1
0
Fork 0
forked from Simnation/Main
Main/resources/[jobs]/[mechanic]/rtx_carlift/html/gizmoapi.js
2025-08-13 21:09:54 +02:00

3220 lines
1 MiB

function JD(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if(r!=="default"&&!(r in n)){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const eO=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}};eO();var Eo=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},te={exports:{}},Tt={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var rd=Symbol.for("react.element"),tO=Symbol.for("react.portal"),nO=Symbol.for("react.fragment"),rO=Symbol.for("react.strict_mode"),iO=Symbol.for("react.profiler"),sO=Symbol.for("react.provider"),oO=Symbol.for("react.context"),aO=Symbol.for("react.forward_ref"),lO=Symbol.for("react.suspense"),uO=Symbol.for("react.memo"),cO=Symbol.for("react.lazy"),JM=Symbol.iterator;function fO(n){return n===null||typeof n!="object"?null:(n=JM&&n[JM]||n["@@iterator"],typeof n=="function"?n:null)}var kC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zC=Object.assign,FC={};function Uu(n,e,t){this.props=n,this.context=e,this.refs=FC,this.updater=t||kC}Uu.prototype.isReactComponent={};Uu.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};Uu.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function UC(){}UC.prototype=Uu.prototype;function r1(n,e,t){this.props=n,this.context=e,this.refs=FC,this.updater=t||kC}var i1=r1.prototype=new UC;i1.constructor=r1;zC(i1,Uu.prototype);i1.isPureReactComponent=!0;var eb=Array.isArray,BC=Object.prototype.hasOwnProperty,s1={current:null},VC={key:!0,ref:!0,__self:!0,__source:!0};function GC(n,e,t){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)BC.call(e,r)&&!VC.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=t;else if(1<a){for(var c=Array(a),f=0;f<a;f++)c[f]=arguments[f+2];i.children=c}if(n&&n.defaultProps)for(r in a=n.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:rd,type:n,key:s,ref:o,props:i,_owner:s1.current}}function dO(n,e){return{$$typeof:rd,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function o1(n){return typeof n=="object"&&n!==null&&n.$$typeof===rd}function hO(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var tb=/\/+/g;function Av(n,e){return typeof n=="object"&&n!==null&&n.key!=null?hO(""+n.key):e.toString(36)}function $p(n,e,t,r,i){var s=typeof n;(s==="undefined"||s==="boolean")&&(n=null);var o=!1;if(n===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(n.$$typeof){case rd:case tO:o=!0}}if(o)return o=n,i=i(o),n=r===""?"."+Av(o,0):r,eb(i)?(t="",n!=null&&(t=n.replace(tb,"$&/")+"/"),$p(i,e,t,"",function(f){return f})):i!=null&&(o1(i)&&(i=dO(i,t+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(tb,"$&/")+"/")+n)),e.push(i)),1;if(o=0,r=r===""?".":r+":",eb(n))for(var a=0;a<n.length;a++){s=n[a];var c=r+Av(s,a);o+=$p(s,e,t,c,i)}else if(c=fO(n),typeof c=="function")for(n=c.call(n),a=0;!(s=n.next()).done;)s=s.value,c=r+Av(s,a++),o+=$p(s,e,t,c,i);else if(s==="object")throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Lh(n,e,t){if(n==null)return n;var r=[],i=0;return $p(n,r,"","",function(s){return e.call(t,s,i++)}),r}function pO(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var gr={current:null},jp={transition:null},mO={ReactCurrentDispatcher:gr,ReactCurrentBatchConfig:jp,ReactCurrentOwner:s1};Tt.Children={map:Lh,forEach:function(n,e,t){Lh(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return Lh(n,function(){e++}),e},toArray:function(n){return Lh(n,function(e){return e})||[]},only:function(n){if(!o1(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Tt.Component=Uu;Tt.Fragment=nO;Tt.Profiler=iO;Tt.PureComponent=r1;Tt.StrictMode=rO;Tt.Suspense=lO;Tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mO;Tt.cloneElement=function(n,e,t){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var r=zC({},n.props),i=n.key,s=n.ref,o=n._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=s1.current),e.key!==void 0&&(i=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(c in e)BC.call(e,c)&&!VC.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&a!==void 0?a[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=t;else if(1<c){a=Array(c);for(var f=0;f<c;f++)a[f]=arguments[f+2];r.children=a}return{$$typeof:rd,type:n.type,key:i,ref:s,props:r,_owner:o}};Tt.createContext=function(n){return n={$$typeof:oO,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:sO,_context:n},n.Consumer=n};Tt.createElement=GC;Tt.createFactory=function(n){var e=GC.bind(null,n);return e.type=n,e};Tt.createRef=function(){return{current:null}};Tt.forwardRef=function(n){return{$$typeof:aO,render:n}};Tt.isValidElement=o1;Tt.lazy=function(n){return{$$typeof:cO,_payload:{_status:-1,_result:n},_init:pO}};Tt.memo=function(n,e){return{$$typeof:uO,type:n,compare:e===void 0?null:e}};Tt.startTransition=function(n){var e=jp.transition;jp.transition={};try{n()}finally{jp.transition=e}};Tt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Tt.useCallback=function(n,e){return gr.current.useCallback(n,e)};Tt.useContext=function(n){return gr.current.useContext(n)};Tt.useDebugValue=function(){};Tt.useDeferredValue=function(n){return gr.current.useDeferredValue(n)};Tt.useEffect=function(n,e){return gr.current.useEffect(n,e)};Tt.useId=function(){return gr.current.useId()};Tt.useImperativeHandle=function(n,e,t){return gr.current.useImperativeHandle(n,e,t)};Tt.useInsertionEffect=function(n,e){return gr.current.useInsertionEffect(n,e)};Tt.useLayoutEffect=function(n,e){return gr.current.useLayoutEffect(n,e)};Tt.useMemo=function(n,e){return gr.current.useMemo(n,e)};Tt.useReducer=function(n,e,t){return gr.current.useReducer(n,e,t)};Tt.useRef=function(n){return gr.current.useRef(n)};Tt.useState=function(n){return gr.current.useState(n)};Tt.useSyncExternalStore=function(n,e,t){return gr.current.useSyncExternalStore(n,e,t)};Tt.useTransition=function(){return gr.current.useTransition()};Tt.version="18.2.0";te.exports=Tt;var ke=te.exports,o_=JD({__proto__:null,default:ke},[te.exports]),a_={},vg={exports:{}},Zr={},HC={exports:{}},WC={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(n){function e(z,F){var G=z.length;z.push(F);e:for(;0<G;){var Z=G-1>>>1,k=z[Z];if(0<i(k,F))z[Z]=F,z[G]=k,G=Z;else break e}}function t(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var F=z[0],G=z.pop();if(G!==F){z[0]=G;e:for(var Z=0,k=z.length,W=k>>>1;Z<W;){var N=2*(Z+1)-1,me=z[N],X=N+1,Te=z[X];if(0>i(me,G))X<k&&0>i(Te,me)?(z[Z]=Te,z[X]=G,Z=X):(z[Z]=me,z[N]=G,Z=N);else if(X<k&&0>i(Te,G))z[Z]=Te,z[X]=G,Z=X;else break e}}return F}function i(z,F){var G=z.sortIndex-F.sortIndex;return G!==0?G:z.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var c=[],f=[],d=1,h=null,p=3,g=!1,v=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(z){for(var F=t(f);F!==null;){if(F.callback===null)r(f);else if(F.startTime<=z)r(f),F.sortIndex=F.expirationTime,e(c,F);else break;F=t(f)}}function E(z){if(y=!1,M(z),!v)if(t(c)!==null)v=!0,le(C);else{var F=t(f);F!==null&&pe(E,F.startTime-z)}}function C(z,F){v=!1,y&&(y=!1,w(T),T=-1),g=!0;var G=p;try{for(M(F),h=t(c);h!==null&&(!(h.expirationTime>F)||z&&!Y());){var Z=h.callback;if(typeof Z=="function"){h.callback=null,p=h.priorityLevel;var k=Z(h.expirationTime<=F);F=n.unstable_now(),typeof k=="function"?h.callback=k:h===t(c)&&r(c),M(F)}else r(c);h=t(c)}if(h!==null)var W=!0;else{var N=t(f);N!==null&&pe(E,N.startTime-F),W=!1}return W}finally{h=null,p=G,g=!1}}var P=!1,R=null,T=-1,L=5,D=-1;function Y(){return!(n.unstable_now()-D<L)}function fe(){if(R!==null){var z=n.unstable_now();D=z;var F=!0;try{F=R(!0,z)}finally{F?q():(P=!1,R=null)}}else P=!1}var q;if(typeof _=="function")q=function(){_(fe)};else if(typeof MessageChannel!="undefined"){var $=new MessageChannel,se=$.port2;$.port1.onmessage=fe,q=function(){se.postMessage(null)}}else q=function(){x(fe,0)};function le(z){R=z,P||(P=!0,q())}function pe(z,F){T=x(function(){z(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(z){z.callback=null},n.unstable_continueExecution=function(){v||g||(v=!0,le(C))},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(c)},n.unstable_next=function(z){switch(p){case 1:case 2:case 3:var F=3;break;default:F=p}var G=p;p=F;try{return z()}finally{p=G}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(z,F){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var G=p;p=z;try{return F()}finally{p=G}},n.unstable_scheduleCallback=function(z,F,G){var Z=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Z+G:Z):G=Z,z){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=G+k,z={id:d++,callback:F,priorityLevel:z,startTime:G,expirationTime:k,sortIndex:-1},G>Z?(z.sortIndex=G,e(f,z),t(c)===null&&z===t(f)&&(y?(w(T),T=-1):y=!0,pe(E,G-Z))):(z.sortIndex=k,e(c,z),v||g||(v=!0,le(C))),z},n.unstable_shouldYield=Y,n.unstable_wrapCallback=function(z){var F=p;return function(){var G=p;p=F;try{return z.apply(this,arguments)}finally{p=G}}}})(WC);HC.exports=WC;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var $C=te.exports,Yr=HC.exports;function Re(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var jC=new Set,vf={};function rl(n,e){Mu(n,e),Mu(n+"Capture",e)}function Mu(n,e){for(vf[n]=e,n=0;n<e.length;n++)jC.add(e[n])}var Hs=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),l_=Object.prototype.hasOwnProperty,gO=/^[: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]*$/,nb={},rb={};function vO(n){return l_.call(rb,n)?!0:l_.call(nb,n)?!1:gO.test(n)?rb[n]=!0:(nb[n]=!0,!1)}function yO(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function _O(n,e,t,r){if(e===null||typeof e=="undefined"||yO(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function vr(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Yn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Yn[n]=new vr(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Yn[e]=new vr(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Yn[n]=new vr(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Yn[n]=new vr(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Yn[n]=new vr(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Yn[n]=new vr(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Yn[n]=new vr(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Yn[n]=new vr(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Yn[n]=new vr(n,5,!1,n.toLowerCase(),null,!1,!1)});var a1=/[\-:]([a-z])/g;function l1(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(a1,l1);Yn[e]=new vr(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(a1,l1);Yn[e]=new vr(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(a1,l1);Yn[e]=new vr(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Yn[n]=new vr(n,1,!1,n.toLowerCase(),null,!1,!1)});Yn.xlinkHref=new vr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Yn[n]=new vr(n,1,!1,n.toLowerCase(),null,!0,!0)});function u1(n,e,t,r){var i=Yn.hasOwnProperty(e)?Yn[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(_O(e,t,i,r)&&(t=null),r||i===null?vO(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):i.mustUseProperty?n[i.propertyName]=t===null?i.type===3?!1:"":t:(e=i.attributeName,r=i.attributeNamespace,t===null?n.removeAttribute(e):(i=i.type,t=i===3||i===4&&t===!0?"":""+t,r?n.setAttributeNS(r,e,t):n.setAttribute(e,t))))}var qs=$C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ih=Symbol.for("react.element"),Kl=Symbol.for("react.portal"),Jl=Symbol.for("react.fragment"),c1=Symbol.for("react.strict_mode"),u_=Symbol.for("react.profiler"),XC=Symbol.for("react.provider"),YC=Symbol.for("react.context"),f1=Symbol.for("react.forward_ref"),c_=Symbol.for("react.suspense"),f_=Symbol.for("react.suspense_list"),d1=Symbol.for("react.memo"),_o=Symbol.for("react.lazy"),qC=Symbol.for("react.offscreen"),ib=Symbol.iterator;function vc(n){return n===null||typeof n!="object"?null:(n=ib&&n[ib]||n["@@iterator"],typeof n=="function"?n:null)}var dn=Object.assign,Pv;function Xc(n){if(Pv===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);Pv=e&&e[1]||""}return`
`+Pv+n}var Rv=!1;function Lv(n,e){if(!n||Rv)return"";Rv=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(f){var r=f}Reflect.construct(n,[],e)}else{try{e.call()}catch(f){r=f}n.call(e.prototype)}else{try{throw Error()}catch(f){r=f}n()}}catch(f){if(f&&r&&typeof f.stack=="string"){for(var i=f.stack.split(`
`),s=r.stack.split(`
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var c=`
`+i[o].replace(" at new "," at ");return n.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",n.displayName)),c}while(1<=o&&0<=a);break}}}finally{Rv=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Xc(n):""}function xO(n){switch(n.tag){case 5:return Xc(n.type);case 16:return Xc("Lazy");case 13:return Xc("Suspense");case 19:return Xc("SuspenseList");case 0:case 2:case 15:return n=Lv(n.type,!1),n;case 11:return n=Lv(n.type.render,!1),n;case 1:return n=Lv(n.type,!0),n;default:return""}}function d_(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Jl:return"Fragment";case Kl:return"Portal";case u_:return"Profiler";case c1:return"StrictMode";case c_:return"Suspense";case f_:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case YC:return(n.displayName||"Context")+".Consumer";case XC:return(n._context.displayName||"Context")+".Provider";case f1:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case d1:return e=n.displayName||null,e!==null?e:d_(n.type)||"Memo";case _o:e=n._payload,n=n._init;try{return d_(n(e))}catch{}}return null}function SO(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return d_(e);case 8:return e===c1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Uo(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ZC(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function wO(n){var e=ZC(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Nh(n){n._valueTracker||(n._valueTracker=wO(n))}function QC(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=ZC(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function gm(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch{return n.body}}function h_(n,e){var t=e.checked;return dn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:n._wrapperState.initialChecked})}function sb(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=Uo(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function KC(n,e){e=e.checked,e!=null&&u1(n,"checked",e,!1)}function p_(n,e){KC(n,e);var t=Uo(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?m_(n,e.type,t):e.hasOwnProperty("defaultValue")&&m_(n,e.type,Uo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function ob(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function m_(n,e,t){(e!=="number"||gm(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Yc=Array.isArray;function pu(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i<t.length;i++)e["$"+t[i]]=!0;for(t=0;t<n.length;t++)i=e.hasOwnProperty("$"+n[t].value),n[t].selected!==i&&(n[t].selected=i),i&&r&&(n[t].defaultSelected=!0)}else{for(t=""+Uo(t),e=null,i=0;i<n.length;i++){if(n[i].value===t){n[i].selected=!0,r&&(n[i].defaultSelected=!0);return}e!==null||n[i].disabled||(e=n[i])}e!==null&&(e.selected=!0)}}function g_(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Re(91));return dn({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function ab(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(Re(92));if(Yc(t)){if(1<t.length)throw Error(Re(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:Uo(t)}}function JC(n,e){var t=Uo(e.value),r=Uo(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),r!=null&&(n.defaultValue=""+r)}function lb(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function eA(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function v_(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?eA(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var Dh,tA=function(n){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(e,t,r,i){MSApp.execUnsafeLocalFunction(function(){return n(e,t,r,i)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(Dh=Dh||document.createElement("div"),Dh.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Dh.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function yf(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var ef={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},MO=["Webkit","ms","Moz","O"];Object.keys(ef).forEach(function(n){MO.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),ef[e]=ef[n]})});function nA(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||ef.hasOwnProperty(n)&&ef[n]?(""+e).trim():e+"px"}function rA(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=nA(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var bO=dn({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 y_(n,e){if(e){if(bO[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Re(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Re(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Re(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Re(62))}}function __(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var x_=null;function h1(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var S_=null,mu=null,gu=null;function ub(n){if(n=od(n)){if(typeof S_!="function")throw Error(Re(280));var e=n.stateNode;e&&(e=wg(e),S_(n.stateNode,n.type,e))}}function iA(n){mu?gu?gu.push(n):gu=[n]:mu=n}function sA(){if(mu){var n=mu,e=gu;if(gu=mu=null,ub(n),e)for(n=0;n<e.length;n++)ub(e[n])}}function oA(n,e){return n(e)}function aA(){}var Iv=!1;function lA(n,e,t){if(Iv)return n(e,t);Iv=!0;try{return oA(n,e,t)}finally{Iv=!1,(mu!==null||gu!==null)&&(aA(),sA())}}function _f(n,e){var t=n.stateNode;if(t===null)return null;var r=wg(t);if(r===null)return null;t=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(n=n.type,r=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!r;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(Re(231,e,typeof t));return t}var w_=!1;if(Hs)try{var yc={};Object.defineProperty(yc,"passive",{get:function(){w_=!0}}),window.addEventListener("test",yc,yc),window.removeEventListener("test",yc,yc)}catch{w_=!1}function EO(n,e,t,r,i,s,o,a,c){var f=Array.prototype.slice.call(arguments,3);try{e.apply(t,f)}catch(d){this.onError(d)}}var tf=!1,vm=null,ym=!1,M_=null,TO={onError:function(n){tf=!0,vm=n}};function CO(n,e,t,r,i,s,o,a,c){tf=!1,vm=null,EO.apply(TO,arguments)}function AO(n,e,t,r,i,s,o,a,c){if(CO.apply(this,arguments),tf){if(tf){var f=vm;tf=!1,vm=null}else throw Error(Re(198));ym||(ym=!0,M_=f)}}function il(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,(e.flags&4098)!==0&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function uA(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function cb(n){if(il(n)!==n)throw Error(Re(188))}function PO(n){var e=n.alternate;if(!e){if(e=il(n),e===null)throw Error(Re(188));return e!==n?null:n}for(var t=n,r=e;;){var i=t.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){t=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===t)return cb(i),n;if(s===r)return cb(i),e;s=s.sibling}throw Error(Re(188))}if(t.return!==r.return)t=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===t){o=!0,t=i,r=s;break}if(a===r){o=!0,r=i,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,r=i;break}if(a===r){o=!0,r=s,t=i;break}a=a.sibling}if(!o)throw Error(Re(189))}}if(t.alternate!==r)throw Error(Re(190))}if(t.tag!==3)throw Error(Re(188));return t.stateNode.current===t?n:e}function cA(n){return n=PO(n),n!==null?fA(n):null}function fA(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=fA(n);if(e!==null)return e;n=n.sibling}return null}var dA=Yr.unstable_scheduleCallback,fb=Yr.unstable_cancelCallback,RO=Yr.unstable_shouldYield,LO=Yr.unstable_requestPaint,_n=Yr.unstable_now,IO=Yr.unstable_getCurrentPriorityLevel,p1=Yr.unstable_ImmediatePriority,hA=Yr.unstable_UserBlockingPriority,_m=Yr.unstable_NormalPriority,NO=Yr.unstable_LowPriority,pA=Yr.unstable_IdlePriority,yg=null,as=null;function DO(n){if(as&&typeof as.onCommitFiberRoot=="function")try{as.onCommitFiberRoot(yg,n,void 0,(n.current.flags&128)===128)}catch{}}var zi=Math.clz32?Math.clz32:zO,OO=Math.log,kO=Math.LN2;function zO(n){return n>>>=0,n===0?32:31-(OO(n)/kO|0)|0}var Oh=64,kh=4194304;function qc(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function xm(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=qc(a):(s&=o,s!==0&&(r=qc(s)))}else o=t&~i,o!==0?r=qc(o):s!==0&&(r=qc(s));if(r===0)return 0;if(e!==0&&e!==r&&(e&i)===0&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if((r&4)!==0&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0<e;)t=31-zi(e),i=1<<t,r|=n[t],e&=~i;return r}function FO(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function UO(n,e){for(var t=n.suspendedLanes,r=n.pingedLanes,i=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-zi(s),a=1<<o,c=i[o];c===-1?((a&t)===0||(a&r)!==0)&&(i[o]=FO(a,e)):c<=e&&(n.expiredLanes|=a),s&=~a}}function b_(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function mA(){var n=Oh;return Oh<<=1,(Oh&4194240)===0&&(Oh=64),n}function Nv(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function id(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-zi(e),n[e]=t}function BO(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0<t;){var i=31-zi(t),s=1<<i;e[i]=0,r[i]=-1,n[i]=-1,t&=~s}}function m1(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var r=31-zi(t),i=1<<r;i&e|n[r]&e&&(n[r]|=e),t&=~i}}var Wt=0;function gA(n){return n&=-n,1<n?4<n?(n&268435455)!==0?16:536870912:4:1}var vA,g1,yA,_A,xA,E_=!1,zh=[],Ro=null,Lo=null,Io=null,xf=new Map,Sf=new Map,Mo=[],VO="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 db(n,e){switch(n){case"focusin":case"focusout":Ro=null;break;case"dragenter":case"dragleave":Lo=null;break;case"mouseover":case"mouseout":Io=null;break;case"pointerover":case"pointerout":xf.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sf.delete(e.pointerId)}}function _c(n,e,t,r,i,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=od(e),e!==null&&g1(e)),n):(n.eventSystemFlags|=r,e=n.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),n)}function GO(n,e,t,r,i){switch(e){case"focusin":return Ro=_c(Ro,n,e,t,r,i),!0;case"dragenter":return Lo=_c(Lo,n,e,t,r,i),!0;case"mouseover":return Io=_c(Io,n,e,t,r,i),!0;case"pointerover":var s=i.pointerId;return xf.set(s,_c(xf.get(s)||null,n,e,t,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Sf.set(s,_c(Sf.get(s)||null,n,e,t,r,i)),!0}return!1}function SA(n){var e=ba(n.target);if(e!==null){var t=il(e);if(t!==null){if(e=t.tag,e===13){if(e=uA(t),e!==null){n.blockedOn=e,xA(n.priority,function(){yA(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Xp(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=T_(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var r=new t.constructor(t.type,t);x_=r,t.target.dispatchEvent(r),x_=null}else return e=od(t),e!==null&&g1(e),n.blockedOn=t,!1;e.shift()}return!0}function hb(n,e,t){Xp(n)&&t.delete(e)}function HO(){E_=!1,Ro!==null&&Xp(Ro)&&(Ro=null),Lo!==null&&Xp(Lo)&&(Lo=null),Io!==null&&Xp(Io)&&(Io=null),xf.forEach(hb),Sf.forEach(hb)}function xc(n,e){n.blockedOn===e&&(n.blockedOn=null,E_||(E_=!0,Yr.unstable_scheduleCallback(Yr.unstable_NormalPriority,HO)))}function wf(n){function e(i){return xc(i,n)}if(0<zh.length){xc(zh[0],n);for(var t=1;t<zh.length;t++){var r=zh[t];r.blockedOn===n&&(r.blockedOn=null)}}for(Ro!==null&&xc(Ro,n),Lo!==null&&xc(Lo,n),Io!==null&&xc(Io,n),xf.forEach(e),Sf.forEach(e),t=0;t<Mo.length;t++)r=Mo[t],r.blockedOn===n&&(r.blockedOn=null);for(;0<Mo.length&&(t=Mo[0],t.blockedOn===null);)SA(t),t.blockedOn===null&&Mo.shift()}var vu=qs.ReactCurrentBatchConfig,Sm=!0;function WO(n,e,t,r){var i=Wt,s=vu.transition;vu.transition=null;try{Wt=1,v1(n,e,t,r)}finally{Wt=i,vu.transition=s}}function $O(n,e,t,r){var i=Wt,s=vu.transition;vu.transition=null;try{Wt=4,v1(n,e,t,r)}finally{Wt=i,vu.transition=s}}function v1(n,e,t,r){if(Sm){var i=T_(n,e,t,r);if(i===null)Hv(n,e,r,wm,t),db(n,r);else if(GO(i,n,e,t,r))r.stopPropagation();else if(db(n,r),e&4&&-1<VO.indexOf(n)){for(;i!==null;){var s=od(i);if(s!==null&&vA(s),s=T_(n,e,t,r),s===null&&Hv(n,e,r,wm,t),s===i)break;i=s}i!==null&&r.stopPropagation()}else Hv(n,e,r,null,t)}}var wm=null;function T_(n,e,t,r){if(wm=null,n=h1(r),n=ba(n),n!==null)if(e=il(n),e===null)n=null;else if(t=e.tag,t===13){if(n=uA(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return wm=n,null}function wA(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(IO()){case p1:return 1;case hA:return 4;case _m:case NO:return 16;case pA:return 536870912;default:return 16}default:return 16}}var To=null,y1=null,Yp=null;function MA(){if(Yp)return Yp;var n,e=y1,t=e.length,r,i="value"in To?To.value:To.textContent,s=i.length;for(n=0;n<t&&e[n]===i[n];n++);var o=t-n;for(r=1;r<=o&&e[t-r]===i[s-r];r++);return Yp=i.slice(n,1<r?1-r:void 0)}function qp(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function Fh(){return!0}function pb(){return!1}function Qr(n){function e(t,r,i,s,o){this._reactName=t,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Fh:pb,this.isPropagationStopped=pb,this}return dn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=Fh)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=Fh)},persist:function(){},isPersistent:Fh}),e}var Bu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_1=Qr(Bu),sd=dn({},Bu,{view:0,detail:0}),jO=Qr(sd),Dv,Ov,Sc,_g=dn({},sd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:x1,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Sc&&(Sc&&n.type==="mousemove"?(Dv=n.screenX-Sc.screenX,Ov=n.screenY-Sc.screenY):Ov=Dv=0,Sc=n),Dv)},movementY:function(n){return"movementY"in n?n.movementY:Ov}}),mb=Qr(_g),XO=dn({},_g,{dataTransfer:0}),YO=Qr(XO),qO=dn({},sd,{relatedTarget:0}),kv=Qr(qO),ZO=dn({},Bu,{animationName:0,elapsedTime:0,pseudoElement:0}),QO=Qr(ZO),KO=dn({},Bu,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),JO=Qr(KO),ek=dn({},Bu,{data:0}),gb=Qr(ek),tk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nk={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"},rk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ik(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=rk[n])?!!e[n]:!1}function x1(){return ik}var sk=dn({},sd,{key:function(n){if(n.key){var e=tk[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=qp(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?nk[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:x1,charCode:function(n){return n.type==="keypress"?qp(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?qp(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),ok=Qr(sk),ak=dn({},_g,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vb=Qr(ak),lk=dn({},sd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:x1}),uk=Qr(lk),ck=dn({},Bu,{propertyName:0,elapsedTime:0,pseudoElement:0}),fk=Qr(ck),dk=dn({},_g,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),hk=Qr(dk),pk=[9,13,27,32],S1=Hs&&"CompositionEvent"in window,nf=null;Hs&&"documentMode"in document&&(nf=document.documentMode);var mk=Hs&&"TextEvent"in window&&!nf,bA=Hs&&(!S1||nf&&8<nf&&11>=nf),yb=String.fromCharCode(32),_b=!1;function EA(n,e){switch(n){case"keyup":return pk.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function TA(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var eu=!1;function gk(n,e){switch(n){case"compositionend":return TA(e);case"keypress":return e.which!==32?null:(_b=!0,yb);case"textInput":return n=e.data,n===yb&&_b?null:n;default:return null}}function vk(n,e){if(eu)return n==="compositionend"||!S1&&EA(n,e)?(n=MA(),Yp=y1=To=null,eu=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return bA&&e.locale!=="ko"?null:e.data;default:return null}}var yk={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 xb(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!yk[n.type]:e==="textarea"}function CA(n,e,t,r){iA(r),e=Mm(e,"onChange"),0<e.length&&(t=new _1("onChange","change",null,t,r),n.push({event:t,listeners:e}))}var rf=null,Mf=null;function _k(n){FA(n,0)}function xg(n){var e=ru(n);if(QC(e))return n}function xk(n,e){if(n==="change")return e}var AA=!1;if(Hs){var zv;if(Hs){var Fv="oninput"in document;if(!Fv){var Sb=document.createElement("div");Sb.setAttribute("oninput","return;"),Fv=typeof Sb.oninput=="function"}zv=Fv}else zv=!1;AA=zv&&(!document.documentMode||9<document.documentMode)}function wb(){rf&&(rf.detachEvent("onpropertychange",PA),Mf=rf=null)}function PA(n){if(n.propertyName==="value"&&xg(Mf)){var e=[];CA(e,Mf,n,h1(n)),lA(_k,e)}}function Sk(n,e,t){n==="focusin"?(wb(),rf=e,Mf=t,rf.attachEvent("onpropertychange",PA)):n==="focusout"&&wb()}function wk(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return xg(Mf)}function Mk(n,e){if(n==="click")return xg(e)}function bk(n,e){if(n==="input"||n==="change")return xg(e)}function Ek(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Bi=typeof Object.is=="function"?Object.is:Ek;function bf(n,e){if(Bi(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(r=0;r<t.length;r++){var i=t[r];if(!l_.call(e,i)||!Bi(n[i],e[i]))return!1}return!0}function Mb(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function bb(n,e){var t=Mb(n);n=0;for(var r;t;){if(t.nodeType===3){if(r=n+t.textContent.length,n<=e&&r>=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Mb(t)}}function RA(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?RA(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function LA(){for(var n=window,e=gm();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=gm(n.document)}return e}function w1(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function Tk(n){var e=LA(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&RA(t.ownerDocument.documentElement,t)){if(r!==null&&w1(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=bb(t,s);var o=bb(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var Ck=Hs&&"documentMode"in document&&11>=document.documentMode,tu=null,C_=null,sf=null,A_=!1;function Eb(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;A_||tu==null||tu!==gm(r)||(r=tu,"selectionStart"in r&&w1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),sf&&bf(sf,r)||(sf=r,r=Mm(C_,"onSelect"),0<r.length&&(e=new _1("onSelect","select",null,e,t),n.push({event:e,listeners:r}),e.target=tu)))}function Uh(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var nu={animationend:Uh("Animation","AnimationEnd"),animationiteration:Uh("Animation","AnimationIteration"),animationstart:Uh("Animation","AnimationStart"),transitionend:Uh("Transition","TransitionEnd")},Uv={},IA={};Hs&&(IA=document.createElement("div").style,"AnimationEvent"in window||(delete nu.animationend.animation,delete nu.animationiteration.animation,delete nu.animationstart.animation),"TransitionEvent"in window||delete nu.transitionend.transition);function Sg(n){if(Uv[n])return Uv[n];if(!nu[n])return n;var e=nu[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in IA)return Uv[n]=e[t];return n}var NA=Sg("animationend"),DA=Sg("animationiteration"),OA=Sg("animationstart"),kA=Sg("transitionend"),zA=new Map,Tb="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 $o(n,e){zA.set(n,e),rl(e,[n])}for(var Bv=0;Bv<Tb.length;Bv++){var Vv=Tb[Bv],Ak=Vv.toLowerCase(),Pk=Vv[0].toUpperCase()+Vv.slice(1);$o(Ak,"on"+Pk)}$o(NA,"onAnimationEnd");$o(DA,"onAnimationIteration");$o(OA,"onAnimationStart");$o("dblclick","onDoubleClick");$o("focusin","onFocus");$o("focusout","onBlur");$o(kA,"onTransitionEnd");Mu("onMouseEnter",["mouseout","mouseover"]);Mu("onMouseLeave",["mouseout","mouseover"]);Mu("onPointerEnter",["pointerout","pointerover"]);Mu("onPointerLeave",["pointerout","pointerover"]);rl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));rl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));rl("onBeforeInput",["compositionend","keypress","textInput","paste"]);rl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));rl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));rl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zc="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(" "),Rk=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zc));function Cb(n,e,t){var r=n.type||"unknown-event";n.currentTarget=t,AO(r,e,void 0,n),n.currentTarget=null}function FA(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var r=n[t],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,f=a.currentTarget;if(a=a.listener,c!==s&&i.isPropagationStopped())break e;Cb(i,a,f),s=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,f=a.currentTarget,a=a.listener,c!==s&&i.isPropagationStopped())break e;Cb(i,a,f),s=c}}}if(ym)throw n=M_,ym=!1,M_=null,n}function Qt(n,e){var t=e[N_];t===void 0&&(t=e[N_]=new Set);var r=n+"__bubble";t.has(r)||(UA(e,n,2,!1),t.add(r))}function Gv(n,e,t){var r=0;e&&(r|=4),UA(t,n,r,e)}var Bh="_reactListening"+Math.random().toString(36).slice(2);function Ef(n){if(!n[Bh]){n[Bh]=!0,jC.forEach(function(t){t!=="selectionchange"&&(Rk.has(t)||Gv(t,!1,n),Gv(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[Bh]||(e[Bh]=!0,Gv("selectionchange",!1,e))}}function UA(n,e,t,r){switch(wA(e)){case 1:var i=WO;break;case 4:i=$O;break;default:i=v1}t=i.bind(null,e,t,n),i=void 0,!w_||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?n.addEventListener(e,t,{capture:!0,passive:i}):n.addEventListener(e,t,!0):i!==void 0?n.addEventListener(e,t,{passive:i}):n.addEventListener(e,t,!1)}function Hv(n,e,t,r,i){var s=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;a!==null;){if(o=ba(a),o===null)return;if(c=o.tag,c===5||c===6){r=s=o;continue e}a=a.parentNode}}r=r.return}lA(function(){var f=s,d=h1(t),h=[];e:{var p=zA.get(n);if(p!==void 0){var g=_1,v=n;switch(n){case"keypress":if(qp(t)===0)break e;case"keydown":case"keyup":g=ok;break;case"focusin":v="focus",g=kv;break;case"focusout":v="blur",g=kv;break;case"beforeblur":case"afterblur":g=kv;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=mb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=YO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=uk;break;case NA:case DA:case OA:g=QO;break;case kA:g=fk;break;case"scroll":g=jO;break;case"wheel":g=hk;break;case"copy":case"cut":case"paste":g=JO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=vb}var y=(e&4)!==0,x=!y&&n==="scroll",w=y?p!==null?p+"Capture":null:p;y=[];for(var _=f,M;_!==null;){M=_;var E=M.stateNode;if(M.tag===5&&E!==null&&(M=E,w!==null&&(E=_f(_,w),E!=null&&y.push(Tf(_,E,M)))),x)break;_=_.return}0<y.length&&(p=new g(p,v,null,t,d),h.push({event:p,listeners:y}))}}if((e&7)===0){e:{if(p=n==="mouseover"||n==="pointerover",g=n==="mouseout"||n==="pointerout",p&&t!==x_&&(v=t.relatedTarget||t.fromElement)&&(ba(v)||v[Ws]))break e;if((g||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,g?(v=t.relatedTarget||t.toElement,g=f,v=v?ba(v):null,v!==null&&(x=il(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(g=null,v=f),g!==v)){if(y=mb,E="onMouseLeave",w="onMouseEnter",_="mouse",(n==="pointerout"||n==="pointerover")&&(y=vb,E="onPointerLeave",w="onPointerEnter",_="pointer"),x=g==null?p:ru(g),M=v==null?p:ru(v),p=new y(E,_+"leave",g,t,d),p.target=x,p.relatedTarget=M,E=null,ba(d)===f&&(y=new y(w,_+"enter",v,t,d),y.target=M,y.relatedTarget=x,E=y),x=E,g&&v)t:{for(y=g,w=v,_=0,M=y;M;M=Cl(M))_++;for(M=0,E=w;E;E=Cl(E))M++;for(;0<_-M;)y=Cl(y),_--;for(;0<M-_;)w=Cl(w),M--;for(;_--;){if(y===w||w!==null&&y===w.alternate)break t;y=Cl(y),w=Cl(w)}y=null}else y=null;g!==null&&Ab(h,p,g,y,!1),v!==null&&x!==null&&Ab(h,x,v,y,!0)}}e:{if(p=f?ru(f):window,g=p.nodeName&&p.nodeName.toLowerCase(),g==="select"||g==="input"&&p.type==="file")var C=xk;else if(xb(p))if(AA)C=bk;else{C=wk;var P=Sk}else(g=p.nodeName)&&g.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(C=Mk);if(C&&(C=C(n,f))){CA(h,C,t,d);break e}P&&P(n,p,f),n==="focusout"&&(P=p._wrapperState)&&P.controlled&&p.type==="number"&&m_(p,"number",p.value)}switch(P=f?ru(f):window,n){case"focusin":(xb(P)||P.contentEditable==="true")&&(tu=P,C_=f,sf=null);break;case"focusout":sf=C_=tu=null;break;case"mousedown":A_=!0;break;case"contextmenu":case"mouseup":case"dragend":A_=!1,Eb(h,t,d);break;case"selectionchange":if(Ck)break;case"keydown":case"keyup":Eb(h,t,d)}var R;if(S1)e:{switch(n){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else eu?EA(n,t)&&(T="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(T="onCompositionStart");T&&(bA&&t.locale!=="ko"&&(eu||T!=="onCompositionStart"?T==="onCompositionEnd"&&eu&&(R=MA()):(To=d,y1="value"in To?To.value:To.textContent,eu=!0)),P=Mm(f,T),0<P.length&&(T=new gb(T,n,null,t,d),h.push({event:T,listeners:P}),R?T.data=R:(R=TA(t),R!==null&&(T.data=R)))),(R=mk?gk(n,t):vk(n,t))&&(f=Mm(f,"onBeforeInput"),0<f.length&&(d=new gb("onBeforeInput","beforeinput",null,t,d),h.push({event:d,listeners:f}),d.data=R))}FA(h,e)})}function Tf(n,e,t){return{instance:n,listener:e,currentTarget:t}}function Mm(n,e){for(var t=e+"Capture",r=[];n!==null;){var i=n,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=_f(n,t),s!=null&&r.unshift(Tf(n,s,i)),s=_f(n,e),s!=null&&r.push(Tf(n,s,i))),n=n.return}return r}function Cl(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function Ab(n,e,t,r,i){for(var s=e._reactName,o=[];t!==null&&t!==r;){var a=t,c=a.alternate,f=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&f!==null&&(a=f,i?(c=_f(t,s),c!=null&&o.unshift(Tf(t,c,a))):i||(c=_f(t,s),c!=null&&o.push(Tf(t,c,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var Lk=/\r\n?/g,Ik=/\u0000|\uFFFD/g;function Pb(n){return(typeof n=="string"?n:""+n).replace(Lk,`
`).replace(Ik,"")}function Vh(n,e,t){if(e=Pb(e),Pb(n)!==e&&t)throw Error(Re(425))}function bm(){}var P_=null,R_=null;function L_(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var I_=typeof setTimeout=="function"?setTimeout:void 0,Nk=typeof clearTimeout=="function"?clearTimeout:void 0,Rb=typeof Promise=="function"?Promise:void 0,Dk=typeof queueMicrotask=="function"?queueMicrotask:typeof Rb!="undefined"?function(n){return Rb.resolve(null).then(n).catch(Ok)}:I_;function Ok(n){setTimeout(function(){throw n})}function Wv(n,e){var t=e,r=0;do{var i=t.nextSibling;if(n.removeChild(t),i&&i.nodeType===8)if(t=i.data,t==="/$"){if(r===0){n.removeChild(i),wf(e);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=i}while(t);wf(e)}function No(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function Lb(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var Vu=Math.random().toString(36).slice(2),ss="__reactFiber$"+Vu,Cf="__reactProps$"+Vu,Ws="__reactContainer$"+Vu,N_="__reactEvents$"+Vu,kk="__reactListeners$"+Vu,zk="__reactHandles$"+Vu;function ba(n){var e=n[ss];if(e)return e;for(var t=n.parentNode;t;){if(e=t[Ws]||t[ss]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=Lb(n);n!==null;){if(t=n[ss])return t;n=Lb(n)}return e}n=t,t=n.parentNode}return null}function od(n){return n=n[ss]||n[Ws],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function ru(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(Re(33))}function wg(n){return n[Cf]||null}var D_=[],iu=-1;function jo(n){return{current:n}}function Jt(n){0>iu||(n.current=D_[iu],D_[iu]=null,iu--)}function Zt(n,e){iu++,D_[iu]=n.current,n.current=e}var Bo={},ar=jo(Bo),Cr=jo(!1),Ha=Bo;function bu(n,e){var t=n.type.contextTypes;if(!t)return Bo;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function Ar(n){return n=n.childContextTypes,n!=null}function Em(){Jt(Cr),Jt(ar)}function Ib(n,e,t){if(ar.current!==Bo)throw Error(Re(168));Zt(ar,e),Zt(Cr,t)}function BA(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Re(108,SO(n)||"Unknown",i));return dn({},t,r)}function Tm(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Bo,Ha=ar.current,Zt(ar,n),Zt(Cr,Cr.current),!0}function Nb(n,e,t){var r=n.stateNode;if(!r)throw Error(Re(169));t?(n=BA(n,e,Ha),r.__reactInternalMemoizedMergedChildContext=n,Jt(Cr),Jt(ar),Zt(ar,n)):Jt(Cr),Zt(Cr,t)}var Os=null,Mg=!1,$v=!1;function VA(n){Os===null?Os=[n]:Os.push(n)}function Fk(n){Mg=!0,VA(n)}function Xo(){if(!$v&&Os!==null){$v=!0;var n=0,e=Wt;try{var t=Os;for(Wt=1;n<t.length;n++){var r=t[n];do r=r(!0);while(r!==null)}Os=null,Mg=!1}catch(i){throw Os!==null&&(Os=Os.slice(n+1)),dA(p1,Xo),i}finally{Wt=e,$v=!1}}return null}var su=[],ou=0,Cm=null,Am=0,mi=[],gi=0,Wa=null,zs=1,Fs="";function ga(n,e){su[ou++]=Am,su[ou++]=Cm,Cm=n,Am=e}function GA(n,e,t){mi[gi++]=zs,mi[gi++]=Fs,mi[gi++]=Wa,Wa=n;var r=zs;n=Fs;var i=32-zi(r)-1;r&=~(1<<i),t+=1;var s=32-zi(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,zs=1<<32-zi(e)+i|t<<i|r,Fs=s+n}else zs=1<<s|t<<i|r,Fs=n}function M1(n){n.return!==null&&(ga(n,1),GA(n,1,0))}function b1(n){for(;n===Cm;)Cm=su[--ou],su[ou]=null,Am=su[--ou],su[ou]=null;for(;n===Wa;)Wa=mi[--gi],mi[gi]=null,Fs=mi[--gi],mi[gi]=null,zs=mi[--gi],mi[gi]=null}var Wr=null,Hr=null,rn=!1,Di=null;function HA(n,e){var t=yi(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function Db(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,Wr=n,Hr=No(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,Wr=n,Hr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=Wa!==null?{id:zs,overflow:Fs}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=yi(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,Wr=n,Hr=null,!0):!1;default:return!1}}function O_(n){return(n.mode&1)!==0&&(n.flags&128)===0}function k_(n){if(rn){var e=Hr;if(e){var t=e;if(!Db(n,e)){if(O_(n))throw Error(Re(418));e=No(t.nextSibling);var r=Wr;e&&Db(n,e)?HA(r,t):(n.flags=n.flags&-4097|2,rn=!1,Wr=n)}}else{if(O_(n))throw Error(Re(418));n.flags=n.flags&-4097|2,rn=!1,Wr=n}}}function Ob(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;Wr=n}function Gh(n){if(n!==Wr)return!1;if(!rn)return Ob(n),rn=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!L_(n.type,n.memoizedProps)),e&&(e=Hr)){if(O_(n))throw WA(),Error(Re(418));for(;e;)HA(n,e),e=No(e.nextSibling)}if(Ob(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Re(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Hr=No(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Hr=null}}else Hr=Wr?No(n.stateNode.nextSibling):null;return!0}function WA(){for(var n=Hr;n;)n=No(n.nextSibling)}function Eu(){Hr=Wr=null,rn=!1}function E1(n){Di===null?Di=[n]:Di.push(n)}var Uk=qs.ReactCurrentBatchConfig;function Ii(n,e){if(n&&n.defaultProps){e=dn({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var Pm=jo(null),Rm=null,au=null,T1=null;function C1(){T1=au=Rm=null}function A1(n){var e=Pm.current;Jt(Pm),n._currentValue=e}function z_(n,e,t){for(;n!==null;){var r=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),n===t)break;n=n.return}}function yu(n,e){Rm=n,T1=au=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&e)!==0&&(Er=!0),n.firstContext=null)}function Si(n){var e=n._currentValue;if(T1!==n)if(n={context:n,memoizedValue:e,next:null},au===null){if(Rm===null)throw Error(Re(308));au=n,Rm.dependencies={lanes:0,firstContext:n}}else au=au.next=n;return e}var Ea=null;function P1(n){Ea===null?Ea=[n]:Ea.push(n)}function $A(n,e,t,r){var i=e.interleaved;return i===null?(t.next=t,P1(e)):(t.next=i.next,i.next=t),e.interleaved=t,$s(n,r)}function $s(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var xo=!1;function R1(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jA(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Vs(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Do(n,e,t){var r=n.updateQueue;if(r===null)return null;if(r=r.shared,(It&2)!==0){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,$s(n,t)}return i=r.interleaved,i===null?(e.next=e,P1(r)):(e.next=i.next,i.next=e),r.interleaved=e,$s(n,t)}function Zp(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,m1(n,t)}}function kb(n,e){var t=n.updateQueue,r=n.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var i=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?i=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?i=s=e:s=s.next=e}else i=s=e;t={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Lm(n,e,t,r){var i=n.updateQueue;xo=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,f=c.next;c.next=null,o===null?s=f:o.next=f,o=c;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=f:a.next=f,d.lastBaseUpdate=c))}if(s!==null){var h=i.baseState;o=0,d=f=c=null,a=s;do{var p=a.lane,g=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=n,y=a;switch(p=e,g=t,y.tag){case 1:if(v=y.payload,typeof v=="function"){h=v.call(g,h,p);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,p=typeof v=="function"?v.call(g,h,p):v,p==null)break e;h=dn({},h,p);break e;case 2:xo=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(f=d=g,c=h):d=d.next=g,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);if(d===null&&(c=h),i.baseState=c,i.firstBaseUpdate=f,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);ja|=o,n.lanes=o,n.memoizedState=h}}function zb(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var r=n[e],i=r.callback;if(i!==null){if(r.callback=null,r=t,typeof i!="function")throw Error(Re(191,i));i.call(r)}}}var XA=new $C.Component().refs;function F_(n,e,t,r){e=n.memoizedState,t=t(r,e),t=t==null?e:dn({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var bg={isMounted:function(n){return(n=n._reactInternals)?il(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var r=mr(),i=ko(n),s=Vs(r,i);s.payload=e,t!=null&&(s.callback=t),e=Do(n,s,i),e!==null&&(Fi(e,n,i,r),Zp(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var r=mr(),i=ko(n),s=Vs(r,i);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=Do(n,s,i),e!==null&&(Fi(e,n,i,r),Zp(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=mr(),r=ko(n),i=Vs(t,r);i.tag=2,e!=null&&(i.callback=e),e=Do(n,i,r),e!==null&&(Fi(e,n,r,t),Zp(e,n,r))}};function Fb(n,e,t,r,i,s,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!bf(t,r)||!bf(i,s):!0}function YA(n,e,t){var r=!1,i=Bo,s=e.contextType;return typeof s=="object"&&s!==null?s=Si(s):(i=Ar(e)?Ha:ar.current,r=e.contextTypes,s=(r=r!=null)?bu(n,i):Bo),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=bg,n.stateNode=e,e._reactInternals=n,r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=s),e}function Ub(n,e,t,r){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,r),e.state!==n&&bg.enqueueReplaceState(e,e.state,null)}function U_(n,e,t,r){var i=n.stateNode;i.props=t,i.state=n.memoizedState,i.refs=XA,R1(n);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Si(s):(s=Ar(e)?Ha:ar.current,i.context=bu(n,s)),i.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(F_(n,e,s,t),i.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&bg.enqueueReplaceState(i,i.state,null),Lm(n,t,i,r),i.state=n.memoizedState),typeof i.componentDidMount=="function"&&(n.flags|=4194308)}function wc(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(Re(309));var r=t.stateNode}if(!r)throw Error(Re(147,n));var i=r,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;a===XA&&(a=i.refs={}),o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(Re(284));if(!t._owner)throw Error(Re(290,n))}return n}function Hh(n,e){throw n=Object.prototype.toString.call(e),Error(Re(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function Bb(n){var e=n._init;return e(n._payload)}function qA(n){function e(w,_){if(n){var M=w.deletions;M===null?(w.deletions=[_],w.flags|=16):M.push(_)}}function t(w,_){if(!n)return null;for(;_!==null;)e(w,_),_=_.sibling;return null}function r(w,_){for(w=new Map;_!==null;)_.key!==null?w.set(_.key,_):w.set(_.index,_),_=_.sibling;return w}function i(w,_){return w=zo(w,_),w.index=0,w.sibling=null,w}function s(w,_,M){return w.index=M,n?(M=w.alternate,M!==null?(M=M.index,M<_?(w.flags|=2,_):M):(w.flags|=2,_)):(w.flags|=1048576,_)}function o(w){return n&&w.alternate===null&&(w.flags|=2),w}function a(w,_,M,E){return _===null||_.tag!==6?(_=Kv(M,w.mode,E),_.return=w,_):(_=i(_,M),_.return=w,_)}function c(w,_,M,E){var C=M.type;return C===Jl?d(w,_,M.props.children,E,M.key):_!==null&&(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===_o&&Bb(C)===_.type)?(E=i(_,M.props),E.ref=wc(w,_,M),E.return=w,E):(E=nm(M.type,M.key,M.props,null,w.mode,E),E.ref=wc(w,_,M),E.return=w,E)}function f(w,_,M,E){return _===null||_.tag!==4||_.stateNode.containerInfo!==M.containerInfo||_.stateNode.implementation!==M.implementation?(_=Jv(M,w.mode,E),_.return=w,_):(_=i(_,M.children||[]),_.return=w,_)}function d(w,_,M,E,C){return _===null||_.tag!==7?(_=Oa(M,w.mode,E,C),_.return=w,_):(_=i(_,M),_.return=w,_)}function h(w,_,M){if(typeof _=="string"&&_!==""||typeof _=="number")return _=Kv(""+_,w.mode,M),_.return=w,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Ih:return M=nm(_.type,_.key,_.props,null,w.mode,M),M.ref=wc(w,null,_),M.return=w,M;case Kl:return _=Jv(_,w.mode,M),_.return=w,_;case _o:var E=_._init;return h(w,E(_._payload),M)}if(Yc(_)||vc(_))return _=Oa(_,w.mode,M,null),_.return=w,_;Hh(w,_)}return null}function p(w,_,M,E){var C=_!==null?_.key:null;if(typeof M=="string"&&M!==""||typeof M=="number")return C!==null?null:a(w,_,""+M,E);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case Ih:return M.key===C?c(w,_,M,E):null;case Kl:return M.key===C?f(w,_,M,E):null;case _o:return C=M._init,p(w,_,C(M._payload),E)}if(Yc(M)||vc(M))return C!==null?null:d(w,_,M,E,null);Hh(w,M)}return null}function g(w,_,M,E,C){if(typeof E=="string"&&E!==""||typeof E=="number")return w=w.get(M)||null,a(_,w,""+E,C);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Ih:return w=w.get(E.key===null?M:E.key)||null,c(_,w,E,C);case Kl:return w=w.get(E.key===null?M:E.key)||null,f(_,w,E,C);case _o:var P=E._init;return g(w,_,M,P(E._payload),C)}if(Yc(E)||vc(E))return w=w.get(M)||null,d(_,w,E,C,null);Hh(_,E)}return null}function v(w,_,M,E){for(var C=null,P=null,R=_,T=_=0,L=null;R!==null&&T<M.length;T++){R.index>T?(L=R,R=null):L=R.sibling;var D=p(w,R,M[T],E);if(D===null){R===null&&(R=L);break}n&&R&&D.alternate===null&&e(w,R),_=s(D,_,T),P===null?C=D:P.sibling=D,P=D,R=L}if(T===M.length)return t(w,R),rn&&ga(w,T),C;if(R===null){for(;T<M.length;T++)R=h(w,M[T],E),R!==null&&(_=s(R,_,T),P===null?C=R:P.sibling=R,P=R);return rn&&ga(w,T),C}for(R=r(w,R);T<M.length;T++)L=g(R,w,T,M[T],E),L!==null&&(n&&L.alternate!==null&&R.delete(L.key===null?T:L.key),_=s(L,_,T),P===null?C=L:P.sibling=L,P=L);return n&&R.forEach(function(Y){return e(w,Y)}),rn&&ga(w,T),C}function y(w,_,M,E){var C=vc(M);if(typeof C!="function")throw Error(Re(150));if(M=C.call(M),M==null)throw Error(Re(151));for(var P=C=null,R=_,T=_=0,L=null,D=M.next();R!==null&&!D.done;T++,D=M.next()){R.index>T?(L=R,R=null):L=R.sibling;var Y=p(w,R,D.value,E);if(Y===null){R===null&&(R=L);break}n&&R&&Y.alternate===null&&e(w,R),_=s(Y,_,T),P===null?C=Y:P.sibling=Y,P=Y,R=L}if(D.done)return t(w,R),rn&&ga(w,T),C;if(R===null){for(;!D.done;T++,D=M.next())D=h(w,D.value,E),D!==null&&(_=s(D,_,T),P===null?C=D:P.sibling=D,P=D);return rn&&ga(w,T),C}for(R=r(w,R);!D.done;T++,D=M.next())D=g(R,w,T,D.value,E),D!==null&&(n&&D.alternate!==null&&R.delete(D.key===null?T:D.key),_=s(D,_,T),P===null?C=D:P.sibling=D,P=D);return n&&R.forEach(function(fe){return e(w,fe)}),rn&&ga(w,T),C}function x(w,_,M,E){if(typeof M=="object"&&M!==null&&M.type===Jl&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case Ih:e:{for(var C=M.key,P=_;P!==null;){if(P.key===C){if(C=M.type,C===Jl){if(P.tag===7){t(w,P.sibling),_=i(P,M.props.children),_.return=w,w=_;break e}}else if(P.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===_o&&Bb(C)===P.type){t(w,P.sibling),_=i(P,M.props),_.ref=wc(w,P,M),_.return=w,w=_;break e}t(w,P);break}else e(w,P);P=P.sibling}M.type===Jl?(_=Oa(M.props.children,w.mode,E,M.key),_.return=w,w=_):(E=nm(M.type,M.key,M.props,null,w.mode,E),E.ref=wc(w,_,M),E.return=w,w=E)}return o(w);case Kl:e:{for(P=M.key;_!==null;){if(_.key===P)if(_.tag===4&&_.stateNode.containerInfo===M.containerInfo&&_.stateNode.implementation===M.implementation){t(w,_.sibling),_=i(_,M.children||[]),_.return=w,w=_;break e}else{t(w,_);break}else e(w,_);_=_.sibling}_=Jv(M,w.mode,E),_.return=w,w=_}return o(w);case _o:return P=M._init,x(w,_,P(M._payload),E)}if(Yc(M))return v(w,_,M,E);if(vc(M))return y(w,_,M,E);Hh(w,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,_!==null&&_.tag===6?(t(w,_.sibling),_=i(_,M),_.return=w,w=_):(t(w,_),_=Kv(M,w.mode,E),_.return=w,w=_),o(w)):t(w,_)}return x}var Tu=qA(!0),ZA=qA(!1),ad={},ls=jo(ad),Af=jo(ad),Pf=jo(ad);function Ta(n){if(n===ad)throw Error(Re(174));return n}function L1(n,e){switch(Zt(Pf,e),Zt(Af,n),Zt(ls,ad),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:v_(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=v_(e,n)}Jt(ls),Zt(ls,e)}function Cu(){Jt(ls),Jt(Af),Jt(Pf)}function QA(n){Ta(Pf.current);var e=Ta(ls.current),t=v_(e,n.type);e!==t&&(Zt(Af,n),Zt(ls,t))}function I1(n){Af.current===n&&(Jt(ls),Jt(Af))}var ln=jo(0);function Im(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var jv=[];function N1(){for(var n=0;n<jv.length;n++)jv[n]._workInProgressVersionPrimary=null;jv.length=0}var Qp=qs.ReactCurrentDispatcher,Xv=qs.ReactCurrentBatchConfig,$a=0,fn=null,Ln=null,Vn=null,Nm=!1,of=!1,Rf=0,Bk=0;function tr(){throw Error(Re(321))}function D1(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!Bi(n[t],e[t]))return!1;return!0}function O1(n,e,t,r,i,s){if($a=s,fn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Qp.current=n===null||n.memoizedState===null?Wk:$k,n=t(r,i),of){s=0;do{if(of=!1,Rf=0,25<=s)throw Error(Re(301));s+=1,Vn=Ln=null,e.updateQueue=null,Qp.current=jk,n=t(r,i)}while(of)}if(Qp.current=Dm,e=Ln!==null&&Ln.next!==null,$a=0,Vn=Ln=fn=null,Nm=!1,e)throw Error(Re(300));return n}function k1(){var n=Rf!==0;return Rf=0,n}function es(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?fn.memoizedState=Vn=n:Vn=Vn.next=n,Vn}function wi(){if(Ln===null){var n=fn.alternate;n=n!==null?n.memoizedState:null}else n=Ln.next;var e=Vn===null?fn.memoizedState:Vn.next;if(e!==null)Vn=e,Ln=n;else{if(n===null)throw Error(Re(310));Ln=n,n={memoizedState:Ln.memoizedState,baseState:Ln.baseState,baseQueue:Ln.baseQueue,queue:Ln.queue,next:null},Vn===null?fn.memoizedState=Vn=n:Vn=Vn.next=n}return Vn}function Lf(n,e){return typeof e=="function"?e(n):e}function Yv(n){var e=wi(),t=e.queue;if(t===null)throw Error(Re(311));t.lastRenderedReducer=n;var r=Ln,i=r.baseQueue,s=t.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,t.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,c=null,f=s;do{var d=f.lane;if(($a&d)===d)c!==null&&(c=c.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),r=f.hasEagerState?f.eagerState:n(r,f.action);else{var h={lane:d,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};c===null?(a=c=h,o=r):c=c.next=h,fn.lanes|=d,ja|=d}f=f.next}while(f!==null&&f!==s);c===null?o=r:c.next=a,Bi(r,e.memoizedState)||(Er=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=c,t.lastRenderedState=r}if(n=t.interleaved,n!==null){i=n;do s=i.lane,fn.lanes|=s,ja|=s,i=i.next;while(i!==n)}else i===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function qv(n){var e=wi(),t=e.queue;if(t===null)throw Error(Re(311));t.lastRenderedReducer=n;var r=t.dispatch,i=t.pending,s=e.memoizedState;if(i!==null){t.pending=null;var o=i=i.next;do s=n(s,o.action),o=o.next;while(o!==i);Bi(s,e.memoizedState)||(Er=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,r]}function KA(){}function JA(n,e){var t=fn,r=wi(),i=e(),s=!Bi(r.memoizedState,i);if(s&&(r.memoizedState=i,Er=!0),r=r.queue,z1(n3.bind(null,t,r,n),[n]),r.getSnapshot!==e||s||Vn!==null&&Vn.memoizedState.tag&1){if(t.flags|=2048,If(9,t3.bind(null,t,r,i,e),void 0,null),Hn===null)throw Error(Re(349));($a&30)!==0||e3(t,e,i)}return i}function e3(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=fn.updateQueue,e===null?(e={lastEffect:null,stores:null},fn.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function t3(n,e,t,r){e.value=t,e.getSnapshot=r,r3(e)&&i3(n)}function n3(n,e,t){return t(function(){r3(e)&&i3(n)})}function r3(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Bi(n,t)}catch{return!0}}function i3(n){var e=$s(n,1);e!==null&&Fi(e,n,1,-1)}function Vb(n){var e=es();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Lf,lastRenderedState:n},e.queue=n,n=n.dispatch=Hk.bind(null,fn,n),[e.memoizedState,n]}function If(n,e,t,r){return n={tag:n,create:e,destroy:t,deps:r,next:null},e=fn.updateQueue,e===null?(e={lastEffect:null,stores:null},fn.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(r=t.next,t.next=n,n.next=r,e.lastEffect=n)),n}function s3(){return wi().memoizedState}function Kp(n,e,t,r){var i=es();fn.flags|=n,i.memoizedState=If(1|e,t,void 0,r===void 0?null:r)}function Eg(n,e,t,r){var i=wi();r=r===void 0?null:r;var s=void 0;if(Ln!==null){var o=Ln.memoizedState;if(s=o.destroy,r!==null&&D1(r,o.deps)){i.memoizedState=If(e,t,s,r);return}}fn.flags|=n,i.memoizedState=If(1|e,t,s,r)}function Gb(n,e){return Kp(8390656,8,n,e)}function z1(n,e){return Eg(2048,8,n,e)}function o3(n,e){return Eg(4,2,n,e)}function a3(n,e){return Eg(4,4,n,e)}function l3(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function u3(n,e,t){return t=t!=null?t.concat([n]):null,Eg(4,4,l3.bind(null,e,n),t)}function F1(){}function c3(n,e){var t=wi();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&D1(e,r[1])?r[0]:(t.memoizedState=[n,e],n)}function f3(n,e){var t=wi();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&D1(e,r[1])?r[0]:(n=n(),t.memoizedState=[n,e],n)}function d3(n,e,t){return($a&21)===0?(n.baseState&&(n.baseState=!1,Er=!0),n.memoizedState=t):(Bi(t,e)||(t=mA(),fn.lanes|=t,ja|=t,n.baseState=!0),e)}function Vk(n,e){var t=Wt;Wt=t!==0&&4>t?t:4,n(!0);var r=Xv.transition;Xv.transition={};try{n(!1),e()}finally{Wt=t,Xv.transition=r}}function h3(){return wi().memoizedState}function Gk(n,e,t){var r=ko(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},p3(n))m3(e,t);else if(t=$A(n,e,t,r),t!==null){var i=mr();Fi(t,n,r,i),g3(t,e,r)}}function Hk(n,e,t){var r=ko(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(p3(n))m3(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(i.hasEagerState=!0,i.eagerState=a,Bi(a,o)){var c=e.interleaved;c===null?(i.next=i,P1(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}t=$A(n,e,i,r),t!==null&&(i=mr(),Fi(t,n,r,i),g3(t,e,r))}}function p3(n){var e=n.alternate;return n===fn||e!==null&&e===fn}function m3(n,e){of=Nm=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function g3(n,e,t){if((t&4194240)!==0){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,m1(n,t)}}var Dm={readContext:Si,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useInsertionEffect:tr,useLayoutEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useMutableSource:tr,useSyncExternalStore:tr,useId:tr,unstable_isNewReconciler:!1},Wk={readContext:Si,useCallback:function(n,e){return es().memoizedState=[n,e===void 0?null:e],n},useContext:Si,useEffect:Gb,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Kp(4194308,4,l3.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Kp(4194308,4,n,e)},useInsertionEffect:function(n,e){return Kp(4,2,n,e)},useMemo:function(n,e){var t=es();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=es();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=Gk.bind(null,fn,n),[r.memoizedState,n]},useRef:function(n){var e=es();return n={current:n},e.memoizedState=n},useState:Vb,useDebugValue:F1,useDeferredValue:function(n){return es().memoizedState=n},useTransition:function(){var n=Vb(!1),e=n[0];return n=Vk.bind(null,n[1]),es().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=fn,i=es();if(rn){if(t===void 0)throw Error(Re(407));t=t()}else{if(t=e(),Hn===null)throw Error(Re(349));($a&30)!==0||e3(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,Gb(n3.bind(null,r,s,n),[n]),r.flags|=2048,If(9,t3.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=es(),e=Hn.identifierPrefix;if(rn){var t=Fs,r=zs;t=(r&~(1<<32-zi(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=Rf++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=Bk++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},$k={readContext:Si,useCallback:c3,useContext:Si,useEffect:z1,useImperativeHandle:u3,useInsertionEffect:o3,useLayoutEffect:a3,useMemo:f3,useReducer:Yv,useRef:s3,useState:function(){return Yv(Lf)},useDebugValue:F1,useDeferredValue:function(n){var e=wi();return d3(e,Ln.memoizedState,n)},useTransition:function(){var n=Yv(Lf)[0],e=wi().memoizedState;return[n,e]},useMutableSource:KA,useSyncExternalStore:JA,useId:h3,unstable_isNewReconciler:!1},jk={readContext:Si,useCallback:c3,useContext:Si,useEffect:z1,useImperativeHandle:u3,useInsertionEffect:o3,useLayoutEffect:a3,useMemo:f3,useReducer:qv,useRef:s3,useState:function(){return qv(Lf)},useDebugValue:F1,useDeferredValue:function(n){var e=wi();return Ln===null?e.memoizedState=n:d3(e,Ln.memoizedState,n)},useTransition:function(){var n=qv(Lf)[0],e=wi().memoizedState;return[n,e]},useMutableSource:KA,useSyncExternalStore:JA,useId:h3,unstable_isNewReconciler:!1};function Au(n,e){try{var t="",r=e;do t+=xO(r),r=r.return;while(r);var i=t}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:n,source:e,stack:i,digest:null}}function Zv(n,e,t){return{value:n,source:null,stack:t!=null?t:null,digest:e!=null?e:null}}function B_(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var Xk=typeof WeakMap=="function"?WeakMap:Map;function v3(n,e,t){t=Vs(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){km||(km=!0,Z_=r),B_(n,e)},t}function y3(n,e,t){t=Vs(-1,t),t.tag=3;var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;t.payload=function(){return r(i)},t.callback=function(){B_(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){B_(n,e),typeof r!="function"&&(Oo===null?Oo=new Set([this]):Oo.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function Hb(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new Xk;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(t)||(i.add(t),n=az.bind(null,n,e,t),e.then(n,n))}function Wb(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function $b(n,e,t,r,i){return(n.mode&1)===0?(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=Vs(-1,1),e.tag=2,Do(t,e,1))),t.lanes|=1),n):(n.flags|=65536,n.lanes=i,n)}var Yk=qs.ReactCurrentOwner,Er=!1;function dr(n,e,t,r){e.child=n===null?ZA(e,null,t,r):Tu(e,n.child,t,r)}function jb(n,e,t,r,i){t=t.render;var s=e.ref;return yu(e,i),r=O1(n,e,t,r,s,i),t=k1(),n!==null&&!Er?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,js(n,e,i)):(rn&&t&&M1(e),e.flags|=1,dr(n,e,r,i),e.child)}function Xb(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!j1(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,_3(n,e,s,r,i)):(n=nm(t.type,null,r,e,e.mode,i),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,(n.lanes&i)===0){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:bf,t(o,r)&&n.ref===e.ref)return js(n,e,i)}return e.flags|=1,n=zo(s,r),n.ref=e.ref,n.return=e,e.child=n}function _3(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(bf(s,r)&&n.ref===e.ref)if(Er=!1,e.pendingProps=r=s,(n.lanes&i)!==0)(n.flags&131072)!==0&&(Er=!0);else return e.lanes=n.lanes,js(n,e,i)}return V_(n,e,t,r,i)}function x3(n,e,t){var r=e.pendingProps,i=r.children,s=n!==null?n.memoizedState:null;if(r.mode==="hidden")if((e.mode&1)===0)e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Zt(uu,Br),Br|=t;else{if((t&1073741824)===0)return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Zt(uu,Br),Br|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,Zt(uu,Br),Br|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,Zt(uu,Br),Br|=r;return dr(n,e,i,t),e.child}function S3(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function V_(n,e,t,r,i){var s=Ar(t)?Ha:ar.current;return s=bu(e,s),yu(e,i),t=O1(n,e,t,r,s,i),r=k1(),n!==null&&!Er?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,js(n,e,i)):(rn&&r&&M1(e),e.flags|=1,dr(n,e,t,i),e.child)}function Yb(n,e,t,r,i){if(Ar(t)){var s=!0;Tm(e)}else s=!1;if(yu(e,i),e.stateNode===null)Jp(n,e),YA(e,t,r),U_(e,t,r,i),r=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,f=t.contextType;typeof f=="object"&&f!==null?f=Si(f):(f=Ar(t)?Ha:ar.current,f=bu(e,f));var d=t.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==f)&&Ub(e,o,r,f),xo=!1;var p=e.memoizedState;o.state=p,Lm(e,r,o,i),c=e.memoizedState,a!==r||p!==c||Cr.current||xo?(typeof d=="function"&&(F_(e,t,d,r),c=e.memoizedState),(a=xo||Fb(e,t,a,r,p,c,f))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),o.props=r,o.state=c,o.context=f,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,jA(n,e),a=e.memoizedProps,f=e.type===e.elementType?a:Ii(e.type,a),o.props=f,h=e.pendingProps,p=o.context,c=t.contextType,typeof c=="object"&&c!==null?c=Si(c):(c=Ar(t)?Ha:ar.current,c=bu(e,c));var g=t.getDerivedStateFromProps;(d=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||p!==c)&&Ub(e,o,r,c),xo=!1,p=e.memoizedState,o.state=p,Lm(e,r,o,i);var v=e.memoizedState;a!==h||p!==v||Cr.current||xo?(typeof g=="function"&&(F_(e,t,g,r),v=e.memoizedState),(f=xo||Fb(e,t,f,r,p,v,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),o.props=r,o.state=v,o.context=c,r=f):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),r=!1)}return G_(n,e,t,r,s,i)}function G_(n,e,t,r,i,s){S3(n,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&Nb(e,t,!1),js(n,e,s);r=e.stateNode,Yk.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&o?(e.child=Tu(e,n.child,null,s),e.child=Tu(e,null,a,s)):dr(n,e,a,s),e.memoizedState=r.state,i&&Nb(e,t,!0),e.child}function w3(n){var e=n.stateNode;e.pendingContext?Ib(n,e.pendingContext,e.pendingContext!==e.context):e.context&&Ib(n,e.context,!1),L1(n,e.containerInfo)}function qb(n,e,t,r,i){return Eu(),E1(i),e.flags|=256,dr(n,e,t,r),e.child}var H_={dehydrated:null,treeContext:null,retryLane:0};function W_(n){return{baseLanes:n,cachePool:null,transitions:null}}function M3(n,e,t){var r=e.pendingProps,i=ln.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(i|=1),Zt(ln,i&1),n===null)return k_(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?((e.mode&1)===0?e.lanes=1:n.data==="$!"?e.lanes=8:e.lanes=1073741824,null):(o=r.children,n=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},(r&1)===0&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Ag(o,r,0,null),n=Oa(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=W_(t),e.memoizedState=H_,n):U1(e,o));if(i=n.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return qk(n,e,o,r,a,i,t);if(s){s=r.fallback,o=e.mode,i=n.child,a=i.sibling;var c={mode:"hidden",children:r.children};return(o&1)===0&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=zo(i,c),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=zo(a,s):(s=Oa(s,o,t,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=n.child.memoizedState,o=o===null?W_(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=H_,r}return s=n.child,n=s.sibling,r=zo(s,{mode:"visible",children:r.children}),(e.mode&1)===0&&(r.lanes=t),r.return=e,r.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=r,e.memoizedState=null,r}function U1(n,e){return e=Ag({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function Wh(n,e,t,r){return r!==null&&E1(r),Tu(e,n.child,null,t),n=U1(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function qk(n,e,t,r,i,s,o){if(t)return e.flags&256?(e.flags&=-257,r=Zv(Error(Re(422))),Wh(n,e,o,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Ag({mode:"visible",children:r.children},i,0,null),s=Oa(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,(e.mode&1)!==0&&Tu(e,n.child,null,o),e.child.memoizedState=W_(o),e.memoizedState=H_,s);if((e.mode&1)===0)return Wh(n,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(Re(419)),r=Zv(s,r,void 0),Wh(n,e,o,r)}if(a=(o&n.childLanes)!==0,Er||a){if(r=Hn,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=(i&(r.suspendedLanes|o))!==0?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,$s(n,i),Fi(r,n,i,-1))}return $1(),r=Zv(Error(Re(421))),Wh(n,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=lz.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,Hr=No(i.nextSibling),Wr=e,rn=!0,Di=null,n!==null&&(mi[gi++]=zs,mi[gi++]=Fs,mi[gi++]=Wa,zs=n.id,Fs=n.overflow,Wa=e),e=U1(e,r.children),e.flags|=4096,e)}function Zb(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),z_(n.return,e,t)}function Qv(n,e,t,r,i){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=t,s.tailMode=i)}function b3(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(dr(n,e,r.children,t),r=ln.current,(r&2)!==0)r=r&1|2,e.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Zb(n,t,e);else if(n.tag===19)Zb(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}r&=1}if(Zt(ln,r),(e.mode&1)===0)e.memoizedState=null;else switch(i){case"forwards":for(t=e.child,i=null;t!==null;)n=t.alternate,n!==null&&Im(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),Qv(e,!1,i,t,s);break;case"backwards":for(t=null,i=e.child,e.child=null;i!==null;){if(n=i.alternate,n!==null&&Im(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}Qv(e,!0,t,null,s);break;case"together":Qv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Jp(n,e){(e.mode&1)===0&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function js(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),ja|=e.lanes,(t&e.childLanes)===0)return null;if(n!==null&&e.child!==n.child)throw Error(Re(153));if(e.child!==null){for(n=e.child,t=zo(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=zo(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function Zk(n,e,t){switch(e.tag){case 3:w3(e),Eu();break;case 5:QA(e);break;case 1:Ar(e.type)&&Tm(e);break;case 4:L1(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Zt(Pm,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Zt(ln,ln.current&1),e.flags|=128,null):(t&e.child.childLanes)!==0?M3(n,e,t):(Zt(ln,ln.current&1),n=js(n,e,t),n!==null?n.sibling:null);Zt(ln,ln.current&1);break;case 19:if(r=(t&e.childLanes)!==0,(n.flags&128)!==0){if(r)return b3(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Zt(ln,ln.current),r)break;return null;case 22:case 23:return e.lanes=0,x3(n,e,t)}return js(n,e,t)}var E3,$_,T3,C3;E3=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};$_=function(){};T3=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,Ta(ls.current);var s=null;switch(t){case"input":i=h_(n,i),r=h_(n,r),s=[];break;case"select":i=dn({},i,{value:void 0}),r=dn({},r,{value:void 0}),s=[];break;case"textarea":i=g_(n,i),r=g_(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=bm)}y_(t,r);var o;t=null;for(f in i)if(!r.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var a=i[f];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(vf.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in r){var c=r[f];if(a=i!=null?i[f]:void 0,r.hasOwnProperty(f)&&c!==a&&(c!=null||a!=null))if(f==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(t||(t={}),t[o]=c[o])}else t||(s||(s=[]),s.push(f,t)),t=c;else f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(f,c)):f==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(f,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(vf.hasOwnProperty(f)?(c!=null&&f==="onScroll"&&Qt("scroll",n),s||a===c||(s=[])):(s=s||[]).push(f,c))}t&&(s=s||[]).push("style",t);var f=s;(e.updateQueue=f)&&(e.flags|=4)}};C3=function(n,e,t,r){t!==r&&(e.flags|=4)};function Mc(n,e){if(!rn)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:r.sibling=null}}function nr(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,r=0;if(e)for(var i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=n,i=i.sibling;else for(i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=n,i=i.sibling;return n.subtreeFlags|=r,n.childLanes=t,e}function Qk(n,e,t){var r=e.pendingProps;switch(b1(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nr(e),null;case 1:return Ar(e.type)&&Em(),nr(e),null;case 3:return r=e.stateNode,Cu(),Jt(Cr),Jt(ar),N1(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(Gh(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Di!==null&&(J_(Di),Di=null))),$_(n,e),nr(e),null;case 5:I1(e);var i=Ta(Pf.current);if(t=e.type,n!==null&&e.stateNode!=null)T3(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Re(166));return nr(e),null}if(n=Ta(ls.current),Gh(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[ss]=e,r[Cf]=s,n=(e.mode&1)!==0,t){case"dialog":Qt("cancel",r),Qt("close",r);break;case"iframe":case"object":case"embed":Qt("load",r);break;case"video":case"audio":for(i=0;i<Zc.length;i++)Qt(Zc[i],r);break;case"source":Qt("error",r);break;case"img":case"image":case"link":Qt("error",r),Qt("load",r);break;case"details":Qt("toggle",r);break;case"input":sb(r,s),Qt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Qt("invalid",r);break;case"textarea":ab(r,s),Qt("invalid",r)}y_(t,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Vh(r.textContent,a,n),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Vh(r.textContent,a,n),i=["children",""+a]):vf.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Qt("scroll",r)}switch(t){case"input":Nh(r),ob(r,s,!0);break;case"textarea":Nh(r),lb(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=bm)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=eA(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[ss]=e,n[Cf]=r,E3(n,e,!1,!1),e.stateNode=n;e:{switch(o=__(t,r),t){case"dialog":Qt("cancel",n),Qt("close",n),i=r;break;case"iframe":case"object":case"embed":Qt("load",n),i=r;break;case"video":case"audio":for(i=0;i<Zc.length;i++)Qt(Zc[i],n);i=r;break;case"source":Qt("error",n),i=r;break;case"img":case"image":case"link":Qt("error",n),Qt("load",n),i=r;break;case"details":Qt("toggle",n),i=r;break;case"input":sb(n,r),i=h_(n,r),Qt("invalid",n);break;case"option":i=r;break;case"select":n._wrapperState={wasMultiple:!!r.multiple},i=dn({},r,{value:void 0}),Qt("invalid",n);break;case"textarea":ab(n,r),i=g_(n,r),Qt("invalid",n);break;default:i=r}y_(t,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var c=a[s];s==="style"?rA(n,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&tA(n,c)):s==="children"?typeof c=="string"?(t!=="textarea"||c!=="")&&yf(n,c):typeof c=="number"&&yf(n,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(vf.hasOwnProperty(s)?c!=null&&s==="onScroll"&&Qt("scroll",n):c!=null&&u1(n,s,c,o))}switch(t){case"input":Nh(n),ob(n,r,!1);break;case"textarea":Nh(n),lb(n);break;case"option":r.value!=null&&n.setAttribute("value",""+Uo(r.value));break;case"select":n.multiple=!!r.multiple,s=r.value,s!=null?pu(n,!!r.multiple,s,!1):r.defaultValue!=null&&pu(n,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(n.onclick=bm)}switch(t){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return nr(e),null;case 6:if(n&&e.stateNode!=null)C3(n,e,n.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(Re(166));if(t=Ta(Pf.current),Ta(ls.current),Gh(e)){if(r=e.stateNode,t=e.memoizedProps,r[ss]=e,(s=r.nodeValue!==t)&&(n=Wr,n!==null))switch(n.tag){case 3:Vh(r.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Vh(r.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else r=(t.nodeType===9?t:t.ownerDocument).createTextNode(r),r[ss]=e,e.stateNode=r}return nr(e),null;case 13:if(Jt(ln),r=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(rn&&Hr!==null&&(e.mode&1)!==0&&(e.flags&128)===0)WA(),Eu(),e.flags|=98560,s=!1;else if(s=Gh(e),r!==null&&r.dehydrated!==null){if(n===null){if(!s)throw Error(Re(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Re(317));s[ss]=e}else Eu(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;nr(e),s=!1}else Di!==null&&(J_(Di),Di=null),s=!0;if(!s)return e.flags&65536?e:null}return(e.flags&128)!==0?(e.lanes=t,e):(r=r!==null,r!==(n!==null&&n.memoizedState!==null)&&r&&(e.child.flags|=8192,(e.mode&1)!==0&&(n===null||(ln.current&1)!==0?In===0&&(In=3):$1())),e.updateQueue!==null&&(e.flags|=4),nr(e),null);case 4:return Cu(),$_(n,e),n===null&&Ef(e.stateNode.containerInfo),nr(e),null;case 10:return A1(e.type._context),nr(e),null;case 17:return Ar(e.type)&&Em(),nr(e),null;case 19:if(Jt(ln),s=e.memoizedState,s===null)return nr(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)Mc(s,!1);else{if(In!==0||n!==null&&(n.flags&128)!==0)for(n=e.child;n!==null;){if(o=Im(n),o!==null){for(e.flags|=128,Mc(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=t,t=e.child;t!==null;)s=t,n=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return Zt(ln,ln.current&1|2),e.child}n=n.sibling}s.tail!==null&&_n()>Pu&&(e.flags|=128,r=!0,Mc(s,!1),e.lanes=4194304)}else{if(!r)if(n=Im(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Mc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!rn)return nr(e),null}else 2*_n()-s.renderingStartTime>Pu&&t!==1073741824&&(e.flags|=128,r=!0,Mc(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=_n(),e.sibling=null,t=ln.current,Zt(ln,r?t&1|2:t&1),e):(nr(e),null);case 22:case 23:return W1(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&(e.mode&1)!==0?(Br&1073741824)!==0&&(nr(e),e.subtreeFlags&6&&(e.flags|=8192)):nr(e),null;case 24:return null;case 25:return null}throw Error(Re(156,e.tag))}function Kk(n,e){switch(b1(e),e.tag){case 1:return Ar(e.type)&&Em(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Cu(),Jt(Cr),Jt(ar),N1(),n=e.flags,(n&65536)!==0&&(n&128)===0?(e.flags=n&-65537|128,e):null;case 5:return I1(e),null;case 13:if(Jt(ln),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Re(340));Eu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Jt(ln),null;case 4:return Cu(),null;case 10:return A1(e.type._context),null;case 22:case 23:return W1(),null;case 24:return null;default:return null}}var $h=!1,or=!1,Jk=typeof WeakSet=="function"?WeakSet:Set,$e=null;function lu(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){mn(n,e,r)}else t.current=null}function j_(n,e,t){try{t()}catch(r){mn(n,e,r)}}var Qb=!1;function ez(n,e){if(P_=Sm,n=LA(),w1(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,c=-1,f=0,d=0,h=n,p=null;t:for(;;){for(var g;h!==t||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===n)break t;if(p===t&&++f===i&&(a=o),p===s&&++d===r&&(c=o),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}t=a===-1||c===-1?null:{start:a,end:c}}else t=null}t=t||{start:0,end:0}}else t=null;for(R_={focusedElem:n,selectionRange:t},Sm=!1,$e=e;$e!==null;)if(e=$e,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,$e=n;else for(;$e!==null;){e=$e;try{var v=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,x=v.memoizedState,w=e.stateNode,_=w.getSnapshotBeforeUpdate(e.elementType===e.type?y:Ii(e.type,y),x);w.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var M=e.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(E){mn(e,e.return,E)}if(n=e.sibling,n!==null){n.return=e.return,$e=n;break}$e=e.return}return v=Qb,Qb=!1,v}function af(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&j_(e,t,s)}i=i.next}while(i!==r)}}function Tg(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function X_(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function A3(n){var e=n.alternate;e!==null&&(n.alternate=null,A3(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[ss],delete e[Cf],delete e[N_],delete e[kk],delete e[zk])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function P3(n){return n.tag===5||n.tag===3||n.tag===4}function Kb(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||P3(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Y_(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=bm));else if(r!==4&&(n=n.child,n!==null))for(Y_(n,e,t),n=n.sibling;n!==null;)Y_(n,e,t),n=n.sibling}function q_(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(q_(n,e,t),n=n.sibling;n!==null;)q_(n,e,t),n=n.sibling}var $n=null,Ni=!1;function uo(n,e,t){for(t=t.child;t!==null;)R3(n,e,t),t=t.sibling}function R3(n,e,t){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(yg,t)}catch{}switch(t.tag){case 5:or||lu(t,e);case 6:var r=$n,i=Ni;$n=null,uo(n,e,t),$n=r,Ni=i,$n!==null&&(Ni?(n=$n,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):$n.removeChild(t.stateNode));break;case 18:$n!==null&&(Ni?(n=$n,t=t.stateNode,n.nodeType===8?Wv(n.parentNode,t):n.nodeType===1&&Wv(n,t),wf(n)):Wv($n,t.stateNode));break;case 4:r=$n,i=Ni,$n=t.stateNode.containerInfo,Ni=!0,uo(n,e,t),$n=r,Ni=i;break;case 0:case 11:case 14:case 15:if(!or&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&((s&2)!==0||(s&4)!==0)&&j_(t,e,o),i=i.next}while(i!==r)}uo(n,e,t);break;case 1:if(!or&&(lu(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){mn(t,e,a)}uo(n,e,t);break;case 21:uo(n,e,t);break;case 22:t.mode&1?(or=(r=or)||t.memoizedState!==null,uo(n,e,t),or=r):uo(n,e,t);break;default:uo(n,e,t)}}function Jb(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new Jk),e.forEach(function(r){var i=uz.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function Ci(n,e){var t=e.deletions;if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];try{var s=n,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:$n=a.stateNode,Ni=!1;break e;case 3:$n=a.stateNode.containerInfo,Ni=!0;break e;case 4:$n=a.stateNode.containerInfo,Ni=!0;break e}a=a.return}if($n===null)throw Error(Re(160));R3(s,o,i),$n=null,Ni=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(f){mn(i,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)L3(e,n),e=e.sibling}function L3(n,e){var t=n.alternate,r=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Ci(e,n),Ji(n),r&4){try{af(3,n,n.return),Tg(3,n)}catch(y){mn(n,n.return,y)}try{af(5,n,n.return)}catch(y){mn(n,n.return,y)}}break;case 1:Ci(e,n),Ji(n),r&512&&t!==null&&lu(t,t.return);break;case 5:if(Ci(e,n),Ji(n),r&512&&t!==null&&lu(t,t.return),n.flags&32){var i=n.stateNode;try{yf(i,"")}catch(y){mn(n,n.return,y)}}if(r&4&&(i=n.stateNode,i!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,c=n.updateQueue;if(n.updateQueue=null,c!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&KC(i,s),__(a,o);var f=__(a,s);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];d==="style"?rA(i,h):d==="dangerouslySetInnerHTML"?tA(i,h):d==="children"?yf(i,h):u1(i,d,h,f)}switch(a){case"input":p_(i,s);break;case"textarea":JC(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var g=s.value;g!=null?pu(i,!!s.multiple,g,!1):p!==!!s.multiple&&(s.defaultValue!=null?pu(i,!!s.multiple,s.defaultValue,!0):pu(i,!!s.multiple,s.multiple?[]:"",!1))}i[Cf]=s}catch(y){mn(n,n.return,y)}}break;case 6:if(Ci(e,n),Ji(n),r&4){if(n.stateNode===null)throw Error(Re(162));i=n.stateNode,s=n.memoizedProps;try{i.nodeValue=s}catch(y){mn(n,n.return,y)}}break;case 3:if(Ci(e,n),Ji(n),r&4&&t!==null&&t.memoizedState.isDehydrated)try{wf(e.containerInfo)}catch(y){mn(n,n.return,y)}break;case 4:Ci(e,n),Ji(n);break;case 13:Ci(e,n),Ji(n),i=n.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(G1=_n())),r&4&&Jb(n);break;case 22:if(d=t!==null&&t.memoizedState!==null,n.mode&1?(or=(f=or)||d,Ci(e,n),or=f):Ci(e,n),Ji(n),r&8192){if(f=n.memoizedState!==null,(n.stateNode.isHidden=f)&&!d&&(n.mode&1)!==0)for($e=n,d=n.child;d!==null;){for(h=$e=d;$e!==null;){switch(p=$e,g=p.child,p.tag){case 0:case 11:case 14:case 15:af(4,p,p.return);break;case 1:lu(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){r=p,t=p.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(y){mn(r,t,y)}}break;case 5:lu(p,p.return);break;case 22:if(p.memoizedState!==null){tE(h);continue}}g!==null?(g.return=p,$e=g):tE(h)}d=d.sibling}e:for(d=null,h=n;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,f?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=nA("display",o))}catch(y){mn(n,n.return,y)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=f?"":h.memoizedProps}catch(y){mn(n,n.return,y)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===n)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Ci(e,n),Ji(n),r&4&&Jb(n);break;case 21:break;default:Ci(e,n),Ji(n)}}function Ji(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(P3(t)){var r=t;break e}t=t.return}throw Error(Re(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(yf(i,""),r.flags&=-33);var s=Kb(n);q_(n,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Kb(n);Y_(n,a,o);break;default:throw Error(Re(161))}}catch(c){mn(n,n.return,c)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function tz(n,e,t){$e=n,I3(n)}function I3(n,e,t){for(var r=(n.mode&1)!==0;$e!==null;){var i=$e,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||$h;if(!o){var a=i.alternate,c=a!==null&&a.memoizedState!==null||or;a=$h;var f=or;if($h=o,(or=c)&&!f)for($e=i;$e!==null;)o=$e,c=o.child,o.tag===22&&o.memoizedState!==null?nE(i):c!==null?(c.return=o,$e=c):nE(i);for(;s!==null;)$e=s,I3(s),s=s.sibling;$e=i,$h=a,or=f}eE(n)}else(i.subtreeFlags&8772)!==0&&s!==null?(s.return=i,$e=s):eE(n)}}function eE(n){for(;$e!==null;){var e=$e;if((e.flags&8772)!==0){var t=e.alternate;try{if((e.flags&8772)!==0)switch(e.tag){case 0:case 11:case 15:or||Tg(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!or)if(t===null)r.componentDidMount();else{var i=e.elementType===e.type?t.memoizedProps:Ii(e.type,t.memoizedProps);r.componentDidUpdate(i,t.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&zb(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}zb(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&t.focus();break;case"img":c.src&&(t.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var f=e.alternate;if(f!==null){var d=f.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&wf(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Re(163))}or||e.flags&512&&X_(e)}catch(p){mn(e,e.return,p)}}if(e===n){$e=null;break}if(t=e.sibling,t!==null){t.return=e.return,$e=t;break}$e=e.return}}function tE(n){for(;$e!==null;){var e=$e;if(e===n){$e=null;break}var t=e.sibling;if(t!==null){t.return=e.return,$e=t;break}$e=e.return}}function nE(n){for(;$e!==null;){var e=$e;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{Tg(4,e)}catch(c){mn(e,t,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(c){mn(e,i,c)}}var s=e.return;try{X_(e)}catch(c){mn(e,s,c)}break;case 5:var o=e.return;try{X_(e)}catch(c){mn(e,o,c)}}}catch(c){mn(e,e.return,c)}if(e===n){$e=null;break}var a=e.sibling;if(a!==null){a.return=e.return,$e=a;break}$e=e.return}}var nz=Math.ceil,Om=qs.ReactCurrentDispatcher,B1=qs.ReactCurrentOwner,xi=qs.ReactCurrentBatchConfig,It=0,Hn=null,Tn=null,Xn=0,Br=0,uu=jo(0),In=0,Nf=null,ja=0,Cg=0,V1=0,lf=null,br=null,G1=0,Pu=1/0,Ds=null,km=!1,Z_=null,Oo=null,jh=!1,Co=null,zm=0,uf=0,Q_=null,em=-1,tm=0;function mr(){return(It&6)!==0?_n():em!==-1?em:em=_n()}function ko(n){return(n.mode&1)===0?1:(It&2)!==0&&Xn!==0?Xn&-Xn:Uk.transition!==null?(tm===0&&(tm=mA()),tm):(n=Wt,n!==0||(n=window.event,n=n===void 0?16:wA(n.type)),n)}function Fi(n,e,t,r){if(50<uf)throw uf=0,Q_=null,Error(Re(185));id(n,t,r),((It&2)===0||n!==Hn)&&(n===Hn&&((It&2)===0&&(Cg|=t),In===4&&bo(n,Xn)),Pr(n,r),t===1&&It===0&&(e.mode&1)===0&&(Pu=_n()+500,Mg&&Xo()))}function Pr(n,e){var t=n.callbackNode;UO(n,e);var r=xm(n,n===Hn?Xn:0);if(r===0)t!==null&&fb(t),n.callbackNode=null,n.callbackPriority=0;else if(e=r&-r,n.callbackPriority!==e){if(t!=null&&fb(t),e===1)n.tag===0?Fk(rE.bind(null,n)):VA(rE.bind(null,n)),Dk(function(){(It&6)===0&&Xo()}),t=null;else{switch(gA(r)){case 1:t=p1;break;case 4:t=hA;break;case 16:t=_m;break;case 536870912:t=pA;break;default:t=_m}t=B3(t,N3.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function N3(n,e){if(em=-1,tm=0,(It&6)!==0)throw Error(Re(327));var t=n.callbackNode;if(_u()&&n.callbackNode!==t)return null;var r=xm(n,n===Hn?Xn:0);if(r===0)return null;if((r&30)!==0||(r&n.expiredLanes)!==0||e)e=Fm(n,r);else{e=r;var i=It;It|=2;var s=O3();(Hn!==n||Xn!==e)&&(Ds=null,Pu=_n()+500,Da(n,e));do try{sz();break}catch(a){D3(n,a)}while(1);C1(),Om.current=s,It=i,Tn!==null?e=0:(Hn=null,Xn=0,e=In)}if(e!==0){if(e===2&&(i=b_(n),i!==0&&(r=i,e=K_(n,i))),e===1)throw t=Nf,Da(n,0),bo(n,r),Pr(n,_n()),t;if(e===6)bo(n,r);else{if(i=n.current.alternate,(r&30)===0&&!rz(i)&&(e=Fm(n,r),e===2&&(s=b_(n),s!==0&&(r=s,e=K_(n,s))),e===1))throw t=Nf,Da(n,0),bo(n,r),Pr(n,_n()),t;switch(n.finishedWork=i,n.finishedLanes=r,e){case 0:case 1:throw Error(Re(345));case 2:va(n,br,Ds);break;case 3:if(bo(n,r),(r&130023424)===r&&(e=G1+500-_n(),10<e)){if(xm(n,0)!==0)break;if(i=n.suspendedLanes,(i&r)!==r){mr(),n.pingedLanes|=n.suspendedLanes&i;break}n.timeoutHandle=I_(va.bind(null,n,br,Ds),e);break}va(n,br,Ds);break;case 4:if(bo(n,r),(r&4194240)===r)break;for(e=n.eventTimes,i=-1;0<r;){var o=31-zi(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=_n()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nz(r/1960))-r,10<r){n.timeoutHandle=I_(va.bind(null,n,br,Ds),r);break}va(n,br,Ds);break;case 5:va(n,br,Ds);break;default:throw Error(Re(329))}}}return Pr(n,_n()),n.callbackNode===t?N3.bind(null,n):null}function K_(n,e){var t=lf;return n.current.memoizedState.isDehydrated&&(Da(n,e).flags|=256),n=Fm(n,e),n!==2&&(e=br,br=t,e!==null&&J_(e)),n}function J_(n){br===null?br=n:br.push.apply(br,n)}function rz(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var r=0;r<t.length;r++){var i=t[r],s=i.getSnapshot;i=i.value;try{if(!Bi(s(),i))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function bo(n,e){for(e&=~V1,e&=~Cg,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-zi(e),r=1<<t;n[t]=-1,e&=~r}}function rE(n){if((It&6)!==0)throw Error(Re(327));_u();var e=xm(n,0);if((e&1)===0)return Pr(n,_n()),null;var t=Fm(n,e);if(n.tag!==0&&t===2){var r=b_(n);r!==0&&(e=r,t=K_(n,r))}if(t===1)throw t=Nf,Da(n,0),bo(n,e),Pr(n,_n()),t;if(t===6)throw Error(Re(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,va(n,br,Ds),Pr(n,_n()),null}function H1(n,e){var t=It;It|=1;try{return n(e)}finally{It=t,It===0&&(Pu=_n()+500,Mg&&Xo())}}function Xa(n){Co!==null&&Co.tag===0&&(It&6)===0&&_u();var e=It;It|=1;var t=xi.transition,r=Wt;try{if(xi.transition=null,Wt=1,n)return n()}finally{Wt=r,xi.transition=t,It=e,(It&6)===0&&Xo()}}function W1(){Br=uu.current,Jt(uu)}function Da(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,Nk(t)),Tn!==null)for(t=Tn.return;t!==null;){var r=t;switch(b1(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Em();break;case 3:Cu(),Jt(Cr),Jt(ar),N1();break;case 5:I1(r);break;case 4:Cu();break;case 13:Jt(ln);break;case 19:Jt(ln);break;case 10:A1(r.type._context);break;case 22:case 23:W1()}t=t.return}if(Hn=n,Tn=n=zo(n.current,null),Xn=Br=e,In=0,Nf=null,V1=Cg=ja=0,br=lf=null,Ea!==null){for(e=0;e<Ea.length;e++)if(t=Ea[e],r=t.interleaved,r!==null){t.interleaved=null;var i=r.next,s=t.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}t.pending=r}Ea=null}return n}function D3(n,e){do{var t=Tn;try{if(C1(),Qp.current=Dm,Nm){for(var r=fn.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Nm=!1}if($a=0,Vn=Ln=fn=null,of=!1,Rf=0,B1.current=null,t===null||t.return===null){In=1,Nf=e,Tn=null;break}e:{var s=n,o=t.return,a=t,c=e;if(e=Xn,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=c,d=a,h=d.tag;if((d.mode&1)===0&&(h===0||h===11||h===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=Wb(o);if(g!==null){g.flags&=-257,$b(g,o,a,s,e),g.mode&1&&Hb(s,f,e),e=g,c=f;var v=e.updateQueue;if(v===null){var y=new Set;y.add(c),e.updateQueue=y}else v.add(c);break e}else{if((e&1)===0){Hb(s,f,e),$1();break e}c=Error(Re(426))}}else if(rn&&a.mode&1){var x=Wb(o);if(x!==null){(x.flags&65536)===0&&(x.flags|=256),$b(x,o,a,s,e),E1(Au(c,a));break e}}s=c=Au(c,a),In!==4&&(In=2),lf===null?lf=[s]:lf.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var w=v3(s,c,e);kb(s,w);break e;case 1:a=c;var _=s.type,M=s.stateNode;if((s.flags&128)===0&&(typeof _.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(Oo===null||!Oo.has(M)))){s.flags|=65536,e&=-e,s.lanes|=e;var E=y3(s,a,e);kb(s,E);break e}}s=s.return}while(s!==null)}z3(t)}catch(C){e=C,Tn===t&&t!==null&&(Tn=t=t.return);continue}break}while(1)}function O3(){var n=Om.current;return Om.current=Dm,n===null?Dm:n}function $1(){(In===0||In===3||In===2)&&(In=4),Hn===null||(ja&268435455)===0&&(Cg&268435455)===0||bo(Hn,Xn)}function Fm(n,e){var t=It;It|=2;var r=O3();(Hn!==n||Xn!==e)&&(Ds=null,Da(n,e));do try{iz();break}catch(i){D3(n,i)}while(1);if(C1(),It=t,Om.current=r,Tn!==null)throw Error(Re(261));return Hn=null,Xn=0,In}function iz(){for(;Tn!==null;)k3(Tn)}function sz(){for(;Tn!==null&&!RO();)k3(Tn)}function k3(n){var e=U3(n.alternate,n,Br);n.memoizedProps=n.pendingProps,e===null?z3(n):Tn=e,B1.current=null}function z3(n){var e=n;do{var t=e.alternate;if(n=e.return,(e.flags&32768)===0){if(t=Qk(t,e,Br),t!==null){Tn=t;return}}else{if(t=Kk(t,e),t!==null){t.flags&=32767,Tn=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{In=6,Tn=null;return}}if(e=e.sibling,e!==null){Tn=e;return}Tn=e=n}while(e!==null);In===0&&(In=5)}function va(n,e,t){var r=Wt,i=xi.transition;try{xi.transition=null,Wt=1,oz(n,e,t,r)}finally{xi.transition=i,Wt=r}return null}function oz(n,e,t,r){do _u();while(Co!==null);if((It&6)!==0)throw Error(Re(327));t=n.finishedWork;var i=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(Re(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(BO(n,s),n===Hn&&(Tn=Hn=null,Xn=0),(t.subtreeFlags&2064)===0&&(t.flags&2064)===0||jh||(jh=!0,B3(_m,function(){return _u(),null})),s=(t.flags&15990)!==0,(t.subtreeFlags&15990)!==0||s){s=xi.transition,xi.transition=null;var o=Wt;Wt=1;var a=It;It|=4,B1.current=null,ez(n,t),L3(t,n),Tk(R_),Sm=!!P_,R_=P_=null,n.current=t,tz(t),LO(),It=a,Wt=o,xi.transition=s}else n.current=t;if(jh&&(jh=!1,Co=n,zm=i),s=n.pendingLanes,s===0&&(Oo=null),DO(t.stateNode),Pr(n,_n()),e!==null)for(r=n.onRecoverableError,t=0;t<e.length;t++)i=e[t],r(i.value,{componentStack:i.stack,digest:i.digest});if(km)throw km=!1,n=Z_,Z_=null,n;return(zm&1)!==0&&n.tag!==0&&_u(),s=n.pendingLanes,(s&1)!==0?n===Q_?uf++:(uf=0,Q_=n):uf=0,Xo(),null}function _u(){if(Co!==null){var n=gA(zm),e=xi.transition,t=Wt;try{if(xi.transition=null,Wt=16>n?16:n,Co===null)var r=!1;else{if(n=Co,Co=null,zm=0,(It&6)!==0)throw Error(Re(331));var i=It;for(It|=4,$e=n.current;$e!==null;){var s=$e,o=s.child;if(($e.flags&16)!==0){var a=s.deletions;if(a!==null){for(var c=0;c<a.length;c++){var f=a[c];for($e=f;$e!==null;){var d=$e;switch(d.tag){case 0:case 11:case 15:af(8,d,s)}var h=d.child;if(h!==null)h.return=d,$e=h;else for(;$e!==null;){d=$e;var p=d.sibling,g=d.return;if(A3(d),d===f){$e=null;break}if(p!==null){p.return=g,$e=p;break}$e=g}}}var v=s.alternate;if(v!==null){var y=v.child;if(y!==null){v.child=null;do{var x=y.sibling;y.sibling=null,y=x}while(y!==null)}}$e=s}}if((s.subtreeFlags&2064)!==0&&o!==null)o.return=s,$e=o;else e:for(;$e!==null;){if(s=$e,(s.flags&2048)!==0)switch(s.tag){case 0:case 11:case 15:af(9,s,s.return)}var w=s.sibling;if(w!==null){w.return=s.return,$e=w;break e}$e=s.return}}var _=n.current;for($e=_;$e!==null;){o=$e;var M=o.child;if((o.subtreeFlags&2064)!==0&&M!==null)M.return=o,$e=M;else e:for(o=_;$e!==null;){if(a=$e,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:Tg(9,a)}}catch(C){mn(a,a.return,C)}if(a===o){$e=null;break e}var E=a.sibling;if(E!==null){E.return=a.return,$e=E;break e}$e=a.return}}if(It=i,Xo(),as&&typeof as.onPostCommitFiberRoot=="function")try{as.onPostCommitFiberRoot(yg,n)}catch{}r=!0}return r}finally{Wt=t,xi.transition=e}}return!1}function iE(n,e,t){e=Au(t,e),e=v3(n,e,1),n=Do(n,e,1),e=mr(),n!==null&&(id(n,1,e),Pr(n,e))}function mn(n,e,t){if(n.tag===3)iE(n,n,t);else for(;e!==null;){if(e.tag===3){iE(e,n,t);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Oo===null||!Oo.has(r))){n=Au(t,n),n=y3(e,n,1),e=Do(e,n,1),n=mr(),e!==null&&(id(e,1,n),Pr(e,n));break}}e=e.return}}function az(n,e,t){var r=n.pingCache;r!==null&&r.delete(e),e=mr(),n.pingedLanes|=n.suspendedLanes&t,Hn===n&&(Xn&t)===t&&(In===4||In===3&&(Xn&130023424)===Xn&&500>_n()-G1?Da(n,0):V1|=t),Pr(n,e)}function F3(n,e){e===0&&((n.mode&1)===0?e=1:(e=kh,kh<<=1,(kh&130023424)===0&&(kh=4194304)));var t=mr();n=$s(n,e),n!==null&&(id(n,e,t),Pr(n,t))}function lz(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),F3(n,t)}function uz(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(Re(314))}r!==null&&r.delete(e),F3(n,t)}var U3;U3=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Cr.current)Er=!0;else{if((n.lanes&t)===0&&(e.flags&128)===0)return Er=!1,Zk(n,e,t);Er=(n.flags&131072)!==0}else Er=!1,rn&&(e.flags&1048576)!==0&&GA(e,Am,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Jp(n,e),n=e.pendingProps;var i=bu(e,ar.current);yu(e,t),i=O1(null,e,r,n,i,t);var s=k1();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ar(r)?(s=!0,Tm(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,R1(e),i.updater=bg,e.stateNode=i,i._reactInternals=e,U_(e,r,n,t),e=G_(null,e,r,!0,s,t)):(e.tag=0,rn&&s&&M1(e),dr(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(Jp(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=fz(r),n=Ii(r,n),i){case 0:e=V_(null,e,r,n,t);break e;case 1:e=Yb(null,e,r,n,t);break e;case 11:e=jb(null,e,r,n,t);break e;case 14:e=Xb(null,e,r,Ii(r.type,n),t);break e}throw Error(Re(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ii(r,i),V_(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ii(r,i),Yb(n,e,r,i,t);case 3:e:{if(w3(e),n===null)throw Error(Re(387));r=e.pendingProps,s=e.memoizedState,i=s.element,jA(n,e),Lm(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Au(Error(Re(423)),e),e=qb(n,e,r,t,i);break e}else if(r!==i){i=Au(Error(Re(424)),e),e=qb(n,e,r,t,i);break e}else for(Hr=No(e.stateNode.containerInfo.firstChild),Wr=e,rn=!0,Di=null,t=ZA(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Eu(),r===i){e=js(n,e,t);break e}dr(n,e,r,t)}e=e.child}return e;case 5:return QA(e),n===null&&k_(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,L_(r,i)?o=null:s!==null&&L_(r,s)&&(e.flags|=32),S3(n,e),dr(n,e,o,t),e.child;case 6:return n===null&&k_(e),null;case 13:return M3(n,e,t);case 4:return L1(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=Tu(e,null,r,t):dr(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ii(r,i),jb(n,e,r,i,t);case 7:return dr(n,e,e.pendingProps,t),e.child;case 8:return dr(n,e,e.pendingProps.children,t),e.child;case 12:return dr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Zt(Pm,r._currentValue),r._currentValue=o,s!==null)if(Bi(s.value,o)){if(s.children===i.children&&!Cr.current){e=js(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=Vs(-1,t&-t),c.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var d=f.pending;d===null?c.next=c:(c.next=d.next,d.next=c),f.pending=c}}s.lanes|=t,c=s.alternate,c!==null&&(c.lanes|=t),z_(s.return,t,e),a.lanes|=t;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Re(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),z_(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}dr(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,yu(e,t),i=Si(i),r=r(i),e.flags|=1,dr(n,e,r,t),e.child;case 14:return r=e.type,i=Ii(r,e.pendingProps),i=Ii(r.type,i),Xb(n,e,r,i,t);case 15:return _3(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ii(r,i),Jp(n,e),e.tag=1,Ar(r)?(n=!0,Tm(e)):n=!1,yu(e,t),YA(e,r,i),U_(e,r,i,t),G_(null,e,r,!0,n,t);case 19:return b3(n,e,t);case 22:return x3(n,e,t)}throw Error(Re(156,e.tag))};function B3(n,e){return dA(n,e)}function cz(n,e,t,r){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(n,e,t,r){return new cz(n,e,t,r)}function j1(n){return n=n.prototype,!(!n||!n.isReactComponent)}function fz(n){if(typeof n=="function")return j1(n)?1:0;if(n!=null){if(n=n.$$typeof,n===f1)return 11;if(n===d1)return 14}return 2}function zo(n,e){var t=n.alternate;return t===null?(t=yi(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function nm(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")j1(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Jl:return Oa(t.children,i,s,e);case c1:o=8,i|=8;break;case u_:return n=yi(12,t,e,i|2),n.elementType=u_,n.lanes=s,n;case c_:return n=yi(13,t,e,i),n.elementType=c_,n.lanes=s,n;case f_:return n=yi(19,t,e,i),n.elementType=f_,n.lanes=s,n;case qC:return Ag(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case XC:o=10;break e;case YC:o=9;break e;case f1:o=11;break e;case d1:o=14;break e;case _o:o=16,r=null;break e}throw Error(Re(130,n==null?n:typeof n,""))}return e=yi(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function Oa(n,e,t,r){return n=yi(7,n,r,e),n.lanes=t,n}function Ag(n,e,t,r){return n=yi(22,n,r,e),n.elementType=qC,n.lanes=t,n.stateNode={isHidden:!1},n}function Kv(n,e,t){return n=yi(6,n,null,e),n.lanes=t,n}function Jv(n,e,t){return e=yi(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function dz(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nv(0),this.expirationTimes=Nv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nv(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function X1(n,e,t,r,i,s,o,a,c){return n=new dz(n,e,t,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=yi(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},R1(s),n}function hz(n,e,t){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kl,key:r==null?null:""+r,children:n,containerInfo:e,implementation:t}}function V3(n){if(!n)return Bo;n=n._reactInternals;e:{if(il(n)!==n||n.tag!==1)throw Error(Re(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ar(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Re(171))}if(n.tag===1){var t=n.type;if(Ar(t))return BA(n,t,e)}return e}function G3(n,e,t,r,i,s,o,a,c){return n=X1(t,r,!0,n,i,s,o,a,c),n.context=V3(null),t=n.current,r=mr(),i=ko(t),s=Vs(r,i),s.callback=e!=null?e:null,Do(t,s,i),n.current.lanes=i,id(n,i,r),Pr(n,r),n}function Pg(n,e,t,r){var i=e.current,s=mr(),o=ko(i);return t=V3(t),e.context===null?e.context=t:e.pendingContext=t,e=Vs(s,o),e.payload={element:n},r=r===void 0?null:r,r!==null&&(e.callback=r),n=Do(i,e,o),n!==null&&(Fi(n,i,o,s),Zp(n,i,o)),o}function Um(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function sE(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function Y1(n,e){sE(n,e),(n=n.alternate)&&sE(n,e)}function pz(){return null}var H3=typeof reportError=="function"?reportError:function(n){console.error(n)};function q1(n){this._internalRoot=n}Rg.prototype.render=q1.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Re(409));Pg(n,e,null,null)};Rg.prototype.unmount=q1.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;Xa(function(){Pg(null,n,null,null)}),e[Ws]=null}};function Rg(n){this._internalRoot=n}Rg.prototype.unstable_scheduleHydration=function(n){if(n){var e=_A();n={blockedOn:null,target:n,priority:e};for(var t=0;t<Mo.length&&e!==0&&e<Mo[t].priority;t++);Mo.splice(t,0,n),t===0&&SA(n)}};function Z1(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function Lg(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function oE(){}function mz(n,e,t,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var f=Um(o);s.call(f)}}var o=G3(e,r,n,0,null,!1,!1,"",oE);return n._reactRootContainer=o,n[Ws]=o.current,Ef(n.nodeType===8?n.parentNode:n),Xa(),o}for(;i=n.lastChild;)n.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var f=Um(c);a.call(f)}}var c=X1(n,0,!1,null,null,!1,!1,"",oE);return n._reactRootContainer=c,n[Ws]=c.current,Ef(n.nodeType===8?n.parentNode:n),Xa(function(){Pg(e,c,t,r)}),c}function Ig(n,e,t,r,i){var s=t._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var c=Um(o);a.call(c)}}Pg(e,o,n,i)}else o=mz(t,e,n,i,r);return Um(o)}vA=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=qc(e.pendingLanes);t!==0&&(m1(e,t|1),Pr(e,_n()),(It&6)===0&&(Pu=_n()+500,Xo()))}break;case 13:Xa(function(){var r=$s(n,1);if(r!==null){var i=mr();Fi(r,n,1,i)}}),Y1(n,1)}};g1=function(n){if(n.tag===13){var e=$s(n,134217728);if(e!==null){var t=mr();Fi(e,n,134217728,t)}Y1(n,134217728)}};yA=function(n){if(n.tag===13){var e=ko(n),t=$s(n,e);if(t!==null){var r=mr();Fi(t,n,e,r)}Y1(n,e)}};_A=function(){return Wt};xA=function(n,e){var t=Wt;try{return Wt=n,e()}finally{Wt=t}};S_=function(n,e,t){switch(e){case"input":if(p_(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var r=t[e];if(r!==n&&r.form===n.form){var i=wg(r);if(!i)throw Error(Re(90));QC(r),p_(r,i)}}}break;case"textarea":JC(n,t);break;case"select":e=t.value,e!=null&&pu(n,!!t.multiple,e,!1)}};oA=H1;aA=Xa;var gz={usingClientEntryPoint:!1,Events:[od,ru,wg,iA,sA,H1]},bc={findFiberByHostInstance:ba,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},vz={bundleType:bc.bundleType,version:bc.version,rendererPackageName:bc.rendererPackageName,rendererConfig:bc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qs.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=cA(n),n===null?null:n.stateNode},findFiberByHostInstance:bc.findFiberByHostInstance||pz,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{yg=Xh.inject(vz),as=Xh}catch{}}Zr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gz;Zr.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Z1(e))throw Error(Re(200));return hz(n,e,null,t)};Zr.createRoot=function(n,e){if(!Z1(n))throw Error(Re(299));var t=!1,r="",i=H3;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=X1(n,1,!1,null,null,t,!1,r,i),n[Ws]=e.current,Ef(n.nodeType===8?n.parentNode:n),new q1(e)};Zr.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(Re(188)):(n=Object.keys(n).join(","),Error(Re(268,n)));return n=cA(e),n=n===null?null:n.stateNode,n};Zr.flushSync=function(n){return Xa(n)};Zr.hydrate=function(n,e,t){if(!Lg(e))throw Error(Re(200));return Ig(null,n,e,!0,t)};Zr.hydrateRoot=function(n,e,t){if(!Z1(n))throw Error(Re(405));var r=t!=null&&t.hydratedSources||null,i=!1,s="",o=H3;if(t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=G3(e,null,n,1,t!=null?t:null,i,!1,s,o),n[Ws]=e.current,Ef(n),r)for(n=0;n<r.length;n++)t=r[n],i=t._getVersion,i=i(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,i]:e.mutableSourceEagerHydrationData.push(t,i);return new Rg(e)};Zr.render=function(n,e,t){if(!Lg(e))throw Error(Re(200));return Ig(null,n,e,!1,t)};Zr.unmountComponentAtNode=function(n){if(!Lg(n))throw Error(Re(40));return n._reactRootContainer?(Xa(function(){Ig(null,null,n,!1,function(){n._reactRootContainer=null,n[Ws]=null})}),!0):!1};Zr.unstable_batchedUpdates=H1;Zr.unstable_renderSubtreeIntoContainer=function(n,e,t,r){if(!Lg(t))throw Error(Re(200));if(n==null||n._reactInternals===void 0)throw Error(Re(38));return Ig(n,e,t,!1,r)};Zr.version="18.2.0-next-9e3b772b8-20220608";function W3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(W3)}catch(n){console.error(n)}}W3(),vg.exports=Zr;var yz=vg.exports,aE=vg.exports;a_.createRoot=aE.createRoot,a_.hydrateRoot=aE.hydrateRoot;var Ng={exports:{}},Dg={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var _z=te.exports,xz=Symbol.for("react.element"),Sz=Symbol.for("react.fragment"),wz=Object.prototype.hasOwnProperty,Mz=_z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bz={key:!0,ref:!0,__self:!0,__source:!0};function $3(n,e,t){var r,i={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)wz.call(e,r)&&!bz.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:xz,type:n,key:s,ref:o,props:i,_owner:Mz.current}}Dg.Fragment=Sz;Dg.jsx=$3;Dg.jsxs=$3;Ng.exports=Dg;const at=Ng.exports.jsx,ka=Ng.exports.jsxs,Og=Ng.exports.Fragment;function lE(n){return Array.isArray(n)?n:[n]}function Ez(n,e){window.dispatchEvent(new CustomEvent(n,{detail:e}))}const Tz=typeof window!="undefined"?te.exports.useLayoutEffect:te.exports.useEffect;function Cz(n){function e(r){const i=Object.keys(r).reduce((s,o)=>(s[`${n}:${o}`]=a=>r[o](a.detail),s),{});Tz(()=>(Object.keys(i).forEach(s=>{window.removeEventListener(s,i[s]),window.addEventListener(s,i[s])}),()=>Object.keys(i).forEach(s=>{window.removeEventListener(s,i[s])})),[i])}function t(r){return(...i)=>Ez(`${n}:${String(r)}`,i[0])}return[e,t]}function j3(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n))for(e=0;e<n.length;e++)n[e]&&(t=j3(n[e]))&&(r&&(r+=" "),r+=t);else for(e in n)n[e]&&(r&&(r+=" "),r+=e);return r}function Az(){for(var n=0,e,t,r="";n<arguments.length;)(e=arguments[n++])&&(t=j3(e))&&(r&&(r+=" "),r+=t);return r}const X3={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function Pz(n){return()=>({fontFamily:n.fontFamily||"sans-serif"})}var Rz=Object.defineProperty,uE=Object.getOwnPropertySymbols,Lz=Object.prototype.hasOwnProperty,Iz=Object.prototype.propertyIsEnumerable,cE=(n,e,t)=>e in n?Rz(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,fE=(n,e)=>{for(var t in e||(e={}))Lz.call(e,t)&&cE(n,t,e[t]);if(uE)for(var t of uE(e))Iz.call(e,t)&&cE(n,t,e[t]);return n};function Nz(n){return e=>({WebkitTapHighlightColor:"transparent",[e||"&:focus"]:fE({},n.focusRing==="always"||n.focusRing==="auto"?n.focusRingStyles.styles(n):n.focusRingStyles.resetStyles(n)),[e?e.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:fE({},n.focusRing==="auto"||n.focusRing==="never"?n.focusRingStyles.resetStyles(n):null)})}function ld(n){return e=>typeof n.primaryShade=="number"?n.primaryShade:n.primaryShade[e||n.colorScheme]}function Q1(n){const e=ld(n);return(t,r,i=!0,s=!0)=>{if(typeof t=="string"&&t.includes(".")){const[a,c]=t.split("."),f=parseInt(c,10);if(a in n.colors&&f>=0&&f<10)return n.colors[a][typeof r=="number"&&!s?r:f]}const o=typeof r=="number"?r:e();return t in n.colors?n.colors[t][o]:i?n.colors[n.primaryColor][o]:t}}function Y3(n){let e="";for(let t=1;t<n.length-1;t+=1)e+=`${n[t]} ${t/(n.length-1)*100}%, `;return`${n[0]} 0%, ${e}${n[n.length-1]} 100%`}function Dz(n,...e){return`linear-gradient(${n}deg, ${Y3(e)})`}function Oz(...n){return`radial-gradient(circle, ${Y3(n)})`}function q3(n){const e=Q1(n),t=ld(n);return r=>{const i={from:(r==null?void 0:r.from)||n.defaultGradient.from,to:(r==null?void 0:r.to)||n.defaultGradient.to,deg:(r==null?void 0:r.deg)||n.defaultGradient.deg};return`linear-gradient(${i.deg}deg, ${e(i.from,t(),!1)} 0%, ${e(i.to,t(),!1)} 100%)`}}function K1(n){if(typeof n.size=="number")return n.size;const e=n.sizes[n.size];return e!==void 0?e:n.size||n.sizes.md}function kz(n){return e=>`@media (min-width: ${K1({size:e,sizes:n.breakpoints})}px)`}function zz(n){return e=>`@media (max-width: ${K1({size:e,sizes:n.breakpoints})-1}px)`}function Fz(n){return/^#?([0-9A-F]{3}){1,2}$/i.test(n)}function Uz(n){let e=n.replace("#","");if(e.length===3){const o=e.split("");e=[o[0],o[0],o[1],o[1],o[2],o[2]].join("")}const t=parseInt(e,16),r=t>>16&255,i=t>>8&255,s=t&255;return{r,g:i,b:s,a:1}}function Bz(n){const[e,t,r,i]=n.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:e,g:t,b:r,a:i||1}}function J1(n){return Fz(n)?Uz(n):n.startsWith("rgb")?Bz(n):{r:0,g:0,b:0,a:1}}function Yl(n,e){if(typeof n!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";const{r:t,g:r,b:i}=J1(n);return`rgba(${t}, ${r}, ${i}, ${e})`}function Vz(n=0){return{position:"absolute",top:n,right:n,left:n,bottom:n}}function Gz(n,e){const{r:t,g:r,b:i,a:s}=J1(n),o=1-e,a=c=>Math.round(c*o);return`rgba(${a(t)}, ${a(r)}, ${a(i)}, ${s})`}function Hz(n,e){const{r:t,g:r,b:i,a:s}=J1(n),o=a=>Math.round(a+(255-a)*e);return`rgba(${o(t)}, ${o(r)}, ${o(i)}, ${s})`}function Wz(n){return e=>{if(typeof e=="number")return e;const t=typeof n.defaultRadius=="number"?n.defaultRadius:n.radius[n.defaultRadius]||n.defaultRadius;return n.radius[e]||e||t}}function $z(n,e){if(typeof n=="string"&&n.includes(".")){const[t,r]=n.split("."),i=parseInt(r,10);if(t in e.colors&&i>=0&&i<10)return{isSplittedColor:!0,key:t,shade:i}}return{isSplittedColor:!1}}function jz(n){const e=Q1(n),t=ld(n),r=q3(n);return({variant:i,color:s,gradient:o,primaryFallback:a})=>{const c=$z(s,n);switch(i){case"light":return{border:"transparent",background:Yl(e(s,n.colorScheme==="dark"?8:0,a,!1),n.colorScheme==="dark"?.2:1),color:s==="dark"?n.colorScheme==="dark"?n.colors.dark[0]:n.colors.dark[9]:e(s,n.colorScheme==="dark"?2:t("light")),hover:Yl(e(s,n.colorScheme==="dark"?7:1,a,!1),n.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:s==="dark"?n.colorScheme==="dark"?n.colors.dark[0]:n.colors.dark[9]:e(s,n.colorScheme==="dark"?2:t("light")),hover:Yl(e(s,n.colorScheme==="dark"?8:0,a,!1),n.colorScheme==="dark"?.2:1)};case"outline":return{border:e(s,n.colorScheme==="dark"?5:t("light")),background:"transparent",color:e(s,n.colorScheme==="dark"?5:t("light")),hover:n.colorScheme==="dark"?Yl(e(s,5,a,!1),.05):Yl(e(s,0,a,!1),.35)};case"default":return{border:n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[4],background:n.colorScheme==="dark"?n.colors.dark[6]:n.white,color:n.colorScheme==="dark"?n.white:n.black,hover:n.colorScheme==="dark"?n.colors.dark[5]:n.colors.gray[0]};case"white":return{border:"transparent",background:n.white,color:e(s,t()),hover:null};case"transparent":return{border:"transparent",color:s==="dark"?n.colorScheme==="dark"?n.colors.dark[0]:n.colors.dark[9]:e(s,n.colorScheme==="dark"?2:t("light")),background:"transparent",hover:null};case"gradient":return{background:r(o),color:n.white,border:"transparent",hover:null};default:{const f=t(),d=c.isSplittedColor?c.shade:f,h=c.isSplittedColor?c.key:s;return{border:"transparent",background:e(h,d,a),color:n.white,hover:e(h,d===9?8:d+1)}}}}}function Xz(n){return e=>{const t=ld(n)(e);return n.colors[n.primaryColor][t]}}function Yz(n){return{"@media (hover: hover)":{"&:hover":n},"@media (hover: none)":{"&:active":n}}}function qz(n){return()=>({userSelect:"none",color:n.colorScheme==="dark"?n.colors.dark[3]:n.colors.gray[5]})}const Pn={fontStyles:Pz,themeColor:Q1,focusStyles:Nz,linearGradient:Dz,radialGradient:Oz,smallerThan:zz,largerThan:kz,rgba:Yl,size:K1,cover:Vz,darken:Gz,lighten:Hz,radius:Wz,variant:jz,primaryShade:ld,hover:Yz,gradient:q3,primaryColor:Xz,placeholderStyles:qz};var Zz=Object.defineProperty,Qz=Object.defineProperties,Kz=Object.getOwnPropertyDescriptors,dE=Object.getOwnPropertySymbols,Jz=Object.prototype.hasOwnProperty,e4=Object.prototype.propertyIsEnumerable,hE=(n,e,t)=>e in n?Zz(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,t4=(n,e)=>{for(var t in e||(e={}))Jz.call(e,t)&&hE(n,t,e[t]);if(dE)for(var t of dE(e))e4.call(e,t)&&hE(n,t,e[t]);return n},n4=(n,e)=>Qz(n,Kz(e));function r4(n){return n4(t4({},n),{fn:{fontStyles:Pn.fontStyles(n),themeColor:Pn.themeColor(n),focusStyles:Pn.focusStyles(n),largerThan:Pn.largerThan(n),smallerThan:Pn.smallerThan(n),radialGradient:Pn.radialGradient,linearGradient:Pn.linearGradient,gradient:Pn.gradient(n),rgba:Pn.rgba,size:Pn.size,cover:Pn.cover,lighten:Pn.lighten,darken:Pn.darken,primaryShade:Pn.primaryShade(n),radius:Pn.radius(n),variant:Pn.variant(n),hover:Pn.hover,primaryColor:Pn.primaryColor(n),placeholderStyles:Pn.placeholderStyles(n)}})}Object.keys(X3);const i4={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",dateFormat:"MMMM D, YYYY",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:X3,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",sm:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 10px 15px -5px, rgba(0, 0, 0, 0.04) 0px 7px 7px -5px",md:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px",lg:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 28px 23px -7px, rgba(0, 0, 0, 0.04) 0px 12px 12px -7px",xl:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 36px 28px -7px, rgba(0, 0, 0, 0.04) 0px 17px 17px -7px"},fontSizes:{xs:12,sm:14,md:16,lg:18,xl:20},radius:{xs:2,sm:4,md:8,lg:16,xl:32},spacing:{xs:10,sm:12,md:16,lg:20,xl:24},breakpoints:{xs:576,sm:768,md:992,lg:1200,xl:1400},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:34,lineHeight:1.3,fontWeight:void 0},h2:{fontSize:26,lineHeight:1.35,fontWeight:void 0},h3:{fontSize:22,lineHeight:1.4,fontWeight:void 0},h4:{fontSize:18,lineHeight:1.45,fontWeight:void 0},h5:{fontSize:16,lineHeight:1.5,fontWeight:void 0},h6:{fontSize:14,lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(1px)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:n=>({outlineOffset:2,outline:`2px solid ${n.colors[n.primaryColor][n.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:n=>({outline:"none",borderColor:n.colors[n.primaryColor][typeof n.primaryShade=="object"?n.primaryShade[n.colorScheme]:n.primaryShade]})}},Z3=r4(i4);function s4(n){if(n.sheet)return n.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===n)return document.styleSheets[e]}function o4(n){var e=document.createElement("style");return e.setAttribute("data-emotion",n.key),n.nonce!==void 0&&e.setAttribute("nonce",n.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var a4=function(){function n(t){var r=this;this._insertTag=function(i){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,s),r.tags.push(i)},this.isSpeedy=t.speedy===void 0?!0:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=n.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(o4(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=s4(i);try{s.insertRule(r,s.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0},n}(),ir="-ms-",Bm="-moz-",Ut="-webkit-",Q3="comm",eS="rule",tS="decl",l4="@import",K3="@keyframes",u4=Math.abs,kg=String.fromCharCode,c4=Object.assign;function f4(n,e){return jn(n,0)^45?(((e<<2^jn(n,0))<<2^jn(n,1))<<2^jn(n,2))<<2^jn(n,3):0}function J3(n){return n.trim()}function d4(n,e){return(n=e.exec(n))?n[0]:n}function Vt(n,e,t){return n.replace(e,t)}function ex(n,e){return n.indexOf(e)}function jn(n,e){return n.charCodeAt(e)|0}function Df(n,e,t){return n.slice(e,t)}function ns(n){return n.length}function nS(n){return n.length}function Yh(n,e){return e.push(n),n}function h4(n,e){return n.map(e).join("")}var zg=1,Ru=1,eP=0,Lr=0,bn=0,Gu="";function Fg(n,e,t,r,i,s,o){return{value:n,root:e,parent:t,type:r,props:i,children:s,line:zg,column:Ru,length:o,return:""}}function Ec(n,e){return c4(Fg("",null,null,"",null,null,0),n,{length:-n.length},e)}function p4(){return bn}function m4(){return bn=Lr>0?jn(Gu,--Lr):0,Ru--,bn===10&&(Ru=1,zg--),bn}function $r(){return bn=Lr<eP?jn(Gu,Lr++):0,Ru++,bn===10&&(Ru=1,zg++),bn}function us(){return jn(Gu,Lr)}function rm(){return Lr}function ud(n,e){return Df(Gu,n,e)}function Of(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tP(n){return zg=Ru=1,eP=ns(Gu=n),Lr=0,[]}function nP(n){return Gu="",n}function im(n){return J3(ud(Lr-1,tx(n===91?n+2:n===40?n+1:n)))}function g4(n){for(;(bn=us())&&bn<33;)$r();return Of(n)>2||Of(bn)>3?"":" "}function v4(n,e){for(;--e&&$r()&&!(bn<48||bn>102||bn>57&&bn<65||bn>70&&bn<97););return ud(n,rm()+(e<6&&us()==32&&$r()==32))}function tx(n){for(;$r();)switch(bn){case n:return Lr;case 34:case 39:n!==34&&n!==39&&tx(bn);break;case 40:n===41&&tx(n);break;case 92:$r();break}return Lr}function y4(n,e){for(;$r()&&n+bn!==47+10;)if(n+bn===42+42&&us()===47)break;return"/*"+ud(e,Lr-1)+"*"+kg(n===47?n:$r())}function _4(n){for(;!Of(us());)$r();return ud(n,Lr)}function x4(n){return nP(sm("",null,null,null,[""],n=tP(n),0,[0],n))}function sm(n,e,t,r,i,s,o,a,c){for(var f=0,d=0,h=o,p=0,g=0,v=0,y=1,x=1,w=1,_=0,M="",E=i,C=s,P=r,R=M;x;)switch(v=_,_=$r()){case 40:if(v!=108&&jn(R,h-1)==58){ex(R+=Vt(im(_),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:R+=im(_);break;case 9:case 10:case 13:case 32:R+=g4(v);break;case 92:R+=v4(rm()-1,7);continue;case 47:switch(us()){case 42:case 47:Yh(S4(y4($r(),rm()),e,t),c);break;default:R+="/"}break;case 123*y:a[f++]=ns(R)*w;case 125*y:case 59:case 0:switch(_){case 0:case 125:x=0;case 59+d:g>0&&ns(R)-h&&Yh(g>32?mE(R+";",r,t,h-1):mE(Vt(R," ","")+";",r,t,h-2),c);break;case 59:R+=";";default:if(Yh(P=pE(R,e,t,f,d,i,a,M,E=[],C=[],h),s),_===123)if(d===0)sm(R,e,P,P,E,s,h,a,C);else switch(p===99&&jn(R,3)===110?100:p){case 100:case 109:case 115:sm(n,P,P,r&&Yh(pE(n,P,P,0,0,i,a,M,i,E=[],h),C),i,C,h,a,r?E:C);break;default:sm(R,P,P,P,[""],C,0,a,C)}}f=d=g=0,y=w=1,M=R="",h=o;break;case 58:h=1+ns(R),g=v;default:if(y<1){if(_==123)--y;else if(_==125&&y++==0&&m4()==125)continue}switch(R+=kg(_),_*y){case 38:w=d>0?1:(R+="\f",-1);break;case 44:a[f++]=(ns(R)-1)*w,w=1;break;case 64:us()===45&&(R+=im($r())),p=us(),d=h=ns(M=R+=_4(rm())),_++;break;case 45:v===45&&ns(R)==2&&(y=0)}}return s}function pE(n,e,t,r,i,s,o,a,c,f,d){for(var h=i-1,p=i===0?s:[""],g=nS(p),v=0,y=0,x=0;v<r;++v)for(var w=0,_=Df(n,h+1,h=u4(y=o[v])),M=n;w<g;++w)(M=J3(y>0?p[w]+" "+_:Vt(_,/&\f/g,p[w])))&&(c[x++]=M);return Fg(n,e,t,i===0?eS:a,c,f,d)}function S4(n,e,t){return Fg(n,e,t,Q3,kg(p4()),Df(n,2,-2),0)}function mE(n,e,t,r){return Fg(n,e,t,tS,Df(n,0,r),Df(n,r+1,-1),r)}function xu(n,e){for(var t="",r=nS(n),i=0;i<r;i++)t+=e(n[i],i,n,e)||"";return t}function w4(n,e,t,r){switch(n.type){case l4:case tS:return n.return=n.return||n.value;case Q3:return"";case K3:return n.return=n.value+"{"+xu(n.children,r)+"}";case eS:n.value=n.props.join(",")}return ns(t=xu(n.children,r))?n.return=n.value+"{"+t+"}":""}function M4(n){var e=nS(n);return function(t,r,i,s){for(var o="",a=0;a<e;a++)o+=n[a](t,r,i,s)||"";return o}}function b4(n){return function(e){e.root||(e=e.return)&&n(e)}}function E4(n){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=n(t)),e[t]}}var T4=function(e,t,r){for(var i=0,s=0;i=s,s=us(),i===38&&s===12&&(t[r]=1),!Of(s);)$r();return ud(e,Lr)},C4=function(e,t){var r=-1,i=44;do switch(Of(i)){case 0:i===38&&us()===12&&(t[r]=1),e[r]+=T4(Lr-1,t,r);break;case 2:e[r]+=im(i);break;case 4:if(i===44){e[++r]=us()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=kg(i)}while(i=$r());return e},A4=function(e,t){return nP(C4(tP(e),t))},gE=new WeakMap,P4=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!gE.get(r))&&!i){gE.set(e,!0);for(var s=[],o=A4(t,s),a=r.props,c=0,f=0;c<o.length;c++)for(var d=0;d<a.length;d++,f++)e.props[f]=s[c]?o[c].replace(/&\f/g,a[d]):a[d]+" "+o[c]}}},R4=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function rP(n,e){switch(f4(n,e)){case 5103:return Ut+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ut+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return Ut+n+Bm+n+ir+n+n;case 6828:case 4268:return Ut+n+ir+n+n;case 6165:return Ut+n+ir+"flex-"+n+n;case 5187:return Ut+n+Vt(n,/(\w+).+(:[^]+)/,Ut+"box-$1$2"+ir+"flex-$1$2")+n;case 5443:return Ut+n+ir+"flex-item-"+Vt(n,/flex-|-self/,"")+n;case 4675:return Ut+n+ir+"flex-line-pack"+Vt(n,/align-content|flex-|-self/,"")+n;case 5548:return Ut+n+ir+Vt(n,"shrink","negative")+n;case 5292:return Ut+n+ir+Vt(n,"basis","preferred-size")+n;case 6060:return Ut+"box-"+Vt(n,"-grow","")+Ut+n+ir+Vt(n,"grow","positive")+n;case 4554:return Ut+Vt(n,/([^-])(transform)/g,"$1"+Ut+"$2")+n;case 6187:return Vt(Vt(Vt(n,/(zoom-|grab)/,Ut+"$1"),/(image-set)/,Ut+"$1"),n,"")+n;case 5495:case 3959:return Vt(n,/(image-set\([^]*)/,Ut+"$1$`$1");case 4968:return Vt(Vt(n,/(.+:)(flex-)?(.*)/,Ut+"box-pack:$3"+ir+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ut+n+n;case 4095:case 3583:case 4068:case 2532:return Vt(n,/(.+)-inline(.+)/,Ut+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ns(n)-1-e>6)switch(jn(n,e+1)){case 109:if(jn(n,e+4)!==45)break;case 102:return Vt(n,/(.+:)(.+)-([^]+)/,"$1"+Ut+"$2-$3$1"+Bm+(jn(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~ex(n,"stretch")?rP(Vt(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(jn(n,e+1)!==115)break;case 6444:switch(jn(n,ns(n)-3-(~ex(n,"!important")&&10))){case 107:return Vt(n,":",":"+Ut)+n;case 101:return Vt(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ut+(jn(n,14)===45?"inline-":"")+"box$3$1"+Ut+"$2$3$1"+ir+"$2box$3")+n}break;case 5936:switch(jn(n,e+11)){case 114:return Ut+n+ir+Vt(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return Ut+n+ir+Vt(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return Ut+n+ir+Vt(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return Ut+n+ir+n+n}return n}var L4=function(e,t,r,i){if(e.length>-1&&!e.return)switch(e.type){case tS:e.return=rP(e.value,e.length);break;case K3:return xu([Ec(e,{value:Vt(e.value,"@","@"+Ut)})],i);case eS:if(e.length)return h4(e.props,function(s){switch(d4(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return xu([Ec(e,{props:[Vt(s,/:(read-\w+)/,":"+Bm+"$1")]})],i);case"::placeholder":return xu([Ec(e,{props:[Vt(s,/:(plac\w+)/,":"+Ut+"input-$1")]}),Ec(e,{props:[Vt(s,/:(plac\w+)/,":"+Bm+"$1")]}),Ec(e,{props:[Vt(s,/:(plac\w+)/,ir+"input-$1")]})],i)}return""})}},I4=[L4],N4=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var x=y.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=e.stylisPlugins||I4,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var x=y.getAttribute("data-emotion").split(" "),w=1;w<x.length;w++)s[x[w]]=!0;a.push(y)});var c,f=[P4,R4];{var d,h=[w4,b4(function(y){d.insert(y)})],p=M4(f.concat(i,h)),g=function(x){return xu(x4(x),p)};c=function(x,w,_,M){d=_,g(x?x+"{"+w.styles+"}":w.styles),M&&(v.inserted[w.name]=!0)}}var v={key:t,sheet:new a4({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:c};return v.sheet.hydrate(a),v},D4=N4;function Ya(){return Ya=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ya.apply(this,arguments)}var O4=!0;function k4(n,e,t){var r="";return t.split(" ").forEach(function(i){n[i]!==void 0?e.push(n[i]+";"):r+=i+" "}),r}var z4=function(e,t,r){var i=e.key+"-"+t.name;(r===!1||O4===!1)&&e.registered[i]===void 0&&(e.registered[i]=t.styles)},F4=function(e,t,r){z4(e,t,r);var i=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var s=t;do e.insert(t===s?"."+i:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function U4(n){for(var e=0,t,r=0,i=n.length;i>=4;++r,i-=4)t=n.charCodeAt(r)&255|(n.charCodeAt(++r)&255)<<8|(n.charCodeAt(++r)&255)<<16|(n.charCodeAt(++r)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(n.charCodeAt(r+2)&255)<<16;case 2:e^=(n.charCodeAt(r+1)&255)<<8;case 1:e^=n.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var B4={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},V4=/[A-Z]|^ms/g,G4=/_EMO_([^_]+?)_([^]*?)_EMO_/g,iP=function(e){return e.charCodeAt(1)===45},vE=function(e){return e!=null&&typeof e!="boolean"},ey=E4(function(n){return iP(n)?n:n.replace(V4,"-$&").toLowerCase()}),yE=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(G4,function(r,i,s){return rs={name:i,styles:s,next:rs},i})}return B4[e]!==1&&!iP(e)&&typeof t=="number"&&t!==0?t+"px":t};function kf(n,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return rs={name:t.name,styles:t.styles,next:rs},t.name;if(t.styles!==void 0){var r=t.next;if(r!==void 0)for(;r!==void 0;)rs={name:r.name,styles:r.styles,next:rs},r=r.next;var i=t.styles+";";return i}return H4(n,e,t)}case"function":{if(n!==void 0){var s=rs,o=t(n);return rs=s,kf(n,e,o)}break}}if(e==null)return t;var a=e[t];return a!==void 0?a:t}function H4(n,e,t){var r="";if(Array.isArray(t))for(var i=0;i<t.length;i++)r+=kf(n,e,t[i])+";";else for(var s in t){var o=t[s];if(typeof o!="object")e!=null&&e[o]!==void 0?r+=s+"{"+e[o]+"}":vE(o)&&(r+=ey(s)+":"+yE(s,o)+";");else if(Array.isArray(o)&&typeof o[0]=="string"&&(e==null||e[o[0]]===void 0))for(var a=0;a<o.length;a++)vE(o[a])&&(r+=ey(s)+":"+yE(s,o[a])+";");else{var c=kf(n,e,o);switch(s){case"animation":case"animationName":{r+=ey(s)+":"+c+";";break}default:r+=s+"{"+c+"}"}}}return r}var _E=/label:\s*([^\s;\n{]+)\s*(;|$)/g,rs,W4=function(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,s="";rs=void 0;var o=e[0];o==null||o.raw===void 0?(i=!1,s+=kf(r,t,o)):s+=o[0];for(var a=1;a<e.length;a++)s+=kf(r,t,e[a]),i&&(s+=o[a]);_E.lastIndex=0;for(var c="",f;(f=_E.exec(s))!==null;)c+="-"+f[1];var d=U4(s)+c;return{name:d,styles:s,next:rs}};function sP(n){return Object.keys(n).reduce((e,t)=>(n[t]!==void 0&&(e[t]=n[t]),e),{})}var $4=Object.defineProperty,xE=Object.getOwnPropertySymbols,j4=Object.prototype.hasOwnProperty,X4=Object.prototype.propertyIsEnumerable,SE=(n,e,t)=>e in n?$4(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ty=(n,e)=>{for(var t in e||(e={}))j4.call(e,t)&&SE(n,t,e[t]);if(xE)for(var t of xE(e))X4.call(e,t)&&SE(n,t,e[t]);return n};const oP=te.exports.createContext({theme:Z3});function Yo(){var n;return((n=te.exports.useContext(oP))==null?void 0:n.theme)||Z3}function Y4(n){const e=Yo(),t=r=>{var i,s;return{styles:((i=e.components[r])==null?void 0:i.styles)||{},classNames:((s=e.components[r])==null?void 0:s.classNames)||{}}};return Array.isArray(n)?n.map(t):[t(n)]}function aP(){var n;return(n=te.exports.useContext(oP))==null?void 0:n.emotionCache}function Mi(n,e,t){var r;const i=Yo(),s=(r=i.components[n])==null?void 0:r.defaultProps,o=typeof s=="function"?s(i):s;return ty(ty(ty({},e),o),sP(t))}const q4={app:100,modal:200,popover:300,overlay:400,max:9999};function rS(n){return q4[n]}function Z4(n,e){const t=te.exports.useRef();return(!t.current||e.length!==t.current.prevDeps.length||t.current.prevDeps.map((r,i)=>r===e[i]).indexOf(!1)>=0)&&(t.current={v:n(),prevDeps:[...e]}),t.current.v}const Q4=D4({key:"mantine",prepend:!0});function K4(){return aP()||Q4}var J4=Object.defineProperty,wE=Object.getOwnPropertySymbols,eF=Object.prototype.hasOwnProperty,tF=Object.prototype.propertyIsEnumerable,ME=(n,e,t)=>e in n?J4(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,nF=(n,e)=>{for(var t in e||(e={}))eF.call(e,t)&&ME(n,t,e[t]);if(wE)for(var t of wE(e))tF.call(e,t)&&ME(n,t,e[t]);return n};const ny="ref";function rF(n){let e;if(n.length!==1)return{args:n,ref:e};const[t]=n;if(!(t instanceof Object))return{args:n,ref:e};if(!(ny in t))return{args:n,ref:e};e=t[ny];const r=nF({},t);return delete r[ny],{args:[r],ref:e}}const{cssFactory:iF}=(()=>{function n(t,r,i){const s=[],o=k4(t,s,i);return s.length<2?i:o+r(s)}function e(t){const{cache:r}=t,i=(...o)=>{const{ref:a,args:c}=rF(o),f=W4(c,r.registered);return F4(r,f,!1),`${r.key}-${f.name}${a===void 0?"":` ${a}`}`};return{css:i,cx:(...o)=>n(r.registered,i,Az(o))}}return{cssFactory:e}})();function lP(){const n=K4();return Z4(()=>iF({cache:n}),[n])}function sF({cx:n,classes:e,context:t,classNames:r,name:i,cache:s}){const o=t.reduce((a,c)=>(Object.keys(c.classNames).forEach(f=>{typeof a[f]!="string"?a[f]=`${c.classNames[f]}`:a[f]=`${a[f]} ${c.classNames[f]}`}),a),{});return Object.keys(e).reduce((a,c)=>(a[c]=n(e[c],o[c],r!=null&&r[c],Array.isArray(i)?i.filter(Boolean).map(f=>`${(s==null?void 0:s.key)||"mantine"}-${f}-${c}`).join(" "):i?`${(s==null?void 0:s.key)||"mantine"}-${i}-${c}`:null),a),{})}var oF=Object.defineProperty,bE=Object.getOwnPropertySymbols,aF=Object.prototype.hasOwnProperty,lF=Object.prototype.propertyIsEnumerable,EE=(n,e,t)=>e in n?oF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ry=(n,e)=>{for(var t in e||(e={}))aF.call(e,t)&&EE(n,t,e[t]);if(bE)for(var t of bE(e))lF.call(e,t)&&EE(n,t,e[t]);return n};function uF(n){return`__mantine-ref-${n||""}`}function TE(n,e,t){const r=i=>typeof i=="function"?i(e,t||{}):i||{};return Array.isArray(n)?n.map(i=>r(i.styles)).reduce((i,s)=>(Object.keys(s).forEach(o=>{i[o]?i[o]=ry(ry({},i[o]),s[o]):i[o]=ry({},s[o])}),i),{}):r(n)}function ds(n){const e=typeof n=="function"?n:()=>n;function t(r,i){const s=Yo(),o=Y4(i==null?void 0:i.name),a=aP(),{css:c,cx:f}=lP(),d=e(s,r,uF),h=TE(i==null?void 0:i.styles,s,r),p=TE(o,s,r),g=Object.fromEntries(Object.keys(d).map(v=>{const y=f({[c(d[v])]:!(i!=null&&i.unstyled)},c(p[v]),c(h[v]));return[v,y]}));return{classes:sF({cx:f,classes:g,context:o,classNames:i==null?void 0:i.classNames,name:i==null?void 0:i.name,cache:a}),cx:f,theme:s}}return t}var cF=Object.defineProperty,fF=Object.defineProperties,dF=Object.getOwnPropertyDescriptors,CE=Object.getOwnPropertySymbols,hF=Object.prototype.hasOwnProperty,pF=Object.prototype.propertyIsEnumerable,AE=(n,e,t)=>e in n?cF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Tc=(n,e)=>{for(var t in e||(e={}))hF.call(e,t)&&AE(n,t,e[t]);if(CE)for(var t of CE(e))pF.call(e,t)&&AE(n,t,e[t]);return n},Cc=(n,e)=>fF(n,dF(e));const Ac={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(.9) translateY(10px)"},transitionProperty:"transform, opacity"},qh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Cc(Tc({},Ac),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Cc(Tc({},Ac),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Cc(Tc({},Ac),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Cc(Tc({},Ac),{common:{transformOrigin:"top left"}}),"pop-top-right":Cc(Tc({},Ac),{common:{transformOrigin:"top right"}})};function mF(n,e){try{return n.addEventListener("change",e),()=>n.removeEventListener("change",e)}catch{return n.addListener(e),()=>n.removeListener(e)}}function gF(n,e){return typeof e=="boolean"?e:typeof window!="undefined"&&"matchMedia"in window?window.matchMedia(n).matches:!1}function vF(n,e,{getInitialValueInEffect:t}={getInitialValueInEffect:!0}){const[r,i]=te.exports.useState(t?e:gF(n,e)),s=te.exports.useRef();return te.exports.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(n),i(s.current.matches),mF(s.current,o=>i(o.matches))},[n]),r}const uP=typeof document!="undefined"?te.exports.useLayoutEffect:te.exports.useEffect;function cP(n,e){const t=te.exports.useRef(!1);te.exports.useEffect(()=>()=>{t.current=!1},[]),te.exports.useEffect(()=>{if(t.current)return n();t.current=!0},e)}function yF({opened:n,shouldReturnFocus:e=!0}){const t=te.exports.useRef(),r=()=>{var i;t.current&&"focus"in t.current&&typeof t.current.focus=="function"&&((i=t.current)==null||i.focus({preventScroll:!0}))};return cP(()=>{let i=-1;const s=o=>{o.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),n?t.current=document.activeElement:e&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[n,e]),r}const _F=/input|select|textarea|button|object/,fP="a, input, select, textarea, button, object, [tabindex]";function xF(n){return n.style.display==="none"}function SF(n){if(n.getAttribute("aria-hidden")||n.getAttribute("hidden")||n.getAttribute("type")==="hidden")return!1;let t=n;for(;t&&!(t===document.body||t.nodeType===11);){if(xF(t))return!1;t=t.parentNode}return!0}function dP(n){let e=n.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function nx(n){const e=n.nodeName.toLowerCase(),t=!Number.isNaN(dP(n));return(_F.test(e)&&!n.disabled||n instanceof HTMLAnchorElement&&n.href||t)&&SF(n)}function hP(n){const e=dP(n);return(Number.isNaN(e)||e>=0)&&nx(n)}function wF(n){return Array.from(n.querySelectorAll(fP)).filter(hP)}function MF(n,e){const t=wF(n);if(!t.length){e.preventDefault();return}const r=t[e.shiftKey?0:t.length-1],i=n.getRootNode();if(!(r===i.activeElement||n===i.activeElement))return;e.preventDefault();const o=t[e.shiftKey?t.length-1:0];o&&o.focus()}function bF(n,e="body > :not(script)"){const t=Array.from(document.querySelectorAll(e)).map(r=>{var i;if(((i=r==null?void 0:r.shadowRoot)==null?void 0:i.contains(n))||r.contains(n))return;const s=r.getAttribute("aria-hidden");return(s===null||s==="false")&&r.setAttribute("aria-hidden","true"),{node:r,ariaHidden:s}});return()=>{t.forEach(r=>{!r||(r.ariaHidden===null?r.node.removeAttribute("aria-hidden"):r.node.setAttribute("aria-hidden",r.ariaHidden))})}}function EF(n=!0){const e=te.exports.useRef(),t=te.exports.useRef(null),r=te.exports.useCallback(i=>{if(!!n&&i!==null&&(t.current=bF(i),e.current!==i))if(i){const s=()=>{let o=i.querySelector("[data-autofocus]");if(!o){const a=Array.from(i.querySelectorAll(fP));o=a.find(hP)||a.find(nx)||null,!o&&nx(i)&&(o=i)}o&&o.focus({preventScroll:!0})};setTimeout(()=>{i.getRootNode()&&s()}),e.current=i}else e.current=null},[n]);return te.exports.useEffect(()=>{if(!n)return;const i=s=>{s.key==="Tab"&&e.current&&MF(e.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),t.current&&t.current()}},[n]),r}const TF=()=>`mantine-${Math.random().toString(36).slice(2,11)}`,CF=ke["useId".toString()]||(()=>{});function AF(){const[n,e]=te.exports.useState("");return uP(()=>{e(TF())},[]),n}function PF(){const n=CF();return n?`mantine-${n.replace(/:/g,"")}`:""}function RF(n){return typeof n=="string"?n:PF()||AF()}function LF(n,e,t){te.exports.useEffect(()=>(window.addEventListener(n,e,t),()=>window.removeEventListener(n,e,t)),[n,e])}function IF(n,e){typeof n=="function"?n(e):typeof n=="object"&&n!==null&&"current"in n&&(n.current=e)}function NF(...n){return e=>{n.forEach(t=>IF(t,e))}}function DF(...n){return te.exports.useCallback(NF(...n),n)}function OF(n,e){return vF("(prefers-reduced-motion: reduce)",n,e)}function kF(){if(typeof window=="undefined"||typeof document=="undefined")return 0;const n=parseInt(window.getComputedStyle(document.body).paddingRight,10),e=window.innerWidth-document.documentElement.clientWidth;return n+e}const zF=({disableBodyPadding:n})=>{const e=n?null:kF();return`body {
--removed-scroll-width: ${e}px;
touch-action: none;
overflow: hidden !important;
position: relative !important;
${e?"padding-right: var(--removed-scroll-width) !important;":""}
`};function FF(n,e){n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}function UF(n){(document.head||document.getElementsByTagName("head")[0]).appendChild(n)}function BF(){const n=document.createElement("style");return n.type="text/css",n.setAttribute("mantine-scroll-lock",""),n}function VF(n,e={disableBodyPadding:!1}){const[t,r]=te.exports.useState(n||!1),i=te.exports.useRef(0),{disableBodyPadding:s}=e,o=te.exports.useRef(null),a=()=>{i.current=window.scrollY;const f=zF({disableBodyPadding:s}),d=BF();FF(d,f),UF(d),o.current=d},c=()=>{!(o!=null&&o.current)||(o.current.parentNode.removeChild(o.current),o.current=null)};return te.exports.useEffect(()=>(t?a():c(),c),[t]),te.exports.useEffect(()=>{n!==void 0&&r(n)},[n]),te.exports.useEffect(()=>{n===void 0&&typeof window!="undefined"&&window.document.body.style.overflow==="hidden"&&r(!0)},[r]),[t,r]}function iy(){return`mantine-${Math.random().toString(36).slice(2,11)}`}var PE=Object.getOwnPropertySymbols,GF=Object.prototype.hasOwnProperty,HF=Object.prototype.propertyIsEnumerable,WF=(n,e)=>{var t={};for(var r in n)GF.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&PE)for(var r of PE(n))e.indexOf(r)<0&&HF.call(n,r)&&(t[r]=n[r]);return t};function $F(n){const e=n,{m:t,mx:r,my:i,mt:s,mb:o,ml:a,mr:c,p:f,px:d,py:h,pt:p,pb:g,pl:v,pr:y,bg:x,c:w,opacity:_,ff:M,fz:E,fw:C,lts:P,ta:R,lh:T,fs:L,tt:D,td:Y,w:fe,miw:q,maw:$,h:se,mih:le,mah:pe,bgsz:z,bgp:F,bgr:G,bga:Z,pos:k,top:W,left:N,bottom:me,right:X,inset:Te,display:Ce}=e,we=WF(e,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:sP({m:t,mx:r,my:i,mt:s,mb:o,ml:a,mr:c,p:f,px:d,py:h,pt:p,pb:g,pl:v,pr:y,bg:x,c:w,opacity:_,ff:M,fz:E,fw:C,lts:P,ta:R,lh:T,fs:L,tt:D,td:Y,w:fe,miw:q,maw:$,h:se,mih:le,mah:pe,bgsz:z,bgp:F,bgr:G,bga:Z,pos:k,top:W,left:N,bottom:me,right:X,inset:Te,display:Ce}),rest:we}}function jF(n,e){const t=Object.keys(n).filter(r=>r!=="base").sort((r,i)=>e.fn.size({size:r,sizes:e.breakpoints})-e.fn.size({size:i,sizes:e.breakpoints}));return"base"in n?["base",...t]:t}function XF({value:n,theme:e,getValue:t,property:r}){if(n==null)return;if(typeof n=="object")return jF(n,e).reduce((o,a)=>{if(a==="base"&&n.base!==void 0){const f=t(n.base,e);return Array.isArray(r)?(r.forEach(d=>{o[d]=f}),o):(o[r]=f,o)}const c=t(n[a],e);return Array.isArray(r)?(o[e.fn.largerThan(a)]={},r.forEach(f=>{o[e.fn.largerThan(a)][f]=c}),o):(o[e.fn.largerThan(a)]={[r]:c},o)},{});const i=t(n,e);return Array.isArray(r)?r.reduce((s,o)=>(s[o]=i,s),{}):{[r]:i}}function YF(n,e){return n==="dimmed"?e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]:e.fn.variant({variant:"filled",color:n,primaryFallback:!1}).background}function qF(n){return n}function ZF(n,e){return e.fn.size({size:n,sizes:e.fontSizes})}const QF=["-xs","-sm","-md","-lg","-xl"];function KF(n,e){return QF.includes(n)?e.fn.size({size:n.replace("-",""),sizes:e.spacing})*-1:e.fn.size({size:n,sizes:e.spacing})}const JF={color:YF,default:qF,fontSize:ZF,spacing:KF},e5={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"default",property:"opacity"},ff:{type:"default",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"default",property:"fontWeight"},lts:{type:"default",property:"letterSpacing"},ta:{type:"default",property:"textAlign"},lh:{type:"default",property:"lineHeight"},fs:{type:"default",property:"fontStyle"},tt:{type:"default",property:"textTransform"},td:{type:"default",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"default",property:"background-size"},bgp:{type:"default",property:"background-position"},bgr:{type:"default",property:"background-repeat"},bga:{type:"default",property:"background-attachment"},pos:{type:"default",property:"position"},top:{type:"default",property:"top"},left:{type:"default",property:"left"},bottom:{type:"default",property:"bottom"},right:{type:"default",property:"right"},inset:{type:"default",property:"inset"},display:{type:"default",property:"display"}};var t5=Object.defineProperty,RE=Object.getOwnPropertySymbols,n5=Object.prototype.hasOwnProperty,r5=Object.prototype.propertyIsEnumerable,LE=(n,e,t)=>e in n?t5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,IE=(n,e)=>{for(var t in e||(e={}))n5.call(e,t)&&LE(n,t,e[t]);if(RE)for(var t of RE(e))r5.call(e,t)&&LE(n,t,e[t]);return n};function NE(n,e,t=e5){return Object.keys(t).reduce((i,s)=>(s in n&&n[s]!==void 0&&i.push(XF({value:n[s],getValue:JF[t[s].type],property:t[s].property,theme:e})),i),[]).reduce((i,s)=>(Object.keys(s).forEach(o=>{typeof s[o]=="object"&&s[o]!==null&&o in i?i[o]=IE(IE({},i[o]),s[o]):i[o]=s[o]}),i),{})}function DE(n,e){return typeof n=="function"?n(e):n}function i5(n,e,t){const r=Yo(),{css:i,cx:s}=lP();return Array.isArray(n)?s(t,i(NE(e,r)),n.map(o=>i(DE(o,r)))):s(t,i(DE(n,r)),i(NE(e,r)))}var s5=Object.defineProperty,Vm=Object.getOwnPropertySymbols,pP=Object.prototype.hasOwnProperty,mP=Object.prototype.propertyIsEnumerable,OE=(n,e,t)=>e in n?s5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,o5=(n,e)=>{for(var t in e||(e={}))pP.call(e,t)&&OE(n,t,e[t]);if(Vm)for(var t of Vm(e))mP.call(e,t)&&OE(n,t,e[t]);return n},a5=(n,e)=>{var t={};for(var r in n)pP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Vm)for(var r of Vm(n))e.indexOf(r)<0&&mP.call(n,r)&&(t[r]=n[r]);return t};const gP=te.exports.forwardRef((n,e)=>{var t=n,{className:r,component:i,style:s,sx:o}=t,a=a5(t,["className","component","style","sx"]);const{systemStyles:c,rest:f}=$F(a);return at(i||"div",{...o5({ref:e,className:i5(o,c,r),style:s},f)})});gP.displayName="@mantine/core/Box";const Vi=gP;var l5=Object.defineProperty,u5=Object.defineProperties,c5=Object.getOwnPropertyDescriptors,kE=Object.getOwnPropertySymbols,f5=Object.prototype.hasOwnProperty,d5=Object.prototype.propertyIsEnumerable,zE=(n,e,t)=>e in n?l5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,FE=(n,e)=>{for(var t in e||(e={}))f5.call(e,t)&&zE(n,t,e[t]);if(kE)for(var t of kE(e))d5.call(e,t)&&zE(n,t,e[t]);return n},h5=(n,e)=>u5(n,c5(e)),p5=ds(n=>({root:h5(FE(FE({},n.fn.focusStyles()),n.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:n.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:n.colorScheme==="dark"?n.colors.dark[0]:n.black,textDecoration:"none",boxSizing:"border-box"})})),m5=p5,g5=Object.defineProperty,Gm=Object.getOwnPropertySymbols,vP=Object.prototype.hasOwnProperty,yP=Object.prototype.propertyIsEnumerable,UE=(n,e,t)=>e in n?g5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,v5=(n,e)=>{for(var t in e||(e={}))vP.call(e,t)&&UE(n,t,e[t]);if(Gm)for(var t of Gm(e))yP.call(e,t)&&UE(n,t,e[t]);return n},y5=(n,e)=>{var t={};for(var r in n)vP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Gm)for(var r of Gm(n))e.indexOf(r)<0&&yP.call(n,r)&&(t[r]=n[r]);return t};const _P=te.exports.forwardRef((n,e)=>{const t=Mi("UnstyledButton",{},n),{className:r,component:i="button",unstyled:s}=t,o=y5(t,["className","component","unstyled"]),{classes:a,cx:c}=m5(null,{name:"UnstyledButton",unstyled:s});return at(Vi,{...v5({component:i,ref:e,className:c(a.root,r),type:i==="button"?"button":void 0},o)})});_P.displayName="@mantine/core/UnstyledButton";const xP=_P;var _5=Object.defineProperty,x5=Object.defineProperties,S5=Object.getOwnPropertyDescriptors,BE=Object.getOwnPropertySymbols,w5=Object.prototype.hasOwnProperty,M5=Object.prototype.propertyIsEnumerable,VE=(n,e,t)=>e in n?_5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,SP=(n,e)=>{for(var t in e||(e={}))w5.call(e,t)&&VE(n,t,e[t]);if(BE)for(var t of BE(e))M5.call(e,t)&&VE(n,t,e[t]);return n},b5=(n,e)=>x5(n,S5(e));const Qc={xs:18,sm:22,md:28,lg:34,xl:44};function E5({variant:n,theme:e,color:t,gradient:r}){const i=e.fn.variant({color:t,variant:n,gradient:r});return n==="gradient"?{border:0,backgroundImage:i.background,color:i.color,"&:hover":e.fn.hover({backgroundSize:"200%"})}:SP({border:`1px solid ${i.border}`,backgroundColor:i.background,color:i.color},e.fn.hover({backgroundColor:i.hover}))}var T5=ds((n,{color:e,size:t,radius:r,variant:i,gradient:s})=>({root:b5(SP({},E5({variant:i,theme:n,color:e,gradient:s})),{position:"relative",height:n.fn.size({size:t,sizes:Qc}),minHeight:n.fn.size({size:t,sizes:Qc}),width:n.fn.size({size:t,sizes:Qc}),minWidth:n.fn.size({size:t,sizes:Qc}),borderRadius:n.fn.radius(r),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center","&:active":n.activeStyles,"&:disabled, &[data-disabled]":{color:n.colors.gray[n.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:i==="transparent"?void 0:n.fn.themeColor("gray",n.colorScheme==="dark"?8:1),borderColor:i==="transparent"?void 0:n.fn.themeColor("gray",n.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:n.colorScheme==="dark"?n.fn.rgba(n.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:n.fn.radius(r),cursor:"not-allowed"}}})})),C5=T5,A5=Object.defineProperty,Hm=Object.getOwnPropertySymbols,wP=Object.prototype.hasOwnProperty,MP=Object.prototype.propertyIsEnumerable,GE=(n,e,t)=>e in n?A5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,P5=(n,e)=>{for(var t in e||(e={}))wP.call(e,t)&&GE(n,t,e[t]);if(Hm)for(var t of Hm(e))MP.call(e,t)&&GE(n,t,e[t]);return n},R5=(n,e)=>{var t={};for(var r in n)wP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Hm)for(var r of Hm(n))e.indexOf(r)<0&&MP.call(n,r)&&(t[r]=n[r]);return t};function L5(n){var e=n,{size:t,color:r}=e,i=R5(e,["size","color"]);return ke.createElement("svg",P5({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:`${t}px`},i),ke.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var I5=Object.defineProperty,Wm=Object.getOwnPropertySymbols,bP=Object.prototype.hasOwnProperty,EP=Object.prototype.propertyIsEnumerable,HE=(n,e,t)=>e in n?I5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,N5=(n,e)=>{for(var t in e||(e={}))bP.call(e,t)&&HE(n,t,e[t]);if(Wm)for(var t of Wm(e))EP.call(e,t)&&HE(n,t,e[t]);return n},D5=(n,e)=>{var t={};for(var r in n)bP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Wm)for(var r of Wm(n))e.indexOf(r)<0&&EP.call(n,r)&&(t[r]=n[r]);return t};function O5(n){var e=n,{size:t,color:r}=e,i=D5(e,["size","color"]);return ke.createElement("svg",N5({width:`${t}px`,height:`${t}px`,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},i),ke.createElement("g",{fill:"none",fillRule:"evenodd"},ke.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},ke.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),ke.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},ke.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var k5=Object.defineProperty,$m=Object.getOwnPropertySymbols,TP=Object.prototype.hasOwnProperty,CP=Object.prototype.propertyIsEnumerable,WE=(n,e,t)=>e in n?k5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,z5=(n,e)=>{for(var t in e||(e={}))TP.call(e,t)&&WE(n,t,e[t]);if($m)for(var t of $m(e))CP.call(e,t)&&WE(n,t,e[t]);return n},F5=(n,e)=>{var t={};for(var r in n)TP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&$m)for(var r of $m(n))e.indexOf(r)<0&&CP.call(n,r)&&(t[r]=n[r]);return t};function U5(n){var e=n,{size:t,color:r}=e,i=F5(e,["size","color"]);return ke.createElement("svg",z5({width:`${t}px`,height:`${t/4}px`,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},i),ke.createElement("circle",{cx:"15",cy:"15",r:"15"},ke.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},ke.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("circle",{cx:"105",cy:"15",r:"15"},ke.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var B5=Object.defineProperty,jm=Object.getOwnPropertySymbols,AP=Object.prototype.hasOwnProperty,PP=Object.prototype.propertyIsEnumerable,$E=(n,e,t)=>e in n?B5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,V5=(n,e)=>{for(var t in e||(e={}))AP.call(e,t)&&$E(n,t,e[t]);if(jm)for(var t of jm(e))PP.call(e,t)&&$E(n,t,e[t]);return n},G5=(n,e)=>{var t={};for(var r in n)AP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&jm)for(var r of jm(n))e.indexOf(r)<0&&PP.call(n,r)&&(t[r]=n[r]);return t};const sy={bars:L5,oval:O5,dots:U5},H5={xs:18,sm:22,md:36,lg:44,xl:58},W5={size:"md"};function iS(n){const e=Mi("Loader",W5,n),{size:t,color:r,variant:i}=e,s=G5(e,["size","color","variant"]),o=Yo(),a=i in sy?i:o.loader;return ke.createElement(Vi,V5({role:"presentation",component:sy[a]||sy.bars,size:o.fn.size({size:t,sizes:H5}),color:o.fn.variant({variant:"filled",primaryFallback:!1,color:r||o.primaryColor}).background},s))}iS.displayName="@mantine/core/Loader";var $5=Object.defineProperty,Xm=Object.getOwnPropertySymbols,RP=Object.prototype.hasOwnProperty,LP=Object.prototype.propertyIsEnumerable,jE=(n,e,t)=>e in n?$5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,XE=(n,e)=>{for(var t in e||(e={}))RP.call(e,t)&&jE(n,t,e[t]);if(Xm)for(var t of Xm(e))LP.call(e,t)&&jE(n,t,e[t]);return n},j5=(n,e)=>{var t={};for(var r in n)RP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Xm)for(var r of Xm(n))e.indexOf(r)<0&&LP.call(n,r)&&(t[r]=n[r]);return t};const X5={color:"gray",size:"md",variant:"subtle",loading:!1},IP=te.exports.forwardRef((n,e)=>{const t=Mi("ActionIcon",X5,n),{className:r,color:i,children:s,radius:o,size:a,variant:c,gradient:f,disabled:d,loaderProps:h,loading:p,unstyled:g}=t,v=j5(t,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled"]),{classes:y,cx:x,theme:w}=C5({size:a,radius:o,color:i,variant:c,gradient:f},{name:"ActionIcon",unstyled:g}),_=w.fn.variant({color:i,variant:c}),M=at(iS,{...XE({color:_.color,size:w.fn.size({size:a,sizes:Qc})-12},h)});return at(xP,{...XE({className:x(y.root,r),ref:e,disabled:d,"data-disabled":d||void 0,"data-loading":p||void 0,unstyled:g},v),children:p?M:s})});IP.displayName="@mantine/core/ActionIcon";const Y5=IP;function NP(n){const{children:e,target:t,className:r}=Mi("Portal",{},n),i=Yo(),[s,o]=te.exports.useState(!1),a=te.exports.useRef();return uP(()=>(o(!0),a.current=t?typeof t=="string"?document.querySelector(t):t:document.createElement("div"),t||document.body.appendChild(a.current),()=>{!t&&document.body.removeChild(a.current)}),[t]),s?vg.exports.createPortal(at("div",{className:r,dir:i.dir,children:e}),a.current):null}NP.displayName="@mantine/core/Portal";var q5=Object.defineProperty,Ym=Object.getOwnPropertySymbols,DP=Object.prototype.hasOwnProperty,OP=Object.prototype.propertyIsEnumerable,YE=(n,e,t)=>e in n?q5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Z5=(n,e)=>{for(var t in e||(e={}))DP.call(e,t)&&YE(n,t,e[t]);if(Ym)for(var t of Ym(e))OP.call(e,t)&&YE(n,t,e[t]);return n},Q5=(n,e)=>{var t={};for(var r in n)DP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Ym)for(var r of Ym(n))e.indexOf(r)<0&&OP.call(n,r)&&(t[r]=n[r]);return t};function kP(n){var e=n,{withinPortal:t=!0,children:r}=e,i=Q5(e,["withinPortal","children"]);return t?ke.createElement(NP,Z5({},i),r):ke.createElement(ke.Fragment,null,r)}kP.displayName="@mantine/core/OptionalPortal";var K5=Object.defineProperty,qE=Object.getOwnPropertySymbols,J5=Object.prototype.hasOwnProperty,eU=Object.prototype.propertyIsEnumerable,ZE=(n,e,t)=>e in n?K5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,tU=(n,e)=>{for(var t in e||(e={}))J5.call(e,t)&&ZE(n,t,e[t]);if(qE)for(var t of qE(e))eU.call(e,t)&&ZE(n,t,e[t]);return n};function zP(n){return ke.createElement("svg",tU({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),ke.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}zP.displayName="@mantine/core/CloseIcon";var nU=Object.defineProperty,qm=Object.getOwnPropertySymbols,FP=Object.prototype.hasOwnProperty,UP=Object.prototype.propertyIsEnumerable,QE=(n,e,t)=>e in n?nU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,rU=(n,e)=>{for(var t in e||(e={}))FP.call(e,t)&&QE(n,t,e[t]);if(qm)for(var t of qm(e))UP.call(e,t)&&QE(n,t,e[t]);return n},iU=(n,e)=>{var t={};for(var r in n)FP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&qm)for(var r of qm(n))e.indexOf(r)<0&&UP.call(n,r)&&(t[r]=n[r]);return t};const sU={xs:12,sm:14,md:16,lg:20,xl:24},oU={size:"md"},BP=te.exports.forwardRef((n,e)=>{const t=Mi("CloseButton",oU,n),{iconSize:r,size:i="md"}=t,s=iU(t,["iconSize","size"]),o=Yo(),a=r||o.fn.size({size:i,sizes:sU});return at(Y5,{...rU({size:i,ref:e},s),children:at(zP,{width:a,height:a})})});BP.displayName="@mantine/core/CloseButton";const aU=BP;var lU=Object.defineProperty,uU=Object.defineProperties,cU=Object.getOwnPropertyDescriptors,KE=Object.getOwnPropertySymbols,fU=Object.prototype.hasOwnProperty,dU=Object.prototype.propertyIsEnumerable,JE=(n,e,t)=>e in n?lU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Pc=(n,e)=>{for(var t in e||(e={}))fU.call(e,t)&&JE(n,t,e[t]);if(KE)for(var t of KE(e))dU.call(e,t)&&JE(n,t,e[t]);return n},hU=(n,e)=>uU(n,cU(e));function pU({underline:n,strikethrough:e}){const t=[];return n&&t.push("underline"),e&&t.push("line-through"),t.length>0?t.join(" "):"none"}function mU({theme:n,color:e,variant:t}){return e==="dimmed"?n.colorScheme==="dark"?n.colors.dark[2]:n.colors.gray[6]:typeof e=="string"&&(e in n.colors||e.split(".")[0]in n.colors)?n.fn.variant({variant:"filled",color:e}).background:t==="link"?n.colors[n.primaryColor][n.colorScheme==="dark"?4:7]:e||"inherit"}function gU(n){return typeof n=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:n,WebkitBoxOrient:"vertical"}:null}function vU(n){return n?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var yU=ds((n,{color:e,variant:t,size:r,lineClamp:i,truncate:s,inline:o,inherit:a,underline:c,gradient:f,weight:d,transform:h,align:p,strikethrough:g,italic:v})=>{const y=n.fn.variant({variant:"gradient",gradient:f});return{root:Pc(hU(Pc(Pc(Pc(Pc({},n.fn.fontStyles()),n.fn.focusStyles()),gU(i)),vU(s)),{color:mU({color:e,theme:n,variant:t}),fontFamily:a?"inherit":n.fontFamily,fontSize:a||r===void 0?"inherit":n.fn.size({size:r,sizes:n.fontSizes}),lineHeight:a?"inherit":o?1:n.lineHeight,textDecoration:pU({underline:c,strikethrough:g}),WebkitTapHighlightColor:"transparent",fontWeight:a?"inherit":d,textTransform:h,textAlign:p,fontStyle:v?"italic":void 0}),n.fn.hover(t==="link"&&c===void 0?{textDecoration:"underline"}:void 0)),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}}),_U=yU,xU=Object.defineProperty,Zm=Object.getOwnPropertySymbols,VP=Object.prototype.hasOwnProperty,GP=Object.prototype.propertyIsEnumerable,eT=(n,e,t)=>e in n?xU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,SU=(n,e)=>{for(var t in e||(e={}))VP.call(e,t)&&eT(n,t,e[t]);if(Zm)for(var t of Zm(e))GP.call(e,t)&&eT(n,t,e[t]);return n},wU=(n,e)=>{var t={};for(var r in n)VP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Zm)for(var r of Zm(n))e.indexOf(r)<0&&GP.call(n,r)&&(t[r]=n[r]);return t};const MU={variant:"text"},HP=te.exports.forwardRef((n,e)=>{const t=Mi("Text",MU,n),{className:r,size:i,weight:s,transform:o,color:a,align:c,variant:f,lineClamp:d,truncate:h,gradient:p,inline:g,inherit:v,underline:y,strikethrough:x,italic:w,classNames:_,styles:M,unstyled:E,span:C}=t,P=wU(t,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span"]),{classes:R,cx:T}=_U({variant:f,color:a,size:i,lineClamp:d,truncate:h,inline:g,inherit:v,underline:y,strikethrough:x,italic:w,weight:s,transform:o,align:c,gradient:p},{unstyled:E,name:"Text"});return at(Vi,{...SU({ref:e,className:T(R.root,{[R.gradient]:f==="gradient"},r),component:C?"span":"div"},P)})});HP.displayName="@mantine/core/Text";const bU=HP;var EU=Object.defineProperty,tT=Object.getOwnPropertySymbols,TU=Object.prototype.hasOwnProperty,CU=Object.prototype.propertyIsEnumerable,nT=(n,e,t)=>e in n?EU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Al=(n,e)=>{for(var t in e||(e={}))TU.call(e,t)&&nT(n,t,e[t]);if(tT)for(var t of tT(e))CU.call(e,t)&&nT(n,t,e[t]);return n};const rT={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function AU({transition:n,state:e,duration:t,timingFunction:r}){const i={transitionDuration:`${t}ms`,transitionTimingFunction:r};return typeof n=="string"?n in qh?Al(Al(Al({transitionProperty:qh[n].transitionProperty},i),qh[n].common),qh[n][rT[e]]):null:Al(Al(Al({transitionProperty:n.transitionProperty},i),n.common),n[rT[e]])}function PU({duration:n,exitDuration:e,timingFunction:t,mounted:r,onEnter:i,onExit:s,onEntered:o,onExited:a}){const c=Yo(),f=OF(),d=c.respectReducedMotion?f:!1,[h,p]=te.exports.useState(r?"entered":"exited");let g=d?0:n;const v=te.exports.useRef(-1),y=x=>{const w=x?i:s,_=x?o:a;if(p(x?"pre-entering":"pre-exiting"),window.clearTimeout(v.current),g=d?0:x?n:e,g===0)typeof w=="function"&&w(),typeof _=="function"&&_(),p(x?"entered":"exited");else{const M=window.setTimeout(()=>{typeof w=="function"&&w(),p(x?"entering":"exiting")},10);v.current=window.setTimeout(()=>{window.clearTimeout(M),typeof _=="function"&&_(),p(x?"entered":"exited")},g)}};return cP(()=>{y(r)},[r]),te.exports.useEffect(()=>()=>window.clearTimeout(v.current),[]),{transitionDuration:g,transitionStatus:h,transitionTimingFunction:t||c.transitionTimingFunction}}const Rc={xs:30,sm:36,md:42,lg:50,xl:60};var RU=ds((n,{orientation:e,buttonBorderWidth:t})=>({root:{display:"flex",flexDirection:e==="vertical"?"column":"row","& [data-button]":{"&:first-of-type":{borderBottomRightRadius:0,[e==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[e==="vertical"?"borderBottomWidth":"borderRightWidth"]:t/2},"&:last-of-type":{borderTopLeftRadius:0,[e==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[e==="vertical"?"borderTopWidth":"borderLeftWidth"]:t/2},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[e==="vertical"?"borderTopWidth":"borderLeftWidth"]:t/2,[e==="vertical"?"borderBottomWidth":"borderRightWidth"]:t/2},"& + [data-button]":{[e==="vertical"?"marginTop":"marginLeft"]:-t,"@media (min-resolution: 192dpi)":{[e==="vertical"?"marginTop":"marginLeft"]:0}}}}})),LU=RU,IU=Object.defineProperty,Qm=Object.getOwnPropertySymbols,WP=Object.prototype.hasOwnProperty,$P=Object.prototype.propertyIsEnumerable,iT=(n,e,t)=>e in n?IU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,NU=(n,e)=>{for(var t in e||(e={}))WP.call(e,t)&&iT(n,t,e[t]);if(Qm)for(var t of Qm(e))$P.call(e,t)&&iT(n,t,e[t]);return n},DU=(n,e)=>{var t={};for(var r in n)WP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Qm)for(var r of Qm(n))e.indexOf(r)<0&&$P.call(n,r)&&(t[r]=n[r]);return t};const OU={orientation:"horizontal",buttonBorderWidth:1},jP=te.exports.forwardRef((n,e)=>{const t=Mi("ButtonGroup",OU,n),{className:r,orientation:i,buttonBorderWidth:s,unstyled:o}=t,a=DU(t,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:f}=LU({orientation:i,buttonBorderWidth:s},{name:"ButtonGroup",unstyled:o});return at(Vi,{...NU({className:f(c.root,r),ref:e},a)})});jP.displayName="@mantine/core/ButtonGroup";var kU=Object.defineProperty,zU=Object.defineProperties,FU=Object.getOwnPropertyDescriptors,sT=Object.getOwnPropertySymbols,UU=Object.prototype.hasOwnProperty,BU=Object.prototype.propertyIsEnumerable,oT=(n,e,t)=>e in n?kU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,xa=(n,e)=>{for(var t in e||(e={}))UU.call(e,t)&&oT(n,t,e[t]);if(sT)for(var t of sT(e))BU.call(e,t)&&oT(n,t,e[t]);return n},rx=(n,e)=>zU(n,FU(e));const ix={xs:{height:Rc.xs,paddingLeft:14,paddingRight:14},sm:{height:Rc.sm,paddingLeft:18,paddingRight:18},md:{height:Rc.md,paddingLeft:22,paddingRight:22},lg:{height:Rc.lg,paddingLeft:26,paddingRight:26},xl:{height:Rc.xl,paddingLeft:32,paddingRight:32},"compact-xs":{height:22,paddingLeft:7,paddingRight:7},"compact-sm":{height:26,paddingLeft:8,paddingRight:8},"compact-md":{height:30,paddingLeft:10,paddingRight:10},"compact-lg":{height:34,paddingLeft:12,paddingRight:12},"compact-xl":{height:40,paddingLeft:14,paddingRight:14}};function VU({compact:n,size:e,withLeftIcon:t,withRightIcon:r}){if(n)return ix[`compact-${e}`];const i=ix[e];return rx(xa({},i),{paddingLeft:t?i.paddingLeft/1.5:i.paddingLeft,paddingRight:r?i.paddingRight/1.5:i.paddingRight})}const GU=n=>({display:n?"block":"inline-block",width:n?"100%":"auto"});function HU({variant:n,theme:e,color:t,gradient:r}){const i=e.fn.variant({color:t,variant:n,gradient:r});return n==="gradient"?{border:0,backgroundImage:i.background,color:i.color,"&:hover":e.fn.hover({backgroundSize:"200%"})}:xa({border:`1px solid ${i.border}`,backgroundColor:i.background,color:i.color},e.fn.hover({backgroundColor:i.hover}))}var WU=ds((n,{color:e,size:t,radius:r,fullWidth:i,compact:s,gradient:o,variant:a,withLeftIcon:c,withRightIcon:f})=>({root:rx(xa(rx(xa(xa(xa(xa({},VU({compact:s,size:t,withLeftIcon:c,withRightIcon:f})),n.fn.fontStyles()),n.fn.focusStyles()),GU(i)),{borderRadius:n.fn.radius(r),fontWeight:600,position:"relative",lineHeight:1,fontSize:n.fn.size({size:t,sizes:n.fontSizes}),userSelect:"none",cursor:"pointer"}),HU({variant:a,theme:n,color:e,gradient:o})),{"&:active":n.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[2],color:n.colorScheme==="dark"?n.colors.dark[6]:n.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:n.colorScheme==="dark"?n.fn.rgba(n.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:n.fn.radius(r),cursor:"not-allowed"}}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:10},rightIcon:{marginLeft:10},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}})),$U=WU,jU=Object.defineProperty,Km=Object.getOwnPropertySymbols,XP=Object.prototype.hasOwnProperty,YP=Object.prototype.propertyIsEnumerable,aT=(n,e,t)=>e in n?jU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,lT=(n,e)=>{for(var t in e||(e={}))XP.call(e,t)&&aT(n,t,e[t]);if(Km)for(var t of Km(e))YP.call(e,t)&&aT(n,t,e[t]);return n},XU=(n,e)=>{var t={};for(var r in n)XP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Km)for(var r of Km(n))e.indexOf(r)<0&&YP.call(n,r)&&(t[r]=n[r]);return t};const YU={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},sS=te.exports.forwardRef((n,e)=>{const t=Mi("Button",YU,n),{className:r,size:i,color:s,type:o,disabled:a,children:c,leftIcon:f,rightIcon:d,fullWidth:h,variant:p,radius:g,uppercase:v,compact:y,loading:x,loaderPosition:w,loaderProps:_,gradient:M,classNames:E,styles:C,unstyled:P}=t,R=XU(t,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:T,cx:L,theme:D}=$U({radius:g,color:s,size:i,fullWidth:h,compact:y,gradient:M,variant:p,withLeftIcon:!!f,withRightIcon:!!d},{name:"Button",unstyled:P,classNames:E,styles:C}),Y=D.fn.variant({color:s,variant:p}),fe=at(iS,{...lT({color:Y.color,size:D.fn.size({size:i,sizes:ix}).height/2},_)});return at(xP,{...lT({className:L(T.root,r),type:o,disabled:a,"data-button":!0,"data-disabled":a||void 0,"data-loading":x||void 0,ref:e,unstyled:P},R),children:ka("div",{className:T.inner,children:[(f||x&&w==="left")&&at("span",{className:L(T.icon,T.leftIcon),children:x&&w==="left"?fe:f}),x&&w==="center"&&at("span",{className:T.centerLoader,children:fe}),at("span",{className:T.label,style:{textTransform:v?"uppercase":void 0},children:c}),(d||x&&w==="right")&&at("span",{className:L(T.icon,T.rightIcon),children:x&&w==="right"?fe:d})]})})});sS.displayName="@mantine/core/Button";sS.Group=jP;const uT=sS;var qU=ds((n,{radius:e,shadow:t,withBorder:r})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:n.colorScheme==="dark"?n.colors.dark[0]:n.black,backgroundColor:n.colorScheme==="dark"?n.colors.dark[7]:n.white,boxSizing:"border-box",borderRadius:n.fn.radius(e),boxShadow:n.shadows[t]||t||"none",border:r?`1px solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`:void 0}})),ZU=qU,QU=Object.defineProperty,Jm=Object.getOwnPropertySymbols,qP=Object.prototype.hasOwnProperty,ZP=Object.prototype.propertyIsEnumerable,cT=(n,e,t)=>e in n?QU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,KU=(n,e)=>{for(var t in e||(e={}))qP.call(e,t)&&cT(n,t,e[t]);if(Jm)for(var t of Jm(e))ZP.call(e,t)&&cT(n,t,e[t]);return n},JU=(n,e)=>{var t={};for(var r in n)qP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Jm)for(var r of Jm(n))e.indexOf(r)<0&&ZP.call(n,r)&&(t[r]=n[r]);return t};const eB={},QP=te.exports.forwardRef((n,e)=>{const t=Mi("Paper",eB,n),{className:r,children:i,radius:s,withBorder:o,shadow:a,unstyled:c}=t,f=JU(t,["className","children","radius","withBorder","shadow","unstyled"]),{classes:d,cx:h}=ZU({radius:s,shadow:a,withBorder:o},{name:"Paper",unstyled:c});return at(Vi,{...KU({className:h(d.root,r),ref:e},f),children:i})});QP.displayName="@mantine/core/Paper";const tB=QP;function nB(n){return te.exports.Children.toArray(n).filter(Boolean)}const rB={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var iB=ds((n,{spacing:e,position:t,noWrap:r,grow:i,align:s,count:o})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:s||"center",flexWrap:r?"nowrap":"wrap",justifyContent:rB[t],gap:n.fn.size({size:e,sizes:n.spacing}),"& > *":{boxSizing:"border-box",maxWidth:i?`calc(${100/o}% - ${n.fn.size({size:e,sizes:n.spacing})-n.fn.size({size:e,sizes:n.spacing})/o}px)`:void 0,flexGrow:i?1:0}}})),sB=iB,oB=Object.defineProperty,eg=Object.getOwnPropertySymbols,KP=Object.prototype.hasOwnProperty,JP=Object.prototype.propertyIsEnumerable,fT=(n,e,t)=>e in n?oB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,aB=(n,e)=>{for(var t in e||(e={}))KP.call(e,t)&&fT(n,t,e[t]);if(eg)for(var t of eg(e))JP.call(e,t)&&fT(n,t,e[t]);return n},lB=(n,e)=>{var t={};for(var r in n)KP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&eg)for(var r of eg(n))e.indexOf(r)<0&&JP.call(n,r)&&(t[r]=n[r]);return t};const uB={position:"left",spacing:"md"},eR=te.exports.forwardRef((n,e)=>{const t=Mi("Group",uB,n),{className:r,position:i,align:s,children:o,noWrap:a,grow:c,spacing:f,unstyled:d}=t,h=lB(t,["className","position","align","children","noWrap","grow","spacing","unstyled"]),p=nB(o),{classes:g,cx:v}=sB({align:s,grow:c,noWrap:a,spacing:f,position:i,count:p.length},{unstyled:d,name:"Group"});return at(Vi,{...aB({className:v(g.root,r),ref:e},h),children:p})});eR.displayName="@mantine/core/Group";function tR({transitions:n,duration:e=250,exitDuration:t=e,mounted:r,children:i,timingFunction:s,onExit:o,onEntered:a,onEnter:c,onExited:f}){const{transitionDuration:d,transitionStatus:h,transitionTimingFunction:p}=PU({mounted:r,duration:e,exitDuration:t,timingFunction:s,onExit:o,onEntered:a,onEnter:c,onExited:f});if(d===0)return r?ke.createElement(ke.Fragment,null,i({})):null;if(h==="exited")return null;const g=Object.keys(n).reduce((v,y)=>(v[y]=AU({duration:n[y].duration,transition:n[y].transition,timingFunction:n[y].timingFunction||p,state:h}),v),{});return ke.createElement(ke.Fragment,null,i(g))}tR.displayName="@mantine/core/GroupedTransition";var cB=ds((n,{zIndex:e})=>({root:{position:"absolute",top:0,bottom:0,left:0,right:0,zIndex:e}})),fB=cB,dB=Object.defineProperty,hB=Object.defineProperties,pB=Object.getOwnPropertyDescriptors,tg=Object.getOwnPropertySymbols,nR=Object.prototype.hasOwnProperty,rR=Object.prototype.propertyIsEnumerable,dT=(n,e,t)=>e in n?dB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,oy=(n,e)=>{for(var t in e||(e={}))nR.call(e,t)&&dT(n,t,e[t]);if(tg)for(var t of tg(e))rR.call(e,t)&&dT(n,t,e[t]);return n},mB=(n,e)=>hB(n,pB(e)),gB=(n,e)=>{var t={};for(var r in n)nR.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&tg)for(var r of tg(n))e.indexOf(r)<0&&rR.call(n,r)&&(t[r]=n[r]);return t};const vB={opacity:.6,color:"#fff",zIndex:rS("modal"),radius:0,blur:0},iR=te.exports.forwardRef((n,e)=>{const t=Mi("Overlay",vB,n),{opacity:r,blur:i,color:s,gradient:o,zIndex:a,radius:c,sx:f,unstyled:d,className:h}=t,p=gB(t,["opacity","blur","color","gradient","zIndex","radius","sx","unstyled","className"]),{classes:g,cx:v}=fB({zIndex:a},{name:"Overlay",unstyled:d}),y=o?{backgroundImage:o}:{backgroundColor:s},x=w=>at(Vi,{...oy({ref:e,className:v(g.root,h),sx:[_=>mB(oy({},y),{opacity:r,borderRadius:_.fn.size({size:c,sizes:_.radius})}),...lE(f)]},w)});return i?at(Vi,{...oy({className:v(g.root,h),sx:[{backdropFilter:`blur(${i}px)`},...lE(f)]},p),children:x()}):x(p)});iR.displayName="@mantine/core/Overlay";const yB=iR;var _B=Object.defineProperty,hT=Object.getOwnPropertySymbols,xB=Object.prototype.hasOwnProperty,SB=Object.prototype.propertyIsEnumerable,pT=(n,e,t)=>e in n?_B(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,wB=(n,e)=>{for(var t in e||(e={}))xB.call(e,t)&&pT(n,t,e[t]);if(hT)for(var t of hT(e))SB.call(e,t)&&pT(n,t,e[t]);return n};const MB={xs:320,sm:380,md:440,lg:620,xl:780};function bB(n){return n?{position:"absolute",top:0,left:0,right:0,bottom:0,maxHeight:"100vh",overflowY:"auto"}:{}}var EB=ds((n,{overflow:e,size:t,centered:r,zIndex:i,fullScreen:s})=>({close:{},overlay:{display:s?"none":void 0},root:{position:"fixed",zIndex:i,top:0,left:0,right:0,bottom:0},inner:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowY:"auto",padding:s?0:`${n.spacing.xl*2}px ${n.spacing.md}px`,display:"flex",justifyContent:"center",alignItems:r?"center":"flex-start"},title:{marginRight:n.spacing.md,textOverflow:"ellipsis",display:"block",wordBreak:"break-word"},modal:wB({position:"relative",width:s?"100vw":n.fn.size({sizes:MB,size:t}),borderRadius:s?0:void 0,outline:0,backgroundColor:n.colorScheme==="dark"?n.colors.dark[7]:n.white,marginTop:r?"auto":void 0,marginBottom:r?"auto":void 0,zIndex:1},bB(s)),header:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:n.spacing.md,marginRight:-9},body:{maxHeight:e==="inside"?"calc(100vh - 185px)":null,overflowY:e==="inside"?"auto":null,wordBreak:"break-word"}})),TB=EB,CB=Object.defineProperty,ng=Object.getOwnPropertySymbols,sR=Object.prototype.hasOwnProperty,oR=Object.prototype.propertyIsEnumerable,mT=(n,e,t)=>e in n?CB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,AB=(n,e)=>{for(var t in e||(e={}))sR.call(e,t)&&mT(n,t,e[t]);if(ng)for(var t of ng(e))oR.call(e,t)&&mT(n,t,e[t]);return n},PB=(n,e)=>{var t={};for(var r in n)sR.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&ng)for(var r of ng(n))e.indexOf(r)<0&&oR.call(n,r)&&(t[r]=n[r]);return t};const RB={size:"md",transitionDuration:250,overflow:"outside",padding:"lg",shadow:"lg",closeOnClickOutside:!0,closeOnEscape:!0,trapFocus:!0,withCloseButton:!0,withinPortal:!0,lockScroll:!0,withFocusReturn:!0,overlayBlur:0,zIndex:rS("modal"),exitTransitionDuration:0};function aR(n){const e=Mi("Modal",RB,n),{className:t,opened:r,title:i,onClose:s,children:o,withCloseButton:a,overlayOpacity:c,size:f,transitionDuration:d,exitTransitionDuration:h,closeButtonLabel:p,overlayColor:g,overflow:v,transition:y,padding:x,shadow:w,radius:_,id:M,classNames:E,styles:C,closeOnClickOutside:P,trapFocus:R,closeOnEscape:T,centered:L,target:D,withinPortal:Y,zIndex:fe,overlayBlur:q,transitionTimingFunction:$,fullScreen:se,unstyled:le,lockScroll:pe,withFocusReturn:z}=e,F=PB(e,["className","opened","title","onClose","children","withCloseButton","overlayOpacity","size","transitionDuration","exitTransitionDuration","closeButtonLabel","overlayColor","overflow","transition","padding","shadow","radius","id","classNames","styles","closeOnClickOutside","trapFocus","closeOnEscape","centered","target","withinPortal","zIndex","overlayBlur","transitionTimingFunction","fullScreen","unstyled","lockScroll","withFocusReturn"]),G=RF(M),Z=`${G}-title`,k=`${G}-body`,{classes:W,cx:N,theme:me}=TB({size:f,overflow:v,centered:L,zIndex:fe,fullScreen:se},{unstyled:le,classNames:E,styles:C,name:"Modal"}),X=EF(R&&r),Te=te.exports.useRef(null),Ce=DF(X,Te),we=typeof c=="number"?c:me.colorScheme==="dark"?.85:.75;VF(pe&&r);const be=ne=>{!R&&ne.key==="Escape"&&T&&s()};te.exports.useEffect(()=>{if(!R)return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[R]),yF({opened:r,shouldReturnFocus:R&&z});const He=te.exports.useRef(null);LF("mousedown",ne=>{He.current=ne.target});const ue=()=>{He.current===Te.current&&P&&s()};return at(kP,{withinPortal:Y,target:D,children:at(tR,{mounted:r,duration:d,exitDuration:h,timingFunction:$,transitions:{modal:{duration:d,transition:y||(se?"fade":"pop")},overlay:{duration:d/2,transition:"fade",timingFunction:"ease"}},children:ne=>at(Og,{children:ka(Vi,{...AB({id:G,className:N(W.root,t)},F),children:[at("div",{style:ne.overlay,children:at(yB,{className:W.overlay,sx:{position:"fixed"},zIndex:0,blur:q,color:g||(me.colorScheme==="dark"?me.colors.dark[9]:me.black),opacity:we,unstyled:le})}),at("div",{role:"presentation",className:W.inner,onClick:ue,onKeyDown:Ee=>{var Ue;((Ue=Ee.target)==null?void 0:Ue.getAttribute("data-mantine-stop-propagation"))!=="true"&&Ee.key==="Escape"&&T&&s()},ref:Ce,children:ka(tB,{className:W.modal,shadow:w,p:x,radius:_,role:"dialog","aria-labelledby":Z,"aria-describedby":k,"aria-modal":!0,tabIndex:-1,style:ne.modal,unstyled:le,onClick:Ee=>Ee.stopPropagation(),children:[(i||a)&&ka("div",{className:W.header,children:[at(bU,{id:Z,className:W.title,children:i}),a&&at(aU,{iconSize:16,onClick:s,"aria-label":p,className:W.close})]}),at("div",{id:k,className:W.body,children:o})]})})]})})})})}aR.displayName="@mantine/core/Modal";/**
* @license
* Copyright 2010-2022 Three.js Authors
* SPDX-License-Identifier: MIT
*/const Ug="145",LB={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},IB={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},lR=0,sx=1,uR=2,NB=3,cR=0,Bg=1,cf=2,Ca=3,qa=0,jr=1,ki=2,Gs=0,za=1,ox=2,ax=3,lx=4,fR=5,Sa=100,dR=101,hR=102,ux=103,cx=104,pR=200,mR=201,gR=202,vR=203,oS=204,aS=205,yR=206,_R=207,xR=208,SR=209,wR=210,MR=0,bR=1,ER=2,rg=3,TR=4,CR=5,AR=6,PR=7,cd=0,RR=1,LR=2,Ui=0,IR=1,NR=2,DR=3,lS=4,OR=5,Vg=300,Vo=301,Go=302,zf=303,Ff=304,Hu=306,Uf=1e3,pr=1001,Bf=1002,En=1003,ig=1004,DB=1004,sg=1005,OB=1005,un=1006,uS=1007,kB=1007,sl=1008,zB=1008,Ho=1009,kR=1010,zR=1011,cS=1012,FR=1013,Ao=1014,os=1015,Za=1016,UR=1017,BR=1018,Fa=1020,VR=1021,GR=1022,_i=1023,HR=1024,WR=1025,Fo=1026,Qa=1027,$R=1028,jR=1029,XR=1030,YR=1031,qR=1033,om=33776,am=33777,lm=33778,um=33779,fx=35840,dx=35841,hx=35842,px=35843,ZR=36196,mx=37492,gx=37496,vx=37808,yx=37809,_x=37810,xx=37811,Sx=37812,wx=37813,Mx=37814,bx=37815,Ex=37816,Tx=37817,Cx=37818,Ax=37819,Px=37820,Rx=37821,Lx=36492,QR=2200,KR=2201,JR=2202,Vf=2300,Gf=2301,cm=2302,Aa=2400,Pa=2401,Hf=2402,Gg=2500,fS=2501,FB=0,UB=1,BB=2,Xs=3e3,Kt=3001,eL=3200,tL=3201,qo=0,nL=1,VB="",ts="srgb",Po="srgb-linear",GB=0,fm=7680,HB=7681,WB=7682,$B=7683,jB=34055,XB=34056,YB=5386,qB=512,ZB=513,QB=514,KB=515,JB=516,eV=517,tV=518,rL=519,Wf=35044,nV=35048,rV=35040,iV=35045,sV=35049,oV=35041,aV=35046,lV=35050,uV=35042,cV="100",Ix="300 es",og=1035;class Zs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}}const rr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let gT=1234567;const Ua=Math.PI/180,$f=180/Math.PI;function Xr(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(rr[n&255]+rr[n>>8&255]+rr[n>>16&255]+rr[n>>24&255]+"-"+rr[e&255]+rr[e>>8&255]+"-"+rr[e>>16&15|64]+rr[e>>24&255]+"-"+rr[t&63|128]+rr[t>>8&255]+"-"+rr[t>>16&255]+rr[t>>24&255]+rr[r&255]+rr[r>>8&255]+rr[r>>16&255]+rr[r>>24&255]).toLowerCase()}function xn(n,e,t){return Math.max(e,Math.min(t,n))}function dS(n,e){return(n%e+e)%e}function fV(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function dV(n,e,t){return n!==e?(t-n)/(e-n):0}function ff(n,e,t){return(1-t)*n+t*e}function hV(n,e,t,r){return ff(n,e,1-Math.exp(-t*r))}function pV(n,e=1){return e-Math.abs(dS(n,e*2)-e)}function mV(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function gV(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function vV(n,e){return n+Math.floor(Math.random()*(e-n+1))}function yV(n,e){return n+Math.random()*(e-n)}function _V(n){return n*(.5-Math.random())}function xV(n){n!==void 0&&(gT=n);let e=gT+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function SV(n){return n*Ua}function wV(n){return n*$f}function Nx(n){return(n&n-1)===0&&n!==0}function iL(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function ag(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function MV(n,e,t,r,i){const s=Math.cos,o=Math.sin,a=s(t/2),c=o(t/2),f=s((e+r)/2),d=o((e+r)/2),h=s((e-r)/2),p=o((e-r)/2),g=s((r-e)/2),v=o((r-e)/2);switch(i){case"XYX":n.set(a*d,c*h,c*p,a*f);break;case"YZY":n.set(c*p,a*d,c*h,a*f);break;case"ZXZ":n.set(c*h,c*p,a*d,a*f);break;case"XZX":n.set(a*d,c*v,c*g,a*f);break;case"YXY":n.set(c*g,a*d,c*v,a*f);break;case"ZYZ":n.set(c*v,c*g,a*d,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Us(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Xt(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}var is=Object.freeze({__proto__:null,DEG2RAD:Ua,RAD2DEG:$f,generateUUID:Xr,clamp:xn,euclideanModulo:dS,mapLinear:fV,inverseLerp:dV,lerp:ff,damp:hV,pingpong:pV,smoothstep:mV,smootherstep:gV,randInt:vV,randFloat:yV,randFloatSpread:_V,seededRandom:xV,degToRad:SV,radToDeg:wV,isPowerOfTwo:Nx,ceilPowerOfTwo:iL,floorPowerOfTwo:ag,setQuaternionFromProperEuler:MV,normalize:Xt,denormalize:Us});class Me{constructor(e=0,t=0){Me.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,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 r=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*r-o*i+e.x,this.y=s*i+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Tr{constructor(){Tr.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,r,i,s,o,a,c,f){const d=this.elements;return d[0]=e,d[1]=i,d[2]=a,d[3]=t,d[4]=s,d[5]=c,d[6]=r,d[7]=o,d[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.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 r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[3],c=r[6],f=r[1],d=r[4],h=r[7],p=r[2],g=r[5],v=r[8],y=i[0],x=i[3],w=i[6],_=i[1],M=i[4],E=i[7],C=i[2],P=i[5],R=i[8];return s[0]=o*y+a*_+c*C,s[3]=o*x+a*M+c*P,s[6]=o*w+a*E+c*R,s[1]=f*y+d*_+h*C,s[4]=f*x+d*M+h*P,s[7]=f*w+d*E+h*R,s[2]=p*y+g*_+v*C,s[5]=p*x+g*M+v*P,s[8]=p*w+g*E+v*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],f=e[7],d=e[8];return t*o*d-t*a*f-r*s*d+r*a*c+i*s*f-i*o*c}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],f=e[7],d=e[8],h=d*o-a*f,p=a*c-d*s,g=f*s-o*c,v=t*h+r*p+i*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/v;return e[0]=h*y,e[1]=(i*f-d*r)*y,e[2]=(a*r-i*o)*y,e[3]=p*y,e[4]=(d*t-i*c)*y,e[5]=(i*s-a*t)*y,e[6]=g*y,e[7]=(r*c-f*t)*y,e[8]=(o*t-r*s)*y,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,s,o,a){const c=Math.cos(s),f=Math.sin(s);return this.set(r*c,r*f,-r*(c*o+f*a)+o+e,-i*f,i*c,-i*(-f*o+c*a)+a+t,0,0,1),this}scale(e,t){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this}rotate(e){const t=Math.cos(e),r=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],c=i[1],f=i[4],d=i[7];return i[0]=t*s+r*c,i[3]=t*o+r*f,i[6]=t*a+r*d,i[1]=-r*s+t*c,i[4]=-r*o+t*f,i[7]=-r*a+t*d,this}translate(e,t){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}function sL(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const bV={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function cu(n,e){return new bV[n](e)}function jf(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Ba(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function dm(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const ay={[ts]:{[Po]:Ba},[Po]:{[ts]:dm}},di={legacyMode:!0,get workingColorSpace(){return Po},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,e,t){if(this.legacyMode||e===t||!e||!t)return n;if(ay[e]&&ay[e][t]!==void 0){const r=ay[e][t];return n.r=r(n.r),n.g=r(n.g),n.b=r(n.b),n}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(n,e){return this.convert(n,this.workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this.workingColorSpace)}},oL={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},Rn={r:0,g:0,b:0},Ai={h:0,s:0,l:0},Zh={h:0,s:0,l:0};function ly(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}function Qh(n,e){return e.r=n.r,e.g=n.g,e.b=n.b,e}class Ge{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&r===void 0?this.set(e):this.setRGB(e,t,r)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ts){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,di.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=Po){return this.r=e,this.g=t,this.b=r,di.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=Po){if(e=dS(e,1),t=xn(t,0,1),r=xn(r,0,1),t===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+t):r+t-r*t,o=2*r-s;this.r=ly(o,s,e+1/3),this.g=ly(o,s,e),this.b=ly(o,s,e-1/3)}return di.toWorkingColorSpace(this,i),this}setStyle(e,t=ts){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(s[1],10))/255,this.g=Math.min(255,parseInt(s[2],10))/255,this.b=Math.min(255,parseInt(s[3],10))/255,di.toWorkingColorSpace(this,t),r(s[4]),this;if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(s[1],10))/100,this.g=Math.min(100,parseInt(s[2],10))/100,this.b=Math.min(100,parseInt(s[3],10))/100,di.toWorkingColorSpace(this,t),r(s[4]),this;break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const c=parseFloat(s[1])/360,f=parseFloat(s[2])/100,d=parseFloat(s[3])/100;return r(s[4]),this.setHSL(c,f,d,t)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.r=parseInt(s.charAt(0)+s.charAt(0),16)/255,this.g=parseInt(s.charAt(1)+s.charAt(1),16)/255,this.b=parseInt(s.charAt(2)+s.charAt(2),16)/255,di.toWorkingColorSpace(this,t),this;if(o===6)return this.r=parseInt(s.charAt(0)+s.charAt(1),16)/255,this.g=parseInt(s.charAt(2)+s.charAt(3),16)/255,this.b=parseInt(s.charAt(4)+s.charAt(5),16)/255,di.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t=ts){const r=oL[e.toLowerCase()];return r!==void 0?this.setHex(r,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ba(e.r),this.g=Ba(e.g),this.b=Ba(e.b),this}copyLinearToSRGB(e){return this.r=dm(e.r),this.g=dm(e.g),this.b=dm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ts){return di.fromWorkingColorSpace(Qh(this,Rn),e),xn(Rn.r*255,0,255)<<16^xn(Rn.g*255,0,255)<<8^xn(Rn.b*255,0,255)<<0}getHexString(e=ts){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Po){di.fromWorkingColorSpace(Qh(this,Rn),t);const r=Rn.r,i=Rn.g,s=Rn.b,o=Math.max(r,i,s),a=Math.min(r,i,s);let c,f;const d=(a+o)/2;if(a===o)c=0,f=0;else{const h=o-a;switch(f=d<=.5?h/(o+a):h/(2-o-a),o){case r:c=(i-s)/h+(i<s?6:0);break;case i:c=(s-r)/h+2;break;case s:c=(r-i)/h+4;break}c/=6}return e.h=c,e.s=f,e.l=d,e}getRGB(e,t=Po){return di.fromWorkingColorSpace(Qh(this,Rn),t),e.r=Rn.r,e.g=Rn.g,e.b=Rn.b,e}getStyle(e=ts){return di.fromWorkingColorSpace(Qh(this,Rn),e),e!==ts?`color(${e} ${Rn.r} ${Rn.g} ${Rn.b})`:`rgb(${Rn.r*255|0},${Rn.g*255|0},${Rn.b*255|0})`}offsetHSL(e,t,r){return this.getHSL(Ai),Ai.h+=e,Ai.s+=t,Ai.l+=r,this.setHSL(Ai.h,Ai.s,Ai.l),this}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,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Ai),e.getHSL(Zh);const r=ff(Ai.h,Zh.h,t),i=ff(Ai.s,Zh.s,t),s=ff(Ai.l,Zh.l,t);return this.setHSL(r,i,s),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}}Ge.NAMES=oL;let Pl;class hS{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Pl===void 0&&(Pl=jf("canvas")),Pl.width=e.width,Pl.height=e.height;const r=Pl.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=Pl}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){const t=jf("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=Ba(s[o]/255)*255;return r.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let r=0;r<t.length;r++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[r]=Math.floor(Ba(t[r]/255)*255):t[r]=Ba(t[r]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class Ra{constructor(e=null){this.isSource=!0,this.uuid=Xr(),this.data=e,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(uy(i[o].image)):s.push(uy(i[o]))}else s=uy(i);r.url=s}return t||(e.images[this.uuid]=r),r}}function uy(n){return typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?hS.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let EV=0;class Cn extends Zs{constructor(e=Cn.DEFAULT_IMAGE,t=Cn.DEFAULT_MAPPING,r=pr,i=pr,s=un,o=sl,a=_i,c=Ho,f=1,d=Xs){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:EV++}),this.uuid=Xr(),this.name="",this.source=new Ra(e),this.mipmaps=[],this.mapping=t,this.wrapS=r,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=f,this.format=a,this.internalFormat=null,this.type=c,this.offset=new Me(0,0),this.repeat=new Me(1,1),this.center=new Me(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Tr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=d,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}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)}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.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Vg)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Uf:e.x=e.x-Math.floor(e.x);break;case pr:e.x=e.x<0?0:1;break;case Bf: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 Uf:e.y=e.y-Math.floor(e.y);break;case pr:e.y=e.y<0?0:1;break;case Bf: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)}}Cn.DEFAULT_IMAGE=null;Cn.DEFAULT_MAPPING=Vg;class Ht{constructor(e=0,t=0,r=0,i=1){Ht.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*r+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*r+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*r+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,s;const c=e.elements,f=c[0],d=c[4],h=c[8],p=c[1],g=c[5],v=c[9],y=c[2],x=c[6],w=c[10];if(Math.abs(d-p)<.01&&Math.abs(h-y)<.01&&Math.abs(v-x)<.01){if(Math.abs(d+p)<.1&&Math.abs(h+y)<.1&&Math.abs(v+x)<.1&&Math.abs(f+g+w-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(f+1)/2,E=(g+1)/2,C=(w+1)/2,P=(d+p)/4,R=(h+y)/4,T=(v+x)/4;return M>E&&M>C?M<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(M),i=P/r,s=R/r):E>C?E<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(E),r=P/i,s=T/i):C<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(C),r=R/s,i=T/s),this.set(r,i,s,t),this}let _=Math.sqrt((x-v)*(x-v)+(h-y)*(h-y)+(p-d)*(p-d));return Math.abs(_)<.001&&(_=1),this.x=(x-v)/_,this.y=(h-y)/_,this.z=(p-d)/_,this.w=Math.acos((f+g+w-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class qr extends Zs{constructor(e,t,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ht(0,0,e,t),this.scissorTest=!1,this.viewport=new Ht(0,0,e,t);const i={width:e,height:t,depth:1};this.texture=new Cn(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:un,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,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.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Ra(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class fd extends Cn{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=En,this.minFilter=En,this.wrapR=pr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class TV extends qr{constructor(e,t,r){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new fd(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class Hg extends Cn{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=En,this.minFilter=En,this.wrapR=pr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class CV extends qr{constructor(e,t,r){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new Hg(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class AV extends qr{constructor(e,t,r,i={}){super(e,t,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o<r;o++)this.texture[o]=s.clone(),this.texture[o].isRenderTargetTexture=!0}setSize(e,t,r=1){if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(let i=0,s=this.texture.length;i<s;i++)this.texture[i].image.width=e,this.texture[i].image.height=t,this.texture[i].image.depth=r;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,r=e.texture.length;t<r;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}}class Gt{constructor(e=0,t=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=i}static slerpFlat(e,t,r,i,s,o,a){let c=r[i+0],f=r[i+1],d=r[i+2],h=r[i+3];const p=s[o+0],g=s[o+1],v=s[o+2],y=s[o+3];if(a===0){e[t+0]=c,e[t+1]=f,e[t+2]=d,e[t+3]=h;return}if(a===1){e[t+0]=p,e[t+1]=g,e[t+2]=v,e[t+3]=y;return}if(h!==y||c!==p||f!==g||d!==v){let x=1-a;const w=c*p+f*g+d*v+h*y,_=w>=0?1:-1,M=1-w*w;if(M>Number.EPSILON){const C=Math.sqrt(M),P=Math.atan2(C,w*_);x=Math.sin(x*P)/C,a=Math.sin(a*P)/C}const E=a*_;if(c=c*x+p*E,f=f*x+g*E,d=d*x+v*E,h=h*x+y*E,x===1-a){const C=1/Math.sqrt(c*c+f*f+d*d+h*h);c*=C,f*=C,d*=C,h*=C}}e[t]=c,e[t+1]=f,e[t+2]=d,e[t+3]=h}static multiplyQuaternionsFlat(e,t,r,i,s,o){const a=r[i],c=r[i+1],f=r[i+2],d=r[i+3],h=s[o],p=s[o+1],g=s[o+2],v=s[o+3];return e[t]=a*v+d*h+c*g-f*p,e[t+1]=c*v+d*p+f*h-a*g,e[t+2]=f*v+d*g+a*p-c*h,e[t+3]=d*v-a*h-c*p-f*g,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,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const r=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,c=Math.sin,f=a(r/2),d=a(i/2),h=a(s/2),p=c(r/2),g=c(i/2),v=c(s/2);switch(o){case"XYZ":this._x=p*d*h+f*g*v,this._y=f*g*h-p*d*v,this._z=f*d*v+p*g*h,this._w=f*d*h-p*g*v;break;case"YXZ":this._x=p*d*h+f*g*v,this._y=f*g*h-p*d*v,this._z=f*d*v-p*g*h,this._w=f*d*h+p*g*v;break;case"ZXY":this._x=p*d*h-f*g*v,this._y=f*g*h+p*d*v,this._z=f*d*v+p*g*h,this._w=f*d*h-p*g*v;break;case"ZYX":this._x=p*d*h-f*g*v,this._y=f*g*h+p*d*v,this._z=f*d*v-p*g*h,this._w=f*d*h+p*g*v;break;case"YZX":this._x=p*d*h+f*g*v,this._y=f*g*h+p*d*v,this._z=f*d*v-p*g*h,this._w=f*d*h-p*g*v;break;case"XZY":this._x=p*d*h-f*g*v,this._y=f*g*h-p*d*v,this._z=f*d*v+p*g*h,this._w=f*d*h+p*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],s=t[8],o=t[1],a=t[5],c=t[9],f=t[2],d=t[6],h=t[10],p=r+a+h;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-c)*g,this._y=(s-f)*g,this._z=(o-i)*g}else if(r>a&&r>h){const g=2*Math.sqrt(1+r-a-h);this._w=(d-c)/g,this._x=.25*g,this._y=(i+o)/g,this._z=(s+f)/g}else if(a>h){const g=2*Math.sqrt(1+a-r-h);this._w=(s-f)/g,this._x=(i+o)/g,this._y=.25*g,this._z=(c+d)/g}else{const g=2*Math.sqrt(1+h-r-a);this._w=(o-i)/g,this._x=(s+f)/g,this._y=(c+d)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(xn(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,i=e._y,s=e._z,o=e._w,a=t._x,c=t._y,f=t._z,d=t._w;return this._x=r*d+o*a+i*f-s*c,this._y=i*d+o*c+s*a-r*f,this._z=s*d+o*f+r*c-i*a,this._w=o*d-r*a-i*c-s*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,o=this._w;let a=o*e._w+r*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=r,this._y=i,this._z=s,this;const c=1-a*a;if(c<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*r+t*this._x,this._y=g*i+t*this._y,this._z=g*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const f=Math.sqrt(c),d=Math.atan2(f,a),h=Math.sin((1-t)*d)/f,p=Math.sin(t*d)/f;return this._w=o*h+this._w*p,this._x=r*h+this._x*p,this._y=i*h+this._y*p,this._z=s*h+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),r*Math.sin(s),r*Math.cos(s),t*Math.sin(i))}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}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class I{constructor(e=0,t=0,r=0){I.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(vT.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(vT.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6]*i,this.y=s[1]*t+s[4]*r+s[7]*i,this.z=s[2]*t+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*r+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*r+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*r+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,s=e.x,o=e.y,a=e.z,c=e.w,f=c*t+o*i-a*r,d=c*r+a*t-s*i,h=c*i+s*r-o*t,p=-s*t-o*r-a*i;return this.x=f*c+p*-s+d*-a-h*-o,this.y=d*c+p*-o+h*-s-f*-a,this.z=h*c+p*-a+f*-o-d*-s,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,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i,this.y=s[1]*t+s[5]*r+s[9]*i,this.z=s[2]*t+s[6]*r+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,s=e.z,o=t.x,a=t.y,c=t.z;return this.x=i*c-s*a,this.y=s*o-r*c,this.z=r*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return cy.copy(this).projectOnVector(e),this.sub(cy)}reflect(e){return this.sub(cy.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 r=this.dot(e)/t;return Math.acos(xn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const cy=new I,vT=new Gt;class ol{constructor(e=new I(1/0,1/0,1/0),t=new I(-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){let t=1/0,r=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let c=0,f=e.length;c<f;c+=3){const d=e[c],h=e[c+1],p=e[c+2];d<t&&(t=d),h<r&&(r=h),p<i&&(i=p),d>s&&(s=d),h>o&&(o=h),p>a&&(a=p)}return this.min.set(t,r,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,r=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let c=0,f=e.count;c<f;c++){const d=e.getX(c),h=e.getY(c),p=e.getZ(c);d<t&&(t=d),h<r&&(r=h),p<i&&(i=p),d>s&&(s=d),h>o&&(o=h),p>a&&(a=p)}return this.min.set(t,r,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=la.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),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 r=e.geometry;if(r!==void 0)if(t&&r.attributes!=null&&r.attributes.position!==void 0){const s=r.attributes.position;for(let o=0,a=s.count;o<a;o++)la.fromBufferAttribute(s,o).applyMatrix4(e.matrixWorld),this.expandByPoint(la)}else r.boundingBox===null&&r.computeBoundingBox(),fy.copy(r.boundingBox),fy.applyMatrix4(e.matrixWorld),this.union(fy);const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,la),la.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Lc),Kh.subVectors(this.max,Lc),Rl.subVectors(e.a,Lc),Ll.subVectors(e.b,Lc),Il.subVectors(e.c,Lc),co.subVectors(Ll,Rl),fo.subVectors(Il,Ll),ua.subVectors(Rl,Il);let t=[0,-co.z,co.y,0,-fo.z,fo.y,0,-ua.z,ua.y,co.z,0,-co.x,fo.z,0,-fo.x,ua.z,0,-ua.x,-co.y,co.x,0,-fo.y,fo.x,0,-ua.y,ua.x,0];return!dy(t,Rl,Ll,Il,Kh)||(t=[1,0,0,0,1,0,0,0,1],!dy(t,Rl,Ll,Il,Kh))?!1:(Jh.crossVectors(co,fo),t=[Jh.x,Jh.y,Jh.z],dy(t,Rl,Ll,Il,Kh))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return la.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(la).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:(As[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),As[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),As[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),As[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),As[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),As[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),As[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),As[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(As),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const As=[new I,new I,new I,new I,new I,new I,new I,new I],la=new I,fy=new ol,Rl=new I,Ll=new I,Il=new I,co=new I,fo=new I,ua=new I,Lc=new I,Kh=new I,Jh=new I,ca=new I;function dy(n,e,t,r,i){for(let s=0,o=n.length-3;s<=o;s+=3){ca.fromArray(n,s);const a=i.x*Math.abs(ca.x)+i.y*Math.abs(ca.y)+i.z*Math.abs(ca.z),c=e.dot(ca),f=t.dot(ca),d=r.dot(ca);if(Math.max(-Math.max(c,f,d),Math.min(c,f,d))>a)return!1}return!0}const PV=new ol,yT=new I,ep=new I,hy=new I;class al{constructor(e=new I,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):PV.setFromPoints(e).getCenter(r);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,r.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const r=this.center.distanceToSquared(e);return t.copy(e),r>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;hy.subVectors(e,this.center);const t=hy.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.add(hy.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?ep.set(0,0,1).multiplyScalar(e.radius):ep.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(yT.copy(e.center).add(ep)),this.expandByPoint(yT.copy(e.center).sub(ep)),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ps=new I,py=new I,tp=new I,ho=new I,my=new I,np=new I,gy=new I;class dd{constructor(e=new I,t=new I(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.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ps)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ps.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ps.copy(this.direction).multiplyScalar(t).add(this.origin),Ps.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){py.copy(e).add(t).multiplyScalar(.5),tp.copy(t).sub(e).normalize(),ho.copy(this.origin).sub(py);const s=e.distanceTo(t)*.5,o=-this.direction.dot(tp),a=ho.dot(this.direction),c=-ho.dot(tp),f=ho.lengthSq(),d=Math.abs(1-o*o);let h,p,g,v;if(d>0)if(h=o*c-a,p=o*a-c,v=s*d,h>=0)if(p>=-v)if(p<=v){const y=1/d;h*=y,p*=y,g=h*(h+o*p+2*a)+p*(o*h+p+2*c)+f}else p=s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*c)+f;else p=-s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*c)+f;else p<=-v?(h=Math.max(0,-(-o*s+a)),p=h>0?-s:Math.min(Math.max(-s,-c),s),g=-h*h+p*(p+2*c)+f):p<=v?(h=0,p=Math.min(Math.max(-s,-c),s),g=p*(p+2*c)+f):(h=Math.max(0,-(o*s+a)),p=h>0?s:Math.min(Math.max(-s,-c),s),g=-h*h+p*(p+2*c)+f);else p=o>0?-s:s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*c)+f;return r&&r.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(tp).multiplyScalar(p).add(py),g}intersectSphere(e,t){Ps.subVectors(e.center,this.origin);const r=Ps.dot(this.direction),i=Ps.dot(Ps)-r*r,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=r-o,c=r+o;return a<0&&c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,s,o,a,c;const f=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,p=this.origin;return f>=0?(r=(e.min.x-p.x)*f,i=(e.max.x-p.x)*f):(r=(e.max.x-p.x)*f,i=(e.min.x-p.x)*f),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),r>o||s>i||((s>r||r!==r)&&(r=s),(o<i||i!==i)&&(i=o),h>=0?(a=(e.min.z-p.z)*h,c=(e.max.z-p.z)*h):(a=(e.max.z-p.z)*h,c=(e.min.z-p.z)*h),r>c||a>i)||((a>r||r!==r)&&(r=a),(c<i||i!==i)&&(i=c),i<0)?null:this.at(r>=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,Ps)!==null}intersectTriangle(e,t,r,i,s){my.subVectors(t,e),np.subVectors(r,e),gy.crossVectors(my,np);let o=this.direction.dot(gy),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ho.subVectors(this.origin,e);const c=a*this.direction.dot(np.crossVectors(ho,np));if(c<0)return null;const f=a*this.direction.dot(my.cross(ho));if(f<0||c+f>o)return null;const d=-a*ho.dot(gy);return d<0?null:this.at(d/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class dt{constructor(){dt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,r,i,s,o,a,c,f,d,h,p,g,v,y,x){const w=this.elements;return w[0]=e,w[4]=t,w[8]=r,w[12]=i,w[1]=s,w[5]=o,w[9]=a,w[13]=c,w[2]=f,w[6]=d,w[10]=h,w[14]=p,w[3]=g,w[7]=v,w[11]=y,w[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new dt().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[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,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/Nl.setFromMatrixColumn(e,0).length(),s=1/Nl.setFromMatrixColumn(e,1).length(),o=1/Nl.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*s,t[5]=r[5]*s,t[6]=r[6]*s,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),c=Math.cos(i),f=Math.sin(i),d=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*h,v=a*d,y=a*h;t[0]=c*d,t[4]=-c*h,t[8]=f,t[1]=g+v*f,t[5]=p-y*f,t[9]=-a*c,t[2]=y-p*f,t[6]=v+g*f,t[10]=o*c}else if(e.order==="YXZ"){const p=c*d,g=c*h,v=f*d,y=f*h;t[0]=p+y*a,t[4]=v*a-g,t[8]=o*f,t[1]=o*h,t[5]=o*d,t[9]=-a,t[2]=g*a-v,t[6]=y+p*a,t[10]=o*c}else if(e.order==="ZXY"){const p=c*d,g=c*h,v=f*d,y=f*h;t[0]=p-y*a,t[4]=-o*h,t[8]=v+g*a,t[1]=g+v*a,t[5]=o*d,t[9]=y-p*a,t[2]=-o*f,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){const p=o*d,g=o*h,v=a*d,y=a*h;t[0]=c*d,t[4]=v*f-g,t[8]=p*f+y,t[1]=c*h,t[5]=y*f+p,t[9]=g*f-v,t[2]=-f,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){const p=o*c,g=o*f,v=a*c,y=a*f;t[0]=c*d,t[4]=y-p*h,t[8]=v*h+g,t[1]=h,t[5]=o*d,t[9]=-a*d,t[2]=-f*d,t[6]=g*h+v,t[10]=p-y*h}else if(e.order==="XZY"){const p=o*c,g=o*f,v=a*c,y=a*f;t[0]=c*d,t[4]=-h,t[8]=f*d,t[1]=p*h+y,t[5]=o*d,t[9]=g*h-v,t[2]=v*h-g,t[6]=a*d,t[10]=y*h+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(RV,e,LV)}lookAt(e,t,r){const i=this.elements;return Fr.subVectors(e,t),Fr.lengthSq()===0&&(Fr.z=1),Fr.normalize(),po.crossVectors(r,Fr),po.lengthSq()===0&&(Math.abs(r.z)===1?Fr.x+=1e-4:Fr.z+=1e-4,Fr.normalize(),po.crossVectors(r,Fr)),po.normalize(),rp.crossVectors(Fr,po),i[0]=po.x,i[4]=rp.x,i[8]=Fr.x,i[1]=po.y,i[5]=rp.y,i[9]=Fr.y,i[2]=po.z,i[6]=rp.z,i[10]=Fr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[4],c=r[8],f=r[12],d=r[1],h=r[5],p=r[9],g=r[13],v=r[2],y=r[6],x=r[10],w=r[14],_=r[3],M=r[7],E=r[11],C=r[15],P=i[0],R=i[4],T=i[8],L=i[12],D=i[1],Y=i[5],fe=i[9],q=i[13],$=i[2],se=i[6],le=i[10],pe=i[14],z=i[3],F=i[7],G=i[11],Z=i[15];return s[0]=o*P+a*D+c*$+f*z,s[4]=o*R+a*Y+c*se+f*F,s[8]=o*T+a*fe+c*le+f*G,s[12]=o*L+a*q+c*pe+f*Z,s[1]=d*P+h*D+p*$+g*z,s[5]=d*R+h*Y+p*se+g*F,s[9]=d*T+h*fe+p*le+g*G,s[13]=d*L+h*q+p*pe+g*Z,s[2]=v*P+y*D+x*$+w*z,s[6]=v*R+y*Y+x*se+w*F,s[10]=v*T+y*fe+x*le+w*G,s[14]=v*L+y*q+x*pe+w*Z,s[3]=_*P+M*D+E*$+C*z,s[7]=_*R+M*Y+E*se+C*F,s[11]=_*T+M*fe+E*le+C*G,s[15]=_*L+M*q+E*pe+C*Z,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],r=e[4],i=e[8],s=e[12],o=e[1],a=e[5],c=e[9],f=e[13],d=e[2],h=e[6],p=e[10],g=e[14],v=e[3],y=e[7],x=e[11],w=e[15];return v*(+s*c*h-i*f*h-s*a*p+r*f*p+i*a*g-r*c*g)+y*(+t*c*g-t*f*p+s*o*p-i*o*g+i*f*d-s*c*d)+x*(+t*f*h-t*a*g-s*o*h+r*o*g+s*a*d-r*f*d)+w*(-i*a*d-t*c*h+t*a*p+i*o*h-r*o*p+r*c*d)}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,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],f=e[7],d=e[8],h=e[9],p=e[10],g=e[11],v=e[12],y=e[13],x=e[14],w=e[15],_=h*x*f-y*p*f+y*c*g-a*x*g-h*c*w+a*p*w,M=v*p*f-d*x*f-v*c*g+o*x*g+d*c*w-o*p*w,E=d*y*f-v*h*f+v*a*g-o*y*g-d*a*w+o*h*w,C=v*h*c-d*y*c-v*a*p+o*y*p+d*a*x-o*h*x,P=t*_+r*M+i*E+s*C;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/P;return e[0]=_*R,e[1]=(y*p*s-h*x*s-y*i*g+r*x*g+h*i*w-r*p*w)*R,e[2]=(a*x*s-y*c*s+y*i*f-r*x*f-a*i*w+r*c*w)*R,e[3]=(h*c*s-a*p*s-h*i*f+r*p*f+a*i*g-r*c*g)*R,e[4]=M*R,e[5]=(d*x*s-v*p*s+v*i*g-t*x*g-d*i*w+t*p*w)*R,e[6]=(v*c*s-o*x*s-v*i*f+t*x*f+o*i*w-t*c*w)*R,e[7]=(o*p*s-d*c*s+d*i*f-t*p*f-o*i*g+t*c*g)*R,e[8]=E*R,e[9]=(v*h*s-d*y*s-v*r*g+t*y*g+d*r*w-t*h*w)*R,e[10]=(o*y*s-v*a*s+v*r*f-t*y*f-o*r*w+t*a*w)*R,e[11]=(d*a*s-o*h*s-d*r*f+t*h*f+o*r*g-t*a*g)*R,e[12]=C*R,e[13]=(d*y*i-v*h*i+v*r*p-t*y*p-d*r*x+t*h*x)*R,e[14]=(v*a*i-o*y*i-v*r*c+t*y*c+o*r*x-t*a*x)*R,e[15]=(o*h*i-d*a*i+d*r*c-t*h*c-o*r*p+t*a*p)*R,this}scale(e){const t=this.elements,r=e.x,i=e.y,s=e.z;return t[0]*=r,t[4]*=i,t[8]*=s,t[1]*=r,t[5]*=i,t[9]*=s,t[2]*=r,t[6]*=i,t[10]*=s,t[3]*=r,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),s=1-r,o=e.x,a=e.y,c=e.z,f=s*o,d=s*a;return this.set(f*o+r,f*a-i*c,f*c+i*a,0,f*a+i*c,d*a+r,d*c-i*o,0,f*c-i*a,d*c+i*o,s*c*c+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,s,o){return this.set(1,r,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,s=t._x,o=t._y,a=t._z,c=t._w,f=s+s,d=o+o,h=a+a,p=s*f,g=s*d,v=s*h,y=o*d,x=o*h,w=a*h,_=c*f,M=c*d,E=c*h,C=r.x,P=r.y,R=r.z;return i[0]=(1-(y+w))*C,i[1]=(g+E)*C,i[2]=(v-M)*C,i[3]=0,i[4]=(g-E)*P,i[5]=(1-(p+w))*P,i[6]=(x+_)*P,i[7]=0,i[8]=(v+M)*R,i[9]=(x-_)*R,i[10]=(1-(p+y))*R,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let s=Nl.set(i[0],i[1],i[2]).length();const o=Nl.set(i[4],i[5],i[6]).length(),a=Nl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Pi.copy(this);const f=1/s,d=1/o,h=1/a;return Pi.elements[0]*=f,Pi.elements[1]*=f,Pi.elements[2]*=f,Pi.elements[4]*=d,Pi.elements[5]*=d,Pi.elements[6]*=d,Pi.elements[8]*=h,Pi.elements[9]*=h,Pi.elements[10]*=h,t.setFromRotationMatrix(Pi),r.x=s,r.y=o,r.z=a,this}makePerspective(e,t,r,i,s,o){const a=this.elements,c=2*s/(t-e),f=2*s/(r-i),d=(t+e)/(t-e),h=(r+i)/(r-i),p=-(o+s)/(o-s),g=-2*o*s/(o-s);return a[0]=c,a[4]=0,a[8]=d,a[12]=0,a[1]=0,a[5]=f,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=g,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,r,i,s,o){const a=this.elements,c=1/(t-e),f=1/(r-i),d=1/(o-s),h=(t+e)*c,p=(r+i)*f,g=(o+s)*d;return a[0]=2*c,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*f,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=-2*d,a[14]=-g,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const Nl=new I,Pi=new dt,RV=new I(0,0,0),LV=new I(1,1,1),po=new I,rp=new I,Fr=new I,_T=new dt,xT=new Gt;class ll{constructor(e=0,t=0,r=0,i=ll.DefaultOrder){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],c=i[1],f=i[5],d=i[9],h=i[2],p=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(xn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,f),this._z=0);break;case"YXZ":this._x=Math.asin(-xn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(c,f)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(xn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,g),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-xn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(xn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,f),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-xn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,f),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return _T.makeRotationFromQuaternion(e),this.setFromRotationMatrix(_T,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return xT.setFromEuler(this),this.setFromQuaternion(xT,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}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}ll.DefaultOrder="XYZ";ll.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Va{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 IV=0;const ST=new I,Dl=new Gt,Rs=new dt,ip=new I,Ic=new I,NV=new I,DV=new Gt,wT=new I(1,0,0),MT=new I(0,1,0),bT=new I(0,0,1),OV={type:"added"},ET={type:"removed"};class Mt extends Zs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:IV++}),this.uuid=Xr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Mt.DefaultUp.clone();const e=new I,t=new ll,r=new Gt,i=new I(1,1,1);function s(){r.setFromEuler(t,!1)}function o(){t.setFromQuaternion(r,void 0,!1)}t._onChange(s),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new dt},normalMatrix:{value:new Tr}}),this.matrix=new dt,this.matrixWorld=new dt,this.matrixAutoUpdate=Mt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=Mt.DefaultMatrixWorldAutoUpdate,this.layers=new Va,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}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 Dl.setFromAxisAngle(e,t),this.quaternion.multiply(Dl),this}rotateOnWorldAxis(e,t){return Dl.setFromAxisAngle(e,t),this.quaternion.premultiply(Dl),this}rotateX(e){return this.rotateOnAxis(wT,e)}rotateY(e){return this.rotateOnAxis(MT,e)}rotateZ(e){return this.rotateOnAxis(bT,e)}translateOnAxis(e,t){return ST.copy(e).applyQuaternion(this.quaternion),this.position.add(ST.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(wT,e)}translateY(e){return this.translateOnAxis(MT,e)}translateZ(e){return this.translateOnAxis(bT,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Rs.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?ip.copy(e):ip.set(e,t,r);const i=this.parent;this.updateWorldMatrix(!0,!1),Ic.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rs.lookAt(Ic,ip,this.up):Rs.lookAt(ip,Ic,this.up),this.quaternion.setFromRotationMatrix(Rs),i&&(Rs.extractRotation(i.matrixWorld),Dl.setFromRotationMatrix(Rs),this.quaternion.premultiply(Dl.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(OV)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(ET)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(ET)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),Rs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Rs.multiply(e.parent.matrixWorld)),e.applyMatrix4(Rs),this.add(e),e.updateWorldMatrix(!1,!0),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 r=0,i=this.children.length;r<i;r++){const o=this.children[r].getObjectByProperty(e,t);if(o!==void 0)return o}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ic,e,NV),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ic,DV,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 r=0,i=t.length;r<i;r++)t[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.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 r=0,i=t.length;r<i;r++){const s=t[r];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const r=this.parent;if(e===!0&&r!==null&&r.matrixWorldAutoUpdate===!0&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++){const a=i[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON()));function s(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const c=a.shapes;if(Array.isArray(c))for(let f=0,d=c.length;f<d;f++){const h=c[f];s(e.shapes,h)}else s(e.shapes,c)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let c=0,f=this.material.length;c<f;c++)a.push(s(e.materials,this.material[c]));i.material=a}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){const c=this.animations[a];i.animations.push(s(e.animations,c))}}if(t){const a=o(e.geometries),c=o(e.materials),f=o(e.textures),d=o(e.images),h=o(e.shapes),p=o(e.skeletons),g=o(e.animations),v=o(e.nodes);a.length>0&&(r.geometries=a),c.length>0&&(r.materials=c),f.length>0&&(r.textures=f),d.length>0&&(r.images=d),h.length>0&&(r.shapes=h),p.length>0&&(r.skeletons=p),g.length>0&&(r.animations=g),v.length>0&&(r.nodes=v)}return r.object=i,r;function o(a){const c=[];for(const f in a){const d=a[f];delete d.metadata,c.push(d)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}Mt.DefaultUp=new I(0,1,0);Mt.DefaultMatrixAutoUpdate=!0;Mt.DefaultMatrixWorldAutoUpdate=!0;const Ri=new I,Ls=new I,vy=new I,Is=new I,Ol=new I,kl=new I,TT=new I,yy=new I,_y=new I,xy=new I;class vi{constructor(e=new I,t=new I,r=new I){this.a=e,this.b=t,this.c=r}static getNormal(e,t,r,i){i.subVectors(r,t),Ri.subVectors(e,t),i.cross(Ri);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,r,i,s){Ri.subVectors(i,t),Ls.subVectors(r,t),vy.subVectors(e,t);const o=Ri.dot(Ri),a=Ri.dot(Ls),c=Ri.dot(vy),f=Ls.dot(Ls),d=Ls.dot(vy),h=o*f-a*a;if(h===0)return s.set(-2,-1,-1);const p=1/h,g=(f*c-a*d)*p,v=(o*d-a*c)*p;return s.set(1-g-v,v,g)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,Is),Is.x>=0&&Is.y>=0&&Is.x+Is.y<=1}static getUV(e,t,r,i,s,o,a,c){return this.getBarycoord(e,t,r,i,Is),c.set(0,0),c.addScaledVector(s,Is.x),c.addScaledVector(o,Is.y),c.addScaledVector(a,Is.z),c}static isFrontFacing(e,t,r,i){return Ri.subVectors(r,t),Ls.subVectors(e,t),Ri.cross(Ls).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ri.subVectors(this.c,this.b),Ls.subVectors(this.a,this.b),Ri.cross(Ls).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return vi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return vi.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,r,i,s){return vi.getUV(e,this.a,this.b,this.c,t,r,i,s)}containsPoint(e){return vi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return vi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,s=this.c;let o,a;Ol.subVectors(i,r),kl.subVectors(s,r),yy.subVectors(e,r);const c=Ol.dot(yy),f=kl.dot(yy);if(c<=0&&f<=0)return t.copy(r);_y.subVectors(e,i);const d=Ol.dot(_y),h=kl.dot(_y);if(d>=0&&h<=d)return t.copy(i);const p=c*h-d*f;if(p<=0&&c>=0&&d<=0)return o=c/(c-d),t.copy(r).addScaledVector(Ol,o);xy.subVectors(e,s);const g=Ol.dot(xy),v=kl.dot(xy);if(v>=0&&g<=v)return t.copy(s);const y=g*f-c*v;if(y<=0&&f>=0&&v<=0)return a=f/(f-v),t.copy(r).addScaledVector(kl,a);const x=d*v-g*h;if(x<=0&&h-d>=0&&g-v>=0)return TT.subVectors(s,i),a=(h-d)/(h-d+(g-v)),t.copy(i).addScaledVector(TT,a);const w=1/(x+y+p);return o=y*w,a=p*w,t.copy(r).addScaledVector(Ol,o).addScaledVector(kl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let kV=0;class qn extends Zs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:kV++}),this.uuid=Xr(),this.name="",this.type="Material",this.blending=za,this.side=qa,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=oS,this.blendDst=aS,this.blendEquation=Sa,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=rg,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=rL,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=fm,this.stencilZFail=fm,this.stencilZPass=fm,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}const i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==za&&(r.blending=this.blending),this.side!==qa&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function i(s){const o=[];for(const a in s){const c=s[a];delete c.metadata,o.push(c)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(r.textures=s),o.length>0&&(r.images=o)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(t!==null){const i=t.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=t[s].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.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++}}class hs extends qn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ge(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.combine=cd,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.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 Mn=new I,sp=new Me;class qt{constructor(e,t,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r===!0,this.usage=Wf,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,r=this.count;t<r;t++)sp.fromBufferAttribute(this,t),sp.applyMatrix3(e),this.setXY(t,sp.x,sp.y);else if(this.itemSize===3)for(let t=0,r=this.count;t<r;t++)Mn.fromBufferAttribute(this,t),Mn.applyMatrix3(e),this.setXYZ(t,Mn.x,Mn.y,Mn.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)Mn.fromBufferAttribute(this,t),Mn.applyMatrix4(e),this.setXYZ(t,Mn.x,Mn.y,Mn.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)Mn.fromBufferAttribute(this,t),Mn.applyNormalMatrix(e),this.setXYZ(t,Mn.x,Mn.y,Mn.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)Mn.fromBufferAttribute(this,t),Mn.transformDirection(e),this.setXYZ(t,Mn.x,Mn.y,Mn.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Us(t,this.array)),t}setX(e,t){return this.normalized&&(t=Xt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Us(t,this.array)),t}setY(e,t){return this.normalized&&(t=Xt(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=Us(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Xt(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=Us(t,this.array)),t}setW(e,t){return this.normalized&&(t=Xt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=Xt(t,this.array),r=Xt(r,this.array)),this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=Xt(t,this.array),r=Xt(r,this.array),i=Xt(i,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e*=this.itemSize,this.normalized&&(t=Xt(t,this.array),r=Xt(r,this.array),i=Xt(i,this.array),s=Xt(s,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Wf&&(e.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(e.updateRange=this.updateRange),e}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class zV extends qt{constructor(e,t,r){super(new Int8Array(e),t,r)}}class FV extends qt{constructor(e,t,r){super(new Uint8Array(e),t,r)}}class UV extends qt{constructor(e,t,r){super(new Uint8ClampedArray(e),t,r)}}class BV extends qt{constructor(e,t,r){super(new Int16Array(e),t,r)}}class pS extends qt{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class VV extends qt{constructor(e,t,r){super(new Int32Array(e),t,r)}}class mS extends qt{constructor(e,t,r){super(new Uint32Array(e),t,r)}}class GV extends qt{constructor(e,t,r){super(new Uint16Array(e),t,r),this.isFloat16BufferAttribute=!0}}class Xe extends qt{constructor(e,t,r){super(new Float32Array(e),t,r)}}class HV extends qt{constructor(e,t,r){super(new Float64Array(e),t,r)}}let WV=0;const fi=new dt,Sy=new Mt,zl=new I,Ur=new ol,Nc=new ol,Un=new I;class ht extends Zs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:WV++}),this.uuid=Xr(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(sL(e)?mS:pS)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}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 r=this.attributes.normal;if(r!==void 0){const s=new Tr().getNormalMatrix(e);r.applyNormalMatrix(s),r.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return fi.makeRotationFromQuaternion(e),this.applyMatrix4(fi),this}rotateX(e){return fi.makeRotationX(e),this.applyMatrix4(fi),this}rotateY(e){return fi.makeRotationY(e),this.applyMatrix4(fi),this}rotateZ(e){return fi.makeRotationZ(e),this.applyMatrix4(fi),this}translate(e,t,r){return fi.makeTranslation(e,t,r),this.applyMatrix4(fi),this}scale(e,t,r){return fi.makeScale(e,t,r),this.applyMatrix4(fi),this}lookAt(e){return Sy.lookAt(e),Sy.updateMatrix(),this.applyMatrix4(Sy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(zl).negate(),this.translate(zl.x,zl.y,zl.z),this}setFromPoints(e){const t=[];for(let r=0,i=e.length;r<i;r++){const s=e[r];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Xe(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ol);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new I(-1/0,-1/0,-1/0),new I(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let r=0,i=t.length;r<i;r++){const s=t[r];Ur.setFromBufferAttribute(s),this.morphTargetsRelative?(Un.addVectors(this.boundingBox.min,Ur.min),this.boundingBox.expandByPoint(Un),Un.addVectors(this.boundingBox.max,Ur.max),this.boundingBox.expandByPoint(Un)):(this.boundingBox.expandByPoint(Ur.min),this.boundingBox.expandByPoint(Ur.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new al);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new I,1/0);return}if(e){const r=this.boundingSphere.center;if(Ur.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];Nc.setFromBufferAttribute(a),this.morphTargetsRelative?(Un.addVectors(Ur.min,Nc.min),Ur.expandByPoint(Un),Un.addVectors(Ur.max,Nc.max),Ur.expandByPoint(Un)):(Ur.expandByPoint(Nc.min),Ur.expandByPoint(Nc.max))}Ur.getCenter(r);let i=0;for(let s=0,o=e.count;s<o;s++)Un.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(Un));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],c=this.morphTargetsRelative;for(let f=0,d=a.count;f<d;f++)Un.fromBufferAttribute(a,f),c&&(zl.fromBufferAttribute(e,f),Un.add(zl)),i=Math.max(i,r.distanceToSquared(Un))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=e.array,i=t.position.array,s=t.normal.array,o=t.uv.array,a=i.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new qt(new Float32Array(4*a),4));const c=this.getAttribute("tangent").array,f=[],d=[];for(let D=0;D<a;D++)f[D]=new I,d[D]=new I;const h=new I,p=new I,g=new I,v=new Me,y=new Me,x=new Me,w=new I,_=new I;function M(D,Y,fe){h.fromArray(i,D*3),p.fromArray(i,Y*3),g.fromArray(i,fe*3),v.fromArray(o,D*2),y.fromArray(o,Y*2),x.fromArray(o,fe*2),p.sub(h),g.sub(h),y.sub(v),x.sub(v);const q=1/(y.x*x.y-x.x*y.y);!isFinite(q)||(w.copy(p).multiplyScalar(x.y).addScaledVector(g,-y.y).multiplyScalar(q),_.copy(g).multiplyScalar(y.x).addScaledVector(p,-x.x).multiplyScalar(q),f[D].add(w),f[Y].add(w),f[fe].add(w),d[D].add(_),d[Y].add(_),d[fe].add(_))}let E=this.groups;E.length===0&&(E=[{start:0,count:r.length}]);for(let D=0,Y=E.length;D<Y;++D){const fe=E[D],q=fe.start,$=fe.count;for(let se=q,le=q+$;se<le;se+=3)M(r[se+0],r[se+1],r[se+2])}const C=new I,P=new I,R=new I,T=new I;function L(D){R.fromArray(s,D*3),T.copy(R);const Y=f[D];C.copy(Y),C.sub(R.multiplyScalar(R.dot(Y))).normalize(),P.crossVectors(T,Y);const q=P.dot(d[D])<0?-1:1;c[D*4]=C.x,c[D*4+1]=C.y,c[D*4+2]=C.z,c[D*4+3]=q}for(let D=0,Y=E.length;D<Y;++D){const fe=E[D],q=fe.start,$=fe.count;for(let se=q,le=q+$;se<le;se+=3)L(r[se+0]),L(r[se+1]),L(r[se+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new qt(new Float32Array(t.count*3),3),this.setAttribute("normal",r);else for(let p=0,g=r.count;p<g;p++)r.setXYZ(p,0,0,0);const i=new I,s=new I,o=new I,a=new I,c=new I,f=new I,d=new I,h=new I;if(e)for(let p=0,g=e.count;p<g;p+=3){const v=e.getX(p+0),y=e.getX(p+1),x=e.getX(p+2);i.fromBufferAttribute(t,v),s.fromBufferAttribute(t,y),o.fromBufferAttribute(t,x),d.subVectors(o,s),h.subVectors(i,s),d.cross(h),a.fromBufferAttribute(r,v),c.fromBufferAttribute(r,y),f.fromBufferAttribute(r,x),a.add(d),c.add(d),f.add(d),r.setXYZ(v,a.x,a.y,a.z),r.setXYZ(y,c.x,c.y,c.z),r.setXYZ(x,f.x,f.y,f.z)}else for(let p=0,g=t.count;p<g;p+=3)i.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),d.subVectors(o,s),h.subVectors(i,s),d.cross(h),r.setXYZ(p+0,d.x,d.y,d.z),r.setXYZ(p+1,d.x,d.y,d.z),r.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),r.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)Un.fromBufferAttribute(e,t),Un.normalize(),e.setXYZ(t,Un.x,Un.y,Un.z)}toNonIndexed(){function e(a,c){const f=a.array,d=a.itemSize,h=a.normalized,p=new f.constructor(c.length*d);let g=0,v=0;for(let y=0,x=c.length;y<x;y++){a.isInterleavedBufferAttribute?g=c[y]*a.data.stride+a.offset:g=c[y]*d;for(let w=0;w<d;w++)p[v++]=f[g++]}return new qt(p,d,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ht,r=this.index.array,i=this.attributes;for(const a in i){const c=i[a],f=e(c,r);t.setAttribute(a,f)}const s=this.morphAttributes;for(const a in s){const c=[],f=s[a];for(let d=0,h=f.length;d<h;d++){const p=f[d],g=e(p,r);c.push(g)}t.morphAttributes[a]=c}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,c=o.length;a<c;a++){const f=o[a];t.addGroup(f.start,f.count,f.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const f in c)c[f]!==void 0&&(e[f]=c[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const c in r){const f=r[c];e.data.attributes[c]=f.toJSON(e.data)}const i={};let s=!1;for(const c in this.morphAttributes){const f=this.morphAttributes[c],d=[];for(let h=0,p=f.length;h<p;h++){const g=f[h];d.push(g.toJSON(e.data))}d.length>0&&(i[c]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(t));const i=e.attributes;for(const f in i){const d=i[f];this.setAttribute(f,d.clone(t))}const s=e.morphAttributes;for(const f in s){const d=[],h=s[f];for(let p=0,g=h.length;p<g;p++)d.push(h[p].clone(t));this.morphAttributes[f]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let f=0,d=o.length;f<d;f++){const h=o[f];this.addGroup(h.start,h.count,h.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,e.parameters!==void 0&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}const CT=new dt,Fl=new dd,wy=new al,mo=new I,go=new I,vo=new I,My=new I,by=new I,Ey=new I,op=new I,ap=new I,lp=new I,up=new Me,cp=new Me,fp=new Me,Ty=new I,dp=new I;class We extends Mt{constructor(e=new ht,t=new hs){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}raycast(e,t){const r=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(r.boundingSphere===null&&r.computeBoundingSphere(),wy.copy(r.boundingSphere),wy.applyMatrix4(s),e.ray.intersectsSphere(wy)===!1)||(CT.copy(s).invert(),Fl.copy(e.ray).applyMatrix4(CT),r.boundingBox!==null&&Fl.intersectsBox(r.boundingBox)===!1))return;let o;const a=r.index,c=r.attributes.position,f=r.morphAttributes.position,d=r.morphTargetsRelative,h=r.attributes.uv,p=r.attributes.uv2,g=r.groups,v=r.drawRange;if(a!==null)if(Array.isArray(i))for(let y=0,x=g.length;y<x;y++){const w=g[y],_=i[w.materialIndex],M=Math.max(w.start,v.start),E=Math.min(a.count,Math.min(w.start+w.count,v.start+v.count));for(let C=M,P=E;C<P;C+=3){const R=a.getX(C),T=a.getX(C+1),L=a.getX(C+2);o=hp(this,_,e,Fl,c,f,d,h,p,R,T,L),o&&(o.faceIndex=Math.floor(C/3),o.face.materialIndex=w.materialIndex,t.push(o))}}else{const y=Math.max(0,v.start),x=Math.min(a.count,v.start+v.count);for(let w=y,_=x;w<_;w+=3){const M=a.getX(w),E=a.getX(w+1),C=a.getX(w+2);o=hp(this,i,e,Fl,c,f,d,h,p,M,E,C),o&&(o.faceIndex=Math.floor(w/3),t.push(o))}}else if(c!==void 0)if(Array.isArray(i))for(let y=0,x=g.length;y<x;y++){const w=g[y],_=i[w.materialIndex],M=Math.max(w.start,v.start),E=Math.min(c.count,Math.min(w.start+w.count,v.start+v.count));for(let C=M,P=E;C<P;C+=3){const R=C,T=C+1,L=C+2;o=hp(this,_,e,Fl,c,f,d,h,p,R,T,L),o&&(o.faceIndex=Math.floor(C/3),o.face.materialIndex=w.materialIndex,t.push(o))}}else{const y=Math.max(0,v.start),x=Math.min(c.count,v.start+v.count);for(let w=y,_=x;w<_;w+=3){const M=w,E=w+1,C=w+2;o=hp(this,i,e,Fl,c,f,d,h,p,M,E,C),o&&(o.faceIndex=Math.floor(w/3),t.push(o))}}}}function $V(n,e,t,r,i,s,o,a){let c;if(e.side===jr?c=r.intersectTriangle(o,s,i,!0,a):c=r.intersectTriangle(i,s,o,e.side!==ki,a),c===null)return null;dp.copy(a),dp.applyMatrix4(n.matrixWorld);const f=t.ray.origin.distanceTo(dp);return f<t.near||f>t.far?null:{distance:f,point:dp.clone(),object:n}}function hp(n,e,t,r,i,s,o,a,c,f,d,h){mo.fromBufferAttribute(i,f),go.fromBufferAttribute(i,d),vo.fromBufferAttribute(i,h);const p=n.morphTargetInfluences;if(s&&p){op.set(0,0,0),ap.set(0,0,0),lp.set(0,0,0);for(let v=0,y=s.length;v<y;v++){const x=p[v],w=s[v];x!==0&&(My.fromBufferAttribute(w,f),by.fromBufferAttribute(w,d),Ey.fromBufferAttribute(w,h),o?(op.addScaledVector(My,x),ap.addScaledVector(by,x),lp.addScaledVector(Ey,x)):(op.addScaledVector(My.sub(mo),x),ap.addScaledVector(by.sub(go),x),lp.addScaledVector(Ey.sub(vo),x)))}mo.add(op),go.add(ap),vo.add(lp)}n.isSkinnedMesh&&(n.boneTransform(f,mo),n.boneTransform(d,go),n.boneTransform(h,vo));const g=$V(n,e,t,r,mo,go,vo,Ty);if(g){a&&(up.fromBufferAttribute(a,f),cp.fromBufferAttribute(a,d),fp.fromBufferAttribute(a,h),g.uv=vi.getUV(Ty,mo,go,vo,up,cp,fp,new Me)),c&&(up.fromBufferAttribute(c,f),cp.fromBufferAttribute(c,d),fp.fromBufferAttribute(c,h),g.uv2=vi.getUV(Ty,mo,go,vo,up,cp,fp,new Me));const v={a:f,b:d,c:h,normal:new I,materialIndex:0};vi.getNormal(mo,go,vo,v.normal),g.face=v}return g}class hr extends ht{constructor(e=1,t=1,r=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const c=[],f=[],d=[],h=[];let p=0,g=0;v("z","y","x",-1,-1,r,t,e,o,s,0),v("z","y","x",1,-1,r,t,-e,o,s,1),v("x","z","y",1,1,e,r,t,i,o,2),v("x","z","y",1,-1,e,r,-t,i,o,3),v("x","y","z",1,-1,e,t,r,i,s,4),v("x","y","z",-1,-1,e,t,-r,i,s,5),this.setIndex(c),this.setAttribute("position",new Xe(f,3)),this.setAttribute("normal",new Xe(d,3)),this.setAttribute("uv",new Xe(h,2));function v(y,x,w,_,M,E,C,P,R,T,L){const D=E/R,Y=C/T,fe=E/2,q=C/2,$=P/2,se=R+1,le=T+1;let pe=0,z=0;const F=new I;for(let G=0;G<le;G++){const Z=G*Y-q;for(let k=0;k<se;k++){const W=k*D-fe;F[y]=W*_,F[x]=Z*M,F[w]=$,f.push(F.x,F.y,F.z),F[y]=0,F[x]=0,F[w]=P>0?1:-1,d.push(F.x,F.y,F.z),h.push(k/R),h.push(1-G/T),pe+=1}}for(let G=0;G<T;G++)for(let Z=0;Z<R;Z++){const k=p+Z+se*G,W=p+Z+se*(G+1),N=p+(Z+1)+se*(G+1),me=p+(Z+1)+se*G;c.push(k,W,me),c.push(W,N,me),z+=6}a.addGroup(g,z,L),g+=z,p+=pe}}static fromJSON(e){return new hr(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Lu(n){const e={};for(const t in n){e[t]={};for(const r in n[t]){const i=n[t][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?e[t][r]=i.clone():Array.isArray(i)?e[t][r]=i.slice():e[t][r]=i}}return e}function sr(n){const e={};for(let t=0;t<n.length;t++){const r=Lu(n[t]);for(const i in r)e[i]=r[i]}return e}function jV(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}const aL={clone:Lu,merge:sr};var XV=`void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,YV=`void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class fs extends qn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=XV,this.fragmentShader=YV,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[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=Lu(e.uniforms),this.uniformsGroups=jV(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const o=this.uniforms[i].value;o&&o.isTexture?t.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[i]={type:"m4",value:o.toArray()}:t.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class hd extends Mt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new dt,this.projectionMatrix=new dt,this.projectionMatrixInverse=new dt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Gn extends hd{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=$f*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Ua*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $f*2*Math.atan(Math.tan(Ua*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,r,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Ua*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const c=o.fullWidth,f=o.fullHeight;s+=o.offsetX*i/c,t-=o.offsetY*r/f,i*=o.width/c,r*=o.height/f}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ul=90,Bl=1;class lL extends Mt{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new Gn(Ul,Bl,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new I(1,0,0)),this.add(i);const s=new Gn(Ul,Bl,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new I(-1,0,0)),this.add(s);const o=new Gn(Ul,Bl,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new I(0,1,0)),this.add(o);const a=new Gn(Ul,Bl,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new I(0,-1,0)),this.add(a);const c=new Gn(Ul,Bl,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new I(0,0,1)),this.add(c);const f=new Gn(Ul,Bl,e,t);f.layers=this.layers,f.up.set(0,-1,0),f.lookAt(new I(0,0,-1)),this.add(f)}update(e,t){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,s,o,a,c,f]=this.children,d=e.getRenderTarget(),h=e.toneMapping,p=e.xr.enabled;e.toneMapping=Ui,e.xr.enabled=!1;const g=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,s),e.setRenderTarget(r,2),e.render(t,o),e.setRenderTarget(r,3),e.render(t,a),e.setRenderTarget(r,4),e.render(t,c),r.texture.generateMipmaps=g,e.setRenderTarget(r,5),e.render(t,f),e.setRenderTarget(d),e.toneMapping=h,e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class pd extends Cn{constructor(e,t,r,i,s,o,a,c,f,d){e=e!==void 0?e:[],t=t!==void 0?t:Vo,super(e,t,r,i,s,o,a,c,f,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class uL extends qr{constructor(e,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new pd(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:un}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:`
varying vec3 vWorldDirection;
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}
`,fragmentShader:`
uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
}
`},i=new hr(5,5,5),s=new fs({name:"CubemapFromEquirect",uniforms:Lu(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:jr,blending:Gs});s.uniforms.tEquirect.value=t;const o=new We(i,s),a=t.minFilter;return t.minFilter===sl&&(t.minFilter=un),new lL(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,r,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,r,i);e.setRenderTarget(s)}}const Cy=new I,qV=new I,ZV=new Tr;class So{constructor(e=new I(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,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=Cy.subVectors(r,t).cross(qV.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const r=e.delta(Cy),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(r).multiplyScalar(s).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<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 r=t||ZV.getNormalMatrix(e),i=this.coplanarPoint(Cy).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Vl=new al,pp=new I;class Wg{constructor(e=new So,t=new So,r=new So,i=new So,s=new So,o=new So){this.planes=[e,t,r,i,s,o]}set(e,t,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const t=this.planes,r=e.elements,i=r[0],s=r[1],o=r[2],a=r[3],c=r[4],f=r[5],d=r[6],h=r[7],p=r[8],g=r[9],v=r[10],y=r[11],x=r[12],w=r[13],_=r[14],M=r[15];return t[0].setComponents(a-i,h-c,y-p,M-x).normalize(),t[1].setComponents(a+i,h+c,y+p,M+x).normalize(),t[2].setComponents(a+s,h+f,y+g,M+w).normalize(),t[3].setComponents(a-s,h-f,y-g,M-w).normalize(),t[4].setComponents(a-o,h-d,y-v,M-_).normalize(),t[5].setComponents(a+o,h+d,y+v,M+_).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),Vl.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Vl)}intersectsSprite(e){return Vl.center.set(0,0,0),Vl.radius=.7071067811865476,Vl.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vl)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const i=t[r];if(pp.x=i.normal.x>0?e.max.x:e.min.x,pp.y=i.normal.y>0?e.max.y:e.min.y,pp.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(pp)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function cL(){let n=null,e=!1,t=null,r=null;function i(s,o){t(s,o),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function QV(n,e){const t=e.isWebGL2,r=new WeakMap;function i(f,d){const h=f.array,p=f.usage,g=n.createBuffer();n.bindBuffer(d,g),n.bufferData(d,h,p),f.onUploadCallback();let v;if(h instanceof Float32Array)v=5126;else if(h instanceof Uint16Array)if(f.isFloat16BufferAttribute)if(t)v=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else v=5123;else if(h instanceof Int16Array)v=5122;else if(h instanceof Uint32Array)v=5125;else if(h instanceof Int32Array)v=5124;else if(h instanceof Int8Array)v=5120;else if(h instanceof Uint8Array)v=5121;else if(h instanceof Uint8ClampedArray)v=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:g,type:v,bytesPerElement:h.BYTES_PER_ELEMENT,version:f.version}}function s(f,d,h){const p=d.array,g=d.updateRange;n.bindBuffer(h,f),g.count===-1?n.bufferSubData(h,0,p):(t?n.bufferSubData(h,g.offset*p.BYTES_PER_ELEMENT,p,g.offset,g.count):n.bufferSubData(h,g.offset*p.BYTES_PER_ELEMENT,p.subarray(g.offset,g.offset+g.count)),g.count=-1)}function o(f){return f.isInterleavedBufferAttribute&&(f=f.data),r.get(f)}function a(f){f.isInterleavedBufferAttribute&&(f=f.data);const d=r.get(f);d&&(n.deleteBuffer(d.buffer),r.delete(f))}function c(f,d){if(f.isGLBufferAttribute){const p=r.get(f);(!p||p.version<f.version)&&r.set(f,{buffer:f.buffer,type:f.type,bytesPerElement:f.elementSize,version:f.version});return}f.isInterleavedBufferAttribute&&(f=f.data);const h=r.get(f);h===void 0?r.set(f,i(f,d)):h.version<f.version&&(s(h.buffer,f,d),h.version=f.version)}return{get:o,remove:a,update:c}}class Gr extends ht{constructor(e=1,t=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:i};const s=e/2,o=t/2,a=Math.floor(r),c=Math.floor(i),f=a+1,d=c+1,h=e/a,p=t/c,g=[],v=[],y=[],x=[];for(let w=0;w<d;w++){const _=w*p-o;for(let M=0;M<f;M++){const E=M*h-s;v.push(E,-_,0),y.push(0,0,1),x.push(M/a),x.push(1-w/c)}}for(let w=0;w<c;w++)for(let _=0;_<a;_++){const M=_+f*w,E=_+f*(w+1),C=_+1+f*(w+1),P=_+1+f*w;g.push(M,E,P),g.push(E,C,P)}this.setIndex(g),this.setAttribute("position",new Xe(v,3)),this.setAttribute("normal",new Xe(y,3)),this.setAttribute("uv",new Xe(x,2))}static fromJSON(e){return new Gr(e.width,e.height,e.widthSegments,e.heightSegments)}}var KV=`#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, vUv ).g;
#endif`,JV=`#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,e6=`#ifdef USE_ALPHATEST
if ( diffuseColor.a < alphaTest ) discard;
#endif`,t6=`#ifdef USE_ALPHATEST
uniform float alphaTest;
#endif`,n6=`#ifdef USE_AOMAP
float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
reflectedLight.indirectDiffuse *= ambientOcclusion;
#if defined( USE_ENVMAP ) && defined( STANDARD )
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
#endif
#endif`,r6=`#ifdef USE_AOMAP
uniform sampler2D aoMap;
uniform float aoMapIntensity;
#endif`,i6="vec3 transformed = vec3( position );",s6=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
vec3 objectTangent = vec3( tangent.xyz );
#endif`,o6=`vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
float x2 = x * x;
float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
float a2 = pow2( alpha );
float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
float a2 = pow2( alpha );
float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
return RECIPROCAL_PI * a2 / pow2( denom );
}
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {
float alpha = pow2( roughness );
vec3 halfDir = normalize( lightDir + viewDir );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = F_Schlick( f0, f90, dotVH );
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
float D = D_GGX( alpha, dotNH );
return F * ( V * D );
}
#ifdef USE_IRIDESCENCE
vec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {
float alpha = pow2( roughness );
vec3 halfDir = normalize( lightDir + viewDir );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
float D = D_GGX( alpha, dotNH );
return F * ( V * D );
}
#endif
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
const float LUT_SIZE = 64.0;
const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
const float LUT_BIAS = 0.5 / LUT_SIZE;
float dotNV = saturate( dot( N, V ) );
vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
uv = uv * LUT_SCALE + LUT_BIAS;
return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
float l = length( f );
return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
float x = dot( v1, v2 );
float y = abs( x );
float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
float b = 3.4175940 + ( 4.1616724 + y ) * y;
float v = a / b;
float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
vec3 lightNormal = cross( v1, v2 );
if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
vec3 T1, T2;
T1 = normalize( V - N * dot( V, N ) );
T2 = - cross( N, T1 );
mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
vec3 coords[ 4 ];
coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
coords[ 0 ] = normalize( coords[ 0 ] );
coords[ 1 ] = normalize( coords[ 1 ] );
coords[ 2 ] = normalize( coords[ 2 ] );
coords[ 3 ] = normalize( coords[ 3 ] );
vec3 vectorFormFactor = vec3( 0.0 );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
return vec3( result );
}
float G_BlinnPhong_Implicit( ) {
return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
vec3 halfDir = normalize( lightDir + viewDir );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = F_Schlick( specularColor, 1.0, dotVH );
float G = G_BlinnPhong_Implicit( );
float D = D_BlinnPhong( shininess, dotNH );
return F * ( G * D );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
float alpha = pow2( roughness );
float invAlpha = 1.0 / alpha;
float cos2h = dotNH * dotNH;
float sin2h = max( 1.0 - cos2h, 0.0078125 );
return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
vec3 halfDir = normalize( lightDir + viewDir );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float D = D_Charlie( sheenRoughness, dotNH );
float V = V_Neubelt( dotNV, dotNL );
return sheenColor * ( D * V );
}
#endif`,a6=`#ifdef USE_IRIDESCENCE
const mat3 XYZ_TO_REC709 = mat3(
3.2404542, -0.9692660, 0.0556434,
-1.5371385, 1.8760108, -0.2040259,
-0.4985314, 0.0415560, 1.0572252
);
vec3 Fresnel0ToIor( vec3 fresnel0 ) {
vec3 sqrtF0 = sqrt( fresnel0 );
return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
}
vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
}
float IorToFresnel0( float transmittedIor, float incidentIor ) {
return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
}
vec3 evalSensitivity( float OPD, vec3 shift ) {
float phase = 2.0 * PI * OPD * 1.0e-9;
vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
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 ) );
xyz /= 1.0685e-7;
vec3 rgb = XYZ_TO_REC709 * xyz;
return rgb;
}
vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
vec3 I;
float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
float cosTheta2Sq = 1.0 - sinTheta2Sq;
if ( cosTheta2Sq < 0.0 ) {
return vec3( 1.0 );
}
float cosTheta2 = sqrt( cosTheta2Sq );
float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
float R12 = F_Schlick( R0, 1.0, cosTheta1 );
float R21 = R12;
float T121 = 1.0 - R12;
float phi12 = 0.0;
if ( iridescenceIOR < outsideIOR ) phi12 = PI;
float phi21 = PI - phi12;
vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
vec3 phi23 = vec3( 0.0 );
if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
vec3 phi = vec3( phi21 ) + phi23;
vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
vec3 r123 = sqrt( R123 );
vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
vec3 C0 = R12 + Rs;
I = C0;
vec3 Cm = Rs - T121;
for ( int m = 1; m <= 2; ++ m ) {
Cm *= r123;
vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
I += Cm * Sm;
}
return max( I, vec3( 0.0 ) );
}
#endif`,l6=`#ifdef USE_BUMPMAP
uniform sampler2D bumpMap;
uniform float bumpScale;
vec2 dHdxy_fwd() {
vec2 dSTdx = dFdx( vUv );
vec2 dSTdy = dFdy( vUv );
float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
return vec2( dBx, dBy );
}
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
vec3 vSigmaX = dFdx( surf_pos.xyz );
vec3 vSigmaY = dFdy( surf_pos.xyz );
vec3 vN = surf_norm;
vec3 R1 = cross( vSigmaY, vN );
vec3 R2 = cross( vN, vSigmaX );
float fDet = dot( vSigmaX, R1 ) * faceDirection;
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
return normalize( abs( fDet ) * surf_norm - vGrad );
}
#endif`,u6=`#if NUM_CLIPPING_PLANES > 0
vec4 plane;
#pragma unroll_loop_start
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
}
#pragma unroll_loop_end
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
bool clipped = true;
#pragma unroll_loop_start
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
}
#pragma unroll_loop_end
if ( clipped ) discard;
#endif
#endif`,c6=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,f6=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`,d6=`#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
#endif`,h6=`#if defined( USE_COLOR_ALPHA )
diffuseColor *= vColor;
#elif defined( USE_COLOR )
diffuseColor.rgb *= vColor;
#endif`,p6=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR )
varying vec3 vColor;
#endif`,m6=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
varying vec3 vColor;
#endif`,g6=`#if defined( USE_COLOR_ALPHA )
vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
vColor.xyz *= instanceColor.xyz;
#endif`,v6=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
const highp float a = 12.9898, b = 78.233, c = 43758.5453;
highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
float precisionSafeLength( vec3 v ) { return length( v ); }
#else
float precisionSafeLength( vec3 v ) {
float maxComponent = max3( abs( v ) );
return length( v / maxComponent ) * maxComponent;
}
#endif
struct IncidentLight {
vec3 color;
vec3 direction;
bool visible;
};
struct ReflectedLight {
vec3 directDiffuse;
vec3 directSpecular;
vec3 indirectDiffuse;
vec3 indirectSpecular;
};
struct GeometricContext {
vec3 position;
vec3 normal;
vec3 viewDir;
#ifdef USE_CLEARCOAT
vec3 clearcoatNormal;
#endif
};
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
mat3 tmp;
tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
return tmp;
}
float luminance( const in vec3 rgb ) {
const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
return dot( weights, rgb );
}
bool isPerspectiveMatrix( mat4 m ) {
return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
return vec2( u, v );
}`,y6=`#ifdef ENVMAP_TYPE_CUBE_UV
#define cubeUV_minMipLevel 4.0
#define cubeUV_minTileSize 16.0
float getFace( vec3 direction ) {
vec3 absDirection = abs( direction );
float face = - 1.0;
if ( absDirection.x > absDirection.z ) {
if ( absDirection.x > absDirection.y )
face = direction.x > 0.0 ? 0.0 : 3.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
} else {
if ( absDirection.z > absDirection.y )
face = direction.z > 0.0 ? 2.0 : 5.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
}
return face;
}
vec2 getUV( vec3 direction, float face ) {
vec2 uv;
if ( face == 0.0 ) {
uv = vec2( direction.z, direction.y ) / abs( direction.x );
} else if ( face == 1.0 ) {
uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
} else if ( face == 2.0 ) {
uv = vec2( - direction.x, direction.y ) / abs( direction.z );
} else if ( face == 3.0 ) {
uv = vec2( - direction.z, direction.y ) / abs( direction.x );
} else if ( face == 4.0 ) {
uv = vec2( - direction.x, direction.z ) / abs( direction.y );
} else {
uv = vec2( direction.x, direction.y ) / abs( direction.z );
}
return 0.5 * ( uv + 1.0 );
}
vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
float face = getFace( direction );
float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
mipInt = max( mipInt, cubeUV_minMipLevel );
float faceSize = exp2( mipInt );
vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
if ( face > 2.0 ) {
uv.y += faceSize;
face -= 3.0;
}
uv.x += face * faceSize;
uv.x += filterInt * 3.0 * cubeUV_minTileSize;
uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
uv.x *= CUBEUV_TEXEL_WIDTH;
uv.y *= CUBEUV_TEXEL_HEIGHT;
#ifdef texture2DGradEXT
return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
#else
return texture2D( envMap, uv ).rgb;
#endif
}
#define cubeUV_r0 1.0
#define cubeUV_v0 0.339
#define cubeUV_m0 - 2.0
#define cubeUV_r1 0.8
#define cubeUV_v1 0.276
#define cubeUV_m1 - 1.0
#define cubeUV_r4 0.4
#define cubeUV_v4 0.046
#define cubeUV_m4 2.0
#define cubeUV_r5 0.305
#define cubeUV_v5 0.016
#define cubeUV_m5 3.0
#define cubeUV_r6 0.21
#define cubeUV_v6 0.0038
#define cubeUV_m6 4.0
float roughnessToMip( float roughness ) {
float mip = 0.0;
if ( roughness >= cubeUV_r1 ) {
mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
} else if ( roughness >= cubeUV_r4 ) {
mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
} else if ( roughness >= cubeUV_r5 ) {
mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
} else if ( roughness >= cubeUV_r6 ) {
mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
} else {
mip = - 2.0 * log2( 1.16 * roughness ); }
return mip;
}
vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
float mipF = fract( mip );
float mipInt = floor( mip );
vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
if ( mipF == 0.0 ) {
return vec4( color0, 1.0 );
} else {
vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
return vec4( mix( color0, color1, mipF ), 1.0 );
}
}
#endif`,_6=`vec3 transformedNormal = objectNormal;
#ifdef USE_INSTANCING
mat3 m = mat3( instanceMatrix );
transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
transformedNormal = m * transformedNormal;
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
#ifdef FLIP_SIDED
transformedTangent = - transformedTangent;
#endif
#endif`,x6=`#ifdef USE_DISPLACEMENTMAP
uniform sampler2D displacementMap;
uniform float displacementScale;
uniform float displacementBias;
#endif`,S6=`#ifdef USE_DISPLACEMENTMAP
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
#endif`,w6=`#ifdef USE_EMISSIVEMAP
vec4 emissiveColor = texture2D( emissiveMap, vUv );
totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,M6=`#ifdef USE_EMISSIVEMAP
uniform sampler2D emissiveMap;
#endif`,b6="gl_FragColor = linearToOutputTexel( gl_FragColor );",E6=`vec4 LinearToLinear( in vec4 value ) {
return value;
}
vec4 LinearTosRGB( in vec4 value ) {
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}`,T6=`#ifdef USE_ENVMAP
#ifdef ENV_WORLDPOS
vec3 cameraToFrag;
if ( isOrthographic ) {
cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
} else {
cameraToFrag = normalize( vWorldPosition - cameraPosition );
}
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
#ifdef ENVMAP_MODE_REFLECTION
vec3 reflectVec = reflect( cameraToFrag, worldNormal );
#else
vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
#endif
#else
vec3 reflectVec = vReflect;
#endif
#ifdef ENVMAP_TYPE_CUBE
vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
#elif defined( ENVMAP_TYPE_CUBE_UV )
vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );
#else
vec4 envColor = vec4( 0.0 );
#endif
#ifdef ENVMAP_BLENDING_MULTIPLY
outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
#elif defined( ENVMAP_BLENDING_MIX )
outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
#elif defined( ENVMAP_BLENDING_ADD )
outgoingLight += envColor.xyz * specularStrength * reflectivity;
#endif
#endif`,C6=`#ifdef USE_ENVMAP
uniform float envMapIntensity;
uniform float flipEnvMap;
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
#endif`,A6=`#ifdef USE_ENVMAP
uniform float reflectivity;
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
#define ENV_WORLDPOS
#endif
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
uniform float refractionRatio;
#else
varying vec3 vReflect;
#endif
#endif`,P6=`#ifdef USE_ENVMAP
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
#define ENV_WORLDPOS
#endif
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
#else
varying vec3 vReflect;
uniform float refractionRatio;
#endif
#endif`,R6=`#ifdef USE_ENVMAP
#ifdef ENV_WORLDPOS
vWorldPosition = worldPosition.xyz;
#else
vec3 cameraToVertex;
if ( isOrthographic ) {
cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
} else {
cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
}
vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
#ifdef ENVMAP_MODE_REFLECTION
vReflect = reflect( cameraToVertex, worldNormal );
#else
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
#endif
#endif
#endif`,L6=`#ifdef USE_FOG
vFogDepth = - mvPosition.z;
#endif`,I6=`#ifdef USE_FOG
varying float vFogDepth;
#endif`,N6=`#ifdef USE_FOG
#ifdef FOG_EXP2
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
#else
float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
#endif
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`,D6=`#ifdef USE_FOG
uniform vec3 fogColor;
varying float vFogDepth;
#ifdef FOG_EXP2
uniform float fogDensity;
#else
uniform float fogNear;
uniform float fogFar;
#endif
#endif`,O6=`#ifdef USE_GRADIENTMAP
uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
float dotNL = dot( normal, lightDirection );
vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
#ifdef USE_GRADIENTMAP
return vec3( texture2D( gradientMap, coord ).r );
#else
vec2 fw = fwidth( coord ) * 0.5;
return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
#endif
}`,k6=`#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vUv2 );
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
reflectedLight.indirectDiffuse += lightMapIrradiance;
#endif`,z6=`#ifdef USE_LIGHTMAP
uniform sampler2D lightMap;
uniform float lightMapIntensity;
#endif`,F6=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,U6=`varying vec3 vViewPosition;
struct LambertMaterial {
vec3 diffuseColor;
float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_Lambert
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert
#define Material_LightProbeLOD( material ) (0)`,B6=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
uniform vec3 lightProbe[ 9 ];
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
float x = normal.x, y = normal.y, z = normal.z;
vec3 result = shCoefficients[ 0 ] * 0.886227;
result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
vec3 irradiance = ambientLightColor;
return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
#if defined ( PHYSICALLY_CORRECT_LIGHTS )
float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
if ( cutoffDistance > 0.0 ) {
distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
}
return distanceFalloff;
#else
if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
}
return 1.0;
#endif
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
struct DirectionalLight {
vec3 direction;
vec3 color;
};
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {
light.color = directionalLight.color;
light.direction = directionalLight.direction;
light.visible = true;
}
#endif
#if NUM_POINT_LIGHTS > 0
struct PointLight {
vec3 position;
vec3 color;
float distance;
float decay;
};
uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {
vec3 lVector = pointLight.position - geometry.position;
light.direction = normalize( lVector );
float lightDistance = length( lVector );
light.color = pointLight.color;
light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
light.visible = ( light.color != vec3( 0.0 ) );
}
#endif
#if NUM_SPOT_LIGHTS > 0
struct SpotLight {
vec3 position;
vec3 direction;
vec3 color;
float distance;
float decay;
float coneCos;
float penumbraCos;
};
uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {
vec3 lVector = spotLight.position - geometry.position;
light.direction = normalize( lVector );
float angleCos = dot( light.direction, spotLight.direction );
float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
if ( spotAttenuation > 0.0 ) {
float lightDistance = length( lVector );
light.color = spotLight.color * spotAttenuation;
light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
light.visible = ( light.color != vec3( 0.0 ) );
} else {
light.color = vec3( 0.0 );
light.visible = false;
}
}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
struct RectAreaLight {
vec3 color;
vec3 position;
vec3 halfWidth;
vec3 halfHeight;
};
uniform sampler2D ltc_1; uniform sampler2D ltc_2;
uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
struct HemisphereLight {
vec3 direction;
vec3 skyColor;
vec3 groundColor;
};
uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
float dotNL = dot( normal, hemiLight.direction );
float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
return irradiance;
}
#endif`,V6=`#if defined( USE_ENVMAP )
vec3 getIBLIrradiance( const in vec3 normal ) {
#if defined( ENVMAP_TYPE_CUBE_UV )
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
return PI * envMapColor.rgb * envMapIntensity;
#else
return vec3( 0.0 );
#endif
}
vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
#if defined( ENVMAP_TYPE_CUBE_UV )
vec3 reflectVec = reflect( - viewDir, normal );
reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
return envMapColor.rgb * envMapIntensity;
#else
return vec3( 0.0 );
#endif
}
#endif`,G6=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,H6=`varying vec3 vViewPosition;
struct ToonMaterial {
vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_Toon
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon
#define Material_LightProbeLOD( material ) (0)`,W6=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,$6=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
vec3 diffuseColor;
vec3 specularColor;
float specularShininess;
float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_BlinnPhong
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong
#define Material_LightProbeLOD( material ) (0)`,j6=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
material.ior = ior;
#ifdef SPECULAR
float specularIntensityFactor = specularIntensity;
vec3 specularColorFactor = specularColor;
#ifdef USE_SPECULARINTENSITYMAP
specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;
#endif
#ifdef USE_SPECULARCOLORMAP
specularColorFactor *= texture2D( specularColorMap, vUv ).rgb;
#endif
material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
#else
float specularIntensityFactor = 1.0;
vec3 specularColorFactor = vec3( 1.0 );
material.specularF90 = 1.0;
#endif
material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
material.clearcoat = clearcoat;
material.clearcoatRoughness = clearcoatRoughness;
material.clearcoatF0 = vec3( 0.04 );
material.clearcoatF90 = 1.0;
#ifdef USE_CLEARCOATMAP
material.clearcoat *= texture2D( clearcoatMap, vUv ).x;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;
#endif
material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
material.clearcoatRoughness += geometryRoughness;
material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_IRIDESCENCE
material.iridescence = iridescence;
material.iridescenceIOR = iridescenceIOR;
#ifdef USE_IRIDESCENCEMAP
material.iridescence *= texture2D( iridescenceMap, vUv ).r;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;
#else
material.iridescenceThickness = iridescenceThicknessMaximum;
#endif
#endif
#ifdef USE_SHEEN
material.sheenColor = sheenColor;
#ifdef USE_SHEENCOLORMAP
material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;
#endif
material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
#ifdef USE_SHEENROUGHNESSMAP
material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;
#endif
#endif`,X6=`struct PhysicalMaterial {
vec3 diffuseColor;
float roughness;
vec3 specularColor;
float specularF90;
#ifdef USE_CLEARCOAT
float clearcoat;
float clearcoatRoughness;
vec3 clearcoatF0;
float clearcoatF90;
#endif
#ifdef USE_IRIDESCENCE
float iridescence;
float iridescenceIOR;
float iridescenceThickness;
vec3 iridescenceFresnel;
vec3 iridescenceF0;
#endif
#ifdef USE_SHEEN
vec3 sheenColor;
float sheenRoughness;
#endif
#ifdef IOR
float ior;
#endif
#ifdef USE_TRANSMISSION
float transmission;
float transmissionAlpha;
float thickness;
float attenuationDistance;
vec3 attenuationColor;
#endif
};
vec3 clearcoatSpecular = vec3( 0.0 );
vec3 sheenSpecular = vec3( 0.0 );
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
float dotNV = saturate( dot( normal, viewDir ) );
float r2 = roughness * roughness;
float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
float dotNV = saturate( dot( normal, viewDir ) );
const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
vec4 r = roughness * c0 + c1;
float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
vec2 fab = DFGApprox( normal, viewDir, roughness );
return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
vec2 fab = DFGApprox( normal, viewDir, roughness );
#ifdef USE_IRIDESCENCE
vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
#else
vec3 Fr = specularColor;
#endif
vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
float Ess = fab.x + fab.y;
float Ems = 1.0 - Ess;
vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
singleScatter += FssEss;
multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
vec3 normal = geometry.normal;
vec3 viewDir = geometry.viewDir;
vec3 position = geometry.position;
vec3 lightPos = rectAreaLight.position;
vec3 halfWidth = rectAreaLight.halfWidth;
vec3 halfHeight = rectAreaLight.halfHeight;
vec3 lightColor = rectAreaLight.color;
float roughness = material.roughness;
vec3 rectCoords[ 4 ];
rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
vec2 uv = LTC_Uv( normal, viewDir, roughness );
vec4 t1 = texture2D( ltc_1, uv );
vec4 t2 = texture2D( ltc_2, uv );
mat3 mInv = mat3(
vec3( t1.x, 0, t1.y ),
vec3( 0, 1, 0 ),
vec3( t1.z, 0, t1.w )
);
vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
#ifdef USE_CLEARCOAT
float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
vec3 ccIrradiance = dotNLcc * directLight.color;
clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
#endif
#ifdef USE_SHEEN
sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );
#endif
#ifdef USE_IRIDESCENCE
reflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );
#else
reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );
#endif
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
#ifdef USE_CLEARCOAT
clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
#endif
#ifdef USE_SHEEN
sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );
#endif
vec3 singleScattering = vec3( 0.0 );
vec3 multiScattering = vec3( 0.0 );
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
#ifdef USE_IRIDESCENCE
computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
#else
computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
#endif
vec3 totalScattering = singleScattering + multiScattering;
vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
reflectedLight.indirectSpecular += radiance * singleScattering;
reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct RE_Direct_Physical
#define RE_Direct_RectArea RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,Y6=`
GeometricContext geometry;
geometry.position = - vViewPosition;
geometry.normal = normal;
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
#ifdef USE_CLEARCOAT
geometry.clearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
float dotNVi = saturate( dot( normal, geometry.viewDir ) );
if ( material.iridescenceThickness == 0.0 ) {
material.iridescence = 0.0;
} else {
material.iridescence = saturate( material.iridescence );
}
if ( material.iridescence > 0.0 ) {
material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
PointLight pointLight;
#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
PointLightShadow pointLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
pointLight = pointLights[ i ];
getPointLightInfo( pointLight, geometry, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
pointLightShadow = pointLightShadows[ i ];
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
#endif
RE_Direct( directLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
SpotLight spotLight;
vec4 spotColor;
vec3 spotLightCoord;
bool inSpotLightMap;
#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
SpotLightShadow spotLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
spotLight = spotLights[ i ];
getSpotLightInfo( spotLight, geometry, directLight );
#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
#else
#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
#endif
#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
#endif
#undef SPOT_LIGHT_MAP_INDEX
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
spotLightShadow = spotLightShadows[ i ];
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
DirectionalLight directionalLight;
#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
DirectionalLightShadow directionalLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
directionalLight = directionalLights[ i ];
getDirectionalLightInfo( directionalLight, geometry, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
directionalLightShadow = directionalLightShadows[ i ];
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
RectAreaLight rectAreaLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
rectAreaLight = rectAreaLights[ i ];
RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
vec3 iblIrradiance = vec3( 0.0 );
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );
#if ( NUM_HEMI_LIGHTS > 0 )
#pragma unroll_loop_start
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
}
#pragma unroll_loop_end
#endif
#endif
#if defined( RE_IndirectSpecular )
vec3 radiance = vec3( 0.0 );
vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,q6=`#if defined( RE_IndirectDiffuse )
#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vUv2 );
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
irradiance += lightMapIrradiance;
#endif
#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
iblIrradiance += getIBLIrradiance( geometry.normal );
#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );
#ifdef USE_CLEARCOAT
clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );
#endif
#endif`,Z6=`#if defined( RE_IndirectDiffuse )
RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
#endif`,Q6=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,K6=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
uniform float logDepthBufFC;
varying float vFragDepth;
varying float vIsPerspective;
#endif`,J6=`#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
varying float vFragDepth;
varying float vIsPerspective;
#else
uniform float logDepthBufFC;
#endif
#endif`,e8=`#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
vFragDepth = 1.0 + gl_Position.w;
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#else
if ( isPerspectiveMatrix( projectionMatrix ) ) {
gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
gl_Position.z *= gl_Position.w;
}
#endif
#endif`,t8=`#ifdef USE_MAP
vec4 sampledDiffuseColor = texture2D( map, vUv );
#ifdef DECODE_VIDEO_TEXTURE
sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
#endif
diffuseColor *= sampledDiffuseColor;
#endif`,n8=`#ifdef USE_MAP
uniform sampler2D map;
#endif`,r8=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
#endif
#ifdef USE_MAP
diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,i8=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
uniform mat3 uvTransform;
#endif
#ifdef USE_MAP
uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,s8=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vUv );
metalnessFactor *= texelMetalness.b;
#endif`,o8=`#ifdef USE_METALNESSMAP
uniform sampler2D metalnessMap;
#endif`,a8=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
vColor *= morphTargetBaseInfluence;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
#if defined( USE_COLOR_ALPHA )
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
#elif defined( USE_COLOR )
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
#endif
}
#endif`,l8=`#ifdef USE_MORPHNORMALS
objectNormal *= morphTargetBaseInfluence;
#ifdef MORPHTARGETS_TEXTURE
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
}
#else
objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
#endif
#endif`,u8=`#ifdef USE_MORPHTARGETS
uniform float morphTargetBaseInfluence;
#ifdef MORPHTARGETS_TEXTURE
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
uniform sampler2DArray morphTargetsTexture;
uniform ivec2 morphTargetsTextureSize;
vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
int y = texelIndex / morphTargetsTextureSize.x;
int x = texelIndex - y * morphTargetsTextureSize.x;
ivec3 morphUV = ivec3( x, y, morphTargetIndex );
return texelFetch( morphTargetsTexture, morphUV, 0 );
}
#else
#ifndef USE_MORPHNORMALS
uniform float morphTargetInfluences[ 8 ];
#else
uniform float morphTargetInfluences[ 4 ];
#endif
#endif
#endif`,c8=`#ifdef USE_MORPHTARGETS
transformed *= morphTargetBaseInfluence;
#ifdef MORPHTARGETS_TEXTURE
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
}
#else
transformed += morphTarget0 * morphTargetInfluences[ 0 ];
transformed += morphTarget1 * morphTargetInfluences[ 1 ];
transformed += morphTarget2 * morphTargetInfluences[ 2 ];
transformed += morphTarget3 * morphTargetInfluences[ 3 ];
#ifndef USE_MORPHNORMALS
transformed += morphTarget4 * morphTargetInfluences[ 4 ];
transformed += morphTarget5 * morphTargetInfluences[ 5 ];
transformed += morphTarget6 * morphTargetInfluences[ 6 ];
transformed += morphTarget7 * morphTargetInfluences[ 7 ];
#endif
#endif
#endif`,f8=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
vec3 fdx = dFdx( vViewPosition );
vec3 fdy = dFdy( vViewPosition );
vec3 normal = normalize( cross( fdx, fdy ) );
#else
vec3 normal = normalize( vNormal );
#ifdef DOUBLE_SIDED
normal = normal * faceDirection;
#endif
#ifdef USE_TANGENT
vec3 tangent = normalize( vTangent );
vec3 bitangent = normalize( vBitangent );
#ifdef DOUBLE_SIDED
tangent = tangent * faceDirection;
bitangent = bitangent * faceDirection;
#endif
#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )
mat3 vTBN = mat3( tangent, bitangent, normal );
#endif
#endif
#endif
vec3 geometryNormal = normal;`,d8=`#ifdef OBJECTSPACE_NORMALMAP
normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
#ifdef FLIP_SIDED
normal = - normal;
#endif
#ifdef DOUBLE_SIDED
normal = normal * faceDirection;
#endif
normal = normalize( normalMatrix * normal );
#elif defined( TANGENTSPACE_NORMALMAP )
vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
mapN.xy *= normalScale;
#ifdef USE_TANGENT
normal = normalize( vTBN * mapN );
#else
normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );
#endif
#elif defined( USE_BUMPMAP )
normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,h8=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,p8=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,m8=`#ifndef FLAT_SHADED
vNormal = normalize( transformedNormal );
#ifdef USE_TANGENT
vTangent = normalize( transformedTangent );
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
#endif
#endif`,g8=`#ifdef USE_NORMALMAP
uniform sampler2D normalMap;
uniform vec2 normalScale;
#endif
#ifdef OBJECTSPACE_NORMALMAP
uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )
vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {
vec3 q0 = dFdx( eye_pos.xyz );
vec3 q1 = dFdy( eye_pos.xyz );
vec2 st0 = dFdx( vUv.st );
vec2 st1 = dFdy( vUv.st );
vec3 N = surf_norm;
vec3 q1perp = cross( q1, N );
vec3 q0perp = cross( N, q0 );
vec3 T = q1perp * st0.x + q0perp * st1.x;
vec3 B = q1perp * st0.y + q0perp * st1.y;
float det = max( dot( T, T ), dot( B, B ) );
float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );
return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );
}
#endif`,v8=`#ifdef USE_CLEARCOAT
vec3 clearcoatNormal = geometryNormal;
#endif`,y8=`#ifdef USE_CLEARCOAT_NORMALMAP
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;
clearcoatMapN.xy *= clearcoatNormalScale;
#ifdef USE_TANGENT
clearcoatNormal = normalize( vTBN * clearcoatMapN );
#else
clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );
#endif
#endif`,_8=`#ifdef USE_CLEARCOATMAP
uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
uniform sampler2D clearcoatRoughnessMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
uniform sampler2D clearcoatNormalMap;
uniform vec2 clearcoatNormalScale;
#endif`,x8=`#ifdef USE_IRIDESCENCEMAP
uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
uniform sampler2D iridescenceThicknessMap;
#endif`,S8=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha + 0.1;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,w8=`vec3 packNormalToRGB( const in vec3 normal ) {
return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
const float ShiftRight8 = 1. / 256.;
vec4 packDepthToRGBA( const in float v ) {
vec4 r = vec4( fract( v * PackFactors ), v );
r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;
}
float unpackRGBAToDepth( const in vec4 v ) {
return dot( v, UnpackFactors );
}
vec4 pack2HalfToRGBA( vec2 v ) {
vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( vec4 v ) {
return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
return linearClipZ * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
return ( near * far ) / ( ( far - near ) * invClipZ - far );
}`,M8=`#ifdef PREMULTIPLIED_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif`,b8=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,E8=`#ifdef DITHERING
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,T8=`#ifdef DITHERING
vec3 dithering( vec3 color ) {
float grid_position = rand( gl_FragCoord.xy );
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
return color + dither_shift_RGB;
}
#endif`,C8=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vUv );
roughnessFactor *= texelRoughness.g;
#endif`,A8=`#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
#endif`,P8=`#if NUM_SPOT_LIGHT_COORDS > 0
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
struct DirectionalLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
struct SpotLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
struct PointLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
}
vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
return unpackRGBATo2Half( texture2D( shadow, uv ) );
}
float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
float occlusion = 1.0;
vec2 distribution = texture2DDistribution( shadow, uv );
float hard_shadow = step( compare , distribution.x );
if (hard_shadow != 1.0 ) {
float distance = compare - distribution.x ;
float variance = max( 0.00000, distribution.y * distribution.y );
float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
}
return occlusion;
}
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
float shadow = 1.0;
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z += shadowBias;
bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
bool inFrustum = all( inFrustumVec );
bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
bool frustumTest = all( frustumTestVec );
if ( frustumTest ) {
#if defined( SHADOWMAP_TYPE_PCF )
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
float dx0 = - texelSize.x * shadowRadius;
float dy0 = - texelSize.y * shadowRadius;
float dx1 = + texelSize.x * shadowRadius;
float dy1 = + texelSize.y * shadowRadius;
float dx2 = dx0 / 2.0;
float dy2 = dy0 / 2.0;
float dx3 = dx1 / 2.0;
float dy3 = dy1 / 2.0;
shadow = (
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
) * ( 1.0 / 17.0 );
#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
float dx = texelSize.x;
float dy = texelSize.y;
vec2 uv = shadowCoord.xy;
vec2 f = fract( uv * shadowMapSize + 0.5 );
uv -= f * texelSize;
shadow = (
texture2DCompare( shadowMap, uv, shadowCoord.z ) +
texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
f.x ) +
mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
f.x ) +
mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
f.y ) +
mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
f.y ) +
mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
f.x ),
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
f.x ),
f.y )
) * ( 1.0 / 9.0 );
#elif defined( SHADOWMAP_TYPE_VSM )
shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
#else
shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
#endif
}
return shadow;
}
vec2 cubeToUV( vec3 v, float texelSizeY ) {
vec3 absV = abs( v );
float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
absV *= scaleToCube;
v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
vec2 planar = v.xy;
float almostATexel = 1.5 * texelSizeY;
float almostOne = 1.0 - almostATexel;
if ( absV.z >= almostOne ) {
if ( v.z > 0.0 )
planar.x = 4.0 - v.x;
} else if ( absV.x >= almostOne ) {
float signX = sign( v.x );
planar.x = v.z * signX + 2.0 * signX;
} else if ( absV.y >= almostOne ) {
float signY = sign( v.y );
planar.x = v.x + 2.0 * signY + 2.0;
planar.y = v.z * signY - 2.0;
}
return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
}
float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
vec3 lightToPosition = shadowCoord.xyz;
float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
vec3 bd3D = normalize( lightToPosition );
#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
return (
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
) * ( 1.0 / 9.0 );
#else
return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
#endif
}
#endif`,R8=`#if NUM_SPOT_LIGHT_COORDS > 0
uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
struct DirectionalLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
struct SpotLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
struct PointLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
#endif`,L8=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0
vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
vec4 shadowWorldPosition;
#endif
#if NUM_DIR_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#if NUM_SPOT_LIGHT_COORDS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
shadowWorldPosition = worldPosition;
#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
#endif
vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#endif`,I8=`float getShadowMask() {
float shadow = 1.0;
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
DirectionalLightShadow directionalLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
directionalLight = directionalLightShadows[ i ];
shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
}
#pragma unroll_loop_end
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
SpotLightShadow spotLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
spotLight = spotLightShadows[ i ];
shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
}
#pragma unroll_loop_end
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
PointLightShadow pointLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
pointLight = pointLightShadows[ i ];
shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
}
#pragma unroll_loop_end
#endif
#endif
return shadow;
}`,N8=`#ifdef USE_SKINNING
mat4 boneMatX = getBoneMatrix( skinIndex.x );
mat4 boneMatY = getBoneMatrix( skinIndex.y );
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,D8=`#ifdef USE_SKINNING
uniform mat4 bindMatrix;
uniform mat4 bindMatrixInverse;
uniform highp sampler2D boneTexture;
uniform int boneTextureSize;
mat4 getBoneMatrix( const in float i ) {
float j = i * 4.0;
float x = mod( j, float( boneTextureSize ) );
float y = floor( j / float( boneTextureSize ) );
float dx = 1.0 / float( boneTextureSize );
float dy = 1.0 / float( boneTextureSize );
y = dy * ( y + 0.5 );
vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
mat4 bone = mat4( v1, v2, v3, v4 );
return bone;
}
#endif`,O8=`#ifdef USE_SKINNING
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
vec4 skinned = vec4( 0.0 );
skinned += boneMatX * skinVertex * skinWeight.x;
skinned += boneMatY * skinVertex * skinWeight.y;
skinned += boneMatZ * skinVertex * skinWeight.z;
skinned += boneMatW * skinVertex * skinWeight.w;
transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,k8=`#ifdef USE_SKINNING
mat4 skinMatrix = mat4( 0.0 );
skinMatrix += skinWeight.x * boneMatX;
skinMatrix += skinWeight.y * boneMatY;
skinMatrix += skinWeight.z * boneMatZ;
skinMatrix += skinWeight.w * boneMatW;
skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
#ifdef USE_TANGENT
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
#endif
#endif`,z8=`float specularStrength;
#ifdef USE_SPECULARMAP
vec4 texelSpecular = texture2D( specularMap, vUv );
specularStrength = texelSpecular.r;
#else
specularStrength = 1.0;
#endif`,F8=`#ifdef USE_SPECULARMAP
uniform sampler2D specularMap;
#endif`,U8=`#if defined( TONE_MAPPING )
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,B8=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
return toneMappingExposure * color;
}
vec3 ReinhardToneMapping( vec3 color ) {
color *= toneMappingExposure;
return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 OptimizedCineonToneMapping( vec3 color ) {
color *= toneMappingExposure;
color = max( vec3( 0.0 ), color - 0.004 );
return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
const mat3 ACESInputMat = mat3(
vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),
vec3( 0.04823, 0.01566, 0.83777 )
);
const mat3 ACESOutputMat = mat3(
vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),
vec3( -0.07367, -0.00605, 1.07602 )
);
color *= toneMappingExposure / 0.6;
color = ACESInputMat * color;
color = RRTAndODTFit( color );
color = ACESOutputMat * color;
return saturate( color );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,V8=`#ifdef USE_TRANSMISSION
material.transmission = transmission;
material.transmissionAlpha = 1.0;
material.thickness = thickness;
material.attenuationDistance = attenuationDistance;
material.attenuationColor = attenuationColor;
#ifdef USE_TRANSMISSIONMAP
material.transmission *= texture2D( transmissionMap, vUv ).r;
#endif
#ifdef USE_THICKNESSMAP
material.thickness *= texture2D( thicknessMap, vUv ).g;
#endif
vec3 pos = vWorldPosition;
vec3 v = normalize( cameraPosition - pos );
vec3 n = inverseTransformDirection( normal, viewMatrix );
vec4 transmission = getIBLVolumeRefraction(
n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,
material.attenuationColor, material.attenuationDistance );
material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );
totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );
#endif`,G8=`#ifdef USE_TRANSMISSION
uniform float transmission;
uniform float thickness;
uniform float attenuationDistance;
uniform vec3 attenuationColor;
#ifdef USE_TRANSMISSIONMAP
uniform sampler2D transmissionMap;
#endif
#ifdef USE_THICKNESSMAP
uniform sampler2D thicknessMap;
#endif
uniform vec2 transmissionSamplerSize;
uniform sampler2D transmissionSamplerMap;
uniform mat4 modelMatrix;
uniform mat4 projectionMatrix;
varying vec3 vWorldPosition;
vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
vec3 modelScale;
modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
return normalize( refractionVector ) * thickness * modelScale;
}
float applyIorToRoughness( const in float roughness, const in float ior ) {
return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
}
vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
#ifdef texture2DLodEXT
return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );
#else
return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );
#endif
}
vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
if ( isinf( attenuationDistance ) ) {
return radiance;
} else {
vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance;
}
}
vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,
const in vec3 attenuationColor, const in float attenuationDistance ) {
vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
vec3 refractedRayExit = position + transmissionRay;
vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
vec2 refractionCoords = ndcPos.xy / ndcPos.w;
refractionCoords += 1.0;
refractionCoords /= 2.0;
vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );
vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );
}
#endif`,H8=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
varying vec2 vUv;
#endif`,W8=`#ifdef USE_UV
#ifdef UVS_VERTEX_ONLY
vec2 vUv;
#else
varying vec2 vUv;
#endif
uniform mat3 uvTransform;
#endif`,$8=`#ifdef USE_UV
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
#endif`,j8=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
varying vec2 vUv2;
#endif`,X8=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
attribute vec2 uv2;
varying vec2 vUv2;
uniform mat3 uv2Transform;
#endif`,Y8=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
#endif`,q8=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
vec4 worldPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
worldPosition = instanceMatrix * worldPosition;
#endif
worldPosition = modelMatrix * worldPosition;
#endif`;const Z8=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,Q8=`uniform sampler2D t2D;
varying vec2 vUv;
void main() {
gl_FragColor = texture2D( t2D, vUv );
#ifdef DECODE_VIDEO_TEXTURE
gl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );
#endif
#include <tonemapping_fragment>
#include <encodings_fragment>
}`,K8=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,J8=`#include <envmap_common_pars_fragment>
uniform float opacity;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
vec3 vReflect = vWorldDirection;
#include <envmap_fragment>
gl_FragColor = envColor;
gl_FragColor.a *= opacity;
#include <tonemapping_fragment>
#include <encodings_fragment>
}`,eG=`#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
#include <uv_vertex>
#include <skinbase_vertex>
#ifdef USE_DISPLACEMENTMAP
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vHighPrecisionZW = gl_Position.zw;
}`,tG=`#if DEPTH_PACKING == 3200
uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( 1.0 );
#if DEPTH_PACKING == 3200
diffuseColor.a = opacity;
#endif
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <logdepthbuf_fragment>
float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
#if DEPTH_PACKING == 3200
gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
#elif DEPTH_PACKING == 3201
gl_FragColor = packDepthToRGBA( fragCoordZ );
#endif
}`,nG=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <skinbase_vertex>
#ifdef USE_DISPLACEMENTMAP
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <worldpos_vertex>
#include <clipping_planes_vertex>
vWorldPosition = worldPosition.xyz;
}`,rG=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( 1.0 );
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
float dist = length( vWorldPosition - referencePosition );
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
dist = saturate( dist );
gl_FragColor = packDepthToRGBA( dist );
}`,iG=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}`,sG=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
#include <tonemapping_fragment>
#include <encodings_fragment>
}`,oG=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
vLineDistance = scale * lineDistance;
#include <color_vertex>
#include <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,aG=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
if ( mod( vLineDistance, totalSize ) > dashSize ) {
discard;
}
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <color_fragment>
outgoingLight = diffuseColor.rgb;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,lG=`#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <worldpos_vertex>
#include <envmap_vertex>
#include <fog_vertex>
}`,uG=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <specularmap_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vUv2 );
reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
#else
reflectedLight.indirectDiffuse += vec3( 1.0 );
#endif
#include <aomap_fragment>
reflectedLight.indirectDiffuse *= diffuseColor.rgb;
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include <envmap_fragment>
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,cG=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <envmap_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,fG=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_lambert_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
#include <envmap_fragment>
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,dG=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
vViewPosition = - mvPosition.xyz;
}`,hG=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
vec3 viewDir = normalize( vViewPosition );
vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
vec3 y = cross( viewDir, x );
vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
#ifdef USE_MATCAP
vec4 matcapColor = texture2D( matcap, uv );
#else
vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
#endif
vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,pG=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
varying vec3 vViewPosition;
#endif
#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
vViewPosition = - mvPosition.xyz;
#endif
}`,mG=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
#ifdef OPAQUE
gl_FragColor.a = 1.0;
#endif
}`,gG=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <envmap_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,vG=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_phong_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
#include <envmap_fragment>
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,yG=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
varying vec3 vWorldPosition;
#endif
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
#ifdef USE_TRANSMISSION
vWorldPosition = worldPosition.xyz;
#endif
}`,_G=`#define STANDARD
#ifdef PHYSICAL
#define IOR
#define SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
uniform float ior;
#endif
#ifdef SPECULAR
uniform float specularIntensity;
uniform vec3 specularColor;
#ifdef USE_SPECULARINTENSITYMAP
uniform sampler2D specularIntensityMap;
#endif
#ifdef USE_SPECULARCOLORMAP
uniform sampler2D specularColorMap;
#endif
#endif
#ifdef USE_CLEARCOAT
uniform float clearcoat;
uniform float clearcoatRoughness;
#endif
#ifdef USE_IRIDESCENCE
uniform float iridescence;
uniform float iridescenceIOR;
uniform float iridescenceThicknessMinimum;
uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
uniform vec3 sheenColor;
uniform float sheenRoughness;
#ifdef USE_SHEENCOLORMAP
uniform sampler2D sheenColorMap;
#endif
#ifdef USE_SHEENROUGHNESSMAP
uniform sampler2D sheenRoughnessMap;
#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <bsdfs>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <roughnessmap_fragment>
#include <metalnessmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <clearcoat_normal_fragment_begin>
#include <clearcoat_normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_physical_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
#include <transmission_fragment>
vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
#ifdef USE_SHEEN
float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;
#endif
#ifdef USE_CLEARCOAT
float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );
vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;
#endif
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,xG=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,SG=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_toon_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,wG=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <color_vertex>
#include <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
gl_PointSize = size;
#ifdef USE_SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
#endif
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <worldpos_vertex>
#include <fog_vertex>
}`,MG=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <map_particle_fragment>
#include <color_fragment>
#include <alphatest_fragment>
outgoingLight = diffuseColor.rgb;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,bG=`#include <common>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <project_vertex>
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,EG=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
}`,TG=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
vec2 scale;
scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
#ifndef USE_SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
if ( isPerspective ) scale *= - mvPosition.z;
#endif
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
vec2 rotatedPosition;
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
mvPosition.xy += rotatedPosition;
gl_Position = projectionMatrix * mvPosition;
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,CG=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
outgoingLight = diffuseColor.rgb;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
}`,wt={alphamap_fragment:KV,alphamap_pars_fragment:JV,alphatest_fragment:e6,alphatest_pars_fragment:t6,aomap_fragment:n6,aomap_pars_fragment:r6,begin_vertex:i6,beginnormal_vertex:s6,bsdfs:o6,iridescence_fragment:a6,bumpmap_pars_fragment:l6,clipping_planes_fragment:u6,clipping_planes_pars_fragment:c6,clipping_planes_pars_vertex:f6,clipping_planes_vertex:d6,color_fragment:h6,color_pars_fragment:p6,color_pars_vertex:m6,color_vertex:g6,common:v6,cube_uv_reflection_fragment:y6,defaultnormal_vertex:_6,displacementmap_pars_vertex:x6,displacementmap_vertex:S6,emissivemap_fragment:w6,emissivemap_pars_fragment:M6,encodings_fragment:b6,encodings_pars_fragment:E6,envmap_fragment:T6,envmap_common_pars_fragment:C6,envmap_pars_fragment:A6,envmap_pars_vertex:P6,envmap_physical_pars_fragment:V6,envmap_vertex:R6,fog_vertex:L6,fog_pars_vertex:I6,fog_fragment:N6,fog_pars_fragment:D6,gradientmap_pars_fragment:O6,lightmap_fragment:k6,lightmap_pars_fragment:z6,lights_lambert_fragment:F6,lights_lambert_pars_fragment:U6,lights_pars_begin:B6,lights_toon_fragment:G6,lights_toon_pars_fragment:H6,lights_phong_fragment:W6,lights_phong_pars_fragment:$6,lights_physical_fragment:j6,lights_physical_pars_fragment:X6,lights_fragment_begin:Y6,lights_fragment_maps:q6,lights_fragment_end:Z6,logdepthbuf_fragment:Q6,logdepthbuf_pars_fragment:K6,logdepthbuf_pars_vertex:J6,logdepthbuf_vertex:e8,map_fragment:t8,map_pars_fragment:n8,map_particle_fragment:r8,map_particle_pars_fragment:i8,metalnessmap_fragment:s8,metalnessmap_pars_fragment:o8,morphcolor_vertex:a8,morphnormal_vertex:l8,morphtarget_pars_vertex:u8,morphtarget_vertex:c8,normal_fragment_begin:f8,normal_fragment_maps:d8,normal_pars_fragment:h8,normal_pars_vertex:p8,normal_vertex:m8,normalmap_pars_fragment:g8,clearcoat_normal_fragment_begin:v8,clearcoat_normal_fragment_maps:y8,clearcoat_pars_fragment:_8,iridescence_pars_fragment:x8,output_fragment:S8,packing:w8,premultiplied_alpha_fragment:M8,project_vertex:b8,dithering_fragment:E8,dithering_pars_fragment:T8,roughnessmap_fragment:C8,roughnessmap_pars_fragment:A8,shadowmap_pars_fragment:P8,shadowmap_pars_vertex:R8,shadowmap_vertex:L8,shadowmask_pars_fragment:I8,skinbase_vertex:N8,skinning_pars_vertex:D8,skinning_vertex:O8,skinnormal_vertex:k8,specularmap_fragment:z8,specularmap_pars_fragment:F8,tonemapping_fragment:U8,tonemapping_pars_fragment:B8,transmission_fragment:V8,transmission_pars_fragment:G8,uv_pars_fragment:H8,uv_pars_vertex:W8,uv_vertex:$8,uv2_pars_fragment:j8,uv2_pars_vertex:X8,uv2_vertex:Y8,worldpos_vertex:q8,background_vert:Z8,background_frag:Q8,cube_vert:K8,cube_frag:J8,depth_vert:eG,depth_frag:tG,distanceRGBA_vert:nG,distanceRGBA_frag:rG,equirect_vert:iG,equirect_frag:sG,linedashed_vert:oG,linedashed_frag:aG,meshbasic_vert:lG,meshbasic_frag:uG,meshlambert_vert:cG,meshlambert_frag:fG,meshmatcap_vert:dG,meshmatcap_frag:hG,meshnormal_vert:pG,meshnormal_frag:mG,meshphong_vert:gG,meshphong_frag:vG,meshphysical_vert:yG,meshphysical_frag:_G,meshtoon_vert:xG,meshtoon_frag:SG,points_vert:wG,points_frag:MG,shadow_vert:bG,shadow_frag:EG,sprite_vert:TG,sprite_frag:CG},De={common:{diffuse:{value:new Ge(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Tr},uv2Transform:{value:new Tr},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Me(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ge(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ge(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Tr}},sprite:{diffuse:{value:new Ge(16777215)},opacity:{value:1},center:{value:new Me(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Tr}}},Oi={basic:{uniforms:sr([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.fog]),vertexShader:wt.meshbasic_vert,fragmentShader:wt.meshbasic_frag},lambert:{uniforms:sr([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Ge(0)}}]),vertexShader:wt.meshlambert_vert,fragmentShader:wt.meshlambert_frag},phong:{uniforms:sr([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Ge(0)},specular:{value:new Ge(1118481)},shininess:{value:30}}]),vertexShader:wt.meshphong_vert,fragmentShader:wt.meshphong_frag},standard:{uniforms:sr([De.common,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.roughnessmap,De.metalnessmap,De.fog,De.lights,{emissive:{value:new Ge(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:wt.meshphysical_vert,fragmentShader:wt.meshphysical_frag},toon:{uniforms:sr([De.common,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.gradientmap,De.fog,De.lights,{emissive:{value:new Ge(0)}}]),vertexShader:wt.meshtoon_vert,fragmentShader:wt.meshtoon_frag},matcap:{uniforms:sr([De.common,De.bumpmap,De.normalmap,De.displacementmap,De.fog,{matcap:{value:null}}]),vertexShader:wt.meshmatcap_vert,fragmentShader:wt.meshmatcap_frag},points:{uniforms:sr([De.points,De.fog]),vertexShader:wt.points_vert,fragmentShader:wt.points_frag},dashed:{uniforms:sr([De.common,De.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:wt.linedashed_vert,fragmentShader:wt.linedashed_frag},depth:{uniforms:sr([De.common,De.displacementmap]),vertexShader:wt.depth_vert,fragmentShader:wt.depth_frag},normal:{uniforms:sr([De.common,De.bumpmap,De.normalmap,De.displacementmap,{opacity:{value:1}}]),vertexShader:wt.meshnormal_vert,fragmentShader:wt.meshnormal_frag},sprite:{uniforms:sr([De.sprite,De.fog]),vertexShader:wt.sprite_vert,fragmentShader:wt.sprite_frag},background:{uniforms:{uvTransform:{value:new Tr},t2D:{value:null}},vertexShader:wt.background_vert,fragmentShader:wt.background_frag},cube:{uniforms:sr([De.envmap,{opacity:{value:1}}]),vertexShader:wt.cube_vert,fragmentShader:wt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:wt.equirect_vert,fragmentShader:wt.equirect_frag},distanceRGBA:{uniforms:sr([De.common,De.displacementmap,{referencePosition:{value:new I},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:wt.distanceRGBA_vert,fragmentShader:wt.distanceRGBA_frag},shadow:{uniforms:sr([De.lights,De.fog,{color:{value:new Ge(0)},opacity:{value:1}}]),vertexShader:wt.shadow_vert,fragmentShader:wt.shadow_frag}};Oi.physical={uniforms:sr([Oi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Me(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Ge(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Me},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ge(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Ge(1,1,1)},specularColorMap:{value:null}}]),vertexShader:wt.meshphysical_vert,fragmentShader:wt.meshphysical_frag};function AG(n,e,t,r,i,s){const o=new Ge(0);let a=i===!0?0:1,c,f,d=null,h=0,p=null;function g(y,x){let w=!1,_=x.isScene===!0?x.background:null;_&&_.isTexture&&(_=e.get(_));const M=n.xr,E=M.getSession&&M.getSession();E&&E.environmentBlendMode==="additive"&&(_=null),_===null?v(o,a):_&&_.isColor&&(v(_,1),w=!0),(n.autoClear||w)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),_&&(_.isCubeTexture||_.mapping===Hu)?(f===void 0&&(f=new We(new hr(1,1,1),new fs({name:"BackgroundCubeMaterial",uniforms:Lu(Oi.cube.uniforms),vertexShader:Oi.cube.vertexShader,fragmentShader:Oi.cube.fragmentShader,side:jr,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(C,P,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(f)),f.material.uniforms.envMap.value=_,f.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,(d!==_||h!==_.version||p!==n.toneMapping)&&(f.material.needsUpdate=!0,d=_,h=_.version,p=n.toneMapping),f.layers.enableAll(),y.unshift(f,f.geometry,f.material,0,0,null)):_&&_.isTexture&&(c===void 0&&(c=new We(new Gr(2,2),new fs({name:"BackgroundMaterial",uniforms:Lu(Oi.background.uniforms),vertexShader:Oi.background.vertexShader,fragmentShader:Oi.background.fragmentShader,side:qa,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=_,_.matrixAutoUpdate===!0&&_.updateMatrix(),c.material.uniforms.uvTransform.value.copy(_.matrix),(d!==_||h!==_.version||p!==n.toneMapping)&&(c.material.needsUpdate=!0,d=_,h=_.version,p=n.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function v(y,x){t.buffers.color.setClear(y.r,y.g,y.b,x,s)}return{getClearColor:function(){return o},setClearColor:function(y,x=1){o.set(y),a=x,v(o,a)},getClearAlpha:function(){return a},setClearAlpha:function(y){a=y,v(o,a)},render:g}}function PG(n,e,t,r){const i=n.getParameter(34921),s=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||s!==null,a={},c=x(null);let f=c,d=!1;function h($,se,le,pe,z){let F=!1;if(o){const G=y(pe,le,se);f!==G&&(f=G,g(f.object)),F=w($,pe,le,z),F&&_($,pe,le,z)}else{const G=se.wireframe===!0;(f.geometry!==pe.id||f.program!==le.id||f.wireframe!==G)&&(f.geometry=pe.id,f.program=le.id,f.wireframe=G,F=!0)}z!==null&&t.update(z,34963),(F||d)&&(d=!1,T($,se,le,pe),z!==null&&n.bindBuffer(34963,t.get(z).buffer))}function p(){return r.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function g($){return r.isWebGL2?n.bindVertexArray($):s.bindVertexArrayOES($)}function v($){return r.isWebGL2?n.deleteVertexArray($):s.deleteVertexArrayOES($)}function y($,se,le){const pe=le.wireframe===!0;let z=a[$.id];z===void 0&&(z={},a[$.id]=z);let F=z[se.id];F===void 0&&(F={},z[se.id]=F);let G=F[pe];return G===void 0&&(G=x(p()),F[pe]=G),G}function x($){const se=[],le=[],pe=[];for(let z=0;z<i;z++)se[z]=0,le[z]=0,pe[z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:se,enabledAttributes:le,attributeDivisors:pe,object:$,attributes:{},index:null}}function w($,se,le,pe){const z=f.attributes,F=se.attributes;let G=0;const Z=le.getAttributes();for(const k in Z)if(Z[k].location>=0){const N=z[k];let me=F[k];if(me===void 0&&(k==="instanceMatrix"&&$.instanceMatrix&&(me=$.instanceMatrix),k==="instanceColor"&&$.instanceColor&&(me=$.instanceColor)),N===void 0||N.attribute!==me||me&&N.data!==me.data)return!0;G++}return f.attributesNum!==G||f.index!==pe}function _($,se,le,pe){const z={},F=se.attributes;let G=0;const Z=le.getAttributes();for(const k in Z)if(Z[k].location>=0){let N=F[k];N===void 0&&(k==="instanceMatrix"&&$.instanceMatrix&&(N=$.instanceMatrix),k==="instanceColor"&&$.instanceColor&&(N=$.instanceColor));const me={};me.attribute=N,N&&N.data&&(me.data=N.data),z[k]=me,G++}f.attributes=z,f.attributesNum=G,f.index=pe}function M(){const $=f.newAttributes;for(let se=0,le=$.length;se<le;se++)$[se]=0}function E($){C($,0)}function C($,se){const le=f.newAttributes,pe=f.enabledAttributes,z=f.attributeDivisors;le[$]=1,pe[$]===0&&(n.enableVertexAttribArray($),pe[$]=1),z[$]!==se&&((r.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"]($,se),z[$]=se)}function P(){const $=f.newAttributes,se=f.enabledAttributes;for(let le=0,pe=se.length;le<pe;le++)se[le]!==$[le]&&(n.disableVertexAttribArray(le),se[le]=0)}function R($,se,le,pe,z,F){r.isWebGL2===!0&&(le===5124||le===5125)?n.vertexAttribIPointer($,se,le,z,F):n.vertexAttribPointer($,se,le,pe,z,F)}function T($,se,le,pe){if(r.isWebGL2===!1&&($.isInstancedMesh||pe.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;M();const z=pe.attributes,F=le.getAttributes(),G=se.defaultAttributeValues;for(const Z in F){const k=F[Z];if(k.location>=0){let W=z[Z];if(W===void 0&&(Z==="instanceMatrix"&&$.instanceMatrix&&(W=$.instanceMatrix),Z==="instanceColor"&&$.instanceColor&&(W=$.instanceColor)),W!==void 0){const N=W.normalized,me=W.itemSize,X=t.get(W);if(X===void 0)continue;const Te=X.buffer,Ce=X.type,we=X.bytesPerElement;if(W.isInterleavedBufferAttribute){const be=W.data,He=be.stride,ue=W.offset;if(be.isInstancedInterleavedBuffer){for(let ne=0;ne<k.locationSize;ne++)C(k.location+ne,be.meshPerAttribute);$.isInstancedMesh!==!0&&pe._maxInstanceCount===void 0&&(pe._maxInstanceCount=be.meshPerAttribute*be.count)}else for(let ne=0;ne<k.locationSize;ne++)E(k.location+ne);n.bindBuffer(34962,Te);for(let ne=0;ne<k.locationSize;ne++)R(k.location+ne,me/k.locationSize,Ce,N,He*we,(ue+me/k.locationSize*ne)*we)}else{if(W.isInstancedBufferAttribute){for(let be=0;be<k.locationSize;be++)C(k.location+be,W.meshPerAttribute);$.isInstancedMesh!==!0&&pe._maxInstanceCount===void 0&&(pe._maxInstanceCount=W.meshPerAttribute*W.count)}else for(let be=0;be<k.locationSize;be++)E(k.location+be);n.bindBuffer(34962,Te);for(let be=0;be<k.locationSize;be++)R(k.location+be,me/k.locationSize,Ce,N,me*we,me/k.locationSize*be*we)}}else if(G!==void 0){const N=G[Z];if(N!==void 0)switch(N.length){case 2:n.vertexAttrib2fv(k.location,N);break;case 3:n.vertexAttrib3fv(k.location,N);break;case 4:n.vertexAttrib4fv(k.location,N);break;default:n.vertexAttrib1fv(k.location,N)}}}}P()}function L(){fe();for(const $ in a){const se=a[$];for(const le in se){const pe=se[le];for(const z in pe)v(pe[z].object),delete pe[z];delete se[le]}delete a[$]}}function D($){if(a[$.id]===void 0)return;const se=a[$.id];for(const le in se){const pe=se[le];for(const z in pe)v(pe[z].object),delete pe[z];delete se[le]}delete a[$.id]}function Y($){for(const se in a){const le=a[se];if(le[$.id]===void 0)continue;const pe=le[$.id];for(const z in pe)v(pe[z].object),delete pe[z];delete le[$.id]}}function fe(){q(),d=!0,f!==c&&(f=c,g(f.object))}function q(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:h,reset:fe,resetDefaultState:q,dispose:L,releaseStatesOfGeometry:D,releaseStatesOfProgram:Y,initAttributes:M,enableAttribute:E,disableUnusedAttributes:P}}function RG(n,e,t,r){const i=r.isWebGL2;let s;function o(f){s=f}function a(f,d){n.drawArrays(s,f,d),t.update(d,s,1)}function c(f,d,h){if(h===0)return;let p,g;if(i)p=n,g="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),g="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[g](s,f,d,h),t.update(d,s,h)}this.setMode=o,this.render=a,this.renderInstances=c}function LG(n,e,t){let r;function i(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const R=e.get("EXT_texture_filter_anisotropic");r=n.getParameter(R.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function s(R){if(R==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";R="mediump"}return R==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext!="undefined"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&n instanceof WebGL2ComputeRenderingContext;let a=t.precision!==void 0?t.precision:"highp";const c=s(a);c!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",c,"instead."),a=c);const f=o||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,h=n.getParameter(34930),p=n.getParameter(35660),g=n.getParameter(3379),v=n.getParameter(34076),y=n.getParameter(34921),x=n.getParameter(36347),w=n.getParameter(36348),_=n.getParameter(36349),M=p>0,E=o||e.has("OES_texture_float"),C=M&&E,P=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:f,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:d,maxTextures:h,maxVertexTextures:p,maxTextureSize:g,maxCubemapSize:v,maxAttributes:y,maxVertexUniforms:x,maxVaryings:w,maxFragmentUniforms:_,vertexTextures:M,floatFragmentTextures:E,floatVertexTextures:C,maxSamples:P}}function IG(n){const e=this;let t=null,r=0,i=!1,s=!1;const o=new So,a=new Tr,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p,g){const v=h.length!==0||p||r!==0||i;return i=p,t=d(h,g,0),r=h.length,v},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1,f()},this.setState=function(h,p,g){const v=h.clippingPlanes,y=h.clipIntersection,x=h.clipShadows,w=n.get(h);if(!i||v===null||v.length===0||s&&!x)s?d(null):f();else{const _=s?0:r,M=_*4;let E=w.clippingState||null;c.value=E,E=d(v,p,M,g);for(let C=0;C!==M;++C)E[C]=t[C];w.clippingState=E,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=_}};function f(){c.value!==t&&(c.value=t,c.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function d(h,p,g,v){const y=h!==null?h.length:0;let x=null;if(y!==0){if(x=c.value,v!==!0||x===null){const w=g+y*4,_=p.matrixWorldInverse;a.getNormalMatrix(_),(x===null||x.length<w)&&(x=new Float32Array(w));for(let M=0,E=g;M!==y;++M,E+=4)o.copy(h[M]).applyMatrix4(_,a),o.normal.toArray(x,E),x[E+3]=o.constant}c.value=x,c.needsUpdate=!0}return e.numPlanes=y,e.numIntersection=0,x}}function NG(n){let e=new WeakMap;function t(o,a){return a===zf?o.mapping=Vo:a===Ff&&(o.mapping=Go),o}function r(o){if(o&&o.isTexture&&o.isRenderTargetTexture===!1){const a=o.mapping;if(a===zf||a===Ff)if(e.has(o)){const c=e.get(o).texture;return t(c,o.mapping)}else{const c=o.image;if(c&&c.height>0){const f=new uL(c.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),o.addEventListener("dispose",i),t(f.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const c=e.get(a);c!==void 0&&(e.delete(a),c.dispose())}function s(){e=new WeakMap}return{get:r,dispose:s}}class md extends hd{constructor(e=-1,t=1,r=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,r,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,o=r+e,a=i+t,c=i-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=f*this.view.offsetX,o=s+f*this.view.width,a-=d*this.view.offsetY,c=a-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,c,this.near,this.far),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 fu=4,AT=[.125,.215,.35,.446,.526,.582],wa=20,Ay=new md,PT=new Ge;let Py=null;const ya=(1+Math.sqrt(5))/2,Gl=1/ya,RT=[new I(1,1,1),new I(-1,1,1),new I(1,1,-1),new I(-1,1,-1),new I(0,ya,Gl),new I(0,ya,-Gl),new I(Gl,0,ya),new I(-Gl,0,ya),new I(ya,Gl,0),new I(-ya,Gl,0)];class Dx{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,r=.1,i=100){Py=this._renderer.getRenderTarget(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,r,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=NT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=IT(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Py),e.scissorTest=!1,mp(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Vo||e.mapping===Go?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Py=this._renderer.getRenderTarget();const r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:un,minFilter:un,generateMipmaps:!1,type:Za,format:_i,encoding:Xs,depthBuffer:!1},i=LT(e,t,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=LT(e,t,r);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=DG(s)),this._blurMaterial=OG(s,e,t)}return i}_compileMaterial(e){const t=new We(this._lodPlanes[0],e);this._renderer.compile(t,Ay)}_sceneToCubeUV(e,t,r,i){const a=new Gn(90,1,t,r),c=[1,-1,1,1,1,1],f=[1,1,1,-1,-1,-1],d=this._renderer,h=d.autoClear,p=d.toneMapping;d.getClearColor(PT),d.toneMapping=Ui,d.autoClear=!1;const g=new hs({name:"PMREM.Background",side:jr,depthWrite:!1,depthTest:!1}),v=new We(new hr,g);let y=!1;const x=e.background;x?x.isColor&&(g.color.copy(x),e.background=null,y=!0):(g.color.copy(PT),y=!0);for(let w=0;w<6;w++){const _=w%3;_===0?(a.up.set(0,c[w],0),a.lookAt(f[w],0,0)):_===1?(a.up.set(0,0,c[w]),a.lookAt(0,f[w],0)):(a.up.set(0,c[w],0),a.lookAt(0,0,f[w]));const M=this._cubeSize;mp(i,_*M,w>2?M:0,M,M),d.setRenderTarget(i),y&&d.render(v,a),d.render(e,a)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=h,e.background=x}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===Vo||e.mapping===Go;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=NT()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=IT());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new We(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const c=this._cubeSize;mp(t,0,0,3*c,2*c),r.setRenderTarget(t),r.render(o,Ay)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=RT[(i-1)%RT.length];this._blur(e,i-1,i,s,o)}t.autoClear=r}_blur(e,t,r,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,r,i,"latitudinal",s),this._halfBlur(o,e,r,r,i,"longitudinal",s)}_halfBlur(e,t,r,i,s,o,a){const c=this._renderer,f=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,h=new We(this._lodPlanes[i],f),p=f.uniforms,g=this._sizeLods[r]-1,v=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*wa-1),y=s/v,x=isFinite(s)?1+Math.floor(d*y):wa;x>wa&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${wa}`);const w=[];let _=0;for(let R=0;R<wa;++R){const T=R/y,L=Math.exp(-T*T/2);w.push(L),R===0?_+=L:R<x&&(_+=2*L)}for(let R=0;R<w.length;R++)w[R]=w[R]/_;p.envMap.value=e.texture,p.samples.value=x,p.weights.value=w,p.latitudinal.value=o==="latitudinal",a&&(p.poleAxis.value=a);const{_lodMax:M}=this;p.dTheta.value=v,p.mipInt.value=M-r;const E=this._sizeLods[i],C=3*E*(i>M-fu?i-M+fu:0),P=4*(this._cubeSize-E);mp(t,C,P,3*E,2*E),c.setRenderTarget(t),c.render(h,Ay)}}function DG(n){const e=[],t=[],r=[];let i=n;const s=n-fu+1+AT.length;for(let o=0;o<s;o++){const a=Math.pow(2,i);t.push(a);let c=1/a;o>n-fu?c=AT[o-n+fu-1]:o===0&&(c=0),r.push(c);const f=1/(a-2),d=-f,h=1+f,p=[d,d,h,d,h,h,d,d,h,h,d,h],g=6,v=6,y=3,x=2,w=1,_=new Float32Array(y*v*g),M=new Float32Array(x*v*g),E=new Float32Array(w*v*g);for(let P=0;P<g;P++){const R=P%3*2/3-1,T=P>2?0:-1,L=[R,T,0,R+2/3,T,0,R+2/3,T+1,0,R,T,0,R+2/3,T+1,0,R,T+1,0];_.set(L,y*v*P),M.set(p,x*v*P);const D=[P,P,P,P,P,P];E.set(D,w*v*P)}const C=new ht;C.setAttribute("position",new qt(_,y)),C.setAttribute("uv",new qt(M,x)),C.setAttribute("faceIndex",new qt(E,w)),e.push(C),i>fu&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function LT(n,e,t){const r=new qr(n,e,t);return r.texture.mapping=Hu,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function mp(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function OG(n,e,t){const r=new Float32Array(wa),i=new I(0,1,0);return new fs({name:"SphericalGaussianBlur",defines:{n:wa,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:gS(),fragmentShader:`
precision mediump float;
precision mediump int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
uniform int samples;
uniform float weights[ n ];
uniform bool latitudinal;
uniform float dTheta;
uniform float mipInt;
uniform vec3 poleAxis;
#define ENVMAP_TYPE_CUBE_UV
#include <cube_uv_reflection_fragment>
vec3 getSample( float theta, vec3 axis ) {
float cosTheta = cos( theta );
// Rodrigues' axis-angle rotation
vec3 sampleDirection = vOutputDirection * cosTheta
+ cross( axis, vOutputDirection ) * sin( theta )
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
return bilinearCubeUV( envMap, sampleDirection, mipInt );
}
void main() {
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
}
axis = normalize( axis );
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
for ( int i = 1; i < n; i++ ) {
if ( i >= samples ) {
break;
}
float theta = dTheta * float( i );
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
}
}
`,blending:Gs,depthTest:!1,depthWrite:!1})}function IT(){return new fs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:gS(),fragmentShader:`
precision mediump float;
precision mediump int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
#include <common>
void main() {
vec3 outputDirection = normalize( vOutputDirection );
vec2 uv = equirectUv( outputDirection );
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
}
`,blending:Gs,depthTest:!1,depthWrite:!1})}function NT(){return new fs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:gS(),fragmentShader:`
precision mediump float;
precision mediump int;
uniform float flipEnvMap;
varying vec3 vOutputDirection;
uniform samplerCube envMap;
void main() {
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
}
`,blending:Gs,depthTest:!1,depthWrite:!1})}function gS(){return`
precision mediump float;
precision mediump int;
attribute float faceIndex;
varying vec3 vOutputDirection;
// RH coordinate system; PMREM face-indexing convention
vec3 getDirection( vec2 uv, float face ) {
uv = 2.0 * uv - 1.0;
vec3 direction = vec3( uv, 1.0 );
if ( face == 0.0 ) {
direction = direction.zyx; // ( 1, v, u ) pos x
} else if ( face == 1.0 ) {
direction = direction.xzy;
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
} else if ( face == 2.0 ) {
direction.x *= -1.0; // ( -u, v, 1 ) pos z
} else if ( face == 3.0 ) {
direction = direction.zyx;
direction.xz *= -1.0; // ( -1, v, -u ) neg x
} else if ( face == 4.0 ) {
direction = direction.xzy;
direction.xy *= -1.0; // ( -u, -1, v ) neg y
} else if ( face == 5.0 ) {
direction.z *= -1.0; // ( u, v, -1 ) neg z
}
return direction;
}
void main() {
vOutputDirection = getDirection( uv, faceIndex );
gl_Position = vec4( position, 1.0 );
}
`}function kG(n){let e=new WeakMap,t=null;function r(a){if(a&&a.isTexture){const c=a.mapping,f=c===zf||c===Ff,d=c===Vo||c===Go;if(f||d)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let h=e.get(a);return t===null&&(t=new Dx(n)),h=f?t.fromEquirectangular(a,h):t.fromCubemap(a,h),e.set(a,h),h.texture}else{if(e.has(a))return e.get(a).texture;{const h=a.image;if(f&&h&&h.height>0||d&&h&&i(h)){t===null&&(t=new Dx(n));const p=f?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function i(a){let c=0;const f=6;for(let d=0;d<f;d++)a[d]!==void 0&&c++;return c===f}function s(a){const c=a.target;c.removeEventListener("dispose",s);const f=e.get(c);f!==void 0&&(e.delete(c),f.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:r,dispose:o}}function zG(n){const e={};function t(r){if(e[r]!==void 0)return e[r];let i;switch(r){case"WEBGL_depth_texture":i=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=n.getExtension(r)}return e[r]=i,i}return{has:function(r){return t(r)!==null},init:function(r){r.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(r){const i=t(r);return i===null&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),i}}}function FG(n,e,t,r){const i={},s=new WeakMap;function o(h){const p=h.target;p.index!==null&&e.remove(p.index);for(const v in p.attributes)e.remove(p.attributes[v]);p.removeEventListener("dispose",o),delete i[p.id];const g=s.get(p);g&&(e.remove(g),s.delete(p)),r.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function a(h,p){return i[p.id]===!0||(p.addEventListener("dispose",o),i[p.id]=!0,t.memory.geometries++),p}function c(h){const p=h.attributes;for(const v in p)e.update(p[v],34962);const g=h.morphAttributes;for(const v in g){const y=g[v];for(let x=0,w=y.length;x<w;x++)e.update(y[x],34962)}}function f(h){const p=[],g=h.index,v=h.attributes.position;let y=0;if(g!==null){const _=g.array;y=g.version;for(let M=0,E=_.length;M<E;M+=3){const C=_[M+0],P=_[M+1],R=_[M+2];p.push(C,P,P,R,R,C)}}else{const _=v.array;y=v.version;for(let M=0,E=_.length/3-1;M<E;M+=3){const C=M+0,P=M+1,R=M+2;p.push(C,P,P,R,R,C)}}const x=new(sL(p)?mS:pS)(p,1);x.version=y;const w=s.get(h);w&&e.remove(w),s.set(h,x)}function d(h){const p=s.get(h);if(p){const g=h.index;g!==null&&p.version<g.version&&f(h)}else f(h);return s.get(h)}return{get:a,update:c,getWireframeAttribute:d}}function UG(n,e,t,r){const i=r.isWebGL2;let s;function o(p){s=p}let a,c;function f(p){a=p.type,c=p.bytesPerElement}function d(p,g){n.drawElements(s,g,a,p*c),t.update(g,s,1)}function h(p,g,v){if(v===0)return;let y,x;if(i)y=n,x="drawElementsInstanced";else if(y=e.get("ANGLE_instanced_arrays"),x="drawElementsInstancedANGLE",y===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}y[x](s,g,a,p*c,v),t.update(g,s,v)}this.setMode=o,this.setIndex=f,this.render=d,this.renderInstances=h}function BG(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function r(s,o,a){switch(t.calls++,o){case 4:t.triangles+=a*(s/3);break;case 1:t.lines+=a*(s/2);break;case 3:t.lines+=a*(s-1);break;case 2:t.lines+=a*s;break;case 0:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:r}}function VG(n,e){return n[0]-e[0]}function GG(n,e){return Math.abs(e[1])-Math.abs(n[1])}function HG(n,e,t){const r={},i=new Float32Array(8),s=new WeakMap,o=new Ht,a=[];for(let f=0;f<8;f++)a[f]=[f,0];function c(f,d,h,p){const g=f.morphTargetInfluences;if(e.isWebGL2===!0){const y=d.morphAttributes.position||d.morphAttributes.normal||d.morphAttributes.color,x=y!==void 0?y.length:0;let w=s.get(d);if(w===void 0||w.count!==x){let le=function(){$.dispose(),s.delete(d),d.removeEventListener("dispose",le)};var v=le;w!==void 0&&w.texture.dispose();const E=d.morphAttributes.position!==void 0,C=d.morphAttributes.normal!==void 0,P=d.morphAttributes.color!==void 0,R=d.morphAttributes.position||[],T=d.morphAttributes.normal||[],L=d.morphAttributes.color||[];let D=0;E===!0&&(D=1),C===!0&&(D=2),P===!0&&(D=3);let Y=d.attributes.position.count*D,fe=1;Y>e.maxTextureSize&&(fe=Math.ceil(Y/e.maxTextureSize),Y=e.maxTextureSize);const q=new Float32Array(Y*fe*4*x),$=new fd(q,Y,fe,x);$.type=os,$.needsUpdate=!0;const se=D*4;for(let pe=0;pe<x;pe++){const z=R[pe],F=T[pe],G=L[pe],Z=Y*fe*4*pe;for(let k=0;k<z.count;k++){const W=k*se;E===!0&&(o.fromBufferAttribute(z,k),q[Z+W+0]=o.x,q[Z+W+1]=o.y,q[Z+W+2]=o.z,q[Z+W+3]=0),C===!0&&(o.fromBufferAttribute(F,k),q[Z+W+4]=o.x,q[Z+W+5]=o.y,q[Z+W+6]=o.z,q[Z+W+7]=0),P===!0&&(o.fromBufferAttribute(G,k),q[Z+W+8]=o.x,q[Z+W+9]=o.y,q[Z+W+10]=o.z,q[Z+W+11]=G.itemSize===4?o.w:1)}}w={count:x,texture:$,size:new Me(Y,fe)},s.set(d,w),d.addEventListener("dispose",le)}let _=0;for(let E=0;E<g.length;E++)_+=g[E];const M=d.morphTargetsRelative?1:1-_;p.getUniforms().setValue(n,"morphTargetBaseInfluence",M),p.getUniforms().setValue(n,"morphTargetInfluences",g),p.getUniforms().setValue(n,"morphTargetsTexture",w.texture,t),p.getUniforms().setValue(n,"morphTargetsTextureSize",w.size)}else{const y=g===void 0?0:g.length;let x=r[d.id];if(x===void 0||x.length!==y){x=[];for(let C=0;C<y;C++)x[C]=[C,0];r[d.id]=x}for(let C=0;C<y;C++){const P=x[C];P[0]=C,P[1]=g[C]}x.sort(GG);for(let C=0;C<8;C++)C<y&&x[C][1]?(a[C][0]=x[C][0],a[C][1]=x[C][1]):(a[C][0]=Number.MAX_SAFE_INTEGER,a[C][1]=0);a.sort(VG);const w=d.morphAttributes.position,_=d.morphAttributes.normal;let M=0;for(let C=0;C<8;C++){const P=a[C],R=P[0],T=P[1];R!==Number.MAX_SAFE_INTEGER&&T?(w&&d.getAttribute("morphTarget"+C)!==w[R]&&d.setAttribute("morphTarget"+C,w[R]),_&&d.getAttribute("morphNormal"+C)!==_[R]&&d.setAttribute("morphNormal"+C,_[R]),i[C]=T,M+=T):(w&&d.hasAttribute("morphTarget"+C)===!0&&d.deleteAttribute("morphTarget"+C),_&&d.hasAttribute("morphNormal"+C)===!0&&d.deleteAttribute("morphNormal"+C),i[C]=0)}const E=d.morphTargetsRelative?1:1-M;p.getUniforms().setValue(n,"morphTargetBaseInfluence",E),p.getUniforms().setValue(n,"morphTargetInfluences",i)}}return{update:c}}function WG(n,e,t,r){let i=new WeakMap;function s(c){const f=r.render.frame,d=c.geometry,h=e.get(c,d);return i.get(h)!==f&&(e.update(h),i.set(h,f)),c.isInstancedMesh&&(c.hasEventListener("dispose",a)===!1&&c.addEventListener("dispose",a),t.update(c.instanceMatrix,34962),c.instanceColor!==null&&t.update(c.instanceColor,34962)),h}function o(){i=new WeakMap}function a(c){const f=c.target;f.removeEventListener("dispose",a),t.remove(f.instanceMatrix),f.instanceColor!==null&&t.remove(f.instanceColor)}return{update:s,dispose:o}}const fL=new Cn,dL=new fd,hL=new Hg,pL=new pd,DT=[],OT=[],kT=new Float32Array(16),zT=new Float32Array(9),FT=new Float32Array(4);function Wu(n,e,t){const r=n[0];if(r<=0||r>0)return n;const i=e*t;let s=DT[i];if(s===void 0&&(s=new Float32Array(i),DT[i]=s),e!==0){r.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Nn(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t<r;t++)if(n[t]!==e[t])return!1;return!0}function Dn(n,e){for(let t=0,r=e.length;t<r;t++)n[t]=e[t]}function $g(n,e){let t=OT[e];t===void 0&&(t=new Int32Array(e),OT[e]=t);for(let r=0;r!==e;++r)t[r]=n.allocateTextureUnit();return t}function $G(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function jG(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Nn(t,e))return;n.uniform2fv(this.addr,e),Dn(t,e)}}function XG(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Nn(t,e))return;n.uniform3fv(this.addr,e),Dn(t,e)}}function YG(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Nn(t,e))return;n.uniform4fv(this.addr,e),Dn(t,e)}}function qG(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(Nn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Dn(t,e)}else{if(Nn(t,r))return;FT.set(r),n.uniformMatrix2fv(this.addr,!1,FT),Dn(t,r)}}function ZG(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(Nn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Dn(t,e)}else{if(Nn(t,r))return;zT.set(r),n.uniformMatrix3fv(this.addr,!1,zT),Dn(t,r)}}function QG(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(Nn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Dn(t,e)}else{if(Nn(t,r))return;kT.set(r),n.uniformMatrix4fv(this.addr,!1,kT),Dn(t,r)}}function KG(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function JG(n,e){const t=this.cache;Nn(t,e)||(n.uniform2iv(this.addr,e),Dn(t,e))}function eH(n,e){const t=this.cache;Nn(t,e)||(n.uniform3iv(this.addr,e),Dn(t,e))}function tH(n,e){const t=this.cache;Nn(t,e)||(n.uniform4iv(this.addr,e),Dn(t,e))}function nH(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function rH(n,e){const t=this.cache;Nn(t,e)||(n.uniform2uiv(this.addr,e),Dn(t,e))}function iH(n,e){const t=this.cache;Nn(t,e)||(n.uniform3uiv(this.addr,e),Dn(t,e))}function sH(n,e){const t=this.cache;Nn(t,e)||(n.uniform4uiv(this.addr,e),Dn(t,e))}function oH(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture2D(e||fL,i)}function aH(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture3D(e||hL,i)}function lH(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTextureCube(e||pL,i)}function uH(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture2DArray(e||dL,i)}function cH(n){switch(n){case 5126:return $G;case 35664:return jG;case 35665:return XG;case 35666:return YG;case 35674:return qG;case 35675:return ZG;case 35676:return QG;case 5124:case 35670:return KG;case 35667:case 35671:return JG;case 35668:case 35672:return eH;case 35669:case 35673:return tH;case 5125:return nH;case 36294:return rH;case 36295:return iH;case 36296:return sH;case 35678:case 36198:case 36298:case 36306:case 35682:return oH;case 35679:case 36299:case 36307:return aH;case 35680:case 36300:case 36308:case 36293:return lH;case 36289:case 36303:case 36311:case 36292:return uH}}function fH(n,e){n.uniform1fv(this.addr,e)}function dH(n,e){const t=Wu(e,this.size,2);n.uniform2fv(this.addr,t)}function hH(n,e){const t=Wu(e,this.size,3);n.uniform3fv(this.addr,t)}function pH(n,e){const t=Wu(e,this.size,4);n.uniform4fv(this.addr,t)}function mH(n,e){const t=Wu(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function gH(n,e){const t=Wu(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function vH(n,e){const t=Wu(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function yH(n,e){n.uniform1iv(this.addr,e)}function _H(n,e){n.uniform2iv(this.addr,e)}function xH(n,e){n.uniform3iv(this.addr,e)}function SH(n,e){n.uniform4iv(this.addr,e)}function wH(n,e){n.uniform1uiv(this.addr,e)}function MH(n,e){n.uniform2uiv(this.addr,e)}function bH(n,e){n.uniform3uiv(this.addr,e)}function EH(n,e){n.uniform4uiv(this.addr,e)}function TH(n,e,t){const r=this.cache,i=e.length,s=$g(t,i);Nn(r,s)||(n.uniform1iv(this.addr,s),Dn(r,s));for(let o=0;o!==i;++o)t.setTexture2D(e[o]||fL,s[o])}function CH(n,e,t){const r=this.cache,i=e.length,s=$g(t,i);Nn(r,s)||(n.uniform1iv(this.addr,s),Dn(r,s));for(let o=0;o!==i;++o)t.setTexture3D(e[o]||hL,s[o])}function AH(n,e,t){const r=this.cache,i=e.length,s=$g(t,i);Nn(r,s)||(n.uniform1iv(this.addr,s),Dn(r,s));for(let o=0;o!==i;++o)t.setTextureCube(e[o]||pL,s[o])}function PH(n,e,t){const r=this.cache,i=e.length,s=$g(t,i);Nn(r,s)||(n.uniform1iv(this.addr,s),Dn(r,s));for(let o=0;o!==i;++o)t.setTexture2DArray(e[o]||dL,s[o])}function RH(n){switch(n){case 5126:return fH;case 35664:return dH;case 35665:return hH;case 35666:return pH;case 35674:return mH;case 35675:return gH;case 35676:return vH;case 5124:case 35670:return yH;case 35667:case 35671:return _H;case 35668:case 35672:return xH;case 35669:case 35673:return SH;case 5125:return wH;case 36294:return MH;case 36295:return bH;case 36296:return EH;case 35678:case 36198:case 36298:case 36306:case 35682:return TH;case 35679:case 36299:case 36307:return CH;case 35680:case 36300:case 36308:case 36293:return AH;case 36289:case 36303:case 36311:case 36292:return PH}}class LH{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.setValue=cH(t.type)}}class IH{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.size=t.size,this.setValue=RH(t.type)}}class NH{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,r){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const a=i[s];a.setValue(e,t[a.id],r)}}}const Ry=/(\w+)(\])?(\[|\.)?/g;function UT(n,e){n.seq.push(e),n.map[e.id]=e}function DH(n,e,t){const r=n.name,i=r.length;for(Ry.lastIndex=0;;){const s=Ry.exec(r),o=Ry.lastIndex;let a=s[1];const c=s[2]==="]",f=s[3];if(c&&(a=a|0),f===void 0||f==="["&&o+2===i){UT(t,f===void 0?new LH(a,n,e):new IH(a,n,e));break}else{let h=t.map[a];h===void 0&&(h=new NH(a),UT(t,h)),t=h}}}class hm{constructor(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,35718);for(let i=0;i<r;++i){const s=e.getActiveUniform(t,i),o=e.getUniformLocation(t,s.name);DH(s,o,this)}}setValue(e,t,r,i){const s=this.map[t];s!==void 0&&s.setValue(e,r,i)}setOptional(e,t,r){const i=t[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,t,r,i){for(let s=0,o=t.length;s!==o;++s){const a=t[s],c=r[a.id];c.needsUpdate!==!1&&a.setValue(e,c.value,i)}}static seqWithValue(e,t){const r=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in t&&r.push(o)}return r}}function BT(n,e,t){const r=n.createShader(e);return n.shaderSource(r,t),n.compileShader(r),r}let OH=0;function kH(n,e){const t=n.split(`
`),r=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=i;o<s;o++){const a=o+1;r.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return r.join(`
`)}function zH(n){switch(n){case Xs:return["Linear","( value )"];case Kt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function VT(n,e,t){const r=n.getShaderParameter(e,35713),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+`
`+i+`
`+kH(n.getShaderSource(e),o)}else return i}function FH(n,e){const t=zH(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function UH(n,e){let t;switch(e){case IR:t="Linear";break;case NR:t="Reinhard";break;case DR:t="OptimizedCineon";break;case lS:t="ACESFilmic";break;case OR:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function BH(n){return[n.extensionDerivatives||!!n.envMapCubeUVHeight||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Kc).join(`
`)}function VH(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(`
`)}function GH(n,e){const t={},r=n.getProgramParameter(e,35721);for(let i=0;i<r;i++){const s=n.getActiveAttrib(e,i),o=s.name;let a=1;s.type===35674&&(a=2),s.type===35675&&(a=3),s.type===35676&&(a=4),t[o]={type:s.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function Kc(n){return n!==""}function GT(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function HT(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const HH=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ox(n){return n.replace(HH,WH)}function WH(n,e){const t=wt[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return Ox(t)}const $H=/#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 WT(n){return n.replace($H,jH)}function jH(n,e,t,r){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function $T(n){let e="precision "+n.precision+` float;
precision `+n.precision+" int;";return n.precision==="highp"?e+=`
#define HIGH_PRECISION`:n.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function XH(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===Bg?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===cf?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Ca&&(e="SHADOWMAP_TYPE_VSM"),e}function YH(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Vo:case Go:e="ENVMAP_TYPE_CUBE";break;case Hu:e="ENVMAP_TYPE_CUBE_UV";break}return e}function qH(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case Go:e="ENVMAP_MODE_REFRACTION";break}return e}function ZH(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case cd:e="ENVMAP_BLENDING_MULTIPLY";break;case RR:e="ENVMAP_BLENDING_MIX";break;case LR:e="ENVMAP_BLENDING_ADD";break}return e}function QH(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:r,maxMip:t}}function KH(n,e,t,r){const i=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const c=XH(t),f=YH(t),d=qH(t),h=ZH(t),p=QH(t),g=t.isWebGL2?"":BH(t),v=VH(s),y=i.createProgram();let x,w,_=t.glslVersion?"#version "+t.glslVersion+`
`:"";t.isRawShaderMaterial?(x=[v].filter(Kc).join(`
`),x.length>0&&(x+=`
`),w=[g,v].filter(Kc).join(`
`),w.length>0&&(w+=`
`)):(x=[$T(t),"#define SHADER_NAME "+t.shaderName,v,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"",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 "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",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&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
`].filter(Kc).join(`
`),w=[g,$T(t),"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.envMap?"#define "+d:"",t.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",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 "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ui?"#define TONE_MAPPING":"",t.toneMapping!==Ui?wt.tonemapping_pars_fragment:"",t.toneMapping!==Ui?UH("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",wt.encodings_pars_fragment,FH("linearToOutputTexel",t.outputEncoding),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
`].filter(Kc).join(`
`)),o=Ox(o),o=GT(o,t),o=HT(o,t),a=Ox(a),a=GT(a,t),a=HT(a,t),o=WT(o),a=WT(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(_=`#version 300 es
`,x=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+x,w=["#define varying in",t.glslVersion===Ix?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Ix?"":"#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(`
`)+`
`+w);const M=_+x+o,E=_+w+a,C=BT(i,35633,M),P=BT(i,35632,E);if(i.attachShader(y,C),i.attachShader(y,P),t.index0AttributeName!==void 0?i.bindAttribLocation(y,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(y,0,"position"),i.linkProgram(y),n.debug.checkShaderErrors){const L=i.getProgramInfoLog(y).trim(),D=i.getShaderInfoLog(C).trim(),Y=i.getShaderInfoLog(P).trim();let fe=!0,q=!0;if(i.getProgramParameter(y,35714)===!1){fe=!1;const $=VT(i,C,"vertex"),se=VT(i,P,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(y,35715)+`
Program Info Log: `+L+`
`+$+`
`+se)}else L!==""?console.warn("THREE.WebGLProgram: Program Info Log:",L):(D===""||Y==="")&&(q=!1);q&&(this.diagnostics={runnable:fe,programLog:L,vertexShader:{log:D,prefix:x},fragmentShader:{log:Y,prefix:w}})}i.deleteShader(C),i.deleteShader(P);let R;this.getUniforms=function(){return R===void 0&&(R=new hm(i,y)),R};let T;return this.getAttributes=function(){return T===void 0&&(T=GH(i,y)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(y),this.program=void 0},this.name=t.shaderName,this.id=OH++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=C,this.fragmentShader=P,this}let JH=0;class eW{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(r),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new tW(e),t.set(e,r)),r}}class tW{constructor(e){this.id=JH++,this.code=e,this.usedTimes=0}}function nW(n,e,t,r,i,s,o){const a=new Va,c=new eW,f=[],d=i.isWebGL2,h=i.logarithmicDepthBuffer,p=i.vertexTextures;let g=i.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(T,L,D,Y,fe){const q=Y.fog,$=fe.geometry,se=T.isMeshStandardMaterial?Y.environment:null,le=(T.isMeshStandardMaterial?t:e).get(T.envMap||se),pe=!!le&&le.mapping===Hu?le.image.height:null,z=v[T.type];T.precision!==null&&(g=i.getMaxPrecision(T.precision),g!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",g,"instead."));const F=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,G=F!==void 0?F.length:0;let Z=0;$.morphAttributes.position!==void 0&&(Z=1),$.morphAttributes.normal!==void 0&&(Z=2),$.morphAttributes.color!==void 0&&(Z=3);let k,W,N,me;if(z){const He=Oi[z];k=He.vertexShader,W=He.fragmentShader}else k=T.vertexShader,W=T.fragmentShader,c.update(T),N=c.getVertexShaderID(T),me=c.getFragmentShaderID(T);const X=n.getRenderTarget(),Te=T.alphaTest>0,Ce=T.clearcoat>0,we=T.iridescence>0;return{isWebGL2:d,shaderID:z,shaderName:T.type,vertexShader:k,fragmentShader:W,defines:T.defines,customVertexShaderID:N,customFragmentShaderID:me,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:g,instancing:fe.isInstancedMesh===!0,instancingColor:fe.isInstancedMesh===!0&&fe.instanceColor!==null,supportsVertexTextures:p,outputEncoding:X===null?n.outputEncoding:X.isXRRenderTarget===!0?X.texture.encoding:Xs,map:!!T.map,matcap:!!T.matcap,envMap:!!le,envMapMode:le&&le.mapping,envMapCubeUVHeight:pe,lightMap:!!T.lightMap,aoMap:!!T.aoMap,emissiveMap:!!T.emissiveMap,bumpMap:!!T.bumpMap,normalMap:!!T.normalMap,objectSpaceNormalMap:T.normalMapType===nL,tangentSpaceNormalMap:T.normalMapType===qo,decodeVideoTexture:!!T.map&&T.map.isVideoTexture===!0&&T.map.encoding===Kt,clearcoat:Ce,clearcoatMap:Ce&&!!T.clearcoatMap,clearcoatRoughnessMap:Ce&&!!T.clearcoatRoughnessMap,clearcoatNormalMap:Ce&&!!T.clearcoatNormalMap,iridescence:we,iridescenceMap:we&&!!T.iridescenceMap,iridescenceThicknessMap:we&&!!T.iridescenceThicknessMap,displacementMap:!!T.displacementMap,roughnessMap:!!T.roughnessMap,metalnessMap:!!T.metalnessMap,specularMap:!!T.specularMap,specularIntensityMap:!!T.specularIntensityMap,specularColorMap:!!T.specularColorMap,opaque:T.transparent===!1&&T.blending===za,alphaMap:!!T.alphaMap,alphaTest:Te,gradientMap:!!T.gradientMap,sheen:T.sheen>0,sheenColorMap:!!T.sheenColorMap,sheenRoughnessMap:!!T.sheenRoughnessMap,transmission:T.transmission>0,transmissionMap:!!T.transmissionMap,thicknessMap:!!T.thicknessMap,combine:T.combine,vertexTangents:!!T.normalMap&&!!$.attributes.tangent,vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,vertexUvs:!!T.map||!!T.bumpMap||!!T.normalMap||!!T.specularMap||!!T.alphaMap||!!T.emissiveMap||!!T.roughnessMap||!!T.metalnessMap||!!T.clearcoatMap||!!T.clearcoatRoughnessMap||!!T.clearcoatNormalMap||!!T.iridescenceMap||!!T.iridescenceThicknessMap||!!T.displacementMap||!!T.transmissionMap||!!T.thicknessMap||!!T.specularIntensityMap||!!T.specularColorMap||!!T.sheenColorMap||!!T.sheenRoughnessMap,uvsVertexOnly:!(!!T.map||!!T.bumpMap||!!T.normalMap||!!T.specularMap||!!T.alphaMap||!!T.emissiveMap||!!T.roughnessMap||!!T.metalnessMap||!!T.clearcoatNormalMap||!!T.iridescenceMap||!!T.iridescenceThicknessMap||T.transmission>0||!!T.transmissionMap||!!T.thicknessMap||!!T.specularIntensityMap||!!T.specularColorMap||T.sheen>0||!!T.sheenColorMap||!!T.sheenRoughnessMap)&&!!T.displacementMap,fog:!!q,useFog:T.fog===!0,fogExp2:q&&q.isFogExp2,flatShading:!!T.flatShading,sizeAttenuation:T.sizeAttenuation,logarithmicDepthBuffer:h,skinning:fe.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:G,morphTextureStride:Z,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,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:T.dithering,shadowMapEnabled:n.shadowMap.enabled&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:T.toneMapped?n.toneMapping:Ui,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===ki,flipSided:T.side===jr,useDepthPacking:!!T.depthPacking,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionDerivatives:T.extensions&&T.extensions.derivatives,extensionFragDepth:T.extensions&&T.extensions.fragDepth,extensionDrawBuffers:T.extensions&&T.extensions.drawBuffers,extensionShaderTextureLOD:T.extensions&&T.extensions.shaderTextureLOD,rendererExtensionFragDepth:d||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||r.has("EXT_shader_texture_lod"),customProgramCacheKey:T.customProgramCacheKey()}}function x(T){const L=[];if(T.shaderID?L.push(T.shaderID):(L.push(T.customVertexShaderID),L.push(T.customFragmentShaderID)),T.defines!==void 0)for(const D in T.defines)L.push(D),L.push(T.defines[D]);return T.isRawShaderMaterial===!1&&(w(L,T),_(L,T),L.push(n.outputEncoding)),L.push(T.customProgramCacheKey),L.join()}function w(T,L){T.push(L.precision),T.push(L.outputEncoding),T.push(L.envMapMode),T.push(L.envMapCubeUVHeight),T.push(L.combine),T.push(L.vertexUvs),T.push(L.fogExp2),T.push(L.sizeAttenuation),T.push(L.morphTargetsCount),T.push(L.morphAttributeCount),T.push(L.numDirLights),T.push(L.numPointLights),T.push(L.numSpotLights),T.push(L.numSpotLightMaps),T.push(L.numHemiLights),T.push(L.numRectAreaLights),T.push(L.numDirLightShadows),T.push(L.numPointLightShadows),T.push(L.numSpotLightShadows),T.push(L.numSpotLightShadowsWithMaps),T.push(L.shadowMapType),T.push(L.toneMapping),T.push(L.numClippingPlanes),T.push(L.numClipIntersection),T.push(L.depthPacking)}function _(T,L){a.disableAll(),L.isWebGL2&&a.enable(0),L.supportsVertexTextures&&a.enable(1),L.instancing&&a.enable(2),L.instancingColor&&a.enable(3),L.map&&a.enable(4),L.matcap&&a.enable(5),L.envMap&&a.enable(6),L.lightMap&&a.enable(7),L.aoMap&&a.enable(8),L.emissiveMap&&a.enable(9),L.bumpMap&&a.enable(10),L.normalMap&&a.enable(11),L.objectSpaceNormalMap&&a.enable(12),L.tangentSpaceNormalMap&&a.enable(13),L.clearcoat&&a.enable(14),L.clearcoatMap&&a.enable(15),L.clearcoatRoughnessMap&&a.enable(16),L.clearcoatNormalMap&&a.enable(17),L.iridescence&&a.enable(18),L.iridescenceMap&&a.enable(19),L.iridescenceThicknessMap&&a.enable(20),L.displacementMap&&a.enable(21),L.specularMap&&a.enable(22),L.roughnessMap&&a.enable(23),L.metalnessMap&&a.enable(24),L.gradientMap&&a.enable(25),L.alphaMap&&a.enable(26),L.alphaTest&&a.enable(27),L.vertexColors&&a.enable(28),L.vertexAlphas&&a.enable(29),L.vertexUvs&&a.enable(30),L.vertexTangents&&a.enable(31),L.uvsVertexOnly&&a.enable(32),T.push(a.mask),a.disableAll(),L.fog&&a.enable(0),L.useFog&&a.enable(1),L.flatShading&&a.enable(2),L.logarithmicDepthBuffer&&a.enable(3),L.skinning&&a.enable(4),L.morphTargets&&a.enable(5),L.morphNormals&&a.enable(6),L.morphColors&&a.enable(7),L.premultipliedAlpha&&a.enable(8),L.shadowMapEnabled&&a.enable(9),L.physicallyCorrectLights&&a.enable(10),L.doubleSided&&a.enable(11),L.flipSided&&a.enable(12),L.useDepthPacking&&a.enable(13),L.dithering&&a.enable(14),L.specularIntensityMap&&a.enable(15),L.specularColorMap&&a.enable(16),L.transmission&&a.enable(17),L.transmissionMap&&a.enable(18),L.thicknessMap&&a.enable(19),L.sheen&&a.enable(20),L.sheenColorMap&&a.enable(21),L.sheenRoughnessMap&&a.enable(22),L.decodeVideoTexture&&a.enable(23),L.opaque&&a.enable(24),T.push(a.mask)}function M(T){const L=v[T.type];let D;if(L){const Y=Oi[L];D=aL.clone(Y.uniforms)}else D=T.uniforms;return D}function E(T,L){let D;for(let Y=0,fe=f.length;Y<fe;Y++){const q=f[Y];if(q.cacheKey===L){D=q,++D.usedTimes;break}}return D===void 0&&(D=new KH(n,L,T,s),f.push(D)),D}function C(T){if(--T.usedTimes===0){const L=f.indexOf(T);f[L]=f[f.length-1],f.pop(),T.destroy()}}function P(T){c.remove(T)}function R(){c.dispose()}return{getParameters:y,getProgramCacheKey:x,getUniforms:M,acquireProgram:E,releaseProgram:C,releaseShaderCache:P,programs:f,dispose:R}}function rW(){let n=new WeakMap;function e(s){let o=n.get(s);return o===void 0&&(o={},n.set(s,o)),o}function t(s){n.delete(s)}function r(s,o,a){n.get(s)[o]=a}function i(){n=new WeakMap}return{get:e,remove:t,update:r,dispose:i}}function iW(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function jT(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function XT(){const n=[];let e=0;const t=[],r=[],i=[];function s(){e=0,t.length=0,r.length=0,i.length=0}function o(h,p,g,v,y,x){let w=n[e];return w===void 0?(w={id:h.id,object:h,geometry:p,material:g,groupOrder:v,renderOrder:h.renderOrder,z:y,group:x},n[e]=w):(w.id=h.id,w.object=h,w.geometry=p,w.material=g,w.groupOrder=v,w.renderOrder=h.renderOrder,w.z=y,w.group=x),e++,w}function a(h,p,g,v,y,x){const w=o(h,p,g,v,y,x);g.transmission>0?r.push(w):g.transparent===!0?i.push(w):t.push(w)}function c(h,p,g,v,y,x){const w=o(h,p,g,v,y,x);g.transmission>0?r.unshift(w):g.transparent===!0?i.unshift(w):t.unshift(w)}function f(h,p){t.length>1&&t.sort(h||iW),r.length>1&&r.sort(p||jT),i.length>1&&i.sort(p||jT)}function d(){for(let h=e,p=n.length;h<p;h++){const g=n[h];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:r,transparent:i,init:s,push:a,unshift:c,finish:d,sort:f}}function sW(){let n=new WeakMap;function e(r,i){const s=n.get(r);let o;return s===void 0?(o=new XT,n.set(r,[o])):i>=s.length?(o=new XT,s.push(o)):o=s[i],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function oW(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new I,color:new Ge};break;case"SpotLight":t={position:new I,direction:new I,color:new Ge,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new I,color:new Ge,distance:0,decay:0};break;case"HemisphereLight":t={direction:new I,skyColor:new Ge,groundColor:new Ge};break;case"RectAreaLight":t={color:new Ge,position:new I,halfWidth:new I,halfHeight:new I};break}return n[e.id]=t,t}}}function aW(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Me};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Me};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Me,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let lW=0;function uW(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function cW(n,e){const t=new oW,r=aW(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-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};for(let d=0;d<9;d++)i.probe.push(new I);const s=new I,o=new dt,a=new dt;function c(d,h){let p=0,g=0,v=0;for(let Y=0;Y<9;Y++)i.probe[Y].set(0,0,0);let y=0,x=0,w=0,_=0,M=0,E=0,C=0,P=0,R=0,T=0;d.sort(uW);const L=h!==!0?Math.PI:1;for(let Y=0,fe=d.length;Y<fe;Y++){const q=d[Y],$=q.color,se=q.intensity,le=q.distance,pe=q.shadow&&q.shadow.map?q.shadow.map.texture:null;if(q.isAmbientLight)p+=$.r*se*L,g+=$.g*se*L,v+=$.b*se*L;else if(q.isLightProbe)for(let z=0;z<9;z++)i.probe[z].addScaledVector(q.sh.coefficients[z],se);else if(q.isDirectionalLight){const z=t.get(q);if(z.color.copy(q.color).multiplyScalar(q.intensity*L),q.castShadow){const F=q.shadow,G=r.get(q);G.shadowBias=F.bias,G.shadowNormalBias=F.normalBias,G.shadowRadius=F.radius,G.shadowMapSize=F.mapSize,i.directionalShadow[y]=G,i.directionalShadowMap[y]=pe,i.directionalShadowMatrix[y]=q.shadow.matrix,E++}i.directional[y]=z,y++}else if(q.isSpotLight){const z=t.get(q);z.position.setFromMatrixPosition(q.matrixWorld),z.color.copy($).multiplyScalar(se*L),z.distance=le,z.coneCos=Math.cos(q.angle),z.penumbraCos=Math.cos(q.angle*(1-q.penumbra)),z.decay=q.decay,i.spot[w]=z;const F=q.shadow;if(q.map&&(i.spotLightMap[R]=q.map,R++,F.updateMatrices(q),q.castShadow&&T++),i.spotLightMatrix[w]=F.matrix,q.castShadow){const G=r.get(q);G.shadowBias=F.bias,G.shadowNormalBias=F.normalBias,G.shadowRadius=F.radius,G.shadowMapSize=F.mapSize,i.spotShadow[w]=G,i.spotShadowMap[w]=pe,P++}w++}else if(q.isRectAreaLight){const z=t.get(q);z.color.copy($).multiplyScalar(se),z.halfWidth.set(q.width*.5,0,0),z.halfHeight.set(0,q.height*.5,0),i.rectArea[_]=z,_++}else if(q.isPointLight){const z=t.get(q);if(z.color.copy(q.color).multiplyScalar(q.intensity*L),z.distance=q.distance,z.decay=q.decay,q.castShadow){const F=q.shadow,G=r.get(q);G.shadowBias=F.bias,G.shadowNormalBias=F.normalBias,G.shadowRadius=F.radius,G.shadowMapSize=F.mapSize,G.shadowCameraNear=F.camera.near,G.shadowCameraFar=F.camera.far,i.pointShadow[x]=G,i.pointShadowMap[x]=pe,i.pointShadowMatrix[x]=q.shadow.matrix,C++}i.point[x]=z,x++}else if(q.isHemisphereLight){const z=t.get(q);z.skyColor.copy(q.color).multiplyScalar(se*L),z.groundColor.copy(q.groundColor).multiplyScalar(se*L),i.hemi[M]=z,M++}}_>0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=De.LTC_FLOAT_1,i.rectAreaLTC2=De.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=De.LTC_HALF_1,i.rectAreaLTC2=De.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=p,i.ambient[1]=g,i.ambient[2]=v;const D=i.hash;(D.directionalLength!==y||D.pointLength!==x||D.spotLength!==w||D.rectAreaLength!==_||D.hemiLength!==M||D.numDirectionalShadows!==E||D.numPointShadows!==C||D.numSpotShadows!==P||D.numSpotMaps!==R)&&(i.directional.length=y,i.spot.length=w,i.rectArea.length=_,i.point.length=x,i.hemi.length=M,i.directionalShadow.length=E,i.directionalShadowMap.length=E,i.pointShadow.length=C,i.pointShadowMap.length=C,i.spotShadow.length=P,i.spotShadowMap.length=P,i.directionalShadowMatrix.length=E,i.pointShadowMatrix.length=C,i.spotLightMatrix.length=P+R-T,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=T,D.directionalLength=y,D.pointLength=x,D.spotLength=w,D.rectAreaLength=_,D.hemiLength=M,D.numDirectionalShadows=E,D.numPointShadows=C,D.numSpotShadows=P,D.numSpotMaps=R,i.version=lW++)}function f(d,h){let p=0,g=0,v=0,y=0,x=0;const w=h.matrixWorldInverse;for(let _=0,M=d.length;_<M;_++){const E=d[_];if(E.isDirectionalLight){const C=i.directional[p];C.direction.setFromMatrixPosition(E.matrixWorld),s.setFromMatrixPosition(E.target.matrixWorld),C.direction.sub(s),C.direction.transformDirection(w),p++}else if(E.isSpotLight){const C=i.spot[v];C.position.setFromMatrixPosition(E.matrixWorld),C.position.applyMatrix4(w),C.direction.setFromMatrixPosition(E.matrixWorld),s.setFromMatrixPosition(E.target.matrixWorld),C.direction.sub(s),C.direction.transformDirection(w),v++}else if(E.isRectAreaLight){const C=i.rectArea[y];C.position.setFromMatrixPosition(E.matrixWorld),C.position.applyMatrix4(w),a.identity(),o.copy(E.matrixWorld),o.premultiply(w),a.extractRotation(o),C.halfWidth.set(E.width*.5,0,0),C.halfHeight.set(0,E.height*.5,0),C.halfWidth.applyMatrix4(a),C.halfHeight.applyMatrix4(a),y++}else if(E.isPointLight){const C=i.point[g];C.position.setFromMatrixPosition(E.matrixWorld),C.position.applyMatrix4(w),g++}else if(E.isHemisphereLight){const C=i.hemi[x];C.direction.setFromMatrixPosition(E.matrixWorld),C.direction.transformDirection(w),x++}}}return{setup:c,setupView:f,state:i}}function YT(n,e){const t=new cW(n,e),r=[],i=[];function s(){r.length=0,i.length=0}function o(h){r.push(h)}function a(h){i.push(h)}function c(h){t.setup(r,h)}function f(h){t.setupView(r,h)}return{init:s,state:{lightsArray:r,shadowsArray:i,lights:t},setupLights:c,setupLightsView:f,pushLight:o,pushShadow:a}}function fW(n,e){let t=new WeakMap;function r(s,o=0){const a=t.get(s);let c;return a===void 0?(c=new YT(n,e),t.set(s,[c])):o>=a.length?(c=new YT(n,e),a.push(c)):c=a[o],c}function i(){t=new WeakMap}return{get:r,dispose:i}}class vS extends qn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=eL,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 yS extends qn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new I,this.nearDistance=1,this.farDistance=1e3,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.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const dW=`void main() {
gl_Position = vec4( position, 1.0 );
}`,hW=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
const float samples = float( VSM_SAMPLES );
float mean = 0.0;
float squared_mean = 0.0;
float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
for ( float i = 0.0; i < samples; i ++ ) {
float uvOffset = uvStart + i * uvStride;
#ifdef HORIZONTAL_PASS
vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
mean += distribution.x;
squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
#else
float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
mean += depth;
squared_mean += depth * depth;
#endif
}
mean = mean / samples;
squared_mean = squared_mean / samples;
float std_dev = sqrt( squared_mean - mean * mean );
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function pW(n,e,t){let r=new Wg;const i=new Me,s=new Me,o=new Ht,a=new vS({depthPacking:tL}),c=new yS,f={},d=t.maxTextureSize,h={0:jr,1:qa,2:ki},p=new fs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Me},radius:{value:4}},vertexShader:dW,fragmentShader:hW}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new ht;v.setAttribute("position",new qt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new We(v,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Bg,this.render=function(E,C,P){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||E.length===0)return;const R=n.getRenderTarget(),T=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),D=n.state;D.setBlending(Gs),D.buffers.color.setClear(1,1,1,1),D.buffers.depth.setTest(!0),D.setScissorTest(!1);for(let Y=0,fe=E.length;Y<fe;Y++){const q=E[Y],$=q.shadow;if($===void 0){console.warn("THREE.WebGLShadowMap:",q,"has no shadow.");continue}if($.autoUpdate===!1&&$.needsUpdate===!1)continue;i.copy($.mapSize);const se=$.getFrameExtents();if(i.multiply(se),s.copy($.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/se.x),i.x=s.x*se.x,$.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/se.y),i.y=s.y*se.y,$.mapSize.y=s.y)),$.map===null){const pe=this.type!==Ca?{minFilter:En,magFilter:En}:{};$.map=new qr(i.x,i.y,pe),$.map.texture.name=q.name+".shadowMap",$.camera.updateProjectionMatrix()}n.setRenderTarget($.map),n.clear();const le=$.getViewportCount();for(let pe=0;pe<le;pe++){const z=$.getViewport(pe);o.set(s.x*z.x,s.y*z.y,s.x*z.z,s.y*z.w),D.viewport(o),$.updateMatrices(q,pe),r=$.getFrustum(),M(C,P,$.camera,q,this.type)}$.isPointLightShadow!==!0&&this.type===Ca&&w($,P),$.needsUpdate=!1}x.needsUpdate=!1,n.setRenderTarget(R,T,L)};function w(E,C){const P=e.update(y);p.defines.VSM_SAMPLES!==E.blurSamples&&(p.defines.VSM_SAMPLES=E.blurSamples,g.defines.VSM_SAMPLES=E.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),E.mapPass===null&&(E.mapPass=new qr(i.x,i.y)),p.uniforms.shadow_pass.value=E.map.texture,p.uniforms.resolution.value=E.mapSize,p.uniforms.radius.value=E.radius,n.setRenderTarget(E.mapPass),n.clear(),n.renderBufferDirect(C,null,P,p,y,null),g.uniforms.shadow_pass.value=E.mapPass.texture,g.uniforms.resolution.value=E.mapSize,g.uniforms.radius.value=E.radius,n.setRenderTarget(E.map),n.clear(),n.renderBufferDirect(C,null,P,g,y,null)}function _(E,C,P,R,T,L){let D=null;const Y=P.isPointLight===!0?E.customDistanceMaterial:E.customDepthMaterial;if(Y!==void 0?D=Y:D=P.isPointLight===!0?c:a,n.localClippingEnabled&&C.clipShadows===!0&&Array.isArray(C.clippingPlanes)&&C.clippingPlanes.length!==0||C.displacementMap&&C.displacementScale!==0||C.alphaMap&&C.alphaTest>0){const fe=D.uuid,q=C.uuid;let $=f[fe];$===void 0&&($={},f[fe]=$);let se=$[q];se===void 0&&(se=D.clone(),$[q]=se),D=se}return D.visible=C.visible,D.wireframe=C.wireframe,L===Ca?D.side=C.shadowSide!==null?C.shadowSide:C.side:D.side=C.shadowSide!==null?C.shadowSide:h[C.side],D.alphaMap=C.alphaMap,D.alphaTest=C.alphaTest,D.clipShadows=C.clipShadows,D.clippingPlanes=C.clippingPlanes,D.clipIntersection=C.clipIntersection,D.displacementMap=C.displacementMap,D.displacementScale=C.displacementScale,D.displacementBias=C.displacementBias,D.wireframeLinewidth=C.wireframeLinewidth,D.linewidth=C.linewidth,P.isPointLight===!0&&D.isMeshDistanceMaterial===!0&&(D.referencePosition.setFromMatrixPosition(P.matrixWorld),D.nearDistance=R,D.farDistance=T),D}function M(E,C,P,R,T){if(E.visible===!1)return;if(E.layers.test(C.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&T===Ca)&&(!E.frustumCulled||r.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,E.matrixWorld);const Y=e.update(E),fe=E.material;if(Array.isArray(fe)){const q=Y.groups;for(let $=0,se=q.length;$<se;$++){const le=q[$],pe=fe[le.materialIndex];if(pe&&pe.visible){const z=_(E,pe,R,P.near,P.far,T);n.renderBufferDirect(P,null,Y,z,E,le)}}}else if(fe.visible){const q=_(E,fe,R,P.near,P.far,T);n.renderBufferDirect(P,null,Y,q,E,null)}}const D=E.children;for(let Y=0,fe=D.length;Y<fe;Y++)M(D[Y],C,P,R,T)}}function mW(n,e,t){const r=t.isWebGL2;function i(){let U=!1;const de=new Ht;let ie=null;const ee=new Ht(0,0,0,0);return{setMask:function(ye){ie!==ye&&!U&&(n.colorMask(ye,ye,ye,ye),ie=ye)},setLocked:function(ye){U=ye},setClear:function(ye,Ae,Oe,Ye,bt){bt===!0&&(ye*=Ye,Ae*=Ye,Oe*=Ye),de.set(ye,Ae,Oe,Ye),ee.equals(de)===!1&&(n.clearColor(ye,Ae,Oe,Ye),ee.copy(de))},reset:function(){U=!1,ie=null,ee.set(-1,0,0,0)}}}function s(){let U=!1,de=null,ie=null,ee=null;return{setTest:function(ye){ye?Te(2929):Ce(2929)},setMask:function(ye){de!==ye&&!U&&(n.depthMask(ye),de=ye)},setFunc:function(ye){if(ie!==ye){switch(ye){case MR:n.depthFunc(512);break;case bR:n.depthFunc(519);break;case ER:n.depthFunc(513);break;case rg:n.depthFunc(515);break;case TR:n.depthFunc(514);break;case CR:n.depthFunc(518);break;case AR:n.depthFunc(516);break;case PR:n.depthFunc(517);break;default:n.depthFunc(515)}ie=ye}},setLocked:function(ye){U=ye},setClear:function(ye){ee!==ye&&(n.clearDepth(ye),ee=ye)},reset:function(){U=!1,de=null,ie=null,ee=null}}}function o(){let U=!1,de=null,ie=null,ee=null,ye=null,Ae=null,Oe=null,Ye=null,bt=null;return{setTest:function(_t){U||(_t?Te(2960):Ce(2960))},setMask:function(_t){de!==_t&&!U&&(n.stencilMask(_t),de=_t)},setFunc:function(_t,Ft,$t){(ie!==_t||ee!==Ft||ye!==$t)&&(n.stencilFunc(_t,Ft,$t),ie=_t,ee=Ft,ye=$t)},setOp:function(_t,Ft,$t){(Ae!==_t||Oe!==Ft||Ye!==$t)&&(n.stencilOp(_t,Ft,$t),Ae=_t,Oe=Ft,Ye=$t)},setLocked:function(_t){U=_t},setClear:function(_t){bt!==_t&&(n.clearStencil(_t),bt=_t)},reset:function(){U=!1,de=null,ie=null,ee=null,ye=null,Ae=null,Oe=null,Ye=null,bt=null}}}const a=new i,c=new s,f=new o,d=new WeakMap,h=new WeakMap;let p={},g={},v=new WeakMap,y=[],x=null,w=!1,_=null,M=null,E=null,C=null,P=null,R=null,T=null,L=!1,D=null,Y=null,fe=null,q=null,$=null;const se=n.getParameter(35661);let le=!1,pe=0;const z=n.getParameter(7938);z.indexOf("WebGL")!==-1?(pe=parseFloat(/^WebGL (\d)/.exec(z)[1]),le=pe>=1):z.indexOf("OpenGL ES")!==-1&&(pe=parseFloat(/^OpenGL ES (\d)/.exec(z)[1]),le=pe>=2);let F=null,G={};const Z=n.getParameter(3088),k=n.getParameter(2978),W=new Ht().fromArray(Z),N=new Ht().fromArray(k);function me(U,de,ie){const ee=new Uint8Array(4),ye=n.createTexture();n.bindTexture(U,ye),n.texParameteri(U,10241,9728),n.texParameteri(U,10240,9728);for(let Ae=0;Ae<ie;Ae++)n.texImage2D(de+Ae,0,6408,1,1,0,6408,5121,ee);return ye}const X={};X[3553]=me(3553,3553,1),X[34067]=me(34067,34069,6),a.setClear(0,0,0,1),c.setClear(1),f.setClear(0),Te(2929),c.setFunc(rg),Le(!1),qe(sx),Te(2884),Ee(Gs);function Te(U){p[U]!==!0&&(n.enable(U),p[U]=!0)}function Ce(U){p[U]!==!1&&(n.disable(U),p[U]=!1)}function we(U,de){return g[U]!==de?(n.bindFramebuffer(U,de),g[U]=de,r&&(U===36009&&(g[36160]=de),U===36160&&(g[36009]=de)),!0):!1}function be(U,de){let ie=y,ee=!1;if(U)if(ie=v.get(de),ie===void 0&&(ie=[],v.set(de,ie)),U.isWebGLMultipleRenderTargets){const ye=U.texture;if(ie.length!==ye.length||ie[0]!==36064){for(let Ae=0,Oe=ye.length;Ae<Oe;Ae++)ie[Ae]=36064+Ae;ie.length=ye.length,ee=!0}}else ie[0]!==36064&&(ie[0]=36064,ee=!0);else ie[0]!==1029&&(ie[0]=1029,ee=!0);ee&&(t.isWebGL2?n.drawBuffers(ie):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(ie))}function He(U){return x!==U?(n.useProgram(U),x=U,!0):!1}const ue={[Sa]:32774,[dR]:32778,[hR]:32779};if(r)ue[ux]=32775,ue[cx]=32776;else{const U=e.get("EXT_blend_minmax");U!==null&&(ue[ux]=U.MIN_EXT,ue[cx]=U.MAX_EXT)}const ne={[pR]:0,[mR]:1,[gR]:768,[oS]:770,[wR]:776,[xR]:774,[yR]:772,[vR]:769,[aS]:771,[SR]:775,[_R]:773};function Ee(U,de,ie,ee,ye,Ae,Oe,Ye){if(U===Gs){w===!0&&(Ce(3042),w=!1);return}if(w===!1&&(Te(3042),w=!0),U!==fR){if(U!==_||Ye!==L){if((M!==Sa||P!==Sa)&&(n.blendEquation(32774),M=Sa,P=Sa),Ye)switch(U){case za:n.blendFuncSeparate(1,771,1,771);break;case ox:n.blendFunc(1,1);break;case ax:n.blendFuncSeparate(0,769,0,1);break;case lx:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",U);break}else switch(U){case za:n.blendFuncSeparate(770,771,1,771);break;case ox:n.blendFunc(770,1);break;case ax:n.blendFuncSeparate(0,769,0,1);break;case lx:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",U);break}E=null,C=null,R=null,T=null,_=U,L=Ye}return}ye=ye||de,Ae=Ae||ie,Oe=Oe||ee,(de!==M||ye!==P)&&(n.blendEquationSeparate(ue[de],ue[ye]),M=de,P=ye),(ie!==E||ee!==C||Ae!==R||Oe!==T)&&(n.blendFuncSeparate(ne[ie],ne[ee],ne[Ae],ne[Oe]),E=ie,C=ee,R=Ae,T=Oe),_=U,L=null}function Ue(U,de){U.side===ki?Ce(2884):Te(2884);let ie=U.side===jr;de&&(ie=!ie),Le(ie),U.blending===za&&U.transparent===!1?Ee(Gs):Ee(U.blending,U.blendEquation,U.blendSrc,U.blendDst,U.blendEquationAlpha,U.blendSrcAlpha,U.blendDstAlpha,U.premultipliedAlpha),c.setFunc(U.depthFunc),c.setTest(U.depthTest),c.setMask(U.depthWrite),a.setMask(U.colorWrite);const ee=U.stencilWrite;f.setTest(ee),ee&&(f.setMask(U.stencilWriteMask),f.setFunc(U.stencilFunc,U.stencilRef,U.stencilFuncMask),f.setOp(U.stencilFail,U.stencilZFail,U.stencilZPass)),tt(U.polygonOffset,U.polygonOffsetFactor,U.polygonOffsetUnits),U.alphaToCoverage===!0?Te(32926):Ce(32926)}function Le(U){D!==U&&(U?n.frontFace(2304):n.frontFace(2305),D=U)}function qe(U){U!==lR?(Te(2884),U!==Y&&(U===sx?n.cullFace(1029):U===uR?n.cullFace(1028):n.cullFace(1032))):Ce(2884),Y=U}function et(U){U!==fe&&(le&&n.lineWidth(U),fe=U)}function tt(U,de,ie){U?(Te(32823),(q!==de||$!==ie)&&(n.polygonOffset(de,ie),q=de,$=ie)):Ce(32823)}function Ct(U){U?Te(3089):Ce(3089)}function Nt(U){U===void 0&&(U=33984+se-1),F!==U&&(n.activeTexture(U),F=U)}function H(U,de,ie){ie===void 0&&(F===null?ie=33984+se-1:ie=F);let ee=G[ie];ee===void 0&&(ee={type:void 0,texture:void 0},G[ie]=ee),(ee.type!==U||ee.texture!==de)&&(F!==ie&&(n.activeTexture(ie),F=ie),n.bindTexture(U,de||X[U]),ee.type=U,ee.texture=de)}function O(){const U=G[F];U!==void 0&&U.type!==void 0&&(n.bindTexture(U.type,null),U.type=void 0,U.texture=void 0)}function ce(){try{n.compressedTexImage2D.apply(n,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function Pe(){try{n.texSubImage2D.apply(n,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function Ne(){try{n.texSubImage3D.apply(n,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function ze(){try{n.compressedTexSubImage2D.apply(n,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function st(){try{n.texStorage2D.apply(n,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function Be(){try{n.texStorage3D.apply(n,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function Se(){try{n.texImage2D.apply(n,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function Je(){try{n.texImage3D.apply(n,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function ot(U){W.equals(U)===!1&&(n.scissor(U.x,U.y,U.z,U.w),W.copy(U))}function Ze(U){N.equals(U)===!1&&(n.viewport(U.x,U.y,U.z,U.w),N.copy(U))}function it(U,de){let ie=h.get(de);ie===void 0&&(ie=new WeakMap,h.set(de,ie));let ee=ie.get(U);ee===void 0&&(ee=n.getUniformBlockIndex(de,U.name),ie.set(U,ee))}function Q(U,de){const ee=h.get(de).get(U);d.get(U)!==ee&&(n.uniformBlockBinding(de,ee,U.__bindingPointIndex),d.set(U,ee))}function j(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),r===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),p={},F=null,G={},g={},v=new WeakMap,y=[],x=null,w=!1,_=null,M=null,E=null,C=null,P=null,R=null,T=null,L=!1,D=null,Y=null,fe=null,q=null,$=null,W.set(0,0,n.canvas.width,n.canvas.height),N.set(0,0,n.canvas.width,n.canvas.height),a.reset(),c.reset(),f.reset()}return{buffers:{color:a,depth:c,stencil:f},enable:Te,disable:Ce,bindFramebuffer:we,drawBuffers:be,useProgram:He,setBlending:Ee,setMaterial:Ue,setFlipSided:Le,setCullFace:qe,setLineWidth:et,setPolygonOffset:tt,setScissorTest:Ct,activeTexture:Nt,bindTexture:H,unbindTexture:O,compressedTexImage2D:ce,texImage2D:Se,texImage3D:Je,updateUBOMapping:it,uniformBlockBinding:Q,texStorage2D:st,texStorage3D:Be,texSubImage2D:Pe,texSubImage3D:Ne,compressedTexSubImage2D:ze,scissor:ot,viewport:Ze,reset:j}}function gW(n,e,t,r,i,s,o){const a=i.isWebGL2,c=i.maxTextures,f=i.maxCubemapSize,d=i.maxTextureSize,h=i.maxSamples,p=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,g=/OculusBrowser/g.test(navigator.userAgent),v=new WeakMap;let y;const x=new WeakMap;let w=!1;try{w=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(H,O){return w?new OffscreenCanvas(H,O):jf("canvas")}function M(H,O,ce,Pe){let Ne=1;if((H.width>Pe||H.height>Pe)&&(Ne=Pe/Math.max(H.width,H.height)),Ne<1||O===!0)if(typeof HTMLImageElement!="undefined"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&H instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&H instanceof ImageBitmap){const ze=O?ag:Math.floor,st=ze(Ne*H.width),Be=ze(Ne*H.height);y===void 0&&(y=_(st,Be));const Se=ce?_(st,Be):y;return Se.width=st,Se.height=Be,Se.getContext("2d").drawImage(H,0,0,st,Be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+st+"x"+Be+")."),Se}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function E(H){return Nx(H.width)&&Nx(H.height)}function C(H){return a?!1:H.wrapS!==pr||H.wrapT!==pr||H.minFilter!==En&&H.minFilter!==un}function P(H,O){return H.generateMipmaps&&O&&H.minFilter!==En&&H.minFilter!==un}function R(H){n.generateMipmap(H)}function T(H,O,ce,Pe,Ne=!1){if(a===!1)return O;if(H!==null){if(n[H]!==void 0)return n[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let ze=O;return O===6403&&(ce===5126&&(ze=33326),ce===5131&&(ze=33325),ce===5121&&(ze=33321)),O===33319&&(ce===5126&&(ze=33328),ce===5131&&(ze=33327),ce===5121&&(ze=33323)),O===6408&&(ce===5126&&(ze=34836),ce===5131&&(ze=34842),ce===5121&&(ze=Pe===Kt&&Ne===!1?35907:32856),ce===32819&&(ze=32854),ce===32820&&(ze=32855)),(ze===33325||ze===33326||ze===33327||ze===33328||ze===34842||ze===34836)&&e.get("EXT_color_buffer_float"),ze}function L(H,O,ce){return P(H,ce)===!0||H.isFramebufferTexture&&H.minFilter!==En&&H.minFilter!==un?Math.log2(Math.max(O.width,O.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?O.mipmaps.length:1}function D(H){return H===En||H===ig||H===sg?9728:9729}function Y(H){const O=H.target;O.removeEventListener("dispose",Y),q(O),O.isVideoTexture&&v.delete(O)}function fe(H){const O=H.target;O.removeEventListener("dispose",fe),se(O)}function q(H){const O=r.get(H);if(O.__webglInit===void 0)return;const ce=H.source,Pe=x.get(ce);if(Pe){const Ne=Pe[O.__cacheKey];Ne.usedTimes--,Ne.usedTimes===0&&$(H),Object.keys(Pe).length===0&&x.delete(ce)}r.remove(H)}function $(H){const O=r.get(H);n.deleteTexture(O.__webglTexture);const ce=H.source,Pe=x.get(ce);delete Pe[O.__cacheKey],o.memory.textures--}function se(H){const O=H.texture,ce=r.get(H),Pe=r.get(O);if(Pe.__webglTexture!==void 0&&(n.deleteTexture(Pe.__webglTexture),o.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let Ne=0;Ne<6;Ne++)n.deleteFramebuffer(ce.__webglFramebuffer[Ne]),ce.__webglDepthbuffer&&n.deleteRenderbuffer(ce.__webglDepthbuffer[Ne]);else{if(n.deleteFramebuffer(ce.__webglFramebuffer),ce.__webglDepthbuffer&&n.deleteRenderbuffer(ce.__webglDepthbuffer),ce.__webglMultisampledFramebuffer&&n.deleteFramebuffer(ce.__webglMultisampledFramebuffer),ce.__webglColorRenderbuffer)for(let Ne=0;Ne<ce.__webglColorRenderbuffer.length;Ne++)ce.__webglColorRenderbuffer[Ne]&&n.deleteRenderbuffer(ce.__webglColorRenderbuffer[Ne]);ce.__webglDepthRenderbuffer&&n.deleteRenderbuffer(ce.__webglDepthRenderbuffer)}if(H.isWebGLMultipleRenderTargets)for(let Ne=0,ze=O.length;Ne<ze;Ne++){const st=r.get(O[Ne]);st.__webglTexture&&(n.deleteTexture(st.__webglTexture),o.memory.textures--),r.remove(O[Ne])}r.remove(O),r.remove(H)}let le=0;function pe(){le=0}function z(){const H=le;return H>=c&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+c),le+=1,H}function F(H){const O=[];return O.push(H.wrapS),O.push(H.wrapT),O.push(H.magFilter),O.push(H.minFilter),O.push(H.anisotropy),O.push(H.internalFormat),O.push(H.format),O.push(H.type),O.push(H.generateMipmaps),O.push(H.premultiplyAlpha),O.push(H.flipY),O.push(H.unpackAlignment),O.push(H.encoding),O.join()}function G(H,O){const ce=r.get(H);if(H.isVideoTexture&&Ct(H),H.isRenderTargetTexture===!1&&H.version>0&&ce.__version!==H.version){const Pe=H.image;if(Pe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Pe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ce(ce,H,O);return}}t.bindTexture(3553,ce.__webglTexture,33984+O)}function Z(H,O){const ce=r.get(H);if(H.version>0&&ce.__version!==H.version){Ce(ce,H,O);return}t.bindTexture(35866,ce.__webglTexture,33984+O)}function k(H,O){const ce=r.get(H);if(H.version>0&&ce.__version!==H.version){Ce(ce,H,O);return}t.bindTexture(32879,ce.__webglTexture,33984+O)}function W(H,O){const ce=r.get(H);if(H.version>0&&ce.__version!==H.version){we(ce,H,O);return}t.bindTexture(34067,ce.__webglTexture,33984+O)}const N={[Uf]:10497,[pr]:33071,[Bf]:33648},me={[En]:9728,[ig]:9984,[sg]:9986,[un]:9729,[uS]:9985,[sl]:9987};function X(H,O,ce){if(ce?(n.texParameteri(H,10242,N[O.wrapS]),n.texParameteri(H,10243,N[O.wrapT]),(H===32879||H===35866)&&n.texParameteri(H,32882,N[O.wrapR]),n.texParameteri(H,10240,me[O.magFilter]),n.texParameteri(H,10241,me[O.minFilter])):(n.texParameteri(H,10242,33071),n.texParameteri(H,10243,33071),(H===32879||H===35866)&&n.texParameteri(H,32882,33071),(O.wrapS!==pr||O.wrapT!==pr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(H,10240,D(O.magFilter)),n.texParameteri(H,10241,D(O.minFilter)),O.minFilter!==En&&O.minFilter!==un&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Pe=e.get("EXT_texture_filter_anisotropic");if(O.type===os&&e.has("OES_texture_float_linear")===!1||a===!1&&O.type===Za&&e.has("OES_texture_half_float_linear")===!1)return;(O.anisotropy>1||r.get(O).__currentAnisotropy)&&(n.texParameterf(H,Pe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,i.getMaxAnisotropy())),r.get(O).__currentAnisotropy=O.anisotropy)}}function Te(H,O){let ce=!1;H.__webglInit===void 0&&(H.__webglInit=!0,O.addEventListener("dispose",Y));const Pe=O.source;let Ne=x.get(Pe);Ne===void 0&&(Ne={},x.set(Pe,Ne));const ze=F(O);if(ze!==H.__cacheKey){Ne[ze]===void 0&&(Ne[ze]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ce=!0),Ne[ze].usedTimes++;const st=Ne[H.__cacheKey];st!==void 0&&(Ne[H.__cacheKey].usedTimes--,st.usedTimes===0&&$(O)),H.__cacheKey=ze,H.__webglTexture=Ne[ze].texture}return ce}function Ce(H,O,ce){let Pe=3553;O.isDataArrayTexture&&(Pe=35866),O.isData3DTexture&&(Pe=32879);const Ne=Te(H,O),ze=O.source;t.bindTexture(Pe,H.__webglTexture,33984+ce);const st=r.get(ze);if(ze.version!==st.__version||Ne===!0){t.activeTexture(33984+ce),n.pixelStorei(37440,O.flipY),n.pixelStorei(37441,O.premultiplyAlpha),n.pixelStorei(3317,O.unpackAlignment),n.pixelStorei(37443,0);const Be=C(O)&&E(O.image)===!1;let Se=M(O.image,Be,!1,d);Se=Nt(O,Se);const Je=E(Se)||a,ot=s.convert(O.format,O.encoding);let Ze=s.convert(O.type),it=T(O.internalFormat,ot,Ze,O.encoding,O.isVideoTexture);X(Pe,O,Je);let Q;const j=O.mipmaps,U=a&&O.isVideoTexture!==!0,de=st.__version===void 0||Ne===!0,ie=L(O,Se,Je);if(O.isDepthTexture)it=6402,a?O.type===os?it=36012:O.type===Ao?it=33190:O.type===Fa?it=35056:it=33189:O.type===os&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),O.format===Fo&&it===6402&&O.type!==cS&&O.type!==Ao&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),O.type=Ao,Ze=s.convert(O.type)),O.format===Qa&&it===6402&&(it=34041,O.type!==Fa&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),O.type=Fa,Ze=s.convert(O.type))),de&&(U?t.texStorage2D(3553,1,it,Se.width,Se.height):t.texImage2D(3553,0,it,Se.width,Se.height,0,ot,Ze,null));else if(O.isDataTexture)if(j.length>0&&Je){U&&de&&t.texStorage2D(3553,ie,it,j[0].width,j[0].height);for(let ee=0,ye=j.length;ee<ye;ee++)Q=j[ee],U?t.texSubImage2D(3553,ee,0,0,Q.width,Q.height,ot,Ze,Q.data):t.texImage2D(3553,ee,it,Q.width,Q.height,0,ot,Ze,Q.data);O.generateMipmaps=!1}else U?(de&&t.texStorage2D(3553,ie,it,Se.width,Se.height),t.texSubImage2D(3553,0,0,0,Se.width,Se.height,ot,Ze,Se.data)):t.texImage2D(3553,0,it,Se.width,Se.height,0,ot,Ze,Se.data);else if(O.isCompressedTexture){U&&de&&t.texStorage2D(3553,ie,it,j[0].width,j[0].height);for(let ee=0,ye=j.length;ee<ye;ee++)Q=j[ee],O.format!==_i?ot!==null?U?t.compressedTexSubImage2D(3553,ee,0,0,Q.width,Q.height,ot,Q.data):t.compressedTexImage2D(3553,ee,it,Q.width,Q.height,0,Q.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):U?t.texSubImage2D(3553,ee,0,0,Q.width,Q.height,ot,Ze,Q.data):t.texImage2D(3553,ee,it,Q.width,Q.height,0,ot,Ze,Q.data)}else if(O.isDataArrayTexture)U?(de&&t.texStorage3D(35866,ie,it,Se.width,Se.height,Se.depth),t.texSubImage3D(35866,0,0,0,0,Se.width,Se.height,Se.depth,ot,Ze,Se.data)):t.texImage3D(35866,0,it,Se.width,Se.height,Se.depth,0,ot,Ze,Se.data);else if(O.isData3DTexture)U?(de&&t.texStorage3D(32879,ie,it,Se.width,Se.height,Se.depth),t.texSubImage3D(32879,0,0,0,0,Se.width,Se.height,Se.depth,ot,Ze,Se.data)):t.texImage3D(32879,0,it,Se.width,Se.height,Se.depth,0,ot,Ze,Se.data);else if(O.isFramebufferTexture){if(de)if(U)t.texStorage2D(3553,ie,it,Se.width,Se.height);else{let ee=Se.width,ye=Se.height;for(let Ae=0;Ae<ie;Ae++)t.texImage2D(3553,Ae,it,ee,ye,0,ot,Ze,null),ee>>=1,ye>>=1}}else if(j.length>0&&Je){U&&de&&t.texStorage2D(3553,ie,it,j[0].width,j[0].height);for(let ee=0,ye=j.length;ee<ye;ee++)Q=j[ee],U?t.texSubImage2D(3553,ee,0,0,ot,Ze,Q):t.texImage2D(3553,ee,it,ot,Ze,Q);O.generateMipmaps=!1}else U?(de&&t.texStorage2D(3553,ie,it,Se.width,Se.height),t.texSubImage2D(3553,0,0,0,ot,Ze,Se)):t.texImage2D(3553,0,it,ot,Ze,Se);P(O,Je)&&R(Pe),st.__version=ze.version,O.onUpdate&&O.onUpdate(O)}H.__version=O.version}function we(H,O,ce){if(O.image.length!==6)return;const Pe=Te(H,O),Ne=O.source;t.bindTexture(34067,H.__webglTexture,33984+ce);const ze=r.get(Ne);if(Ne.version!==ze.__version||Pe===!0){t.activeTexture(33984+ce),n.pixelStorei(37440,O.flipY),n.pixelStorei(37441,O.premultiplyAlpha),n.pixelStorei(3317,O.unpackAlignment),n.pixelStorei(37443,0);const st=O.isCompressedTexture||O.image[0].isCompressedTexture,Be=O.image[0]&&O.image[0].isDataTexture,Se=[];for(let ee=0;ee<6;ee++)!st&&!Be?Se[ee]=M(O.image[ee],!1,!0,f):Se[ee]=Be?O.image[ee].image:O.image[ee],Se[ee]=Nt(O,Se[ee]);const Je=Se[0],ot=E(Je)||a,Ze=s.convert(O.format,O.encoding),it=s.convert(O.type),Q=T(O.internalFormat,Ze,it,O.encoding),j=a&&O.isVideoTexture!==!0,U=ze.__version===void 0||Pe===!0;let de=L(O,Je,ot);X(34067,O,ot);let ie;if(st){j&&U&&t.texStorage2D(34067,de,Q,Je.width,Je.height);for(let ee=0;ee<6;ee++){ie=Se[ee].mipmaps;for(let ye=0;ye<ie.length;ye++){const Ae=ie[ye];O.format!==_i?Ze!==null?j?t.compressedTexSubImage2D(34069+ee,ye,0,0,Ae.width,Ae.height,Ze,Ae.data):t.compressedTexImage2D(34069+ee,ye,Q,Ae.width,Ae.height,0,Ae.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):j?t.texSubImage2D(34069+ee,ye,0,0,Ae.width,Ae.height,Ze,it,Ae.data):t.texImage2D(34069+ee,ye,Q,Ae.width,Ae.height,0,Ze,it,Ae.data)}}}else{ie=O.mipmaps,j&&U&&(ie.length>0&&de++,t.texStorage2D(34067,de,Q,Se[0].width,Se[0].height));for(let ee=0;ee<6;ee++)if(Be){j?t.texSubImage2D(34069+ee,0,0,0,Se[ee].width,Se[ee].height,Ze,it,Se[ee].data):t.texImage2D(34069+ee,0,Q,Se[ee].width,Se[ee].height,0,Ze,it,Se[ee].data);for(let ye=0;ye<ie.length;ye++){const Oe=ie[ye].image[ee].image;j?t.texSubImage2D(34069+ee,ye+1,0,0,Oe.width,Oe.height,Ze,it,Oe.data):t.texImage2D(34069+ee,ye+1,Q,Oe.width,Oe.height,0,Ze,it,Oe.data)}}else{j?t.texSubImage2D(34069+ee,0,0,0,Ze,it,Se[ee]):t.texImage2D(34069+ee,0,Q,Ze,it,Se[ee]);for(let ye=0;ye<ie.length;ye++){const Ae=ie[ye];j?t.texSubImage2D(34069+ee,ye+1,0,0,Ze,it,Ae.image[ee]):t.texImage2D(34069+ee,ye+1,Q,Ze,it,Ae.image[ee])}}}P(O,ot)&&R(34067),ze.__version=Ne.version,O.onUpdate&&O.onUpdate(O)}H.__version=O.version}function be(H,O,ce,Pe,Ne){const ze=s.convert(ce.format,ce.encoding),st=s.convert(ce.type),Be=T(ce.internalFormat,ze,st,ce.encoding);r.get(O).__hasExternalTextures||(Ne===32879||Ne===35866?t.texImage3D(Ne,0,Be,O.width,O.height,O.depth,0,ze,st,null):t.texImage2D(Ne,0,Be,O.width,O.height,0,ze,st,null)),t.bindFramebuffer(36160,H),tt(O)?p.framebufferTexture2DMultisampleEXT(36160,Pe,Ne,r.get(ce).__webglTexture,0,et(O)):n.framebufferTexture2D(36160,Pe,Ne,r.get(ce).__webglTexture,0),t.bindFramebuffer(36160,null)}function He(H,O,ce){if(n.bindRenderbuffer(36161,H),O.depthBuffer&&!O.stencilBuffer){let Pe=33189;if(ce||tt(O)){const Ne=O.depthTexture;Ne&&Ne.isDepthTexture&&(Ne.type===os?Pe=36012:Ne.type===Ao&&(Pe=33190));const ze=et(O);tt(O)?p.renderbufferStorageMultisampleEXT(36161,ze,Pe,O.width,O.height):n.renderbufferStorageMultisample(36161,ze,Pe,O.width,O.height)}else n.renderbufferStorage(36161,Pe,O.width,O.height);n.framebufferRenderbuffer(36160,36096,36161,H)}else if(O.depthBuffer&&O.stencilBuffer){const Pe=et(O);ce&&tt(O)===!1?n.renderbufferStorageMultisample(36161,Pe,35056,O.width,O.height):tt(O)?p.renderbufferStorageMultisampleEXT(36161,Pe,35056,O.width,O.height):n.renderbufferStorage(36161,34041,O.width,O.height),n.framebufferRenderbuffer(36160,33306,36161,H)}else{const Pe=O.isWebGLMultipleRenderTargets===!0?O.texture:[O.texture];for(let Ne=0;Ne<Pe.length;Ne++){const ze=Pe[Ne],st=s.convert(ze.format,ze.encoding),Be=s.convert(ze.type),Se=T(ze.internalFormat,st,Be,ze.encoding),Je=et(O);ce&&tt(O)===!1?n.renderbufferStorageMultisample(36161,Je,Se,O.width,O.height):tt(O)?p.renderbufferStorageMultisampleEXT(36161,Je,Se,O.width,O.height):n.renderbufferStorage(36161,Se,O.width,O.height)}}n.bindRenderbuffer(36161,null)}function ue(H,O){if(O&&O.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,H),!(O.depthTexture&&O.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(O.depthTexture).__webglTexture||O.depthTexture.image.width!==O.width||O.depthTexture.image.height!==O.height)&&(O.depthTexture.image.width=O.width,O.depthTexture.image.height=O.height,O.depthTexture.needsUpdate=!0),G(O.depthTexture,0);const Pe=r.get(O.depthTexture).__webglTexture,Ne=et(O);if(O.depthTexture.format===Fo)tt(O)?p.framebufferTexture2DMultisampleEXT(36160,36096,3553,Pe,0,Ne):n.framebufferTexture2D(36160,36096,3553,Pe,0);else if(O.depthTexture.format===Qa)tt(O)?p.framebufferTexture2DMultisampleEXT(36160,33306,3553,Pe,0,Ne):n.framebufferTexture2D(36160,33306,3553,Pe,0);else throw new Error("Unknown depthTexture format")}function ne(H){const O=r.get(H),ce=H.isWebGLCubeRenderTarget===!0;if(H.depthTexture&&!O.__autoAllocateDepthBuffer){if(ce)throw new Error("target.depthTexture not supported in Cube render targets");ue(O.__webglFramebuffer,H)}else if(ce){O.__webglDepthbuffer=[];for(let Pe=0;Pe<6;Pe++)t.bindFramebuffer(36160,O.__webglFramebuffer[Pe]),O.__webglDepthbuffer[Pe]=n.createRenderbuffer(),He(O.__webglDepthbuffer[Pe],H,!1)}else t.bindFramebuffer(36160,O.__webglFramebuffer),O.__webglDepthbuffer=n.createRenderbuffer(),He(O.__webglDepthbuffer,H,!1);t.bindFramebuffer(36160,null)}function Ee(H,O,ce){const Pe=r.get(H);O!==void 0&&be(Pe.__webglFramebuffer,H,H.texture,36064,3553),ce!==void 0&&ne(H)}function Ue(H){const O=H.texture,ce=r.get(H),Pe=r.get(O);H.addEventListener("dispose",fe),H.isWebGLMultipleRenderTargets!==!0&&(Pe.__webglTexture===void 0&&(Pe.__webglTexture=n.createTexture()),Pe.__version=O.version,o.memory.textures++);const Ne=H.isWebGLCubeRenderTarget===!0,ze=H.isWebGLMultipleRenderTargets===!0,st=E(H)||a;if(Ne){ce.__webglFramebuffer=[];for(let Be=0;Be<6;Be++)ce.__webglFramebuffer[Be]=n.createFramebuffer()}else{if(ce.__webglFramebuffer=n.createFramebuffer(),ze)if(i.drawBuffers){const Be=H.texture;for(let Se=0,Je=Be.length;Se<Je;Se++){const ot=r.get(Be[Se]);ot.__webglTexture===void 0&&(ot.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(a&&H.samples>0&&tt(H)===!1){const Be=ze?O:[O];ce.__webglMultisampledFramebuffer=n.createFramebuffer(),ce.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,ce.__webglMultisampledFramebuffer);for(let Se=0;Se<Be.length;Se++){const Je=Be[Se];ce.__webglColorRenderbuffer[Se]=n.createRenderbuffer(),n.bindRenderbuffer(36161,ce.__webglColorRenderbuffer[Se]);const ot=s.convert(Je.format,Je.encoding),Ze=s.convert(Je.type),it=T(Je.internalFormat,ot,Ze,Je.encoding,H.isXRRenderTarget===!0),Q=et(H);n.renderbufferStorageMultisample(36161,Q,it,H.width,H.height),n.framebufferRenderbuffer(36160,36064+Se,36161,ce.__webglColorRenderbuffer[Se])}n.bindRenderbuffer(36161,null),H.depthBuffer&&(ce.__webglDepthRenderbuffer=n.createRenderbuffer(),He(ce.__webglDepthRenderbuffer,H,!0)),t.bindFramebuffer(36160,null)}}if(Ne){t.bindTexture(34067,Pe.__webglTexture),X(34067,O,st);for(let Be=0;Be<6;Be++)be(ce.__webglFramebuffer[Be],H,O,36064,34069+Be);P(O,st)&&R(34067),t.unbindTexture()}else if(ze){const Be=H.texture;for(let Se=0,Je=Be.length;Se<Je;Se++){const ot=Be[Se],Ze=r.get(ot);t.bindTexture(3553,Ze.__webglTexture),X(3553,ot,st),be(ce.__webglFramebuffer,H,ot,36064+Se,3553),P(ot,st)&&R(3553)}t.unbindTexture()}else{let Be=3553;(H.isWebGL3DRenderTarget||H.isWebGLArrayRenderTarget)&&(a?Be=H.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(Be,Pe.__webglTexture),X(Be,O,st),be(ce.__webglFramebuffer,H,O,36064,Be),P(O,st)&&R(Be),t.unbindTexture()}H.depthBuffer&&ne(H)}function Le(H){const O=E(H)||a,ce=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let Pe=0,Ne=ce.length;Pe<Ne;Pe++){const ze=ce[Pe];if(P(ze,O)){const st=H.isWebGLCubeRenderTarget?34067:3553,Be=r.get(ze).__webglTexture;t.bindTexture(st,Be),R(st),t.unbindTexture()}}}function qe(H){if(a&&H.samples>0&&tt(H)===!1){const O=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],ce=H.width,Pe=H.height;let Ne=16384;const ze=[],st=H.stencilBuffer?33306:36096,Be=r.get(H),Se=H.isWebGLMultipleRenderTargets===!0;if(Se)for(let Je=0;Je<O.length;Je++)t.bindFramebuffer(36160,Be.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064+Je,36161,null),t.bindFramebuffer(36160,Be.__webglFramebuffer),n.framebufferTexture2D(36009,36064+Je,3553,null,0);t.bindFramebuffer(36008,Be.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,Be.__webglFramebuffer);for(let Je=0;Je<O.length;Je++){ze.push(36064+Je),H.depthBuffer&&ze.push(st);const ot=Be.__ignoreDepthValues!==void 0?Be.__ignoreDepthValues:!1;if(ot===!1&&(H.depthBuffer&&(Ne|=256),H.stencilBuffer&&(Ne|=1024)),Se&&n.framebufferRenderbuffer(36008,36064,36161,Be.__webglColorRenderbuffer[Je]),ot===!0&&(n.invalidateFramebuffer(36008,[st]),n.invalidateFramebuffer(36009,[st])),Se){const Ze=r.get(O[Je]).__webglTexture;n.framebufferTexture2D(36009,36064,3553,Ze,0)}n.blitFramebuffer(0,0,ce,Pe,0,0,ce,Pe,Ne,9728),g&&n.invalidateFramebuffer(36008,ze)}if(t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,null),Se)for(let Je=0;Je<O.length;Je++){t.bindFramebuffer(36160,Be.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064+Je,36161,Be.__webglColorRenderbuffer[Je]);const ot=r.get(O[Je]).__webglTexture;t.bindFramebuffer(36160,Be.__webglFramebuffer),n.framebufferTexture2D(36009,36064+Je,3553,ot,0)}t.bindFramebuffer(36009,Be.__webglMultisampledFramebuffer)}}function et(H){return Math.min(h,H.samples)}function tt(H){const O=r.get(H);return a&&H.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function Ct(H){const O=o.render.frame;v.get(H)!==O&&(v.set(H,O),H.update())}function Nt(H,O){const ce=H.encoding,Pe=H.format,Ne=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===og||ce!==Xs&&(ce===Kt?a===!1?e.has("EXT_sRGB")===!0&&Pe===_i?(H.format=og,H.minFilter=un,H.generateMipmaps=!1):O=hS.sRGBToLinear(O):(Pe!==_i||Ne!==Ho)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",ce)),O}this.allocateTextureUnit=z,this.resetTextureUnits=pe,this.setTexture2D=G,this.setTexture2DArray=Z,this.setTexture3D=k,this.setTextureCube=W,this.rebindTextures=Ee,this.setupRenderTarget=Ue,this.updateRenderTargetMipmap=Le,this.updateMultisampleRenderTarget=qe,this.setupDepthRenderbuffer=ne,this.setupFrameBufferTexture=be,this.useMultisampledRTT=tt}function mL(n,e,t){const r=t.isWebGL2;function i(s,o=null){let a;if(s===Ho)return 5121;if(s===UR)return 32819;if(s===BR)return 32820;if(s===kR)return 5120;if(s===zR)return 5122;if(s===cS)return 5123;if(s===FR)return 5124;if(s===Ao)return 5125;if(s===os)return 5126;if(s===Za)return r?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===VR)return 6406;if(s===_i)return 6408;if(s===HR)return 6409;if(s===WR)return 6410;if(s===Fo)return 6402;if(s===Qa)return 34041;if(s===$R)return 6403;if(s===GR)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===og)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===jR)return 36244;if(s===XR)return 33319;if(s===YR)return 33320;if(s===qR)return 36249;if(s===om||s===am||s===lm||s===um)if(o===Kt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===om)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===am)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===lm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===um)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===om)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===am)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===lm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===um)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===fx||s===dx||s===hx||s===px)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===fx)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===dx)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===hx)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===px)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===ZR)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===mx||s===gx)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===mx)return o===Kt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===gx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===vx||s===yx||s===_x||s===xx||s===Sx||s===wx||s===Mx||s===bx||s===Ex||s===Tx||s===Cx||s===Ax||s===Px||s===Rx)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===vx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===yx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===_x)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===xx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Sx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===wx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Mx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===bx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Ex)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Tx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Cx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Ax)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Px)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Rx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Lx)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===Lx)return o===Kt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return s===Fa?r?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:i}}class gL extends Gn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class du extends Mt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const vW={type:"move"};class Ly{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new du,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 du,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new I,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new I),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new du,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new I,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new I),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}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,r){let i=null,s=null,o=null;const a=this._targetRay,c=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const y of e.hand.values()){const x=t.getJointPose(y,r);if(f.joints[y.jointName]===void 0){const _=new du;_.matrixAutoUpdate=!1,_.visible=!1,f.joints[y.jointName]=_,f.add(_)}const w=f.joints[y.jointName];x!==null&&(w.matrix.fromArray(x.transform.matrix),w.matrix.decompose(w.position,w.rotation,w.scale),w.jointRadius=x.radius),w.visible=x!==null}const d=f.joints["index-finger-tip"],h=f.joints["thumb-tip"],p=d.position.distanceTo(h.position),g=.02,v=.005;f.inputState.pinching&&p>g+v?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&p<=g-v&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(vW)))}return a!==null&&(a.visible=i!==null),c!==null&&(c.visible=s!==null),f!==null&&(f.visible=o!==null),this}}class _S extends Cn{constructor(e,t,r,i,s,o,a,c,f,d){if(d=d!==void 0?d:Fo,d!==Fo&&d!==Qa)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&d===Fo&&(r=Ao),r===void 0&&d===Qa&&(r=Fa),super(null,i,s,o,a,c,d,r,f),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:En,this.minFilter=c!==void 0?c:En,this.flipY=!1,this.generateMipmaps=!1}}class yW extends Zs{constructor(e,t){super();const r=this;let i=null,s=1,o=null,a="local-floor",c=null,f=null,d=null,h=null,p=null,g=null;const v=t.getContextAttributes();let y=null,x=null;const w=[],_=[],M=new Gn;M.layers.enable(1),M.viewport=new Ht;const E=new Gn;E.layers.enable(2),E.viewport=new Ht;const C=[M,E],P=new gL;P.layers.enable(1),P.layers.enable(2);let R=null,T=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(F){let G=w[F];return G===void 0&&(G=new Ly,w[F]=G),G.getTargetRaySpace()},this.getControllerGrip=function(F){let G=w[F];return G===void 0&&(G=new Ly,w[F]=G),G.getGripSpace()},this.getHand=function(F){let G=w[F];return G===void 0&&(G=new Ly,w[F]=G),G.getHandSpace()};function L(F){const G=_.indexOf(F.inputSource);if(G===-1)return;const Z=w[G];Z!==void 0&&Z.dispatchEvent({type:F.type,data:F.inputSource})}function D(){i.removeEventListener("select",L),i.removeEventListener("selectstart",L),i.removeEventListener("selectend",L),i.removeEventListener("squeeze",L),i.removeEventListener("squeezestart",L),i.removeEventListener("squeezeend",L),i.removeEventListener("end",D),i.removeEventListener("inputsourceschange",Y);for(let F=0;F<w.length;F++){const G=_[F];G!==null&&(_[F]=null,w[F].disconnect(G))}R=null,T=null,e.setRenderTarget(y),p=null,h=null,d=null,i=null,x=null,z.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(F){s=F,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(F){a=F,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(F){c=F},this.getBaseLayer=function(){return h!==null?h:p},this.getBinding=function(){return d},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(F){if(i=F,i!==null){if(y=e.getRenderTarget(),i.addEventListener("select",L),i.addEventListener("selectstart",L),i.addEventListener("selectend",L),i.addEventListener("squeeze",L),i.addEventListener("squeezestart",L),i.addEventListener("squeezeend",L),i.addEventListener("end",D),i.addEventListener("inputsourceschange",Y),v.xrCompatible!==!0&&await t.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const G={antialias:i.renderState.layers===void 0?v.antialias:!0,alpha:v.alpha,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:s};p=new XRWebGLLayer(i,t,G),i.updateRenderState({baseLayer:p}),x=new qr(p.framebufferWidth,p.framebufferHeight,{format:_i,type:Ho,encoding:e.outputEncoding,stencilBuffer:v.stencil})}else{let G=null,Z=null,k=null;v.depth&&(k=v.stencil?35056:33190,G=v.stencil?Qa:Fo,Z=v.stencil?Fa:Ao);const W={colorFormat:32856,depthFormat:k,scaleFactor:s};d=new XRWebGLBinding(i,t),h=d.createProjectionLayer(W),i.updateRenderState({layers:[h]}),x=new qr(h.textureWidth,h.textureHeight,{format:_i,type:Ho,depthTexture:new _S(h.textureWidth,h.textureHeight,Z,void 0,void 0,void 0,void 0,void 0,void 0,G),stencilBuffer:v.stencil,encoding:e.outputEncoding,samples:v.antialias?4:0});const N=e.properties.get(x);N.__ignoreDepthValues=h.ignoreDepthValues}x.isXRRenderTarget=!0,this.setFoveation(1),c=null,o=await i.requestReferenceSpace(a),z.setContext(i),z.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}};function Y(F){for(let G=0;G<F.removed.length;G++){const Z=F.removed[G],k=_.indexOf(Z);k>=0&&(_[k]=null,w[k].dispatchEvent({type:"disconnected",data:Z}))}for(let G=0;G<F.added.length;G++){const Z=F.added[G];let k=_.indexOf(Z);if(k===-1){for(let N=0;N<w.length;N++)if(N>=_.length){_.push(Z),k=N;break}else if(_[N]===null){_[N]=Z,k=N;break}if(k===-1)break}const W=w[k];W&&W.dispatchEvent({type:"connected",data:Z})}}const fe=new I,q=new I;function $(F,G,Z){fe.setFromMatrixPosition(G.matrixWorld),q.setFromMatrixPosition(Z.matrixWorld);const k=fe.distanceTo(q),W=G.projectionMatrix.elements,N=Z.projectionMatrix.elements,me=W[14]/(W[10]-1),X=W[14]/(W[10]+1),Te=(W[9]+1)/W[5],Ce=(W[9]-1)/W[5],we=(W[8]-1)/W[0],be=(N[8]+1)/N[0],He=me*we,ue=me*be,ne=k/(-we+be),Ee=ne*-we;G.matrixWorld.decompose(F.position,F.quaternion,F.scale),F.translateX(Ee),F.translateZ(ne),F.matrixWorld.compose(F.position,F.quaternion,F.scale),F.matrixWorldInverse.copy(F.matrixWorld).invert();const Ue=me+ne,Le=X+ne,qe=He-Ee,et=ue+(k-Ee),tt=Te*X/Le*Ue,Ct=Ce*X/Le*Ue;F.projectionMatrix.makePerspective(qe,et,tt,Ct,Ue,Le)}function se(F,G){G===null?F.matrixWorld.copy(F.matrix):F.matrixWorld.multiplyMatrices(G.matrixWorld,F.matrix),F.matrixWorldInverse.copy(F.matrixWorld).invert()}this.updateCamera=function(F){if(i===null)return;P.near=E.near=M.near=F.near,P.far=E.far=M.far=F.far,(R!==P.near||T!==P.far)&&(i.updateRenderState({depthNear:P.near,depthFar:P.far}),R=P.near,T=P.far);const G=F.parent,Z=P.cameras;se(P,G);for(let W=0;W<Z.length;W++)se(Z[W],G);P.matrixWorld.decompose(P.position,P.quaternion,P.scale),F.matrix.copy(P.matrix),F.matrix.decompose(F.position,F.quaternion,F.scale);const k=F.children;for(let W=0,N=k.length;W<N;W++)k[W].updateMatrixWorld(!0);Z.length===2?$(P,M,E):P.projectionMatrix.copy(M.projectionMatrix)},this.getCamera=function(){return P},this.getFoveation=function(){if(h!==null)return h.fixedFoveation;if(p!==null)return p.fixedFoveation},this.setFoveation=function(F){h!==null&&(h.fixedFoveation=F),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=F)};let le=null;function pe(F,G){if(f=G.getViewerPose(c||o),g=G,f!==null){const Z=f.views;p!==null&&(e.setRenderTargetFramebuffer(x,p.framebuffer),e.setRenderTarget(x));let k=!1;Z.length!==P.cameras.length&&(P.cameras.length=0,k=!0);for(let W=0;W<Z.length;W++){const N=Z[W];let me=null;if(p!==null)me=p.getViewport(N);else{const Te=d.getViewSubImage(h,N);me=Te.viewport,W===0&&(e.setRenderTargetTextures(x,Te.colorTexture,h.ignoreDepthValues?void 0:Te.depthStencilTexture),e.setRenderTarget(x))}let X=C[W];X===void 0&&(X=new Gn,X.layers.enable(W),X.viewport=new Ht,C[W]=X),X.matrix.fromArray(N.transform.matrix),X.projectionMatrix.fromArray(N.projectionMatrix),X.viewport.set(me.x,me.y,me.width,me.height),W===0&&P.matrix.copy(X.matrix),k===!0&&P.cameras.push(X)}}for(let Z=0;Z<w.length;Z++){const k=_[Z],W=w[Z];k!==null&&W!==void 0&&W.update(k,G,c||o)}le&&le(F,G),g=null}const z=new cL;z.setAnimationLoop(pe),this.setAnimationLoop=function(F){le=F},this.dispose=function(){}}}function _W(n,e){function t(y,x){y.fogColor.value.copy(x.color),x.isFog?(y.fogNear.value=x.near,y.fogFar.value=x.far):x.isFogExp2&&(y.fogDensity.value=x.density)}function r(y,x,w,_,M){x.isMeshBasicMaterial||x.isMeshLambertMaterial?i(y,x):x.isMeshToonMaterial?(i(y,x),d(y,x)):x.isMeshPhongMaterial?(i(y,x),f(y,x)):x.isMeshStandardMaterial?(i(y,x),h(y,x),x.isMeshPhysicalMaterial&&p(y,x,M)):x.isMeshMatcapMaterial?(i(y,x),g(y,x)):x.isMeshDepthMaterial?i(y,x):x.isMeshDistanceMaterial?(i(y,x),v(y,x)):x.isMeshNormalMaterial?i(y,x):x.isLineBasicMaterial?(s(y,x),x.isLineDashedMaterial&&o(y,x)):x.isPointsMaterial?a(y,x,w,_):x.isSpriteMaterial?c(y,x):x.isShadowMaterial?(y.color.value.copy(x.color),y.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function i(y,x){y.opacity.value=x.opacity,x.color&&y.diffuse.value.copy(x.color),x.emissive&&y.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(y.map.value=x.map),x.alphaMap&&(y.alphaMap.value=x.alphaMap),x.bumpMap&&(y.bumpMap.value=x.bumpMap,y.bumpScale.value=x.bumpScale,x.side===jr&&(y.bumpScale.value*=-1)),x.displacementMap&&(y.displacementMap.value=x.displacementMap,y.displacementScale.value=x.displacementScale,y.displacementBias.value=x.displacementBias),x.emissiveMap&&(y.emissiveMap.value=x.emissiveMap),x.normalMap&&(y.normalMap.value=x.normalMap,y.normalScale.value.copy(x.normalScale),x.side===jr&&y.normalScale.value.negate()),x.specularMap&&(y.specularMap.value=x.specularMap),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest);const w=e.get(x).envMap;if(w&&(y.envMap.value=w,y.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=x.reflectivity,y.ior.value=x.ior,y.refractionRatio.value=x.refractionRatio),x.lightMap){y.lightMap.value=x.lightMap;const E=n.physicallyCorrectLights!==!0?Math.PI:1;y.lightMapIntensity.value=x.lightMapIntensity*E}x.aoMap&&(y.aoMap.value=x.aoMap,y.aoMapIntensity.value=x.aoMapIntensity);let _;x.map?_=x.map:x.specularMap?_=x.specularMap:x.displacementMap?_=x.displacementMap:x.normalMap?_=x.normalMap:x.bumpMap?_=x.bumpMap:x.roughnessMap?_=x.roughnessMap:x.metalnessMap?_=x.metalnessMap:x.alphaMap?_=x.alphaMap:x.emissiveMap?_=x.emissiveMap:x.clearcoatMap?_=x.clearcoatMap:x.clearcoatNormalMap?_=x.clearcoatNormalMap:x.clearcoatRoughnessMap?_=x.clearcoatRoughnessMap:x.iridescenceMap?_=x.iridescenceMap:x.iridescenceThicknessMap?_=x.iridescenceThicknessMap:x.specularIntensityMap?_=x.specularIntensityMap:x.specularColorMap?_=x.specularColorMap:x.transmissionMap?_=x.transmissionMap:x.thicknessMap?_=x.thicknessMap:x.sheenColorMap?_=x.sheenColorMap:x.sheenRoughnessMap&&(_=x.sheenRoughnessMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),y.uvTransform.value.copy(_.matrix));let M;x.aoMap?M=x.aoMap:x.lightMap&&(M=x.lightMap),M!==void 0&&(M.isWebGLRenderTarget&&(M=M.texture),M.matrixAutoUpdate===!0&&M.updateMatrix(),y.uv2Transform.value.copy(M.matrix))}function s(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity}function o(y,x){y.dashSize.value=x.dashSize,y.totalSize.value=x.dashSize+x.gapSize,y.scale.value=x.scale}function a(y,x,w,_){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.size.value=x.size*w,y.scale.value=_*.5,x.map&&(y.map.value=x.map),x.alphaMap&&(y.alphaMap.value=x.alphaMap),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest);let M;x.map?M=x.map:x.alphaMap&&(M=x.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),y.uvTransform.value.copy(M.matrix))}function c(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.rotation.value=x.rotation,x.map&&(y.map.value=x.map),x.alphaMap&&(y.alphaMap.value=x.alphaMap),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest);let w;x.map?w=x.map:x.alphaMap&&(w=x.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),y.uvTransform.value.copy(w.matrix))}function f(y,x){y.specular.value.copy(x.specular),y.shininess.value=Math.max(x.shininess,1e-4)}function d(y,x){x.gradientMap&&(y.gradientMap.value=x.gradientMap)}function h(y,x){y.roughness.value=x.roughness,y.metalness.value=x.metalness,x.roughnessMap&&(y.roughnessMap.value=x.roughnessMap),x.metalnessMap&&(y.metalnessMap.value=x.metalnessMap),e.get(x).envMap&&(y.envMapIntensity.value=x.envMapIntensity)}function p(y,x,w){y.ior.value=x.ior,x.sheen>0&&(y.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),y.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(y.sheenColorMap.value=x.sheenColorMap),x.sheenRoughnessMap&&(y.sheenRoughnessMap.value=x.sheenRoughnessMap)),x.clearcoat>0&&(y.clearcoat.value=x.clearcoat,y.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(y.clearcoatMap.value=x.clearcoatMap),x.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap),x.clearcoatNormalMap&&(y.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),y.clearcoatNormalMap.value=x.clearcoatNormalMap,x.side===jr&&y.clearcoatNormalScale.value.negate())),x.iridescence>0&&(y.iridescence.value=x.iridescence,y.iridescenceIOR.value=x.iridescenceIOR,y.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(y.iridescenceMap.value=x.iridescenceMap),x.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=x.iridescenceThicknessMap)),x.transmission>0&&(y.transmission.value=x.transmission,y.transmissionSamplerMap.value=w.texture,y.transmissionSamplerSize.value.set(w.width,w.height),x.transmissionMap&&(y.transmissionMap.value=x.transmissionMap),y.thickness.value=x.thickness,x.thicknessMap&&(y.thicknessMap.value=x.thicknessMap),y.attenuationDistance.value=x.attenuationDistance,y.attenuationColor.value.copy(x.attenuationColor)),y.specularIntensity.value=x.specularIntensity,y.specularColor.value.copy(x.specularColor),x.specularIntensityMap&&(y.specularIntensityMap.value=x.specularIntensityMap),x.specularColorMap&&(y.specularColorMap.value=x.specularColorMap)}function g(y,x){x.matcap&&(y.matcap.value=x.matcap)}function v(y,x){y.referencePosition.value.copy(x.referencePosition),y.nearDistance.value=x.nearDistance,y.farDistance.value=x.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:r}}function xW(n,e,t,r){let i={},s={},o=[];const a=t.isWebGL2?n.getParameter(35375):0;function c(_,M){const E=M.program;r.uniformBlockBinding(_,E)}function f(_,M){let E=i[_.id];E===void 0&&(v(_),E=d(_),i[_.id]=E,_.addEventListener("dispose",x));const C=M.program;r.updateUBOMapping(_,C);const P=e.render.frame;s[_.id]!==P&&(p(_),s[_.id]=P)}function d(_){const M=h();_.__bindingPointIndex=M;const E=n.createBuffer(),C=_.__size,P=_.usage;return n.bindBuffer(35345,E),n.bufferData(35345,C,P),n.bindBuffer(35345,null),n.bindBufferBase(35345,M,E),E}function h(){for(let _=0;_<a;_++)if(o.indexOf(_)===-1)return o.push(_),_;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(_){const M=i[_.id],E=_.uniforms,C=_.__cache;n.bindBuffer(35345,M);for(let P=0,R=E.length;P<R;P++){const T=E[P];if(g(T,P,C)===!0){const L=T.value,D=T.__offset;typeof L=="number"?(T.__data[0]=L,n.bufferSubData(35345,D,T.__data)):(T.value.isMatrix3?(T.__data[0]=T.value.elements[0],T.__data[1]=T.value.elements[1],T.__data[2]=T.value.elements[2],T.__data[3]=T.value.elements[0],T.__data[4]=T.value.elements[3],T.__data[5]=T.value.elements[4],T.__data[6]=T.value.elements[5],T.__data[7]=T.value.elements[0],T.__data[8]=T.value.elements[6],T.__data[9]=T.value.elements[7],T.__data[10]=T.value.elements[8],T.__data[11]=T.value.elements[0]):L.toArray(T.__data),n.bufferSubData(35345,D,T.__data))}}n.bindBuffer(35345,null)}function g(_,M,E){const C=_.value;if(E[M]===void 0)return typeof C=="number"?E[M]=C:E[M]=C.clone(),!0;if(typeof C=="number"){if(E[M]!==C)return E[M]=C,!0}else{const P=E[M];if(P.equals(C)===!1)return P.copy(C),!0}return!1}function v(_){const M=_.uniforms;let E=0;const C=16;let P=0;for(let R=0,T=M.length;R<T;R++){const L=M[R],D=y(L);if(L.__data=new Float32Array(D.storage/Float32Array.BYTES_PER_ELEMENT),L.__offset=E,R>0){P=E%C;const Y=C-P;P!==0&&Y-D.boundary<0&&(E+=C-P,L.__offset=E)}E+=D.storage}return P=E%C,P>0&&(E+=C-P),_.__size=E,_.__cache={},this}function y(_){const M=_.value,E={boundary:0,storage:0};return typeof M=="number"?(E.boundary=4,E.storage=4):M.isVector2?(E.boundary=8,E.storage=8):M.isVector3||M.isColor?(E.boundary=16,E.storage=12):M.isVector4?(E.boundary=16,E.storage=16):M.isMatrix3?(E.boundary=48,E.storage=48):M.isMatrix4?(E.boundary=64,E.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),E}function x(_){const M=_.target;M.removeEventListener("dispose",x);const E=o.indexOf(M.__bindingPointIndex);o.splice(E,1),n.deleteBuffer(i[M.id]),delete i[M.id],delete s[M.id]}function w(){for(const _ in i)n.deleteBuffer(i[_]);o=[],i={},s={}}return{bind:c,update:f,dispose:w}}function SW(){const n=jf("canvas");return n.style.display="block",n}function xS(n={}){this.isWebGLRenderer=!0;const e=n.canvas!==void 0?n.canvas:SW(),t=n.context!==void 0?n.context:null,r=n.depth!==void 0?n.depth:!0,i=n.stencil!==void 0?n.stencil:!0,s=n.antialias!==void 0?n.antialias:!1,o=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,a=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let d;t!==null?d=t.getContextAttributes().alpha:d=n.alpha!==void 0?n.alpha:!1;let h=null,p=null;const g=[],v=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Xs,this.physicallyCorrectLights=!1,this.toneMapping=Ui,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const y=this;let x=!1,w=0,_=0,M=null,E=-1,C=null;const P=new Ht,R=new Ht;let T=null,L=e.width,D=e.height,Y=1,fe=null,q=null;const $=new Ht(0,0,L,D),se=new Ht(0,0,L,D);let le=!1;const pe=new Wg;let z=!1,F=!1,G=null;const Z=new dt,k=new Me,W=new I,N={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function me(){return M===null?Y:1}let X=t;function Te(B,oe){for(let _e=0;_e<B.length;_e++){const re=B[_e],xe=e.getContext(re,oe);if(xe!==null)return xe}return null}try{const B={alpha:!0,depth:r,stencil:i,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:a,powerPreference:c,failIfMajorPerformanceCaveat:f};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Ug}`),e.addEventListener("webglcontextlost",it,!1),e.addEventListener("webglcontextrestored",Q,!1),e.addEventListener("webglcontextcreationerror",j,!1),X===null){const oe=["webgl2","webgl","experimental-webgl"];if(y.isWebGL1Renderer===!0&&oe.shift(),X=Te(oe,B),X===null)throw Te(oe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}X.getShaderPrecisionFormat===void 0&&(X.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(B){throw console.error("THREE.WebGLRenderer: "+B.message),B}let Ce,we,be,He,ue,ne,Ee,Ue,Le,qe,et,tt,Ct,Nt,H,O,ce,Pe,Ne,ze,st,Be,Se,Je;function ot(){Ce=new zG(X),we=new LG(X,Ce,n),Ce.init(we),Be=new mL(X,Ce,we),be=new mW(X,Ce,we),He=new BG,ue=new rW,ne=new gW(X,Ce,be,ue,we,Be,He),Ee=new NG(y),Ue=new kG(y),Le=new QV(X,we),Se=new PG(X,Ce,Le,we),qe=new FG(X,Le,He,Se),et=new WG(X,qe,Le,He),Ne=new HG(X,we,ne),O=new IG(ue),tt=new nW(y,Ee,Ue,Ce,we,Se,O),Ct=new _W(y,ue),Nt=new sW,H=new fW(Ce,we),Pe=new AG(y,Ee,be,et,d,o),ce=new pW(y,et,we),Je=new xW(X,He,we,be),ze=new RG(X,Ce,He,we),st=new UG(X,Ce,He,we),He.programs=tt.programs,y.capabilities=we,y.extensions=Ce,y.properties=ue,y.renderLists=Nt,y.shadowMap=ce,y.state=be,y.info=He}ot();const Ze=new yW(y,X);this.xr=Ze,this.getContext=function(){return X},this.getContextAttributes=function(){return X.getContextAttributes()},this.forceContextLoss=function(){const B=Ce.get("WEBGL_lose_context");B&&B.loseContext()},this.forceContextRestore=function(){const B=Ce.get("WEBGL_lose_context");B&&B.restoreContext()},this.getPixelRatio=function(){return Y},this.setPixelRatio=function(B){B!==void 0&&(Y=B,this.setSize(L,D,!1))},this.getSize=function(B){return B.set(L,D)},this.setSize=function(B,oe,_e){if(Ze.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}L=B,D=oe,e.width=Math.floor(B*Y),e.height=Math.floor(oe*Y),_e!==!1&&(e.style.width=B+"px",e.style.height=oe+"px"),this.setViewport(0,0,B,oe)},this.getDrawingBufferSize=function(B){return B.set(L*Y,D*Y).floor()},this.setDrawingBufferSize=function(B,oe,_e){L=B,D=oe,Y=_e,e.width=Math.floor(B*_e),e.height=Math.floor(oe*_e),this.setViewport(0,0,B,oe)},this.getCurrentViewport=function(B){return B.copy(P)},this.getViewport=function(B){return B.copy($)},this.setViewport=function(B,oe,_e,re){B.isVector4?$.set(B.x,B.y,B.z,B.w):$.set(B,oe,_e,re),be.viewport(P.copy($).multiplyScalar(Y).floor())},this.getScissor=function(B){return B.copy(se)},this.setScissor=function(B,oe,_e,re){B.isVector4?se.set(B.x,B.y,B.z,B.w):se.set(B,oe,_e,re),be.scissor(R.copy(se).multiplyScalar(Y).floor())},this.getScissorTest=function(){return le},this.setScissorTest=function(B){be.setScissorTest(le=B)},this.setOpaqueSort=function(B){fe=B},this.setTransparentSort=function(B){q=B},this.getClearColor=function(B){return B.copy(Pe.getClearColor())},this.setClearColor=function(){Pe.setClearColor.apply(Pe,arguments)},this.getClearAlpha=function(){return Pe.getClearAlpha()},this.setClearAlpha=function(){Pe.setClearAlpha.apply(Pe,arguments)},this.clear=function(B=!0,oe=!0,_e=!0){let re=0;B&&(re|=16384),oe&&(re|=256),_e&&(re|=1024),X.clear(re)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",it,!1),e.removeEventListener("webglcontextrestored",Q,!1),e.removeEventListener("webglcontextcreationerror",j,!1),Nt.dispose(),H.dispose(),ue.dispose(),Ee.dispose(),Ue.dispose(),et.dispose(),Se.dispose(),Je.dispose(),tt.dispose(),Ze.dispose(),Ze.removeEventListener("sessionstart",Ae),Ze.removeEventListener("sessionend",Oe),G&&(G.dispose(),G=null),Ye.stop()};function it(B){B.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function Q(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const B=He.autoReset,oe=ce.enabled,_e=ce.autoUpdate,re=ce.needsUpdate,xe=ce.type;ot(),He.autoReset=B,ce.enabled=oe,ce.autoUpdate=_e,ce.needsUpdate=re,ce.type=xe}function j(B){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",B.statusMessage)}function U(B){const oe=B.target;oe.removeEventListener("dispose",U),de(oe)}function de(B){ie(B),ue.remove(B)}function ie(B){const oe=ue.get(B).programs;oe!==void 0&&(oe.forEach(function(_e){tt.releaseProgram(_e)}),B.isShaderMaterial&&tt.releaseShaderCache(B))}this.renderBufferDirect=function(B,oe,_e,re,xe,nt){oe===null&&(oe=N);const lt=xe.isMesh&&xe.matrixWorld.determinant()<0,gt=ys(B,oe,_e,re,xe);be.setMaterial(re,lt);let ut=_e.index;const Dt=_e.attributes.position;if(ut===null){if(Dt===void 0||Dt.count===0)return}else if(ut.count===0)return;let At=1;re.wireframe===!0&&(ut=qe.getWireframeAttribute(_e),At=2),Se.setup(xe,re,gt,_e,ut);let Pt,en=ze;ut!==null&&(Pt=Le.get(ut),en=st,en.setIndex(Pt));const _s=ut!==null?ut.count:Dt.count,Js=_e.drawRange.start*At,eo=_e.drawRange.count*At,yr=nt!==null?nt.start*At:0,Et=nt!==null?nt.count*At:1/0,$i=Math.max(Js,yr),tn=Math.min(_s,Js+eo,yr+Et)-1,_r=Math.max(0,tn-$i+1);if(_r!==0){if(xe.isMesh)re.wireframe===!0?(be.setLineWidth(re.wireframeLinewidth*me()),en.setMode(1)):en.setMode(4);else if(xe.isLine){let Jr=re.linewidth;Jr===void 0&&(Jr=1),be.setLineWidth(Jr*me()),xe.isLineSegments?en.setMode(1):xe.isLineLoop?en.setMode(2):en.setMode(3)}else xe.isPoints?en.setMode(0):xe.isSprite&&en.setMode(4);if(xe.isInstancedMesh)en.renderInstances($i,_r,xe.count);else if(_e.isInstancedBufferGeometry){const Jr=Math.min(_e.instanceCount,_e._maxInstanceCount);en.renderInstances($i,_r,Jr)}else en.render($i,_r)}},this.compile=function(B,oe){function _e(re,xe,nt){re.transparent===!0&&re.side===ki?(re.side=jr,re.needsUpdate=!0,Nr(re,xe,nt),re.side=qa,re.needsUpdate=!0,Nr(re,xe,nt),re.side=ki):Nr(re,xe,nt)}p=H.get(B),p.init(),v.push(p),B.traverseVisible(function(re){re.isLight&&re.layers.test(oe.layers)&&(p.pushLight(re),re.castShadow&&p.pushShadow(re))}),p.setupLights(y.physicallyCorrectLights),B.traverse(function(re){const xe=re.material;if(xe)if(Array.isArray(xe))for(let nt=0;nt<xe.length;nt++){const lt=xe[nt];_e(lt,B,re)}else _e(xe,B,re)}),v.pop(),p=null};let ee=null;function ye(B){ee&&ee(B)}function Ae(){Ye.stop()}function Oe(){Ye.start()}const Ye=new cL;Ye.setAnimationLoop(ye),typeof self!="undefined"&&Ye.setContext(self),this.setAnimationLoop=function(B){ee=B,Ze.setAnimationLoop(B),B===null?Ye.stop():Ye.start()},Ze.addEventListener("sessionstart",Ae),Ze.addEventListener("sessionend",Oe),this.render=function(B,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),Ze.enabled===!0&&Ze.isPresenting===!0&&(Ze.cameraAutoUpdate===!0&&Ze.updateCamera(oe),oe=Ze.getCamera()),B.isScene===!0&&B.onBeforeRender(y,B,oe,M),p=H.get(B,v.length),p.init(),v.push(p),Z.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),pe.setFromProjectionMatrix(Z),F=this.localClippingEnabled,z=O.init(this.clippingPlanes,F,oe),h=Nt.get(B,g.length),h.init(),g.push(h),bt(B,oe,0,y.sortObjects),h.finish(),y.sortObjects===!0&&h.sort(fe,q),z===!0&&O.beginShadows();const _e=p.state.shadowsArray;if(ce.render(_e,B,oe),z===!0&&O.endShadows(),this.info.autoReset===!0&&this.info.reset(),Pe.render(h,B),p.setupLights(y.physicallyCorrectLights),oe.isArrayCamera){const re=oe.cameras;for(let xe=0,nt=re.length;xe<nt;xe++){const lt=re[xe];_t(h,B,lt,lt.viewport)}}else _t(h,B,oe);M!==null&&(ne.updateMultisampleRenderTarget(M),ne.updateRenderTargetMipmap(M)),B.isScene===!0&&B.onAfterRender(y,B,oe),Se.resetDefaultState(),E=-1,C=null,v.pop(),v.length>0?p=v[v.length-1]:p=null,g.pop(),g.length>0?h=g[g.length-1]:h=null};function bt(B,oe,_e,re){if(B.visible===!1)return;if(B.layers.test(oe.layers)){if(B.isGroup)_e=B.renderOrder;else if(B.isLOD)B.autoUpdate===!0&&B.update(oe);else if(B.isLight)p.pushLight(B),B.castShadow&&p.pushShadow(B);else if(B.isSprite){if(!B.frustumCulled||pe.intersectsSprite(B)){re&&W.setFromMatrixPosition(B.matrixWorld).applyMatrix4(Z);const lt=et.update(B),gt=B.material;gt.visible&&h.push(B,lt,gt,_e,W.z,null)}}else if((B.isMesh||B.isLine||B.isPoints)&&(B.isSkinnedMesh&&B.skeleton.frame!==He.render.frame&&(B.skeleton.update(),B.skeleton.frame=He.render.frame),!B.frustumCulled||pe.intersectsObject(B))){re&&W.setFromMatrixPosition(B.matrixWorld).applyMatrix4(Z);const lt=et.update(B),gt=B.material;if(Array.isArray(gt)){const ut=lt.groups;for(let Dt=0,At=ut.length;Dt<At;Dt++){const Pt=ut[Dt],en=gt[Pt.materialIndex];en&&en.visible&&h.push(B,lt,en,_e,W.z,Pt)}}else gt.visible&&h.push(B,lt,gt,_e,W.z,null)}}const nt=B.children;for(let lt=0,gt=nt.length;lt<gt;lt++)bt(nt[lt],oe,_e,re)}function _t(B,oe,_e,re){const xe=B.opaque,nt=B.transmissive,lt=B.transparent;p.setupLightsView(_e),nt.length>0&&Ft(xe,oe,_e),re&&be.viewport(P.copy(re)),xe.length>0&&$t(xe,oe,_e),nt.length>0&&$t(nt,oe,_e),lt.length>0&&$t(lt,oe,_e),be.buffers.depth.setTest(!0),be.buffers.depth.setMask(!0),be.buffers.color.setMask(!0),be.setPolygonOffset(!1)}function Ft(B,oe,_e){const re=we.isWebGL2;G===null&&(G=new qr(1,1,{generateMipmaps:!0,type:Ce.has("EXT_color_buffer_half_float")?Za:Ho,minFilter:sl,samples:re&&s===!0?4:0})),y.getDrawingBufferSize(k),re?G.setSize(k.x,k.y):G.setSize(ag(k.x),ag(k.y));const xe=y.getRenderTarget();y.setRenderTarget(G),y.clear();const nt=y.toneMapping;y.toneMapping=Ui,$t(B,oe,_e),y.toneMapping=nt,ne.updateMultisampleRenderTarget(G),ne.updateRenderTargetMipmap(G),y.setRenderTarget(xe)}function $t(B,oe,_e){const re=oe.isScene===!0?oe.overrideMaterial:null;for(let xe=0,nt=B.length;xe<nt;xe++){const lt=B[xe],gt=lt.object,ut=lt.geometry,Dt=re===null?lt.material:re,At=lt.group;gt.layers.test(_e.layers)&&Zn(gt,oe,_e,ut,Dt,At)}}function Zn(B,oe,_e,re,xe,nt){B.onBeforeRender(y,oe,_e,re,xe,nt),B.modelViewMatrix.multiplyMatrices(_e.matrixWorldInverse,B.matrixWorld),B.normalMatrix.getNormalMatrix(B.modelViewMatrix),xe.onBeforeRender(y,oe,_e,re,B,nt),xe.transparent===!0&&xe.side===ki?(xe.side=jr,xe.needsUpdate=!0,y.renderBufferDirect(_e,oe,re,xe,B,nt),xe.side=qa,xe.needsUpdate=!0,y.renderBufferDirect(_e,oe,re,xe,B,nt),xe.side=ki):y.renderBufferDirect(_e,oe,re,xe,B,nt),B.onAfterRender(y,oe,_e,re,xe,nt)}function Nr(B,oe,_e){oe.isScene!==!0&&(oe=N);const re=ue.get(B),xe=p.state.lights,nt=p.state.shadowsArray,lt=xe.state.version,gt=tt.getParameters(B,xe.state,nt,oe,_e),ut=tt.getProgramCacheKey(gt);let Dt=re.programs;re.environment=B.isMeshStandardMaterial?oe.environment:null,re.fog=oe.fog,re.envMap=(B.isMeshStandardMaterial?Ue:Ee).get(B.envMap||re.environment),Dt===void 0&&(B.addEventListener("dispose",U),Dt=new Map,re.programs=Dt);let At=Dt.get(ut);if(At!==void 0){if(re.currentProgram===At&&re.lightsStateVersion===lt)return vs(B,gt),At}else gt.uniforms=tt.getUniforms(B),B.onBuild(_e,gt,y),B.onBeforeCompile(gt,y),At=tt.acquireProgram(gt,ut),Dt.set(ut,At),re.uniforms=gt.uniforms;const Pt=re.uniforms;(!B.isShaderMaterial&&!B.isRawShaderMaterial||B.clipping===!0)&&(Pt.clippingPlanes=O.uniform),vs(B,gt),re.needsLights=Qu(B),re.lightsStateVersion=lt,re.needsLights&&(Pt.ambientLightColor.value=xe.state.ambient,Pt.lightProbe.value=xe.state.probe,Pt.directionalLights.value=xe.state.directional,Pt.directionalLightShadows.value=xe.state.directionalShadow,Pt.spotLights.value=xe.state.spot,Pt.spotLightShadows.value=xe.state.spotShadow,Pt.rectAreaLights.value=xe.state.rectArea,Pt.ltc_1.value=xe.state.rectAreaLTC1,Pt.ltc_2.value=xe.state.rectAreaLTC2,Pt.pointLights.value=xe.state.point,Pt.pointLightShadows.value=xe.state.pointShadow,Pt.hemisphereLights.value=xe.state.hemi,Pt.directionalShadowMap.value=xe.state.directionalShadowMap,Pt.directionalShadowMatrix.value=xe.state.directionalShadowMatrix,Pt.spotShadowMap.value=xe.state.spotShadowMap,Pt.spotLightMatrix.value=xe.state.spotLightMatrix,Pt.spotLightMap.value=xe.state.spotLightMap,Pt.pointShadowMap.value=xe.state.pointShadowMap,Pt.pointShadowMatrix.value=xe.state.pointShadowMatrix);const en=At.getUniforms(),_s=hm.seqWithValue(en.seq,Pt);return re.currentProgram=At,re.uniformsList=_s,At}function vs(B,oe){const _e=ue.get(B);_e.outputEncoding=oe.outputEncoding,_e.instancing=oe.instancing,_e.skinning=oe.skinning,_e.morphTargets=oe.morphTargets,_e.morphNormals=oe.morphNormals,_e.morphColors=oe.morphColors,_e.morphTargetsCount=oe.morphTargetsCount,_e.numClippingPlanes=oe.numClippingPlanes,_e.numIntersection=oe.numClipIntersection,_e.vertexAlphas=oe.vertexAlphas,_e.vertexTangents=oe.vertexTangents,_e.toneMapping=oe.toneMapping}function ys(B,oe,_e,re,xe){oe.isScene!==!0&&(oe=N),ne.resetTextureUnits();const nt=oe.fog,lt=re.isMeshStandardMaterial?oe.environment:null,gt=M===null?y.outputEncoding:M.isXRRenderTarget===!0?M.texture.encoding:Xs,ut=(re.isMeshStandardMaterial?Ue:Ee).get(re.envMap||lt),Dt=re.vertexColors===!0&&!!_e.attributes.color&&_e.attributes.color.itemSize===4,At=!!re.normalMap&&!!_e.attributes.tangent,Pt=!!_e.morphAttributes.position,en=!!_e.morphAttributes.normal,_s=!!_e.morphAttributes.color,Js=re.toneMapped?y.toneMapping:Ui,eo=_e.morphAttributes.position||_e.morphAttributes.normal||_e.morphAttributes.color,yr=eo!==void 0?eo.length:0,Et=ue.get(re),$i=p.state.lights;if(z===!0&&(F===!0||B!==C)){const Bt=B===C&&re.id===E;O.setState(re,B,Bt)}let tn=!1;re.version===Et.__version?(Et.needsLights&&Et.lightsStateVersion!==$i.state.version||Et.outputEncoding!==gt||xe.isInstancedMesh&&Et.instancing===!1||!xe.isInstancedMesh&&Et.instancing===!0||xe.isSkinnedMesh&&Et.skinning===!1||!xe.isSkinnedMesh&&Et.skinning===!0||Et.envMap!==ut||re.fog===!0&&Et.fog!==nt||Et.numClippingPlanes!==void 0&&(Et.numClippingPlanes!==O.numPlanes||Et.numIntersection!==O.numIntersection)||Et.vertexAlphas!==Dt||Et.vertexTangents!==At||Et.morphTargets!==Pt||Et.morphNormals!==en||Et.morphColors!==_s||Et.toneMapping!==Js||we.isWebGL2===!0&&Et.morphTargetsCount!==yr)&&(tn=!0):(tn=!0,Et.__version=re.version);let _r=Et.currentProgram;tn===!0&&(_r=Nr(re,oe,xe));let Jr=!1,ei=!1,ti=!1;const mt=_r.getUniforms(),Rt=Et.uniforms;if(be.useProgram(_r.program)&&(Jr=!0,ei=!0,ti=!0),re.id!==E&&(E=re.id,ei=!0),Jr||C!==B){if(mt.setValue(X,"projectionMatrix",B.projectionMatrix),we.logarithmicDepthBuffer&&mt.setValue(X,"logDepthBufFC",2/(Math.log(B.far+1)/Math.LN2)),C!==B&&(C=B,ei=!0,ti=!0),re.isShaderMaterial||re.isMeshPhongMaterial||re.isMeshToonMaterial||re.isMeshStandardMaterial||re.envMap){const Bt=mt.map.cameraPosition;Bt!==void 0&&Bt.setValue(X,W.setFromMatrixPosition(B.matrixWorld))}(re.isMeshPhongMaterial||re.isMeshToonMaterial||re.isMeshLambertMaterial||re.isMeshBasicMaterial||re.isMeshStandardMaterial||re.isShaderMaterial)&&mt.setValue(X,"isOrthographic",B.isOrthographicCamera===!0),(re.isMeshPhongMaterial||re.isMeshToonMaterial||re.isMeshLambertMaterial||re.isMeshBasicMaterial||re.isMeshStandardMaterial||re.isShaderMaterial||re.isShadowMaterial||xe.isSkinnedMesh)&&mt.setValue(X,"viewMatrix",B.matrixWorldInverse)}if(xe.isSkinnedMesh){mt.setOptional(X,xe,"bindMatrix"),mt.setOptional(X,xe,"bindMatrixInverse");const Bt=xe.skeleton;Bt&&(we.floatVertexTextures?(Bt.boneTexture===null&&Bt.computeBoneTexture(),mt.setValue(X,"boneTexture",Bt.boneTexture,ne),mt.setValue(X,"boneTextureSize",Bt.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const ni=_e.morphAttributes;if((ni.position!==void 0||ni.normal!==void 0||ni.color!==void 0&&we.isWebGL2===!0)&&Ne.update(xe,_e,re,_r),(ei||Et.receiveShadow!==xe.receiveShadow)&&(Et.receiveShadow=xe.receiveShadow,mt.setValue(X,"receiveShadow",xe.receiveShadow)),re.isMeshGouraudMaterial&&re.envMap!==null&&(Rt.envMap.value=ut,Rt.flipEnvMap.value=ut.isCubeTexture&&ut.isRenderTargetTexture===!1?-1:1),ei&&(mt.setValue(X,"toneMappingExposure",y.toneMappingExposure),Et.needsLights&&Wi(Rt,ti),nt&&re.fog===!0&&Ct.refreshFogUniforms(Rt,nt),Ct.refreshMaterialUniforms(Rt,re,Y,D,G),hm.upload(X,Et.uniformsList,Rt,ne)),re.isShaderMaterial&&re.uniformsNeedUpdate===!0&&(hm.upload(X,Et.uniformsList,Rt,ne),re.uniformsNeedUpdate=!1),re.isSpriteMaterial&&mt.setValue(X,"center",xe.center),mt.setValue(X,"modelViewMatrix",xe.modelViewMatrix),mt.setValue(X,"normalMatrix",xe.normalMatrix),mt.setValue(X,"modelMatrix",xe.matrixWorld),re.isShaderMaterial||re.isRawShaderMaterial){const Bt=re.uniformsGroups;for(let On=0,xs=Bt.length;On<xs;On++)if(we.isWebGL2){const Ss=Bt[On];Je.update(Ss,_r),Je.bind(Ss,_r)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return _r}function Wi(B,oe){B.ambientLightColor.needsUpdate=oe,B.lightProbe.needsUpdate=oe,B.directionalLights.needsUpdate=oe,B.directionalLightShadows.needsUpdate=oe,B.pointLights.needsUpdate=oe,B.pointLightShadows.needsUpdate=oe,B.spotLights.needsUpdate=oe,B.spotLightShadows.needsUpdate=oe,B.rectAreaLights.needsUpdate=oe,B.hemisphereLights.needsUpdate=oe}function Qu(B){return B.isMeshLambertMaterial||B.isMeshToonMaterial||B.isMeshPhongMaterial||B.isMeshStandardMaterial||B.isShadowMaterial||B.isShaderMaterial&&B.lights===!0}this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return _},this.getRenderTarget=function(){return M},this.setRenderTargetTextures=function(B,oe,_e){ue.get(B.texture).__webglTexture=oe,ue.get(B.depthTexture).__webglTexture=_e;const re=ue.get(B);re.__hasExternalTextures=!0,re.__hasExternalTextures&&(re.__autoAllocateDepthBuffer=_e===void 0,re.__autoAllocateDepthBuffer||Ce.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),re.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(B,oe){const _e=ue.get(B);_e.__webglFramebuffer=oe,_e.__useDefaultFramebuffer=oe===void 0},this.setRenderTarget=function(B,oe=0,_e=0){M=B,w=oe,_=_e;let re=!0;if(B){const ut=ue.get(B);ut.__useDefaultFramebuffer!==void 0?(be.bindFramebuffer(36160,null),re=!1):ut.__webglFramebuffer===void 0?ne.setupRenderTarget(B):ut.__hasExternalTextures&&ne.rebindTextures(B,ue.get(B.texture).__webglTexture,ue.get(B.depthTexture).__webglTexture)}let xe=null,nt=!1,lt=!1;if(B){const ut=B.texture;(ut.isData3DTexture||ut.isDataArrayTexture)&&(lt=!0);const Dt=ue.get(B).__webglFramebuffer;B.isWebGLCubeRenderTarget?(xe=Dt[oe],nt=!0):we.isWebGL2&&B.samples>0&&ne.useMultisampledRTT(B)===!1?xe=ue.get(B).__webglMultisampledFramebuffer:xe=Dt,P.copy(B.viewport),R.copy(B.scissor),T=B.scissorTest}else P.copy($).multiplyScalar(Y).floor(),R.copy(se).multiplyScalar(Y).floor(),T=le;if(be.bindFramebuffer(36160,xe)&&we.drawBuffers&&re&&be.drawBuffers(B,xe),be.viewport(P),be.scissor(R),be.setScissorTest(T),nt){const ut=ue.get(B.texture);X.framebufferTexture2D(36160,36064,34069+oe,ut.__webglTexture,_e)}else if(lt){const ut=ue.get(B.texture),Dt=oe||0;X.framebufferTextureLayer(36160,36064,ut.__webglTexture,_e||0,Dt)}E=-1},this.readRenderTargetPixels=function(B,oe,_e,re,xe,nt,lt){if(!(B&&B.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let gt=ue.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&&lt!==void 0&&(gt=gt[lt]),gt){be.bindFramebuffer(36160,gt);try{const ut=B.texture,Dt=ut.format,At=ut.type;if(Dt!==_i&&Be.convert(Dt)!==X.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Pt=At===Za&&(Ce.has("EXT_color_buffer_half_float")||we.isWebGL2&&Ce.has("EXT_color_buffer_float"));if(At!==Ho&&Be.convert(At)!==X.getParameter(35738)&&!(At===os&&(we.isWebGL2||Ce.has("OES_texture_float")||Ce.has("WEBGL_color_buffer_float")))&&!Pt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=B.width-re&&_e>=0&&_e<=B.height-xe&&X.readPixels(oe,_e,re,xe,Be.convert(Dt),Be.convert(At),nt)}finally{const ut=M!==null?ue.get(M).__webglFramebuffer:null;be.bindFramebuffer(36160,ut)}}},this.copyFramebufferToTexture=function(B,oe,_e=0){const re=Math.pow(2,-_e),xe=Math.floor(oe.image.width*re),nt=Math.floor(oe.image.height*re);ne.setTexture2D(oe,0),X.copyTexSubImage2D(3553,_e,0,0,B.x,B.y,xe,nt),be.unbindTexture()},this.copyTextureToTexture=function(B,oe,_e,re=0){const xe=oe.image.width,nt=oe.image.height,lt=Be.convert(_e.format),gt=Be.convert(_e.type);ne.setTexture2D(_e,0),X.pixelStorei(37440,_e.flipY),X.pixelStorei(37441,_e.premultiplyAlpha),X.pixelStorei(3317,_e.unpackAlignment),oe.isDataTexture?X.texSubImage2D(3553,re,B.x,B.y,xe,nt,lt,gt,oe.image.data):oe.isCompressedTexture?X.compressedTexSubImage2D(3553,re,B.x,B.y,oe.mipmaps[0].width,oe.mipmaps[0].height,lt,oe.mipmaps[0].data):X.texSubImage2D(3553,re,B.x,B.y,lt,gt,oe.image),re===0&&_e.generateMipmaps&&X.generateMipmap(3553),be.unbindTexture()},this.copyTextureToTexture3D=function(B,oe,_e,re,xe=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const nt=B.max.x-B.min.x+1,lt=B.max.y-B.min.y+1,gt=B.max.z-B.min.z+1,ut=Be.convert(re.format),Dt=Be.convert(re.type);let At;if(re.isData3DTexture)ne.setTexture3D(re,0),At=32879;else if(re.isDataArrayTexture)ne.setTexture2DArray(re,0),At=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}X.pixelStorei(37440,re.flipY),X.pixelStorei(37441,re.premultiplyAlpha),X.pixelStorei(3317,re.unpackAlignment);const Pt=X.getParameter(3314),en=X.getParameter(32878),_s=X.getParameter(3316),Js=X.getParameter(3315),eo=X.getParameter(32877),yr=_e.isCompressedTexture?_e.mipmaps[0]:_e.image;X.pixelStorei(3314,yr.width),X.pixelStorei(32878,yr.height),X.pixelStorei(3316,B.min.x),X.pixelStorei(3315,B.min.y),X.pixelStorei(32877,B.min.z),_e.isDataTexture||_e.isData3DTexture?X.texSubImage3D(At,xe,oe.x,oe.y,oe.z,nt,lt,gt,ut,Dt,yr.data):_e.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),X.compressedTexSubImage3D(At,xe,oe.x,oe.y,oe.z,nt,lt,gt,ut,yr.data)):X.texSubImage3D(At,xe,oe.x,oe.y,oe.z,nt,lt,gt,ut,Dt,yr),X.pixelStorei(3314,Pt),X.pixelStorei(32878,en),X.pixelStorei(3316,_s),X.pixelStorei(3315,Js),X.pixelStorei(32877,eo),xe===0&&re.generateMipmaps&&X.generateMipmap(At),be.unbindTexture()},this.initTexture=function(B){B.isCubeTexture?ne.setTextureCube(B,0):B.isData3DTexture?ne.setTexture3D(B,0):B.isDataArrayTexture?ne.setTexture2DArray(B,0):ne.setTexture2D(B,0),be.unbindTexture()},this.resetState=function(){w=0,_=0,M=null,be.reset(),Se.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class vL extends xS{}vL.prototype.isWebGL1Renderer=!0;class jg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ge(e),this.density=t}clone(){return new jg(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Xg{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new Ge(e),this.near=t,this.far=r}clone(){return new Xg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class SS extends Mt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__!="undefined"&&__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()),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()),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class Yg{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Wf,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Xr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[r+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Xr()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Xr()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const fr=new I;class Ka{constructor(e,t,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=i===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)fr.fromBufferAttribute(this,t),fr.applyMatrix4(e),this.setXYZ(t,fr.x,fr.y,fr.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)fr.fromBufferAttribute(this,t),fr.applyNormalMatrix(e),this.setXYZ(t,fr.x,fr.y,fr.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)fr.fromBufferAttribute(this,t),fr.transformDirection(e),this.setXYZ(t,fr.x,fr.y,fr.z);return this}setX(e,t){return this.normalized&&(t=Xt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Xt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Xt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Xt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Us(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Us(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Us(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Us(t,this.array)),t}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Xt(t,this.array),r=Xt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Xt(t,this.array),r=Xt(r,this.array),i=Xt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Xt(t,this.array),r=Xt(r,this.array),i=Xt(i,this.array),s=Xt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will deinterleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new qt(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ka(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will deinterleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class wS extends qn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ge(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Hl;const Dc=new I,Wl=new I,$l=new I,jl=new Me,Oc=new Me,yL=new dt,gp=new I,kc=new I,vp=new I,qT=new Me,Iy=new Me,ZT=new Me;class _L extends Mt{constructor(e){if(super(),this.isSprite=!0,this.type="Sprite",Hl===void 0){Hl=new ht;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),r=new Yg(t,5);Hl.setIndex([0,1,2,0,2,3]),Hl.setAttribute("position",new Ka(r,3,0,!1)),Hl.setAttribute("uv",new Ka(r,2,3,!1))}this.geometry=Hl,this.material=e!==void 0?e:new wS,this.center=new Me(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Wl.setFromMatrixScale(this.matrixWorld),yL.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),$l.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Wl.multiplyScalar(-$l.z);const r=this.material.rotation;let i,s;r!==0&&(s=Math.cos(r),i=Math.sin(r));const o=this.center;yp(gp.set(-.5,-.5,0),$l,o,Wl,i,s),yp(kc.set(.5,-.5,0),$l,o,Wl,i,s),yp(vp.set(.5,.5,0),$l,o,Wl,i,s),qT.set(0,0),Iy.set(1,0),ZT.set(1,1);let a=e.ray.intersectTriangle(gp,kc,vp,!1,Dc);if(a===null&&(yp(kc.set(-.5,.5,0),$l,o,Wl,i,s),Iy.set(0,1),a=e.ray.intersectTriangle(gp,vp,kc,!1,Dc),a===null))return;const c=e.ray.origin.distanceTo(Dc);c<e.near||c>e.far||t.push({distance:c,point:Dc.clone(),uv:vi.getUV(Dc,gp,kc,vp,qT,Iy,ZT,new Me),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function yp(n,e,t,r,i,s){jl.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(Oc.x=s*jl.x-i*jl.y,Oc.y=i*jl.x+s*jl.y):Oc.copy(jl),n.copy(e),n.x+=Oc.x,n.y+=Oc.y,n.applyMatrix4(yL)}const _p=new I,QT=new I;class xL extends Mt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let r=0,i=t.length;r<i;r++){const s=t[r];this.addLevel(s.object.clone(),s.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const r=this.levels;let i;for(i=0;i<r.length&&!(t<r[i].distance);i++);return r.splice(i,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let r,i;for(r=1,i=t.length;r<i&&!(e<t[r].distance);r++);return t[r-1].object}return null}raycast(e,t){if(this.levels.length>0){_p.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(_p);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){_p.setFromMatrixPosition(e.matrixWorld),QT.setFromMatrixPosition(this.matrixWorld);const r=_p.distanceTo(QT)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i<s&&r>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;i<s;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const r=this.levels;for(let i=0,s=r.length;i<s;i++){const o=r[i];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const KT=new I,JT=new Ht,e2=new Ht,wW=new I,t2=new dt;class SL extends We{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new dt,this.bindMatrixInverse=new dt}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ht,t=this.geometry.attributes.skinWeight;for(let r=0,i=t.count;r<i;r++){e.fromBufferAttribute(t,r);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const r=this.skeleton,i=this.geometry;JT.fromBufferAttribute(i.attributes.skinIndex,e),e2.fromBufferAttribute(i.attributes.skinWeight,e),KT.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=e2.getComponent(s);if(o!==0){const a=JT.getComponent(s);t2.multiplyMatrices(r.bones[a].matrixWorld,r.boneInverses[a]),t.addScaledVector(wW.copy(KT).applyMatrix4(t2),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class MS extends Mt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Su extends Cn{constructor(e=null,t=1,r=1,i,s,o,a,c,f=En,d=En,h,p){super(null,o,a,c,f,d,i,s,h,p),this.isDataTexture=!0,this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const n2=new dt,MW=new dt;class qg{constructor(e=[],t=[]){this.uuid=Xr(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let r=0,i=this.bones.length;r<i;r++)this.boneInverses.push(new dt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const r=new dt;this.bones[e]&&r.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&r.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&(r.parent&&r.parent.isBone?(r.matrix.copy(r.parent.matrixWorld).invert(),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))}}update(){const e=this.bones,t=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:MW;n2.multiplyMatrices(a,t[s]),n2.toArray(r,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new qg(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=iL(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const r=new Su(t,e,e,_i,os);return r.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=r,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,r=this.bones.length;t<r;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let r=0,i=e.bones.length;r<i;r++){const s=e.bones[r];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new MS),this.bones.push(o),this.boneInverses.push(new dt().fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,r=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const a=r[i];e.boneInverses.push(a.toArray())}return e}}class Iu extends qt{constructor(e,t,r,i=1){super(e,t,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const r2=new dt,i2=new dt,xp=[],zc=new We;class wL extends We{constructor(e,t,r){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Iu(new Float32Array(r*16),16),this.instanceColor=null,this.count=r,this.frustumCulled=!1}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const r=this.matrixWorld,i=this.count;if(zc.geometry=this.geometry,zc.material=this.material,zc.material!==void 0)for(let s=0;s<i;s++){this.getMatrixAt(s,r2),i2.multiplyMatrices(r,r2),zc.matrixWorld=i2,zc.raycast(e,xp);for(let o=0,a=xp.length;o<a;o++){const c=xp[o];c.instanceId=s,c.object=this,t.push(c)}xp.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Iu(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class lr extends qn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ge(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const s2=new I,o2=new I,a2=new dt,Ny=new dd,Sp=new al;class St extends Mt{constructor(e=new ht,t=new lr){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[0];for(let i=1,s=t.count;i<s;i++)s2.fromBufferAttribute(t,i-1),o2.fromBufferAttribute(t,i),r[i]=r[i-1],r[i]+=s2.distanceTo(o2);e.setAttribute("lineDistance",new Xe(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),Sp.copy(r.boundingSphere),Sp.applyMatrix4(i),Sp.radius+=s,e.ray.intersectsSphere(Sp)===!1)return;a2.copy(i).invert(),Ny.copy(e.ray).applyMatrix4(a2);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=a*a,f=new I,d=new I,h=new I,p=new I,g=this.isLineSegments?2:1,v=r.index,x=r.attributes.position;if(v!==null){const w=Math.max(0,o.start),_=Math.min(v.count,o.start+o.count);for(let M=w,E=_-1;M<E;M+=g){const C=v.getX(M),P=v.getX(M+1);if(f.fromBufferAttribute(x,C),d.fromBufferAttribute(x,P),Ny.distanceSqToSegment(f,d,p,h)>c)continue;p.applyMatrix4(this.matrixWorld);const T=e.ray.origin.distanceTo(p);T<e.near||T>e.far||t.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const w=Math.max(0,o.start),_=Math.min(x.count,o.start+o.count);for(let M=w,E=_-1;M<E;M+=g){if(f.fromBufferAttribute(x,M),d.fromBufferAttribute(x,M+1),Ny.distanceSqToSegment(f,d,p,h)>c)continue;p.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(p);P<e.near||P>e.far||t.push({distance:P,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}const l2=new I,u2=new I;class ps extends St{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[];for(let i=0,s=t.count;i<s;i+=2)l2.fromBufferAttribute(t,i),u2.fromBufferAttribute(t,i+1),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+l2.distanceTo(u2);e.setAttribute("lineDistance",new Xe(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class ML extends St{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class bS extends qn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ge(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const c2=new dt,kx=new dd,wp=new al,Mp=new I;class bL extends Mt{constructor(e=new ht,t=new bS){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),wp.copy(r.boundingSphere),wp.applyMatrix4(i),wp.radius+=s,e.ray.intersectsSphere(wp)===!1)return;c2.copy(i).invert(),kx.copy(e.ray).applyMatrix4(c2);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=a*a,f=r.index,h=r.attributes.position;if(f!==null){const p=Math.max(0,o.start),g=Math.min(f.count,o.start+o.count);for(let v=p,y=g;v<y;v++){const x=f.getX(v);Mp.fromBufferAttribute(h,x),f2(Mp,x,c,i,e,t,this)}}else{const p=Math.max(0,o.start),g=Math.min(h.count,o.start+o.count);for(let v=p,y=g;v<y;v++)Mp.fromBufferAttribute(h,v),f2(Mp,v,c,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function f2(n,e,t,r,i,s,o){const a=kx.distanceSqToPoint(n);if(a<t){const c=new I;kx.closestPointToPoint(n,c),c.applyMatrix4(r);const f=i.ray.origin.distanceTo(c);if(f<i.near||f>i.far)return;s.push({distance:f,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,object:o})}}class bW extends Cn{constructor(e,t,r,i,s,o,a,c,f){super(e,t,r,i,s,o,a,c,f),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:un,this.magFilter=s!==void 0?s:un,this.generateMipmaps=!1;const d=this;function h(){d.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class EW extends Cn{constructor(e,t,r){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=r,this.magFilter=En,this.minFilter=En,this.generateMipmaps=!1,this.needsUpdate=!0}}class EL extends Cn{constructor(e,t,r,i,s,o,a,c,f,d,h,p){super(null,o,a,c,f,d,i,s,h,p),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class TW extends Cn{constructor(e,t,r,i,s,o,a,c,f){super(e,t,r,i,s,o,a,c,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Gi{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let i=0;const s=r.length;let o;t?o=t:o=e*r[s-1];let a=0,c=s-1,f;for(;a<=c;)if(i=Math.floor(a+(c-a)/2),f=r[i]-o,f<0)a=i+1;else if(f>0)c=i-1;else{c=i;break}if(i=c,r[i]===o)return i/(s-1);const d=r[i],p=r[i+1]-d,g=(o-d)/p;return(i+g)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),a=this.getPoint(s),c=t||(o.isVector2?new Me:new I);return c.copy(a).sub(o).normalize(),c}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new I,i=[],s=[],o=[],a=new I,c=new dt;for(let g=0;g<=e;g++){const v=g/e;i[g]=this.getTangentAt(v,new I)}s[0]=new I,o[0]=new I;let f=Number.MAX_VALUE;const d=Math.abs(i[0].x),h=Math.abs(i[0].y),p=Math.abs(i[0].z);d<=f&&(f=d,r.set(1,0,0)),h<=f&&(f=h,r.set(0,1,0)),p<=f&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),a.crossVectors(i[g-1],i[g]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(xn(i[g-1].dot(i[g]),-1,1));s[g].applyMatrix4(c.makeRotationAxis(a,v))}o[g].crossVectors(i[g],s[g])}if(t===!0){let g=Math.acos(xn(s[0].dot(s[e]),-1,1));g/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(g=-g);for(let v=1;v<=e;v++)s[v].applyMatrix4(c.makeRotationAxis(i[v],g*v)),o[v].crossVectors(i[v],s[v])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Zg extends Gi{constructor(e=0,t=0,r=1,i=1,s=0,o=Math.PI*2,a=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=c}getPoint(e,t){const r=t||new Me,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(o?s=0:s=i),this.aClockwise===!0&&!o&&(s===i?s=-i:s=s-i);const a=this.aStartAngle+e*s;let c=this.aX+this.xRadius*Math.cos(a),f=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const d=Math.cos(this.aRotation),h=Math.sin(this.aRotation),p=c-this.aX,g=f-this.aY;c=p*d-g*h+this.aX,f=p*h+g*d+this.aY}return r.set(c,f)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class TL extends Zg{constructor(e,t,r,i,s,o){super(e,t,r,r,i,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function ES(){let n=0,e=0,t=0,r=0;function i(s,o,a,c){n=s,e=a,t=-3*s+3*o-2*a-c,r=2*s-2*o+a+c}return{initCatmullRom:function(s,o,a,c,f){i(o,a,f*(a-s),f*(c-o))},initNonuniformCatmullRom:function(s,o,a,c,f,d,h){let p=(o-s)/f-(a-s)/(f+d)+(a-o)/d,g=(a-o)/d-(c-o)/(d+h)+(c-a)/h;p*=d,g*=d,i(o,a,p,g)},calc:function(s){const o=s*s,a=o*s;return n+e*s+t*o+r*a}}}const bp=new I,Dy=new ES,Oy=new ES,ky=new ES;class CL extends Gi{constructor(e=[],t=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=i}getPoint(e,t=new I){const r=t,i=this.points,s=i.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),c=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:c===0&&a===s-1&&(a=s-2,c=1);let f,d;this.closed||a>0?f=i[(a-1)%s]:(bp.subVectors(i[0],i[1]).add(i[0]),f=bp);const h=i[a%s],p=i[(a+1)%s];if(this.closed||a+2<s?d=i[(a+2)%s]:(bp.subVectors(i[s-1],i[s-2]).add(i[s-1]),d=bp),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let v=Math.pow(f.distanceToSquared(h),g),y=Math.pow(h.distanceToSquared(p),g),x=Math.pow(p.distanceToSquared(d),g);y<1e-4&&(y=1),v<1e-4&&(v=y),x<1e-4&&(x=y),Dy.initNonuniformCatmullRom(f.x,h.x,p.x,d.x,v,y,x),Oy.initNonuniformCatmullRom(f.y,h.y,p.y,d.y,v,y,x),ky.initNonuniformCatmullRom(f.z,h.z,p.z,d.z,v,y,x)}else this.curveType==="catmullrom"&&(Dy.initCatmullRom(f.x,h.x,p.x,d.x,this.tension),Oy.initCatmullRom(f.y,h.y,p.y,d.y,this.tension),ky.initCatmullRom(f.z,h.z,p.z,d.z,this.tension));return r.set(Dy.calc(c),Oy.calc(c),ky.calc(c)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new I().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function d2(n,e,t,r,i){const s=(r-e)*.5,o=(i-t)*.5,a=n*n,c=n*a;return(2*t-2*r+s+o)*c+(-3*t+3*r-2*s-o)*a+s*n+t}function CW(n,e){const t=1-n;return t*t*e}function AW(n,e){return 2*(1-n)*n*e}function PW(n,e){return n*n*e}function df(n,e,t,r){return CW(n,e)+AW(n,t)+PW(n,r)}function RW(n,e){const t=1-n;return t*t*t*e}function LW(n,e){const t=1-n;return 3*t*t*n*e}function IW(n,e){return 3*(1-n)*n*n*e}function NW(n,e){return n*n*n*e}function hf(n,e,t,r,i){return RW(n,e)+LW(n,t)+IW(n,r)+NW(n,i)}class TS extends Gi{constructor(e=new Me,t=new Me,r=new Me,i=new Me){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new Me){const r=t,i=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set(hf(e,i.x,s.x,o.x,a.x),hf(e,i.y,s.y,o.y,a.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class AL extends Gi{constructor(e=new I,t=new I,r=new I,i=new I){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new I){const r=t,i=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set(hf(e,i.x,s.x,o.x,a.x),hf(e,i.y,s.y,o.y,a.y),hf(e,i.z,s.z,o.z,a.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Qg extends Gi{constructor(e=new Me,t=new Me){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Me){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const r=t||new Me;return r.copy(this.v2).sub(this.v1).normalize(),r}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class PL extends Gi{constructor(e=new I,t=new I){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new I){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class CS extends Gi{constructor(e=new Me,t=new Me,r=new Me){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new Me){const r=t,i=this.v0,s=this.v1,o=this.v2;return r.set(df(e,i.x,s.x,o.x),df(e,i.y,s.y,o.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class AS extends Gi{constructor(e=new I,t=new I,r=new I){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new I){const r=t,i=this.v0,s=this.v1,o=this.v2;return r.set(df(e,i.x,s.x,o.x),df(e,i.y,s.y,o.y),df(e,i.z,s.z,o.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class PS extends Gi{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Me){const r=t,i=this.points,s=(i.length-1)*e,o=Math.floor(s),a=s-o,c=i[o===0?o:o-1],f=i[o],d=i[o>i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return r.set(d2(a,c.x,f.x,d.x,h.x),d2(a,c.y,f.y,d.y,h.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new Me().fromArray(i))}return this}}var RS=Object.freeze({__proto__:null,ArcCurve:TL,CatmullRomCurve3:CL,CubicBezierCurve:TS,CubicBezierCurve3:AL,EllipseCurve:Zg,LineCurve:Qg,LineCurve3:PL,QuadraticBezierCurve:CS,QuadraticBezierCurve3:AS,SplineCurve:PS});class RL extends Gi{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Qg(t,e))}getPoint(e,t){const r=e*this.getLength(),i=this.getCurveLengths();let s=0;for(;s<i.length;){if(i[s]>=r){const o=i[s]-r,a=this.curves[s],c=a.getLength(),f=c===0?0:1-o/c;return a.getPointAt(f,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,i=this.curves.length;r<i;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let r;for(let i=0,s=this.curves;i<s.length;i++){const o=s[i],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,c=o.getPoints(a);for(let f=0;f<c.length;f++){const d=c[f];r&&r.equals(d)||(t.push(d),r=d)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(new RS[i.type]().fromJSON(i))}return this}}class Xf extends RL{constructor(e){super(),this.type="Path",this.currentPoint=new Me,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const r=new Qg(this.currentPoint.clone(),new Me(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,i){const s=new CS(this.currentPoint.clone(),new Me(e,t),new Me(r,i));return this.curves.push(s),this.currentPoint.set(r,i),this}bezierCurveTo(e,t,r,i,s,o){const a=new TS(this.currentPoint.clone(),new Me(e,t),new Me(r,i),new Me(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),r=new PS(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,i,s,o){const a=this.currentPoint.x,c=this.currentPoint.y;return this.absarc(e+a,t+c,r,i,s,o),this}absarc(e,t,r,i,s,o){return this.absellipse(e,t,r,r,i,s,o),this}ellipse(e,t,r,i,s,o,a,c){const f=this.currentPoint.x,d=this.currentPoint.y;return this.absellipse(e+f,t+d,r,i,s,o,a,c),this}absellipse(e,t,r,i,s,o,a,c){const f=new Zg(e,t,r,i,s,o,a,c);if(this.curves.length>0){const h=f.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(f);const d=f.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class $u extends ht{constructor(e=[new Me(0,-.5),new Me(.5,0),new Me(0,.5)],t=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=xn(i,0,Math.PI*2);const s=[],o=[],a=[],c=[],f=[],d=1/t,h=new I,p=new Me,g=new I,v=new I,y=new I;let x=0,w=0;for(let _=0;_<=e.length-1;_++)switch(_){case 0:x=e[_+1].x-e[_].x,w=e[_+1].y-e[_].y,g.x=w*1,g.y=-x,g.z=w*0,y.copy(g),g.normalize(),c.push(g.x,g.y,g.z);break;case e.length-1:c.push(y.x,y.y,y.z);break;default:x=e[_+1].x-e[_].x,w=e[_+1].y-e[_].y,g.x=w*1,g.y=-x,g.z=w*0,v.copy(g),g.x+=y.x,g.y+=y.y,g.z+=y.z,g.normalize(),c.push(g.x,g.y,g.z),y.copy(v)}for(let _=0;_<=t;_++){const M=r+_*d*i,E=Math.sin(M),C=Math.cos(M);for(let P=0;P<=e.length-1;P++){h.x=e[P].x*E,h.y=e[P].y,h.z=e[P].x*C,o.push(h.x,h.y,h.z),p.x=_/t,p.y=P/(e.length-1),a.push(p.x,p.y);const R=c[3*P+0]*E,T=c[3*P+1],L=c[3*P+0]*C;f.push(R,T,L)}}for(let _=0;_<t;_++)for(let M=0;M<e.length-1;M++){const E=M+_*e.length,C=E,P=E+e.length,R=E+e.length+1,T=E+1;s.push(C,P,T),s.push(R,T,P)}this.setIndex(s),this.setAttribute("position",new Xe(o,3)),this.setAttribute("uv",new Xe(a,2)),this.setAttribute("normal",new Xe(f,3))}static fromJSON(e){return new $u(e.points,e.segments,e.phiStart,e.phiLength)}}class gd extends $u{constructor(e=1,t=1,r=4,i=8){const s=new Xf;s.absarc(0,-t/2,e,Math.PI*1.5,0),s.absarc(0,t/2,e,0,Math.PI*.5),super(s.getPoints(r),i),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:r,radialSegments:i}}static fromJSON(e){return new gd(e.radius,e.length,e.capSegments,e.radialSegments)}}class vd extends ht{constructor(e=1,t=8,r=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:i},t=Math.max(3,t);const s=[],o=[],a=[],c=[],f=new I,d=new Me;o.push(0,0,0),a.push(0,0,1),c.push(.5,.5);for(let h=0,p=3;h<=t;h++,p+=3){const g=r+h/t*i;f.x=e*Math.cos(g),f.y=e*Math.sin(g),o.push(f.x,f.y,f.z),a.push(0,0,1),d.x=(o[p]/e+1)/2,d.y=(o[p+1]/e+1)/2,c.push(d.x,d.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Xe(o,3)),this.setAttribute("normal",new Xe(a,3)),this.setAttribute("uv",new Xe(c,2))}static fromJSON(e){return new vd(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Bn extends ht{constructor(e=1,t=1,r=1,i=8,s=1,o=!1,a=0,c=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:c};const f=this;i=Math.floor(i),s=Math.floor(s);const d=[],h=[],p=[],g=[];let v=0;const y=[],x=r/2;let w=0;_(),o===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(d),this.setAttribute("position",new Xe(h,3)),this.setAttribute("normal",new Xe(p,3)),this.setAttribute("uv",new Xe(g,2));function _(){const E=new I,C=new I;let P=0;const R=(t-e)/r;for(let T=0;T<=s;T++){const L=[],D=T/s,Y=D*(t-e)+e;for(let fe=0;fe<=i;fe++){const q=fe/i,$=q*c+a,se=Math.sin($),le=Math.cos($);C.x=Y*se,C.y=-D*r+x,C.z=Y*le,h.push(C.x,C.y,C.z),E.set(se,R,le).normalize(),p.push(E.x,E.y,E.z),g.push(q,1-D),L.push(v++)}y.push(L)}for(let T=0;T<i;T++)for(let L=0;L<s;L++){const D=y[L][T],Y=y[L+1][T],fe=y[L+1][T+1],q=y[L][T+1];d.push(D,Y,q),d.push(Y,fe,q),P+=6}f.addGroup(w,P,0),w+=P}function M(E){const C=v,P=new Me,R=new I;let T=0;const L=E===!0?e:t,D=E===!0?1:-1;for(let fe=1;fe<=i;fe++)h.push(0,x*D,0),p.push(0,D,0),g.push(.5,.5),v++;const Y=v;for(let fe=0;fe<=i;fe++){const $=fe/i*c+a,se=Math.cos($),le=Math.sin($);R.x=L*le,R.y=x*D,R.z=L*se,h.push(R.x,R.y,R.z),p.push(0,D,0),P.x=se*.5+.5,P.y=le*.5*D+.5,g.push(P.x,P.y),v++}for(let fe=0;fe<i;fe++){const q=C+fe,$=Y+fe;E===!0?d.push($,$+1,q):d.push($+1,$,q),T+=3}f.addGroup(w,T,E===!0?1:2),w+=T}}static fromJSON(e){return new Bn(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class yd extends Bn{constructor(e=1,t=1,r=8,i=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,r,i,s,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new yd(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Qs extends ht{constructor(e=[],t=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:i};const s=[],o=[];a(i),f(r),d(),this.setAttribute("position",new Xe(s,3)),this.setAttribute("normal",new Xe(s.slice(),3)),this.setAttribute("uv",new Xe(o,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function a(_){const M=new I,E=new I,C=new I;for(let P=0;P<t.length;P+=3)g(t[P+0],M),g(t[P+1],E),g(t[P+2],C),c(M,E,C,_)}function c(_,M,E,C){const P=C+1,R=[];for(let T=0;T<=P;T++){R[T]=[];const L=_.clone().lerp(E,T/P),D=M.clone().lerp(E,T/P),Y=P-T;for(let fe=0;fe<=Y;fe++)fe===0&&T===P?R[T][fe]=L:R[T][fe]=L.clone().lerp(D,fe/Y)}for(let T=0;T<P;T++)for(let L=0;L<2*(P-T)-1;L++){const D=Math.floor(L/2);L%2===0?(p(R[T][D+1]),p(R[T+1][D]),p(R[T][D])):(p(R[T][D+1]),p(R[T+1][D+1]),p(R[T+1][D]))}}function f(_){const M=new I;for(let E=0;E<s.length;E+=3)M.x=s[E+0],M.y=s[E+1],M.z=s[E+2],M.normalize().multiplyScalar(_),s[E+0]=M.x,s[E+1]=M.y,s[E+2]=M.z}function d(){const _=new I;for(let M=0;M<s.length;M+=3){_.x=s[M+0],_.y=s[M+1],_.z=s[M+2];const E=x(_)/2/Math.PI+.5,C=w(_)/Math.PI+.5;o.push(E,1-C)}v(),h()}function h(){for(let _=0;_<o.length;_+=6){const M=o[_+0],E=o[_+2],C=o[_+4],P=Math.max(M,E,C),R=Math.min(M,E,C);P>.9&&R<.1&&(M<.2&&(o[_+0]+=1),E<.2&&(o[_+2]+=1),C<.2&&(o[_+4]+=1))}}function p(_){s.push(_.x,_.y,_.z)}function g(_,M){const E=_*3;M.x=e[E+0],M.y=e[E+1],M.z=e[E+2]}function v(){const _=new I,M=new I,E=new I,C=new I,P=new Me,R=new Me,T=new Me;for(let L=0,D=0;L<s.length;L+=9,D+=6){_.set(s[L+0],s[L+1],s[L+2]),M.set(s[L+3],s[L+4],s[L+5]),E.set(s[L+6],s[L+7],s[L+8]),P.set(o[D+0],o[D+1]),R.set(o[D+2],o[D+3]),T.set(o[D+4],o[D+5]),C.copy(_).add(M).add(E).divideScalar(3);const Y=x(C);y(P,D+0,_,Y),y(R,D+2,M,Y),y(T,D+4,E,Y)}}function y(_,M,E,C){C<0&&_.x===1&&(o[M]=_.x-1),E.x===0&&E.z===0&&(o[M]=C/2/Math.PI+.5)}function x(_){return Math.atan2(_.z,-_.x)}function w(_){return Math.atan2(-_.y,Math.sqrt(_.x*_.x+_.z*_.z))}}static fromJSON(e){return new Qs(e.vertices,e.indices,e.radius,e.details)}}class _d extends Qs{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,i=1/r,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new _d(e.radius,e.detail)}}const Ep=new I,Tp=new I,zy=new I,Cp=new vi;class LL extends ht{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const i=Math.pow(10,4),s=Math.cos(Ua*t),o=e.getIndex(),a=e.getAttribute("position"),c=o?o.count:a.count,f=[0,0,0],d=["a","b","c"],h=new Array(3),p={},g=[];for(let v=0;v<c;v+=3){o?(f[0]=o.getX(v),f[1]=o.getX(v+1),f[2]=o.getX(v+2)):(f[0]=v,f[1]=v+1,f[2]=v+2);const{a:y,b:x,c:w}=Cp;if(y.fromBufferAttribute(a,f[0]),x.fromBufferAttribute(a,f[1]),w.fromBufferAttribute(a,f[2]),Cp.getNormal(zy),h[0]=`${Math.round(y.x*i)},${Math.round(y.y*i)},${Math.round(y.z*i)}`,h[1]=`${Math.round(x.x*i)},${Math.round(x.y*i)},${Math.round(x.z*i)}`,h[2]=`${Math.round(w.x*i)},${Math.round(w.y*i)},${Math.round(w.z*i)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let _=0;_<3;_++){const M=(_+1)%3,E=h[_],C=h[M],P=Cp[d[_]],R=Cp[d[M]],T=`${E}_${C}`,L=`${C}_${E}`;L in p&&p[L]?(zy.dot(p[L].normal)<=s&&(g.push(P.x,P.y,P.z),g.push(R.x,R.y,R.z)),p[L]=null):T in p||(p[T]={index0:f[_],index1:f[M],normal:zy.clone()})}}for(const v in p)if(p[v]){const{index0:y,index1:x}=p[v];Ep.fromBufferAttribute(a,y),Tp.fromBufferAttribute(a,x),g.push(Ep.x,Ep.y,Ep.z),g.push(Tp.x,Tp.y,Tp.z)}this.setAttribute("position",new Xe(g,3))}}}class Ga extends Xf{constructor(e){super(e),this.uuid=Xr(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let r=0,i=this.holes.length;r<i;r++)t[r]=this.holes[r].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(new Xf().fromJSON(i))}return this}}const DW={triangulate:function(n,e,t=2){const r=e&&e.length,i=r?e[0]*t:n.length;let s=IL(n,0,i,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,c,f,d,h,p,g;if(r&&(s=UW(n,e,s,t)),n.length>80*t){a=f=n[0],c=d=n[1];for(let v=t;v<i;v+=t)h=n[v],p=n[v+1],h<a&&(a=h),p<c&&(c=p),h>f&&(f=h),p>d&&(d=p);g=Math.max(f-a,d-c),g=g!==0?1/g:0}return Yf(s,o,t,a,c,g),o}};function IL(n,e,t,r,i){let s,o;if(i===ZW(n,e,t,r)>0)for(s=e;s<t;s+=r)o=h2(s,n[s],n[s+1],o);else for(s=t-r;s>=e;s-=r)o=h2(s,n[s],n[s+1],o);return o&&Kg(o,o.next)&&(Zf(o),o=o.next),o}function Wo(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(Kg(t,t.next)||cn(t.prev,t,t.next)===0)){if(Zf(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Yf(n,e,t,r,i,s,o){if(!n)return;!o&&s&&WW(n,r,i,s);let a=n,c,f;for(;n.prev!==n.next;){if(c=n.prev,f=n.next,s?kW(n,r,i,s):OW(n)){e.push(c.i/t),e.push(n.i/t),e.push(f.i/t),Zf(n),n=f.next,a=f.next;continue}if(n=f,n===a){o?o===1?(n=zW(Wo(n),e,t),Yf(n,e,t,r,i,s,2)):o===2&&FW(n,e,t,r,i,s):Yf(Wo(n),e,t,r,i,s,1);break}}}function OW(n){const e=n.prev,t=n,r=n.next;if(cn(e,t,r)>=0)return!1;let i=n.next.next;for(;i!==n.prev;){if(hu(e.x,e.y,t.x,t.y,r.x,r.y,i.x,i.y)&&cn(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function kW(n,e,t,r){const i=n.prev,s=n,o=n.next;if(cn(i,s,o)>=0)return!1;const a=i.x<s.x?i.x<o.x?i.x:o.x:s.x<o.x?s.x:o.x,c=i.y<s.y?i.y<o.y?i.y:o.y:s.y<o.y?s.y:o.y,f=i.x>s.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,d=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=zx(a,c,e,t,r),p=zx(f,d,e,t,r);let g=n.prevZ,v=n.nextZ;for(;g&&g.z>=h&&v&&v.z<=p;){if(g!==n.prev&&g!==n.next&&hu(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&cn(g.prev,g,g.next)>=0||(g=g.prevZ,v!==n.prev&&v!==n.next&&hu(i.x,i.y,s.x,s.y,o.x,o.y,v.x,v.y)&&cn(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;g&&g.z>=h;){if(g!==n.prev&&g!==n.next&&hu(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&cn(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;v&&v.z<=p;){if(v!==n.prev&&v!==n.next&&hu(i.x,i.y,s.x,s.y,o.x,o.y,v.x,v.y)&&cn(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function zW(n,e,t){let r=n;do{const i=r.prev,s=r.next.next;!Kg(i,s)&&NL(i,r,r.next,s)&&qf(i,s)&&qf(s,i)&&(e.push(i.i/t),e.push(r.i/t),e.push(s.i/t),Zf(r),Zf(r.next),r=n=s),r=r.next}while(r!==n);return Wo(r)}function FW(n,e,t,r,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&XW(o,a)){let c=DL(o,a);o=Wo(o,o.next),c=Wo(c,c.next),Yf(o,e,t,r,i,s),Yf(c,e,t,r,i,s);return}a=a.next}o=o.next}while(o!==n)}function UW(n,e,t,r){const i=[];let s,o,a,c,f;for(s=0,o=e.length;s<o;s++)a=e[s]*r,c=s<o-1?e[s+1]*r:n.length,f=IL(n,a,c,r,!1),f===f.next&&(f.steiner=!0),i.push(jW(f));for(i.sort(BW),s=0;s<i.length;s++)VW(i[s],t),t=Wo(t,t.next);return t}function BW(n,e){return n.x-e.x}function VW(n,e){if(e=GW(n,e),e){const t=DL(e,n);Wo(e,e.next),Wo(t,t.next)}}function GW(n,e){let t=e;const r=n.x,i=n.y;let s=-1/0,o;do{if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const p=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=r&&p>s){if(s=p,p===r){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(r===s)return o;const a=o,c=o.x,f=o.y;let d=1/0,h;t=o;do r>=t.x&&t.x>=c&&r!==t.x&&hu(i<f?r:s,i,c,f,i<f?s:r,i,t.x,t.y)&&(h=Math.abs(i-t.y)/(r-t.x),qf(t,n)&&(h<d||h===d&&(t.x>o.x||t.x===o.x&&HW(o,t)))&&(o=t,d=h)),t=t.next;while(t!==a);return o}function HW(n,e){return cn(n.prev,n,e.prev)<0&&cn(e.next,n,n.next)<0}function WW(n,e,t,r){let i=n;do i.z===null&&(i.z=zx(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,$W(i)}function $W(n){let e,t,r,i,s,o,a,c,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,r=t,a=0,e=0;e<f&&(a++,r=r.nextZ,!!r);e++);for(c=f;a>0||c>0&&r;)a!==0&&(c===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,a--):(i=r,r=r.nextZ,c--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=r}s.nextZ=null,f*=2}while(o>1);return n}function zx(n,e,t,r,i){return n=32767*(n-t)*i,e=32767*(e-r)*i,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function jW(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function hu(n,e,t,r,i,s,o,a){return(i-o)*(e-a)-(n-o)*(s-a)>=0&&(n-o)*(r-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(r-a)>=0}function XW(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!YW(n,e)&&(qf(n,e)&&qf(e,n)&&qW(n,e)&&(cn(n.prev,n,e.prev)||cn(n,e.prev,e))||Kg(n,e)&&cn(n.prev,n,n.next)>0&&cn(e.prev,e,e.next)>0)}function cn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Kg(n,e){return n.x===e.x&&n.y===e.y}function NL(n,e,t,r){const i=Pp(cn(n,e,t)),s=Pp(cn(n,e,r)),o=Pp(cn(t,r,n)),a=Pp(cn(t,r,e));return!!(i!==s&&o!==a||i===0&&Ap(n,t,e)||s===0&&Ap(n,r,e)||o===0&&Ap(t,n,r)||a===0&&Ap(t,e,r))}function Ap(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Pp(n){return n>0?1:n<0?-1:0}function YW(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&NL(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function qf(n,e){return cn(n.prev,n,n.next)<0?cn(n,e,n.next)>=0&&cn(n,n.prev,e)>=0:cn(n,e,n.prev)<0||cn(n,n.next,e)<0}function qW(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function DL(n,e){const t=new Fx(n.i,n.x,n.y),r=new Fx(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function h2(n,e,t,r){const i=new Fx(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Zf(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Fx(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ZW(n,e,t,r){let i=0;for(let s=e,o=t-r;s<t;s+=r)i+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return i}class cs{static area(e){const t=e.length;let r=0;for(let i=t-1,s=0;s<t;i=s++)r+=e[i].x*e[s].y-e[s].x*e[i].y;return r*.5}static isClockWise(e){return cs.area(e)<0}static triangulateShape(e,t){const r=[],i=[],s=[];p2(e),m2(r,e);let o=e.length;t.forEach(p2);for(let c=0;c<t.length;c++)i.push(o),o+=t[c].length,m2(r,t[c]);const a=DW.triangulate(r,i);for(let c=0;c<a.length;c+=3)s.push(a.slice(c,c+3));return s}}function p2(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function m2(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class xd extends ht{constructor(e=new Ga([new Me(.5,.5),new Me(-.5,.5),new Me(-.5,-.5),new Me(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const r=this,i=[],s=[];for(let a=0,c=e.length;a<c;a++){const f=e[a];o(f)}this.setAttribute("position",new Xe(i,3)),this.setAttribute("uv",new Xe(s,2)),this.computeVertexNormals();function o(a){const c=[],f=t.curveSegments!==void 0?t.curveSegments:12,d=t.steps!==void 0?t.steps:1,h=t.depth!==void 0?t.depth:1;let p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:.2,v=t.bevelSize!==void 0?t.bevelSize:g-.1,y=t.bevelOffset!==void 0?t.bevelOffset:0,x=t.bevelSegments!==void 0?t.bevelSegments:3;const w=t.extrudePath,_=t.UVGenerator!==void 0?t.UVGenerator:QW;let M,E=!1,C,P,R,T;w&&(M=w.getSpacedPoints(d),E=!0,p=!1,C=w.computeFrenetFrames(d,!1),P=new I,R=new I,T=new I),p||(x=0,g=0,v=0,y=0);const L=a.extractPoints(f);let D=L.shape;const Y=L.holes;if(!cs.isClockWise(D)){D=D.reverse();for(let ue=0,ne=Y.length;ue<ne;ue++){const Ee=Y[ue];cs.isClockWise(Ee)&&(Y[ue]=Ee.reverse())}}const q=cs.triangulateShape(D,Y),$=D;for(let ue=0,ne=Y.length;ue<ne;ue++){const Ee=Y[ue];D=D.concat(Ee)}function se(ue,ne,Ee){return ne||console.error("THREE.ExtrudeGeometry: vec does not exist"),ne.clone().multiplyScalar(Ee).add(ue)}const le=D.length,pe=q.length;function z(ue,ne,Ee){let Ue,Le,qe;const et=ue.x-ne.x,tt=ue.y-ne.y,Ct=Ee.x-ue.x,Nt=Ee.y-ue.y,H=et*et+tt*tt,O=et*Nt-tt*Ct;if(Math.abs(O)>Number.EPSILON){const ce=Math.sqrt(H),Pe=Math.sqrt(Ct*Ct+Nt*Nt),Ne=ne.x-tt/ce,ze=ne.y+et/ce,st=Ee.x-Nt/Pe,Be=Ee.y+Ct/Pe,Se=((st-Ne)*Nt-(Be-ze)*Ct)/(et*Nt-tt*Ct);Ue=Ne+et*Se-ue.x,Le=ze+tt*Se-ue.y;const Je=Ue*Ue+Le*Le;if(Je<=2)return new Me(Ue,Le);qe=Math.sqrt(Je/2)}else{let ce=!1;et>Number.EPSILON?Ct>Number.EPSILON&&(ce=!0):et<-Number.EPSILON?Ct<-Number.EPSILON&&(ce=!0):Math.sign(tt)===Math.sign(Nt)&&(ce=!0),ce?(Ue=-tt,Le=et,qe=Math.sqrt(H)):(Ue=et,Le=tt,qe=Math.sqrt(H/2))}return new Me(Ue/qe,Le/qe)}const F=[];for(let ue=0,ne=$.length,Ee=ne-1,Ue=ue+1;ue<ne;ue++,Ee++,Ue++)Ee===ne&&(Ee=0),Ue===ne&&(Ue=0),F[ue]=z($[ue],$[Ee],$[Ue]);const G=[];let Z,k=F.concat();for(let ue=0,ne=Y.length;ue<ne;ue++){const Ee=Y[ue];Z=[];for(let Ue=0,Le=Ee.length,qe=Le-1,et=Ue+1;Ue<Le;Ue++,qe++,et++)qe===Le&&(qe=0),et===Le&&(et=0),Z[Ue]=z(Ee[Ue],Ee[qe],Ee[et]);G.push(Z),k=k.concat(Z)}for(let ue=0;ue<x;ue++){const ne=ue/x,Ee=g*Math.cos(ne*Math.PI/2),Ue=v*Math.sin(ne*Math.PI/2)+y;for(let Le=0,qe=$.length;Le<qe;Le++){const et=se($[Le],F[Le],Ue);Te(et.x,et.y,-Ee)}for(let Le=0,qe=Y.length;Le<qe;Le++){const et=Y[Le];Z=G[Le];for(let tt=0,Ct=et.length;tt<Ct;tt++){const Nt=se(et[tt],Z[tt],Ue);Te(Nt.x,Nt.y,-Ee)}}}const W=v+y;for(let ue=0;ue<le;ue++){const ne=p?se(D[ue],k[ue],W):D[ue];E?(R.copy(C.normals[0]).multiplyScalar(ne.x),P.copy(C.binormals[0]).multiplyScalar(ne.y),T.copy(M[0]).add(R).add(P),Te(T.x,T.y,T.z)):Te(ne.x,ne.y,0)}for(let ue=1;ue<=d;ue++)for(let ne=0;ne<le;ne++){const Ee=p?se(D[ne],k[ne],W):D[ne];E?(R.copy(C.normals[ue]).multiplyScalar(Ee.x),P.copy(C.binormals[ue]).multiplyScalar(Ee.y),T.copy(M[ue]).add(R).add(P),Te(T.x,T.y,T.z)):Te(Ee.x,Ee.y,h/d*ue)}for(let ue=x-1;ue>=0;ue--){const ne=ue/x,Ee=g*Math.cos(ne*Math.PI/2),Ue=v*Math.sin(ne*Math.PI/2)+y;for(let Le=0,qe=$.length;Le<qe;Le++){const et=se($[Le],F[Le],Ue);Te(et.x,et.y,h+Ee)}for(let Le=0,qe=Y.length;Le<qe;Le++){const et=Y[Le];Z=G[Le];for(let tt=0,Ct=et.length;tt<Ct;tt++){const Nt=se(et[tt],Z[tt],Ue);E?Te(Nt.x,Nt.y+M[d-1].y,M[d-1].x+Ee):Te(Nt.x,Nt.y,h+Ee)}}}N(),me();function N(){const ue=i.length/3;if(p){let ne=0,Ee=le*ne;for(let Ue=0;Ue<pe;Ue++){const Le=q[Ue];Ce(Le[2]+Ee,Le[1]+Ee,Le[0]+Ee)}ne=d+x*2,Ee=le*ne;for(let Ue=0;Ue<pe;Ue++){const Le=q[Ue];Ce(Le[0]+Ee,Le[1]+Ee,Le[2]+Ee)}}else{for(let ne=0;ne<pe;ne++){const Ee=q[ne];Ce(Ee[2],Ee[1],Ee[0])}for(let ne=0;ne<pe;ne++){const Ee=q[ne];Ce(Ee[0]+le*d,Ee[1]+le*d,Ee[2]+le*d)}}r.addGroup(ue,i.length/3-ue,0)}function me(){const ue=i.length/3;let ne=0;X($,ne),ne+=$.length;for(let Ee=0,Ue=Y.length;Ee<Ue;Ee++){const Le=Y[Ee];X(Le,ne),ne+=Le.length}r.addGroup(ue,i.length/3-ue,1)}function X(ue,ne){let Ee=ue.length;for(;--Ee>=0;){const Ue=Ee;let Le=Ee-1;Le<0&&(Le=ue.length-1);for(let qe=0,et=d+x*2;qe<et;qe++){const tt=le*qe,Ct=le*(qe+1),Nt=ne+Ue+tt,H=ne+Le+tt,O=ne+Le+Ct,ce=ne+Ue+Ct;we(Nt,H,O,ce)}}}function Te(ue,ne,Ee){c.push(ue),c.push(ne),c.push(Ee)}function Ce(ue,ne,Ee){be(ue),be(ne),be(Ee);const Ue=i.length/3,Le=_.generateTopUV(r,i,Ue-3,Ue-2,Ue-1);He(Le[0]),He(Le[1]),He(Le[2])}function we(ue,ne,Ee,Ue){be(ue),be(ne),be(Ue),be(ne),be(Ee),be(Ue);const Le=i.length/3,qe=_.generateSideWallUV(r,i,Le-6,Le-3,Le-2,Le-1);He(qe[0]),He(qe[1]),He(qe[3]),He(qe[1]),He(qe[2]),He(qe[3])}function be(ue){i.push(c[ue*3+0]),i.push(c[ue*3+1]),i.push(c[ue*3+2])}function He(ue){s.push(ue.x),s.push(ue.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,r=this.parameters.options;return KW(t,r,e)}static fromJSON(e,t){const r=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];r.push(a)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new RS[i.type]().fromJSON(i)),new xd(r,e.options)}}const QW={generateTopUV:function(n,e,t,r,i){const s=e[t*3],o=e[t*3+1],a=e[r*3],c=e[r*3+1],f=e[i*3],d=e[i*3+1];return[new Me(s,o),new Me(a,c),new Me(f,d)]},generateSideWallUV:function(n,e,t,r,i,s){const o=e[t*3],a=e[t*3+1],c=e[t*3+2],f=e[r*3],d=e[r*3+1],h=e[r*3+2],p=e[i*3],g=e[i*3+1],v=e[i*3+2],y=e[s*3],x=e[s*3+1],w=e[s*3+2];return Math.abs(a-d)<Math.abs(o-f)?[new Me(o,1-c),new Me(f,1-h),new Me(p,1-v),new Me(y,1-w)]:[new Me(a,1-c),new Me(d,1-h),new Me(g,1-v),new Me(x,1-w)]}};function KW(n,e,t){if(t.shapes=[],Array.isArray(n))for(let r=0,i=n.length;r<i;r++){const s=n[r];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class Sd extends Qs{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,i=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(i,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Sd(e.radius,e.detail)}}class Vr extends Qs{constructor(e=1,t=0){const r=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(r,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Vr(e.radius,e.detail)}}class wd extends ht{constructor(e=.5,t=1,r=8,i=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:i,thetaStart:s,thetaLength:o},r=Math.max(3,r),i=Math.max(1,i);const a=[],c=[],f=[],d=[];let h=e;const p=(t-e)/i,g=new I,v=new Me;for(let y=0;y<=i;y++){for(let x=0;x<=r;x++){const w=s+x/r*o;g.x=h*Math.cos(w),g.y=h*Math.sin(w),c.push(g.x,g.y,g.z),f.push(0,0,1),v.x=(g.x/t+1)/2,v.y=(g.y/t+1)/2,d.push(v.x,v.y)}h+=p}for(let y=0;y<i;y++){const x=y*(r+1);for(let w=0;w<r;w++){const _=w+x,M=_,E=_+r+1,C=_+r+2,P=_+1;a.push(M,E,P),a.push(E,C,P)}}this.setIndex(a),this.setAttribute("position",new Xe(c,3)),this.setAttribute("normal",new Xe(f,3)),this.setAttribute("uv",new Xe(d,2))}static fromJSON(e){return new wd(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Md extends ht{constructor(e=new Ga([new Me(0,.5),new Me(-.5,-.5),new Me(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const r=[],i=[],s=[],o=[];let a=0,c=0;if(Array.isArray(e)===!1)f(e);else for(let d=0;d<e.length;d++)f(e[d]),this.addGroup(a,c,d),a+=c,c=0;this.setIndex(r),this.setAttribute("position",new Xe(i,3)),this.setAttribute("normal",new Xe(s,3)),this.setAttribute("uv",new Xe(o,2));function f(d){const h=i.length/3,p=d.extractPoints(t);let g=p.shape;const v=p.holes;cs.isClockWise(g)===!1&&(g=g.reverse());for(let x=0,w=v.length;x<w;x++){const _=v[x];cs.isClockWise(_)===!0&&(v[x]=_.reverse())}const y=cs.triangulateShape(g,v);for(let x=0,w=v.length;x<w;x++){const _=v[x];g=g.concat(_)}for(let x=0,w=g.length;x<w;x++){const _=g[x];i.push(_.x,_.y,0),s.push(0,0,1),o.push(_.x,_.y)}for(let x=0,w=y.length;x<w;x++){const _=y[x],M=_[0]+h,E=_[1]+h,C=_[2]+h;r.push(M,E,C),c+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return JW(t,e)}static fromJSON(e,t){const r=[];for(let i=0,s=e.shapes.length;i<s;i++){const o=t[e.shapes[i]];r.push(o)}return new Md(r,e.curveSegments)}}function JW(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const i=n[t];e.shapes.push(i.uuid)}else e.shapes.push(n.uuid);return e}class ul extends ht{constructor(e=1,t=32,r=16,i=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:i,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));const c=Math.min(o+a,Math.PI);let f=0;const d=[],h=new I,p=new I,g=[],v=[],y=[],x=[];for(let w=0;w<=r;w++){const _=[],M=w/r;let E=0;w==0&&o==0?E=.5/t:w==r&&c==Math.PI&&(E=-.5/t);for(let C=0;C<=t;C++){const P=C/t;h.x=-e*Math.cos(i+P*s)*Math.sin(o+M*a),h.y=e*Math.cos(o+M*a),h.z=e*Math.sin(i+P*s)*Math.sin(o+M*a),v.push(h.x,h.y,h.z),p.copy(h).normalize(),y.push(p.x,p.y,p.z),x.push(P+E,1-M),_.push(f++)}d.push(_)}for(let w=0;w<r;w++)for(let _=0;_<t;_++){const M=d[w][_+1],E=d[w][_],C=d[w+1][_],P=d[w+1][_+1];(w!==0||o>0)&&g.push(M,E,P),(w!==r-1||c<Math.PI)&&g.push(E,C,P)}this.setIndex(g),this.setAttribute("position",new Xe(v,3)),this.setAttribute("normal",new Xe(y,3)),this.setAttribute("uv",new Xe(x,2))}static fromJSON(e){return new ul(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class bd extends Qs{constructor(e=1,t=0){const r=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(r,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new bd(e.radius,e.detail)}}class Bs extends ht{constructor(e=1,t=.4,r=8,i=6,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:i,arc:s},r=Math.floor(r),i=Math.floor(i);const o=[],a=[],c=[],f=[],d=new I,h=new I,p=new I;for(let g=0;g<=r;g++)for(let v=0;v<=i;v++){const y=v/i*s,x=g/r*Math.PI*2;h.x=(e+t*Math.cos(x))*Math.cos(y),h.y=(e+t*Math.cos(x))*Math.sin(y),h.z=t*Math.sin(x),a.push(h.x,h.y,h.z),d.x=e*Math.cos(y),d.y=e*Math.sin(y),p.subVectors(h,d).normalize(),c.push(p.x,p.y,p.z),f.push(v/i),f.push(g/r)}for(let g=1;g<=r;g++)for(let v=1;v<=i;v++){const y=(i+1)*g+v-1,x=(i+1)*(g-1)+v-1,w=(i+1)*(g-1)+v,_=(i+1)*g+v;o.push(y,x,_),o.push(x,w,_)}this.setIndex(o),this.setAttribute("position",new Xe(a,3)),this.setAttribute("normal",new Xe(c,3)),this.setAttribute("uv",new Xe(f,2))}static fromJSON(e){return new Bs(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Ed extends ht{constructor(e=1,t=.4,r=64,i=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:i,p:s,q:o},r=Math.floor(r),i=Math.floor(i);const a=[],c=[],f=[],d=[],h=new I,p=new I,g=new I,v=new I,y=new I,x=new I,w=new I;for(let M=0;M<=r;++M){const E=M/r*s*Math.PI*2;_(E,s,o,e,g),_(E+.01,s,o,e,v),x.subVectors(v,g),w.addVectors(v,g),y.crossVectors(x,w),w.crossVectors(y,x),y.normalize(),w.normalize();for(let C=0;C<=i;++C){const P=C/i*Math.PI*2,R=-t*Math.cos(P),T=t*Math.sin(P);h.x=g.x+(R*w.x+T*y.x),h.y=g.y+(R*w.y+T*y.y),h.z=g.z+(R*w.z+T*y.z),c.push(h.x,h.y,h.z),p.subVectors(h,g).normalize(),f.push(p.x,p.y,p.z),d.push(M/r),d.push(C/i)}}for(let M=1;M<=r;M++)for(let E=1;E<=i;E++){const C=(i+1)*(M-1)+(E-1),P=(i+1)*M+(E-1),R=(i+1)*M+E,T=(i+1)*(M-1)+E;a.push(C,P,T),a.push(P,R,T)}this.setIndex(a),this.setAttribute("position",new Xe(c,3)),this.setAttribute("normal",new Xe(f,3)),this.setAttribute("uv",new Xe(d,2));function _(M,E,C,P,R){const T=Math.cos(M),L=Math.sin(M),D=C/E*M,Y=Math.cos(D);R.x=P*(2+Y)*.5*T,R.y=P*(2+Y)*L*.5,R.z=P*Math.sin(D)*.5}}static fromJSON(e){return new Ed(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Td extends ht{constructor(e=new AS(new I(-1,-1,0),new I(-1,1,0),new I(1,1,0)),t=64,r=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:i,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new I,c=new I,f=new Me;let d=new I;const h=[],p=[],g=[],v=[];y(),this.setIndex(v),this.setAttribute("position",new Xe(h,3)),this.setAttribute("normal",new Xe(p,3)),this.setAttribute("uv",new Xe(g,2));function y(){for(let M=0;M<t;M++)x(M);x(s===!1?t:0),_(),w()}function x(M){d=e.getPointAt(M/t,d);const E=o.normals[M],C=o.binormals[M];for(let P=0;P<=i;P++){const R=P/i*Math.PI*2,T=Math.sin(R),L=-Math.cos(R);c.x=L*E.x+T*C.x,c.y=L*E.y+T*C.y,c.z=L*E.z+T*C.z,c.normalize(),p.push(c.x,c.y,c.z),a.x=d.x+r*c.x,a.y=d.y+r*c.y,a.z=d.z+r*c.z,h.push(a.x,a.y,a.z)}}function w(){for(let M=1;M<=t;M++)for(let E=1;E<=i;E++){const C=(i+1)*(M-1)+(E-1),P=(i+1)*M+(E-1),R=(i+1)*M+E,T=(i+1)*(M-1)+E;v.push(C,P,T),v.push(P,R,T)}}function _(){for(let M=0;M<=t;M++)for(let E=0;E<=i;E++)f.x=M/t,f.y=E/i,g.push(f.x,f.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Td(new RS[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class OL extends ht{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],r=new Set,i=new I,s=new I;if(e.index!==null){const o=e.attributes.position,a=e.index;let c=e.groups;c.length===0&&(c=[{start:0,count:a.count,materialIndex:0}]);for(let f=0,d=c.length;f<d;++f){const h=c[f],p=h.start,g=h.count;for(let v=p,y=p+g;v<y;v+=3)for(let x=0;x<3;x++){const w=a.getX(v+x),_=a.getX(v+(x+1)%3);i.fromBufferAttribute(o,w),s.fromBufferAttribute(o,_),g2(i,s,r)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,c=o.count/3;a<c;a++)for(let f=0;f<3;f++){const d=3*a+f,h=3*a+(f+1)%3;i.fromBufferAttribute(o,d),s.fromBufferAttribute(o,h),g2(i,s,r)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new Xe(t,3))}}}function g2(n,e,t){const r=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(r)===!0||t.has(i)===!0?!1:(t.add(r),t.add(i),!0)}var v2=Object.freeze({__proto__:null,BoxGeometry:hr,CapsuleGeometry:gd,CircleGeometry:vd,ConeGeometry:yd,CylinderGeometry:Bn,DodecahedronGeometry:_d,EdgesGeometry:LL,ExtrudeGeometry:xd,IcosahedronGeometry:Sd,LatheGeometry:$u,OctahedronGeometry:Vr,PlaneGeometry:Gr,PolyhedronGeometry:Qs,RingGeometry:wd,ShapeGeometry:Md,SphereGeometry:ul,TetrahedronGeometry:bd,TorusGeometry:Bs,TorusKnotGeometry:Ed,TubeGeometry:Td,WireframeGeometry:OL});class kL extends qn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ge(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class zL extends fs{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class LS extends qn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ge(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ge(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new Me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class FL extends LS{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Me(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return xn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ge(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ge(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ge(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._iridescence=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class UL extends qn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ge(16777215),this.specular=new Ge(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ge(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new Me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=cd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class BL extends qn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ge(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ge(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new Me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class VL extends qn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new Me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class GL extends qn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ge(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ge(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new Me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=cd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class HL extends qn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ge(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new Me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class WL extends lr{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function hi(n,e,t){return IS(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function La(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function IS(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function $L(n){function e(i,s){return n[i]-n[s]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function Ux(n,e,t){const r=n.length,i=new n.constructor(r);for(let s=0,o=0;o!==r;++s){const a=t[s]*e;for(let c=0;c!==e;++c)i[o++]=n[a+c]}return i}function NS(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=n[i++];while(s!==void 0)}function e9(n,e,t,r,i=30){const s=n.clone();s.name=e;const o=[];for(let c=0;c<s.tracks.length;++c){const f=s.tracks[c],d=f.getValueSize(),h=[],p=[];for(let g=0;g<f.times.length;++g){const v=f.times[g]*i;if(!(v<t||v>=r)){h.push(f.times[g]);for(let y=0;y<d;++y)p.push(f.values[g*d+y])}}h.length!==0&&(f.times=La(h,f.times.constructor),f.values=La(p,f.values.constructor),o.push(f))}s.tracks=o;let a=1/0;for(let c=0;c<s.tracks.length;++c)a>s.tracks[c].times[0]&&(a=s.tracks[c].times[0]);for(let c=0;c<s.tracks.length;++c)s.tracks[c].shift(-1*a);return s.resetDuration(),s}function t9(n,e=0,t=n,r=30){r<=0&&(r=30);const i=t.tracks.length,s=e/r;for(let o=0;o<i;++o){const a=t.tracks[o],c=a.ValueTypeName;if(c==="bool"||c==="string")continue;const f=n.tracks.find(function(w){return w.name===a.name&&w.ValueTypeName===c});if(f===void 0)continue;let d=0;const h=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(d=h/3);let p=0;const g=f.getValueSize();f.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=g/3);const v=a.times.length-1;let y;if(s<=a.times[0]){const w=d,_=h-d;y=hi(a.values,w,_)}else if(s>=a.times[v]){const w=v*h+d,_=w+h-d;y=hi(a.values,w,_)}else{const w=a.createInterpolant(),_=d,M=h-d;w.evaluate(s),y=hi(w.resultBuffer,_,M)}c==="quaternion"&&new Gt().fromArray(y).normalize().conjugate().toArray(y);const x=f.times.length;for(let w=0;w<x;++w){const _=w*g+p;if(c==="quaternion")Gt.multiplyQuaternionsFlat(f.values,_,y,0,f.values,_);else{const M=g-p*2;for(let E=0;E<M;++E)f.values[_+E]-=y[E]}}}return n.blendMode=fS,n}var n9=Object.freeze({__proto__:null,arraySlice:hi,convertArray:La,isTypedArray:IS,getKeyframeOrder:$L,sortedArray:Ux,flattenJSON:NS,subclip:e9,makeClipAdditive:t9});class Cd{constructor(e,t,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,i=t[r],s=t[r-1];e:{t:{let o;n:{r:if(!(e<i)){for(let a=r+2;;){if(i===void 0){if(e<s)break r;return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===a)break;if(s=i,i=t[++r],e<i)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(r=2,s=a);for(let c=r-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===c)break;if(i=s,s=t[--r-1],e>=s)break t}o=r,r=0;break n}break e}for(;r<o;){const a=r+o>>>1;e<t[a]?o=a:r=a+1}if(i=t[r],s=t[r-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,s,i)}return this.interpolate_(r,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=r[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class jL extends Cd{constructor(e,t,r,i){super(e,t,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Aa,endingEnd:Aa}}intervalChanged_(e,t,r){const i=this.parameterPositions;let s=e-2,o=e+1,a=i[s],c=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case Pa:s=e,a=2*t-r;break;case Hf:s=i.length-2,a=t+i[s]-i[s+1];break;default:s=e,a=r}if(c===void 0)switch(this.getSettings_().endingEnd){case Pa:o=e,c=2*r-t;break;case Hf:o=1,c=r+i[1]-i[0];break;default:o=e-1,c=t}const f=(r-t)*.5,d=this.valueSize;this._weightPrev=f/(t-a),this._weightNext=f/(c-r),this._offsetPrev=s*d,this._offsetNext=o*d}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,f=c-a,d=this._offsetPrev,h=this._offsetNext,p=this._weightPrev,g=this._weightNext,v=(r-t)/(i-t),y=v*v,x=y*v,w=-p*x+2*p*y-p*v,_=(1+p)*x+(-1.5-2*p)*y+(-.5+p)*v+1,M=(-1-g)*x+(1.5+g)*y+.5*v,E=g*x-g*y;for(let C=0;C!==a;++C)s[C]=w*o[d+C]+_*o[f+C]+M*o[c+C]+E*o[h+C];return s}}class DS extends Cd{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,f=c-a,d=(r-t)/(i-t),h=1-d;for(let p=0;p!==a;++p)s[p]=o[f+p]*h+o[c+p]*d;return s}}class XL extends Cd{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Hi{constructor(e,t,r,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=La(t,this.TimeBufferType),this.values=La(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:La(e.times,Array),values:La(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new XL(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new DS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new jL(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Vf:t=this.InterpolantFactoryMethodDiscrete;break;case Gf:t=this.InterpolantFactoryMethodLinear;break;case cm:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Vf;case this.InterpolantFactoryMethodLinear:return Gf;case this.InterpolantFactoryMethodSmooth:return cm}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]*=e}return this}trim(e,t){const r=this.times,i=r.length;let s=0,o=i-1;for(;s!==i&&r[s]<e;)++s;for(;o!==-1&&r[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=hi(r,s,o),this.values=hi(this.values,s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const c=r[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(i!==void 0&&IS(i))for(let a=0,c=i.length;a!==c;++a){const f=i[a];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,f),e=!1;break}}return e}optimize(){const e=hi(this.times),t=hi(this.values),r=this.getValueSize(),i=this.getInterpolation()===cm,s=e.length-1;let o=1;for(let a=1;a<s;++a){let c=!1;const f=e[a],d=e[a+1];if(f!==d&&(a!==1||f!==e[0]))if(i)c=!0;else{const h=a*r,p=h-r,g=h+r;for(let v=0;v!==r;++v){const y=t[h+v];if(y!==t[p+v]||y!==t[g+v]){c=!0;break}}}if(c){if(a!==o){e[o]=e[a];const h=a*r,p=o*r;for(let g=0;g!==r;++g)t[p+g]=t[h+g]}++o}}if(s>0){e[o]=e[s];for(let a=s*r,c=o*r,f=0;f!==r;++f)t[c+f]=t[a+f];++o}return o!==e.length?(this.times=hi(e,0,o),this.values=hi(t,0,o*r)):(this.times=e,this.values=t),this}clone(){const e=hi(this.times,0),t=hi(this.values,0),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Hi.prototype.TimeBufferType=Float32Array;Hi.prototype.ValueBufferType=Float32Array;Hi.prototype.DefaultInterpolation=Gf;class cl extends Hi{}cl.prototype.ValueTypeName="bool";cl.prototype.ValueBufferType=Array;cl.prototype.DefaultInterpolation=Vf;cl.prototype.InterpolantFactoryMethodLinear=void 0;cl.prototype.InterpolantFactoryMethodSmooth=void 0;class OS extends Hi{}OS.prototype.ValueTypeName="color";class Qf extends Hi{}Qf.prototype.ValueTypeName="number";class YL extends Cd{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(r-t)/(i-t);let f=e*a;for(let d=f+a;f!==d;f+=4)Gt.slerpFlat(s,0,o,f-a,o,f,c);return s}}class ju extends Hi{InterpolantFactoryMethodLinear(e){return new YL(this.times,this.values,this.getValueSize(),e)}}ju.prototype.ValueTypeName="quaternion";ju.prototype.DefaultInterpolation=Gf;ju.prototype.InterpolantFactoryMethodSmooth=void 0;class fl extends Hi{}fl.prototype.ValueTypeName="string";fl.prototype.ValueBufferType=Array;fl.prototype.DefaultInterpolation=Vf;fl.prototype.InterpolantFactoryMethodLinear=void 0;fl.prototype.InterpolantFactoryMethodSmooth=void 0;class Kf extends Hi{}Kf.prototype.ValueTypeName="vector";class Jf{constructor(e,t=-1,r,i=Gg){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=Xr(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let o=0,a=r.length;o!==a;++o)t.push(i9(r[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(Hi.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const s=t.length,o=[];for(let a=0;a<s;a++){let c=[],f=[];c.push((a+s-1)%s,a,(a+1)%s),f.push(0,1,0);const d=$L(c);c=Ux(c,1,d),f=Ux(f,1,d),!i&&c[0]===0&&(c.push(s),f.push(f[0])),o.push(new Qf(".morphTargetInfluences["+t[a].name+"]",c,f).scale(1/r))}return new this(e,-1,o)}static findByName(e,t){let r=e;if(!Array.isArray(e)){const i=e;r=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<r.length;i++)if(r[i].name===t)return r[i];return null}static CreateClipsFromMorphTargetSequences(e,t,r){const i={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,c=e.length;a<c;a++){const f=e[a],d=f.name.match(s);if(d&&d.length>1){const h=d[1];let p=i[h];p||(i[h]=p=[]),p.push(f)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(h,p,g,v,y){if(g.length!==0){const x=[],w=[];NS(g,x,w,v),x.length!==0&&y.push(new h(p,x,w))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let c=e.length||-1;const f=e.hierarchy||[];for(let h=0;h<f.length;h++){const p=f[h].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const g={};let v;for(v=0;v<p.length;v++)if(p[v].morphTargets)for(let y=0;y<p[v].morphTargets.length;y++)g[p[v].morphTargets[y]]=-1;for(const y in g){const x=[],w=[];for(let _=0;_!==p[v].morphTargets.length;++_){const M=p[v];x.push(M.time),w.push(M.morphTarget===y?1:0)}i.push(new Qf(".morphTargetInfluence["+y+"]",x,w))}c=g.length*o}else{const g=".bones["+t[h].name+"]";r(Kf,g+".position",p,"pos",i),r(ju,g+".quaternion",p,"rot",i),r(Kf,g+".scale",p,"scl",i)}}return i.length===0?null:new this(s,c,i,a)}resetDuration(){const e=this.tracks;let t=0;for(let r=0,i=e.length;r!==i;++r){const s=this.tracks[r];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function r9(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Qf;case"vector":case"vector2":case"vector3":case"vector4":return Kf;case"color":return OS;case"quaternion":return ju;case"bool":case"boolean":return cl;case"string":return fl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function i9(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=r9(n.type);if(n.times===void 0){const t=[],r=[];NS(n.keys,t,r,"value"),n.times=t,n.values=r}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Ja={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class kS{constructor(e,t,r){const i=this;let s=!1,o=0,a=0,c;const f=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(d){a++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,a),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return c?c(d):d},this.setURLModifier=function(d){return c=d,this},this.addHandler=function(d,h){return f.push(d,h),this},this.removeHandler=function(d){const h=f.indexOf(d);return h!==-1&&f.splice(h,2),this},this.getHandler=function(d){for(let h=0,p=f.length;h<p;h+=2){const g=f[h],v=f[h+1];if(g.global&&(g.lastIndex=0),g.test(d))return v}return null}}}const qL=new kS;class Kr{constructor(e){this.manager=e!==void 0?e:qL,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const r=this;return new Promise(function(i,s){r.load(e,i,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Ns={};class s9 extends Error{constructor(e,t){super(e),this.response=t}}class Ys extends Kr{constructor(e){super(e)}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=Ja.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(Ns[e]!==void 0){Ns[e].push({onLoad:t,onProgress:r,onError:i});return}Ns[e]=[],Ns[e].push({onLoad:t,onProgress:r,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream=="undefined"||f.body===void 0||f.body.getReader===void 0)return f;const d=Ns[e],h=f.body.getReader(),p=f.headers.get("Content-Length"),g=p?parseInt(p):0,v=g!==0;let y=0;const x=new ReadableStream({start(w){_();function _(){h.read().then(({done:M,value:E})=>{if(M)w.close();else{y+=E.byteLength;const C=new ProgressEvent("progress",{lengthComputable:v,loaded:y,total:g});for(let P=0,R=d.length;P<R;P++){const T=d[P];T.onProgress&&T.onProgress(C)}w.enqueue(E),_()}})}}});return new Response(x)}else throw new s9(`fetch for "${f.url}" responded with ${f.status}: ${f.statusText}`,f)}).then(f=>{switch(c){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return f.json();default:if(a===void 0)return f.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),p=h&&h[1]?h[1].toLowerCase():void 0,g=new TextDecoder(p);return f.arrayBuffer().then(v=>g.decode(v))}}}).then(f=>{Ja.add(e,f);const d=Ns[e];delete Ns[e];for(let h=0,p=d.length;h<p;h++){const g=d[h];g.onLoad&&g.onLoad(f)}}).catch(f=>{const d=Ns[e];if(d===void 0)throw this.manager.itemError(e),f;delete Ns[e];for(let h=0,p=d.length;h<p;h++){const g=d[h];g.onError&&g.onError(f)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class o9 extends Kr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Ys(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}parse(e){const t=[];for(let r=0;r<e.length;r++){const i=Jf.parse(e[r]);t.push(i)}return t}}class a9 extends Kr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=[],a=new EL,c=new Ys(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(s.withCredentials);let f=0;function d(h){c.load(e[h],function(p){const g=s.parse(p,!0);o[h]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},f+=1,f===6&&(g.mipmapCount===1&&(a.minFilter=un),a.image=o,a.format=g.format,a.needsUpdate=!0,t&&t(a))},r,i)}if(Array.isArray(e))for(let h=0,p=e.length;h<p;++h)d(h);else c.load(e,function(h){const p=s.parse(h,!0);if(p.isCubemap){const g=p.mipmaps.length/p.mipmapCount;for(let v=0;v<g;v++){o[v]={mipmaps:[]};for(let y=0;y<p.mipmapCount;y++)o[v].mipmaps.push(p.mipmaps[v*p.mipmapCount+y]),o[v].format=p.format,o[v].width=p.width,o[v].height=p.height}a.image=o}else a.image.width=p.width,a.image.height=p.height,a.mipmaps=p.mipmaps;p.mipmapCount===1&&(a.minFilter=un),a.format=p.format,a.needsUpdate=!0,t&&t(a)},r,i);return a}}class ed extends Kr{constructor(e){super(e)}load(e,t,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Ja.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=jf("img");function c(){d(),Ja.add(e,this),t&&t(this),s.manager.itemEnd(e)}function f(h){d(),i&&i(h),s.manager.itemError(e),s.manager.itemEnd(e)}function d(){a.removeEventListener("load",c,!1),a.removeEventListener("error",f,!1)}return a.addEventListener("load",c,!1),a.addEventListener("error",f,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class l9 extends Kr{constructor(e){super(e)}load(e,t,r,i){const s=new pd,o=new ed(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function c(f){o.load(e[f],function(d){s.images[f]=d,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,i)}for(let f=0;f<e.length;++f)c(f);return s}}class u9 extends Kr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Su,a=new Ys(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,function(c){const f=s.parse(c);!f||(f.image!==void 0?o.image=f.image:f.data!==void 0&&(o.image.width=f.width,o.image.height=f.height,o.image.data=f.data),o.wrapS=f.wrapS!==void 0?f.wrapS:pr,o.wrapT=f.wrapT!==void 0?f.wrapT:pr,o.magFilter=f.magFilter!==void 0?f.magFilter:un,o.minFilter=f.minFilter!==void 0?f.minFilter:un,o.anisotropy=f.anisotropy!==void 0?f.anisotropy:1,f.encoding!==void 0&&(o.encoding=f.encoding),f.flipY!==void 0&&(o.flipY=f.flipY),f.format!==void 0&&(o.format=f.format),f.type!==void 0&&(o.type=f.type),f.mipmaps!==void 0&&(o.mipmaps=f.mipmaps,o.minFilter=sl),f.mipmapCount===1&&(o.minFilter=un),f.generateMipmaps!==void 0&&(o.generateMipmaps=f.generateMipmaps),o.needsUpdate=!0,t&&t(o,f))},r,i),o}}class c9 extends Kr{constructor(e){super(e)}load(e,t,r,i){const s=new Cn,o=new ed(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},r,i),s}}class Zo extends Mt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ge(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class ZL extends Zo{constructor(e,t,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Mt.DefaultUp),this.updateMatrix(),this.groundColor=new Ge(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const Fy=new dt,y2=new I,_2=new I;class zS{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Me(512,512),this.map=null,this.mapPass=null,this.matrix=new dt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Wg,this._frameExtents=new Me(1,1),this._viewportCount=1,this._viewports=[new Ht(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;y2.setFromMatrixPosition(e.matrixWorld),t.position.copy(y2),_2.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(_2),t.updateMatrixWorld(),Fy.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Fy),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(Fy)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class f9 extends zS{constructor(){super(new Gn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=$f*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(r!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=r,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class QL extends Zo{constructor(e,t,r=0,i=Math.PI/3,s=0,o=1){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Mt.DefaultUp),this.updateMatrix(),this.target=new Mt,this.distance=r,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new f9}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const x2=new dt,Fc=new I,Uy=new I;class d9 extends zS{constructor(){super(new Gn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Me(4,2),this._viewportCount=6,this._viewports=[new Ht(2,1,1,1),new Ht(0,1,1,1),new Ht(3,1,1,1),new Ht(1,1,1,1),new Ht(3,0,1,1),new Ht(1,0,1,1)],this._cubeDirections=[new I(1,0,0),new I(-1,0,0),new I(0,0,1),new I(0,0,-1),new I(0,1,0),new I(0,-1,0)],this._cubeUps=[new I(0,1,0),new I(0,1,0),new I(0,1,0),new I(0,1,0),new I(0,0,1),new I(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,i=this.matrix,s=e.distance||r.far;s!==r.far&&(r.far=s,r.updateProjectionMatrix()),Fc.setFromMatrixPosition(e.matrixWorld),r.position.copy(Fc),Uy.copy(r.position),Uy.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(Uy),r.updateMatrixWorld(),i.makeTranslation(-Fc.x,-Fc.y,-Fc.z),x2.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(x2)}}class KL extends Zo{constructor(e,t,r=0,i=1){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new d9}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class h9 extends zS{constructor(){super(new md(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class JL extends Zo{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Mt.DefaultUp),this.updateMatrix(),this.target=new Mt,this.shadow=new h9}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class eI extends Zo{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class tI extends Zo{constructor(e,t,r=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=r,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class nI{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new I)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const r=e.x,i=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*i),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*r),t.addScaledVector(o[4],1.092548*(r*i)),t.addScaledVector(o[5],1.092548*(i*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(r*s)),t.addScaledVector(o[8],.546274*(r*r-i*i)),t}getIrradianceAt(e,t){const r=e.x,i=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*i),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*r),t.addScaledVector(o[4],2*.429043*r*i),t.addScaledVector(o[5],2*.429043*i*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*r*s),t.addScaledVector(o[8],.429043*(r*r-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const r=e.x,i=e.y,s=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*s,t[3]=.488603*r,t[4]=1.092548*r*i,t[5]=1.092548*i*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*r*s,t[8]=.546274*(r*r-i*i)}}class Jg extends Zo{constructor(e=new nI,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class e0 extends Kr{constructor(e){super(e),this.textures={}}load(e,t,r,i){const s=this,o=new Ys(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}parse(e){const t=this.textures;function r(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const i=e0.createMaterialFromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new Ge().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.iridescence!==void 0&&(i.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(i.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==1&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=r(o.value);break;case"c":i.uniforms[s].value=new Ge().setHex(o.value);break;case"v2":i.uniforms[s].value=new Me().fromArray(o.value);break;case"v3":i.uniforms[s].value=new I().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Ht().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Tr().fromArray(o.value);break;case"m4":i.uniforms[s].value=new dt().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new Me().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Me().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:kL,SpriteMaterial:wS,RawShaderMaterial:zL,ShaderMaterial:fs,PointsMaterial:bS,MeshPhysicalMaterial:FL,MeshStandardMaterial:LS,MeshPhongMaterial:UL,MeshToonMaterial:BL,MeshNormalMaterial:VL,MeshLambertMaterial:GL,MeshDepthMaterial:vS,MeshDistanceMaterial:yS,MeshBasicMaterial:hs,MeshMatcapMaterial:HL,LineDashedMaterial:WL,LineBasicMaterial:lr,Material:qn};return new t[e]}}class Bx{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r<i;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class rI extends ht{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class iI extends Kr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Ys(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}parse(e){const t={},r={};function i(g,v){if(t[v]!==void 0)return t[v];const x=g.interleavedBuffers[v],w=s(g,x.buffer),_=cu(x.type,w),M=new Yg(_,x.stride);return M.uuid=x.uuid,t[v]=M,M}function s(g,v){if(r[v]!==void 0)return r[v];const x=g.arrayBuffers[v],w=new Uint32Array(x).buffer;return r[v]=w,w}const o=e.isInstancedBufferGeometry?new rI:new ht,a=e.data.index;if(a!==void 0){const g=cu(a.type,a.array);o.setIndex(new qt(g,1))}const c=e.data.attributes;for(const g in c){const v=c[g];let y;if(v.isInterleavedBufferAttribute){const x=i(e.data,v.data);y=new Ka(x,v.itemSize,v.offset,v.normalized)}else{const x=cu(v.type,v.array),w=v.isInstancedBufferAttribute?Iu:qt;y=new w(x,v.itemSize,v.normalized)}v.name!==void 0&&(y.name=v.name),v.usage!==void 0&&y.setUsage(v.usage),v.updateRange!==void 0&&(y.updateRange.offset=v.updateRange.offset,y.updateRange.count=v.updateRange.count),o.setAttribute(g,y)}const f=e.data.morphAttributes;if(f)for(const g in f){const v=f[g],y=[];for(let x=0,w=v.length;x<w;x++){const _=v[x];let M;if(_.isInterleavedBufferAttribute){const E=i(e.data,_.data);M=new Ka(E,_.itemSize,_.offset,_.normalized)}else{const E=cu(_.type,_.array);M=new qt(E,_.itemSize,_.normalized)}_.name!==void 0&&(M.name=_.name),y.push(M)}o.morphAttributes[g]=y}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let g=0,v=h.length;g!==v;++g){const y=h[g];o.addGroup(y.start,y.count,y.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const g=new I;p.center!==void 0&&g.fromArray(p.center),o.boundingSphere=new al(g,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class p9 extends Kr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=this.path===""?Bx.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new Ys(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(c){let f=null;try{f=JSON.parse(c)}catch(h){i!==void 0&&i(h),console.error("THREE:ObjectLoader: Can't parse "+e+".",h.message);return}const d=f.metadata;if(d===void 0||d.type===void 0||d.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(f,t)},r,i)}async loadAsync(e,t){const r=this,i=this.path===""?Bx.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const s=new Ys(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),a=JSON.parse(o),c=a.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await r.parseAsync(a)}parse(e,t){const r=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,i),o=this.parseImages(e.images,function(){t!==void 0&&t(f)}),a=this.parseTextures(e.textures,o),c=this.parseMaterials(e.materials,a),f=this.parseObject(e.object,s,c,a,r),d=this.parseSkeletons(e.skeletons,f);if(this.bindSkeletons(f,d),t!==void 0){let h=!1;for(const p in o)if(o[p].data instanceof HTMLImageElement){h=!0;break}h===!1&&t(f)}return f}async parseAsync(e){const t=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),c=this.parseObject(e.object,i,a,o,t),f=this.parseSkeletons(e.skeletons,c);return this.bindSkeletons(c,f),c}parseShapes(e){const t={};if(e!==void 0)for(let r=0,i=e.length;r<i;r++){const s=new Ga().fromJSON(e[r]);t[s.uuid]=s}return t}parseSkeletons(e,t){const r={},i={};if(t.traverse(function(s){s.isBone&&(i[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=new qg().fromJSON(e[s],i);r[a.uuid]=a}return r}parseGeometries(e,t){const r={};if(e!==void 0){const i=new iI;for(let s=0,o=e.length;s<o;s++){let a;const c=e[s];switch(c.type){case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(c);break;default:c.type in v2?a=v2[c.type].fromJSON(c,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${c.type}"`)}a.uuid=c.uuid,c.name!==void 0&&(a.name=c.name),a.isBufferGeometry===!0&&c.userData!==void 0&&(a.userData=c.userData),r[c.uuid]=a}}return r}parseMaterials(e,t){const r={},i={};if(e!==void 0){const s=new e0;s.setTextures(t);for(let o=0,a=e.length;o<a;o++){const c=e[o];r[c.uuid]===void 0&&(r[c.uuid]=s.parse(c)),i[c.uuid]=r[c.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let r=0;r<e.length;r++){const i=e[r],s=Jf.parse(i);t[s.uuid]=s}return t}parseImages(e,t){const r=this,i={};let s;function o(c){return r.manager.itemStart(c),s.load(c,function(){r.manager.itemEnd(c)},void 0,function(){r.manager.itemError(c),r.manager.itemEnd(c)})}function a(c){if(typeof c=="string"){const f=c,d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(f)?f:r.resourcePath+f;return o(d)}else return c.data?{data:cu(c.type,c.data),width:c.width,height:c.height}:null}if(e!==void 0&&e.length>0){const c=new kS(t);s=new ed(c),s.setCrossOrigin(this.crossOrigin);for(let f=0,d=e.length;f<d;f++){const h=e[f],p=h.url;if(Array.isArray(p)){const g=[];for(let v=0,y=p.length;v<y;v++){const x=p[v],w=a(x);w!==null&&(w instanceof HTMLImageElement?g.push(w):g.push(new Su(w.data,w.width,w.height)))}i[h.uuid]=new Ra(g)}else{const g=a(h.url);i[h.uuid]=new Ra(g)}}}return i}async parseImagesAsync(e){const t=this,r={};let i;async function s(o){if(typeof o=="string"){const a=o,c=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await i.loadAsync(c)}else return o.data?{data:cu(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){i=new ed(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const c=e[o],f=c.url;if(Array.isArray(f)){const d=[];for(let h=0,p=f.length;h<p;h++){const g=f[h],v=await s(g);v!==null&&(v instanceof HTMLImageElement?d.push(v):d.push(new Su(v.data,v.width,v.height)))}r[c.uuid]=new Ra(d)}else{const d=await s(c.url);r[c.uuid]=new Ra(d)}}}return r}parseTextures(e,t){function r(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const i={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=e[s];a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const c=t[a.image],f=c.data;let d;Array.isArray(f)?(d=new pd,f.length===6&&(d.needsUpdate=!0)):(f&&f.data?d=new Su:d=new Cn,f&&(d.needsUpdate=!0)),d.source=c,d.uuid=a.uuid,a.name!==void 0&&(d.name=a.name),a.mapping!==void 0&&(d.mapping=r(a.mapping,m9)),a.offset!==void 0&&d.offset.fromArray(a.offset),a.repeat!==void 0&&d.repeat.fromArray(a.repeat),a.center!==void 0&&d.center.fromArray(a.center),a.rotation!==void 0&&(d.rotation=a.rotation),a.wrap!==void 0&&(d.wrapS=r(a.wrap[0],S2),d.wrapT=r(a.wrap[1],S2)),a.format!==void 0&&(d.format=a.format),a.type!==void 0&&(d.type=a.type),a.encoding!==void 0&&(d.encoding=a.encoding),a.minFilter!==void 0&&(d.minFilter=r(a.minFilter,w2)),a.magFilter!==void 0&&(d.magFilter=r(a.magFilter,w2)),a.anisotropy!==void 0&&(d.anisotropy=a.anisotropy),a.flipY!==void 0&&(d.flipY=a.flipY),a.premultiplyAlpha!==void 0&&(d.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(d.unpackAlignment=a.unpackAlignment),a.userData!==void 0&&(d.userData=a.userData),i[a.uuid]=d}return i}parseObject(e,t,r,i,s){let o;function a(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function c(p){if(p!==void 0){if(Array.isArray(p)){const g=[];for(let v=0,y=p.length;v<y;v++){const x=p[v];r[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",x),g.push(r[x])}return g}return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),r[p]}}function f(p){return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),i[p]}let d,h;switch(e.type){case"Scene":o=new SS,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Ge(e.background):o.background=f(e.background)),e.environment!==void 0&&(o.environment=f(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new Xg(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new jg(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new Gn(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new md(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new eI(e.color,e.intensity);break;case"DirectionalLight":o=new JL(e.color,e.intensity);break;case"PointLight":o=new KL(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new tI(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new QL(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new ZL(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Jg().fromJSON(e);break;case"SkinnedMesh":d=a(e.geometry),h=c(e.material),o=new SL(d,h),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":d=a(e.geometry),h=c(e.material),o=new We(d,h);break;case"InstancedMesh":d=a(e.geometry),h=c(e.material);const p=e.count,g=e.instanceMatrix,v=e.instanceColor;o=new wL(d,h,p),o.instanceMatrix=new Iu(new Float32Array(g.array),16),v!==void 0&&(o.instanceColor=new Iu(new Float32Array(v.array),v.itemSize));break;case"LOD":o=new xL;break;case"Line":o=new St(a(e.geometry),c(e.material));break;case"LineLoop":o=new ML(a(e.geometry),c(e.material));break;case"LineSegments":o=new ps(a(e.geometry),c(e.material));break;case"PointCloud":case"Points":o=new bL(a(e.geometry),c(e.material));break;case"Sprite":o=new _L(c(e.material));break;case"Group":o=new du;break;case"Bone":o=new MS;break;default:o=new Mt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let g=0;g<p.length;g++)o.add(this.parseObject(p[g],t,r,i,s))}if(e.animations!==void 0){const p=e.animations;for(let g=0;g<p.length;g++){const v=p[g];o.animations.push(s[v])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let g=0;g<p.length;g++){const v=p[g],y=o.getObjectByProperty("uuid",v.object);y!==void 0&&o.addLevel(y,v.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(r){if(r.isSkinnedMesh===!0&&r.skeleton!==void 0){const i=t[r.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",r.skeleton):r.bind(i,r.bindMatrix)}})}}const m9={UVMapping:Vg,CubeReflectionMapping:Vo,CubeRefractionMapping:Go,EquirectangularReflectionMapping:zf,EquirectangularRefractionMapping:Ff,CubeUVReflectionMapping:Hu},S2={RepeatWrapping:Uf,ClampToEdgeWrapping:pr,MirroredRepeatWrapping:Bf},w2={NearestFilter:En,NearestMipmapNearestFilter:ig,NearestMipmapLinearFilter:sg,LinearFilter:un,LinearMipmapNearestFilter:uS,LinearMipmapLinearFilter:sl};class g9 extends Kr{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Ja.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){Ja.add(e,c),t&&t(c),s.manager.itemEnd(e)}).catch(function(c){i&&i(c),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}let Rp;const FS={getContext:function(){return Rp===void 0&&(Rp=new(window.AudioContext||window.webkitAudioContext)),Rp},setContext:function(n){Rp=n}};class v9 extends Kr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Ys(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{const c=a.slice(0);FS.getContext().decodeAudioData(c,function(d){t(d)})}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}}class y9 extends Jg{constructor(e,t,r=1){super(void 0,r),this.isHemisphereLightProbe=!0;const i=new Ge().set(e),s=new Ge().set(t),o=new I(i.r,i.g,i.b),a=new I(s.r,s.g,s.b),c=Math.sqrt(Math.PI),f=c*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(c),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(f)}}class _9 extends Jg{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const r=new Ge().set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const M2=new dt,b2=new dt,fa=new dt;class x9{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Gn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Gn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,fa.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(Ua*t.fov*.5)/t.zoom;let a,c;b2.elements[12]=-i,M2.elements[12]=i,a=-o*t.aspect+s,c=o*t.aspect+s,fa.elements[0]=2*t.near/(c-a),fa.elements[8]=(c+a)/(c-a),this.cameraL.projectionMatrix.copy(fa),a=-o*t.aspect-s,c=o*t.aspect-s,fa.elements[0]=2*t.near/(c-a),fa.elements[8]=(c+a)/(c-a),this.cameraR.projectionMatrix.copy(fa)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(b2),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(M2)}}class US{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=E2(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=E2();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function E2(){return(typeof performance=="undefined"?Date:performance).now()}const da=new I,T2=new Gt,S9=new I,ha=new I;class w9 extends Mt{constructor(){super(),this.type="AudioListener",this.context=FS.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new US}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(da,T2,S9),ha.set(0,0,-1).applyQuaternion(T2),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(da.x,i),t.positionY.linearRampToValueAtTime(da.y,i),t.positionZ.linearRampToValueAtTime(da.z,i),t.forwardX.linearRampToValueAtTime(ha.x,i),t.forwardY.linearRampToValueAtTime(ha.y,i),t.forwardZ.linearRampToValueAtTime(ha.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(da.x,da.y,da.z),t.setOrientation(ha.x,ha.y,ha.z,r.x,r.y,r.z)}}class sI extends Mt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const pa=new I,C2=new Gt,M9=new I,ma=new I;class b9 extends sI{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,r){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=r,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(pa,C2,M9),ma.set(0,0,1).applyQuaternion(C2);const t=this.panner;if(t.positionX){const r=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(pa.x,r),t.positionY.linearRampToValueAtTime(pa.y,r),t.positionZ.linearRampToValueAtTime(pa.z,r),t.orientationX.linearRampToValueAtTime(ma.x,r),t.orientationY.linearRampToValueAtTime(ma.y,r),t.orientationZ.linearRampToValueAtTime(ma.z,r)}else t.setPosition(pa.x,pa.y,pa.z),t.setOrientation(ma.x,ma.y,ma.z)}}class E9{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let r=0;r<t.length;r++)e+=t[r];return e/t.length}}class oI{constructor(e,t,r){this.binding=e,this.valueSize=r;let i,s,o;switch(t){case"quaternion":i=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(r*6),this._workIndex=5;break;case"string":case"bool":i=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(r*5);break;default:i=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(r*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const r=this.buffer,i=this.valueSize,s=e*i+i;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==i;++a)r[s+a]=r[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(r,s,0,a,i)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,r=this.valueSize,i=r*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,r=this.buffer,i=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const c=t*this._origIndex;this._mixBufferRegion(r,i,c,1-s,t)}o>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let c=t,f=t+t;c!==f;++c)if(r[c]!==r[c+t]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let s=r,o=i;s!==o;++s)t[s]=t[i+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r<t;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[t+r]=this.buffer[e+r]}_select(e,t,r,i,s){if(i>=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,i){Gt.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,s){const o=this._workIndex*s;Gt.multiplyQuaternionsFlat(e,o,e,t,e,r),Gt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,r,i,s){const o=1-i;for(let a=0;a!==s;++a){const c=t+a;e[c]=e[c]*o+e[r+a]*i}}_lerpAdditive(e,t,r,i,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[r+o]*i}}}const BS="\\[\\]\\.:\\/",T9=new RegExp("["+BS+"]","g"),VS="[^"+BS+"]",C9="[^"+BS.replace("\\.","")+"]",A9=/((?:WC+[\/:])*)/.source.replace("WC",VS),P9=/(WCOD+)?/.source.replace("WCOD",C9),R9=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",VS),L9=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",VS),I9=new RegExp("^"+A9+P9+R9+L9+"$"),N9=["material","materials","bones","map"];class D9{constructor(e,t,r){const i=r||Lt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class Lt{constructor(e,t,r){this.path=t,this.parsedPath=r||Lt.parseTrackName(t),this.node=Lt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new Lt.Composite(e,t,r):new Lt(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(T9,"")}static parseTrackName(e){const t=I9.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=r.nodeName.substring(i+1);N9.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const c=r(a.children);if(c)return c}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)e[t++]=r[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,r=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Lt.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(r){let f=t.objectIndex;switch(r){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===f){f=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}if(f!==void 0){if(e[f]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[f]}}const o=e[i];if(o===void 0){const f=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+f+"."+i+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Lt.Composite=D9;Lt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Lt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Lt.prototype.GetterByBindingType=[Lt.prototype._getValue_direct,Lt.prototype._getValue_array,Lt.prototype._getValue_arrayElement,Lt.prototype._getValue_toArray];Lt.prototype.SetterByBindingTypeAndVersioning=[[Lt.prototype._setValue_direct,Lt.prototype._setValue_direct_setNeedsUpdate,Lt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Lt.prototype._setValue_array,Lt.prototype._setValue_array_setNeedsUpdate,Lt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Lt.prototype._setValue_arrayElement,Lt.prototype._setValue_arrayElement_setNeedsUpdate,Lt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Lt.prototype._setValue_fromArray,Lt.prototype._setValue_fromArray_setNeedsUpdate,Lt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class O9{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Xr(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let r=0,i=arguments.length;r!==i;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,r=this._paths,i=this._parsedPaths,s=this._bindings,o=s.length;let a,c=e.length,f=this.nCachedObjects_;for(let d=0,h=arguments.length;d!==h;++d){const p=arguments[d],g=p.uuid;let v=t[g];if(v===void 0){v=c++,t[g]=v,e.push(p);for(let y=0,x=o;y!==x;++y)s[y].push(new Lt(p,r[y],i[y]))}else if(v<f){a=e[v];const y=--f,x=e[y];t[x.uuid]=v,e[v]=x,t[g]=y,e[y]=p;for(let w=0,_=o;w!==_;++w){const M=s[w],E=M[y];let C=M[v];M[v]=E,C===void 0&&(C=new Lt(p,r[w],i[w])),M[y]=C}}else e[v]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=f}remove(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const c=arguments[o],f=c.uuid,d=t[f];if(d!==void 0&&d>=s){const h=s++,p=e[h];t[p.uuid]=d,e[d]=p,t[f]=h,e[h]=c;for(let g=0,v=i;g!==v;++g){const y=r[g],x=y[h],w=y[d];y[d]=x,y[h]=w}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,c=arguments.length;a!==c;++a){const f=arguments[a],d=f.uuid,h=t[d];if(h!==void 0)if(delete t[d],h<s){const p=--s,g=e[p],v=--o,y=e[v];t[g.uuid]=h,e[h]=g,t[y.uuid]=p,e[p]=y,e.pop();for(let x=0,w=i;x!==w;++x){const _=r[x],M=_[p],E=_[v];_[h]=M,_[p]=E,_.pop()}}else{const p=--o,g=e[p];p>0&&(t[g.uuid]=h),e[h]=g,e.pop();for(let v=0,y=i;v!==y;++v){const x=r[v];x[h]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const r=this._bindingsIndicesByPath;let i=r[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,a=this._parsedPaths,c=this._objects,f=c.length,d=this.nCachedObjects_,h=new Array(f);i=s.length,r[e]=i,o.push(e),a.push(t),s.push(h);for(let p=d,g=c.length;p!==g;++p){const v=c[p];h[p]=new Lt(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,c=o[a],f=e[a];t[f]=r,o[r]=c,o.pop(),s[r]=s[a],s.pop(),i[r]=i[a],i.pop()}}}class k9{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;const s=t.tracks,o=s.length,a=new Array(o),c={endingStart:Aa,endingEnd:Aa};for(let f=0;f!==o;++f){const d=s[f].createInterpolant(null);a[f]=d,d.settings=c}this._interpolantSettings=c,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=KR,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const i=this._mixer,s=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const c=a.parameterPositions,f=a.sampleValues;return c[0]=s,c[1]=s+r,f[0]=e/o,f[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const c=(e-s)*r;c<0||r===0?t=0:(this._startTime=null,t=r*c)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const c=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case fS:for(let d=0,h=c.length;d!==h;++d)c[d].evaluate(o),f[d].accumulateAdditive(a);break;case Gg:default:for(let d=0,h=c.length;d!==h;++d)c[d].evaluate(o),f[d].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;r!==null&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let i=this.time+e,s=this._loopCount;const o=r===JR;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(r===QR){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const c=this.repetitions-s;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,r){const i=this._interpolantSettings;r?(i.endingStart=Pa,i.endingEnd=Pa):(e?i.endingStart=this.zeroSlopeAtStart?Pa:Aa:i.endingStart=Hf,t?i.endingEnd=this.zeroSlopeAtEnd?Pa:Aa:i.endingEnd=Hf)}_scheduleFading(e,t,r){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,c=o.sampleValues;return a[0]=s,c[0]=t,a[1]=s+e,c[1]=r,this}}const z9=new Float32Array(1);class F9 extends Zs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,c=r.uuid,f=this._bindingsByRootAndName;let d=f[c];d===void 0&&(d={},f[c]=d);for(let h=0;h!==s;++h){const p=i[h],g=p.name;let v=d[g];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,c,g));continue}const y=t&&t._propertyBindings[h].binding.parsedPath;v=new oI(Lt.create(r,g,y),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,c,g),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,r){const i=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=i.length,i.push(e),o.actionByRoot[r]=e}_removeInactiveAction(e){const t=this._actions,r=t[t.length-1],i=e._cacheIndex;r._cacheIndex=i,t[i]=r,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,a=o[s],c=a.knownActions,f=c[c.length-1],d=e._byClipCacheIndex;f._byClipCacheIndex=d,c[d]=f,c.pop(),e._byClipCacheIndex=null;const h=a.actionByRoot,p=(e._localRoot||this._root).uuid;delete h[p],c.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,r=e._cacheIndex,i=this._nActiveActions++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_takeBackAction(e){const t=this._actions,r=e._cacheIndex,i=--this._nActiveActions,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_addInactiveBinding(e,t,r){const i=this._bindingsByRootAndName,s=this._bindings;let o=i[t];o===void 0&&(o={},i[t]=o),o[r]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,r=e.binding,i=r.rootNode.uuid,s=r.path,o=this._bindingsByRootAndName,a=o[i],c=t[t.length-1],f=e._cacheIndex;c._cacheIndex=f,t[f]=c,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[i]}_lendBinding(e){const t=this._bindings,r=e._cacheIndex,i=this._nActiveBindings++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_takeBackBinding(e){const t=this._bindings,r=e._cacheIndex,i=--this._nActiveBindings,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let r=e[t];return r===void 0&&(r=new DS(new Float32Array(2),new Float32Array(2),1,z9),r.__cacheIndex=t,e[t]=r),r}_takeBackControlInterpolant(e){const t=this._controlInterpolants,r=e.__cacheIndex,i=--this._nActiveControlInterpolants,s=t[i];e.__cacheIndex=i,t[i]=e,s.__cacheIndex=r,t[r]=s}clipAction(e,t,r){const i=t||this._root,s=i.uuid;let o=typeof e=="string"?Jf.findByName(i,e):e;const a=o!==null?o.uuid:e,c=this._actionsByClip[a];let f=null;if(r===void 0&&(o!==null?r=o.blendMode:r=Gg),c!==void 0){const h=c.actionByRoot[s];if(h!==void 0&&h.blendMode===r)return h;f=c.knownActions[0],o===null&&(o=f._clip)}if(o===null)return null;const d=new k9(this,o,t,r);return this._bindAction(d,f),this._addInactiveAction(d,a,s),d}existingAction(e,t){const r=t||this._root,i=r.uuid,s=typeof e=="string"?Jf.findByName(r,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[i]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let r=t-1;r>=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let f=0;f!==r;++f)t[f]._update(i,e,s,o);const a=this._bindings,c=this._nActiveBindings;for(let f=0;f!==c;++f)a[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,r=e.uuid,i=this._actionsByClip,s=i[r];if(s!==void 0){const o=s.knownActions;for(let a=0,c=o.length;a!==c;++a){const f=o[a];this._deactivateAction(f);const d=f._cacheIndex,h=t[t.length-1];f._cacheIndex=null,f._byClipCacheIndex=null,h._cacheIndex=d,t[d]=h,t.pop(),this._removeInactiveBindingsForAction(f)}delete i[r]}}uncacheRoot(e){const t=e.uuid,r=this._actionsByClip;for(const o in r){const a=r[o].actionByRoot,c=a[t];c!==void 0&&(this._deactivateAction(c),this._removeInactiveAction(c))}const i=this._bindingsByRootAndName,s=i[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const r=this.existingAction(e,t);r!==null&&(this._deactivateAction(r),this._removeInactiveAction(r))}}class GS{constructor(e){this.value=e}clone(){return new GS(this.value.clone===void 0?this.value:this.value.clone())}}let U9=0;class B9 extends Zs{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:U9++}),this.name="",this.usage=Wf,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let r=0,i=t.length;r<i;r++)this.uniforms.push(t[r].clone());return this}clone(){return new this.constructor().copy(this)}}class V9 extends Yg{constructor(e,t,r=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class G9{constructor(e,t,r,i,s){this.isGLBufferAttribute=!0,this.buffer=e,this.type=t,this.itemSize=r,this.elementSize=i,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}class HS{constructor(e,t,r=0,i=1/0){this.ray=new dd(e,t),this.near=r,this.far=i,this.camera=null,this.layers=new Va,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,r=[]){return Vx(e,this,r,t),r.sort(A2),r}intersectObjects(e,t=!0,r=[]){for(let i=0,s=e.length;i<s;i++)Vx(e[i],this,r,t);return r.sort(A2),r}}function A2(n,e){return n.distance-e.distance}function Vx(n,e,t,r){if(n.layers.test(e.layers)&&n.raycast(e,t),r===!0){const i=n.children;for(let s=0,o=i.length;s<o;s++)Vx(i[s],e,t,!0)}}class H9{constructor(e=1,t=0,r=0){return this.radius=e,this.phi=t,this.theta=r,this}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+t*t+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(xn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class W9{constructor(e=1,t=0,r=0){return this.radius=e,this.theta=t,this.y=r,this}set(e,t,r){return this.radius=e,this.theta=t,this.y=r,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+r*r),this.theta=Math.atan2(e,r),this.y=t,this}clone(){return new this.constructor().copy(this)}}const P2=new Me;class $9{constructor(e=new Me(1/0,1/0),t=new Me(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=P2.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return P2.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const R2=new I,Lp=new I;class j9{constructor(e=new I,t=new I){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){R2.subVectors(e,this.start),Lp.subVectors(this.end,this.start);const r=Lp.dot(Lp);let s=Lp.dot(R2)/r;return t&&(s=xn(s,0,1)),s}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const L2=new I;class X9 extends Mt{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const r=new ht,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,c=32;o<c;o++,a++){const f=o/c*Math.PI*2,d=a/c*Math.PI*2;i.push(Math.cos(f),Math.sin(f),1,Math.cos(d),Math.sin(d),1)}r.setAttribute("position",new Xe(i,3));const s=new lr({fog:!1,toneMapped:!1});this.cone=new ps(r,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),L2.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(L2),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const yo=new I,Ip=new dt,By=new dt;class Y9 extends ps{constructor(e){const t=aI(e),r=new ht,i=[],s=[],o=new Ge(0,0,1),a=new Ge(0,1,0);for(let f=0;f<t.length;f++){const d=t[f];d.parent&&d.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}r.setAttribute("position",new Xe(i,3)),r.setAttribute("color",new Xe(s,3));const c=new lr({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(r,c),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,r=this.geometry,i=r.getAttribute("position");By.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&(Ip.multiplyMatrices(By,a.matrixWorld),yo.setFromMatrixPosition(Ip),i.setXYZ(o,yo.x,yo.y,yo.z),Ip.multiplyMatrices(By,a.parent.matrixWorld),yo.setFromMatrixPosition(Ip),i.setXYZ(o+1,yo.x,yo.y,yo.z),o+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function aI(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,aI(n.children[t]));return e}class q9 extends We{constructor(e,t,r){const i=new ul(t,4,2),s=new hs({wireframe:!0,fog:!1,toneMapped:!1});super(i,s),this.light=e,this.light.updateMatrixWorld(),this.color=r,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const Z9=new I,I2=new Ge,N2=new Ge;class Q9 extends Mt{constructor(e,t,r){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r;const i=new Vr(t);i.rotateY(Math.PI*.5),this.material=new hs({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),o=new Float32Array(s.count*3);i.setAttribute("color",new qt(o,3)),this.add(new We(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");I2.copy(this.light.color),N2.copy(this.light.groundColor);for(let r=0,i=t.count;r<i;r++){const s=r<i/2?I2:N2;t.setXYZ(r,s.r,s.g,s.b)}t.needsUpdate=!0}e.lookAt(Z9.setFromMatrixPosition(this.light.matrixWorld).negate())}}class K9 extends ps{constructor(e=10,t=10,r=4473924,i=8947848){r=new Ge(r),i=new Ge(i);const s=t/2,o=e/t,a=e/2,c=[],f=[];for(let p=0,g=0,v=-a;p<=t;p++,v+=o){c.push(-a,0,v,a,0,v),c.push(v,0,-a,v,0,a);const y=p===s?r:i;y.toArray(f,g),g+=3,y.toArray(f,g),g+=3,y.toArray(f,g),g+=3,y.toArray(f,g),g+=3}const d=new ht;d.setAttribute("position",new Xe(c,3)),d.setAttribute("color",new Xe(f,3));const h=new lr({vertexColors:!0,toneMapped:!1});super(d,h),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class J9 extends ps{constructor(e=10,t=16,r=8,i=64,s=4473924,o=8947848){s=new Ge(s),o=new Ge(o);const a=[],c=[];if(t>1)for(let h=0;h<t;h++){const p=h/t*(Math.PI*2),g=Math.sin(p)*e,v=Math.cos(p)*e;a.push(0,0,0),a.push(g,0,v);const y=h&1?s:o;c.push(y.r,y.g,y.b),c.push(y.r,y.g,y.b)}for(let h=0;h<r;h++){const p=h&1?s:o,g=e-e/r*h;for(let v=0;v<i;v++){let y=v/i*(Math.PI*2),x=Math.sin(y)*g,w=Math.cos(y)*g;a.push(x,0,w),c.push(p.r,p.g,p.b),y=(v+1)/i*(Math.PI*2),x=Math.sin(y)*g,w=Math.cos(y)*g,a.push(x,0,w),c.push(p.r,p.g,p.b)}}const f=new ht;f.setAttribute("position",new Xe(a,3)),f.setAttribute("color",new Xe(c,3));const d=new lr({vertexColors:!0,toneMapped:!1});super(f,d),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const D2=new I,Np=new I,O2=new I;class e7 extends Mt{constructor(e,t,r){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,t===void 0&&(t=1);let i=new ht;i.setAttribute("position",new Xe([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new lr({fog:!1,toneMapped:!1});this.lightPlane=new St(i,s),this.add(this.lightPlane),i=new ht,i.setAttribute("position",new Xe([0,0,0,0,0,1],3)),this.targetLine=new St(i,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){D2.setFromMatrixPosition(this.light.matrixWorld),Np.setFromMatrixPosition(this.light.target.matrixWorld),O2.subVectors(Np,D2),this.lightPlane.lookAt(Np),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Np),this.targetLine.scale.z=O2.length()}}const Dp=new I,pn=new hd;class t7 extends ps{constructor(e){const t=new ht,r=new lr({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],o={};a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4");function a(v,y){c(v),c(y)}function c(v){i.push(0,0,0),s.push(0,0,0),o[v]===void 0&&(o[v]=[]),o[v].push(i.length/3-1)}t.setAttribute("position",new Xe(i,3)),t.setAttribute("color",new Xe(s,3)),super(t,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const f=new Ge(16755200),d=new Ge(16711680),h=new Ge(43775),p=new Ge(16777215),g=new Ge(3355443);this.setColors(f,d,h,p,g)}setColors(e,t,r,i,s){const a=this.geometry.getAttribute("color");a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,r.r,r.g,r.b),a.setXYZ(33,r.r,r.g,r.b),a.setXYZ(34,r.r,r.g,r.b),a.setXYZ(35,r.r,r.g,r.b),a.setXYZ(36,r.r,r.g,r.b),a.setXYZ(37,r.r,r.g,r.b),a.setXYZ(38,i.r,i.g,i.b),a.setXYZ(39,i.r,i.g,i.b),a.setXYZ(40,s.r,s.g,s.b),a.setXYZ(41,s.r,s.g,s.b),a.setXYZ(42,s.r,s.g,s.b),a.setXYZ(43,s.r,s.g,s.b),a.setXYZ(44,s.r,s.g,s.b),a.setXYZ(45,s.r,s.g,s.b),a.setXYZ(46,s.r,s.g,s.b),a.setXYZ(47,s.r,s.g,s.b),a.setXYZ(48,s.r,s.g,s.b),a.setXYZ(49,s.r,s.g,s.b),a.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,r=1,i=1;pn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),yn("c",t,e,pn,0,0,-1),yn("t",t,e,pn,0,0,1),yn("n1",t,e,pn,-r,-i,-1),yn("n2",t,e,pn,r,-i,-1),yn("n3",t,e,pn,-r,i,-1),yn("n4",t,e,pn,r,i,-1),yn("f1",t,e,pn,-r,-i,1),yn("f2",t,e,pn,r,-i,1),yn("f3",t,e,pn,-r,i,1),yn("f4",t,e,pn,r,i,1),yn("u1",t,e,pn,r*.7,i*1.1,-1),yn("u2",t,e,pn,-r*.7,i*1.1,-1),yn("u3",t,e,pn,0,i*2,-1),yn("cf1",t,e,pn,-r,0,1),yn("cf2",t,e,pn,r,0,1),yn("cf3",t,e,pn,0,-i,1),yn("cf4",t,e,pn,0,i,1),yn("cn1",t,e,pn,-r,0,-1),yn("cn2",t,e,pn,r,0,-1),yn("cn3",t,e,pn,0,-i,-1),yn("cn4",t,e,pn,0,i,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function yn(n,e,t,r,i,s,o){Dp.set(i,s,o).unproject(r);const a=e[n];if(a!==void 0){const c=t.getAttribute("position");for(let f=0,d=a.length;f<d;f++)c.setXYZ(a[f],Dp.x,Dp.y,Dp.z)}}const Op=new ol;class n7 extends ps{constructor(e,t=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(8*3),s=new ht;s.setIndex(new qt(r,1)),s.setAttribute("position",new qt(i,3)),super(s,new lr({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Op.setFromObject(this.object),Op.isEmpty())return;const t=Op.min,r=Op.max,i=this.geometry.attributes.position,s=i.array;s[0]=r.x,s[1]=r.y,s[2]=r.z,s[3]=t.x,s[4]=r.y,s[5]=r.z,s[6]=t.x,s[7]=t.y,s[8]=r.z,s[9]=r.x,s[10]=t.y,s[11]=r.z,s[12]=r.x,s[13]=r.y,s[14]=t.z,s[15]=t.x,s[16]=r.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=r.x,s[22]=t.y,s[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class r7 extends ps{constructor(e,t=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new ht;s.setIndex(new qt(r,1)),s.setAttribute("position",new Xe(i,3)),super(s,new lr({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class i7 extends St{constructor(e,t=1,r=16776960){const i=r,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],o=new ht;o.setAttribute("position",new Xe(s,3)),o.computeBoundingSphere(),super(o,new lr({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],c=new ht;c.setAttribute("position",new Xe(a,3)),c.computeBoundingSphere(),this.add(new We(c,new hs({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const k2=new I;let kp,Vy;class s7 extends Mt{constructor(e=new I(0,0,1),t=new I(0,0,0),r=1,i=16776960,s=r*.2,o=s*.2){super(),this.type="ArrowHelper",kp===void 0&&(kp=new ht,kp.setAttribute("position",new Xe([0,0,0,0,1,0],3)),Vy=new Bn(0,.5,1,5,1),Vy.translate(0,-.5,0)),this.position.copy(t),this.line=new St(kp,new lr({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new We(Vy,new hs({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(r,s,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{k2.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(k2,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class o7 extends ps{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new ht;i.setAttribute("position",new Xe(t,3)),i.setAttribute("color",new Xe(r,3));const s=new lr({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,r){const i=new Ge,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class a7{constructor(){this.type="ShapePath",this.color=new Ge,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Xf,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,o){return this.currentPath.bezierCurveTo(e,t,r,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(w){const _=[];for(let M=0,E=w.length;M<E;M++){const C=w[M],P=new Ga;P.curves=C.curves,_.push(P)}return _}function r(w,_){const M=_.length;let E=!1;for(let C=M-1,P=0;P<M;C=P++){let R=_[C],T=_[P],L=T.x-R.x,D=T.y-R.y;if(Math.abs(D)>Number.EPSILON){if(D<0&&(R=_[P],L=-L,T=_[C],D=-D),w.y<R.y||w.y>T.y)continue;if(w.y===R.y){if(w.x===R.x)return!0}else{const Y=D*(w.x-R.x)-L*(w.y-R.y);if(Y===0)return!0;if(Y<0)continue;E=!E}}else{if(w.y!==R.y)continue;if(T.x<=w.x&&w.x<=R.x||R.x<=w.x&&w.x<=T.x)return!0}}return E}const i=cs.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,c;const f=[];if(s.length===1)return a=s[0],c=new Ga,c.curves=a.curves,f.push(c),f;let d=!i(s[0].getPoints());d=e?!d:d;const h=[],p=[];let g=[],v=0,y;p[v]=void 0,g[v]=[];for(let w=0,_=s.length;w<_;w++)a=s[w],y=a.getPoints(),o=i(y),o=e?!o:o,o?(!d&&p[v]&&v++,p[v]={s:new Ga,p:y},p[v].s.curves=a.curves,d&&v++,g[v]=[]):g[v].push({h:a,p:y[0]});if(!p[0])return t(s);if(p.length>1){let w=!1,_=0;for(let M=0,E=p.length;M<E;M++)h[M]=[];for(let M=0,E=p.length;M<E;M++){const C=g[M];for(let P=0;P<C.length;P++){const R=C[P];let T=!0;for(let L=0;L<p.length;L++)r(R.p,p[L].p)&&(M!==L&&_++,T?(T=!1,h[L].push(R)):w=!0);T&&h[M].push(R)}}_>0&&w===!1&&(g=h)}let x;for(let w=0,_=p.length;w<_;w++){c=p[w].s,f.push(c),x=g[w];for(let M=0,E=x.length;M<E;M++)c.holes.push(x[M].h)}return f}}const ks=l7();function l7(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),r=new Uint32Array(512),i=new Uint32Array(512);for(let c=0;c<256;++c){const f=c-127;f<-27?(r[c]=0,r[c|256]=32768,i[c]=24,i[c|256]=24):f<-14?(r[c]=1024>>-f-14,r[c|256]=1024>>-f-14|32768,i[c]=-f-1,i[c|256]=-f-1):f<=15?(r[c]=f+15<<10,r[c|256]=f+15<<10|32768,i[c]=13,i[c|256]=13):f<128?(r[c]=31744,r[c|256]=64512,i[c]=24,i[c|256]=24):(r[c]=31744,r[c|256]=64512,i[c]=13,i[c|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let c=1;c<1024;++c){let f=c<<13,d=0;for(;(f&8388608)===0;)f<<=1,d-=8388608;f&=-8388609,d+=947912704,s[c]=f|d}for(let c=1024;c<2048;++c)s[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(a[c]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function u7(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=xn(n,-65504,65504),ks.floatView[0]=n;const e=ks.uint32View[0],t=e>>23&511;return ks.baseTable[t]+((e&8388607)>>ks.shiftTable[t])}function c7(n){const e=n>>10;return ks.uint32View[0]=ks.mantissaTable[ks.offsetTable[e]+(n&1023)]+ks.exponentTable[e],ks.floatView[0]}var f7=Object.freeze({__proto__:null,toHalfFloat:u7,fromHalfFloat:c7});function d7(){console.error("THREE.ImmediateRenderObject has been removed.")}class h7 extends qr{constructor(e,t,r){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,r),this.samples=4}}class p7 extends fd{constructor(e,t,r,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,r,i)}}class m7 extends Hg{constructor(e,t,r,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,r,i)}}class g7 extends hr{constructor(e,t,r,i,s,o){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(e,t,r,i,s,o)}}class v7 extends gd{constructor(e,t,r,i){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(e,t,r,i)}}class y7 extends vd{constructor(e,t,r,i){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(e,t,r,i)}}class _7 extends yd{constructor(e,t,r,i,s,o,a){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(e,t,r,i,s,o,a)}}class x7 extends Bn{constructor(e,t,r,i,s,o,a,c){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(e,t,r,i,s,o,a,c)}}class S7 extends _d{constructor(e,t){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(e,t)}}class w7 extends xd{constructor(e,t){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(e,t)}}class M7 extends Sd{constructor(e,t){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(e,t)}}class b7 extends $u{constructor(e,t,r,i){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(e,t,r,i)}}class E7 extends Vr{constructor(e,t){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(e,t)}}class T7 extends Gr{constructor(e,t,r,i){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(e,t,r,i)}}class C7 extends Qs{constructor(e,t,r,i){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(e,t,r,i)}}class A7 extends wd{constructor(e,t,r,i,s,o){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(e,t,r,i,s,o)}}class P7 extends Md{constructor(e,t){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(e,t)}}class R7 extends ul{constructor(e,t,r,i,s,o,a){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(e,t,r,i,s,o,a)}}class L7 extends bd{constructor(e,t){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(e,t)}}class I7 extends Bs{constructor(e,t,r,i,s){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(e,t,r,i,s)}}class N7 extends Ed{constructor(e,t,r,i,s,o){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(e,t,r,i,s,o)}}class D7 extends Td{constructor(e,t,r,i,s){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(e,t,r,i,s)}}typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ug}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Ug);var lg=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:lS,AddEquation:Sa,AddOperation:LR,AdditiveAnimationBlendMode:fS,AdditiveBlending:ox,AlphaFormat:VR,AlwaysDepth:bR,AlwaysStencilFunc:rL,AmbientLight:eI,AmbientLightProbe:_9,AnimationClip:Jf,AnimationLoader:o9,AnimationMixer:F9,AnimationObjectGroup:O9,AnimationUtils:n9,ArcCurve:TL,ArrayCamera:gL,ArrowHelper:s7,Audio:sI,AudioAnalyser:E9,AudioContext:FS,AudioListener:w9,AudioLoader:v9,AxesHelper:o7,BackSide:jr,BasicDepthPacking:eL,BasicShadowMap:cR,Bone:MS,BooleanKeyframeTrack:cl,Box2:$9,Box3:ol,Box3Helper:r7,BoxBufferGeometry:g7,BoxGeometry:hr,BoxHelper:n7,BufferAttribute:qt,BufferGeometry:ht,BufferGeometryLoader:iI,ByteType:kR,Cache:Ja,Camera:hd,CameraHelper:t7,CanvasTexture:TW,CapsuleBufferGeometry:v7,CapsuleGeometry:gd,CatmullRomCurve3:CL,CineonToneMapping:DR,CircleBufferGeometry:y7,CircleGeometry:vd,ClampToEdgeWrapping:pr,Clock:US,Color:Ge,ColorKeyframeTrack:OS,ColorManagement:di,CompressedTexture:EL,CompressedTextureLoader:a9,ConeBufferGeometry:_7,ConeGeometry:yd,CubeCamera:lL,CubeReflectionMapping:Vo,CubeRefractionMapping:Go,CubeTexture:pd,CubeTextureLoader:l9,CubeUVReflectionMapping:Hu,CubicBezierCurve:TS,CubicBezierCurve3:AL,CubicInterpolant:jL,CullFaceBack:sx,CullFaceFront:uR,CullFaceFrontBack:NB,CullFaceNone:lR,Curve:Gi,CurvePath:RL,CustomBlending:fR,CustomToneMapping:OR,CylinderBufferGeometry:x7,CylinderGeometry:Bn,Cylindrical:W9,Data3DTexture:Hg,DataArrayTexture:fd,DataTexture:Su,DataTexture2DArray:p7,DataTexture3D:m7,DataTextureLoader:u9,DataUtils:f7,DecrementStencilOp:$B,DecrementWrapStencilOp:XB,DefaultLoadingManager:qL,DepthFormat:Fo,DepthStencilFormat:Qa,DepthTexture:_S,DirectionalLight:JL,DirectionalLightHelper:e7,DiscreteInterpolant:XL,DodecahedronBufferGeometry:S7,DodecahedronGeometry:_d,DoubleSide:ki,DstAlphaFactor:yR,DstColorFactor:xR,DynamicCopyUsage:lV,DynamicDrawUsage:nV,DynamicReadUsage:sV,EdgesGeometry:LL,EllipseCurve:Zg,EqualDepth:TR,EqualStencilFunc:QB,EquirectangularReflectionMapping:zf,EquirectangularRefractionMapping:Ff,Euler:ll,EventDispatcher:Zs,ExtrudeBufferGeometry:w7,ExtrudeGeometry:xd,FileLoader:Ys,Float16BufferAttribute:GV,Float32BufferAttribute:Xe,Float64BufferAttribute:HV,FloatType:os,Fog:Xg,FogExp2:jg,FramebufferTexture:EW,FrontSide:qa,Frustum:Wg,GLBufferAttribute:G9,GLSL1:cV,GLSL3:Ix,GreaterDepth:AR,GreaterEqualDepth:CR,GreaterEqualStencilFunc:tV,GreaterStencilFunc:JB,GridHelper:K9,Group:du,HalfFloatType:Za,HemisphereLight:ZL,HemisphereLightHelper:Q9,HemisphereLightProbe:y9,IcosahedronBufferGeometry:M7,IcosahedronGeometry:Sd,ImageBitmapLoader:g9,ImageLoader:ed,ImageUtils:hS,ImmediateRenderObject:d7,IncrementStencilOp:WB,IncrementWrapStencilOp:jB,InstancedBufferAttribute:Iu,InstancedBufferGeometry:rI,InstancedInterleavedBuffer:V9,InstancedMesh:wL,Int16BufferAttribute:BV,Int32BufferAttribute:VV,Int8BufferAttribute:zV,IntType:FR,InterleavedBuffer:Yg,InterleavedBufferAttribute:Ka,Interpolant:Cd,InterpolateDiscrete:Vf,InterpolateLinear:Gf,InterpolateSmooth:cm,InvertStencilOp:YB,KeepStencilOp:fm,KeyframeTrack:Hi,LOD:xL,LatheBufferGeometry:b7,LatheGeometry:$u,Layers:Va,LessDepth:ER,LessEqualDepth:rg,LessEqualStencilFunc:KB,LessStencilFunc:ZB,Light:Zo,LightProbe:Jg,Line:St,Line3:j9,LineBasicMaterial:lr,LineCurve:Qg,LineCurve3:PL,LineDashedMaterial:WL,LineLoop:ML,LineSegments:ps,LinearEncoding:Xs,LinearFilter:un,LinearInterpolant:DS,LinearMipMapLinearFilter:zB,LinearMipMapNearestFilter:kB,LinearMipmapLinearFilter:sl,LinearMipmapNearestFilter:uS,LinearSRGBColorSpace:Po,LinearToneMapping:IR,Loader:Kr,LoaderUtils:Bx,LoadingManager:kS,LoopOnce:QR,LoopPingPong:JR,LoopRepeat:KR,LuminanceAlphaFormat:WR,LuminanceFormat:HR,MOUSE:LB,Material:qn,MaterialLoader:e0,MathUtils:is,Matrix3:Tr,Matrix4:dt,MaxEquation:cx,Mesh:We,MeshBasicMaterial:hs,MeshDepthMaterial:vS,MeshDistanceMaterial:yS,MeshLambertMaterial:GL,MeshMatcapMaterial:HL,MeshNormalMaterial:VL,MeshPhongMaterial:UL,MeshPhysicalMaterial:FL,MeshStandardMaterial:LS,MeshToonMaterial:BL,MinEquation:ux,MirroredRepeatWrapping:Bf,MixOperation:RR,MultiplyBlending:lx,MultiplyOperation:cd,NearestFilter:En,NearestMipMapLinearFilter:OB,NearestMipMapNearestFilter:DB,NearestMipmapLinearFilter:sg,NearestMipmapNearestFilter:ig,NeverDepth:MR,NeverStencilFunc:qB,NoBlending:Gs,NoColorSpace:VB,NoToneMapping:Ui,NormalAnimationBlendMode:Gg,NormalBlending:za,NotEqualDepth:PR,NotEqualStencilFunc:eV,NumberKeyframeTrack:Qf,Object3D:Mt,ObjectLoader:p9,ObjectSpaceNormalMap:nL,OctahedronBufferGeometry:E7,OctahedronGeometry:Vr,OneFactor:mR,OneMinusDstAlphaFactor:_R,OneMinusDstColorFactor:SR,OneMinusSrcAlphaFactor:aS,OneMinusSrcColorFactor:vR,OrthographicCamera:md,PCFShadowMap:Bg,PCFSoftShadowMap:cf,PMREMGenerator:Dx,Path:Xf,PerspectiveCamera:Gn,Plane:So,PlaneBufferGeometry:T7,PlaneGeometry:Gr,PlaneHelper:i7,PointLight:KL,PointLightHelper:q9,Points:bL,PointsMaterial:bS,PolarGridHelper:J9,PolyhedronBufferGeometry:C7,PolyhedronGeometry:Qs,PositionalAudio:b9,PropertyBinding:Lt,PropertyMixer:oI,QuadraticBezierCurve:CS,QuadraticBezierCurve3:AS,Quaternion:Gt,QuaternionKeyframeTrack:ju,QuaternionLinearInterpolant:YL,REVISION:Ug,RGBADepthPacking:tL,RGBAFormat:_i,RGBAIntegerFormat:qR,RGBA_ASTC_10x10_Format:Ax,RGBA_ASTC_10x5_Format:Ex,RGBA_ASTC_10x6_Format:Tx,RGBA_ASTC_10x8_Format:Cx,RGBA_ASTC_12x10_Format:Px,RGBA_ASTC_12x12_Format:Rx,RGBA_ASTC_4x4_Format:vx,RGBA_ASTC_5x4_Format:yx,RGBA_ASTC_5x5_Format:_x,RGBA_ASTC_6x5_Format:xx,RGBA_ASTC_6x6_Format:Sx,RGBA_ASTC_8x5_Format:wx,RGBA_ASTC_8x6_Format:Mx,RGBA_ASTC_8x8_Format:bx,RGBA_BPTC_Format:Lx,RGBA_ETC2_EAC_Format:gx,RGBA_PVRTC_2BPPV1_Format:px,RGBA_PVRTC_4BPPV1_Format:hx,RGBA_S3TC_DXT1_Format:am,RGBA_S3TC_DXT3_Format:lm,RGBA_S3TC_DXT5_Format:um,RGBFormat:GR,RGB_ETC1_Format:ZR,RGB_ETC2_Format:mx,RGB_PVRTC_2BPPV1_Format:dx,RGB_PVRTC_4BPPV1_Format:fx,RGB_S3TC_DXT1_Format:om,RGFormat:XR,RGIntegerFormat:YR,RawShaderMaterial:zL,Ray:dd,Raycaster:HS,RectAreaLight:tI,RedFormat:$R,RedIntegerFormat:jR,ReinhardToneMapping:NR,RepeatWrapping:Uf,ReplaceStencilOp:HB,ReverseSubtractEquation:hR,RingBufferGeometry:A7,RingGeometry:wd,SRGBColorSpace:ts,Scene:SS,ShaderChunk:wt,ShaderLib:Oi,ShaderMaterial:fs,ShadowMaterial:kL,Shape:Ga,ShapeBufferGeometry:P7,ShapeGeometry:Md,ShapePath:a7,ShapeUtils:cs,ShortType:zR,Skeleton:qg,SkeletonHelper:Y9,SkinnedMesh:SL,Source:Ra,Sphere:al,SphereBufferGeometry:R7,SphereGeometry:ul,Spherical:H9,SphericalHarmonics3:nI,SplineCurve:PS,SpotLight:QL,SpotLightHelper:X9,Sprite:_L,SpriteMaterial:wS,SrcAlphaFactor:oS,SrcAlphaSaturateFactor:wR,SrcColorFactor:gR,StaticCopyUsage:aV,StaticDrawUsage:Wf,StaticReadUsage:iV,StereoCamera:x9,StreamCopyUsage:uV,StreamDrawUsage:rV,StreamReadUsage:oV,StringKeyframeTrack:fl,SubtractEquation:dR,SubtractiveBlending:ax,TOUCH:IB,TangentSpaceNormalMap:qo,TetrahedronBufferGeometry:L7,TetrahedronGeometry:bd,Texture:Cn,TextureLoader:c9,TorusBufferGeometry:I7,TorusGeometry:Bs,TorusKnotBufferGeometry:N7,TorusKnotGeometry:Ed,Triangle:vi,TriangleFanDrawMode:BB,TriangleStripDrawMode:UB,TrianglesDrawMode:FB,TubeBufferGeometry:D7,TubeGeometry:Td,UVMapping:Vg,Uint16BufferAttribute:pS,Uint32BufferAttribute:mS,Uint8BufferAttribute:FV,Uint8ClampedBufferAttribute:UV,Uniform:GS,UniformsGroup:B9,UniformsLib:De,UniformsUtils:aL,UnsignedByteType:Ho,UnsignedInt248Type:Fa,UnsignedIntType:Ao,UnsignedShort4444Type:UR,UnsignedShort5551Type:BR,UnsignedShortType:cS,VSMShadowMap:Ca,Vector2:Me,Vector3:I,Vector4:Ht,VectorKeyframeTrack:Kf,VideoTexture:bW,WebGL1Renderer:vL,WebGL3DRenderTarget:CV,WebGLArrayRenderTarget:TV,WebGLCubeRenderTarget:uL,WebGLMultipleRenderTargets:AV,WebGLMultisampleRenderTarget:h7,WebGLRenderTarget:qr,WebGLRenderer:xS,WebGLUtils:mL,WireframeGeometry:OL,WrapAroundEnding:Hf,ZeroCurvatureEnding:Aa,ZeroFactor:pR,ZeroSlopeEnding:Pa,ZeroStencilOp:GB,_SRGBAFormat:og,sRGBEncoding:Kt},Symbol.toStringTag,{value:"Module"})),Ia={exports:{}},dl={};/**
* @license React
* react-reconciler-constants.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/dl.ConcurrentRoot=1;dl.ContinuousEventPriority=4;dl.DefaultEventPriority=16;dl.DiscreteEventPriority=1;dl.IdleEventPriority=536870912;dl.LegacyRoot=0;Ia.exports=dl;function O7(n){let e;const t=new Set,r=(f,d)=>{const h=typeof f=="function"?f(e):f;if(h!==e){const p=e;e=d?h:Object.assign({},e,h),t.forEach(g=>g(e,p))}},i=()=>e,s=(f,d=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=d(e);function g(){const v=d(e);if(!h(p,v)){const y=p;f(p=v,y)}}return t.add(g),()=>t.delete(g)},c={setState:r,getState:i,subscribe:(f,d,h)=>d||h?s(f,d,h):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=n(r,i,c),c}const k7=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),z2=k7?te.exports.useEffect:te.exports.useLayoutEffect;function z7(n){const e=typeof n=="function"?O7(n):n,t=(r=e.getState,i=Object.is)=>{const[,s]=te.exports.useReducer(x=>x+1,0),o=e.getState(),a=te.exports.useRef(o),c=te.exports.useRef(r),f=te.exports.useRef(i),d=te.exports.useRef(!1),h=te.exports.useRef();h.current===void 0&&(h.current=r(o));let p,g=!1;(a.current!==o||c.current!==r||f.current!==i||d.current)&&(p=r(o),g=!i(h.current,p)),z2(()=>{g&&(h.current=p),a.current=o,c.current=r,f.current=i,d.current=!1});const v=te.exports.useRef(o);z2(()=>{const x=()=>{try{const _=e.getState(),M=c.current(_);f.current(h.current,M)||(a.current=_,h.current=M,s())}catch{d.current=!0,s()}},w=e.subscribe(x);return e.getState()!==v.current&&x(),w},[]);const y=g?p:h.current;return te.exports.useDebugValue(y),y};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[t,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},t}var lI={exports:{}},ug={exports:{}},uI={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(n){function e(z,F){var G=z.length;z.push(F);e:for(;0<G;){var Z=G-1>>>1,k=z[Z];if(0<i(k,F))z[Z]=F,z[G]=k,G=Z;else break e}}function t(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var F=z[0],G=z.pop();if(G!==F){z[0]=G;e:for(var Z=0,k=z.length,W=k>>>1;Z<W;){var N=2*(Z+1)-1,me=z[N],X=N+1,Te=z[X];if(0>i(me,G))X<k&&0>i(Te,me)?(z[Z]=Te,z[X]=G,Z=X):(z[Z]=me,z[N]=G,Z=N);else if(X<k&&0>i(Te,G))z[Z]=Te,z[X]=G,Z=X;else break e}}return F}function i(z,F){var G=z.sortIndex-F.sortIndex;return G!==0?G:z.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var c=[],f=[],d=1,h=null,p=3,g=!1,v=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(z){for(var F=t(f);F!==null;){if(F.callback===null)r(f);else if(F.startTime<=z)r(f),F.sortIndex=F.expirationTime,e(c,F);else break;F=t(f)}}function E(z){if(y=!1,M(z),!v)if(t(c)!==null)v=!0,le(C);else{var F=t(f);F!==null&&pe(E,F.startTime-z)}}function C(z,F){v=!1,y&&(y=!1,w(T),T=-1),g=!0;var G=p;try{for(M(F),h=t(c);h!==null&&(!(h.expirationTime>F)||z&&!Y());){var Z=h.callback;if(typeof Z=="function"){h.callback=null,p=h.priorityLevel;var k=Z(h.expirationTime<=F);F=n.unstable_now(),typeof k=="function"?h.callback=k:h===t(c)&&r(c),M(F)}else r(c);h=t(c)}if(h!==null)var W=!0;else{var N=t(f);N!==null&&pe(E,N.startTime-F),W=!1}return W}finally{h=null,p=G,g=!1}}var P=!1,R=null,T=-1,L=5,D=-1;function Y(){return!(n.unstable_now()-D<L)}function fe(){if(R!==null){var z=n.unstable_now();D=z;var F=!0;try{F=R(!0,z)}finally{F?q():(P=!1,R=null)}}else P=!1}var q;if(typeof _=="function")q=function(){_(fe)};else if(typeof MessageChannel!="undefined"){var $=new MessageChannel,se=$.port2;$.port1.onmessage=fe,q=function(){se.postMessage(null)}}else q=function(){x(fe,0)};function le(z){R=z,P||(P=!0,q())}function pe(z,F){T=x(function(){z(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(z){z.callback=null},n.unstable_continueExecution=function(){v||g||(v=!0,le(C))},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(c)},n.unstable_next=function(z){switch(p){case 1:case 2:case 3:var F=3;break;default:F=p}var G=p;p=F;try{return z()}finally{p=G}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(z,F){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var G=p;p=z;try{return F()}finally{p=G}},n.unstable_scheduleCallback=function(z,F,G){var Z=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Z+G:Z):G=Z,z){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=G+k,z={id:d++,callback:F,priorityLevel:z,startTime:G,expirationTime:k,sortIndex:-1},G>Z?(z.sortIndex=G,e(f,z),t(c)===null&&z===t(f)&&(y?(w(T),T=-1):y=!0,pe(E,G-Z))):(z.sortIndex=k,e(c,z),v||g||(v=!0,le(C))),z},n.unstable_shouldYield=Y,n.unstable_wrapCallback=function(z){var F=p;return function(){var G=p;p=F;try{return z.apply(this,arguments)}finally{p=G}}}})(uI);ug.exports=uI;/**
* @license React
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var F7=function(e){var t={},r=te.exports,i=ug.exports,s=Object.assign;function o(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c=Symbol.for("react.element"),f=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),v=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),C=Symbol.iterator;function P(l){return l===null||typeof l!="object"?null:(l=C&&l[C]||l["@@iterator"],typeof l=="function"?l:null)}function R(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case d:return"Fragment";case f:return"Portal";case p:return"Profiler";case h:return"StrictMode";case x:return"Suspense";case w:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case v:return(l.displayName||"Context")+".Consumer";case g:return(l._context.displayName||"Context")+".Provider";case y:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case _:return u=l.displayName||null,u!==null?u:R(l.type)||"Memo";case M:u=l._payload,l=l._init;try{return R(l(u))}catch{}}return null}function T(l){var u=l.type;switch(l.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=u.render,l=l.displayName||l.name||"",u.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(u);case 8:return u===h?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function L(l){var u=l,m=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(m=u.return),l=u.return;while(l)}return u.tag===3?m:null}function D(l){if(L(l)!==l)throw Error(o(188))}function Y(l){var u=l.alternate;if(!u){if(u=L(l),u===null)throw Error(o(188));return u!==l?null:l}for(var m=l,S=u;;){var b=m.return;if(b===null)break;var A=b.alternate;if(A===null){if(S=b.return,S!==null){m=S;continue}break}if(b.child===A.child){for(A=b.child;A;){if(A===m)return D(b),l;if(A===S)return D(b),u;A=A.sibling}throw Error(o(188))}if(m.return!==S.return)m=b,S=A;else{for(var V=!1,K=b.child;K;){if(K===m){V=!0,m=b,S=A;break}if(K===S){V=!0,S=b,m=A;break}K=K.sibling}if(!V){for(K=A.child;K;){if(K===m){V=!0,m=A,S=b;break}if(K===S){V=!0,S=A,m=b;break}K=K.sibling}if(!V)throw Error(o(189))}}if(m.alternate!==S)throw Error(o(190))}if(m.tag!==3)throw Error(o(188));return m.stateNode.current===m?l:u}function fe(l){return l=Y(l),l!==null?q(l):null}function q(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=q(l);if(u!==null)return u;l=l.sibling}return null}function $(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var u=$(l);if(u!==null)return u}l=l.sibling}return null}var se=Array.isArray,le=e.getPublicInstance,pe=e.getRootHostContext,z=e.getChildHostContext,F=e.prepareForCommit,G=e.resetAfterCommit,Z=e.createInstance,k=e.appendInitialChild,W=e.finalizeInitialChildren,N=e.prepareUpdate,me=e.shouldSetTextContent,X=e.createTextInstance,Te=e.scheduleTimeout,Ce=e.cancelTimeout,we=e.noTimeout,be=e.isPrimaryRenderer,He=e.supportsMutation,ue=e.supportsPersistence,ne=e.supportsHydration,Ee=e.getInstanceFromNode,Ue=e.preparePortalMount,Le=e.getCurrentEventPriority,qe=e.detachDeletedInstance,et=e.supportsMicrotasks,tt=e.scheduleMicrotask,Ct=e.supportsTestSelectors,Nt=e.findFiberRoot,H=e.getBoundingRect,O=e.getTextContent,ce=e.isHiddenSubtree,Pe=e.matchAccessibilityRole,Ne=e.setFocusIfFocusable,ze=e.setupIntersectionObserver,st=e.appendChild,Be=e.appendChildToContainer,Se=e.commitTextUpdate,Je=e.commitMount,ot=e.commitUpdate,Ze=e.insertBefore,it=e.insertInContainerBefore,Q=e.removeChild,j=e.removeChildFromContainer,U=e.resetTextContent,de=e.hideInstance,ie=e.hideTextInstance,ee=e.unhideInstance,ye=e.unhideTextInstance,Ae=e.clearContainer,Oe=e.cloneInstance,Ye=e.createContainerChildSet,bt=e.appendChildToContainerChildSet,_t=e.finalizeContainerChildren,Ft=e.replaceContainerChildren,$t=e.cloneHiddenInstance,Zn=e.cloneHiddenTextInstance,Nr=e.canHydrateInstance,vs=e.canHydrateTextInstance,ys=e.canHydrateSuspenseInstance,Wi=e.isSuspenseInstancePending,Qu=e.isSuspenseInstanceFallback,B=e.registerSuspenseInstanceRetry,oe=e.getNextHydratableSibling,_e=e.getFirstHydratableChild,re=e.getFirstHydratableChildWithinContainer,xe=e.getFirstHydratableChildWithinSuspenseInstance,nt=e.hydrateInstance,lt=e.hydrateTextInstance,gt=e.hydrateSuspenseInstance,ut=e.getNextHydratableInstanceAfterSuspenseInstance,Dt=e.commitHydratedContainer,At=e.commitHydratedSuspenseInstance,Pt=e.clearSuspenseBoundary,en=e.clearSuspenseBoundaryFromContainer,_s=e.shouldDeleteUnhydratedTailInstances,Js=e.didNotMatchHydratedContainerTextInstance,eo=e.didNotMatchHydratedTextInstance,yr;function Et(l){if(yr===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);yr=u&&u[1]||""}return`
`+yr+l}var $i=!1;function tn(l,u){if(!l||$i)return"";$i=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(Ie){var S=Ie}Reflect.construct(l,[],u)}else{try{u.call()}catch(Ie){S=Ie}l.call(u.prototype)}else{try{throw Error()}catch(Ie){S=Ie}l()}}catch(Ie){if(Ie&&S&&typeof Ie.stack=="string"){for(var b=Ie.stack.split(`
`),A=S.stack.split(`
`),V=b.length-1,K=A.length-1;1<=V&&0<=K&&b[V]!==A[K];)K--;for(;1<=V&&0<=K;V--,K--)if(b[V]!==A[K]){if(V!==1||K!==1)do if(V--,K--,0>K||b[V]!==A[K]){var ge=`
`+b[V].replace(" at new "," at ");return l.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",l.displayName)),ge}while(1<=V&&0<=K);break}}}finally{$i=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?Et(l):""}var _r=Object.prototype.hasOwnProperty,Jr=[],ei=-1;function ti(l){return{current:l}}function mt(l){0>ei||(l.current=Jr[ei],Jr[ei]=null,ei--)}function Rt(l,u){ei++,Jr[ei]=l.current,l.current=u}var ni={},Bt=ti(ni),On=ti(!1),xs=ni;function Ss(l,u){var m=l.type.contextTypes;if(!m)return ni;var S=l.stateNode;if(S&&S.__reactInternalMemoizedUnmaskedChildContext===u)return S.__reactInternalMemoizedMaskedChildContext;var b={},A;for(A in m)b[A]=u[A];return S&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=b),b}function xr(l){return l=l.childContextTypes,l!=null}function zd(){mt(On),mt(Bt)}function _w(l,u,m){if(Bt.current!==ni)throw Error(o(168));Rt(Bt,u),Rt(On,m)}function xw(l,u,m){var S=l.stateNode;if(u=u.childContextTypes,typeof S.getChildContext!="function")return m;S=S.getChildContext();for(var b in S)if(!(b in u))throw Error(o(108,T(l)||"Unknown",b));return s({},m,S)}function Fd(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ni,xs=Bt.current,Rt(Bt,l),Rt(On,On.current),!0}function Sw(l,u,m){var S=l.stateNode;if(!S)throw Error(o(169));m?(l=xw(l,u,xs),S.__reactInternalMemoizedMergedChildContext=l,mt(On),mt(Bt),Rt(Bt,l)):mt(On),Rt(On,m)}var bi=Math.clz32?Math.clz32:cD,lD=Math.log,uD=Math.LN2;function cD(l){return l>>>=0,l===0?32:31-(lD(l)/uD|0)|0}var Ud=64,Bd=4194304;function Ku(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Vd(l,u){var m=l.pendingLanes;if(m===0)return 0;var S=0,b=l.suspendedLanes,A=l.pingedLanes,V=m&268435455;if(V!==0){var K=V&~b;K!==0?S=Ku(K):(A&=V,A!==0&&(S=Ku(A)))}else V=m&~b,V!==0?S=Ku(V):A!==0&&(S=Ku(A));if(S===0)return 0;if(u!==0&&u!==S&&(u&b)===0&&(b=S&-S,A=u&-u,b>=A||b===16&&(A&4194240)!==0))return u;if((S&4)!==0&&(S|=m&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=S;0<u;)m=31-bi(u),b=1<<m,S|=l[m],u&=~b;return S}function fD(l,u){switch(l){case 1:case 2:case 4:return u+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 u+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 dD(l,u){for(var m=l.suspendedLanes,S=l.pingedLanes,b=l.expirationTimes,A=l.pendingLanes;0<A;){var V=31-bi(A),K=1<<V,ge=b[V];ge===-1?((K&m)===0||(K&S)!==0)&&(b[V]=fD(K,u)):ge<=u&&(l.expiredLanes|=K),A&=~K}}function b0(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function E0(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Ju(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-bi(u),l[u]=m}function hD(l,u){var m=l.pendingLanes&~u;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=u,l.mutableReadLanes&=u,l.entangledLanes&=u,u=l.entanglements;var S=l.eventTimes;for(l=l.expirationTimes;0<m;){var b=31-bi(m),A=1<<b;u[b]=0,S[b]=-1,l[b]=-1,m&=~A}}function T0(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var S=31-bi(m),b=1<<S;b&u|l[S]&u&&(l[S]|=u),m&=~b}}var Ot=0;function ww(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var C0=i.unstable_scheduleCallback,Mw=i.unstable_cancelCallback,pD=i.unstable_shouldYield,mD=i.unstable_requestPaint,kn=i.unstable_now,A0=i.unstable_ImmediatePriority,gD=i.unstable_UserBlockingPriority,P0=i.unstable_NormalPriority,vD=i.unstable_IdlePriority,Gd=null,ji=null;function yD(l){if(ji&&typeof ji.onCommitFiberRoot=="function")try{ji.onCommitFiberRoot(Gd,l,void 0,(l.current.flags&128)===128)}catch{}}function _D(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Xi=typeof Object.is=="function"?Object.is:_D,ws=null,Hd=!1,R0=!1;function bw(l){ws===null?ws=[l]:ws.push(l)}function xD(l){Hd=!0,bw(l)}function Yi(){if(!R0&&ws!==null){R0=!0;var l=0,u=Ot;try{var m=ws;for(Ot=1;l<m.length;l++){var S=m[l];do S=S(!0);while(S!==null)}ws=null,Hd=!1}catch(b){throw ws!==null&&(ws=ws.slice(l+1)),C0(A0,Yi),b}finally{Ot=u,R0=!1}}return null}var SD=a.ReactCurrentBatchConfig;function Wd(l,u){if(Xi(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var m=Object.keys(l),S=Object.keys(u);if(m.length!==S.length)return!1;for(S=0;S<m.length;S++){var b=m[S];if(!_r.call(u,b)||!Xi(l[b],u[b]))return!1}return!0}function wD(l){switch(l.tag){case 5:return Et(l.type);case 16:return Et("Lazy");case 13:return Et("Suspense");case 19:return Et("SuspenseList");case 0:case 2:case 15:return l=tn(l.type,!1),l;case 11:return l=tn(l.type.render,!1),l;case 1:return l=tn(l.type,!0),l;default:return""}}function Ei(l,u){if(l&&l.defaultProps){u=s({},u),l=l.defaultProps;for(var m in l)u[m]===void 0&&(u[m]=l[m]);return u}return u}var $d=ti(null),jd=null,ml=null,L0=null;function I0(){L0=ml=jd=null}function Ew(l,u,m){be?(Rt($d,u._currentValue),u._currentValue=m):(Rt($d,u._currentValue2),u._currentValue2=m)}function N0(l){var u=$d.current;mt($d),be?l._currentValue=u:l._currentValue2=u}function D0(l,u,m){for(;l!==null;){var S=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,S!==null&&(S.childLanes|=u)):S!==null&&(S.childLanes&u)!==u&&(S.childLanes|=u),l===m)break;l=l.return}}function gl(l,u){jd=l,L0=ml=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(kr=!0),l.firstContext=null)}function ri(l){var u=be?l._currentValue:l._currentValue2;if(L0!==l)if(l={context:l,memoizedValue:u,next:null},ml===null){if(jd===null)throw Error(o(308));ml=l,jd.dependencies={lanes:0,firstContext:l}}else ml=ml.next=l;return u}var qi=null,to=!1;function O0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tw(l,u){l=l.updateQueue,u.updateQueue===l&&(u.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Ms(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function no(l,u){var m=l.updateQueue;m!==null&&(m=m.shared,Sn!==null&&(l.mode&1)!==0&&(xt&2)===0?(l=m.interleaved,l===null?(u.next=u,qi===null?qi=[m]:qi.push(m)):(u.next=l.next,l.next=u),m.interleaved=u):(l=m.pending,l===null?u.next=u:(u.next=l.next,l.next=u),m.pending=u))}function Xd(l,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194240)!==0)){var S=u.lanes;S&=l.pendingLanes,m|=S,u.lanes=m,T0(l,m)}}function Cw(l,u){var m=l.updateQueue,S=l.alternate;if(S!==null&&(S=S.updateQueue,m===S)){var b=null,A=null;if(m=m.firstBaseUpdate,m!==null){do{var V={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};A===null?b=A=V:A=A.next=V,m=m.next}while(m!==null);A===null?b=A=u:A=A.next=u}else b=A=u;m={baseState:S.baseState,firstBaseUpdate:b,lastBaseUpdate:A,shared:S.shared,effects:S.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=u}function Yd(l,u,m,S){var b=l.updateQueue;to=!1;var A=b.firstBaseUpdate,V=b.lastBaseUpdate,K=b.shared.pending;if(K!==null){b.shared.pending=null;var ge=K,Ie=ge.next;ge.next=null,V===null?A=Ie:V.next=Ie,V=ge;var je=l.alternate;je!==null&&(je=je.updateQueue,K=je.lastBaseUpdate,K!==V&&(K===null?je.firstBaseUpdate=Ie:K.next=Ie,je.lastBaseUpdate=ge))}if(A!==null){var ct=b.baseState;V=0,je=Ie=ge=null,K=A;do{var rt=K.lane,jt=K.eventTime;if((S&rt)===rt){je!==null&&(je=je.next={eventTime:jt,lane:0,tag:K.tag,payload:K.payload,callback:K.callback,next:null});e:{var Ke=l,er=K;switch(rt=u,jt=m,er.tag){case 1:if(Ke=er.payload,typeof Ke=="function"){ct=Ke.call(jt,ct,rt);break e}ct=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=er.payload,rt=typeof Ke=="function"?Ke.call(jt,ct,rt):Ke,rt==null)break e;ct=s({},ct,rt);break e;case 2:to=!0}}K.callback!==null&&K.lane!==0&&(l.flags|=64,rt=b.effects,rt===null?b.effects=[K]:rt.push(K))}else jt={eventTime:jt,lane:rt,tag:K.tag,payload:K.payload,callback:K.callback,next:null},je===null?(Ie=je=jt,ge=ct):je=je.next=jt,V|=rt;if(K=K.next,K===null){if(K=b.shared.pending,K===null)break;rt=K,K=rt.next,rt.next=null,b.lastBaseUpdate=rt,b.shared.pending=null}}while(1);if(je===null&&(ge=ct),b.baseState=ge,b.firstBaseUpdate=Ie,b.lastBaseUpdate=je,u=b.shared.interleaved,u!==null){b=u;do V|=b.lane,b=b.next;while(b!==u)}else A===null&&(b.shared.lanes=0);El|=V,l.lanes=V,l.memoizedState=ct}}function Aw(l,u,m){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var S=l[u],b=S.callback;if(b!==null){if(S.callback=null,S=m,typeof b!="function")throw Error(o(191,b));b.call(S)}}}var Pw=new r.Component().refs;function k0(l,u,m,S){u=l.memoizedState,m=m(S,u),m=m==null?u:s({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var qd={isMounted:function(l){return(l=l._reactInternals)?L(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var S=cr(),b=so(l),A=Ms(S,b);A.payload=u,m!=null&&(A.callback=m),no(l,A),u=li(l,b,S),u!==null&&Xd(u,l,b)},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var S=cr(),b=so(l),A=Ms(S,b);A.tag=1,A.payload=u,m!=null&&(A.callback=m),no(l,A),u=li(l,b,S),u!==null&&Xd(u,l,b)},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=cr(),S=so(l),b=Ms(m,S);b.tag=2,u!=null&&(b.callback=u),no(l,b),u=li(l,S,m),u!==null&&Xd(u,l,S)}};function Rw(l,u,m,S,b,A,V){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(S,A,V):u.prototype&&u.prototype.isPureReactComponent?!Wd(m,S)||!Wd(b,A):!0}function Lw(l,u,m){var S=!1,b=ni,A=u.contextType;return typeof A=="object"&&A!==null?A=ri(A):(b=xr(u)?xs:Bt.current,S=u.contextTypes,A=(S=S!=null)?Ss(l,b):ni),u=new u(m,A),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=qd,l.stateNode=u,u._reactInternals=l,S&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=b,l.__reactInternalMemoizedMaskedChildContext=A),u}function Iw(l,u,m,S){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,S),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,S),u.state!==l&&qd.enqueueReplaceState(u,u.state,null)}function z0(l,u,m,S){var b=l.stateNode;b.props=m,b.state=l.memoizedState,b.refs=Pw,O0(l);var A=u.contextType;typeof A=="object"&&A!==null?b.context=ri(A):(A=xr(u)?xs:Bt.current,b.context=Ss(l,A)),b.state=l.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(k0(l,u,A,m),b.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(u=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),u!==b.state&&qd.enqueueReplaceState(b,b.state,null),Yd(l,m,b,S),b.state=l.memoizedState),typeof b.componentDidMount=="function"&&(l.flags|=4194308)}var vl=[],yl=0,Zd=null,Qd=0,ii=[],si=0,Jo=null,bs=1,Es="";function ea(l,u){vl[yl++]=Qd,vl[yl++]=Zd,Zd=l,Qd=u}function Nw(l,u,m){ii[si++]=bs,ii[si++]=Es,ii[si++]=Jo,Jo=l;var S=bs;l=Es;var b=32-bi(S)-1;S&=~(1<<b),m+=1;var A=32-bi(u)+b;if(30<A){var V=b-b%5;A=(S&(1<<V)-1).toString(32),S>>=V,b-=V,bs=1<<32-bi(u)+b|m<<b|S,Es=A+l}else bs=1<<A|m<<b|S,Es=l}function F0(l){l.return!==null&&(ea(l,1),Nw(l,1,0))}function U0(l){for(;l===Zd;)Zd=vl[--yl],vl[yl]=null,Qd=vl[--yl],vl[yl]=null;for(;l===Jo;)Jo=ii[--si],ii[si]=null,Es=ii[--si],ii[si]=null,bs=ii[--si],ii[si]=null}var Dr=null,Or=null,nn=!1,ec=!1,Ti=null;function Dw(l,u){var m=ui(5,null,null,0);m.elementType="DELETED",m.stateNode=u,m.return=l,u=l.deletions,u===null?(l.deletions=[m],l.flags|=16):u.push(m)}function Ow(l,u){switch(l.tag){case 5:return u=Nr(u,l.type,l.pendingProps),u!==null?(l.stateNode=u,Dr=l,Or=_e(u),!0):!1;case 6:return u=vs(u,l.pendingProps),u!==null?(l.stateNode=u,Dr=l,Or=null,!0):!1;case 13:if(u=ys(u),u!==null){var m=Jo!==null?{id:bs,overflow:Es}:null;return l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=ui(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,Dr=l,Or=null,!0}return!1;default:return!1}}function B0(l){return(l.mode&1)!==0&&(l.flags&128)===0}function V0(l){if(nn){var u=Or;if(u){var m=u;if(!Ow(l,u)){if(B0(l))throw Error(o(418));u=oe(m);var S=Dr;u&&Ow(l,u)?Dw(S,m):(l.flags=l.flags&-4097|2,nn=!1,Dr=l)}}else{if(B0(l))throw Error(o(418));l.flags=l.flags&-4097|2,nn=!1,Dr=l}}}function kw(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Dr=l}function tc(l){if(!ne||l!==Dr)return!1;if(!nn)return kw(l),nn=!0,!1;if(l.tag!==3&&(l.tag!==5||_s(l.type)&&!me(l.type,l.memoizedProps))){var u=Or;if(u){if(B0(l)){for(l=Or;l;)l=oe(l);throw Error(o(418))}for(;u;)Dw(l,u),u=oe(u)}}if(kw(l),l.tag===13){if(!ne)throw Error(o(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(317));Or=ut(l)}else Or=Dr?oe(l.stateNode):null;return!0}function _l(){ne&&(Or=Dr=null,ec=nn=!1)}function G0(l){Ti===null?Ti=[l]:Ti.push(l)}function nc(l,u,m){if(l=m.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(o(309));var S=m.stateNode}if(!S)throw Error(o(147,l));var b=S,A=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===A?u.ref:(u=function(V){var K=b.refs;K===Pw&&(K=b.refs={}),V===null?delete K[A]:K[A]=V},u._stringRef=A,u)}if(typeof l!="string")throw Error(o(284));if(!m._owner)throw Error(o(290,l))}return l}function Kd(l,u){throw l=Object.prototype.toString.call(u),Error(o(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function zw(l){var u=l._init;return u(l._payload)}function Fw(l){function u(ae,J){if(l){var he=ae.deletions;he===null?(ae.deletions=[J],ae.flags|=16):he.push(J)}}function m(ae,J){if(!l)return null;for(;J!==null;)u(ae,J),J=J.sibling;return null}function S(ae,J){for(ae=new Map;J!==null;)J.key!==null?ae.set(J.key,J):ae.set(J.index,J),J=J.sibling;return ae}function b(ae,J){return ae=ao(ae,J),ae.index=0,ae.sibling=null,ae}function A(ae,J,he){return ae.index=he,l?(he=ae.alternate,he!==null?(he=he.index,he<J?(ae.flags|=2,J):he):(ae.flags|=2,J)):(ae.flags|=1048576,J)}function V(ae){return l&&ae.alternate===null&&(ae.flags|=2),ae}function K(ae,J,he,Ve){return J===null||J.tag!==6?(J=Ev(he,ae.mode,Ve),J.return=ae,J):(J=b(J,he),J.return=ae,J)}function ge(ae,J,he,Ve){var Qe=he.type;return Qe===d?je(ae,J,he.props.children,Ve,he.key):J!==null&&(J.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===M&&zw(Qe)===J.type)?(Ve=b(J,he.props),Ve.ref=nc(ae,J,he),Ve.return=ae,Ve):(Ve=Ph(he.type,he.key,he.props,null,ae.mode,Ve),Ve.ref=nc(ae,J,he),Ve.return=ae,Ve)}function Ie(ae,J,he,Ve){return J===null||J.tag!==4||J.stateNode.containerInfo!==he.containerInfo||J.stateNode.implementation!==he.implementation?(J=Tv(he,ae.mode,Ve),J.return=ae,J):(J=b(J,he.children||[]),J.return=ae,J)}function je(ae,J,he,Ve,Qe){return J===null||J.tag!==7?(J=aa(he,ae.mode,Ve,Qe),J.return=ae,J):(J=b(J,he),J.return=ae,J)}function ct(ae,J,he){if(typeof J=="string"&&J!==""||typeof J=="number")return J=Ev(""+J,ae.mode,he),J.return=ae,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case c:return he=Ph(J.type,J.key,J.props,null,ae.mode,he),he.ref=nc(ae,null,J),he.return=ae,he;case f:return J=Tv(J,ae.mode,he),J.return=ae,J;case M:var Ve=J._init;return ct(ae,Ve(J._payload),he)}if(se(J)||P(J))return J=aa(J,ae.mode,he,null),J.return=ae,J;Kd(ae,J)}return null}function rt(ae,J,he,Ve){var Qe=J!==null?J.key:null;if(typeof he=="string"&&he!==""||typeof he=="number")return Qe!==null?null:K(ae,J,""+he,Ve);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case c:return he.key===Qe?ge(ae,J,he,Ve):null;case f:return he.key===Qe?Ie(ae,J,he,Ve):null;case M:return Qe=he._init,rt(ae,J,Qe(he._payload),Ve)}if(se(he)||P(he))return Qe!==null?null:je(ae,J,he,Ve,null);Kd(ae,he)}return null}function jt(ae,J,he,Ve,Qe){if(typeof Ve=="string"&&Ve!==""||typeof Ve=="number")return ae=ae.get(he)||null,K(J,ae,""+Ve,Qe);if(typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case c:return ae=ae.get(Ve.key===null?he:Ve.key)||null,ge(J,ae,Ve,Qe);case f:return ae=ae.get(Ve.key===null?he:Ve.key)||null,Ie(J,ae,Ve,Qe);case M:var vt=Ve._init;return jt(ae,J,he,vt(Ve._payload),Qe)}if(se(Ve)||P(Ve))return ae=ae.get(he)||null,je(J,ae,Ve,Qe,null);Kd(J,Ve)}return null}function Ke(ae,J,he,Ve){for(var Qe=null,vt=null,ft=J,kt=J=0,Fn=null;ft!==null&&kt<he.length;kt++){ft.index>kt?(Fn=ft,ft=null):Fn=ft.sibling;var zt=rt(ae,ft,he[kt],Ve);if(zt===null){ft===null&&(ft=Fn);break}l&&ft&&zt.alternate===null&&u(ae,ft),J=A(zt,J,kt),vt===null?Qe=zt:vt.sibling=zt,vt=zt,ft=Fn}if(kt===he.length)return m(ae,ft),nn&&ea(ae,kt),Qe;if(ft===null){for(;kt<he.length;kt++)ft=ct(ae,he[kt],Ve),ft!==null&&(J=A(ft,J,kt),vt===null?Qe=ft:vt.sibling=ft,vt=ft);return nn&&ea(ae,kt),Qe}for(ft=S(ae,ft);kt<he.length;kt++)Fn=jt(ft,ae,kt,he[kt],Ve),Fn!==null&&(l&&Fn.alternate!==null&&ft.delete(Fn.key===null?kt:Fn.key),J=A(Fn,J,kt),vt===null?Qe=Fn:vt.sibling=Fn,vt=Fn);return l&&ft.forEach(function(lo){return u(ae,lo)}),nn&&ea(ae,kt),Qe}function er(ae,J,he,Ve){var Qe=P(he);if(typeof Qe!="function")throw Error(o(150));if(he=Qe.call(he),he==null)throw Error(o(151));for(var vt=Qe=null,ft=J,kt=J=0,Fn=null,zt=he.next();ft!==null&&!zt.done;kt++,zt=he.next()){ft.index>kt?(Fn=ft,ft=null):Fn=ft.sibling;var lo=rt(ae,ft,zt.value,Ve);if(lo===null){ft===null&&(ft=Fn);break}l&&ft&&lo.alternate===null&&u(ae,ft),J=A(lo,J,kt),vt===null?Qe=lo:vt.sibling=lo,vt=lo,ft=Fn}if(zt.done)return m(ae,ft),nn&&ea(ae,kt),Qe;if(ft===null){for(;!zt.done;kt++,zt=he.next())zt=ct(ae,zt.value,Ve),zt!==null&&(J=A(zt,J,kt),vt===null?Qe=zt:vt.sibling=zt,vt=zt);return nn&&ea(ae,kt),Qe}for(ft=S(ae,ft);!zt.done;kt++,zt=he.next())zt=jt(ft,ae,kt,zt.value,Ve),zt!==null&&(l&&zt.alternate!==null&&ft.delete(zt.key===null?kt:zt.key),J=A(zt,J,kt),vt===null?Qe=zt:vt.sibling=zt,vt=zt);return l&&ft.forEach(function(KD){return u(ae,KD)}),nn&&ea(ae,kt),Qe}function ci(ae,J,he,Ve){if(typeof he=="object"&&he!==null&&he.type===d&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case c:e:{for(var Qe=he.key,vt=J;vt!==null;){if(vt.key===Qe){if(Qe=he.type,Qe===d){if(vt.tag===7){m(ae,vt.sibling),J=b(vt,he.props.children),J.return=ae,ae=J;break e}}else if(vt.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===M&&zw(Qe)===vt.type){m(ae,vt.sibling),J=b(vt,he.props),J.ref=nc(ae,vt,he),J.return=ae,ae=J;break e}m(ae,vt);break}else u(ae,vt);vt=vt.sibling}he.type===d?(J=aa(he.props.children,ae.mode,Ve,he.key),J.return=ae,ae=J):(Ve=Ph(he.type,he.key,he.props,null,ae.mode,Ve),Ve.ref=nc(ae,J,he),Ve.return=ae,ae=Ve)}return V(ae);case f:e:{for(vt=he.key;J!==null;){if(J.key===vt)if(J.tag===4&&J.stateNode.containerInfo===he.containerInfo&&J.stateNode.implementation===he.implementation){m(ae,J.sibling),J=b(J,he.children||[]),J.return=ae,ae=J;break e}else{m(ae,J);break}else u(ae,J);J=J.sibling}J=Tv(he,ae.mode,Ve),J.return=ae,ae=J}return V(ae);case M:return vt=he._init,ci(ae,J,vt(he._payload),Ve)}if(se(he))return Ke(ae,J,he,Ve);if(P(he))return er(ae,J,he,Ve);Kd(ae,he)}return typeof he=="string"&&he!==""||typeof he=="number"?(he=""+he,J!==null&&J.tag===6?(m(ae,J.sibling),J=b(J,he),J.return=ae,ae=J):(m(ae,J),J=Ev(he,ae.mode,Ve),J.return=ae,ae=J),V(ae)):m(ae,J)}return ci}var xl=Fw(!0),Uw=Fw(!1),rc={},oi=ti(rc),ic=ti(rc),Sl=ti(rc);function Zi(l){if(l===rc)throw Error(o(174));return l}function H0(l,u){Rt(Sl,u),Rt(ic,l),Rt(oi,rc),l=pe(u),mt(oi),Rt(oi,l)}function wl(){mt(oi),mt(ic),mt(Sl)}function Bw(l){var u=Zi(Sl.current),m=Zi(oi.current);u=z(m,l.type,u),m!==u&&(Rt(ic,l),Rt(oi,u))}function W0(l){ic.current===l&&(mt(oi),mt(ic))}var an=ti(0);function Jd(l){for(var u=l;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||Wi(m)||Qu(m)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var $0=[];function j0(){for(var l=0;l<$0.length;l++){var u=$0[l];be?u._workInProgressVersionPrimary=null:u._workInProgressVersionSecondary=null}$0.length=0}var eh=a.ReactCurrentDispatcher,ai=a.ReactCurrentBatchConfig,Ml=0,hn=null,Qn=null,zn=null,th=!1,sc=!1,oc=0,MD=0;function Kn(){throw Error(o(321))}function X0(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!Xi(l[m],u[m]))return!1;return!0}function Y0(l,u,m,S,b,A){if(Ml=A,hn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,eh.current=l===null||l.memoizedState===null?CD:AD,l=m(S,b),sc){A=0;do{if(sc=!1,oc=0,25<=A)throw Error(o(301));A+=1,zn=Qn=null,u.updateQueue=null,eh.current=PD,l=m(S,b)}while(sc)}if(eh.current=oh,u=Qn!==null&&Qn.next!==null,Ml=0,zn=Qn=hn=null,th=!1,u)throw Error(o(300));return l}function q0(){var l=oc!==0;return oc=0,l}function Ts(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zn===null?hn.memoizedState=zn=l:zn=zn.next=l,zn}function Qi(){if(Qn===null){var l=hn.alternate;l=l!==null?l.memoizedState:null}else l=Qn.next;var u=zn===null?hn.memoizedState:zn.next;if(u!==null)zn=u,Qn=l;else{if(l===null)throw Error(o(310));Qn=l,l={memoizedState:Qn.memoizedState,baseState:Qn.baseState,baseQueue:Qn.baseQueue,queue:Qn.queue,next:null},zn===null?hn.memoizedState=zn=l:zn=zn.next=l}return zn}function ta(l,u){return typeof u=="function"?u(l):u}function nh(l){var u=Qi(),m=u.queue;if(m===null)throw Error(o(311));m.lastRenderedReducer=l;var S=Qn,b=S.baseQueue,A=m.pending;if(A!==null){if(b!==null){var V=b.next;b.next=A.next,A.next=V}S.baseQueue=b=A,m.pending=null}if(b!==null){A=b.next,S=S.baseState;var K=V=null,ge=null,Ie=A;do{var je=Ie.lane;if((Ml&je)===je)ge!==null&&(ge=ge.next={lane:0,action:Ie.action,hasEagerState:Ie.hasEagerState,eagerState:Ie.eagerState,next:null}),S=Ie.hasEagerState?Ie.eagerState:l(S,Ie.action);else{var ct={lane:je,action:Ie.action,hasEagerState:Ie.hasEagerState,eagerState:Ie.eagerState,next:null};ge===null?(K=ge=ct,V=S):ge=ge.next=ct,hn.lanes|=je,El|=je}Ie=Ie.next}while(Ie!==null&&Ie!==A);ge===null?V=S:ge.next=K,Xi(S,u.memoizedState)||(kr=!0),u.memoizedState=S,u.baseState=V,u.baseQueue=ge,m.lastRenderedState=S}if(l=m.interleaved,l!==null){b=l;do A=b.lane,hn.lanes|=A,El|=A,b=b.next;while(b!==l)}else b===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function rh(l){var u=Qi(),m=u.queue;if(m===null)throw Error(o(311));m.lastRenderedReducer=l;var S=m.dispatch,b=m.pending,A=u.memoizedState;if(b!==null){m.pending=null;var V=b=b.next;do A=l(A,V.action),V=V.next;while(V!==b);Xi(A,u.memoizedState)||(kr=!0),u.memoizedState=A,u.baseQueue===null&&(u.baseState=A),m.lastRenderedState=A}return[A,S]}function Vw(){}function Gw(l,u){var m=hn,S=Qi(),b=u(),A=!Xi(S.memoizedState,b);if(A&&(S.memoizedState=b,kr=!0),S=S.queue,lc($w.bind(null,m,S,l),[l]),S.getSnapshot!==u||A||zn!==null&&zn.memoizedState.tag&1){if(m.flags|=2048,ac(9,Ww.bind(null,m,S,b,u),void 0,null),Sn===null)throw Error(o(349));(Ml&30)!==0||Hw(m,u,b)}return b}function Hw(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=hn.updateQueue,u===null?(u={lastEffect:null,stores:null},hn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function Ww(l,u,m,S){u.value=m,u.getSnapshot=S,jw(u)&&li(l,1,-1)}function $w(l,u,m){return m(function(){jw(u)&&li(l,1,-1)})}function jw(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!Xi(l,m)}catch{return!0}}function Z0(l){var u=Ts();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:l},u.queue=l,l=l.dispatch=TD.bind(null,hn,l),[u.memoizedState,l]}function ac(l,u,m,S){return l={tag:l,create:u,destroy:m,deps:S,next:null},u=hn.updateQueue,u===null?(u={lastEffect:null,stores:null},hn.updateQueue=u,u.lastEffect=l.next=l):(m=u.lastEffect,m===null?u.lastEffect=l.next=l:(S=m.next,m.next=l,l.next=S,u.lastEffect=l)),l}function Xw(){return Qi().memoizedState}function ih(l,u,m,S){var b=Ts();hn.flags|=l,b.memoizedState=ac(1|u,m,void 0,S===void 0?null:S)}function sh(l,u,m,S){var b=Qi();S=S===void 0?null:S;var A=void 0;if(Qn!==null){var V=Qn.memoizedState;if(A=V.destroy,S!==null&&X0(S,V.deps)){b.memoizedState=ac(u,m,A,S);return}}hn.flags|=l,b.memoizedState=ac(1|u,m,A,S)}function Q0(l,u){return ih(8390656,8,l,u)}function lc(l,u){return sh(2048,8,l,u)}function Yw(l,u){return sh(4,2,l,u)}function qw(l,u){return sh(4,4,l,u)}function Zw(l,u){if(typeof u=="function")return l=l(),u(l),function(){u(null)};if(u!=null)return l=l(),u.current=l,function(){u.current=null}}function Qw(l,u,m){return m=m!=null?m.concat([l]):null,sh(4,4,Zw.bind(null,u,l),m)}function K0(){}function Kw(l,u){var m=Qi();u=u===void 0?null:u;var S=m.memoizedState;return S!==null&&u!==null&&X0(u,S[1])?S[0]:(m.memoizedState=[l,u],l)}function Jw(l,u){var m=Qi();u=u===void 0?null:u;var S=m.memoizedState;return S!==null&&u!==null&&X0(u,S[1])?S[0]:(l=l(),m.memoizedState=[l,u],l)}function bD(l,u){var m=Ot;Ot=m!==0&&4>m?m:4,l(!0);var S=ai.transition;ai.transition={};try{l(!1),u()}finally{Ot=m,ai.transition=S}}function eM(){return Qi().memoizedState}function ED(l,u,m){var S=so(l);m={lane:S,action:m,hasEagerState:!1,eagerState:null,next:null},tM(l)?nM(u,m):(rM(l,u,m),m=cr(),l=li(l,S,m),l!==null&&iM(l,u,S))}function TD(l,u,m){var S=so(l),b={lane:S,action:m,hasEagerState:!1,eagerState:null,next:null};if(tM(l))nM(u,b);else{rM(l,u,b);var A=l.alternate;if(l.lanes===0&&(A===null||A.lanes===0)&&(A=u.lastRenderedReducer,A!==null))try{var V=u.lastRenderedState,K=A(V,m);if(b.hasEagerState=!0,b.eagerState=K,Xi(K,V))return}catch{}finally{}m=cr(),l=li(l,S,m),l!==null&&iM(l,u,S)}}function tM(l){var u=l.alternate;return l===hn||u!==null&&u===hn}function nM(l,u){sc=th=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function rM(l,u,m){Sn!==null&&(l.mode&1)!==0&&(xt&2)===0?(l=u.interleaved,l===null?(m.next=m,qi===null?qi=[u]:qi.push(u)):(m.next=l.next,l.next=m),u.interleaved=m):(l=u.pending,l===null?m.next=m:(m.next=l.next,l.next=m),u.pending=m)}function iM(l,u,m){if((m&4194240)!==0){var S=u.lanes;S&=l.pendingLanes,m|=S,u.lanes=m,T0(l,m)}}var oh={readContext:ri,useCallback:Kn,useContext:Kn,useEffect:Kn,useImperativeHandle:Kn,useInsertionEffect:Kn,useLayoutEffect:Kn,useMemo:Kn,useReducer:Kn,useRef:Kn,useState:Kn,useDebugValue:Kn,useDeferredValue:Kn,useTransition:Kn,useMutableSource:Kn,useSyncExternalStore:Kn,useId:Kn,unstable_isNewReconciler:!1},CD={readContext:ri,useCallback:function(l,u){return Ts().memoizedState=[l,u===void 0?null:u],l},useContext:ri,useEffect:Q0,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,ih(4194308,4,Zw.bind(null,u,l),m)},useLayoutEffect:function(l,u){return ih(4194308,4,l,u)},useInsertionEffect:function(l,u){return ih(4,2,l,u)},useMemo:function(l,u){var m=Ts();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var S=Ts();return u=m!==void 0?m(u):u,S.memoizedState=S.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},S.queue=l,l=l.dispatch=ED.bind(null,hn,l),[S.memoizedState,l]},useRef:function(l){var u=Ts();return l={current:l},u.memoizedState=l},useState:Z0,useDebugValue:K0,useDeferredValue:function(l){var u=Z0(l),m=u[0],S=u[1];return Q0(function(){var b=ai.transition;ai.transition={};try{S(l)}finally{ai.transition=b}},[l]),m},useTransition:function(){var l=Z0(!1),u=l[0];return l=bD.bind(null,l[1]),Ts().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var S=hn,b=Ts();if(nn){if(m===void 0)throw Error(o(407));m=m()}else{if(m=u(),Sn===null)throw Error(o(349));(Ml&30)!==0||Hw(S,u,m)}b.memoizedState=m;var A={value:m,getSnapshot:u};return b.queue=A,Q0($w.bind(null,S,A,l),[l]),S.flags|=2048,ac(9,Ww.bind(null,S,A,m,u),void 0,null),m},useId:function(){var l=Ts(),u=Sn.identifierPrefix;if(nn){var m=Es,S=bs;m=(S&~(1<<32-bi(S)-1)).toString(32)+m,u=":"+u+"R"+m,m=oc++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=MD++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},AD={readContext:ri,useCallback:Kw,useContext:ri,useEffect:lc,useImperativeHandle:Qw,useInsertionEffect:Yw,useLayoutEffect:qw,useMemo:Jw,useReducer:nh,useRef:Xw,useState:function(){return nh(ta)},useDebugValue:K0,useDeferredValue:function(l){var u=nh(ta),m=u[0],S=u[1];return lc(function(){var b=ai.transition;ai.transition={};try{S(l)}finally{ai.transition=b}},[l]),m},useTransition:function(){var l=nh(ta)[0],u=Qi().memoizedState;return[l,u]},useMutableSource:Vw,useSyncExternalStore:Gw,useId:eM,unstable_isNewReconciler:!1},PD={readContext:ri,useCallback:Kw,useContext:ri,useEffect:lc,useImperativeHandle:Qw,useInsertionEffect:Yw,useLayoutEffect:qw,useMemo:Jw,useReducer:rh,useRef:Xw,useState:function(){return rh(ta)},useDebugValue:K0,useDeferredValue:function(l){var u=rh(ta),m=u[0],S=u[1];return lc(function(){var b=ai.transition;ai.transition={};try{S(l)}finally{ai.transition=b}},[l]),m},useTransition:function(){var l=rh(ta)[0],u=Qi().memoizedState;return[l,u]},useMutableSource:Vw,useSyncExternalStore:Gw,useId:eM,unstable_isNewReconciler:!1};function J0(l,u){try{var m="",S=u;do m+=wD(S),S=S.return;while(S);var b=m}catch(A){b=`
Error generating stack: `+A.message+`
`+A.stack}return{value:l,source:u,stack:b}}function ev(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var RD=typeof WeakMap=="function"?WeakMap:Map;function sM(l,u,m){m=Ms(-1,m),m.tag=3,m.payload={element:null};var S=u.value;return m.callback=function(){wh||(wh=!0,yv=S),ev(l,u)},m}function oM(l,u,m){m=Ms(-1,m),m.tag=3;var S=l.type.getDerivedStateFromError;if(typeof S=="function"){var b=u.value;m.payload=function(){return S(b)},m.callback=function(){ev(l,u)}}var A=l.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(m.callback=function(){ev(l,u),typeof S!="function"&&(ro===null?ro=new Set([this]):ro.add(this));var V=u.stack;this.componentDidCatch(u.value,{componentStack:V!==null?V:""})}),m}function aM(l,u,m){var S=l.pingCache;if(S===null){S=l.pingCache=new RD;var b=new Set;S.set(u,b)}else b=S.get(u),b===void 0&&(b=new Set,S.set(u,b));b.has(m)||(b.add(m),l=WD.bind(null,l,u,m),u.then(l,l))}function lM(l){do{var u;if((u=l.tag===13)&&(u=l.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return l;l=l.return}while(l!==null);return null}function uM(l,u,m,S,b){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(u=Ms(-1,1),u.tag=2,no(m,u))),m.lanes|=1),l):(l.flags|=65536,l.lanes=b,l)}function Ki(l){l.flags|=4}function cM(l,u){if(l!==null&&l.child===u.child)return!0;if((u.flags&16)!==0)return!1;for(l=u.child;l!==null;){if((l.flags&12854)!==0||(l.subtreeFlags&12854)!==0)return!1;l=l.sibling}return!0}var uc,cc,ah,lh;if(He)uc=function(l,u){for(var m=u.child;m!==null;){if(m.tag===5||m.tag===6)k(l,m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===u)break;for(;m.sibling===null;){if(m.return===null||m.return===u)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},cc=function(){},ah=function(l,u,m,S,b){if(l=l.memoizedProps,l!==S){var A=u.stateNode,V=Zi(oi.current);m=N(A,m,l,S,b,V),(u.updateQueue=m)&&Ki(u)}},lh=function(l,u,m,S){m!==S&&Ki(u)};else if(ue){uc=function(l,u,m,S){for(var b=u.child;b!==null;){if(b.tag===5){var A=b.stateNode;m&&S&&(A=$t(A,b.type,b.memoizedProps,b)),k(l,A)}else if(b.tag===6)A=b.stateNode,m&&S&&(A=Zn(A,b.memoizedProps,b)),k(l,A);else if(b.tag!==4){if(b.tag===22&&b.memoizedState!==null)A=b.child,A!==null&&(A.return=b),uc(l,b,!0,!0);else if(b.child!==null){b.child.return=b,b=b.child;continue}}if(b===u)break;for(;b.sibling===null;){if(b.return===null||b.return===u)return;b=b.return}b.sibling.return=b.return,b=b.sibling}};var fM=function(l,u,m,S){for(var b=u.child;b!==null;){if(b.tag===5){var A=b.stateNode;m&&S&&(A=$t(A,b.type,b.memoizedProps,b)),bt(l,A)}else if(b.tag===6)A=b.stateNode,m&&S&&(A=Zn(A,b.memoizedProps,b)),bt(l,A);else if(b.tag!==4){if(b.tag===22&&b.memoizedState!==null)A=b.child,A!==null&&(A.return=b),fM(l,b,!0,!0);else if(b.child!==null){b.child.return=b,b=b.child;continue}}if(b===u)break;for(;b.sibling===null;){if(b.return===null||b.return===u)return;b=b.return}b.sibling.return=b.return,b=b.sibling}};cc=function(l,u){var m=u.stateNode;if(!cM(l,u)){l=m.containerInfo;var S=Ye(l);fM(S,u,!1,!1),m.pendingChildren=S,Ki(u),_t(l,S)}},ah=function(l,u,m,S,b){var A=l.stateNode,V=l.memoizedProps;if((l=cM(l,u))&&V===S)u.stateNode=A;else{var K=u.stateNode,ge=Zi(oi.current),Ie=null;V!==S&&(Ie=N(K,m,V,S,b,ge)),l&&Ie===null?u.stateNode=A:(A=Oe(A,Ie,m,V,S,u,l,K),W(A,m,S,b,ge)&&Ki(u),u.stateNode=A,l?Ki(u):uc(A,u,!1,!1))}},lh=function(l,u,m,S){m!==S?(l=Zi(Sl.current),m=Zi(oi.current),u.stateNode=X(S,l,m,u),Ki(u)):u.stateNode=l.stateNode}}else cc=function(){},ah=function(){},lh=function(){};function fc(l,u){if(!nn)switch(l.tailMode){case"hidden":u=l.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l.tail=null:m.sibling=null;break;case"collapsed":m=l.tail;for(var S=null;m!==null;)m.alternate!==null&&(S=m),m=m.sibling;S===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:S.sibling=null}}function Jn(l){var u=l.alternate!==null&&l.alternate.child===l.child,m=0,S=0;if(u)for(var b=l.child;b!==null;)m|=b.lanes|b.childLanes,S|=b.subtreeFlags&14680064,S|=b.flags&14680064,b.return=l,b=b.sibling;else for(b=l.child;b!==null;)m|=b.lanes|b.childLanes,S|=b.subtreeFlags,S|=b.flags,b.return=l,b=b.sibling;return l.subtreeFlags|=S,l.childLanes=m,u}function LD(l,u,m){var S=u.pendingProps;switch(U0(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jn(u),null;case 1:return xr(u.type)&&zd(),Jn(u),null;case 3:return S=u.stateNode,wl(),mt(On),mt(Bt),j0(),S.pendingContext&&(S.context=S.pendingContext,S.pendingContext=null),(l===null||l.child===null)&&(tc(u)?Ki(u):l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Ti!==null&&(Sv(Ti),Ti=null))),cc(l,u),Jn(u),null;case 5:W0(u),m=Zi(Sl.current);var b=u.type;if(l!==null&&u.stateNode!=null)ah(l,u,b,S,m),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!S){if(u.stateNode===null)throw Error(o(166));return Jn(u),null}if(l=Zi(oi.current),tc(u)){if(!ne)throw Error(o(175));l=nt(u.stateNode,u.type,u.memoizedProps,m,l,u,!ec),u.updateQueue=l,l!==null&&Ki(u)}else{var A=Z(b,S,m,l,u);uc(A,u,!1,!1),u.stateNode=A,W(A,b,S,m,l)&&Ki(u)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return Jn(u),null;case 6:if(l&&u.stateNode!=null)lh(l,u,l.memoizedProps,S);else{if(typeof S!="string"&&u.stateNode===null)throw Error(o(166));if(l=Zi(Sl.current),m=Zi(oi.current),tc(u)){if(!ne)throw Error(o(176));if(l=u.stateNode,S=u.memoizedProps,(m=lt(l,S,u,!ec))&&(b=Dr,b!==null))switch(A=(b.mode&1)!==0,b.tag){case 3:Js(b.stateNode.containerInfo,l,S,A);break;case 5:eo(b.type,b.memoizedProps,b.stateNode,l,S,A)}m&&Ki(u)}else u.stateNode=X(S,l,m,u)}return Jn(u),null;case 13:if(mt(an),S=u.memoizedState,nn&&Or!==null&&(u.mode&1)!==0&&(u.flags&128)===0){for(l=Or;l;)l=oe(l);return _l(),u.flags|=98560,u}if(S!==null&&S.dehydrated!==null){if(S=tc(u),l===null){if(!S)throw Error(o(318));if(!ne)throw Error(o(344));if(l=u.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(317));gt(l,u)}else _l(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;return Jn(u),null}return Ti!==null&&(Sv(Ti),Ti=null),(u.flags&128)!==0?(u.lanes=m,u):(S=S!==null,m=!1,l===null?tc(u):m=l.memoizedState!==null,S&&!m&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(an.current&1)!==0?An===0&&(An=3):Mv())),u.updateQueue!==null&&(u.flags|=4),Jn(u),null);case 4:return wl(),cc(l,u),l===null&&Ue(u.stateNode.containerInfo),Jn(u),null;case 10:return N0(u.type._context),Jn(u),null;case 17:return xr(u.type)&&zd(),Jn(u),null;case 19:if(mt(an),b=u.memoizedState,b===null)return Jn(u),null;if(S=(u.flags&128)!==0,A=b.rendering,A===null)if(S)fc(b,!1);else{if(An!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(A=Jd(l),A!==null){for(u.flags|=128,fc(b,!1),l=A.updateQueue,l!==null&&(u.updateQueue=l,u.flags|=4),u.subtreeFlags=0,l=m,S=u.child;S!==null;)m=S,b=l,m.flags&=14680066,A=m.alternate,A===null?(m.childLanes=0,m.lanes=b,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=A.childLanes,m.lanes=A.lanes,m.child=A.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=A.memoizedProps,m.memoizedState=A.memoizedState,m.updateQueue=A.updateQueue,m.type=A.type,b=A.dependencies,m.dependencies=b===null?null:{lanes:b.lanes,firstContext:b.firstContext}),S=S.sibling;return Rt(an,an.current&1|2),u.child}l=l.sibling}b.tail!==null&&kn()>vv&&(u.flags|=128,S=!0,fc(b,!1),u.lanes=4194304)}else{if(!S)if(l=Jd(A),l!==null){if(u.flags|=128,S=!0,l=l.updateQueue,l!==null&&(u.updateQueue=l,u.flags|=4),fc(b,!0),b.tail===null&&b.tailMode==="hidden"&&!A.alternate&&!nn)return Jn(u),null}else 2*kn()-b.renderingStartTime>vv&&m!==1073741824&&(u.flags|=128,S=!0,fc(b,!1),u.lanes=4194304);b.isBackwards?(A.sibling=u.child,u.child=A):(l=b.last,l!==null?l.sibling=A:u.child=A,b.last=A)}return b.tail!==null?(u=b.tail,b.rendering=u,b.tail=u.sibling,b.renderingStartTime=kn(),u.sibling=null,l=an.current,Rt(an,S?l&1|2:l&1),u):(Jn(u),null);case 22:case 23:return wv(),S=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==S&&(u.flags|=8192),S&&(u.mode&1)!==0?(zr&1073741824)!==0&&(Jn(u),He&&u.subtreeFlags&6&&(u.flags|=8192)):Jn(u),null;case 24:return null;case 25:return null}throw Error(o(156,u.tag))}var ID=a.ReactCurrentOwner,kr=!1;function ur(l,u,m,S){u.child=l===null?Uw(u,null,m,S):xl(u,l.child,m,S)}function dM(l,u,m,S,b){m=m.render;var A=u.ref;return gl(u,b),S=Y0(l,u,m,S,A,b),m=q0(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~b,Cs(l,u,b)):(nn&&m&&F0(u),u.flags|=1,ur(l,u,S,b),u.child)}function hM(l,u,m,S,b){if(l===null){var A=m.type;return typeof A=="function"&&!bv(A)&&A.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=A,pM(l,u,A,S,b)):(l=Ph(m.type,null,S,u,u.mode,b),l.ref=u.ref,l.return=u,u.child=l)}if(A=l.child,(l.lanes&b)===0){var V=A.memoizedProps;if(m=m.compare,m=m!==null?m:Wd,m(V,S)&&l.ref===u.ref)return Cs(l,u,b)}return u.flags|=1,l=ao(A,S),l.ref=u.ref,l.return=u,u.child=l}function pM(l,u,m,S,b){if(l!==null&&Wd(l.memoizedProps,S)&&l.ref===u.ref)if(kr=!1,(l.lanes&b)!==0)(l.flags&131072)!==0&&(kr=!0);else return u.lanes=l.lanes,Cs(l,u,b);return tv(l,u,m,S,b)}function mM(l,u,m){var S=u.pendingProps,b=S.children,A=l!==null?l.memoizedState:null;if(S.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null},Rt(bl,zr),zr|=m;else if((m&1073741824)!==0)u.memoizedState={baseLanes:0,cachePool:null},S=A!==null?A.baseLanes:m,Rt(bl,zr),zr|=S;else return l=A!==null?A.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null},u.updateQueue=null,Rt(bl,zr),zr|=l,null;else A!==null?(S=A.baseLanes|m,u.memoizedState=null):S=m,Rt(bl,zr),zr|=S;return ur(l,u,b,m),u.child}function gM(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function tv(l,u,m,S,b){var A=xr(m)?xs:Bt.current;return A=Ss(u,A),gl(u,b),m=Y0(l,u,m,S,A,b),S=q0(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~b,Cs(l,u,b)):(nn&&S&&F0(u),u.flags|=1,ur(l,u,m,b),u.child)}function vM(l,u,m,S,b){if(xr(m)){var A=!0;Fd(u)}else A=!1;if(gl(u,b),u.stateNode===null)l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2),Lw(u,m,S),z0(u,m,S,b),S=!0;else if(l===null){var V=u.stateNode,K=u.memoizedProps;V.props=K;var ge=V.context,Ie=m.contextType;typeof Ie=="object"&&Ie!==null?Ie=ri(Ie):(Ie=xr(m)?xs:Bt.current,Ie=Ss(u,Ie));var je=m.getDerivedStateFromProps,ct=typeof je=="function"||typeof V.getSnapshotBeforeUpdate=="function";ct||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(K!==S||ge!==Ie)&&Iw(u,V,S,Ie),to=!1;var rt=u.memoizedState;V.state=rt,Yd(u,S,V,b),ge=u.memoizedState,K!==S||rt!==ge||On.current||to?(typeof je=="function"&&(k0(u,m,je,S),ge=u.memoizedState),(K=to||Rw(u,m,K,S,rt,ge,Ie))?(ct||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(u.flags|=4194308)):(typeof V.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=S,u.memoizedState=ge),V.props=S,V.state=ge,V.context=Ie,S=K):(typeof V.componentDidMount=="function"&&(u.flags|=4194308),S=!1)}else{V=u.stateNode,Tw(l,u),K=u.memoizedProps,Ie=u.type===u.elementType?K:Ei(u.type,K),V.props=Ie,ct=u.pendingProps,rt=V.context,ge=m.contextType,typeof ge=="object"&&ge!==null?ge=ri(ge):(ge=xr(m)?xs:Bt.current,ge=Ss(u,ge));var jt=m.getDerivedStateFromProps;(je=typeof jt=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(K!==ct||rt!==ge)&&Iw(u,V,S,ge),to=!1,rt=u.memoizedState,V.state=rt,Yd(u,S,V,b);var Ke=u.memoizedState;K!==ct||rt!==Ke||On.current||to?(typeof jt=="function"&&(k0(u,m,jt,S),Ke=u.memoizedState),(Ie=to||Rw(u,m,Ie,S,rt,Ke,ge)||!1)?(je||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(S,Ke,ge),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(S,Ke,ge)),typeof V.componentDidUpdate=="function"&&(u.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof V.componentDidUpdate!="function"||K===l.memoizedProps&&rt===l.memoizedState||(u.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||K===l.memoizedProps&&rt===l.memoizedState||(u.flags|=1024),u.memoizedProps=S,u.memoizedState=Ke),V.props=S,V.state=Ke,V.context=ge,S=Ie):(typeof V.componentDidUpdate!="function"||K===l.memoizedProps&&rt===l.memoizedState||(u.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||K===l.memoizedProps&&rt===l.memoizedState||(u.flags|=1024),S=!1)}return nv(l,u,m,S,A,b)}function nv(l,u,m,S,b,A){gM(l,u);var V=(u.flags&128)!==0;if(!S&&!V)return b&&Sw(u,m,!1),Cs(l,u,A);S=u.stateNode,ID.current=u;var K=V&&typeof m.getDerivedStateFromError!="function"?null:S.render();return u.flags|=1,l!==null&&V?(u.child=xl(u,l.child,null,A),u.child=xl(u,null,K,A)):ur(l,u,K,A),u.memoizedState=S.state,b&&Sw(u,m,!0),u.child}function yM(l){var u=l.stateNode;u.pendingContext?_w(l,u.pendingContext,u.pendingContext!==u.context):u.context&&_w(l,u.context,!1),H0(l,u.containerInfo)}function _M(l,u,m,S,b){return _l(),G0(b),u.flags|=256,ur(l,u,m,S),u.child}var uh={dehydrated:null,treeContext:null,retryLane:0};function ch(l){return{baseLanes:l,cachePool:null}}function xM(l,u,m){var S=u.pendingProps,b=an.current,A=!1,V=(u.flags&128)!==0,K;if((K=V)||(K=l!==null&&l.memoizedState===null?!1:(b&2)!==0),K?(A=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(b|=1),Rt(an,b&1),l===null)return V0(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:Qu(l)?u.lanes=8:u.lanes=1073741824,null):(b=S.children,l=S.fallback,A?(S=u.mode,A=u.child,b={mode:"hidden",children:b},(S&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=b):A=Rh(b,S,0,null),l=aa(l,S,m,null),A.return=u,l.return=u,A.sibling=l,u.child=A,u.child.memoizedState=ch(m),u.memoizedState=uh,l):rv(u,b));if(b=l.memoizedState,b!==null){if(K=b.dehydrated,K!==null){if(V)return u.flags&256?(u.flags&=-257,fh(l,u,m,Error(o(422)))):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(A=S.fallback,b=u.mode,S=Rh({mode:"visible",children:S.children},b,0,null),A=aa(A,b,m,null),A.flags|=2,S.return=u,A.return=u,S.sibling=A,u.child=S,(u.mode&1)!==0&&xl(u,l.child,null,m),u.child.memoizedState=ch(m),u.memoizedState=uh,A);if((u.mode&1)===0)u=fh(l,u,m,null);else if(Qu(K))u=fh(l,u,m,Error(o(419)));else if(S=(m&l.childLanes)!==0,kr||S){if(S=Sn,S!==null){switch(m&-m){case 4:A=2;break;case 16:A=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:A=32;break;case 536870912:A=268435456;break;default:A=0}S=(A&(S.suspendedLanes|m))!==0?0:A,S!==0&&S!==b.retryLane&&(b.retryLane=S,li(l,S,-1))}Mv(),u=fh(l,u,m,Error(o(421)))}else Wi(K)?(u.flags|=128,u.child=l.child,u=$D.bind(null,l),B(K,u),u=null):(m=b.treeContext,ne&&(Or=xe(K),Dr=u,nn=!0,Ti=null,ec=!1,m!==null&&(ii[si++]=bs,ii[si++]=Es,ii[si++]=Jo,bs=m.id,Es=m.overflow,Jo=u)),u=rv(u,u.pendingProps.children),u.flags|=4096);return u}return A?(S=wM(l,u,S.children,S.fallback,m),A=u.child,b=l.child.memoizedState,A.memoizedState=b===null?ch(m):{baseLanes:b.baseLanes|m,cachePool:null},A.childLanes=l.childLanes&~m,u.memoizedState=uh,S):(m=SM(l,u,S.children,m),u.memoizedState=null,m)}return A?(S=wM(l,u,S.children,S.fallback,m),A=u.child,b=l.child.memoizedState,A.memoizedState=b===null?ch(m):{baseLanes:b.baseLanes|m,cachePool:null},A.childLanes=l.childLanes&~m,u.memoizedState=uh,S):(m=SM(l,u,S.children,m),u.memoizedState=null,m)}function rv(l,u){return u=Rh({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function SM(l,u,m,S){var b=l.child;return l=b.sibling,m=ao(b,{mode:"visible",children:m}),(u.mode&1)===0&&(m.lanes=S),m.return=u,m.sibling=null,l!==null&&(S=u.deletions,S===null?(u.deletions=[l],u.flags|=16):S.push(l)),u.child=m}function wM(l,u,m,S,b){var A=u.mode;l=l.child;var V=l.sibling,K={mode:"hidden",children:m};return(A&1)===0&&u.child!==l?(m=u.child,m.childLanes=0,m.pendingProps=K,u.deletions=null):(m=ao(l,K),m.subtreeFlags=l.subtreeFlags&14680064),V!==null?S=ao(V,S):(S=aa(S,A,b,null),S.flags|=2),S.return=u,m.return=u,m.sibling=S,u.child=m,S}function fh(l,u,m,S){return S!==null&&G0(S),xl(u,l.child,null,m),l=rv(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function MM(l,u,m){l.lanes|=u;var S=l.alternate;S!==null&&(S.lanes|=u),D0(l.return,u,m)}function iv(l,u,m,S,b){var A=l.memoizedState;A===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:S,tail:m,tailMode:b}:(A.isBackwards=u,A.rendering=null,A.renderingStartTime=0,A.last=S,A.tail=m,A.tailMode=b)}function bM(l,u,m){var S=u.pendingProps,b=S.revealOrder,A=S.tail;if(ur(l,u,S.children,m),S=an.current,(S&2)!==0)S=S&1|2,u.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&MM(l,m,u);else if(l.tag===19)MM(l,m,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}S&=1}if(Rt(an,S),(u.mode&1)===0)u.memoizedState=null;else switch(b){case"forwards":for(m=u.child,b=null;m!==null;)l=m.alternate,l!==null&&Jd(l)===null&&(b=m),m=m.sibling;m=b,m===null?(b=u.child,u.child=null):(b=m.sibling,m.sibling=null),iv(u,!1,b,m,A);break;case"backwards":for(m=null,b=u.child,u.child=null;b!==null;){if(l=b.alternate,l!==null&&Jd(l)===null){u.child=b;break}l=b.sibling,b.sibling=m,m=b,b=l}iv(u,!0,m,null,A);break;case"together":iv(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Cs(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),El|=u.lanes,(m&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(o(153));if(u.child!==null){for(l=u.child,m=ao(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=ao(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function ND(l,u,m){switch(u.tag){case 3:yM(u),_l();break;case 5:Bw(u);break;case 1:xr(u.type)&&Fd(u);break;case 4:H0(u,u.stateNode.containerInfo);break;case 10:Ew(u,u.type._context,u.memoizedProps.value);break;case 13:var S=u.memoizedState;if(S!==null)return S.dehydrated!==null?(Rt(an,an.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?xM(l,u,m):(Rt(an,an.current&1),l=Cs(l,u,m),l!==null?l.sibling:null);Rt(an,an.current&1);break;case 19:if(S=(m&u.childLanes)!==0,(l.flags&128)!==0){if(S)return bM(l,u,m);u.flags|=128}var b=u.memoizedState;if(b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Rt(an,an.current),S)break;return null;case 22:case 23:return u.lanes=0,mM(l,u,m)}return Cs(l,u,m)}function DD(l,u){switch(U0(u),u.tag){case 1:return xr(u.type)&&zd(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return wl(),mt(On),mt(Bt),j0(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return W0(u),null;case 13:if(mt(an),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(o(340));_l()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return mt(an),null;case 4:return wl(),null;case 10:return N0(u.type._context),null;case 22:case 23:return wv(),null;case 24:return null;default:return null}}var dh=!1,na=!1,OD=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function hh(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(S){Mr(l,u,S)}else m.current=null}function sv(l,u,m){try{m()}catch(S){Mr(l,u,S)}}var EM=!1;function kD(l,u){for(F(l.containerInfo),Fe=u;Fe!==null;)if(l=Fe,u=l.child,(l.subtreeFlags&1028)!==0&&u!==null)u.return=l,Fe=u;else for(;Fe!==null;){l=Fe;try{var m=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var S=m.memoizedProps,b=m.memoizedState,A=l.stateNode,V=A.getSnapshotBeforeUpdate(l.elementType===l.type?S:Ei(l.type,S),b);A.__reactInternalSnapshotBeforeUpdate=V}break;case 3:He&&Ae(l.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(K){Mr(l,l.return,K)}if(u=l.sibling,u!==null){u.return=l.return,Fe=u;break}Fe=l.return}return m=EM,EM=!1,m}function ra(l,u,m){var S=u.updateQueue;if(S=S!==null?S.lastEffect:null,S!==null){var b=S=S.next;do{if((b.tag&l)===l){var A=b.destroy;b.destroy=void 0,A!==void 0&&sv(u,m,A)}b=b.next}while(b!==S)}}function dc(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&l)===l){var S=m.create;m.destroy=S()}m=m.next}while(m!==u)}}function ov(l){var u=l.ref;if(u!==null){var m=l.stateNode;switch(l.tag){case 5:l=le(m);break;default:l=m}typeof u=="function"?u(l):u.current=l}}function TM(l,u,m){if(ji&&typeof ji.onCommitFiberUnmount=="function")try{ji.onCommitFiberUnmount(Gd,u)}catch{}switch(u.tag){case 0:case 11:case 14:case 15:if(l=u.updateQueue,l!==null&&(l=l.lastEffect,l!==null)){var S=l=l.next;do{var b=S,A=b.destroy;b=b.tag,A!==void 0&&((b&2)!==0||(b&4)!==0)&&sv(u,m,A),S=S.next}while(S!==l)}break;case 1:if(hh(u,m),l=u.stateNode,typeof l.componentWillUnmount=="function")try{l.props=u.memoizedProps,l.state=u.memoizedState,l.componentWillUnmount()}catch(V){Mr(u,m,V)}break;case 5:hh(u,m);break;case 4:He?IM(l,u,m):ue&&ue&&(u=u.stateNode.containerInfo,m=Ye(u),Ft(u,m))}}function CM(l,u,m){for(var S=u;;)if(TM(l,S,m),S.child===null||He&&S.tag===4){if(S===u)break;for(;S.sibling===null;){if(S.return===null||S.return===u)return;S=S.return}S.sibling.return=S.return,S=S.sibling}else S.child.return=S,S=S.child}function AM(l){var u=l.alternate;u!==null&&(l.alternate=null,AM(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&qe(u)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function PM(l){return l.tag===5||l.tag===3||l.tag===4}function RM(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||PM(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function LM(l){if(He){e:{for(var u=l.return;u!==null;){if(PM(u))break e;u=u.return}throw Error(o(160))}var m=u;switch(m.tag){case 5:u=m.stateNode,m.flags&32&&(U(u),m.flags&=-33),m=RM(l),lv(l,m,u);break;case 3:case 4:u=m.stateNode.containerInfo,m=RM(l),av(l,m,u);break;default:throw Error(o(161))}}}function av(l,u,m){var S=l.tag;if(S===5||S===6)l=l.stateNode,u?it(m,l,u):Be(m,l);else if(S!==4&&(l=l.child,l!==null))for(av(l,u,m),l=l.sibling;l!==null;)av(l,u,m),l=l.sibling}function lv(l,u,m){var S=l.tag;if(S===5||S===6)l=l.stateNode,u?Ze(m,l,u):st(m,l);else if(S!==4&&(l=l.child,l!==null))for(lv(l,u,m),l=l.sibling;l!==null;)lv(l,u,m),l=l.sibling}function IM(l,u,m){for(var S=u,b=!1,A,V;;){if(!b){b=S.return;e:for(;;){if(b===null)throw Error(o(160));switch(A=b.stateNode,b.tag){case 5:V=!1;break e;case 3:A=A.containerInfo,V=!0;break e;case 4:A=A.containerInfo,V=!0;break e}b=b.return}b=!0}if(S.tag===5||S.tag===6)CM(l,S,m),V?j(A,S.stateNode):Q(A,S.stateNode);else if(S.tag===18)V?en(A,S.stateNode):Pt(A,S.stateNode);else if(S.tag===4){if(S.child!==null){A=S.stateNode.containerInfo,V=!0,S.child.return=S,S=S.child;continue}}else if(TM(l,S,m),S.child!==null){S.child.return=S,S=S.child;continue}if(S===u)break;for(;S.sibling===null;){if(S.return===null||S.return===u)return;S=S.return,S.tag===4&&(b=!1)}S.sibling.return=S.return,S=S.sibling}}function uv(l,u){if(He){switch(u.tag){case 0:case 11:case 14:case 15:ra(3,u,u.return),dc(3,u),ra(5,u,u.return);return;case 1:return;case 5:var m=u.stateNode;if(m!=null){var S=u.memoizedProps;l=l!==null?l.memoizedProps:S;var b=u.type,A=u.updateQueue;u.updateQueue=null,A!==null&&ot(m,A,b,l,S,u)}return;case 6:if(u.stateNode===null)throw Error(o(162));m=u.memoizedProps,Se(u.stateNode,l!==null?l.memoizedProps:m,m);return;case 3:ne&&l!==null&&l.memoizedState.isDehydrated&&Dt(u.stateNode.containerInfo);return;case 12:return;case 13:ph(u);return;case 19:ph(u);return;case 17:return}throw Error(o(163))}switch(u.tag){case 0:case 11:case 14:case 15:ra(3,u,u.return),dc(3,u),ra(5,u,u.return);return;case 12:return;case 13:ph(u);return;case 19:ph(u);return;case 3:ne&&l!==null&&l.memoizedState.isDehydrated&&Dt(u.stateNode.containerInfo);break;case 22:case 23:return}e:if(ue){switch(u.tag){case 1:case 5:case 6:break e;case 3:case 4:u=u.stateNode,Ft(u.containerInfo,u.pendingChildren);break e}throw Error(o(163))}}function ph(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new OD),u.forEach(function(S){var b=jD.bind(null,l,S);m.has(S)||(m.add(S),S.then(b,b))})}}function zD(l,u){for(Fe=u;Fe!==null;){u=Fe;var m=u.deletions;if(m!==null)for(var S=0;S<m.length;S++){var b=m[S];try{var A=l;He?IM(A,b,u):CM(A,b,u);var V=b.alternate;V!==null&&(V.return=null),b.return=null}catch(Qe){Mr(b,u,Qe)}}if(m=u.child,(u.subtreeFlags&12854)!==0&&m!==null)m.return=u,Fe=m;else for(;Fe!==null;){u=Fe;try{var K=u.flags;if(K&32&&He&&U(u.stateNode),K&512){var ge=u.alternate;if(ge!==null){var Ie=ge.ref;Ie!==null&&(typeof Ie=="function"?Ie(null):Ie.current=null)}}if(K&8192)switch(u.tag){case 13:if(u.memoizedState!==null){var je=u.alternate;(je===null||je.memoizedState===null)&&(gv=kn())}break;case 22:var ct=u.memoizedState!==null,rt=u.alternate,jt=rt!==null&&rt.memoizedState!==null;if(m=u,He){e:if(S=m,b=ct,A=null,He)for(var Ke=S;;){if(Ke.tag===5){if(A===null){A=Ke;var er=Ke.stateNode;b?de(er):ee(Ke.stateNode,Ke.memoizedProps)}}else if(Ke.tag===6){if(A===null){var ci=Ke.stateNode;b?ie(ci):ye(ci,Ke.memoizedProps)}}else if((Ke.tag!==22&&Ke.tag!==23||Ke.memoizedState===null||Ke===S)&&Ke.child!==null){Ke.child.return=Ke,Ke=Ke.child;continue}if(Ke===S)break;for(;Ke.sibling===null;){if(Ke.return===null||Ke.return===S)break e;A===Ke&&(A=null),Ke=Ke.return}A===Ke&&(A=null),Ke.sibling.return=Ke.return,Ke=Ke.sibling}}if(ct&&!jt&&(m.mode&1)!==0){Fe=m;for(var ae=m.child;ae!==null;){for(m=Fe=ae;Fe!==null;){S=Fe;var J=S.child;switch(S.tag){case 0:case 11:case 14:case 15:ra(4,S,S.return);break;case 1:hh(S,S.return);var he=S.stateNode;if(typeof he.componentWillUnmount=="function"){var Ve=S.return;try{he.props=S.memoizedProps,he.state=S.memoizedState,he.componentWillUnmount()}catch(Qe){Mr(S,Ve,Qe)}}break;case 5:hh(S,S.return);break;case 22:if(S.memoizedState!==null){OM(m);continue}}J!==null?(J.return=S,Fe=J):OM(m)}ae=ae.sibling}}}switch(K&4102){case 2:LM(u),u.flags&=-3;break;case 6:LM(u),u.flags&=-3,uv(u.alternate,u);break;case 4096:u.flags&=-4097;break;case 4100:u.flags&=-4097,uv(u.alternate,u);break;case 4:uv(u.alternate,u)}}catch(Qe){Mr(u,u.return,Qe)}if(m=u.sibling,m!==null){m.return=u.return,Fe=m;break}Fe=u.return}}}function FD(l,u,m){Fe=l,NM(l)}function NM(l,u,m){for(var S=(l.mode&1)!==0;Fe!==null;){var b=Fe,A=b.child;if(b.tag===22&&S){var V=b.memoizedState!==null||dh;if(!V){var K=b.alternate,ge=K!==null&&K.memoizedState!==null||na;K=dh;var Ie=na;if(dh=V,(na=ge)&&!Ie)for(Fe=b;Fe!==null;)V=Fe,ge=V.child,V.tag===22&&V.memoizedState!==null?kM(b):ge!==null?(ge.return=V,Fe=ge):kM(b);for(;A!==null;)Fe=A,NM(A),A=A.sibling;Fe=b,dh=K,na=Ie}DM(l)}else(b.subtreeFlags&8772)!==0&&A!==null?(A.return=b,Fe=A):DM(l)}}function DM(l){for(;Fe!==null;){var u=Fe;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:na||dc(5,u);break;case 1:var S=u.stateNode;if(u.flags&4&&!na)if(m===null)S.componentDidMount();else{var b=u.elementType===u.type?m.memoizedProps:Ei(u.type,m.memoizedProps);S.componentDidUpdate(b,m.memoizedState,S.__reactInternalSnapshotBeforeUpdate)}var A=u.updateQueue;A!==null&&Aw(u,A,S);break;case 3:var V=u.updateQueue;if(V!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=le(u.child.stateNode);break;case 1:m=u.child.stateNode}Aw(u,V,m)}break;case 5:var K=u.stateNode;m===null&&u.flags&4&&Je(K,u.type,u.memoizedProps,u);break;case 6:break;case 4:break;case 12:break;case 13:if(ne&&u.memoizedState===null){var ge=u.alternate;if(ge!==null){var Ie=ge.memoizedState;if(Ie!==null){var je=Ie.dehydrated;je!==null&&At(je)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}na||u.flags&512&&ov(u)}catch(ct){Mr(u,u.return,ct)}}if(u===l){Fe=null;break}if(m=u.sibling,m!==null){m.return=u.return,Fe=m;break}Fe=u.return}}function OM(l){for(;Fe!==null;){var u=Fe;if(u===l){Fe=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Fe=m;break}Fe=u.return}}function kM(l){for(;Fe!==null;){var u=Fe;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{dc(4,u)}catch(ge){Mr(u,m,ge)}break;case 1:var S=u.stateNode;if(typeof S.componentDidMount=="function"){var b=u.return;try{S.componentDidMount()}catch(ge){Mr(u,b,ge)}}var A=u.return;try{ov(u)}catch(ge){Mr(u,A,ge)}break;case 5:var V=u.return;try{ov(u)}catch(ge){Mr(u,V,ge)}}}catch(ge){Mr(u,u.return,ge)}if(u===l){Fe=null;break}var K=u.sibling;if(K!==null){K.return=u.return,Fe=K;break}Fe=u.return}}var mh=0,gh=1,vh=2,yh=3,_h=4;if(typeof Symbol=="function"&&Symbol.for){var hc=Symbol.for;mh=hc("selector.component"),gh=hc("selector.has_pseudo_class"),vh=hc("selector.role"),yh=hc("selector.test_id"),_h=hc("selector.text")}function cv(l){var u=Ee(l);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(o(364));return u}if(l=Nt(l),l===null)throw Error(o(362));return l.stateNode.current}function fv(l,u){switch(u.$$typeof){case mh:if(l.type===u.value)return!0;break;case gh:e:{u=u.value,l=[l,0];for(var m=0;m<l.length;){var S=l[m++],b=l[m++],A=u[b];if(S.tag!==5||!ce(S)){for(;A!=null&&fv(S,A);)b++,A=u[b];if(b===u.length){u=!0;break e}else for(S=S.child;S!==null;)l.push(S,b),S=S.sibling}}u=!1}return u;case vh:if(l.tag===5&&Pe(l.stateNode,u.value))return!0;break;case _h:if((l.tag===5||l.tag===6)&&(l=O(l),l!==null&&0<=l.indexOf(u.value)))return!0;break;case yh:if(l.tag===5&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function dv(l){switch(l.$$typeof){case mh:return"<"+(R(l.value)||"Unknown")+">";case gh:return":has("+(dv(l)||"")+")";case vh:return'[role="'+l.value+'"]';case _h:return'"'+l.value+'"';case yh:return'[data-testname="'+l.value+'"]';default:throw Error(o(365))}}function zM(l,u){var m=[];l=[l,0];for(var S=0;S<l.length;){var b=l[S++],A=l[S++],V=u[A];if(b.tag!==5||!ce(b)){for(;V!=null&&fv(b,V);)A++,V=u[A];if(A===u.length)m.push(b);else for(b=b.child;b!==null;)l.push(b,A),b=b.sibling}}return m}function hv(l,u){if(!Ct)throw Error(o(363));l=cv(l),l=zM(l,u),u=[],l=Array.from(l);for(var m=0;m<l.length;){var S=l[m++];if(S.tag===5)ce(S)||u.push(S.stateNode);else for(S=S.child;S!==null;)l.push(S),S=S.sibling}return u}var UD=Math.ceil,xh=a.ReactCurrentDispatcher,pv=a.ReactCurrentOwner,vn=a.ReactCurrentBatchConfig,xt=0,Sn=null,wn=null,Wn=0,zr=0,bl=ti(0),An=0,pc=null,El=0,Sh=0,mv=0,mc=null,Sr=null,gv=0,vv=1/0;function Tl(){vv=kn()+500}var wh=!1,yv=null,ro=null,Mh=!1,io=null,bh=0,gc=0,_v=null,Eh=-1,Th=0;function cr(){return(xt&6)!==0?kn():Eh!==-1?Eh:Eh=kn()}function so(l){return(l.mode&1)===0?1:(xt&2)!==0&&Wn!==0?Wn&-Wn:SD.transition!==null?(Th===0&&(l=Ud,Ud<<=1,(Ud&4194240)===0&&(Ud=64),Th=l),Th):(l=Ot,l!==0?l:Le())}function li(l,u,m){if(50<gc)throw gc=0,_v=null,Error(o(185));var S=Ch(l,u);return S===null?null:(Ju(S,u,m),((xt&2)===0||S!==Sn)&&(S===Sn&&((xt&2)===0&&(Sh|=u),An===4&&oo(S,Wn)),wr(S,m),u===1&&xt===0&&(l.mode&1)===0&&(Tl(),Hd&&Yi())),S)}function Ch(l,u){l.lanes|=u;var m=l.alternate;for(m!==null&&(m.lanes|=u),m=l,l=l.return;l!==null;)l.childLanes|=u,m=l.alternate,m!==null&&(m.childLanes|=u),m=l,l=l.return;return m.tag===3?m.stateNode:null}function wr(l,u){var m=l.callbackNode;dD(l,u);var S=Vd(l,l===Sn?Wn:0);if(S===0)m!==null&&Mw(m),l.callbackNode=null,l.callbackPriority=0;else if(u=S&-S,l.callbackPriority!==u){if(m!=null&&Mw(m),u===1)l.tag===0?xD(UM.bind(null,l)):bw(UM.bind(null,l)),et?tt(function(){xt===0&&Yi()}):C0(A0,Yi),m=null;else{switch(ww(S)){case 1:m=A0;break;case 4:m=gD;break;case 16:m=P0;break;case 536870912:m=vD;break;default:m=P0}m=YM(m,FM.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function FM(l,u){if(Eh=-1,Th=0,(xt&6)!==0)throw Error(o(327));var m=l.callbackNode;if(oa()&&l.callbackNode!==m)return null;var S=Vd(l,l===Sn?Wn:0);if(S===0)return null;if((S&30)!==0||(S&l.expiredLanes)!==0||u)u=Ah(l,S);else{u=S;var b=xt;xt|=2;var A=GM();(Sn!==l||Wn!==u)&&(Tl(),ia(l,u));do try{GD();break}catch(K){VM(l,K)}while(1);I0(),xh.current=A,xt=b,wn!==null?u=0:(Sn=null,Wn=0,u=An)}if(u!==0){if(u===2&&(b=b0(l),b!==0&&(S=b,u=xv(l,b))),u===1)throw m=pc,ia(l,0),oo(l,S),wr(l,kn()),m;if(u===6)oo(l,S);else{if(b=l.current.alternate,(S&30)===0&&!BD(b)&&(u=Ah(l,S),u===2&&(A=b0(l),A!==0&&(S=A,u=xv(l,A))),u===1))throw m=pc,ia(l,0),oo(l,S),wr(l,kn()),m;switch(l.finishedWork=b,l.finishedLanes=S,u){case 0:case 1:throw Error(o(345));case 2:sa(l,Sr);break;case 3:if(oo(l,S),(S&130023424)===S&&(u=gv+500-kn(),10<u)){if(Vd(l,0)!==0)break;if(b=l.suspendedLanes,(b&S)!==S){cr(),l.pingedLanes|=l.suspendedLanes&b;break}l.timeoutHandle=Te(sa.bind(null,l,Sr),u);break}sa(l,Sr);break;case 4:if(oo(l,S),(S&4194240)===S)break;for(u=l.eventTimes,b=-1;0<S;){var V=31-bi(S);A=1<<V,V=u[V],V>b&&(b=V),S&=~A}if(S=b,S=kn()-S,S=(120>S?120:480>S?480:1080>S?1080:1920>S?1920:3e3>S?3e3:4320>S?4320:1960*UD(S/1960))-S,10<S){l.timeoutHandle=Te(sa.bind(null,l,Sr),S);break}sa(l,Sr);break;case 5:sa(l,Sr);break;default:throw Error(o(329))}}}return wr(l,kn()),l.callbackNode===m?FM.bind(null,l):null}function xv(l,u){var m=mc;return l.current.memoizedState.isDehydrated&&(ia(l,u).flags|=256),l=Ah(l,u),l!==2&&(u=Sr,Sr=m,u!==null&&Sv(u)),l}function Sv(l){Sr===null?Sr=l:Sr.push.apply(Sr,l)}function BD(l){for(var u=l;;){if(u.flags&16384){var m=u.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var S=0;S<m.length;S++){var b=m[S],A=b.getSnapshot;b=b.value;try{if(!Xi(A(),b))return!1}catch{return!1}}}if(m=u.child,u.subtreeFlags&16384&&m!==null)m.return=u,u=m;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function oo(l,u){for(u&=~mv,u&=~Sh,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-bi(u),S=1<<m;l[m]=-1,u&=~S}}function UM(l){if((xt&6)!==0)throw Error(o(327));oa();var u=Vd(l,0);if((u&1)===0)return wr(l,kn()),null;var m=Ah(l,u);if(l.tag!==0&&m===2){var S=b0(l);S!==0&&(u=S,m=xv(l,S))}if(m===1)throw m=pc,ia(l,0),oo(l,u),wr(l,kn()),m;if(m===6)throw Error(o(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,sa(l,Sr),wr(l,kn()),null}function BM(l){io!==null&&io.tag===0&&(xt&6)===0&&oa();var u=xt;xt|=1;var m=vn.transition,S=Ot;try{if(vn.transition=null,Ot=1,l)return l()}finally{Ot=S,vn.transition=m,xt=u,(xt&6)===0&&Yi()}}function wv(){zr=bl.current,mt(bl)}function ia(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==we&&(l.timeoutHandle=we,Ce(m)),wn!==null)for(m=wn.return;m!==null;){var S=m;switch(U0(S),S.tag){case 1:S=S.type.childContextTypes,S!=null&&zd();break;case 3:wl(),mt(On),mt(Bt),j0();break;case 5:W0(S);break;case 4:wl();break;case 13:mt(an);break;case 19:mt(an);break;case 10:N0(S.type._context);break;case 22:case 23:wv()}m=m.return}if(Sn=l,wn=l=ao(l.current,null),Wn=zr=u,An=0,pc=null,mv=Sh=El=0,Sr=mc=null,qi!==null){for(u=0;u<qi.length;u++)if(m=qi[u],S=m.interleaved,S!==null){m.interleaved=null;var b=S.next,A=m.pending;if(A!==null){var V=A.next;A.next=b,S.next=V}m.pending=S}qi=null}return l}function VM(l,u){do{var m=wn;try{if(I0(),eh.current=oh,th){for(var S=hn.memoizedState;S!==null;){var b=S.queue;b!==null&&(b.pending=null),S=S.next}th=!1}if(Ml=0,zn=Qn=hn=null,sc=!1,oc=0,pv.current=null,m===null||m.return===null){An=1,pc=u,wn=null;break}e:{var A=l,V=m.return,K=m,ge=u;if(u=Wn,K.flags|=32768,ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Ie=ge,je=K,ct=je.tag;if((je.mode&1)===0&&(ct===0||ct===11||ct===15)){var rt=je.alternate;rt?(je.updateQueue=rt.updateQueue,je.memoizedState=rt.memoizedState,je.lanes=rt.lanes):(je.updateQueue=null,je.memoizedState=null)}var jt=lM(V);if(jt!==null){jt.flags&=-257,uM(jt,V,K,A,u),jt.mode&1&&aM(A,Ie,u),u=jt,ge=Ie;var Ke=u.updateQueue;if(Ke===null){var er=new Set;er.add(ge),u.updateQueue=er}else Ke.add(ge);break e}else{if((u&1)===0){aM(A,Ie,u),Mv();break e}ge=Error(o(426))}}else if(nn&&K.mode&1){var ci=lM(V);if(ci!==null){(ci.flags&65536)===0&&(ci.flags|=256),uM(ci,V,K,A,u),G0(ge);break e}}A=ge,An!==4&&(An=2),mc===null?mc=[A]:mc.push(A),ge=J0(ge,K),K=V;do{switch(K.tag){case 3:K.flags|=65536,u&=-u,K.lanes|=u;var ae=sM(K,ge,u);Cw(K,ae);break e;case 1:A=ge;var J=K.type,he=K.stateNode;if((K.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||he!==null&&typeof he.componentDidCatch=="function"&&(ro===null||!ro.has(he)))){K.flags|=65536,u&=-u,K.lanes|=u;var Ve=oM(K,A,u);Cw(K,Ve);break e}}K=K.return}while(K!==null)}WM(m)}catch(Qe){u=Qe,wn===m&&m!==null&&(wn=m=m.return);continue}break}while(1)}function GM(){var l=xh.current;return xh.current=oh,l===null?oh:l}function Mv(){(An===0||An===3||An===2)&&(An=4),Sn===null||(El&268435455)===0&&(Sh&268435455)===0||oo(Sn,Wn)}function Ah(l,u){var m=xt;xt|=2;var S=GM();Sn===l&&Wn===u||ia(l,u);do try{VD();break}catch(b){VM(l,b)}while(1);if(I0(),xt=m,xh.current=S,wn!==null)throw Error(o(261));return Sn=null,Wn=0,An}function VD(){for(;wn!==null;)HM(wn)}function GD(){for(;wn!==null&&!pD();)HM(wn)}function HM(l){var u=XM(l.alternate,l,zr);l.memoizedProps=l.pendingProps,u===null?WM(l):wn=u,pv.current=null}function WM(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=LD(m,u,zr),m!==null){wn=m;return}}else{if(m=DD(m,u),m!==null){m.flags&=32767,wn=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{An=6,wn=null;return}}if(u=u.sibling,u!==null){wn=u;return}wn=u=l}while(u!==null);An===0&&(An=5)}function sa(l,u){var m=Ot,S=vn.transition;try{vn.transition=null,Ot=1,HD(l,u,m)}finally{vn.transition=S,Ot=m}return null}function HD(l,u,m){do oa();while(io!==null);if((xt&6)!==0)throw Error(o(327));var S=l.finishedWork,b=l.finishedLanes;if(S===null)return null;if(l.finishedWork=null,l.finishedLanes=0,S===l.current)throw Error(o(177));l.callbackNode=null,l.callbackPriority=0;var A=S.lanes|S.childLanes;if(hD(l,A),l===Sn&&(wn=Sn=null,Wn=0),(S.subtreeFlags&2064)===0&&(S.flags&2064)===0||Mh||(Mh=!0,YM(P0,function(){return oa(),null})),A=(S.flags&15990)!==0,(S.subtreeFlags&15990)!==0||A){A=vn.transition,vn.transition=null;var V=Ot;Ot=1;var K=xt;xt|=4,pv.current=null,kD(l,S),zD(l,S),G(l.containerInfo),l.current=S,FD(S),mD(),xt=K,Ot=V,vn.transition=A}else l.current=S;if(Mh&&(Mh=!1,io=l,bh=b),A=l.pendingLanes,A===0&&(ro=null),yD(S.stateNode),wr(l,kn()),u!==null)for(m=l.onRecoverableError,S=0;S<u.length;S++)m(u[S]);if(wh)throw wh=!1,l=yv,yv=null,l;return(bh&1)!==0&&l.tag!==0&&oa(),A=l.pendingLanes,(A&1)!==0?l===_v?gc++:(gc=0,_v=l):gc=0,Yi(),null}function oa(){if(io!==null){var l=ww(bh),u=vn.transition,m=Ot;try{if(vn.transition=null,Ot=16>l?16:l,io===null)var S=!1;else{if(l=io,io=null,bh=0,(xt&6)!==0)throw Error(o(331));var b=xt;for(xt|=4,Fe=l.current;Fe!==null;){var A=Fe,V=A.child;if((Fe.flags&16)!==0){var K=A.deletions;if(K!==null){for(var ge=0;ge<K.length;ge++){var Ie=K[ge];for(Fe=Ie;Fe!==null;){var je=Fe;switch(je.tag){case 0:case 11:case 15:ra(8,je,A)}var ct=je.child;if(ct!==null)ct.return=je,Fe=ct;else for(;Fe!==null;){je=Fe;var rt=je.sibling,jt=je.return;if(AM(je),je===Ie){Fe=null;break}if(rt!==null){rt.return=jt,Fe=rt;break}Fe=jt}}}var Ke=A.alternate;if(Ke!==null){var er=Ke.child;if(er!==null){Ke.child=null;do{var ci=er.sibling;er.sibling=null,er=ci}while(er!==null)}}Fe=A}}if((A.subtreeFlags&2064)!==0&&V!==null)V.return=A,Fe=V;else e:for(;Fe!==null;){if(A=Fe,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:ra(9,A,A.return)}var ae=A.sibling;if(ae!==null){ae.return=A.return,Fe=ae;break e}Fe=A.return}}var J=l.current;for(Fe=J;Fe!==null;){V=Fe;var he=V.child;if((V.subtreeFlags&2064)!==0&&he!==null)he.return=V,Fe=he;else e:for(V=J;Fe!==null;){if(K=Fe,(K.flags&2048)!==0)try{switch(K.tag){case 0:case 11:case 15:dc(9,K)}}catch(Qe){Mr(K,K.return,Qe)}if(K===V){Fe=null;break e}var Ve=K.sibling;if(Ve!==null){Ve.return=K.return,Fe=Ve;break e}Fe=K.return}}if(xt=b,Yi(),ji&&typeof ji.onPostCommitFiberRoot=="function")try{ji.onPostCommitFiberRoot(Gd,l)}catch{}S=!0}return S}finally{Ot=m,vn.transition=u}}return!1}function $M(l,u,m){u=J0(m,u),u=sM(l,u,1),no(l,u),u=cr(),l=Ch(l,1),l!==null&&(Ju(l,1,u),wr(l,u))}function Mr(l,u,m){if(l.tag===3)$M(l,l,m);else for(;u!==null;){if(u.tag===3){$M(u,l,m);break}else if(u.tag===1){var S=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(ro===null||!ro.has(S))){l=J0(m,l),l=oM(u,l,1),no(u,l),l=cr(),u=Ch(u,1),u!==null&&(Ju(u,1,l),wr(u,l));break}}u=u.return}}function WD(l,u,m){var S=l.pingCache;S!==null&&S.delete(u),u=cr(),l.pingedLanes|=l.suspendedLanes&m,Sn===l&&(Wn&m)===m&&(An===4||An===3&&(Wn&130023424)===Wn&&500>kn()-gv?ia(l,0):mv|=m),wr(l,u)}function jM(l,u){u===0&&((l.mode&1)===0?u=1:(u=Bd,Bd<<=1,(Bd&130023424)===0&&(Bd=4194304)));var m=cr();l=Ch(l,u),l!==null&&(Ju(l,u,m),wr(l,m))}function $D(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),jM(l,m)}function jD(l,u){var m=0;switch(l.tag){case 13:var S=l.stateNode,b=l.memoizedState;b!==null&&(m=b.retryLane);break;case 19:S=l.stateNode;break;default:throw Error(o(314))}S!==null&&S.delete(u),jM(l,m)}var XM;XM=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||On.current)kr=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return kr=!1,ND(l,u,m);kr=(l.flags&131072)!==0}else kr=!1,nn&&(u.flags&1048576)!==0&&Nw(u,Qd,u.index);switch(u.lanes=0,u.tag){case 2:var S=u.type;l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2),l=u.pendingProps;var b=Ss(u,Bt.current);gl(u,m),b=Y0(null,u,S,l,b,m);var A=q0();return u.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,xr(S)?(A=!0,Fd(u)):A=!1,u.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,O0(u),b.updater=qd,u.stateNode=b,b._reactInternals=u,z0(u,S,l,m),u=nv(null,u,S,!0,A,m)):(u.tag=0,nn&&A&&F0(u),ur(null,u,b,m),u=u.child),u;case 16:S=u.elementType;e:{switch(l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2),l=u.pendingProps,b=S._init,S=b(S._payload),u.type=S,b=u.tag=YD(S),l=Ei(S,l),b){case 0:u=tv(null,u,S,l,m);break e;case 1:u=vM(null,u,S,l,m);break e;case 11:u=dM(null,u,S,l,m);break e;case 14:u=hM(null,u,S,Ei(S.type,l),m);break e}throw Error(o(306,S,""))}return u;case 0:return S=u.type,b=u.pendingProps,b=u.elementType===S?b:Ei(S,b),tv(l,u,S,b,m);case 1:return S=u.type,b=u.pendingProps,b=u.elementType===S?b:Ei(S,b),vM(l,u,S,b,m);case 3:e:{if(yM(u),l===null)throw Error(o(387));S=u.pendingProps,A=u.memoizedState,b=A.element,Tw(l,u),Yd(u,S,null,m);var V=u.memoizedState;if(S=V.element,ne&&A.isDehydrated)if(A={element:S,isDehydrated:!1,cache:V.cache,transitions:V.transitions},u.updateQueue.baseState=A,u.memoizedState=A,u.flags&256){b=Error(o(423)),u=_M(l,u,S,m,b);break e}else if(S!==b){b=Error(o(424)),u=_M(l,u,S,m,b);break e}else for(ne&&(Or=re(u.stateNode.containerInfo),Dr=u,nn=!0,Ti=null,ec=!1),m=Uw(u,null,S,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(_l(),S===b){u=Cs(l,u,m);break e}ur(l,u,S,m)}u=u.child}return u;case 5:return Bw(u),l===null&&V0(u),S=u.type,b=u.pendingProps,A=l!==null?l.memoizedProps:null,V=b.children,me(S,b)?V=null:A!==null&&me(S,A)&&(u.flags|=32),gM(l,u),ur(l,u,V,m),u.child;case 6:return l===null&&V0(u),null;case 13:return xM(l,u,m);case 4:return H0(u,u.stateNode.containerInfo),S=u.pendingProps,l===null?u.child=xl(u,null,S,m):ur(l,u,S,m),u.child;case 11:return S=u.type,b=u.pendingProps,b=u.elementType===S?b:Ei(S,b),dM(l,u,S,b,m);case 7:return ur(l,u,u.pendingProps,m),u.child;case 8:return ur(l,u,u.pendingProps.children,m),u.child;case 12:return ur(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(S=u.type._context,b=u.pendingProps,A=u.memoizedProps,V=b.value,Ew(u,S,V),A!==null)if(Xi(A.value,V)){if(A.children===b.children&&!On.current){u=Cs(l,u,m);break e}}else for(A=u.child,A!==null&&(A.return=u);A!==null;){var K=A.dependencies;if(K!==null){V=A.child;for(var ge=K.firstContext;ge!==null;){if(ge.context===S){if(A.tag===1){ge=Ms(-1,m&-m),ge.tag=2;var Ie=A.updateQueue;if(Ie!==null){Ie=Ie.shared;var je=Ie.pending;je===null?ge.next=ge:(ge.next=je.next,je.next=ge),Ie.pending=ge}}A.lanes|=m,ge=A.alternate,ge!==null&&(ge.lanes|=m),D0(A.return,m,u),K.lanes|=m;break}ge=ge.next}}else if(A.tag===10)V=A.type===u.type?null:A.child;else if(A.tag===18){if(V=A.return,V===null)throw Error(o(341));V.lanes|=m,K=V.alternate,K!==null&&(K.lanes|=m),D0(V,m,u),V=A.sibling}else V=A.child;if(V!==null)V.return=A;else for(V=A;V!==null;){if(V===u){V=null;break}if(A=V.sibling,A!==null){A.return=V.return,V=A;break}V=V.return}A=V}ur(l,u,b.children,m),u=u.child}return u;case 9:return b=u.type,S=u.pendingProps.children,gl(u,m),b=ri(b),S=S(b),u.flags|=1,ur(l,u,S,m),u.child;case 14:return S=u.type,b=Ei(S,u.pendingProps),b=Ei(S.type,b),hM(l,u,S,b,m);case 15:return pM(l,u,u.type,u.pendingProps,m);case 17:return S=u.type,b=u.pendingProps,b=u.elementType===S?b:Ei(S,b),l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2),u.tag=1,xr(S)?(l=!0,Fd(u)):l=!1,gl(u,m),Lw(u,S,b),z0(u,S,b,m),nv(null,u,S,!0,l,m);case 19:return bM(l,u,m);case 22:return mM(l,u,m)}throw Error(o(156,u.tag))};function YM(l,u){return C0(l,u)}function XD(l,u,m,S){this.tag=l,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ui(l,u,m,S){return new XD(l,u,m,S)}function bv(l){return l=l.prototype,!(!l||!l.isReactComponent)}function YD(l){if(typeof l=="function")return bv(l)?1:0;if(l!=null){if(l=l.$$typeof,l===y)return 11;if(l===_)return 14}return 2}function ao(l,u){var m=l.alternate;return m===null?(m=ui(l.tag,u,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=u,m.type=l.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=l.flags&14680064,m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,u=l.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function Ph(l,u,m,S,b,A){var V=2;if(S=l,typeof l=="function")bv(l)&&(V=1);else if(typeof l=="string")V=5;else e:switch(l){case d:return aa(m.children,b,A,u);case h:V=8,b|=8;break;case p:return l=ui(12,m,u,b|2),l.elementType=p,l.lanes=A,l;case x:return l=ui(13,m,u,b),l.elementType=x,l.lanes=A,l;case w:return l=ui(19,m,u,b),l.elementType=w,l.lanes=A,l;case E:return Rh(m,b,A,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case g:V=10;break e;case v:V=9;break e;case y:V=11;break e;case _:V=14;break e;case M:V=16,S=null;break e}throw Error(o(130,l==null?l:typeof l,""))}return u=ui(V,m,u,b),u.elementType=l,u.type=S,u.lanes=A,u}function aa(l,u,m,S){return l=ui(7,l,S,u),l.lanes=m,l}function Rh(l,u,m,S){return l=ui(22,l,S,u),l.elementType=E,l.lanes=m,l.stateNode={},l}function Ev(l,u,m){return l=ui(6,l,null,u),l.lanes=m,l}function Tv(l,u,m){return u=ui(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function qD(l,u,m,S,b){this.tag=u,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=we,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=E0(0),this.expirationTimes=E0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=E0(0),this.identifierPrefix=S,this.onRecoverableError=b,ne&&(this.mutableSourceEagerHydrationData=null)}function qM(l,u,m,S,b,A,V,K,ge){return l=new qD(l,u,m,K,ge),u===1?(u=1,A===!0&&(u|=8)):u=0,A=ui(3,null,null,u),l.current=A,A.stateNode=l,A.memoizedState={element:S,isDehydrated:m,cache:null,transitions:null},O0(A),l}function ZM(l){if(!l)return ni;l=l._reactInternals;e:{if(L(l)!==l||l.tag!==1)throw Error(o(170));var u=l;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(xr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(o(171))}if(l.tag===1){var m=l.type;if(xr(m))return xw(l,m,u)}return u}function QM(l){var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(o(188)):(l=Object.keys(l).join(","),Error(o(268,l)));return l=fe(u),l===null?null:l.stateNode}function KM(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function Cv(l,u){KM(l,u),(l=l.alternate)&&KM(l,u)}function ZD(l){return l=fe(l),l===null?null:l.stateNode}function QD(){return null}return t.attemptContinuousHydration=function(l){if(l.tag===13){var u=cr();li(l,134217728,u),Cv(l,134217728)}},t.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var u=cr(),m=so(l);li(l,m,u),Cv(l,m)}},t.attemptSynchronousHydration=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=Ku(u.pendingLanes);m!==0&&(T0(u,m|1),wr(u,kn()),(xt&6)===0&&(Tl(),Yi()))}break;case 13:var S=cr();BM(function(){return li(l,1,S)}),Cv(l,1)}},t.batchedUpdates=function(l,u){var m=xt;xt|=1;try{return l(u)}finally{xt=m,xt===0&&(Tl(),Hd&&Yi())}},t.createComponentSelector=function(l){return{$$typeof:mh,value:l}},t.createContainer=function(l,u,m,S,b,A,V){return qM(l,u,!1,null,m,S,b,A,V)},t.createHasPseudoClassSelector=function(l){return{$$typeof:gh,value:l}},t.createHydrationContainer=function(l,u,m,S,b,A,V,K,ge){return l=qM(m,S,!0,l,b,A,V,K,ge),l.context=ZM(null),m=l.current,S=cr(),b=so(m),A=Ms(S,b),A.callback=u!=null?u:null,no(m,A),l.current.lanes=b,Ju(l,b,S),wr(l,S),l},t.createPortal=function(l,u,m){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:S==null?null:""+S,children:l,containerInfo:u,implementation:m}},t.createRoleSelector=function(l){return{$$typeof:vh,value:l}},t.createTestNameSelector=function(l){return{$$typeof:yh,value:l}},t.createTextSelector=function(l){return{$$typeof:_h,value:l}},t.deferredUpdates=function(l){var u=Ot,m=vn.transition;try{return vn.transition=null,Ot=16,l()}finally{Ot=u,vn.transition=m}},t.discreteUpdates=function(l,u,m,S,b){var A=Ot,V=vn.transition;try{return vn.transition=null,Ot=1,l(u,m,S,b)}finally{Ot=A,vn.transition=V,xt===0&&Tl()}},t.findAllNodes=hv,t.findBoundingRects=function(l,u){if(!Ct)throw Error(o(363));u=hv(l,u),l=[];for(var m=0;m<u.length;m++)l.push(H(u[m]));for(u=l.length-1;0<u;u--){m=l[u];for(var S=m.x,b=S+m.width,A=m.y,V=A+m.height,K=u-1;0<=K;K--)if(u!==K){var ge=l[K],Ie=ge.x,je=Ie+ge.width,ct=ge.y,rt=ct+ge.height;if(S>=Ie&&A>=ct&&b<=je&&V<=rt){l.splice(u,1);break}else if(S!==Ie||m.width!==ge.width||rt<A||ct>V){if(!(A!==ct||m.height!==ge.height||je<S||Ie>b)){Ie>S&&(ge.width+=Ie-S,ge.x=S),je<b&&(ge.width=b-Ie),l.splice(u,1);break}}else{ct>A&&(ge.height+=ct-A,ge.y=A),rt<V&&(ge.height=V-ct),l.splice(u,1);break}}}return l},t.findHostInstance=QM,t.findHostInstanceWithNoPortals=function(l){return l=Y(l),l=l!==null?$(l):null,l===null?null:l.stateNode},t.findHostInstanceWithWarning=function(l){return QM(l)},t.flushControlled=function(l){var u=xt;xt|=1;var m=vn.transition,S=Ot;try{vn.transition=null,Ot=1,l()}finally{Ot=S,vn.transition=m,xt=u,xt===0&&(Tl(),Yi())}},t.flushPassiveEffects=oa,t.flushSync=BM,t.focusWithin=function(l,u){if(!Ct)throw Error(o(363));for(l=cv(l),u=zM(l,u),u=Array.from(u),l=0;l<u.length;){var m=u[l++];if(!ce(m)){if(m.tag===5&&Ne(m.stateNode))return!0;for(m=m.child;m!==null;)u.push(m),m=m.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Ot},t.getFindAllNodesFailureDescription=function(l,u){if(!Ct)throw Error(o(363));var m=0,S=[];l=[cv(l),0];for(var b=0;b<l.length;){var A=l[b++],V=l[b++],K=u[V];if((A.tag!==5||!ce(A))&&(fv(A,K)&&(S.push(dv(K)),V++,V>m&&(m=V)),V<u.length))for(A=A.child;A!==null;)l.push(A,V),A=A.sibling}if(m<u.length){for(l=[];m<u.length;m++)l.push(dv(u[m]));return`findAllNodes was able to match part of the selector:
`+(S.join(" > ")+`
No matching component was found for:
`)+l.join(" > ")}return null},t.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return le(l.child.stateNode);default:return l.child.stateNode}},t.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:ZD,findFiberByHostInstance:l.findFiberByHostInstance||QD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")l=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)l=!0;else{try{Gd=u.inject(l),ji=u}catch{}l=!!u.checkDCE}}return l},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(l,u,m,S){if(!Ct)throw Error(o(363));l=hv(l,u);var b=ze(l,m,S).disconnect;return{disconnect:function(){b()}}},t.registerMutableSourceForHydration=function(l,u){var m=u._getVersion;m=m(u._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[u,m]:l.mutableSourceEagerHydrationData.push(u,m)},t.runWithPriority=function(l,u){var m=Ot;try{return Ot=l,u()}finally{Ot=m}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(l,u,m,S){var b=u.current,A=cr(),V=so(b);return m=ZM(m),u.context===null?u.context=m:u.pendingContext=m,u=Ms(A,V),u.payload={element:l},S=S===void 0?null:S,S!==null&&(u.callback=S),no(b,u),l=li(b,V,A),l!==null&&Xd(l,b,V),V},t};lI.exports=F7;var U7=lI.exports,F2,U2;const cI=n=>n&&n.isOrthographicCamera,B7=n=>n&&n.hasOwnProperty("current"),Ad=typeof window!="undefined"&&((F2=window.document)!=null&&F2.createElement||((U2=window.navigator)==null?void 0:U2.product)==="ReactNative")?te.exports.useLayoutEffect:te.exports.useEffect;function fI(n){const e=te.exports.useRef(n);return Ad(()=>void(e.current=n),[n]),e}function V7({set:n}){return Ad(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class dI extends te.exports.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}dI.getDerivedStateFromError=()=>({error:!0});const hI="__default",G7=n=>n&&!!n.memoized&&!!n.changes;function pI(n){const e=typeof window!="undefined"?window.devicePixelRatio:1;return Array.isArray(n)?Math.min(Math.max(n[0],e),n[1]):n}const Uc=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},gn={obj:n=>n===Object(n)&&!gn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:i=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(gn.str(n)||gn.num(n))return n===e;const s=gn.obj(n);if(s&&r==="reference")return n===e;const o=gn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;for(a in i?e:n)if(n[a]!==e[a])return!1;if(gn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function H7(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function ql(n,e){const t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function Gx(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),i=r.pop();return t=r.reduce((s,o)=>s[o],n),{target:t,key:i}}else return{target:t,key:e}}const B2=/-\d+$/;function Gy(n,e,t){if(gn.str(t)){if(B2.test(t)){const s=t.replace(B2,""),{target:o,key:a}=Gx(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:r,key:i}=Gx(n,t);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=t(n,e)}function V2(n,e,t){var r,i;if(gn.str(t)){const{target:s,key:o}=Gx(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(i=e.__r3f)==null||delete i.previousAttach}function mI(n,{children:e,key:t,ref:r,...i},{children:s,key:o,ref:a,...c}={},f=!1){var d;const h=(d=n==null?void 0:n.__r3f)!=null?d:{},p=Object.entries(i),g=[];if(f){const y=Object.keys(c);for(let x=0;x<y.length;x++)i.hasOwnProperty(y[x])||p.unshift([y[x],hI+"remove"])}p.forEach(([y,x])=>{var w;if((w=n.__r3f)!=null&&w.primitive&&y==="object"||gn.equ(x,c[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return g.push([y,x,!0,[]]);let _=[];y.includes("-")&&(_=y.split("-")),g.push([y,x,!1,_]);for(const M in i){const E=i[M];M.startsWith(`${y}-`)&&g.push([M,E,!1,M.split("-")])}});const v={...i};return h.memoizedProps&&h.memoizedProps.args&&(v.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(v.attach=h.memoizedProps.attach),{memoized:v,changes:g}}function Hy(n,e){var t,r,i;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(r=o==null||o.getState==null?void 0:o.getState())!=null?r:{},{memoized:c,changes:f}=G7(e)?e:mI(n,e),d=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=c);for(let g=0;g<f.length;g++){let[v,y,x,w]=f[g],_=n,M=_[v];if(w.length&&(M=w.reduce((E,C)=>E[C],n),!(M&&M.set))){const[E,...C]=w.reverse();_=C.reverse().reduce((P,R)=>P[R],n),v=E}if(y===hI+"remove")if(M&&M.constructor){var h;y=new M.constructor(...(h=c.args)!=null?h:[])}else if(_.constructor){var p;const E=new _.constructor(...(p=_.__r3f.memoizedProps.args)!=null?p:[]);y=E[M],E.dispose&&E.dispose()}else y=0;if(x)y?s.handlers[v]=y:delete s.handlers[v],s.eventCount=Object.keys(s.handlers).length;else if(M&&M.set&&(M.copy||M instanceof Va)){if(Array.isArray(y))M.fromArray?M.fromArray(y):M.set(...y);else if(M.copy&&y&&y.constructor&&M.constructor.name===y.constructor.name)M.copy(y);else if(y!==void 0){const E=M instanceof Ge;!E&&M.setScalar?M.setScalar(y):M instanceof Va&&y instanceof Va?M.mask=y.mask:M.set(y),!("ColorManagement"in lg)&&!a.linear&&E&&M.convertSRGBToLinear()}}else _[v]=y,!a.linear&&_[v]instanceof Cn&&(_[v].encoding=Kt);Zl(n)}if(s.parent&&a.internal&&n.raycast&&d!==s.eventCount){const g=a.internal.interaction.indexOf(n);g>-1&&a.internal.interaction.splice(g,1),s.eventCount&&a.internal.interaction.push(n)}return f.length&&(i=n.__r3f)!=null&&i.parent&&Hx(n),n}function Zl(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function Hx(n){n.onUpdate==null||n.onUpdate(n)}function W7(n,e){n.manual||(cI(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function $7(n,e,t){const r=t.pop(),i=t.reduce((s,o)=>s[o],n);return i[r]=e}function zp(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function j7(){var n;const e=typeof self!="undefined"&&self||typeof window!="undefined"&&window;if(!e)return Ia.exports.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Ia.exports.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Ia.exports.ContinuousEventPriority;default:return Ia.exports.DefaultEventPriority}}function gI(n,e,t,r){const i=t.get(e);i&&(t.delete(e),t.size===0&&(n.delete(r),i.target.releasePointerCapture(r)))}function X7(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((r,i)=>{gI(t.capturedMap,e,r,i)})}function Y7(n){function e(c){const{internal:f}=n.getState(),d=c.offsetX-f.initialClick[0],h=c.offsetY-f.initialClick[1];return Math.round(Math.sqrt(d*d+h*h))}function t(c){return c.filter(f=>["Move","Over","Enter","Out","Leave"].some(d=>{var h;return(h=f.__r3f)==null?void 0:h.handlers["onPointer"+d]}))}function r(c,f){const d=n.getState(),h=new Set,p=[],g=f?f(d.internal.interaction):d.internal.interaction;for(let w=0;w<g.length;w++){const _=Uc(g[w]);_&&(_.raycaster.camera=void 0)}d.previousRoot||d.events.compute==null||d.events.compute(c,d);function v(w){const _=Uc(w);if(!_||!_.events.enabled||_.raycaster.camera===null)return[];if(_.raycaster.camera===void 0){var M;_.events.compute==null||_.events.compute(c,_,(M=_.previousRoot)==null?void 0:M.getState()),_.raycaster.camera===void 0&&(_.raycaster.camera=null)}return _.raycaster.camera?_.raycaster.intersectObject(w,!0):[]}let y=g.flatMap(v).sort((w,_)=>{const M=Uc(w.object),E=Uc(_.object);return!M||!E?w.distance-_.distance:E.events.priority-M.events.priority||w.distance-_.distance}).filter(w=>{const _=zp(w);return h.has(_)?!1:(h.add(_),!0)});d.events.filter&&(y=d.events.filter(y,d));for(const w of y){let _=w.object;for(;_;){var x;(x=_.__r3f)!=null&&x.eventCount&&p.push({...w,eventObject:_}),_=_.parent}}if("pointerId"in c&&d.internal.capturedMap.has(c.pointerId))for(let w of d.internal.capturedMap.get(c.pointerId).values())h.has(zp(w.intersection))||p.push(w.intersection);return p}function i(c,f,d,h){const p=n.getState();if(c.length){const g={stopped:!1};for(const v of c){const y=Uc(v.object)||p,{raycaster:x,pointer:w,camera:_,internal:M}=y,E=new I(w.x,w.y,0).unproject(_),C=D=>{var Y,fe;return(Y=(fe=M.capturedMap.get(D))==null?void 0:fe.has(v.eventObject))!=null?Y:!1},P=D=>{const Y={intersection:v,target:f.target};M.capturedMap.has(D)?M.capturedMap.get(D).set(v.eventObject,Y):M.capturedMap.set(D,new Map([[v.eventObject,Y]])),f.target.setPointerCapture(D)},R=D=>{const Y=M.capturedMap.get(D);Y&&gI(M.capturedMap,v.eventObject,Y,D)};let T={};for(let D in f){let Y=f[D];typeof Y!="function"&&(T[D]=Y)}let L={...v,...T,pointer:w,intersections:c,stopped:g.stopped,delta:d,unprojectedPoint:E,ray:x.ray,camera:_,stopPropagation(){const D="pointerId"in f&&M.capturedMap.get(f.pointerId);if((!D||D.has(v.eventObject))&&(L.stopped=g.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(Y=>Y.eventObject===v.eventObject))){const Y=c.slice(0,c.indexOf(v));s([...Y,v])}},target:{hasPointerCapture:C,setPointerCapture:P,releasePointerCapture:R},currentTarget:{hasPointerCapture:C,setPointerCapture:P,releasePointerCapture:R},nativeEvent:f};if(h(L),g.stopped===!0)break}}return c}function s(c){const{internal:f}=n.getState();for(const d of f.hovered.values())if(!c.length||!c.find(h=>h.object===d.object&&h.index===d.index&&h.instanceId===d.instanceId)){const p=d.eventObject.__r3f,g=p==null?void 0:p.handlers;if(f.hovered.delete(zp(d)),p!=null&&p.eventCount){const v={...d,intersections:c};g.onPointerOut==null||g.onPointerOut(v),g.onPointerLeave==null||g.onPointerLeave(v)}}}function o(c,f){for(let d=0;d<f.length;d++){const h=f[d].__r3f;h==null||h.handlers.onPointerMissed==null||h.handlers.onPointerMissed(c)}}function a(c){switch(c){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return f=>{const{internal:d}=n.getState();"pointerId"in f&&d.capturedMap.has(f.pointerId)&&(d.capturedMap.delete(f.pointerId),s([]))}}return function(d){const{onPointerMissed:h,internal:p}=n.getState();p.lastEvent.current=d;const g=c==="onPointerMove",v=c==="onClick"||c==="onContextMenu"||c==="onDoubleClick",x=r(d,g?t:void 0),w=v?e(d):0;c==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=x.map(M=>M.eventObject)),v&&!x.length&&w<=2&&(o(d,p.interaction),h&&h(d)),g&&s(x);function _(M){const E=M.eventObject,C=E.__r3f,P=C==null?void 0:C.handlers;if(!!(C!=null&&C.eventCount))if(g){if(P.onPointerOver||P.onPointerEnter||P.onPointerOut||P.onPointerLeave){const R=zp(M),T=p.hovered.get(R);T?T.stopped&&M.stopPropagation():(p.hovered.set(R,M),P.onPointerOver==null||P.onPointerOver(M),P.onPointerEnter==null||P.onPointerEnter(M))}P.onPointerMove==null||P.onPointerMove(M)}else{const R=P[c];R?(!v||p.initialHits.includes(E))&&(o(d,p.interaction.filter(T=>!p.initialHits.includes(T))),R(M)):v&&p.initialHits.includes(E)&&o(d,p.interaction.filter(T=>!p.initialHits.includes(T)))}}i(x,d,w,_)}}return{handlePointer:a}}let Wx={},q7=n=>void(Wx={...Wx,...n});function Z7(n,e){function t(d,{args:h=[],attach:p,...g},v){let y=`${d[0].toUpperCase()}${d.slice(1)}`,x;if(d==="primitive"){if(g.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const w=g.object;x=ql(w,{type:d,root:v,attach:p,primitive:!0})}else{const w=Wx[y];if(!w)throw new Error(`R3F: ${y} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");x=ql(new w(...h),{type:d,root:v,attach:p,memoizedProps:{args:h}})}return x.__r3f.attach===void 0&&(x instanceof ht?x.__r3f.attach="geometry":x instanceof qn&&(x.__r3f.attach="material")),y!=="inject"&&Hy(x,g),x}function r(d,h){let p=!1;if(h){var g,v;(g=h.__r3f)!=null&&g.attach?Gy(d,h,h.__r3f.attach):h.isObject3D&&d.isObject3D&&(d.add(h),p=!0),p||(v=d.__r3f)==null||v.objects.push(h),h.__r3f||ql(h,{}),h.__r3f.parent=d,Hx(h),Zl(h)}}function i(d,h,p){let g=!1;if(h){var v,y;if((v=h.__r3f)!=null&&v.attach)Gy(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){h.parent=d,h.dispatchEvent({type:"added"});const x=d.children.filter(_=>_!==h),w=x.indexOf(p);d.children=[...x.slice(0,w),h,...x.slice(w)],g=!0}g||(y=d.__r3f)==null||y.objects.push(h),h.__r3f||ql(h,{}),h.__r3f.parent=d,Hx(h),Zl(h)}}function s(d,h,p=!1){d&&[...d].forEach(g=>o(h,g,p))}function o(d,h,p){if(h){var g,v,y;if(h.__r3f&&(h.__r3f.parent=null),(g=d.__r3f)!=null&&g.objects&&(d.__r3f.objects=d.__r3f.objects.filter(E=>E!==h)),(v=h.__r3f)!=null&&v.attach)V2(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){var x;d.remove(h),(x=h.__r3f)!=null&&x.root&&X7(h.__r3f.root,h)}const _=(y=h.__r3f)==null?void 0:y.primitive,M=p===void 0?h.dispose!==null&&!_:p;if(!_){var w;s((w=h.__r3f)==null?void 0:w.objects,h,M),s(h.children,h,M)}h.__r3f&&(delete h.__r3f.root,delete h.__r3f.objects,delete h.__r3f.handlers,delete h.__r3f.memoizedProps,_||delete h.__r3f),M&&h.dispose&&h.type!=="Scene"&&ug.exports.unstable_scheduleCallback(ug.exports.unstable_IdlePriority,()=>{try{h.dispose()}catch{}}),Zl(d)}}function a(d,h,p,g){var v;const y=(v=d.__r3f)==null?void 0:v.parent;if(!y)return;const x=t(h,p,d.__r3f.root);if(d.children){for(const w of d.children)w.__r3f&&r(x,w);d.children=d.children.filter(w=>!w.__r3f)}d.__r3f.objects.forEach(w=>r(x,w)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||o(y,d),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),r(y,x),x.raycast&&x.__r3f.eventCount&&x.__r3f.root.getState().internal.interaction.push(x),[g,g.alternate].forEach(w=>{w!==null&&(w.stateNode=x,w.ref&&(typeof w.ref=="function"?w.ref(x):w.ref.current=x))})}const c=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:U7({createInstance:t,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,h)=>{if(!h)return;const p=d.getState().scene;!p.__r3f||(p.__r3f.root=d,r(p,h))},removeChildFromContainer:(d,h)=>{!h||o(d.getState().scene,h)},insertInContainerBefore:(d,h,p)=>{if(!h||!p)return;const g=d.getState().scene;!g.__r3f||i(g,h,p)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var h;const p=(h=d==null?void 0:d.__r3f)!=null?h:{};return Boolean(p.handlers)},prepareUpdate(d,h,p,g){if(d.__r3f.primitive&&g.object&&g.object!==d)return[!0];{const{args:v=[],children:y,...x}=g,{args:w=[],children:_,...M}=p;if(!Array.isArray(v))throw new Error("R3F: the args prop must be an array!");if(v.some((C,P)=>C!==w[P]))return[!0];const E=mI(d,x,M,!0);return E.changes.length?[!1,E]:null}},commitUpdate(d,[h,p],g,v,y,x){h?a(d,g,y,x):Hy(d,p)},commitMount(d,h,p,g){var v;const y=(v=d.__r3f)!=null?v:{};d.raycast&&y.handlers&&y.eventCount&&d.__r3f.root.getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>ql(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var h;const{attach:p,parent:g}=(h=d.__r3f)!=null?h:{};p&&g&&V2(g,d,p),d.isObject3D&&(d.visible=!1),Zl(d)},unhideInstance(d,h){var p;const{attach:g,parent:v}=(p=d.__r3f)!=null?p:{};g&&v&&Gy(v,d,g),(d.isObject3D&&h.visible==null||h.visible)&&(d.visible=!0),Zl(d)},createTextInstance:c,hideTextInstance:c,unhideTextInstance:c,getCurrentEventPriority:()=>e?e():Ia.exports.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance!="undefined"&&gn.fun(performance.now)?performance.now:gn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:gn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:gn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Hy}}const vI=n=>!!(n!=null&&n.render),yI=te.exports.createContext(null),Q7=(n,e)=>{const t=z7((a,c)=>{const f=new I,d=new I,h=new I;function p(w=c().camera,_=d,M=c().size){const{width:E,height:C,top:P,left:R}=M,T=E/C;_ instanceof I?h.copy(_):h.set(..._);const L=w.getWorldPosition(f).distanceTo(h);if(cI(w))return{width:E/w.zoom,height:C/w.zoom,top:P,left:R,factor:1,distance:L,aspect:T};{const D=w.fov*Math.PI/180,Y=2*Math.tan(D/2)*L,fe=Y*(E/C);return{width:fe,height:Y,top:P,left:R,factor:E/fe,distance:L,aspect:T}}}let g;const v=w=>a(_=>({performance:{..._.performance,current:w}})),y=new Me;return{set:a,get:c,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:(w=1)=>n(c(),w),advance:(w,_)=>e(w,_,c()),legacy:!1,linear:!1,flat:!1,scene:ql(new SS),controls:null,clock:new US,pointer:y,mouse:y,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const w=c();g&&clearTimeout(g),w.performance.current!==w.performance.min&&v(w.performance.min),g=setTimeout(()=>v(c().performance.max),w.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:w=>a(_=>({..._,events:{..._.events,...w}})),setSize:(w,_,M,E,C)=>{const P=c().camera,R={width:w,height:_,top:E||0,left:C||0,updateStyle:M};a(T=>({size:R,viewport:{...T.viewport,...p(P,d,R)}}))},setDpr:w=>a(_=>{const M=pI(w);return{viewport:{..._.viewport,dpr:M,initialDpr:_.viewport.initialDpr||M}}}),setFrameloop:(w="always")=>{const _=c().clock;_.stop(),_.elapsedTime=0,w!=="never"&&(_.start(),_.elapsedTime=0),a(()=>({frameloop:w}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:te.exports.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(w,_,M)=>{const E=c().internal;return E.priority=E.priority+(_>0?1:0),E.subscribers.push({ref:w,priority:_,store:M}),E.subscribers=E.subscribers.sort((C,P)=>C.priority-P.priority),()=>{const C=c().internal;C!=null&&C.subscribers&&(C.priority=C.priority-(_>0?1:0),C.subscribers=C.subscribers.filter(P=>P.ref!==w))}}}}}),r=t.getState();let i=r.size,s=r.viewport.dpr,o=r.camera;return t.subscribe(()=>{const{camera:a,size:c,viewport:f,gl:d,set:h}=t.getState();(c!==i||f.dpr!==s)&&(i=c,s=f.dpr,W7(a,c),d.setPixelRatio(f.dpr),d.setSize(c.width,c.height,c.updateStyle)),a!==o&&(o=a,h(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Fp,K7=new Set,J7=new Set,e$=new Set;function Wy(n,e){if(!!n.size)for(const{callback:t}of n.values())t(e)}function Bc(n,e){switch(n){case"before":return Wy(K7,e);case"after":return Wy(J7,e);case"tail":return Wy(e$,e)}}let $y,jy;function Xy(n,e,t){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(r=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),$y=e.internal.subscribers,Fp=0;Fp<$y.length;Fp++)jy=$y[Fp],jy.ref.current(jy.store.getState(),r,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}function t$(n){let e=!1,t,r,i;function s(c){r=requestAnimationFrame(s),e=!0,t=0,Bc("before",c);for(const d of n.values()){var f;i=d.store.getState(),i.internal.active&&(i.frameloop==="always"||i.internal.frames>0)&&!((f=i.gl.xr)!=null&&f.isPresenting)&&(t+=Xy(c,i))}if(Bc("after",c),t===0)return Bc("tail",c),e=!1,cancelAnimationFrame(r)}function o(c,f=1){var d;if(!c)return n.forEach(h=>o(h.store.getState()),f);(d=c.gl.xr)!=null&&d.isPresenting||!c.internal.active||c.frameloop==="never"||(c.internal.frames=Math.min(60,c.internal.frames+f),e||(e=!0,requestAnimationFrame(s)))}function a(c,f=!0,d,h){if(f&&Bc("before",c),d)Xy(c,d,h);else for(const p of n.values())Xy(c,p.store.getState());f&&Bc("after",c)}return{loop:s,invalidate:o,advance:a}}function _I(){const n=te.exports.useContext(yI);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function pi(n=t=>t,e){return _I()(n,e)}function n$(n,e=0){const t=_I(),r=t.getState().internal.subscribe,i=fI(n);return Ad(()=>r(i,e,t),[e,r,t]),null}const Nu=new Map,{invalidate:G2,advance:H2}=t$(Nu),{reconciler:cg,applyProps:Up}=Z7(Nu,j7),Vc={objects:"shallow",strict:!1},r$=(n,e)=>{const t=typeof n=="function"?n(e):n;return vI(t)?t:new xS({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function i$(n){return n instanceof HTMLCanvasElement}function s$(n,e){if(e)return e;if(i$(n)&&n.parentElement){const{width:t,height:r,top:i,left:s}=n.parentElement.getBoundingClientRect();return{width:t,height:r,top:i,left:s}}return{width:0,height:0,top:0,left:0}}function o$(n){const e=Nu.get(n),t=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=r||Q7(G2,H2),o=t||cg.createContainer(s,Ia.exports.ConcurrentRoot,null,!1,null,"",i,null);e||Nu.set(n,{fiber:o,store:s});let a,c=!1;return{configure(f={}){let{gl:d,size:h,events:p,onCreated:g,shadows:v=!1,linear:y=!1,flat:x=!1,legacy:w=!1,orthographic:_=!1,frameloop:M="always",dpr:E=[1,2],performance:C,raycaster:P,camera:R,onPointerMissed:T}=f,L=s.getState(),D=L.gl;L.gl||L.set({gl:D=r$(d,n)});let Y=L.raycaster;Y||L.set({raycaster:Y=new HS});const{params:fe,...q}=P||{};if(gn.equ(q,Y,Vc)||Up(Y,{...q}),gn.equ(fe,Y.params,Vc)||Up(Y,{params:{...Y.params,...fe}}),!L.camera){const z=R instanceof hd,F=z?R:_?new md(0,0,0,0,.1,1e3):new Gn(75,0,.1,1e3);z||(F.position.z=5,R&&Up(F,R),R!=null&&R.rotation||F.lookAt(0,0,0)),L.set({camera:F})}if(!L.xr){const z=(Z,k)=>{const W=s.getState();W.frameloop!=="never"&&H2(Z,!0,W,k)},F=()=>{const Z=s.getState();Z.gl.xr.enabled=Z.gl.xr.isPresenting,Z.gl.xr.setAnimationLoop(Z.gl.xr.isPresenting?z:null),Z.gl.xr.isPresenting||G2(Z)},G={connect(){const Z=s.getState().gl;Z.xr.addEventListener("sessionstart",F),Z.xr.addEventListener("sessionend",F)},disconnect(){const Z=s.getState().gl;Z.xr.removeEventListener("sessionstart",F),Z.xr.removeEventListener("sessionend",F)}};D.xr&&G.connect(),L.set({xr:G})}if(D.shadowMap){const z=D.shadowMap.enabled,F=D.shadowMap.type;if(D.shadowMap.enabled=!!v,gn.boo(v))D.shadowMap.type=cf;else if(gn.str(v)){var $;const G={basic:cR,percentage:Bg,soft:cf,variance:Ca};D.shadowMap.type=($=G[v])!=null?$:cf}else gn.obj(v)&&Object.assign(D.shadowMap,v);(z!==D.shadowMap.enabled||F!==D.shadowMap.type)&&(D.shadowMap.needsUpdate=!0)}"ColorManagement"in lg&&$7(lg,w,["ColorManagement","legacyMode"]);const se=y?Xs:Kt,le=x?Ui:lS;D.outputEncoding!==se&&(D.outputEncoding=se),D.toneMapping!==le&&(D.toneMapping=le),L.legacy!==w&&L.set(()=>({legacy:w})),L.linear!==y&&L.set(()=>({linear:y})),L.flat!==x&&L.set(()=>({flat:x})),d&&!gn.fun(d)&&!vI(d)&&!gn.equ(d,D,Vc)&&Up(D,d),p&&!L.events.handlers&&L.set({events:p(s)}),E&&L.viewport.dpr!==pI(E)&&L.setDpr(E);const pe=s$(n,h);return gn.equ(pe,L.size,Vc)||L.setSize(pe.width,pe.height,pe.updateStyle,pe.top,pe.left),L.frameloop!==M&&L.setFrameloop(M),L.onPointerMissed||L.set({onPointerMissed:T}),C&&!gn.equ(C,L.performance,Vc)&&L.set(z=>({performance:{...z.performance,...C}})),a=g,c=!0,this},render(f){return c||this.configure(),cg.updateContainer(te.exports.createElement(a$,{store:s,children:f,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){xI(n)}}}function a$({store:n,children:e,onCreated:t,rootElement:r}){return Ad(()=>{const i=n.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),n.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),te.exports.createElement(yI.Provider,{value:n},e)}function xI(n,e){const t=Nu.get(n),r=t==null?void 0:t.fiber;if(r){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),cg.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,o,a,c;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(c=i.gl)!=null&&c.xr&&i.xr.disconnect(),H7(i),Nu.delete(n),e&&e(n)}catch{}},500)})}}cg.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:te.exports.version});function $x(n,e,t){var r,i,s,o,a;e==null&&(e=100);function c(){var d=Date.now()-o;d<e&&d>=0?r=setTimeout(c,e-d):(r=null,t||(a=n.apply(s,i),s=i=null))}var f=function(){s=this,i=arguments,o=Date.now();var d=t&&!r;return r||(r=setTimeout(c,e)),d&&(a=n.apply(s,i),s=i=null),a};return f.clear=function(){r&&(clearTimeout(r),r=null)},f.flush=function(){r&&(a=n.apply(s,i),s=i=null,clearTimeout(r),r=null)},f}$x.debounce=$x;var W2=$x;function l$(n){let{debounce:e,scroll:t,polyfill:r,offsetSize:i}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=r||(typeof window=="undefined"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=te.exports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=te.exports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),f=e?typeof e=="number"?e:e.scroll:null,d=e?typeof e=="number"?e:e.resize:null,h=te.exports.useRef(!1);te.exports.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[p,g,v]=te.exports.useMemo(()=>{const _=()=>{if(!c.current.element)return;const{left:M,top:E,width:C,height:P,bottom:R,right:T,x:L,y:D}=c.current.element.getBoundingClientRect(),Y={left:M,top:E,width:C,height:P,bottom:R,right:T,x:L,y:D};c.current.element instanceof HTMLElement&&i&&(Y.height=c.current.element.offsetHeight,Y.width=c.current.element.offsetWidth),Object.freeze(Y),h.current&&!d$(c.current.lastBounds,Y)&&a(c.current.lastBounds=Y)};return[_,d?W2(_,d):_,f?W2(_,f):_]},[a,i,f,d]);function y(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",v,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function x(){!c.current.element||(c.current.resizeObserver=new s(v),c.current.resizeObserver.observe(c.current.element),t&&c.current.scrollContainers&&c.current.scrollContainers.forEach(_=>_.addEventListener("scroll",v,{capture:!0,passive:!0})))}const w=_=>{!_||_===c.current.element||(y(),c.current.element=_,c.current.scrollContainers=SI(_),x())};return c$(v,Boolean(t)),u$(g),te.exports.useEffect(()=>{y(),x()},[t,v,g]),te.exports.useEffect(()=>y,[]),[w,o,p]}function u$(n){te.exports.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function c$(n,e){te.exports.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function SI(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:r,overflowY:i}=window.getComputedStyle(n);return[t,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...SI(n.parentElement)]}const f$=["x","y","top","bottom","left","right","width","height"],d$=(n,e)=>f$.every(t=>n[t]===e[t]);var h$=Object.defineProperty,p$=Object.defineProperties,m$=Object.getOwnPropertyDescriptors,$2=Object.getOwnPropertySymbols,g$=Object.prototype.hasOwnProperty,v$=Object.prototype.propertyIsEnumerable,j2=(n,e,t)=>e in n?h$(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,X2=(n,e)=>{for(var t in e||(e={}))g$.call(e,t)&&j2(n,t,e[t]);if($2)for(var t of $2(e))v$.call(e,t)&&j2(n,t,e[t]);return n},y$=(n,e)=>p$(n,m$(e));function wI(n,e,t){if(!n)return;if(t(n)===!0)return n;let r=e?n.return:n.child;for(;r;){const i=wI(r,e,t);if(i)return i;r=e?null:r.sibling}}function MI(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const WS=MI(te.exports.createContext(null));class bI extends te.exports.Component{render(){return te.exports.createElement(WS.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:_$,ReactCurrentDispatcher:x$}=te.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S$(){const n=te.exports.useContext(WS);if(!n)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=te.exports.useId();return te.exports.useMemo(()=>{var r;return(r=_$.current)!=null?r:wI(n,!1,i=>{let s=i.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}})},[n,e])}function w$(){var n,e;const t=S$(),[r]=te.exports.useState(()=>new Map);r.clear();let i=t;for(;i;){const s=(n=i.type)==null?void 0:n._context;s&&s!==WS&&!r.has(s)&&r.set(s,(e=x$.current)==null?void 0:e.readContext(MI(s))),i=i.return}return te.exports.useMemo(()=>Array.from(r.keys()).reduce((s,o)=>a=>te.exports.createElement(s,null,te.exports.createElement(o.Provider,y$(X2({},a),{value:r.get(o)}))),s=>te.exports.createElement(bI,X2({},s))),[r])}const Yy={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function M$(n){const{handlePointer:e}=Y7(n);return{priority:1,enabled:!0,compute(t,r,i){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(Yy).reduce((t,r)=>({...t,[r]:e(r)}),{}),connect:t=>{var r;const{set:i,events:s}=n.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((r=s.handlers)!=null?r:[]).forEach(([o,a])=>{const[c,f]=Yy[o];t.addEventListener(c,a,{passive:f})})},disconnect:()=>{const{set:t,events:r}=n.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,o])=>{if(r&&r.connected instanceof HTMLElement){const[a]=Yy[s];r.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const b$=te.exports.forwardRef(function({children:e,fallback:t,resize:r,style:i,gl:s,events:o=M$,eventSource:a,eventPrefix:c,shadows:f,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:y,performance:x,raycaster:w,camera:_,onPointerMissed:M,onCreated:E,...C},P){te.exports.useMemo(()=>q7(lg),[]);const R=w$(),[T,L]=l$({scroll:!0,debounce:{scroll:50,resize:0},...r}),D=te.exports.useRef(null),Y=te.exports.useRef(null),[fe,q]=te.exports.useState(null);te.exports.useImperativeHandle(P,()=>D.current);const $=fI(M),[se,le]=te.exports.useState(!1),[pe,z]=te.exports.useState(!1);if(se)throw se;if(pe)throw pe;const F=te.exports.useRef(null);L.width>0&&L.height>0&&fe&&(F.current||(F.current=o$(fe)),F.current.configure({gl:s,events:o,shadows:f,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:y,performance:x,raycaster:w,camera:_,size:L,onPointerMissed:(...Z)=>$.current==null?void 0:$.current(...Z),onCreated:Z=>{Z.events.connect==null||Z.events.connect(a?B7(a)?a.current:a:Y.current),c&&Z.setEvents({compute:(k,W)=>{const N=k[c+"X"],me=k[c+"Y"];W.pointer.set(N/W.size.width*2-1,-(me/W.size.height)*2+1),W.raycaster.setFromCamera(W.pointer,W.camera)}}),E==null||E(Z)}}),F.current.render(te.exports.createElement(R,null,te.exports.createElement(dI,{set:z},te.exports.createElement(te.exports.Suspense,{fallback:te.exports.createElement(V7,{set:le})},e))))),Ad(()=>{q(D.current)},[]),te.exports.useEffect(()=>{if(fe)return()=>xI(fe)},[fe]);const G=a?"none":"auto";return te.exports.createElement("div",Ya({ref:Y,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:G,...i}},C),te.exports.createElement("div",{ref:T,style:{width:"100%",height:"100%"}},te.exports.createElement("canvas",{ref:D,style:{display:"block"}},t)))}),E$=te.exports.forwardRef(function(e,t){return te.exports.createElement(bI,null,te.exports.createElement(b$,Ya({},e,{ref:t})))});function T$(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}function td(n){return td=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},td(n)}function C$(n,e){if(td(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(td(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function A$(n){var e=C$(n,"string");return td(e)==="symbol"?e:String(e)}function ve(n,e,t){return e=A$(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}class P$ extends Mt{constructor(e,t){super(),ve(this,"isTransformControls",!0),ve(this,"visible",!1),ve(this,"domElement",void 0),ve(this,"raycaster",new HS),ve(this,"gizmo",void 0),ve(this,"plane",void 0),ve(this,"tempVector",new I),ve(this,"tempVector2",new I),ve(this,"tempQuaternion",new Gt),ve(this,"unit",{X:new I(1,0,0),Y:new I(0,1,0),Z:new I(0,0,1)}),ve(this,"pointStart",new I),ve(this,"pointEnd",new I),ve(this,"offset",new I),ve(this,"rotationAxis",new I),ve(this,"startNorm",new I),ve(this,"endNorm",new I),ve(this,"rotationAngle",0),ve(this,"cameraPosition",new I),ve(this,"cameraQuaternion",new Gt),ve(this,"cameraScale",new I),ve(this,"parentPosition",new I),ve(this,"parentQuaternion",new Gt),ve(this,"parentQuaternionInv",new Gt),ve(this,"parentScale",new I),ve(this,"worldPositionStart",new I),ve(this,"worldQuaternionStart",new Gt),ve(this,"worldScaleStart",new I),ve(this,"worldPosition",new I),ve(this,"worldQuaternion",new Gt),ve(this,"worldQuaternionInv",new Gt),ve(this,"worldScale",new I),ve(this,"eye",new I),ve(this,"positionStart",new I),ve(this,"quaternionStart",new Gt),ve(this,"scaleStart",new I),ve(this,"camera",void 0),ve(this,"object",void 0),ve(this,"enabled",!0),ve(this,"axis",null),ve(this,"mode","translate"),ve(this,"translationSnap",null),ve(this,"rotationSnap",null),ve(this,"scaleSnap",null),ve(this,"space","world"),ve(this,"size",1),ve(this,"dragging",!1),ve(this,"showX",!0),ve(this,"showY",!0),ve(this,"showZ",!0),ve(this,"changeEvent",{type:"change"}),ve(this,"mouseDownEvent",{type:"mouseDown",mode:this.mode}),ve(this,"mouseUpEvent",{type:"mouseUp",mode:this.mode}),ve(this,"objectChangeEvent",{type:"objectChange"}),ve(this,"intersectObjectWithRay",(i,s,o)=>{const a=s.intersectObject(i,!0);for(let c=0;c<a.length;c++)if(a[c].object.visible||o)return a[c];return!1}),ve(this,"attach",i=>(this.object=i,this.visible=!0,this)),ve(this,"detach",()=>(this.object=void 0,this.visible=!1,this.axis=null,this)),ve(this,"reset",()=>this.enabled?(this.dragging&&this.object!==void 0&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this):this),ve(this,"updateMatrixWorld",()=>{this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()}),ve(this,"pointerHover",i=>{if(this.object===void 0||this.dragging===!0)return;this.raycaster.setFromCamera(i,this.camera);const s=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);s?this.axis=s.object.name:this.axis=null}),ve(this,"pointerDown",i=>{if(!(this.object===void 0||this.dragging===!0||i.button!==0)&&this.axis!==null){this.raycaster.setFromCamera(i,this.camera);const s=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(s){let o=this.space;if(this.mode==="scale"?o="local":(this.axis==="E"||this.axis==="XYZE"||this.axis==="XYZ")&&(o="world"),o==="local"&&this.mode==="rotate"){const a=this.rotationSnap;this.axis==="X"&&a&&(this.object.rotation.x=Math.round(this.object.rotation.x/a)*a),this.axis==="Y"&&a&&(this.object.rotation.y=Math.round(this.object.rotation.y/a)*a),this.axis==="Z"&&a&&(this.object.rotation.z=Math.round(this.object.rotation.z/a)*a)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(s.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}}),ve(this,"pointerMove",i=>{const s=this.axis,o=this.mode,a=this.object;let c=this.space;if(o==="scale"?c="local":(s==="E"||s==="XYZE"||s==="XYZ")&&(c="world"),a===void 0||s===null||this.dragging===!1||i.button!==-1)return;this.raycaster.setFromCamera(i,this.camera);const f=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(!!f){if(this.pointEnd.copy(f.point).sub(this.worldPositionStart),o==="translate")this.offset.copy(this.pointEnd).sub(this.pointStart),c==="local"&&s!=="XYZ"&&this.offset.applyQuaternion(this.worldQuaternionInv),s.indexOf("X")===-1&&(this.offset.x=0),s.indexOf("Y")===-1&&(this.offset.y=0),s.indexOf("Z")===-1&&(this.offset.z=0),c==="local"&&s!=="XYZ"?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),a.position.copy(this.offset).add(this.positionStart),this.translationSnap&&(c==="local"&&(a.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),s.search("X")!==-1&&(a.position.x=Math.round(a.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(a.position.y=Math.round(a.position.y/this.translationSnap)*this.translationSnap),s.search("Z")!==-1&&(a.position.z=Math.round(a.position.z/this.translationSnap)*this.translationSnap),a.position.applyQuaternion(this.quaternionStart)),c==="world"&&(a.parent&&a.position.add(this.tempVector.setFromMatrixPosition(a.parent.matrixWorld)),s.search("X")!==-1&&(a.position.x=Math.round(a.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(a.position.y=Math.round(a.position.y/this.translationSnap)*this.translationSnap),s.search("Z")!==-1&&(a.position.z=Math.round(a.position.z/this.translationSnap)*this.translationSnap),a.parent&&a.position.sub(this.tempVector.setFromMatrixPosition(a.parent.matrixWorld))));else if(o==="scale"){if(s.search("XYZ")!==-1){let d=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(d*=-1),this.tempVector2.set(d,d,d)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),s.search("X")===-1&&(this.tempVector2.x=1),s.search("Y")===-1&&(this.tempVector2.y=1),s.search("Z")===-1&&(this.tempVector2.z=1);a.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(s.search("X")!==-1&&(this.object.scale.x=Math.round(a.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.search("Y")!==-1&&(a.scale.y=Math.round(a.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.search("Z")!==-1&&(a.scale.z=Math.round(a.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(o==="rotate"){this.offset.copy(this.pointEnd).sub(this.pointStart);const d=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));s==="E"?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this.endNorm.cross(this.startNorm).dot(this.eye)<0?1:-1):s==="XYZE"?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*d):(s==="X"||s==="Y"||s==="Z")&&(this.rotationAxis.copy(this.unit[s]),this.tempVector.copy(this.unit[s]),c==="local"&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*d),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),c==="local"&&s!=="E"&&s!=="XYZE"?(a.quaternion.copy(this.quaternionStart),a.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),a.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),a.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}}),ve(this,"pointerUp",i=>{i.button===0&&(this.dragging&&this.axis!==null&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)}),ve(this,"getPointer",i=>{var s;if(this.domElement&&(s=this.domElement.ownerDocument)!==null&&s!==void 0&&s.pointerLockElement)return{x:0,y:0,button:i.button};{var o;const a=i.changedTouches?i.changedTouches[0]:i,c=(o=this.domElement)===null||o===void 0?void 0:o.getBoundingClientRect();return{x:(a.clientX-c.left)/c.width*2-1,y:-(a.clientY-c.top)/c.height*2+1,button:i.button}}}),ve(this,"onPointerHover",i=>{if(!!this.enabled)switch(i.pointerType){case"mouse":case"pen":this.pointerHover(this.getPointer(i));break}}),ve(this,"onPointerDown",i=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction="none",this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.pointerHover(this.getPointer(i)),this.pointerDown(this.getPointer(i)))}),ve(this,"onPointerMove",i=>{!this.enabled||this.pointerMove(this.getPointer(i))}),ve(this,"onPointerUp",i=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction="",this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.pointerUp(this.getPointer(i)))}),ve(this,"getMode",()=>this.mode),ve(this,"setMode",i=>{this.mode=i}),ve(this,"setTranslationSnap",i=>{this.translationSnap=i}),ve(this,"setRotationSnap",i=>{this.rotationSnap=i}),ve(this,"setScaleSnap",i=>{this.scaleSnap=i}),ve(this,"setSize",i=>{this.size=i}),ve(this,"setSpace",i=>{this.space=i}),ve(this,"update",()=>{console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}),ve(this,"connect",i=>{i===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=i,this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointermove",this.onPointerHover),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp)}),ve(this,"dispose",()=>{var i,s,o,a,c,f;(i=this.domElement)===null||i===void 0||i.removeEventListener("pointerdown",this.onPointerDown),(s=this.domElement)===null||s===void 0||s.removeEventListener("pointermove",this.onPointerHover),(o=this.domElement)===null||o===void 0||(a=o.ownerDocument)===null||a===void 0||a.removeEventListener("pointermove",this.onPointerMove),(c=this.domElement)===null||c===void 0||(f=c.ownerDocument)===null||f===void 0||f.removeEventListener("pointerup",this.onPointerUp),this.traverse(d=>{const h=d;h.geometry&&h.geometry.dispose(),h.material&&h.material.dispose()})}),this.domElement=t,this.camera=e,this.gizmo=new R$,this.add(this.gizmo),this.plane=new L$,this.add(this.plane);const r=(i,s)=>{let o=s;Object.defineProperty(this,i,{get:function(){return o!==void 0?o:s},set:function(a){o!==a&&(o=a,this.plane[i]=a,this.gizmo[i]=a,this.dispatchEvent({type:i+"-changed",value:a}),this.dispatchEvent(this.changeEvent))}}),this[i]=s,this.plane[i]=s,this.gizmo[i]=s};r("camera",this.camera),r("object",this.object),r("enabled",this.enabled),r("axis",this.axis),r("mode",this.mode),r("translationSnap",this.translationSnap),r("rotationSnap",this.rotationSnap),r("scaleSnap",this.scaleSnap),r("space",this.space),r("size",this.size),r("dragging",this.dragging),r("showX",this.showX),r("showY",this.showY),r("showZ",this.showZ),r("worldPosition",this.worldPosition),r("worldPositionStart",this.worldPositionStart),r("worldQuaternion",this.worldQuaternion),r("worldQuaternionStart",this.worldQuaternionStart),r("cameraPosition",this.cameraPosition),r("cameraQuaternion",this.cameraQuaternion),r("pointStart",this.pointStart),r("pointEnd",this.pointEnd),r("rotationAxis",this.rotationAxis),r("rotationAngle",this.rotationAngle),r("eye",this.eye),t!==void 0&&this.connect(t)}}class R$ extends Mt{constructor(){super(),ve(this,"isTransformControlsGizmo",!0),ve(this,"type","TransformControlsGizmo"),ve(this,"tempVector",new I(0,0,0)),ve(this,"tempEuler",new ll),ve(this,"alignVector",new I(0,1,0)),ve(this,"zeroVector",new I(0,0,0)),ve(this,"lookAtMatrix",new dt),ve(this,"tempQuaternion",new Gt),ve(this,"tempQuaternion2",new Gt),ve(this,"identityQuaternion",new Gt),ve(this,"unitX",new I(1,0,0)),ve(this,"unitY",new I(0,1,0)),ve(this,"unitZ",new I(0,0,1)),ve(this,"gizmo",void 0),ve(this,"picker",void 0),ve(this,"helper",void 0),ve(this,"rotationAxis",new I),ve(this,"cameraPosition",new I),ve(this,"worldPositionStart",new I),ve(this,"worldQuaternionStart",new Gt),ve(this,"worldPosition",new I),ve(this,"worldQuaternion",new Gt),ve(this,"eye",new I),ve(this,"camera",null),ve(this,"enabled",!0),ve(this,"axis",null),ve(this,"mode","translate"),ve(this,"space","world"),ve(this,"size",1),ve(this,"dragging",!1),ve(this,"showX",!0),ve(this,"showY",!0),ve(this,"showZ",!0),ve(this,"updateMatrixWorld",()=>{let G=this.space;this.mode==="scale"&&(G="local");const Z=G==="local"?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let k=[];k=k.concat(this.picker[this.mode].children),k=k.concat(this.gizmo[this.mode].children),k=k.concat(this.helper[this.mode].children);for(let W=0;W<k.length;W++){const N=k[W];N.visible=!0,N.rotation.set(0,0,0),N.position.copy(this.worldPosition);let me;if(this.camera.isOrthographicCamera?me=(this.camera.top-this.camera.bottom)/this.camera.zoom:me=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),N.scale.set(1,1,1).multiplyScalar(me*this.size/7),N.tag==="helper"){N.visible=!1,N.name==="AXIS"?(N.position.copy(this.worldPositionStart),N.visible=!!this.axis,this.axis==="X"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,0)),N.quaternion.copy(Z).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(Z).dot(this.eye))>.9&&(N.visible=!1)),this.axis==="Y"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),N.quaternion.copy(Z).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(Z).dot(this.eye))>.9&&(N.visible=!1)),this.axis==="Z"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),N.quaternion.copy(Z).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(Z).dot(this.eye))>.9&&(N.visible=!1)),this.axis==="XYZE"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),N.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),N.quaternion.multiply(this.tempQuaternion),N.visible=this.dragging),this.axis==="E"&&(N.visible=!1)):N.name==="START"?(N.position.copy(this.worldPositionStart),N.visible=this.dragging):N.name==="END"?(N.position.copy(this.worldPosition),N.visible=this.dragging):N.name==="DELTA"?(N.position.copy(this.worldPositionStart),N.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),N.scale.copy(this.tempVector),N.visible=this.dragging):(N.quaternion.copy(Z),this.dragging?N.position.copy(this.worldPositionStart):N.position.copy(this.worldPosition),this.axis&&(N.visible=this.axis.search(N.name)!==-1));continue}N.quaternion.copy(Z),this.mode==="translate"||this.mode==="scale"?((N.name==="X"||N.name==="XYZX")&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(Z).dot(this.eye))>.99&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),(N.name==="Y"||N.name==="XYZY")&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(Z).dot(this.eye))>.99&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),(N.name==="Z"||N.name==="XYZZ")&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(Z).dot(this.eye))>.99&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),N.name==="XY"&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(Z).dot(this.eye))<.2&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),N.name==="YZ"&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(Z).dot(this.eye))<.2&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),N.name==="XZ"&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(Z).dot(this.eye))<.2&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),N.name.search("X")!==-1&&(this.alignVector.copy(this.unitX).applyQuaternion(Z).dot(this.eye)<0?N.tag==="fwd"?N.visible=!1:N.scale.x*=-1:N.tag==="bwd"&&(N.visible=!1)),N.name.search("Y")!==-1&&(this.alignVector.copy(this.unitY).applyQuaternion(Z).dot(this.eye)<0?N.tag==="fwd"?N.visible=!1:N.scale.y*=-1:N.tag==="bwd"&&(N.visible=!1)),N.name.search("Z")!==-1&&(this.alignVector.copy(this.unitZ).applyQuaternion(Z).dot(this.eye)<0?N.tag==="fwd"?N.visible=!1:N.scale.z*=-1:N.tag==="bwd"&&(N.visible=!1))):this.mode==="rotate"&&(this.tempQuaternion2.copy(Z),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(Z).invert()),N.name.search("E")!==-1&&N.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),N.name==="X"&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),N.quaternion.copy(this.tempQuaternion)),N.name==="Y"&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),N.quaternion.copy(this.tempQuaternion)),N.name==="Z"&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),N.quaternion.copy(this.tempQuaternion))),N.visible=N.visible&&(N.name.indexOf("X")===-1||this.showX),N.visible=N.visible&&(N.name.indexOf("Y")===-1||this.showY),N.visible=N.visible&&(N.name.indexOf("Z")===-1||this.showZ),N.visible=N.visible&&(N.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),N.material.tempOpacity=N.material.tempOpacity||N.material.opacity,N.material.tempColor=N.material.tempColor||N.material.color.clone(),N.material.color.copy(N.material.tempColor),N.material.opacity=N.material.tempOpacity,this.enabled?this.axis&&(N.name===this.axis?(N.material.opacity=1,N.material.color.lerp(new Ge(1,1,1),.5)):this.axis.split("").some(function(X){return N.name===X})?(N.material.opacity=1,N.material.color.lerp(new Ge(1,1,1),.5)):(N.material.opacity*=.25,N.material.color.lerp(new Ge(1,1,1),.5))):(N.material.opacity*=.5,N.material.color.lerp(new Ge(1,1,1),.5))}super.updateMatrixWorld()});const e=new hs({depthTest:!1,depthWrite:!1,transparent:!0,side:ki,fog:!1,toneMapped:!1}),t=new lr({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),r=e.clone();r.opacity=.15;const i=e.clone();i.opacity=.33;const s=e.clone();s.color.set(16711680);const o=e.clone();o.color.set(65280);const a=e.clone();a.color.set(255);const c=e.clone();c.opacity=.25;const f=c.clone();f.color.set(16776960);const d=c.clone();d.color.set(65535);const h=c.clone();h.color.set(16711935),e.clone().color.set(16776960);const g=t.clone();g.color.set(16711680);const v=t.clone();v.color.set(65280);const y=t.clone();y.color.set(255);const x=t.clone();x.color.set(65535);const w=t.clone();w.color.set(16711935);const _=t.clone();_.color.set(16776960);const M=t.clone();M.color.set(7895160);const E=_.clone();E.opacity=.25;const C=new Bn(0,.05,.2,12,1,!1),P=new hr(.125,.125,.125),R=new ht;R.setAttribute("position",new Xe([0,0,0,1,0,0],3));const T=(G,Z)=>{const k=new ht,W=[];for(let N=0;N<=64*Z;++N)W.push(0,Math.cos(N/32*Math.PI)*G,Math.sin(N/32*Math.PI)*G);return k.setAttribute("position",new Xe(W,3)),k},L=()=>{const G=new ht;return G.setAttribute("position",new Xe([0,0,0,1,1,1],3)),G},D={X:[[new We(C,s),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new We(C,s),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new St(R,g)]],Y:[[new We(C,o),[0,1,0],null,null,"fwd"],[new We(C,o),[0,1,0],[Math.PI,0,0],null,"bwd"],[new St(R,v),null,[0,0,Math.PI/2]]],Z:[[new We(C,a),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new We(C,a),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new St(R,y),null,[0,-Math.PI/2,0]]],XYZ:[[new We(new Vr(.1,0),c.clone()),[0,0,0],[0,0,0]]],XY:[[new We(new Gr(.295,.295),f.clone()),[.15,.15,0]],[new St(R,_),[.18,.3,0],null,[.125,1,1]],[new St(R,_),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new We(new Gr(.295,.295),d.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new St(R,x),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new St(R,x),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new We(new Gr(.295,.295),h.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new St(R,w),[.18,0,.3],null,[.125,1,1]],[new St(R,w),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},Y={X:[[new We(new Bn(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new We(new Bn(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new We(new Bn(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new We(new Vr(.2,0),r)]],XY:[[new We(new Gr(.4,.4),r),[.2,.2,0]]],YZ:[[new We(new Gr(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new We(new Gr(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},fe={START:[[new We(new Vr(.01,2),i),null,null,null,"helper"]],END:[[new We(new Vr(.01,2),i),null,null,null,"helper"]],DELTA:[[new St(L(),i),null,null,null,"helper"]],X:[[new St(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new St(R,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new St(R,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},q={X:[[new St(T(1,.5),g)],[new We(new Vr(.04,0),s),[0,0,.99],null,[1,3,1]]],Y:[[new St(T(1,.5),v),null,[0,0,-Math.PI/2]],[new We(new Vr(.04,0),o),[0,0,.99],null,[3,1,1]]],Z:[[new St(T(1,.5),y),null,[0,Math.PI/2,0]],[new We(new Vr(.04,0),a),[.99,0,0],null,[1,3,1]]],E:[[new St(T(1.25,1),E),null,[0,Math.PI/2,0]],[new We(new Bn(.03,0,.15,4,1,!1),E),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new We(new Bn(.03,0,.15,4,1,!1),E),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new We(new Bn(.03,0,.15,4,1,!1),E),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new We(new Bn(.03,0,.15,4,1,!1),E),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new St(T(1,1),M),null,[0,Math.PI/2,0]]]},$={AXIS:[[new St(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},se={X:[[new We(new Bs(1,.1,4,24),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new We(new Bs(1,.1,4,24),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new We(new Bs(1,.1,4,24),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new We(new Bs(1.25,.1,2,24),r)]],XYZE:[[new We(new ul(.7,10,8),r)]]},le={X:[[new We(P,s),[.8,0,0],[0,0,-Math.PI/2]],[new St(R,g),null,null,[.8,1,1]]],Y:[[new We(P,o),[0,.8,0]],[new St(R,v),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new We(P,a),[0,0,.8],[Math.PI/2,0,0]],[new St(R,y),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new We(P,f),[.85,.85,0],null,[2,2,.2]],[new St(R,_),[.855,.98,0],null,[.125,1,1]],[new St(R,_),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new We(P,d),[0,.85,.85],null,[.2,2,2]],[new St(R,x),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new St(R,x),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new We(P,h),[.85,0,.85],null,[2,.2,2]],[new St(R,w),[.855,0,.98],null,[.125,1,1]],[new St(R,w),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new We(new hr(.125,.125,.125),c.clone()),[1.1,0,0]]],XYZY:[[new We(new hr(.125,.125,.125),c.clone()),[0,1.1,0]]],XYZZ:[[new We(new hr(.125,.125,.125),c.clone()),[0,0,1.1]]]},pe={X:[[new We(new Bn(.2,0,.8,4,1,!1),r),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new We(new Bn(.2,0,.8,4,1,!1),r),[0,.5,0]]],Z:[[new We(new Bn(.2,0,.8,4,1,!1),r),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new We(P,r),[.85,.85,0],null,[3,3,.2]]],YZ:[[new We(P,r),[0,.85,.85],null,[.2,3,3]]],XZ:[[new We(P,r),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new We(new hr(.2,.2,.2),r),[1.1,0,0]]],XYZY:[[new We(new hr(.2,.2,.2),r),[0,1.1,0]]],XYZZ:[[new We(new hr(.2,.2,.2),r),[0,0,1.1]]]},z={X:[[new St(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new St(R,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new St(R,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},F=G=>{const Z=new Mt;for(let k in G)for(let W=G[k].length;W--;){const N=G[k][W][0].clone(),me=G[k][W][1],X=G[k][W][2],Te=G[k][W][3],Ce=G[k][W][4];N.name=k,N.tag=Ce,me&&N.position.set(me[0],me[1],me[2]),X&&N.rotation.set(X[0],X[1],X[2]),Te&&N.scale.set(Te[0],Te[1],Te[2]),N.updateMatrix();const we=N.geometry.clone();we.applyMatrix4(N.matrix),N.geometry=we,N.renderOrder=1/0,N.position.set(0,0,0),N.rotation.set(0,0,0),N.scale.set(1,1,1),Z.add(N)}return Z};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=F(D)),this.add(this.gizmo.rotate=F(q)),this.add(this.gizmo.scale=F(le)),this.add(this.picker.translate=F(Y)),this.add(this.picker.rotate=F(se)),this.add(this.picker.scale=F(pe)),this.add(this.helper.translate=F(fe)),this.add(this.helper.rotate=F($)),this.add(this.helper.scale=F(z)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}}class L$ extends We{constructor(){super(new Gr(1e5,1e5,2,2),new hs({visible:!1,wireframe:!0,side:ki,transparent:!0,opacity:.1,toneMapped:!1})),ve(this,"isTransformControlsPlane",!0),ve(this,"type","TransformControlsPlane"),ve(this,"unitX",new I(1,0,0)),ve(this,"unitY",new I(0,1,0)),ve(this,"unitZ",new I(0,0,1)),ve(this,"tempVector",new I),ve(this,"dirVector",new I),ve(this,"alignVector",new I),ve(this,"tempMatrix",new dt),ve(this,"identityQuaternion",new Gt),ve(this,"cameraQuaternion",new Gt),ve(this,"worldPosition",new I),ve(this,"worldQuaternion",new Gt),ve(this,"eye",new I),ve(this,"axis",null),ve(this,"mode","translate"),ve(this,"space","world"),ve(this,"updateMatrixWorld",()=>{let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),this.unitX.set(1,0,0).applyQuaternion(e==="local"?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion(e==="local"?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion(e==="local"?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case"translate":case"scale":switch(this.axis){case"X":this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case"Y":this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case"Z":this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case"XY":this.dirVector.copy(this.unitZ);break;case"YZ":this.dirVector.copy(this.unitX);break;case"XZ":this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case"XYZ":case"E":this.dirVector.set(0,0,0);break}break;case"rotate":default:this.dirVector.set(0,0,0)}this.dirVector.length()===0?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()})}}var I$=1/0,N$=9007199254740991,D$="[object Arguments]",O$="[object Function]",k$="[object GeneratorFunction]",z$="[object Symbol]",F$=typeof Eo=="object"&&Eo&&Eo.Object===Object&&Eo,U$=typeof self=="object"&&self&&self.Object===Object&&self,B$=F$||U$||Function("return this")();function V$(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function G$(n,e){for(var t=-1,r=n?n.length:0,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}function H$(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var $S=Object.prototype,W$=$S.hasOwnProperty,jS=$S.toString,Y2=B$.Symbol,$$=$S.propertyIsEnumerable,q2=Y2?Y2.isConcatSpreadable:void 0,Z2=Math.max;function EI(n,e,t,r,i){var s=-1,o=n.length;for(t||(t=q$),i||(i=[]);++s<o;){var a=n[s];e>0&&t(a)?e>1?EI(a,e-1,t,r,i):H$(i,a):r||(i[i.length]=a)}return i}function j$(n,e){return n=Object(n),X$(n,e,function(t,r){return r in n})}function X$(n,e,t){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=n[o];t(a,o)&&(s[o]=a)}return s}function Y$(n,e){return e=Z2(e===void 0?n.length-1:e,0),function(){for(var t=arguments,r=-1,i=Z2(t.length-e,0),s=Array(i);++r<i;)s[r]=t[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=t[r];return o[e]=s,V$(n,this,o)}}function q$(n){return K$(n)||Q$(n)||!!(q2&&n&&n[q2])}function Z$(n){if(typeof n=="string"||ij(n))return n;var e=n+"";return e=="0"&&1/n==-I$?"-0":e}function Q$(n){return ej(n)&&W$.call(n,"callee")&&(!$$.call(n,"callee")||jS.call(n)==D$)}var K$=Array.isArray;function J$(n){return n!=null&&nj(n.length)&&!tj(n)}function ej(n){return TI(n)&&J$(n)}function tj(n){var e=rj(n)?jS.call(n):"";return e==O$||e==k$}function nj(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=N$}function rj(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function TI(n){return!!n&&typeof n=="object"}function ij(n){return typeof n=="symbol"||TI(n)&&jS.call(n)==z$}var sj=Y$(function(n,e){return n==null?{}:j$(n,G$(EI(e,1),Z$))}),oj=sj;function aj(n,e,t){const{gl:r,size:i,viewport:s}=pi(),o=typeof n=="number"?n:i.width*s.dpr,a=typeof e=="number"?e:i.height*s.dpr,c=(typeof n=="number"?t:n)||{},{samples:f=0,depth:d,...h}=c,p=te.exports.useMemo(()=>{let g;return g=new qr(o,a,{minFilter:un,magFilter:un,encoding:r.outputEncoding,type:Za,...h}),d&&(g.depthTexture=new _S(o,a,os)),g.samples=f,g},[]);return te.exports.useLayoutEffect(()=>{p.setSize(o,a),f&&(p.samples=f)},[f,p,o,a]),te.exports.useEffect(()=>()=>p.dispose(),[]),p}const lj=n=>typeof n=="function",uj=te.exports.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:r,children:i,...s},o)=>{const a=pi(({set:x})=>x),c=pi(({camera:x})=>x),f=pi(({size:x})=>x),d=te.exports.useRef(null),h=te.exports.useRef(null),p=aj(e);te.exports.useLayoutEffect(()=>{s.manual||(d.current.aspect=f.width/f.height)},[f,s]),te.exports.useLayoutEffect(()=>{d.current.updateProjectionMatrix()});let g=0,v=null;const y=lj(i);return n$(x=>{y&&(t===1/0||g<t)&&(h.current.visible=!1,x.gl.setRenderTarget(p),v=x.scene.background,n&&(x.scene.background=n),x.gl.render(x.scene,d.current),x.scene.background=v,x.gl.setRenderTarget(null),h.current.visible=!0,g++)}),te.exports.useLayoutEffect(()=>{if(r){const x=c;return a(()=>({camera:d.current})),()=>a(()=>({camera:x}))}},[d,r,a]),te.exports.createElement(te.exports.Fragment,null,te.exports.createElement("perspectiveCamera",Ya({ref:T$([d,o])},s),!y&&i),te.exports.createElement("group",{ref:h},y&&i(p.texture)))});var cj=200,XS="__lodash_hash_undefined__",fj=1/0,CI=9007199254740991,dj="[object Arguments]",hj="[object Function]",pj="[object GeneratorFunction]",mj="[object Symbol]",gj=/[\\^$.*+?()[\]{}|]/g,vj=/^\[object .+?Constructor\]$/,yj=/^(?:0|[1-9]\d*)$/,_j=typeof Eo=="object"&&Eo&&Eo.Object===Object&&Eo,xj=typeof self=="object"&&self&&self.Object===Object&&self,YS=_j||xj||Function("return this")();function Sj(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function wj(n,e){var t=n?n.length:0;return!!t&&Ej(n,e,0)>-1}function Mj(n,e,t){for(var r=-1,i=n?n.length:0;++r<i;)if(t(e,n[r]))return!0;return!1}function AI(n,e){for(var t=-1,r=n?n.length:0,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}function qS(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}function bj(n,e,t,r){for(var i=n.length,s=t+(r?1:-1);r?s--:++s<i;)if(e(n[s],s,n))return s;return-1}function Ej(n,e,t){if(e!==e)return bj(n,Tj,t);for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1}function Tj(n){return n!==n}function Cj(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}function Aj(n){return function(e){return n(e)}}function Pj(n,e){return n.has(e)}function Rj(n,e){return n==null?void 0:n[e]}function Lj(n){var e=!1;if(n!=null&&typeof n.toString!="function")try{e=!!(n+"")}catch{}return e}function PI(n,e){return function(t){return n(e(t))}}var Ij=Array.prototype,Nj=Function.prototype,t0=Object.prototype,qy=YS["__core-js_shared__"],Q2=function(){var n=/[^.]+$/.exec(qy&&qy.keys&&qy.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),RI=Nj.toString,Xu=t0.hasOwnProperty,ZS=t0.toString,Dj=RegExp("^"+RI.call(Xu).replace(gj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),K2=YS.Symbol,Oj=PI(Object.getPrototypeOf,Object),kj=t0.propertyIsEnumerable,zj=Ij.splice,J2=K2?K2.isConcatSpreadable:void 0,jx=Object.getOwnPropertySymbols,eC=Math.max,Fj=II(YS,"Map"),nd=II(Object,"create");function el(n){var e=-1,t=n?n.length:0;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Uj(){this.__data__=nd?nd(null):{}}function Bj(n){return this.has(n)&&delete this.__data__[n]}function Vj(n){var e=this.__data__;if(nd){var t=e[n];return t===XS?void 0:t}return Xu.call(e,n)?e[n]:void 0}function Gj(n){var e=this.__data__;return nd?e[n]!==void 0:Xu.call(e,n)}function Hj(n,e){var t=this.__data__;return t[n]=nd&&e===void 0?XS:e,this}el.prototype.clear=Uj;el.prototype.delete=Bj;el.prototype.get=Vj;el.prototype.has=Gj;el.prototype.set=Hj;function Yu(n){var e=-1,t=n?n.length:0;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Wj(){this.__data__=[]}function $j(n){var e=this.__data__,t=n0(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():zj.call(e,t,1),!0}function jj(n){var e=this.__data__,t=n0(e,n);return t<0?void 0:e[t][1]}function Xj(n){return n0(this.__data__,n)>-1}function Yj(n,e){var t=this.__data__,r=n0(t,n);return r<0?t.push([n,e]):t[r][1]=e,this}Yu.prototype.clear=Wj;Yu.prototype.delete=$j;Yu.prototype.get=jj;Yu.prototype.has=Xj;Yu.prototype.set=Yj;function qu(n){var e=-1,t=n?n.length:0;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function qj(){this.__data__={hash:new el,map:new(Fj||Yu),string:new el}}function Zj(n){return r0(this,n).delete(n)}function Qj(n){return r0(this,n).get(n)}function Kj(n){return r0(this,n).has(n)}function Jj(n,e){return r0(this,n).set(n,e),this}qu.prototype.clear=qj;qu.prototype.delete=Zj;qu.prototype.get=Qj;qu.prototype.has=Kj;qu.prototype.set=Jj;function fg(n){var e=-1,t=n?n.length:0;for(this.__data__=new qu;++e<t;)this.add(n[e])}function eX(n){return this.__data__.set(n,XS),this}function tX(n){return this.__data__.has(n)}fg.prototype.add=fg.prototype.push=eX;fg.prototype.has=tX;function nX(n,e){var t=QS(n)||NI(n)?Cj(n.length,String):[],r=t.length,i=!!r;for(var s in n)(e||Xu.call(n,s))&&!(i&&(s=="length"||pX(s,r)))&&t.push(s);return t}function n0(n,e){for(var t=n.length;t--;)if(SX(n[t][0],e))return t;return-1}function rX(n,e,t,r){var i=-1,s=wj,o=!0,a=n.length,c=[],f=e.length;if(!a)return c;t&&(e=AI(e,Aj(t))),r?(s=Mj,o=!1):e.length>=cj&&(s=Pj,o=!1,e=new fg(e));e:for(;++i<a;){var d=n[i],h=t?t(d):d;if(d=r||d!==0?d:0,o&&h===h){for(var p=f;p--;)if(e[p]===h)continue e;c.push(d)}else s(e,h,r)||c.push(d)}return c}function LI(n,e,t,r,i){var s=-1,o=n.length;for(t||(t=hX),i||(i=[]);++s<o;){var a=n[s];e>0&&t(a)?e>1?LI(a,e-1,t,r,i):qS(i,a):r||(i[i.length]=a)}return i}function iX(n,e,t){var r=e(n);return QS(n)?r:qS(r,t(n))}function sX(n){if(!KS(n)||gX(n))return!1;var e=OI(n)||Lj(n)?Dj:vj;return e.test(xX(n))}function oX(n){if(!KS(n))return yX(n);var e=vX(n),t=[];for(var r in n)r=="constructor"&&(e||!Xu.call(n,r))||t.push(r);return t}function aX(n,e){return n=Object(n),lX(n,e,function(t,r){return r in n})}function lX(n,e,t){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=n[o];t(a,o)&&(s[o]=a)}return s}function uX(n,e){return e=eC(e===void 0?n.length-1:e,0),function(){for(var t=arguments,r=-1,i=eC(t.length-e,0),s=Array(i);++r<i;)s[r]=t[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=t[r];return o[e]=s,Sj(n,this,o)}}function cX(n){return iX(n,EX,dX)}function r0(n,e){var t=n.__data__;return mX(e)?t[typeof e=="string"?"string":"hash"]:t.map}function II(n,e){var t=Rj(n,e);return sX(t)?t:void 0}var fX=jx?PI(jx,Object):zI,dX=jx?function(n){for(var e=[];n;)qS(e,fX(n)),n=Oj(n);return e}:zI;function hX(n){return QS(n)||NI(n)||!!(J2&&n&&n[J2])}function pX(n,e){return e=e==null?CI:e,!!e&&(typeof n=="number"||yj.test(n))&&n>-1&&n%1==0&&n<e}function mX(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function gX(n){return!!Q2&&Q2 in n}function vX(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||t0;return n===t}function yX(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}function _X(n){if(typeof n=="string"||bX(n))return n;var e=n+"";return e=="0"&&1/n==-fj?"-0":e}function xX(n){if(n!=null){try{return RI.call(n)}catch{}try{return n+""}catch{}}return""}function SX(n,e){return n===e||n!==n&&e!==e}function NI(n){return wX(n)&&Xu.call(n,"callee")&&(!kj.call(n,"callee")||ZS.call(n)==dj)}var QS=Array.isArray;function DI(n){return n!=null&&MX(n.length)&&!OI(n)}function wX(n){return kI(n)&&DI(n)}function OI(n){var e=KS(n)?ZS.call(n):"";return e==hj||e==pj}function MX(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=CI}function KS(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function kI(n){return!!n&&typeof n=="object"}function bX(n){return typeof n=="symbol"||kI(n)&&ZS.call(n)==mj}function EX(n){return DI(n)?nX(n,!0):oX(n)}var TX=uX(function(n,e){return n==null?{}:(e=AI(LI(e,1),_X),aX(n,rX(cX(n),e)))});function zI(){return[]}var CX=TX;const AX=te.exports.forwardRef(({children:n,domElement:e,onChange:t,onMouseDown:r,onMouseUp:i,onObjectChange:s,object:o,makeDefault:a,...c},f)=>{const d=["enabled","axis","mode","translationSnap","rotationSnap","scaleSnap","space","size","showX","showY","showZ"],{camera:h,...p}=c,g=oj(p,d),v=CX(p,d),y=pi($=>$.controls),x=pi($=>$.gl),w=pi($=>$.events),_=pi($=>$.camera),M=pi($=>$.invalidate),E=pi($=>$.get),C=pi($=>$.set),P=h||_,R=e||w.connected||x.domElement,T=te.exports.useMemo(()=>new P$(P,R),[P,R]),L=te.exports.useRef();te.exports.useLayoutEffect(()=>(o?T.attach(o instanceof Mt?o:o.current):L.current instanceof Mt&&T.attach(L.current),()=>void T.detach()),[o,n,T]),te.exports.useEffect(()=>{if(y){const $=se=>y.enabled=!se.value;return T.addEventListener("dragging-changed",$),()=>T.removeEventListener("dragging-changed",$)}},[T,y]);const D=te.exports.useRef(),Y=te.exports.useRef(),fe=te.exports.useRef(),q=te.exports.useRef();return te.exports.useLayoutEffect(()=>void(D.current=t),[t]),te.exports.useLayoutEffect(()=>void(Y.current=r),[r]),te.exports.useLayoutEffect(()=>void(fe.current=i),[i]),te.exports.useLayoutEffect(()=>void(q.current=s),[s]),te.exports.useEffect(()=>{const $=z=>{M(),D.current==null||D.current(z)},se=z=>Y.current==null?void 0:Y.current(z),le=z=>fe.current==null?void 0:fe.current(z),pe=z=>q.current==null?void 0:q.current(z);return T.addEventListener("change",$),T.addEventListener("mouseDown",se),T.addEventListener("mouseUp",le),T.addEventListener("objectChange",pe),()=>{T.removeEventListener("change",$),T.removeEventListener("mouseDown",se),T.removeEventListener("mouseUp",le),T.removeEventListener("objectChange",pe)}},[M,T]),te.exports.useEffect(()=>{if(a){const $=E().controls;return C({controls:T}),()=>C({controls:$})}},[a,T]),T?te.exports.createElement(te.exports.Fragment,null,te.exports.createElement("primitive",Ya({ref:f,object:T},g)),te.exports.createElement("group",Ya({ref:L},v),n)):null}),PX=()=>{},Ql=(n,e)=>{const t=te.exports.useRef(PX);te.exports.useEffect(()=>{t.current=e},[e]),te.exports.useEffect(()=>{const r=i=>{const{action:s,data:o}=i.data;t.current&&s===n&&t.current(o)};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)},[n])},RX=()=>{const{camera:n}=pi(),e=(t,r)=>t>0&&t<90?r:t>-180&&t<-90||t>0?-r:r;return Ql("setCameraPosition",({position:t,rotation:r})=>{n.position.set(t.x,t.z,-t.y),n.rotation.order="YZX",r&&n.rotation.set(is.degToRad(r.x),is.degToRad(e(r.x,r.z)),is.degToRad(r.y)),n.updateProjectionMatrix()}),at(uj,{position:[0,0,10],makeDefault:!0,onUpdate:t=>t.updateProjectionMatrix()})};async function LX(n,e,t){const r={method:"post",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(e)},i=window.GetParentResourceName?window.GetParentResourceName():"nui-frame-app";return await(await fetch(`https://${i}/${n}`,r)).json()}const IX=()=>{const n=te.exports.useRef(null),[e,t]=te.exports.useState(),[r,i]=te.exports.useState("translate"),[s,o]=te.exports.useState("world"),[a,c]=te.exports.useState(),[f,d]=te.exports.useState(),h=()=>{const p={handle:e,position:{x:n.current.position.x,y:-n.current.position.z,z:n.current.position.y},rotation:{x:is.radToDeg(n.current.rotation.x),y:is.radToDeg(-n.current.rotation.z),z:is.radToDeg(n.current.rotation.y)}};LX("gizmo:ChangePosition",p)};return Ql("setGizmoEntity",p=>{t(p.handle),p.handle!==void 0&&(n.current.position.set(p.position.x,p.position.z,-p.position.y),n.current.rotation.order="YZX",n.current.rotation.set(is.degToRad(p.rotation.x),is.degToRad(p.rotation.z),is.degToRad(p.rotation.y)))}),Ql("SetGizmoTransformMode",p=>{p.transformhandler===!0?i("rotate"):i("translate")}),Ql("SetTranslateSnap",p=>{c(p.translatesnapdata)}),Ql("SetRotationSnap",p=>{d(p.rotationsnapdata)}),Ql("SetSpaceMode",p=>{p.spacehandler===!0?o("local"):o("world")}),at(Og,{children:ka(te.exports.Suspense,{fallback:at("p",{children:"Loading Gizmo"}),children:[e!=null&&at(AX,{size:.5,object:n,space:s,translationSnap:a,rotationSnap:f,mode:r,onObjectChange:h}),at("mesh",{ref:n})]})})},NX=()=>ka(E$,{style:{zIndex:1},children:[at(RX,{}),at(IX,{})]}),DX=ds(n=>({container:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}})),OX=()=>{const{classes:n}=DX();return at(Og,{children:at(Vi,{className:n.container,children:at(NX,{})})})};/**
* @remix-run/router v1.2.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Xx(){return Xx=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Xx.apply(this,arguments)}var Na;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(Na||(Na={}));const tC="popstate";function kX(n){n===void 0&&(n={});function e(i,s){let{pathname:o="/",search:a="",hash:c=""}=ew(i.location.hash.substr(1));return Yx("",{pathname:o,search:a,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function t(i,s){let o=i.document.querySelector("base"),a="";if(o&&o.getAttribute("href")){let c=i.location.href,f=c.indexOf("#");a=f===-1?c:c.slice(0,f)}return a+"#"+(typeof s=="string"?s:JS(s))}function r(i,s){zX(i.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(s)+")")}return BX(e,t,r,n)}function FI(n,e){if(n===!1||n===null||typeof n=="undefined")throw new Error(e)}function zX(n,e){if(!n){typeof console!="undefined"&&console.warn(e);try{throw new Error(e)}catch{}}}function FX(){return Math.random().toString(36).substr(2,8)}function nC(n){return{usr:n.state,key:n.key}}function Yx(n,e,t,r){return t===void 0&&(t=null),Xx({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?ew(e):e,{state:t,key:e&&e.key||r||FX()})}function JS(n){let{pathname:e="/",search:t="",hash:r=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ew(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let r=n.indexOf("?");r>=0&&(e.search=n.substr(r),n=n.substr(0,r)),n&&(e.pathname=n)}return e}function UX(n){let e=typeof window!="undefined"&&typeof window.location!="undefined"&&window.location.origin!=="null"?window.location.origin:window.location.href,t=typeof n=="string"?n:JS(n);return FI(e,"No window.location.(origin|href) available to create URL for href: "+t),new URL(t,e)}function BX(n,e,t,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Na.Pop,c=null;function f(){a=Na.Pop,c&&c({action:a,location:p.location})}function d(g,v){a=Na.Push;let y=Yx(p.location,g,v);t&&t(y,g);let x=nC(y),w=p.createHref(y);try{o.pushState(x,"",w)}catch{i.location.assign(w)}s&&c&&c({action:a,location:p.location})}function h(g,v){a=Na.Replace;let y=Yx(p.location,g,v);t&&t(y,g);let x=nC(y),w=p.createHref(y);o.replaceState(x,"",w),s&&c&&c({action:a,location:p.location})}let p={get action(){return a},get location(){return n(i,o)},listen(g){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(tC,f),c=g,()=>{i.removeEventListener(tC,f),c=null}},createHref(g){return e(i,g)},encodeLocation(g){let v=UX(typeof g=="string"?g:JS(g));return{pathname:v.pathname,search:v.search,hash:v.hash}},push:d,replace:h,go(g){return o.go(g)}};return p}var rC;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(rC||(rC={}));function VX(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,r=n.charAt(t);return r&&r!=="/"?null:n.slice(t)||"/"}const GX=["post","put","patch","delete"];[...GX];/**
* React Router v6.6.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function HX(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const WX=typeof Object.is=="function"?Object.is:HX,{useState:$X,useEffect:jX,useLayoutEffect:XX,useDebugValue:YX}=o_;function qX(n,e,t){const r=e(),[{inst:i},s]=$X({inst:{value:r,getSnapshot:e}});return XX(()=>{i.value=r,i.getSnapshot=e,Zy(i)&&s({inst:i})},[n,r,e]),jX(()=>(Zy(i)&&s({inst:i}),n(()=>{Zy(i)&&s({inst:i})})),[n]),YX(r),r}function Zy(n){const e=n.getSnapshot,t=n.value;try{const r=e();return!WX(t,r)}catch{return!0}}function ZX(n,e,t){return e()}const QX=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",KX=!QX,JX=KX?ZX:qX;"useSyncExternalStore"in o_&&(n=>n.useSyncExternalStore)(o_);const eY=te.exports.createContext(null),UI=te.exports.createContext(null);function tY(){return te.exports.useContext(UI)!=null}var iC;(function(n){n.UseRevalidator="useRevalidator"})(iC||(iC={}));var sC;(function(n){n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator"})(sC||(sC={}));function nY(n){let{basename:e="/",children:t=null,location:r,navigationType:i=Na.Pop,navigator:s,static:o=!1}=n;tY()&&FI(!1);let a=e.replace(/^\/*/,"/"),c=te.exports.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof r=="string"&&(r=ew(r));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:g="default"}=r,v=te.exports.useMemo(()=>{let y=VX(f,a);return y==null?null:{pathname:y,search:d,hash:h,state:p,key:g}},[a,f,d,h,p,g]);return v==null?null:te.exports.createElement(eY.Provider,{value:c},te.exports.createElement(UI.Provider,{children:t,value:{location:v,navigationType:i}}))}var oC;(function(n){n[n.pending=0]="pending",n[n.success=1]="success",n[n.error=2]="error"})(oC||(oC={}));new Promise(()=>{});/**
* React Router DOM v6.6.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function rY(n){let{basename:e,children:t,window:r}=n,i=te.exports.useRef();i.current==null&&(i.current=kX({window:r,v5Compat:!0}));let s=i.current,[o,a]=te.exports.useState({action:s.action,location:s.location});return te.exports.useLayoutEffect(()=>s.listen(a),[s]),te.exports.createElement(nY,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var aC;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmitImpl="useSubmitImpl",n.UseFetcher="useFetcher"})(aC||(aC={}));var lC;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(lC||(lC={}));const tw=te.exports.createContext(null);tw.displayName="@mantine/modals/ModalsContext";function iY(){const n=te.exports.useContext(tw);if(!n)throw new Error("[@mantine/modals] useModals hook was called outside of context, wrap your app with ModalsProvider component");return n}var sY=Object.defineProperty,oY=Object.defineProperties,aY=Object.getOwnPropertyDescriptors,uC=Object.getOwnPropertySymbols,lY=Object.prototype.hasOwnProperty,uY=Object.prototype.propertyIsEnumerable,cC=(n,e,t)=>e in n?sY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Qy=(n,e)=>{for(var t in e||(e={}))lY.call(e,t)&&cC(n,t,e[t]);if(uC)for(var t of uC(e))uY.call(e,t)&&cC(n,t,e[t]);return n},fC=(n,e)=>oY(n,aY(e));function cY({id:n,cancelProps:e,confirmProps:t,labels:r={cancel:"",confirm:""},closeOnConfirm:i=!0,closeOnCancel:s=!0,groupProps:o,onCancel:a,onConfirm:c,children:f}){const{cancel:d,confirm:h}=r,p=iY(),g=y=>{typeof(e==null?void 0:e.onClick)=="function"&&(e==null||e.onClick(y)),typeof a=="function"&&a(),s&&p.closeModal(n)},v=y=>{typeof(t==null?void 0:t.onClick)=="function"&&(t==null||t.onClick(y)),typeof c=="function"&&c(),i&&p.closeModal(n)};return ke.createElement(ke.Fragment,null,f&&ke.createElement(Vi,{mb:"md"},f),ke.createElement(eR,Qy({position:"right"},o),ke.createElement(uT,fC(Qy({variant:"default"},e),{onClick:g}),(e==null?void 0:e.children)||d),ke.createElement(uT,fC(Qy({},t),{onClick:v}),(t==null?void 0:t.children)||h)))}function fY(n,e){switch(e.type){case"OPEN":return{current:e.payload,modals:[...n.modals,e.payload]};case"CLOSE":return{current:n.modals[n.modals.length-2]||null,modals:n.modals.filter(t=>t.id!==e.payload)};case"CLOSE_ALL":return{current:n.current,modals:[]};default:return n}}const[dY,Pd]=Cz("mantine-modals");Pd("openModal");Pd("closeModal");Pd("closeAllModals");Pd("openConfirmModal");Pd("openContextModal");var hY=Object.defineProperty,pY=Object.defineProperties,mY=Object.getOwnPropertyDescriptors,dg=Object.getOwnPropertySymbols,BI=Object.prototype.hasOwnProperty,VI=Object.prototype.propertyIsEnumerable,dC=(n,e,t)=>e in n?hY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,pm=(n,e)=>{for(var t in e||(e={}))BI.call(e,t)&&dC(n,t,e[t]);if(dg)for(var t of dg(e))VI.call(e,t)&&dC(n,t,e[t]);return n},hC=(n,e)=>pY(n,mY(e)),_a=(n,e)=>{var t={};for(var r in n)BI.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&dg)for(var r of dg(n))e.indexOf(r)<0&&VI.call(n,r)&&(t[r]=n[r]);return t};function gY(n){if(!n)return{confirmProps:{},modalProps:{}};const e=n,{id:t,children:r,onCancel:i,onConfirm:s,closeOnConfirm:o,closeOnCancel:a,cancelProps:c,confirmProps:f,groupProps:d,labels:h}=e,p=_a(e,["id","children","onCancel","onConfirm","closeOnConfirm","closeOnCancel","cancelProps","confirmProps","groupProps","labels"]);return{confirmProps:{id:t,children:r,onCancel:i,onConfirm:s,closeOnConfirm:o,closeOnCancel:a,cancelProps:c,confirmProps:f,groupProps:d,labels:h},modalProps:pm({id:t},p)}}function vY({children:n,modalProps:e,labels:t,modals:r}){const[i,s]=te.exports.useReducer(fY,{modals:[],current:null}),o=y=>{i.modals.forEach(x=>{var w,_,M,E;x.type==="confirm"&&y&&((_=(w=x.props)==null?void 0:w.onCancel)==null||_.call(w)),(E=(M=x.props)==null?void 0:M.onClose)==null||E.call(M)}),s({type:"CLOSE_ALL"})},a=y=>{var x=y,{modalId:w}=x,_=_a(x,["modalId"]);const M=w||iy();return s({type:"OPEN",payload:{id:M,type:"content",props:_}}),M},c=y=>{var x=y,{modalId:w}=x,_=_a(x,["modalId"]);const M=w||iy();return s({type:"OPEN",payload:{id:M,type:"confirm",props:_}}),M},f=(y,x)=>{var w=x,{modalId:_}=w,M=_a(w,["modalId"]);const E=_||iy();return s({type:"OPEN",payload:{id:E,type:"context",props:M,ctx:y}}),E},d=(y,x)=>{var w,_,M,E;if(i.modals.length<=1){o(x);return}const C=i.modals.find(P=>P.id===y);(C==null?void 0:C.type)==="confirm"&&x&&((_=(w=C.props)==null?void 0:w.onCancel)==null||_.call(w)),(E=(M=C==null?void 0:C.props)==null?void 0:M.onClose)==null||E.call(M),s({type:"CLOSE",payload:C.id})};dY({openModal:a,openConfirmModal:c,openContextModal:y=>{var x=y,{modal:w}=x,_=_a(x,["modal"]);return f(w,_)},closeModal:d,closeAllModals:o});const h={modals:i.modals,openModal:a,openConfirmModal:c,openContextModal:f,closeModal:d,closeAll:o},p=()=>{var y;switch((y=i.current)==null?void 0:y.type){case"context":{const x=i.current.props,{innerProps:w}=x,_=_a(x,["innerProps"]),M=r[i.current.ctx];return{modalProps:_,content:at(M,{innerProps:w,context:h,id:i.current.id})}}case"confirm":{const{modalProps:x,confirmProps:w}=gY(i.current.props);return{modalProps:x,content:at(cY,{...hC(pm({},w),{id:i.current.id,labels:i.current.props.labels||t})})}}case"content":{const x=i.current.props,{children:w}=x;return{modalProps:_a(x,["children"]),content:at(Og,{children:w})}}default:return{modalProps:{},content:null}}},{modalProps:g,content:v}=p();return ka(tw.Provider,{value:h,children:[at(aR,{...hC(pm(pm({zIndex:rS("modal")+1},e),g),{opened:i.modals.length>0,onClose:()=>d(i.current.id)}),children:v}),n]})}function yY(n){const e=new Error(n);if(e.stack===void 0)try{throw e}catch{}return e}var _Y=yY,yt=_Y;function xY(n){return!!n&&typeof n.then=="function"}var sn=xY;function SY(n,e){if(n!=null)return n;throw yt(e!=null?e:"Got unexpected null or undefined")}var on=SY;function pt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}class i0{getValue(){throw yt("BaseLoadable")}toPromise(){throw yt("BaseLoadable")}valueMaybe(){throw yt("BaseLoadable")}valueOrThrow(){throw yt(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw yt("BaseLoadable")}promiseOrThrow(){throw yt(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw yt("BaseLoadable")}errorOrThrow(){throw yt(`Loadable expected error, but in "${this.state}" state`)}is(e){return e.state===this.state&&e.contents===this.contents}map(e){throw yt("BaseLoadable")}}class wY extends i0{constructor(e){super(),pt(this,"state","hasValue"),pt(this,"contents",void 0),this.contents=e}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(e){try{const t=e(this.contents);return sn(t)?tl(t):Du(t)?t:Rd(t)}catch(t){return sn(t)?tl(t.next(()=>this.map(e))):s0(t)}}}class MY extends i0{constructor(e){super(),pt(this,"state","hasError"),pt(this,"contents",void 0),this.contents=e}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(e){return this}}class GI extends i0{constructor(e){super(),pt(this,"state","loading"),pt(this,"contents",void 0),this.contents=e}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(e){return tl(this.contents.then(t=>{const r=e(t);if(Du(r)){const i=r;switch(i.state){case"hasValue":return i.contents;case"hasError":throw i.contents;case"loading":return i.contents}}return r}).catch(t=>{if(sn(t))return t.then(()=>this.map(e).contents);throw t}))}}function Rd(n){return Object.freeze(new wY(n))}function s0(n){return Object.freeze(new MY(n))}function tl(n){return Object.freeze(new GI(n))}function HI(){return Object.freeze(new GI(new Promise(()=>{})))}function bY(n){return n.every(e=>e.state==="hasValue")?Rd(n.map(e=>e.contents)):n.some(e=>e.state==="hasError")?s0(on(n.find(e=>e.state==="hasError"),"Invalid loadable passed to loadableAll").contents):tl(Promise.all(n.map(e=>e.contents)))}function WI(n){const t=(Array.isArray(n)?n:Object.getOwnPropertyNames(n).map(i=>n[i])).map(i=>Du(i)?i:sn(i)?tl(i):Rd(i)),r=bY(t);return Array.isArray(n)?r:r.map(i=>Object.getOwnPropertyNames(n).reduce((s,o,a)=>({...s,[o]:i[a]}),{}))}function Du(n){return n instanceof i0}const EY={of:n=>sn(n)?tl(n):Du(n)?n:Rd(n),error:n=>s0(n),loading:()=>HI(),all:WI,isLoadable:Du};var hl={loadableWithValue:Rd,loadableWithError:s0,loadableWithPromise:tl,loadableLoading:HI,loadableAll:WI,isLoadable:Du,RecoilLoadable:EY},TY=hl.loadableWithValue,CY=hl.loadableWithError,AY=hl.loadableWithPromise,PY=hl.loadableLoading,RY=hl.loadableAll,LY=hl.isLoadable,IY=hl.RecoilLoadable,Ld=Object.freeze({__proto__:null,loadableWithValue:TY,loadableWithError:CY,loadableWithPromise:AY,loadableLoading:PY,loadableAll:RY,isLoadable:LY,RecoilLoadable:IY});const o0=new Map().set("recoil_hamt_2020",!0).set("recoil_sync_external_store",!0).set("recoil_suppress_rerender_in_callback",!0).set("recoil_memory_managament_2020",!0);function a0(n){var e;return(e=o0.get(n))!==null&&e!==void 0?e:!1}a0.setPass=n=>{o0.set(n,!0)};a0.setFail=n=>{o0.set(n,!1)};a0.clear=()=>{o0.clear()};var Yt=a0;function NY(n,e,{error:t}={}){return null}var DY=NY,nw=DY,Ky,Jy,e_;const OY=(Ky=ke.createMutableSource)!==null&&Ky!==void 0?Ky:ke.unstable_createMutableSource,$I=(Jy=ke.useMutableSource)!==null&&Jy!==void 0?Jy:ke.unstable_useMutableSource,jI=(e_=ke.useSyncExternalStore)!==null&&e_!==void 0?e_:ke.unstable_useSyncExternalStore;function kY(){var n;const{ReactCurrentDispatcher:e,ReactCurrentOwner:t}=ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;return((n=e==null?void 0:e.current)!==null&&n!==void 0?n:t.currentDispatcher).useSyncExternalStore!=null}function zY(){return Yt("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Yt("recoil_sync_external_store")&&jI!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Yt("recoil_mutable_source")&&$I!=null&&typeof window!="undefined"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Yt("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Yt("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function FY(){return!1}var Id={createMutableSource:OY,useMutableSource:$I,useSyncExternalStore:jI,currentRendererSupportsUseSyncExternalStore:kY,reactMode:zY,isFastRefreshEnabled:FY};const XI={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0};function UY(){var n,e,t;if(typeof process=="undefined"||((n=process)===null||n===void 0?void 0:n.env)==null)return;const r=(e={}.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED)===null||e===void 0||(t=e.toLowerCase())===null||t===void 0?void 0:t.trim();if(r==null||r==="")return;if(!["true","false"].includes(r))throw yt(`({}).RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED value must be 'true', 'false', or empty: ${r}`);XI.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=r==="true"}UY();var YI=XI;class rw{constructor(e){pt(this,"key",void 0),this.key=e}toJSON(){return{key:this.key}}}class qI extends rw{}class ZI extends rw{}function BY(n){return n instanceof qI||n instanceof ZI}var l0={AbstractRecoilValue:rw,RecoilState:qI,RecoilValueReadOnly:ZI,isRecoilValue:BY},VY=l0.AbstractRecoilValue,GY=l0.RecoilState,HY=l0.RecoilValueReadOnly,WY=l0.isRecoilValue,Ou=Object.freeze({__proto__:null,AbstractRecoilValue:VY,RecoilState:GY,RecoilValueReadOnly:HY,isRecoilValue:WY});function $Y(n,e){return function*(){let t=0;for(const r of n)yield e(r,t++)}()}var u0=$Y;class QI{}const jY=new QI,nl=new Map,iw=new Map;function XY(n){return u0(n,e=>on(iw.get(e)))}function YY(n){if(nl.has(n)){const e=`Duplicate atom key "${n}". This is a FATAL ERROR in
production. But it is safe to ignore this warning if it occurred because of
hot module replacement.`;console.warn(e)}}function qY(n){YI.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&YY(n.key),nl.set(n.key,n);const e=n.set==null?new Ou.RecoilValueReadOnly(n.key):new Ou.RecoilState(n.key);return iw.set(n.key,e),e}class KI extends Error{}function ZY(n){const e=nl.get(n);if(e==null)throw new KI(`Missing definition for RecoilValue: "${n}""`);return e}function QY(n){return nl.get(n)}const hg=new Map;function KY(n){var e;if(!Yt("recoil_memory_managament_2020"))return;const t=nl.get(n);if(t!=null&&(e=t.shouldDeleteConfigOnRelease)!==null&&e!==void 0&&e.call(t)){var r;nl.delete(n),(r=JI(n))===null||r===void 0||r(),hg.delete(n)}}function JY(n,e){!Yt("recoil_memory_managament_2020")||(e===void 0?hg.delete(n):hg.set(n,e))}function JI(n){return hg.get(n)}var Ir={nodes:nl,recoilValues:iw,registerNode:qY,getNode:ZY,getNodeMaybe:QY,deleteNodeConfigIfPossible:KY,setConfigDeletionHandler:JY,getConfigDeletionHandler:JI,recoilValuesForKeys:XY,NodeMissingError:KI,DefaultValue:QI,DEFAULT_VALUE:jY};function eq(n,e){e()}var tq={enqueueExecution:eq};function nq(n,e){return e={exports:{}},n(e,e.exports),e.exports}var rq=nq(function(n){var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},t={},r=5,i=Math.pow(2,r),s=i-1,o=i/2,a=i/4,c={},f=function(j){return function(){return j}},d=t.hash=function(Q){var j=typeof Q=="undefined"?"undefined":e(Q);if(j==="number")return Q;j!=="string"&&(Q+="");for(var U=0,de=0,ie=Q.length;de<ie;++de){var ee=Q.charCodeAt(de);U=(U<<5)-U+ee|0}return U},h=function(j){return j-=j>>1&1431655765,j=(j&858993459)+(j>>2&858993459),j=j+(j>>4)&252645135,j+=j>>8,j+=j>>16,j&127},p=function(j,U){return U>>>j&s},g=function(j){return 1<<j},v=function(j,U){return h(j&U-1)},y=function(j,U,de,ie){var ee=ie;if(!j){var ye=ie.length;ee=new Array(ye);for(var Ae=0;Ae<ye;++Ae)ee[Ae]=ie[Ae]}return ee[U]=de,ee},x=function(j,U,de){var ie=de.length-1,ee=0,ye=0,Ae=de;if(j)ee=ye=U;else for(Ae=new Array(ie);ee<U;)Ae[ye++]=de[ee++];for(++ee;ee<=ie;)Ae[ye++]=de[ee++];return j&&(Ae.length=ie),Ae},w=function(j,U,de,ie){var ee=ie.length;if(j){for(var ye=ee;ye>=U;)ie[ye--]=ie[ye];return ie[U]=de,ie}for(var Ae=0,Oe=0,Ye=new Array(ee+1);Ae<U;)Ye[Oe++]=ie[Ae++];for(Ye[U]=de;Ae<ee;)Ye[++Oe]=ie[Ae++];return Ye},_=1,M=2,E=3,C=4,P={__hamt_isEmpty:!0},R=function(j){return j===P||j&&j.__hamt_isEmpty},T=function(j,U,de,ie){return{type:_,edit:j,hash:U,key:de,value:ie,_modify:z}},L=function(j,U,de){return{type:M,edit:j,hash:U,children:de,_modify:F}},D=function(j,U,de){return{type:E,edit:j,mask:U,children:de,_modify:G}},Y=function(j,U,de){return{type:C,edit:j,size:U,children:de,_modify:Z}},fe=function(j){return j===P||j.type===_||j.type===M},q=function(j,U,de,ie,ee){for(var ye=[],Ae=ie,Oe=0,Ye=0;Ae;++Ye)Ae&1&&(ye[Ye]=ee[Oe++]),Ae>>>=1;return ye[U]=de,Y(j,Oe+1,ye)},$=function(j,U,de,ie){for(var ee=new Array(U-1),ye=0,Ae=0,Oe=0,Ye=ie.length;Oe<Ye;++Oe)if(Oe!==de){var bt=ie[Oe];bt&&!R(bt)&&(ee[ye++]=bt,Ae|=1<<Oe)}return D(j,Ae,ee)},se=function Q(j,U,de,ie,ee,ye){if(de===ee)return L(j,de,[ye,ie]);var Ae=p(U,de),Oe=p(U,ee);return D(j,g(Ae)|g(Oe),Ae===Oe?[Q(j,U+r,de,ie,ee,ye)]:Ae<Oe?[ie,ye]:[ye,ie])},le=function(j,U,de,ie,ee,ye,Ae,Oe){for(var Ye=ee.length,bt=0;bt<Ye;++bt){var _t=ee[bt];if(de(Ae,_t.key)){var Ft=_t.value,$t=ye(Ft);return $t===Ft?ee:$t===c?(--Oe.value,x(j,bt,ee)):y(j,bt,T(U,ie,Ae,$t),ee)}}var Zn=ye();return Zn===c?ee:(++Oe.value,y(j,Ye,T(U,ie,Ae,Zn),ee))},pe=function(j,U){return j===U.edit},z=function(j,U,de,ie,ee,ye,Ae){if(U(ye,this.key)){var Oe=ie(this.value);return Oe===this.value?this:Oe===c?(--Ae.value,P):pe(j,this)?(this.value=Oe,this):T(j,ee,ye,Oe)}var Ye=ie();return Ye===c?this:(++Ae.value,se(j,de,this.hash,this,ee,T(j,ee,ye,Ye)))},F=function(j,U,de,ie,ee,ye,Ae){if(ee===this.hash){var Oe=pe(j,this),Ye=le(Oe,j,U,this.hash,this.children,ie,ye,Ae);return Ye===this.children?this:Ye.length>1?L(j,this.hash,Ye):Ye[0]}var bt=ie();return bt===c?this:(++Ae.value,se(j,de,this.hash,this,ee,T(j,ee,ye,bt)))},G=function(j,U,de,ie,ee,ye,Ae){var Oe=this.mask,Ye=this.children,bt=p(de,ee),_t=g(bt),Ft=v(Oe,_t),$t=Oe&_t,Zn=$t?Ye[Ft]:P,Nr=Zn._modify(j,U,de+r,ie,ee,ye,Ae);if(Zn===Nr)return this;var vs=pe(j,this),ys=Oe,Wi=void 0;if($t&&R(Nr)){if(ys&=~_t,!ys)return P;if(Ye.length<=2&&fe(Ye[Ft^1]))return Ye[Ft^1];Wi=x(vs,Ft,Ye)}else if(!$t&&!R(Nr)){if(Ye.length>=o)return q(j,bt,Nr,Oe,Ye);ys|=_t,Wi=w(vs,Ft,Nr,Ye)}else Wi=y(vs,Ft,Nr,Ye);return vs?(this.mask=ys,this.children=Wi,this):D(j,ys,Wi)},Z=function(j,U,de,ie,ee,ye,Ae){var Oe=this.size,Ye=this.children,bt=p(de,ee),_t=Ye[bt],Ft=(_t||P)._modify(j,U,de+r,ie,ee,ye,Ae);if(_t===Ft)return this;var $t=pe(j,this),Zn=void 0;if(R(_t)&&!R(Ft))++Oe,Zn=y($t,bt,Ft,Ye);else if(!R(_t)&&R(Ft)){if(--Oe,Oe<=a)return $(j,Oe,bt,Ye);Zn=y($t,bt,P,Ye)}else Zn=y($t,bt,Ft,Ye);return $t?(this.size=Oe,this.children=Zn,this):Y(j,Oe,Zn)};P._modify=function(Q,j,U,de,ie,ee,ye){var Ae=de();return Ae===c?P:(++ye.value,T(Q,ie,ee,Ae))};function k(Q,j,U,de,ie){this._editable=Q,this._edit=j,this._config=U,this._root=de,this._size=ie}k.prototype.setTree=function(Q,j){return this._editable?(this._root=Q,this._size=j,this):Q===this._root?this:new k(this._editable,this._edit,this._config,Q,j)};var W=t.tryGetHash=function(Q,j,U,de){for(var ie=de._root,ee=0,ye=de._config.keyEq;;)switch(ie.type){case _:return ye(U,ie.key)?ie.value:Q;case M:{if(j===ie.hash)for(var Ae=ie.children,Oe=0,Ye=Ae.length;Oe<Ye;++Oe){var bt=Ae[Oe];if(ye(U,bt.key))return bt.value}return Q}case E:{var _t=p(ee,j),Ft=g(_t);if(ie.mask&Ft){ie=ie.children[v(ie.mask,Ft)],ee+=r;break}return Q}case C:{if(ie=ie.children[p(ee,j)],ie){ee+=r;break}return Q}default:return Q}};k.prototype.tryGetHash=function(Q,j,U){return W(Q,j,U,this)};var N=t.tryGet=function(Q,j,U){return W(Q,U._config.hash(j),j,U)};k.prototype.tryGet=function(Q,j){return N(Q,j,this)};var me=t.getHash=function(Q,j,U){return W(void 0,Q,j,U)};k.prototype.getHash=function(Q,j){return me(Q,j,this)},t.get=function(Q,j){return W(void 0,j._config.hash(Q),Q,j)},k.prototype.get=function(Q,j){return N(j,Q,this)};var X=t.has=function(Q,j,U){return W(c,Q,j,U)!==c};k.prototype.hasHash=function(Q,j){return X(Q,j,this)};var Te=t.has=function(Q,j){return X(j._config.hash(Q),Q,j)};k.prototype.has=function(Q){return Te(Q,this)};var Ce=function(j,U){return j===U};t.make=function(Q){return new k(0,0,{keyEq:Q&&Q.keyEq||Ce,hash:Q&&Q.hash||d},P,0)},t.empty=t.make();var we=t.isEmpty=function(Q){return Q&&!!R(Q._root)};k.prototype.isEmpty=function(){return we(this)};var be=t.modifyHash=function(Q,j,U,de){var ie={value:de._size},ee=de._root._modify(de._editable?de._edit:NaN,de._config.keyEq,0,Q,j,U,ie);return de.setTree(ee,ie.value)};k.prototype.modifyHash=function(Q,j,U){return be(U,Q,j,this)};var He=t.modify=function(Q,j,U){return be(Q,U._config.hash(j),j,U)};k.prototype.modify=function(Q,j){return He(j,Q,this)};var ue=t.setHash=function(Q,j,U,de){return be(f(U),Q,j,de)};k.prototype.setHash=function(Q,j,U){return ue(Q,j,U,this)};var ne=t.set=function(Q,j,U){return ue(U._config.hash(Q),Q,j,U)};k.prototype.set=function(Q,j){return ne(Q,j,this)};var Ee=f(c),Ue=t.removeHash=function(Q,j,U){return be(Ee,Q,j,U)};k.prototype.removeHash=k.prototype.deleteHash=function(Q,j){return Ue(Q,j,this)};var Le=t.remove=function(Q,j){return Ue(j._config.hash(Q),Q,j)};k.prototype.remove=k.prototype.delete=function(Q){return Le(Q,this)};var qe=t.beginMutation=function(Q){return new k(Q._editable+1,Q._edit+1,Q._config,Q._root,Q._size)};k.prototype.beginMutation=function(){return qe(this)};var et=t.endMutation=function(Q){return Q._editable=Q._editable&&Q._editable-1,Q};k.prototype.endMutation=function(){return et(this)};var tt=t.mutate=function(Q,j){var U=qe(j);return Q(U),et(U)};k.prototype.mutate=function(Q){return tt(Q,this)};var Ct=function(j){return j&&Nt(j[0],j[1],j[2],j[3],j[4])},Nt=function(j,U,de,ie,ee){for(;de<j;){var ye=U[de++];if(ye&&!R(ye))return H(ye,ie,[j,U,de,ie,ee])}return Ct(ee)},H=function(j,U,de){switch(j.type){case _:return{value:U(j),rest:de};case M:case C:case E:var ie=j.children;return Nt(ie.length,ie,0,U,de);default:return Ct(de)}},O={done:!0};function ce(Q){this.v=Q}ce.prototype.next=function(){if(!this.v)return O;var Q=this.v;return this.v=Ct(Q.rest),Q},ce.prototype[Symbol.iterator]=function(){return this};var Pe=function(j,U){return new ce(H(j._root,U))},Ne=function(j){return[j.key,j.value]},ze=t.entries=function(Q){return Pe(Q,Ne)};k.prototype.entries=k.prototype[Symbol.iterator]=function(){return ze(this)};var st=function(j){return j.key},Be=t.keys=function(Q){return Pe(Q,st)};k.prototype.keys=function(){return Be(this)};var Se=function(j){return j.value},Je=t.values=k.prototype.values=function(Q){return Pe(Q,Se)};k.prototype.values=function(){return Je(this)};var ot=t.fold=function(Q,j,U){var de=U._root;if(de.type===_)return Q(j,de.value,de.key);for(var ie=[de.children],ee=void 0;ee=ie.pop();)for(var ye=0,Ae=ee.length;ye<Ae;){var Oe=ee[ye++];Oe&&Oe.type&&(Oe.type===_?j=Q(j,Oe.value,Oe.key):ie.push(Oe.children))}return j};k.prototype.fold=function(Q,j){return ot(Q,j,this)};var Ze=t.forEach=function(Q,j){return ot(function(U,de,ie){return Q(de,ie,j)},null,j)};k.prototype.forEach=function(Q){return Ze(Q,this)};var it=t.count=function(Q){return Q._size};k.prototype.count=function(){return it(this)},Object.defineProperty(k.prototype,"size",{get:k.prototype.count}),n.exports?n.exports=t:(void 0).hamt=t});class iq{constructor(e){pt(this,"_map",void 0),this._map=new Map(e==null?void 0:e.entries())}keys(){return this._map.keys()}entries(){return this._map.entries()}get(e){return this._map.get(e)}has(e){return this._map.has(e)}set(e,t){return this._map.set(e,t),this}delete(e){return this._map.delete(e),this}clone(){return ow(this)}toMap(){return new Map(this._map)}}class sw{constructor(e){if(pt(this,"_hamt",rq.empty.beginMutation()),e instanceof sw){const t=e._hamt.endMutation();e._hamt=t.beginMutation(),this._hamt=t.beginMutation()}else if(e)for(const[t,r]of e.entries())this._hamt.set(t,r)}keys(){return this._hamt.keys()}entries(){return this._hamt.entries()}get(e){return this._hamt.get(e)}has(e){return this._hamt.has(e)}set(e,t){return this._hamt.set(e,t),this}delete(e){return this._hamt.delete(e),this}clone(){return ow(this)}toMap(){return new Map(this._hamt)}}function ow(n){return Yt("recoil_hamt_2020")?new sw(n):new iq(n)}var sq={persistentMap:ow},oq=sq.persistentMap,aq=Object.freeze({__proto__:null,persistentMap:oq});function lq(n,...e){const t=new Set;e:for(const r of n){for(const i of e)if(i.has(r))continue e;t.add(r)}return t}var pf=lq;function uq(n,e){const t=new Map;return n.forEach((r,i)=>{t.set(i,e(r,i))}),t}var pg=uq;function cq(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function fq(n){return{nodeDeps:pg(n.nodeDeps,e=>new Set(e)),nodeToNodeSubscriptions:pg(n.nodeToNodeSubscriptions,e=>new Set(e))}}function t_(n,e,t,r){const{nodeDeps:i,nodeToNodeSubscriptions:s}=t,o=i.get(n);if(o&&r&&o!==r.nodeDeps.get(n))return;i.set(n,e);const a=o==null?e:pf(e,o);for(const c of a)s.has(c)||s.set(c,new Set),on(s.get(c)).add(n);if(o){const c=pf(o,e);for(const f of c){if(!s.has(f))return;const d=on(s.get(f));d.delete(n),d.size===0&&s.delete(f)}}}function dq(n,e,t,r){var i,s,o,a;const c=t.getState();r===c.currentTree.version||r===((i=c.nextTree)===null||i===void 0?void 0:i.version)||((s=c.previousTree)===null||s===void 0||s.version);const f=t.getGraph(r);if(t_(n,e,f),r===((o=c.previousTree)===null||o===void 0?void 0:o.version)){const h=t.getGraph(c.currentTree.version);t_(n,e,h,f)}if(r===((a=c.previousTree)===null||a===void 0?void 0:a.version)||r===c.currentTree.version){var d;const h=(d=c.nextTree)===null||d===void 0?void 0:d.version;if(h!==void 0){const p=t.getGraph(h);t_(n,e,p,f)}}}var Nd={cloneGraph:fq,graph:cq,saveDepsToStore:dq};let hq=0;const pq=()=>hq++;let mq=0;const gq=()=>mq++;let vq=0;const yq=()=>vq++;var c0={getNextTreeStateVersion:pq,getNextStoreID:gq,getNextComponentID:yq};const{persistentMap:pC}=aq,{graph:_q}=Nd,{getNextTreeStateVersion:eN}=c0;function tN(){const n=eN();return{version:n,stateID:n,transactionMetadata:{},dirtyAtoms:new Set,atomValues:pC(),nonvalidatedAtoms:pC()}}function xq(){const n=tN();return{currentTree:n,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(n.version,_q()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var nN={makeEmptyTreeState:tN,makeEmptyStoreState:xq,getNextTreeStateVersion:eN};class rN{}function Sq(){return new rN}var f0={RetentionZone:rN,retentionZone:Sq};function wq(n,e){const t=new Set(n);return t.add(e),t}function Mq(n,e){const t=new Set(n);return t.delete(e),t}function bq(n,e,t){const r=new Map(n);return r.set(e,t),r}function Eq(n,e,t){const r=new Map(n);return r.set(e,t(r.get(e))),r}function Tq(n,e){const t=new Map(n);return t.delete(e),t}function Cq(n,e){const t=new Map(n);return e.forEach(r=>t.delete(r)),t}var iN={setByAddingToSet:wq,setByDeletingFromSet:Mq,mapBySettingInMap:bq,mapByUpdatingInMap:Eq,mapByDeletingFromMap:Tq,mapByDeletingMultipleFromMap:Cq};function*Aq(n,e){let t=0;for(const r of n)e(r,t++)&&(yield r)}var aw=Aq;function Pq(n,e){return new Proxy(n,{get:(r,i)=>(!(i in r)&&i in e&&(r[i]=e[i]()),r[i]),ownKeys:r=>Object.keys(r)})}var sN=Pq;const{getNode:Dd,getNodeMaybe:Rq,recoilValuesForKeys:mC}=Ir,{RetentionZone:gC}=f0,{setByAddingToSet:Lq}=iN,Iq=Object.freeze(new Set);class Nq extends Error{}function Dq(n,e,t){if(!Yt("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=n.getState().retention;function i(s){let o=r.get(s);o||r.set(s,o=new Set),o.add(e)}if(t instanceof gC)i(t);else if(Array.isArray(t))for(const s of t)i(s);return()=>{if(!Yt("recoil_memory_managament_2020"))return;const{retention:s}=n.getState();function o(a){const c=s.nodesRetainedByZone.get(a);c==null||c.delete(e),c&&c.size===0&&s.nodesRetainedByZone.delete(a)}if(t instanceof gC)o(t);else if(Array.isArray(t))for(const a of t)o(a)}}function lw(n,e,t,r){const i=n.getState();if(i.nodeCleanupFunctions.has(t))return;const s=Dd(t),o=Dq(n,t,s.retainedBy),a=s.init(n,e,r);i.nodeCleanupFunctions.set(t,()=>{a(),o()})}function Oq(n,e,t){lw(n,n.getState().currentTree,e,t)}function kq(n,e){var t;const r=n.getState();(t=r.nodeCleanupFunctions.get(e))===null||t===void 0||t(),r.nodeCleanupFunctions.delete(e)}function zq(n,e,t){return lw(n,e,t,"get"),Dd(t).get(n,e)}function oN(n,e,t){return Dd(t).peek(n,e)}function Fq(n,e,t){var r;const i=Rq(e);return i==null||(r=i.invalidate)===null||r===void 0||r.call(i,n),{...n,atomValues:n.atomValues.clone().delete(e),nonvalidatedAtoms:n.nonvalidatedAtoms.clone().set(e,t),dirtyAtoms:Lq(n.dirtyAtoms,e)}}function Uq(n,e,t,r){const i=Dd(t);if(i.set==null)throw new Nq(`Attempt to set read-only RecoilValue: ${t}`);const s=i.set;return lw(n,e,t,"set"),s(n,e,r)}function Bq(n,e,t){const r=n.getState(),i=n.getGraph(e.version),s=Dd(t).nodeType;return sN({type:s},{loadable:()=>oN(n,e,t),isActive:()=>r.knownAtoms.has(t)||r.knownSelectors.has(t),isSet:()=>s==="selector"?!1:e.atomValues.has(t),isModified:()=>e.dirtyAtoms.has(t),deps:()=>{var o;return mC((o=i.nodeDeps.get(t))!==null&&o!==void 0?o:[])},subscribers:()=>{var o,a;return{nodes:mC(aw(aN(n,e,new Set([t])),c=>c!==t)),components:u0((o=(a=r.nodeToComponentSubscriptions.get(t))===null||a===void 0?void 0:a.values())!==null&&o!==void 0?o:[],([c])=>({name:c}))}}})}function aN(n,e,t){const r=new Set,i=Array.from(t),s=n.getGraph(e.version);for(let a=i.pop();a;a=i.pop()){var o;r.add(a);const c=(o=s.nodeToNodeSubscriptions.get(a))!==null&&o!==void 0?o:Iq;for(const f of c)r.has(f)||i.push(f)}return r}var Qo={getNodeLoadable:zq,peekNodeLoadable:oN,setNodeValue:Uq,initializeNode:Oq,cleanUpNode:kq,setUnvalidatedAtomValue_DEPRECATED:Fq,peekNodeInfo:Bq,getDownstreamNodes:aN};let lN=null;function Vq(n){lN=n}function Gq(){var n;(n=lN)===null||n===void 0||n()}var uN={setInvalidateMemoizedSnapshot:Vq,invalidateMemoizedSnapshot:Gq};const{getDownstreamNodes:Hq,getNodeLoadable:cN,setNodeValue:Wq}=Qo,{getNextComponentID:$q}=c0,{getNode:jq,getNodeMaybe:fN}=Ir,{DefaultValue:uw}=Ir,{reactMode:Xq}=Id,{AbstractRecoilValue:Yq,RecoilState:qq,RecoilValueReadOnly:Zq,isRecoilValue:Qq}=Ou,{invalidateMemoizedSnapshot:Kq}=uN;function Jq(n,{key:e},t=n.getState().currentTree){var r,i;const s=n.getState();t.version===s.currentTree.version||t.version===((r=s.nextTree)===null||r===void 0?void 0:r.version)||(t.version,(i=s.previousTree)===null||i===void 0||i.version);const o=cN(n,t,e);return o.state==="loading"&&o.contents.catch(()=>{}),o}function eZ(n,e){const t=n.clone();return e.forEach((r,i)=>{r.state==="hasValue"&&r.contents instanceof uw?t.delete(i):t.set(i,r)}),t}function tZ(n,e,{key:t},r){if(typeof r=="function"){const i=cN(n,e,t);if(i.state==="loading"){const s=`Tried to set atom or selector "${t}" using an updater function while the current state is pending, this is not currently supported.`;throw yt(s)}else if(i.state==="hasError")throw i.contents;return r(i.contents)}else return r}function nZ(n,e,t){if(t.type==="set"){const{recoilValue:i,valueOrUpdater:s}=t,o=tZ(n,e,i,s),a=Wq(n,e,i.key,o);for(const[c,f]of a.entries())qx(e,c,f)}else if(t.type==="setLoadable"){const{recoilValue:{key:i},loadable:s}=t;qx(e,i,s)}else if(t.type==="markModified"){const{recoilValue:{key:i}}=t;e.dirtyAtoms.add(i)}else if(t.type==="setUnvalidated"){var r;const{recoilValue:{key:i},unvalidatedValue:s}=t,o=fN(i);o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),e.atomValues.delete(i),e.nonvalidatedAtoms.set(i,s),e.dirtyAtoms.add(i)}else nw(`Unknown action ${t.type}`)}function qx(n,e,t){t.state==="hasValue"&&t.contents instanceof uw?n.atomValues.delete(e):n.atomValues.set(e,t),n.dirtyAtoms.add(e),n.nonvalidatedAtoms.delete(e)}function dN(n,e){n.replaceState(t=>{const r=hN(t);for(const i of e)nZ(n,r,i);return pN(n,r),Kq(),r})}function d0(n,e){if(mf.length){const t=mf[mf.length-1];let r=t.get(n);r||t.set(n,r=[]),r.push(e)}else dN(n,[e])}const mf=[];function rZ(){const n=new Map;return mf.push(n),()=>{for(const[e,t]of n)dN(e,t);mf.pop()}}function hN(n){return{...n,atomValues:n.atomValues.clone(),nonvalidatedAtoms:n.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(n.dirtyAtoms)}}function pN(n,e){const t=Hq(n,e,e.dirtyAtoms);for(const s of t){var r,i;(r=fN(s))===null||r===void 0||(i=r.invalidate)===null||i===void 0||i.call(r,e)}}function mN(n,e,t){d0(n,{type:"set",recoilValue:e,valueOrUpdater:t})}function iZ(n,e,t){if(t instanceof uw)return mN(n,e,t);d0(n,{type:"setLoadable",recoilValue:e,loadable:t})}function sZ(n,e){d0(n,{type:"markModified",recoilValue:e})}function oZ(n,e,t){d0(n,{type:"setUnvalidated",recoilValue:e,unvalidatedValue:t})}function aZ(n,{key:e},t,r=null){const i=$q(),s=n.getState();s.nodeToComponentSubscriptions.has(e)||s.nodeToComponentSubscriptions.set(e,new Map),on(s.nodeToComponentSubscriptions.get(e)).set(i,[r!=null?r:"<not captured>",t]);const o=Xq();if(o.early&&(o.mode==="LEGACY"||o.mode==="MUTABLE_SOURCE")){const a=n.getState().nextTree;a&&a.dirtyAtoms.has(e)&&t(a)}return{release:()=>{const a=n.getState(),c=a.nodeToComponentSubscriptions.get(e);c===void 0||!c.has(i)||(c.delete(i),c.size===0&&a.nodeToComponentSubscriptions.delete(e))}}}function lZ(n,e){var t;const{currentTree:r}=n.getState(),i=jq(e.key);(t=i.clearCache)===null||t===void 0||t.call(i,n,r)}var ms={RecoilValueReadOnly:Zq,AbstractRecoilValue:Yq,RecoilState:qq,getRecoilValueAsLoadable:Jq,setRecoilValue:mN,setRecoilValueLoadable:iZ,markRecoilValueModified:sZ,setUnvalidatedRecoilValue:oZ,subscribeToRecoilValue:aZ,isRecoilValue:Qq,applyAtomValueWrites:eZ,batchStart:rZ,writeLoadableToTreeState:qx,invalidateDownstreams:pN,copyTreeState:hN,refreshRecoilValue:lZ};function uZ(n,e,t){const r=n.entries();let i=r.next();for(;!i.done;){const s=i.value;if(e.call(t,s[1],s[0],n))return!0;i=r.next()}return!1}var cZ=uZ;const{cleanUpNode:fZ}=Qo,{deleteNodeConfigIfPossible:dZ,getNode:gN}=Ir,{RetentionZone:vN}=f0,hZ=12e4,yN=new Set;function _N(n,e){const t=n.getState(),r=t.currentTree;if(t.nextTree)return;const i=new Set;for(const o of e)if(o instanceof vN)for(const a of vZ(t,o))i.add(a);else i.add(o);const s=pZ(n,i);for(const o of s)gZ(n,r,o)}function pZ(n,e){const t=n.getState(),r=t.currentTree,i=n.getGraph(r.version),s=new Set,o=new Set;return a(e),s;function a(c){const f=new Set,d=mZ(n,r,c,s,o);for(const v of d){var h;if(gN(v).retainedBy==="recoilRoot"){o.add(v);continue}if(((h=t.retention.referenceCounts.get(v))!==null&&h!==void 0?h:0)>0){o.add(v);continue}if(xN(v).some(x=>t.retention.referenceCounts.get(x))){o.add(v);continue}const y=i.nodeToNodeSubscriptions.get(v);if(y&&cZ(y,x=>o.has(x))){o.add(v);continue}s.add(v),f.add(v)}const p=new Set;for(const v of f)for(const y of(g=i.nodeDeps.get(v))!==null&&g!==void 0?g:yN){var g;s.has(y)||p.add(y)}p.size&&a(p)}}function mZ(n,e,t,r,i){const s=n.getGraph(e.version),o=[],a=new Set;for(;t.size>0;)c(on(t.values().next().value));return o;function c(f){if(r.has(f)||i.has(f)){t.delete(f);return}if(a.has(f))return;const d=s.nodeToNodeSubscriptions.get(f);if(d)for(const h of d)c(h);a.add(f),t.delete(f),o.push(f)}}function gZ(n,e,t){if(!Yt("recoil_memory_managament_2020"))return;fZ(n,t);const r=n.getState();r.knownAtoms.delete(t),r.knownSelectors.delete(t),r.nodeTransactionSubscriptions.delete(t),r.retention.referenceCounts.delete(t);const i=xN(t);for(const c of i){var s;(s=r.retention.nodesRetainedByZone.get(c))===null||s===void 0||s.delete(t)}e.atomValues.delete(t),e.dirtyAtoms.delete(t),e.nonvalidatedAtoms.delete(t);const o=r.graphsByVersion.get(e.version);if(o){const c=o.nodeDeps.get(t);if(c!==void 0){o.nodeDeps.delete(t);for(const f of c){var a;(a=o.nodeToNodeSubscriptions.get(f))===null||a===void 0||a.delete(t)}}o.nodeToNodeSubscriptions.delete(t)}dZ(t)}function vZ(n,e){var t;return(t=n.retention.nodesRetainedByZone.get(e))!==null&&t!==void 0?t:yN}function xN(n){const e=gN(n).retainedBy;return e===void 0||e==="components"||e==="recoilRoot"?[]:e instanceof vN?[e]:e}function yZ(n,e){const t=n.getState();t.nextTree?t.retention.retainablesToCheckForRelease.add(e):_N(n,new Set([e]))}function _Z(n,e,t){var r;if(!Yt("recoil_memory_managament_2020"))return;const i=n.getState().retention.referenceCounts,s=((r=i.get(e))!==null&&r!==void 0?r:0)+t;s===0?SN(n,e):i.set(e,s)}function SN(n,e){if(!Yt("recoil_memory_managament_2020"))return;n.getState().retention.referenceCounts.delete(e),yZ(n,e)}function xZ(n){if(!Yt("recoil_memory_managament_2020"))return;const e=n.getState();_N(n,e.retention.retainablesToCheckForRelease),e.retention.retainablesToCheckForRelease.clear()}function SZ(n){return n===void 0?"recoilRoot":n}var pl={SUSPENSE_TIMEOUT_MS:hZ,updateRetainCount:_Z,updateRetainCountToZero:SN,releaseScheduledRetainablesNow:xZ,retainedByOptionWithDefault:SZ};const{unstable_batchedUpdates:wZ}=yz;var MZ={unstable_batchedUpdates:wZ};const{unstable_batchedUpdates:bZ}=MZ;var EZ={unstable_batchedUpdates:bZ};const{batchStart:TZ}=ms,{unstable_batchedUpdates:CZ}=EZ;let cw=CZ;const AZ=n=>{cw=n},PZ=()=>cw,RZ=n=>{cw(()=>{let e=()=>{};try{e=TZ(),n()}finally{e()}})};var h0={getBatcher:PZ,setBatcher:AZ,batchUpdates:RZ};function*LZ(n){for(const e of n)for(const t of e)yield t}var wN=LZ;const MN=typeof Window=="undefined"||typeof window=="undefined",IZ=n=>!MN&&(n===window||n instanceof Window),NZ=typeof navigator!="undefined"&&navigator.product==="ReactNative";var fw={isSSR:MN,isReactNative:NZ,isWindow:IZ};function DZ(n,e){let t;return(...i)=>{t||(t={});const s=e(...i);return Object.hasOwnProperty.call(t,s)||(t[s]=n(...i)),t[s]}}function OZ(n,e){let t,r;return(...s)=>{const o=e(...s);return t===o||(t=o,r=n(...s)),r}}function kZ(n,e){let t,r;return[(...o)=>{const a=e(...o);return t===a||(t=a,r=n(...o)),r},()=>{t=null}]}var zZ={memoizeWithArgsHash:DZ,memoizeOneWithArgsHash:OZ,memoizeOneWithArgsHashAndInvalidation:kZ};const{batchUpdates:Zx}=h0,{initializeNode:FZ,peekNodeInfo:UZ}=Qo,{graph:BZ}=Nd,{getNextStoreID:VZ}=c0,{DEFAULT_VALUE:GZ,recoilValues:vC,recoilValuesForKeys:yC}=Ir,{AbstractRecoilValue:HZ,getRecoilValueAsLoadable:WZ,setRecoilValue:_C,setUnvalidatedRecoilValue:$Z}=ms,{updateRetainCount:mm}=pl,{setInvalidateMemoizedSnapshot:jZ}=uN,{getNextTreeStateVersion:XZ,makeEmptyStoreState:YZ}=nN,{isSSR:qZ}=fw,{memoizeOneWithArgsHashAndInvalidation:ZZ}=zZ;class p0{constructor(e,t){pt(this,"_store",void 0),pt(this,"_refCount",1),pt(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),WZ(this._store,r))),pt(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),pt(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const o=this._store.getState().currentTree;return yC(o.dirtyAtoms)}const i=this._store.getState().knownAtoms,s=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?vC.values():r.isInitialized===!0?yC(wN([i,s])):aw(vC.values(),({key:o})=>!i.has(o)&&!s.has(o))}),pt(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),UZ(this._store,this._store.getState().currentTree,r))),pt(this,"map",r=>{this.checkRefCount_INTERNAL();const i=new Qx(this,Zx);return r(i),i}),pt(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const i=new Qx(this,Zx);return i.retain(),await r(i),i.autoRelease_INTERNAL(),i}),this._store={storeID:VZ(),parentStoreID:t,getState:()=>e,replaceState:r=>{e.currentTree=r(e.currentTree)},getGraph:r=>{const i=e.graphsByVersion;if(i.has(r))return on(i.get(r));const s=BZ();return i.set(r,s),s},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw yt("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)FZ(this._store,r,"get"),mm(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let e=!1;return()=>{e||(e=!0,this._release())}}autoRelease_INTERNAL(){qZ||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(e=>e()),this._store.getState().nodeCleanupFunctions.clear(),!Yt("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Yt("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function bN(n,e,t=!1){const r=n.getState(),i=t?XZ():e.version;return{currentTree:{version:t?i:e.version,stateID:t?i:e.stateID,transactionMetadata:{...e.transactionMetadata},dirtyAtoms:new Set(e.dirtyAtoms),atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(i,n.getGraph(e.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(u0(r.nodeCleanupFunctions.entries(),([s])=>[s,()=>{}]))}}function QZ(n){const e=new p0(YZ());return n!=null?e.map(n):e}const[xC,EN]=ZZ((n,e)=>{var t;const r=n.getState(),i=e==="latest"?(t=r.nextTree)!==null&&t!==void 0?t:r.currentTree:on(r.previousTree);return new p0(bN(n,i),n.storeID)},(n,e)=>{var t,r;return String(e)+String(n.storeID)+String((t=n.getState().nextTree)===null||t===void 0?void 0:t.version)+String(n.getState().currentTree.version)+String((r=n.getState().previousTree)===null||r===void 0?void 0:r.version)});jZ(EN);function KZ(n,e="latest"){const t=xC(n,e);return t.isRetained()?t:(EN(),xC(n,e))}class Qx extends p0{constructor(e,t){super(bN(e.getStore_INTERNAL(),e.getStore_INTERNAL().getState().currentTree,!0),e.getStoreID()),pt(this,"_batch",void 0),pt(this,"set",(r,i)=>{this.checkRefCount_INTERNAL();const s=this.getStore_INTERNAL();this._batch(()=>{mm(s,r.key,1),_C(this.getStore_INTERNAL(),r,i)})}),pt(this,"reset",r=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{mm(i,r.key,1),_C(this.getStore_INTERNAL(),r,GZ)})}),pt(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();Zx(()=>{for(const[s,o]of r.entries())mm(i,s,1),$Z(i,new HZ(s),o)})}),this._batch=t}}var m0={Snapshot:p0,MutableSnapshot:Qx,freshSnapshot:QZ,cloneSnapshot:KZ},JZ=m0.Snapshot,eQ=m0.MutableSnapshot,tQ=m0.freshSnapshot,nQ=m0.cloneSnapshot,g0=Object.freeze({__proto__:null,Snapshot:JZ,MutableSnapshot:eQ,freshSnapshot:tQ,cloneSnapshot:nQ});function rQ(...n){const e=new Set;for(const t of n)for(const r of t)e.add(r);return e}var iQ=rQ;const{useRef:sQ}=ke;function oQ(n){const e=sQ(n);return e.current===n&&typeof n=="function"&&(e.current=n()),e}var SC=oQ;const{getNextTreeStateVersion:aQ,makeEmptyStoreState:TN}=nN,{cleanUpNode:lQ,getDownstreamNodes:uQ,initializeNode:cQ,setNodeValue:fQ,setUnvalidatedAtomValue_DEPRECATED:dQ}=Qo,{graph:hQ}=Nd,{cloneGraph:pQ}=Nd,{getNextStoreID:CN}=c0,{createMutableSource:n_,reactMode:AN}=Id,{applyAtomValueWrites:mQ}=ms,{releaseScheduledRetainablesNow:PN}=pl,{freshSnapshot:gQ}=g0,{useCallback:vQ,useContext:RN,useEffect:Kx,useMemo:yQ,useRef:_Q,useState:xQ}=ke;function Gc(){throw yt("This component must be used inside a <RecoilRoot> component.")}const LN=Object.freeze({storeID:CN(),getState:Gc,replaceState:Gc,getGraph:Gc,subscribeToTransactions:Gc,addTransactionMetadata:Gc});let Jx=!1;function wC(n){if(Jx)throw yt("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const e=n.getState();if(e.nextTree===null){Yt("recoil_memory_managament_2020")&&Yt("recoil_release_on_cascading_update_killswitch_2021")&&e.commitDepth>0&&PN(n);const t=e.currentTree.version,r=aQ();e.nextTree={...e.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},e.graphsByVersion.set(r,pQ(on(e.graphsByVersion.get(t))))}}const IN=ke.createContext({current:LN}),v0=()=>RN(IN),NN=ke.createContext(null);function SQ(){return RN(NN)}function dw(n,e,t){const r=uQ(n,t,t.dirtyAtoms);for(const i of r){const s=e.nodeToComponentSubscriptions.get(i);if(s)for(const[o,[a,c]]of s)c(t)}}function DN(n){const e=n.getState(),t=e.currentTree,r=t.dirtyAtoms;if(r.size){for(const[i,s]of e.nodeTransactionSubscriptions)if(r.has(i))for(const[o,a]of s)a(n);for(const[i,s]of e.transactionSubscriptions)s(n);(!AN().early||e.suspendedComponentResolvers.size>0)&&(dw(n,e,t),e.suspendedComponentResolvers.forEach(i=>i()),e.suspendedComponentResolvers.clear())}e.queuedComponentCallbacks_DEPRECATED.forEach(i=>i(t)),e.queuedComponentCallbacks_DEPRECATED.splice(0,e.queuedComponentCallbacks_DEPRECATED.length)}function wQ(n){const e=n.getState();e.commitDepth++;try{const{nextTree:t}=e;if(t==null)return;e.previousTree=e.currentTree,e.currentTree=t,e.nextTree=null,DN(n),e.previousTree!=null?e.graphsByVersion.delete(e.previousTree.version):nw("Ended batch with no previous state, which is unexpected","recoil"),e.previousTree=null,Yt("recoil_memory_managament_2020")&&t==null&&PN(n)}finally{e.commitDepth--}}function MQ({setNotifyBatcherOfChange:n}){const e=v0(),[,t]=xQ([]);return n(()=>t({})),Kx(()=>(n(()=>t({})),()=>{n(()=>{})}),[n]),Kx(()=>{tq.enqueueExecution("Batcher",()=>{wQ(e.current)})}),null}function bQ(n,e){const t=TN();return e({set:(r,i)=>{const s=t.currentTree,o=fQ(n,s,r.key,i),a=new Set(o.keys()),c=s.nonvalidatedAtoms.clone();for(const f of a)c.delete(f);t.currentTree={...s,dirtyAtoms:iQ(s.dirtyAtoms,a),atomValues:mQ(s.atomValues,o),nonvalidatedAtoms:c}},setUnvalidatedAtomValues:r=>{r.forEach((i,s)=>{t.currentTree=dQ(t.currentTree,s,i)})}}),t}function EQ(n){const e=gQ(n),t=e.getStore_INTERNAL().getState();return e.retain(),t.nodeCleanupFunctions.forEach(r=>r()),t.nodeCleanupFunctions.clear(),t}let MC=0;function TQ({initializeState_DEPRECATED:n,initializeState:e,store_INTERNAL:t,children:r}){let i;const s=g=>{const v=i.current.graphsByVersion;if(v.has(g))return on(v.get(g));const y=hQ();return v.set(g,y),y},o=(g,v)=>{if(v==null){const{transactionSubscriptions:y}=h.current.getState(),x=MC++;return y.set(x,g),{release:()=>{y.delete(x)}}}else{const{nodeTransactionSubscriptions:y}=h.current.getState();y.has(v)||y.set(v,new Map);const x=MC++;return on(y.get(v)).set(x,g),{release:()=>{const w=y.get(v);w&&(w.delete(x),w.size===0&&y.delete(v))}}}},a=g=>{wC(h.current);for(const v of Object.keys(g))on(h.current.getState().nextTree).transactionMetadata[v]=g[v]},c=g=>{wC(h.current);const v=on(i.current.nextTree);let y;try{Jx=!0,y=g(v)}finally{Jx=!1}y!==v&&(i.current.nextTree=y,AN().early&&dw(h.current,i.current,y),on(f.current)())},f=_Q(null),d=vQ(g=>{f.current=g},[f]),h=SC(()=>t!=null?t:{storeID:CN(),getState:()=>i.current,replaceState:c,getGraph:s,subscribeToTransactions:o,addTransactionMetadata:a});t!=null&&(h.current=t),i=SC(()=>n!=null?bQ(h.current,n):e!=null?EQ(e):TN());const p=yQ(()=>n_==null?void 0:n_(i,()=>i.current.currentTree.version),[i]);return Kx(()=>{const g=h.current;for(const v of new Set(g.getState().knownAtoms))cQ(g,v,"get");return()=>{for(const v of g.getState().knownAtoms)lQ(g,v)}},[h]),ke.createElement(IN.Provider,{value:h},ke.createElement(NN.Provider,{value:p},ke.createElement(MQ,{setNotifyBatcherOfChange:d}),r))}function CQ(n){const{override:e,...t}=n,r=v0();return e===!1&&r.current!==LN?n.children:ke.createElement(TQ,t)}function AQ(){return v0().current.storeID}var Ks={RecoilRoot:CQ,useStoreRef:v0,useRecoilMutableSource:SQ,useRecoilStoreID:AQ,notifyComponents_FOR_TESTING:dw,sendEndOfBatchNotifications_FOR_TESTING:DN};function PQ(n,e){if(n===e)return!0;if(n.length!==e.length)return!1;for(let t=0,r=n.length;t<r;t++)if(n[t]!==e[t])return!1;return!0}var RQ=PQ;const{useEffect:LQ,useRef:IQ}=ke;function NQ(n){const e=IQ();return LQ(()=>{e.current=n}),e.current}var ON=NQ;const{useStoreRef:DQ}=Ks,{SUSPENSE_TIMEOUT_MS:OQ}=pl,{updateRetainCount:Hc}=pl,{RetentionZone:kQ}=f0,{useEffect:zQ,useRef:FQ}=ke,{isSSR:bC}=fw;function UQ(n){if(!!Yt("recoil_memory_managament_2020"))return BQ(n)}function BQ(n){const t=(Array.isArray(n)?n:[n]).map(o=>o instanceof kQ?o:o.key),r=DQ();zQ(()=>{if(!Yt("recoil_memory_managament_2020"))return;const o=r.current;if(i.current&&!bC)window.clearTimeout(i.current),i.current=null;else for(const a of t)Hc(o,a,1);return()=>{for(const a of t)Hc(o,a,-1)}},[r,...t]);const i=FQ(),s=ON(t);if(!bC&&(s===void 0||!RQ(s,t))){const o=r.current;for(const a of t)Hc(o,a,1);if(s)for(const a of s)Hc(o,a,-1);i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null;for(const a of t)Hc(o,a,-1)},OQ)}}var hw=UQ;function VQ(){return"<component name not available>"}var Od=VQ;const{batchUpdates:GQ}=h0,{DEFAULT_VALUE:kN}=Ir,{currentRendererSupportsUseSyncExternalStore:HQ,reactMode:Zu,useMutableSource:WQ,useSyncExternalStore:$Q}=Id,{useRecoilMutableSource:jQ,useStoreRef:gs}=Ks,{AbstractRecoilValue:e1,getRecoilValueAsLoadable:kd,setRecoilValue:mg,setUnvalidatedRecoilValue:XQ,subscribeToRecoilValue:ku}=ms,{useCallback:Rr,useEffect:zu,useMemo:zN,useRef:gf,useState:pw}=ke,{setByAddingToSet:YQ}=iN;function mw(n,e,t){if(n.state==="hasValue")return n.contents;throw n.state==="loading"?new Promise(i=>{t.current.getState().suspendedComponentResolvers.add(i)}):n.state==="hasError"?n.contents:yt(`Invalid value of loadable atom "${e.key}"`)}function qQ(){const n=Od(),e=gs(),[,t]=pw([]),r=gf(new Set);r.current=new Set;const i=gf(new Set),s=gf(new Map),o=Rr(c=>{const f=s.current.get(c);f&&(f.release(),s.current.delete(c))},[s]),a=Rr((c,f)=>{s.current.has(f)&&t([])},[]);return zu(()=>{const c=e.current;pf(r.current,i.current).forEach(f=>{if(s.current.has(f))return;const d=ku(c,new e1(f),p=>a(p,f),n);s.current.set(f,d),c.getState().nextTree?c.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a(c.getState(),f)}):a(c.getState(),f)}),pf(i.current,r.current).forEach(f=>{o(f)}),i.current=r.current}),zu(()=>{const c=s.current;return pf(r.current,new Set(c.keys())).forEach(f=>{const d=ku(e.current,new e1(f),h=>a(h,f),n);c.set(f,d)}),()=>c.forEach((f,d)=>o(d))},[n,e,o,a]),zN(()=>{function c(v){return y=>{mg(e.current,v,y)}}function f(v){return()=>mg(e.current,v,kN)}function d(v){var y;r.current.has(v.key)||(r.current=YQ(r.current,v.key));const x=e.current.getState();return kd(e.current,v,Zu().early&&(y=x.nextTree)!==null&&y!==void 0?y:x.currentTree)}function h(v){const y=d(v);return mw(y,v,e)}function p(v){return[h(v),c(v)]}function g(v){return[d(v),c(v)]}return{getRecoilValue:h,getRecoilValueLoadable:d,getRecoilState:p,getRecoilStateLoadable:g,getSetRecoilState:c,getResetRecoilState:f}},[r,e])}const ZQ={current:0};function QQ(n){const e=gs(),t=Od(),r=Rr(()=>{var a;const c=e.current,f=c.getState(),d=Zu().early&&(a=f.nextTree)!==null&&a!==void 0?a:f.currentTree;return{loadable:kd(c,n,d),key:n.key}},[e,n]),i=Rr(a=>{let c;return()=>{var f,d;const h=a();return(f=c)!==null&&f!==void 0&&f.loadable.is(h.loadable)&&((d=c)===null||d===void 0?void 0:d.key)===h.key?c:(c=h,h)}},[]),s=zN(()=>i(r),[r,i]),o=Rr(a=>{const c=e.current;return ku(c,n,a,t).release},[e,n,t]);return $Q(o,s,s).loadable}function KQ(n){const e=gs(),t=Rr(()=>{var f;const d=e.current,h=d.getState(),p=Zu().early&&(f=h.nextTree)!==null&&f!==void 0?f:h.currentTree;return kd(d,n,p)},[e,n]),r=Rr(()=>t(),[t]),i=Od(),s=Rr((f,d)=>{const h=e.current;return ku(h,n,()=>{if(!Yt("recoil_suppress_rerender_in_callback"))return d();const g=t();c.current.is(g)||d(),c.current=g},i).release},[e,n,i,t]),o=jQ();if(o==null)throw yt("Recoil hooks must be used in components contained within a <RecoilRoot> component.");const a=WQ(o,r,s),c=gf(a);return zu(()=>{c.current=a}),a}function t1(n){const e=gs(),t=Od(),r=Rr(()=>{var c;const f=e.current,d=f.getState(),h=Zu().early&&(c=d.nextTree)!==null&&c!==void 0?c:d.currentTree;return kd(f,n,h)},[e,n]),i=Rr(()=>({loadable:r(),key:n.key}),[r,n.key]),s=Rr(c=>{const f=i();return c.loadable.is(f.loadable)&&c.key===f.key?c:f},[i]);zu(()=>{const c=ku(e.current,n,f=>{a(s)},t);return a(s),c.release},[t,n,e,s]);const[o,a]=pw(i);return o.key!==n.key?i().loadable:o.loadable}function JQ(n){const e=gs(),[,t]=pw([]),r=Od(),i=Rr(()=>{var a;const c=e.current,f=c.getState(),d=Zu().early&&(a=f.nextTree)!==null&&a!==void 0?a:f.currentTree;return kd(c,n,d)},[e,n]),s=i(),o=gf(s);return zu(()=>{o.current=s}),zu(()=>{const a=e.current,c=a.getState(),f=ku(a,n,h=>{var p;if(!Yt("recoil_suppress_rerender_in_callback"))return t([]);const g=i();(p=o.current)!==null&&p!==void 0&&p.is(g)||t(g),o.current=g},r);if(c.nextTree)a.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{o.current=null,t([])});else{var d;if(!Yt("recoil_suppress_rerender_in_callback"))return t([]);const h=i();(d=o.current)!==null&&d!==void 0&&d.is(h)||t(h),o.current=h}return f.release},[r,i,n,e]),s}function gw(n){return Yt("recoil_memory_managament_2020")&&hw(n),{TRANSITION_SUPPORT:t1,SYNC_EXTERNAL_STORE:HQ()?QQ:t1,MUTABLE_SOURCE:KQ,LEGACY:JQ}[Zu().mode](n)}function FN(n){const e=gs(),t=gw(n);return mw(t,n,e)}function y0(n){const e=gs();return Rr(t=>{mg(e.current,n,t)},[e,n])}function eK(n){const e=gs();return Rr(()=>{mg(e.current,n,kN)},[e,n])}function tK(n){return[FN(n),y0(n)]}function nK(n){return[gw(n),y0(n)]}function rK(){const n=gs();return(e,t={})=>{GQ(()=>{n.current.addTransactionMetadata(t),e.forEach((r,i)=>XQ(n.current,new e1(i),r))})}}function UN(n){return Yt("recoil_memory_managament_2020")&&hw(n),t1(n)}function BN(n){const e=gs(),t=UN(n);return mw(t,n,e)}function iK(n){return[BN(n),y0(n)]}var sK={recoilComponentGetRecoilValueCount_FOR_TESTING:ZQ,useRecoilInterface:qQ,useRecoilState:tK,useRecoilStateLoadable:nK,useRecoilValue:FN,useRecoilValueLoadable:gw,useResetRecoilState:eK,useSetRecoilState:y0,useSetUnvalidatedAtomValues:rK,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:UN,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:BN,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:iK};function oK(n,e){const t=new Map;for(const[r,i]of n)e(i,r)&&t.set(r,i);return t}var aK=oK;function lK(n,e){const t=new Set;for(const r of n)e(r)&&t.add(r);return t}var uK=lK;function cK(...n){const e=new Map;for(let t=0;t<n.length;t++){const r=n[t].keys();let i;for(;!(i=r.next()).done;)e.set(i.value,n[t].get(i.value))}return e}var fK=cK;const{batchUpdates:dK}=h0,{DEFAULT_VALUE:hK,getNode:VN,nodes:pK}=Ir,{useStoreRef:vw}=Ks,{AbstractRecoilValue:mK,setRecoilValueLoadable:gK}=ms,{SUSPENSE_TIMEOUT_MS:vK}=pl,{cloneSnapshot:gg}=g0,{useCallback:_0,useEffect:GN,useRef:EC,useState:yK}=ke,{isSSR:TC}=fw;function x0(n){const e=vw();GN(()=>e.current.subscribeToTransactions(n).release,[n,e])}function CC(n){const e=n.atomValues.toMap(),t=pg(aK(e,(r,i)=>{const o=VN(i).persistence_UNSTABLE;return o!=null&&o.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return fK(n.nonvalidatedAtoms.toMap(),t)}function _K(n){x0(_0(e=>{let t=e.getState().previousTree;const r=e.getState().currentTree;t||(t=e.getState().currentTree);const i=CC(r),s=CC(t),o=pg(pK,c=>{var f,d,h,p;return{persistence_UNSTABLE:{type:(f=(d=c.persistence_UNSTABLE)===null||d===void 0?void 0:d.type)!==null&&f!==void 0?f:"none",backButton:(h=(p=c.persistence_UNSTABLE)===null||p===void 0?void 0:p.backButton)!==null&&h!==void 0?h:!1}}}),a=uK(r.dirtyAtoms,c=>i.has(c)||s.has(c));n({atomValues:i,previousAtomValues:s,atomInfo:o,modifiedAtoms:a,transactionMetadata:{...r.transactionMetadata}})},[n]))}function xK(n){x0(_0(e=>{const t=gg(e,"latest"),r=gg(e,"previous");n({snapshot:t,previousSnapshot:r})},[n]))}function SK(){const n=vw(),[e,t]=yK(()=>gg(n.current)),r=ON(e),i=EC(),s=EC();if(x0(_0(a=>t(gg(a)),[])),GN(()=>{const a=e.retain();if(i.current&&!TC){var c;window.clearTimeout(i.current),i.current=null,(c=s.current)===null||c===void 0||c.call(s),s.current=null}return()=>{window.setTimeout(a,10)}},[e]),r!==e&&!TC){if(i.current){var o;window.clearTimeout(i.current),i.current=null,(o=s.current)===null||o===void 0||o.call(s),s.current=null}s.current=e.retain(),i.current=window.setTimeout(()=>{var a;i.current=null,(a=s.current)===null||a===void 0||a.call(s),s.current=null},vK)}return e}function HN(n,e){var t;const r=n.getState(),i=(t=r.nextTree)!==null&&t!==void 0?t:r.currentTree,s=e.getStore_INTERNAL().getState().currentTree;dK(()=>{const o=new Set;for(const f of[i.atomValues.keys(),s.atomValues.keys()])for(const d of f){var a,c;((a=i.atomValues.get(d))===null||a===void 0?void 0:a.contents)!==((c=s.atomValues.get(d))===null||c===void 0?void 0:c.contents)&&VN(d).shouldRestoreFromSnapshots&&o.add(d)}o.forEach(f=>{gK(n,new mK(f),s.atomValues.has(f)?on(s.atomValues.get(f)):hK)}),n.replaceState(f=>({...f,stateID:e.getID()}))})}function wK(){const n=vw();return _0(e=>HN(n.current,e),[n])}var WN={useRecoilSnapshot:SK,gotoSnapshot:HN,useGotoRecoilSnapshot:wK,useRecoilTransactionObserver:xK,useTransactionObservation_DEPRECATED:_K,useTransactionSubscription_DEPRECATED:x0};const{peekNodeInfo:MK}=Qo,{useStoreRef:bK}=Ks;function EK(){const n=bK();return({key:e})=>MK(n.current,n.current.getState().currentTree,e)}var TK=EK;const{reactMode:CK}=Id,{RecoilRoot:AK,useStoreRef:PK}=Ks,{useMemo:RK}=ke;function LK(){CK().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const n=PK().current;return RK(()=>{function e({children:t}){return ke.createElement(AK,{store_INTERNAL:n},t)}return e},[n])}var IK=LK;const{loadableWithValue:NK}=Ld,{initializeNode:DK}=Qo,{DEFAULT_VALUE:OK,getNode:kK}=Ir,{copyTreeState:zK,getRecoilValueAsLoadable:FK,invalidateDownstreams:UK,writeLoadableToTreeState:BK}=ms;function AC(n){return kK(n.key).nodeType==="atom"}class VK{constructor(e,t){pt(this,"_store",void 0),pt(this,"_treeState",void 0),pt(this,"_changes",void 0),pt(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!AC(r))throw yt("Reading selectors within atomicUpdate is not supported");const i=FK(this._store,r,this._treeState);if(i.state==="hasValue")return i.contents;throw i.state==="hasError"?i.contents:yt(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),pt(this,"set",(r,i)=>{if(!AC(r))throw yt("Setting selectors within atomicUpdate is not supported");if(typeof i=="function"){const s=this.get(r);this._changes.set(r.key,i(s))}else DK(this._store,r.key,"set"),this._changes.set(r.key,i)}),pt(this,"reset",r=>{this.set(r,OK)}),this._store=e,this._treeState=t,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const e=zK(this._treeState);for(const[t,r]of this._changes)BK(e,t,NK(r));return UK(this._store,e),e}}function GK(n){return e=>{n.replaceState(t=>{const r=new VK(n,t);return e(r),r.newTreeState_INTERNAL()})}}var HK={atomicUpdater:GK},WK=HK.atomicUpdater,$N=Object.freeze({__proto__:null,atomicUpdater:WK});function $K(n,e){if(!n)throw new Error(e)}var jK=$K,Jc=jK;const{atomicUpdater:XK}=$N,{batchUpdates:YK}=h0,{DEFAULT_VALUE:qK}=Ir,{useStoreRef:ZK}=Ks,{refreshRecoilValue:QK,setRecoilValue:PC}=ms,{cloneSnapshot:KK}=g0,{gotoSnapshot:JK}=WN,{useCallback:eJ}=ke;class jN{}const tJ=new jN;function XN(n,e,t,r){let i=tJ,s;if(YK(()=>{const a="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof e!="function")throw yt(a);const c=sN({...r!=null?r:{},set:(d,h)=>PC(n,d,h),reset:d=>PC(n,d,qK),refresh:d=>QK(n,d),gotoSnapshot:d=>JK(n,d),transact_UNSTABLE:d=>XK(n)(d)},{snapshot:()=>{const d=KK(n);return s=d.retain(),d}}),f=e(c);if(typeof f!="function")throw yt(a);i=f(...t)}),i instanceof jN&&Jc(!1),sn(i))i.finally(()=>{var a;(a=s)===null||a===void 0||a()});else{var o;(o=s)===null||o===void 0||o()}return i}function nJ(n,e){const t=ZK();return eJ((...r)=>XN(t.current,n,r),e!=null?[...e,t]:void 0)}var YN={recoilCallback:XN,useRecoilCallback:nJ};const{useStoreRef:rJ}=Ks,{refreshRecoilValue:iJ}=ms,{useCallback:sJ}=ke;function oJ(n){const e=rJ();return sJ(()=>{const t=e.current;iJ(t,n)},[n,e])}var aJ=oJ;const{atomicUpdater:lJ}=$N,{useStoreRef:uJ}=Ks,{useMemo:cJ}=ke;function fJ(n,e){const t=uJ();return cJ(()=>(...r)=>{lJ(t.current)(s=>{n(s)(...r)})},e!=null?[...e,t]:void 0)}var dJ=fJ;class hJ{constructor(e){pt(this,"value",void 0),this.value=e}}var pJ={WrappedValue:hJ},mJ=pJ.WrappedValue,qN=Object.freeze({__proto__:null,WrappedValue:mJ});const{isFastRefreshEnabled:gJ}=Id;class RC extends Error{}class vJ{constructor(e){var t,r,i;pt(this,"_name",void 0),pt(this,"_numLeafs",void 0),pt(this,"_root",void 0),pt(this,"_onHit",void 0),pt(this,"_onSet",void 0),pt(this,"_mapNodeValue",void 0),this._name=e==null?void 0:e.name,this._numLeafs=0,this._root=null,this._onHit=(t=e==null?void 0:e.onHit)!==null&&t!==void 0?t:()=>{},this._onSet=(r=e==null?void 0:e.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(i=e==null?void 0:e.mapNodeValue)!==null&&i!==void 0?i:s=>s}size(){return this._numLeafs}root(){return this._root}get(e,t){var r;return(r=this.getLeafNode(e,t))===null||r===void 0?void 0:r.value}getLeafNode(e,t){if(this._root==null)return;let r=this._root;for(;r;){if(t==null||t.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const i=this._mapNodeValue(e(r.nodeKey));r=r.branches.get(i)}}set(e,t,r){const i=()=>{var s,o,a,c;let f,d;for(const[x,w]of e){var h,p,g;const _=this._root;if((_==null?void 0:_.type)==="leaf")throw this.invalidCacheError();const M=f;if(f=M?M.branches.get(d):_,f=(h=f)!==null&&h!==void 0?h:{type:"branch",nodeKey:x,parent:M,branches:new Map,branchKey:d},f.type!=="branch"||f.nodeKey!==x)throw this.invalidCacheError();M==null||M.branches.set(d,f),r==null||(p=r.onNodeVisit)===null||p===void 0||p.call(r,f),d=this._mapNodeValue(w),this._root=(g=this._root)!==null&&g!==void 0?g:f}const v=f?(s=f)===null||s===void 0?void 0:s.branches.get(d):this._root;if(v!=null&&(v.type!=="leaf"||v.branchKey!==d))throw this.invalidCacheError();const y={type:"leaf",value:t,parent:f,branchKey:d};(o=f)===null||o===void 0||o.branches.set(d,y),this._root=(a=this._root)!==null&&a!==void 0?a:y,this._numLeafs++,this._onSet(y),r==null||(c=r.onNodeVisit)===null||c===void 0||c.call(r,y)};try{i()}catch(s){if(s instanceof RC)this.clear(),i();else throw s}}delete(e){const t=this.root();if(!t)return!1;if(e===t)return this._root=null,this._numLeafs=0,!0;let r=e.parent,i=e.branchKey;for(;r;){var s;if(r.branches.delete(i),r===t)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;i=(s=r)===null||s===void 0?void 0:s.branchKey,r=r.parent}for(;r!==t;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const e=gJ()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw nw(e+(this._name!=null?` - ${this._name}`:"")),new RC}}var yJ={TreeCache:vJ},_J=yJ.TreeCache,ZN=Object.freeze({__proto__:null,TreeCache:_J});class xJ{constructor(e){var t;pt(this,"_maxSize",void 0),pt(this,"_size",void 0),pt(this,"_head",void 0),pt(this,"_tail",void 0),pt(this,"_map",void 0),pt(this,"_keyMapper",void 0),this._maxSize=e.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(t=e.mapKey)!==null&&t!==void 0?t:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(e){return this._map.has(this._keyMapper(e))}get(e){const t=this._keyMapper(e),r=this._map.get(t);if(!!r)return this.set(e,r.value),r.value}set(e,t){const r=this._keyMapper(e);this._map.get(r)&&this.delete(e);const s=this.head(),o={key:e,right:s,left:null,value:t};s?s.left=o:this._tail=o,this._map.set(r,o),this._head=o,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const e=this.tail();e&&this.delete(e.key)}delete(e){const t=this._keyMapper(e);if(!this._size||!this._map.has(t))return;const r=on(this._map.get(t)),i=r.right,s=r.left;i&&(i.left=r.left),s&&(s.right=r.right),r===this.head()&&(this._head=i),r===this.tail()&&(this._tail=s),this._map.delete(t),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var SJ={LRUCache:xJ},wJ=SJ.LRUCache,QN=Object.freeze({__proto__:null,LRUCache:wJ});const{LRUCache:MJ}=QN,{TreeCache:bJ}=ZN;function EJ({name:n,maxSize:e,mapNodeValue:t=r=>r}){const r=new MJ({maxSize:e}),i=new bJ({name:n,mapNodeValue:t,onHit:s=>{r.set(s,!0)},onSet:s=>{const o=r.tail();r.set(s,!0),o&&i.size()>e&&i.delete(o.key)}});return i}var LC=EJ;function Li(n,e,t){if(typeof n=="string"&&!n.includes('"')&&!n.includes("\\"))return`"${n}"`;switch(typeof n){case"undefined":return"";case"boolean":return n?"true":"false";case"number":case"symbol":return String(n);case"string":return JSON.stringify(n);case"function":if((e==null?void 0:e.allowFunctions)!==!0)throw yt("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${n.name})__`}if(n===null)return"null";if(typeof n!="object"){var r;return(r=JSON.stringify(n))!==null&&r!==void 0?r:""}if(sn(n))return"__PROMISE__";if(Array.isArray(n))return`[${n.map((i,s)=>Li(i,e,s.toString()))}]`;if(typeof n.toJSON=="function")return Li(n.toJSON(t),e,t);if(n instanceof Map){const i={};for(const[s,o]of n)i[typeof s=="string"?s:Li(s,e)]=o;return Li(i,e,t)}return n instanceof Set?Li(Array.from(n).sort((i,s)=>Li(i,e).localeCompare(Li(s,e))),e,t):Symbol!==void 0&&n[Symbol.iterator]!=null&&typeof n[Symbol.iterator]=="function"?Li(Array.from(n),e,t):`{${Object.keys(n).filter(i=>n[i]!==void 0).sort().map(i=>`${Li(i,e)}:${Li(n[i],e,i)}`).join(",")}}`}function TJ(n,e={allowFunctions:!1}){return Li(n,e)}var S0=TJ;const{TreeCache:CJ}=ZN,Bp={equality:"reference",eviction:"keep-all",maxSize:1/0};function AJ({equality:n=Bp.equality,eviction:e=Bp.eviction,maxSize:t=Bp.maxSize}=Bp,r){const i=PJ(n);return RJ(e,t,i,r)}function PJ(n){switch(n){case"reference":return e=>e;case"value":return e=>S0(e)}throw yt(`Unrecognized equality policy ${n}`)}function RJ(n,e,t,r){switch(n){case"keep-all":return new CJ({name:r,mapNodeValue:t});case"lru":return LC({name:r,maxSize:on(e),mapNodeValue:t});case"most-recent":return LC({name:r,maxSize:1,mapNodeValue:t})}throw yt(`Unrecognized eviction policy ${n}`)}var LJ=AJ;function IJ(n){return()=>null}var NJ={startPerfBlock:IJ};const{isLoadable:DJ,loadableWithError:Vp,loadableWithPromise:OJ,loadableWithValue:r_}=Ld,{WrappedValue:KN}=qN,{getNodeLoadable:Gp,peekNodeLoadable:kJ,setNodeValue:zJ}=Qo,{saveDepsToStore:FJ}=Nd,{DEFAULT_VALUE:UJ,getConfigDeletionHandler:BJ,getNode:VJ,registerNode:IC}=Ir,{isRecoilValue:GJ}=Ou,{markRecoilValueModified:NC}=ms,{retainedByOptionWithDefault:HJ}=pl,{recoilCallback:WJ}=YN,{startPerfBlock:$J}=NJ;class JN{}const Wc=new JN,$c=[],Hp=new Map,jJ=(()=>{let n=0;return()=>n++})();function eD(n){let e=null;const{key:t,get:r,cachePolicy_UNSTABLE:i}=n,s=n.set!=null?n.set:void 0,o=new Set,a=LJ(i!=null?i:{equality:"reference",eviction:"keep-all"},t),c=HJ(n.retainedBy_UNSTABLE),f=new Map;let d=0;function h(){return!Yt("recoil_memory_managament_2020")||d>0}function p(k){return k.getState().knownSelectors.add(t),d++,()=>{d--}}function g(){return BJ(t)!==void 0&&!h()}function v(k,W,N,me,X){le(W,me,X),y(k,N)}function y(k,W){$(k,W)&&q(k),w(W,!0)}function x(k,W){$(k,W)&&(on(D(k)).stateVersions.clear(),w(W,!1))}function w(k,W){const N=Hp.get(k);if(N!=null){for(const me of N)NC(me,on(e));W&&Hp.delete(k)}}function _(k,W){let N=Hp.get(W);N==null&&Hp.set(W,N=new Set),N.add(k)}function M(k,W,N,me,X,Te){return W.then(Ce=>{if(!h())throw q(k),Wc;const we=r_(Ce);return v(k,N,X,we,me),Ce}).catch(Ce=>{if(!h())throw q(k),Wc;if(sn(Ce))return E(k,Ce,N,me,X,Te);const we=Vp(Ce);throw v(k,N,X,we,me),Ce})}function E(k,W,N,me,X,Te){return W.then(Ce=>{if(!h())throw q(k),Wc;Te.loadingDepKey!=null&&Te.loadingDepPromise===W?N.atomValues.set(Te.loadingDepKey,r_(Ce)):k.getState().knownSelectors.forEach(ue=>{N.atomValues.delete(ue)});const we=R(k,N);if(we&&we.state!=="loading"){if(($(k,X)||D(k)==null)&&y(k,X),we.state==="hasValue")return we.contents;throw we.contents}if(!$(k,X)){const ue=L(k,N);if(ue!=null)return ue.loadingLoadable.contents}const[be,He]=P(k,N,X);if(be.state!=="loading"&&v(k,N,X,be,He),be.state==="hasError")throw be.contents;return be.contents}).catch(Ce=>{if(Ce instanceof JN)throw Wc;if(!h())throw q(k),Wc;const we=Vp(Ce);throw v(k,N,X,we,me),Ce})}function C(k,W,N,me){var X,Te,Ce,we;if($(k,me)||W.version===((X=k.getState())===null||X===void 0||(Te=X.currentTree)===null||Te===void 0?void 0:Te.version)||W.version===((Ce=k.getState())===null||Ce===void 0||(we=Ce.nextTree)===null||we===void 0?void 0:we.version)){var be,He,ue;FJ(t,N,k,(be=(He=k.getState())===null||He===void 0||(ue=He.nextTree)===null||ue===void 0?void 0:ue.version)!==null&&be!==void 0?be:k.getState().currentTree.version)}for(const ne of N)o.add(ne)}function P(k,W,N){const me=$J(t);let X=!0,Te=!0;const Ce=()=>{me(),Te=!1};let we,be=!1,He;const ue={loadingDepKey:null,loadingDepPromise:null},ne=new Map;function Ee({key:Le}){const qe=Gp(k,W,Le);switch(ne.set(Le,qe),X||(C(k,W,new Set(ne.keys()),N),x(k,N)),qe.state){case"hasValue":return qe.contents;case"hasError":throw qe.contents;case"loading":throw ue.loadingDepKey=Le,ue.loadingDepPromise=qe.contents,qe.contents}throw yt("Invalid Loadable state")}const Ue=Le=>(...qe)=>{if(Te)throw yt("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return e==null&&Jc(!1),WJ(k,Le,qe,{node:e})};try{we=r({get:Ee,getCallback:Ue}),we=GJ(we)?Ee(we):we,DJ(we)&&(we.state==="hasError"&&(be=!0),we=we.contents),sn(we)?we=M(k,we,W,ne,N,ue).finally(Ce):Ce(),we=we instanceof KN?we.value:we}catch(Le){we=Le,sn(we)?we=E(k,we,W,ne,N,ue).finally(Ce):(be=!0,Ce())}return be?He=Vp(we):sn(we)?He=OJ(we):He=r_(we),X=!1,fe(k,N,ne),C(k,W,new Set(ne.keys()),N),[He,ne]}function R(k,W){let N=W.atomValues.get(t);if(N!=null)return N;const me=new Set;try{N=a.get(Te=>(typeof Te!="string"&&Jc(!1),Gp(k,W,Te).contents),{onNodeVisit:Te=>{Te.type==="branch"&&Te.nodeKey!==t&&me.add(Te.nodeKey)}})}catch(Te){throw yt(`Problem with cache lookup for selector "${t}": ${Te.message}`)}if(N){var X;W.atomValues.set(t,N),C(k,W,me,(X=D(k))===null||X===void 0?void 0:X.executionID)}return N}function T(k,W){const N=R(k,W);if(N!=null)return q(k),N;const me=L(k,W);if(me!=null){var X;return((X=me.loadingLoadable)===null||X===void 0?void 0:X.state)==="loading"&&_(k,me.executionID),me.loadingLoadable}const Te=jJ(),[Ce,we]=P(k,W,Te);return Ce.state==="loading"?(Y(k,Te,Ce,we,W),_(k,Te)):(q(k),le(W,Ce,we)),Ce}function L(k,W){const N=wN([f.has(k)?[on(f.get(k))]:[],u0(aw(f,([X])=>X!==k),([,X])=>X)]);function me(X){for(const[Te,Ce]of X)if(!Gp(k,W,Te).is(Ce))return!0;return!1}for(const X of N){if(X.stateVersions.get(W.version)||!me(X.depValuesDiscoveredSoFarDuringAsyncWork))return X.stateVersions.set(W.version,!0),X;X.stateVersions.set(W.version,!1)}}function D(k){return f.get(k)}function Y(k,W,N,me,X){f.set(k,{depValuesDiscoveredSoFarDuringAsyncWork:me,executionID:W,loadingLoadable:N,stateVersions:new Map([[X.version,!0]])})}function fe(k,W,N){if($(k,W)){const me=D(k);me!=null&&(me.depValuesDiscoveredSoFarDuringAsyncWork=N)}}function q(k){f.delete(k)}function $(k,W){var N;return W===((N=D(k))===null||N===void 0?void 0:N.executionID)}function se(k){return Array.from(k.entries()).map(([W,N])=>[W,N.contents])}function le(k,W,N){k.atomValues.set(t,W);try{a.set(se(N),W)}catch(me){throw yt(`Problem with setting cache for selector "${t}": ${me.message}`)}}function pe(k){if($c.includes(t)){const W=`Recoil selector has circular dependencies: ${$c.slice($c.indexOf(t)).join(" \u2192 ")}`;return Vp(yt(W))}$c.push(t);try{return k()}finally{$c.pop()}}function z(k,W){const N=W.atomValues.get(t);return N!=null?N:a.get(me=>{var X;return typeof me!="string"&&Jc(!1),(X=kJ(k,W,me))===null||X===void 0?void 0:X.contents})}function F(k,W){return pe(()=>T(k,W))}function G(k){k.atomValues.delete(t)}function Z(k,W){e==null&&Jc(!1);for(const me of o){var N;const X=VJ(me);(N=X.clearCache)===null||N===void 0||N.call(X,k,W)}o.clear(),G(W),a.clear(),NC(k,e)}return s!=null?e=IC({key:t,nodeType:"selector",peek:z,get:F,set:(W,N,me)=>{let X=!1;const Te=new Map;function Ce({key:ue}){if(X)throw yt("Recoil: Async selector sets are not currently supported.");const ne=Gp(W,N,ue);if(ne.state==="hasValue")return ne.contents;if(ne.state==="loading"){const Ee=`Getting value of asynchronous atom or selector "${ue}" in a pending state while setting selector "${t}" is not yet supported.`;throw yt(Ee)}else throw ne.contents}function we(ue,ne){if(X)throw yt("Recoil: Async selector sets are not currently supported.");const Ee=typeof ne=="function"?ne(Ce(ue)):ne;zJ(W,N,ue.key,Ee).forEach((Le,qe)=>Te.set(qe,Le))}function be(ue){we(ue,UJ)}const He=s({set:we,get:Ce,reset:be},me);if(He!==void 0)throw sn(He)?yt("Recoil: Async selector sets are not currently supported."):yt("Recoil: selector set should be a void function.");return X=!0,Te},init:p,invalidate:G,clearCache:Z,shouldDeleteConfigOnRelease:g,dangerouslyAllowMutability:n.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:c}):e=IC({key:t,nodeType:"selector",peek:z,get:F,init:p,invalidate:G,clearCache:Z,shouldDeleteConfigOnRelease:g,dangerouslyAllowMutability:n.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:c})}eD.value=n=>new KN(n);var Fu=eD;const{isLoadable:XJ,loadableWithError:i_,loadableWithPromise:s_,loadableWithValue:Xl}=Ld,{WrappedValue:tD}=qN,{peekNodeInfo:YJ}=Qo,{DEFAULT_VALUE:Ma,DefaultValue:wo,getConfigDeletionHandler:nD,registerNode:qJ,setConfigDeletionHandler:ZJ}=Ir,{isRecoilValue:QJ}=Ou,{getRecoilValueAsLoadable:KJ,markRecoilValueModified:JJ,setRecoilValue:DC,setRecoilValueLoadable:eee}=ms,{retainedByOptionWithDefault:tee}=pl,jc=n=>n instanceof tD?n.value:n;function nee(n){const{key:e,persistence_UNSTABLE:t}=n,r=tee(n.retainedBy_UNSTABLE);let i=0;function s(_){return s_(_.then(M=>(o=Xl(M),M)).catch(M=>{throw o=i_(M),M}))}let o=sn(n.default)?s(n.default):XJ(n.default)?n.default.state==="loading"?s(n.default.contents):n.default:Xl(jc(n.default));o.contents;let a;const c=new Map;function f(_){return _}function d(_,M){const E=M.then(C=>{var P,R;return((R=((P=_.getState().nextTree)!==null&&P!==void 0?P:_.getState().currentTree).atomValues.get(e))===null||R===void 0?void 0:R.contents)===E&&DC(_,w,C),C}).catch(C=>{var P,R;throw((R=((P=_.getState().nextTree)!==null&&P!==void 0?P:_.getState().currentTree).atomValues.get(e))===null||R===void 0?void 0:R.contents)===E&&eee(_,w,i_(C)),C});return E}function h(_,M,E){var C;i++;const P=()=>{var q;i--,(q=c.get(_))===null||q===void 0||q.forEach($=>$()),c.delete(_)};if(_.getState().knownAtoms.add(e),o.state==="loading"){const q=()=>{var $;(($=_.getState().nextTree)!==null&&$!==void 0?$:_.getState().currentTree).atomValues.has(e)||JJ(_,w)};o.contents.finally(q)}const R=(C=n.effects)!==null&&C!==void 0?C:n.effects_UNSTABLE;if(R!=null){let pe=function(W){if($&&W.key===e){const N=q;return N instanceof wo?p(_,M):sn(N)?s_(N.then(me=>me instanceof wo?o.toPromise():me)):Xl(N)}return KJ(_,W)},z=function(W){return pe(W).toPromise()},F=function(W){var N;const me=YJ(_,(N=_.getState().nextTree)!==null&&N!==void 0?N:_.getState().currentTree,W.key);return $&&W.key===e&&!(q instanceof wo)?{...me,isSet:!0,loadable:pe(W)}:me};var Y=pe,fe=z,D=F;let q=Ma,$=!0,se=!1,le=null;const G=W=>N=>{if($){const me=pe(w),X=me.state==="hasValue"?me.contents:Ma;q=typeof N=="function"?N(X):N,sn(q)&&(q=q.then(Te=>(le={effect:W,value:Te},Te)))}else{if(sn(N))throw yt("Setting atoms to async values is not implemented.");typeof N!="function"&&(le={effect:W,value:jc(N)}),DC(_,w,typeof N=="function"?me=>{const X=jc(N(me));return le={effect:W,value:X},X}:jc(N))}},Z=W=>()=>G(W)(Ma),k=W=>N=>{var me;const{release:X}=_.subscribeToTransactions(Te=>{var Ce;let{currentTree:we,previousTree:be}=Te.getState();be||(be=we);const He=(Ce=we.atomValues.get(e))!==null&&Ce!==void 0?Ce:o;if(He.state==="hasValue"){var ue,ne,Ee,Ue;const Le=He.contents,qe=(ue=be.atomValues.get(e))!==null&&ue!==void 0?ue:o,et=qe.state==="hasValue"?qe.contents:Ma;((ne=le)===null||ne===void 0?void 0:ne.effect)!==W||((Ee=le)===null||Ee===void 0?void 0:Ee.value)!==Le?N(Le,et,!we.atomValues.has(e)):((Ue=le)===null||Ue===void 0?void 0:Ue.effect)===W&&(le=null)}},e);c.set(_,[...(me=c.get(_))!==null&&me!==void 0?me:[],X])};for(const W of R)try{const N=W({node:w,storeID:_.storeID,parentStoreID_UNSTABLE:_.parentStoreID,trigger:E,setSelf:G(W),resetSelf:Z(W),onSet:k(W),getPromise:z,getLoadable:pe,getInfo_UNSTABLE:F});if(N!=null){var T;c.set(_,[...(T=c.get(_))!==null&&T!==void 0?T:[],N])}}catch(N){q=N,se=!0}if($=!1,!(q instanceof wo)){var L;const W=se?i_(q):sn(q)?s_(d(_,q)):Xl(jc(q));W.contents,M.atomValues.set(e,W),(L=_.getState().nextTree)===null||L===void 0||L.atomValues.set(e,W)}}return P}function p(_,M){var E,C;return(E=(C=M.atomValues.get(e))!==null&&C!==void 0?C:a)!==null&&E!==void 0?E:o}function g(_,M){if(M.atomValues.has(e))return on(M.atomValues.get(e));if(M.nonvalidatedAtoms.has(e)){if(a!=null)return a;if(t==null)return o;const E=M.nonvalidatedAtoms.get(e),C=t.validator(E,Ma);return a=C instanceof wo?o:Xl(C),a}else return o}function v(){a=void 0}function y(_,M,E){if(M.atomValues.has(e)){const C=on(M.atomValues.get(e));if(C.state==="hasValue"&&E===C.contents)return new Map}else if(!M.nonvalidatedAtoms.has(e)&&E instanceof wo)return new Map;return a=void 0,new Map().set(e,Xl(E))}function x(){return nD(e)!==void 0&&i<=0}const w=qJ({key:e,nodeType:"atom",peek:p,get:g,set:y,init:h,invalidate:v,shouldDeleteConfigOnRelease:x,dangerouslyAllowMutability:n.dangerouslyAllowMutability,persistence_UNSTABLE:n.persistence_UNSTABLE?{type:n.persistence_UNSTABLE.type,backButton:n.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return w}function yw(n){const{...e}=n,t="default"in n?n.default:new Promise(()=>{});return QJ(t)?ree({...e,default:t}):nee({...e,default:t})}function ree(n){const e=yw({...n,default:Ma,persistence_UNSTABLE:n.persistence_UNSTABLE===void 0?void 0:{...n.persistence_UNSTABLE,validator:r=>r instanceof wo?r:on(n.persistence_UNSTABLE).validator(r,Ma)},effects:n.effects,effects_UNSTABLE:n.effects_UNSTABLE}),t=Fu({key:`${n.key}__withFallback`,get:({get:r})=>{const i=r(e);return i instanceof wo?n.default:i},set:({set:r},i)=>r(e,i),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:n.dangerouslyAllowMutability});return ZJ(t.key,nD(n.key)),t}yw.value=n=>new tD(n);var rD=yw;class iee{constructor(e){var t;pt(this,"_map",void 0),pt(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(t=e==null?void 0:e.mapKey)!==null&&t!==void 0?t:r=>r}size(){return this._map.size}has(e){return this._map.has(this._keyMapper(e))}get(e){return this._map.get(this._keyMapper(e))}set(e,t){this._map.set(this._keyMapper(e),t)}delete(e){this._map.delete(this._keyMapper(e))}clear(){this._map.clear()}}var see={MapCache:iee},oee=see.MapCache,aee=Object.freeze({__proto__:null,MapCache:oee});const{LRUCache:OC}=QN,{MapCache:lee}=aee,Wp={equality:"reference",eviction:"none",maxSize:1/0};function uee({equality:n=Wp.equality,eviction:e=Wp.eviction,maxSize:t=Wp.maxSize}=Wp){const r=cee(n);return fee(e,t,r)}function cee(n){switch(n){case"reference":return e=>e;case"value":return e=>S0(e)}throw yt(`Unrecognized equality policy ${n}`)}function fee(n,e,t){switch(n){case"keep-all":return new lee({mapKey:t});case"lru":return new OC({mapKey:t,maxSize:on(e)});case"most-recent":return new OC({mapKey:t,maxSize:1})}throw yt(`Unrecognized eviction policy ${n}`)}var iD=uee;const{setConfigDeletionHandler:dee}=Ir;function hee(n){var e,t;const r=iD({equality:(e=(t=n.cachePolicyForParams_UNSTABLE)===null||t===void 0?void 0:t.equality)!==null&&e!==void 0?e:"value",eviction:"keep-all"});return i=>{var s,o;const a=r.get(i);if(a!=null)return a;const{cachePolicyForParams_UNSTABLE:c,...f}=n,d="default"in n?n.default:new Promise(()=>{}),h=rD({...f,key:`${n.key}__${(s=S0(i))!==null&&s!==void 0?s:"void"}`,default:typeof d=="function"?d(i):d,retainedBy_UNSTABLE:typeof n.retainedBy_UNSTABLE=="function"?n.retainedBy_UNSTABLE(i):n.retainedBy_UNSTABLE,effects:typeof n.effects=="function"?n.effects(i):typeof n.effects_UNSTABLE=="function"?n.effects_UNSTABLE(i):(o=n.effects)!==null&&o!==void 0?o:n.effects_UNSTABLE});return r.set(i,h),dee(h.key,()=>{r.delete(i)}),h}}var pee=hee;const{setConfigDeletionHandler:mee}=Ir;let gee=0;function vee(n){var e,t;const r=iD({equality:(e=(t=n.cachePolicyForParams_UNSTABLE)===null||t===void 0?void 0:t.equality)!==null&&e!==void 0?e:"value",eviction:"keep-all"});return i=>{var s;let o;try{o=r.get(i)}catch(p){throw yt(`Problem with cache lookup for selector ${n.key}: ${p.message}`)}if(o!=null)return o;const a=`${n.key}__selectorFamily/${(s=S0(i,{allowFunctions:!0}))!==null&&s!==void 0?s:"void"}/${gee++}`,c=p=>n.get(i)(p),f=n.cachePolicy_UNSTABLE,d=typeof n.retainedBy_UNSTABLE=="function"?n.retainedBy_UNSTABLE(i):n.retainedBy_UNSTABLE;let h;if(n.set!=null){const p=n.set;h=Fu({key:a,get:c,set:(v,y)=>p(i)(v,y),cachePolicy_UNSTABLE:f,dangerouslyAllowMutability:n.dangerouslyAllowMutability,retainedBy_UNSTABLE:d})}else h=Fu({key:a,get:c,cachePolicy_UNSTABLE:f,dangerouslyAllowMutability:n.dangerouslyAllowMutability,retainedBy_UNSTABLE:d});return r.set(i,h),mee(h.key,()=>{r.delete(i)}),h}}var Ko=vee;const yee=Ko({key:"__constant",get:n=>()=>n,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function _ee(n){return yee(n)}var xee=_ee;const See=Ko({key:"__error",get:n=>()=>{throw yt(n)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function wee(n){return See(n)}var Mee=wee;function bee(n){return n}var Eee=bee;const{loadableWithError:sD,loadableWithPromise:oD,loadableWithValue:aD}=Ld;function w0(n,e){const t=Array(e.length).fill(void 0),r=Array(e.length).fill(void 0);for(const[i,s]of e.entries())try{t[i]=n(s)}catch(o){r[i]=o}return[t,r]}function Tee(n){return n!=null&&!sn(n)}function M0(n){return Array.isArray(n)?n:Object.getOwnPropertyNames(n).map(e=>n[e])}function n1(n,e){return Array.isArray(n)?e:Object.getOwnPropertyNames(n).reduce((t,r,i)=>({...t,[r]:e[i]}),{})}function wu(n,e,t){const r=t.map((i,s)=>i==null?aD(e[s]):sn(i)?oD(i):sD(i));return n1(n,r)}function Cee(n,e){return e.map((t,r)=>t===void 0?n[r]:t)}const Aee=Ko({key:"__waitForNone",get:n=>({get:e})=>{const t=M0(n),[r,i]=w0(e,t);return wu(n,r,i)},dangerouslyAllowMutability:!0}),Pee=Ko({key:"__waitForAny",get:n=>({get:e})=>{const t=M0(n),[r,i]=w0(e,t);return i.some(s=>!sn(s))?wu(n,r,i):new Promise(s=>{for(const[o,a]of i.entries())sn(a)&&a.then(c=>{r[o]=c,i[o]=void 0,s(wu(n,r,i))}).catch(c=>{i[o]=c,s(wu(n,r,i))})})},dangerouslyAllowMutability:!0}),Ree=Ko({key:"__waitForAll",get:n=>({get:e})=>{const t=M0(n),[r,i]=w0(e,t);if(i.every(o=>o==null))return n1(n,r);const s=i.find(Tee);if(s!=null)throw s;return Promise.all(i).then(o=>n1(n,Cee(r,o)))},dangerouslyAllowMutability:!0}),Lee=Ko({key:"__waitForAllSettled",get:n=>({get:e})=>{const t=M0(n),[r,i]=w0(e,t);return i.every(s=>!sn(s))?wu(n,r,i):Promise.all(i.map((s,o)=>sn(s)?s.then(a=>{r[o]=a,i[o]=void 0}).catch(a=>{r[o]=void 0,i[o]=a}):null)).then(()=>wu(n,r,i))},dangerouslyAllowMutability:!0}),Iee=Ko({key:"__noWait",get:n=>({get:e})=>{try{return Fu.value(aD(e(n)))}catch(t){return Fu.value(sn(t)?oD(t):sD(t))}},dangerouslyAllowMutability:!0});var Nee={waitForNone:Aee,waitForAny:Pee,waitForAll:Ree,waitForAllSettled:Lee,noWait:Iee};const{RecoilLoadable:Dee}=Ld,{DefaultValue:Oee}=Ir,{RecoilRoot:kee,useRecoilStoreID:zee}=Ks,{isRecoilValue:Fee}=Ou,{retentionZone:Uee}=f0,{freshSnapshot:Bee}=g0,{useRecoilState:Vee,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:Gee,useRecoilStateLoadable:Hee,useRecoilValue:Wee,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:$ee,useRecoilValueLoadable:jee,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:Xee,useResetRecoilState:Yee,useSetRecoilState:qee}=sK,{useGotoRecoilSnapshot:Zee,useRecoilSnapshot:Qee,useRecoilTransactionObserver:Kee}=WN,{useRecoilCallback:Jee}=YN,{noWait:ete,waitForAll:tte,waitForAllSettled:nte,waitForAny:rte,waitForNone:ite}=Nee;var ste={DefaultValue:Oee,isRecoilValue:Fee,RecoilLoadable:Dee,RecoilEnv:YI,RecoilRoot:kee,useRecoilStoreID:zee,useRecoilBridgeAcrossReactRoots_UNSTABLE:IK,atom:rD,selector:Fu,atomFamily:pee,selectorFamily:Ko,constSelector:xee,errorSelector:Mee,readOnlySelector:Eee,noWait:ete,waitForNone:ite,waitForAny:rte,waitForAll:tte,waitForAllSettled:nte,useRecoilValue:Wee,useRecoilValueLoadable:jee,useRecoilState:Vee,useRecoilStateLoadable:Hee,useSetRecoilState:qee,useResetRecoilState:Yee,useGetRecoilValueInfo_UNSTABLE:TK,useRecoilRefresher_UNSTABLE:aJ,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:Xee,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:$ee,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:Gee,useRecoilCallback:Jee,useRecoilTransaction_UNSTABLE:dJ,useGotoRecoilSnapshot:Zee,useRecoilSnapshot:Qee,useRecoilTransactionObserver_UNSTABLE:Kee,snapshot_UNSTABLE:Bee,useRetain:hw,retentionZone:Uee},ote=ste.RecoilRoot;a_.createRoot(document.getElementById("root")).render(at(ke.StrictMode,{children:at(rY,{children:at(ote,{children:at(vY,{modalProps:{size:"xs",transition:"slide-up",styles:{inner:{overflow:"hidden"}}},children:at(OX,{})})})})}));