Files
Project_Velocity/app/dist/assets/index-Cs3AYztb.js

4177 lines
1.9 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function HQ(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(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 a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var cS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ar(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pC={exports:{}},j0={};var C2;function VQ(){if(C2)return j0;C2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,a){var s=null;if(a!==void 0&&(s=""+a),i.key!==void 0&&(s=""+i.key),"key"in i){a={};for(var o in i)o!=="key"&&(a[o]=i[o])}else a=i;return i=a.ref,{$$typeof:t,type:r,key:s,ref:i!==void 0?i:null,props:a}}return j0.Fragment=e,j0.jsx=n,j0.jsxs=n,j0}var R2;function WQ(){return R2||(R2=1,pC.exports=VQ()),pC.exports}var M=WQ(),mC={exports:{}},cn={};var O2;function qQ(){if(O2)return cn;O2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),v=Symbol.iterator;function y(X){return X===null||typeof X!="object"?null:(X=v&&X[v]||X["@@iterator"],typeof X=="function"?X:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function S(X,ae,ue){this.props=X,this.context=ae,this.refs=_,this.updater=ue||b}S.prototype.isReactComponent={},S.prototype.setState=function(X,ae){if(typeof X!="object"&&typeof X!="function"&&X!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,X,ae,"setState")},S.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function E(){}E.prototype=S.prototype;function T(X,ae,ue){this.props=X,this.context=ae,this.refs=_,this.updater=ue||b}var P=T.prototype=new E;P.constructor=T,w(P,S.prototype),P.isPureReactComponent=!0;var R=Array.isArray;function D(){}var I={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function B(X,ae,ue){var Se=ue.ref;return{$$typeof:t,type:X,key:ae,ref:Se!==void 0?Se:null,props:ue}}function U(X,ae){return B(X.type,ae,X.props)}function z(X){return typeof X=="object"&&X!==null&&X.$$typeof===t}function q(X){var ae={"=":"=0",":":"=2"};return"$"+X.replace(/[=:]/g,function(ue){return ae[ue]})}var W=/\/+/g;function ee(X,ae){return typeof X=="object"&&X!==null&&X.key!=null?q(""+X.key):ae.toString(36)}function Q(X){switch(X.status){case"fulfilled":return X.value;case"rejected":throw X.reason;default:switch(typeof X.status=="string"?X.then(D,D):(X.status="pending",X.then(function(ae){X.status==="pending"&&(X.status="fulfilled",X.value=ae)},function(ae){X.status==="pending"&&(X.status="rejected",X.reason=ae)})),X.status){case"fulfilled":return X.value;case"rejected":throw X.reason}}throw X}function V(X,ae,ue,Se,$e){var me=typeof X;(me==="undefined"||me==="boolean")&&(X=null);var ve=!1;if(X===null)ve=!0;else switch(me){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(X.$$typeof){case t:case e:ve=!0;break;case h:return ve=X._init,V(ve(X._payload),ae,ue,Se,$e)}}if(ve)return $e=$e(X),ve=Se===""?"."+ee(X,0):Se,R($e)?(ue="",ve!=null&&(ue=ve.replace(W,"$&/")+"/"),V($e,ae,ue,"",function(Fe){return Fe})):$e!=null&&(z($e)&&($e=U($e,ue+($e.key==null||X&&X.key===$e.key?"":(""+$e.key).replace(W,"$&/")+"/")+ve)),ae.push($e)),1;ve=0;var We=Se===""?".":Se+":";if(R(X))for(var _e=0;_e<X.length;_e++)Se=X[_e],me=We+ee(Se,_e),ve+=V(Se,ae,ue,me,$e);else if(_e=y(X),typeof _e=="function")for(X=_e.call(X),_e=0;!(Se=X.next()).done;)Se=Se.value,me=We+ee(Se,_e++),ve+=V(Se,ae,ue,me,$e);else if(me==="object"){if(typeof X.then=="function")return V(Q(X),ae,ue,Se,$e);throw ae=String(X),Error("Objects are not valid as a React child (found: "+(ae==="[object Object]"?"object with keys {"+Object.keys(X).join(", ")+"}":ae)+"). If you meant to render a collection of children, use an array instead.")}return ve}function $(X,ae,ue){if(X==null)return X;var Se=[],$e=0;return V(X,Se,"","",function(me){return ae.call(ue,me,$e++)}),Se}function Y(X){if(X._status===-1){var ae=X._result;ae=ae(),ae.then(function(ue){(X._status===0||X._status===-1)&&(X._status=1,X._result=ue)},function(ue){(X._status===0||X._status===-1)&&(X._status=2,X._result=ue)}),X._status===-1&&(X._status=0,X._result=ae)}if(X._status===1)return X._result.default;throw X._result}var ie=typeof reportError=="function"?reportError:function(X){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ae=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof X=="object"&&X!==null&&typeof X.message=="string"?String(X.message):String(X),error:X});if(!window.dispatchEvent(ae))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",X);return}console.error(X)},de={map:$,forEach:function(X,ae,ue){$(X,function(){ae.apply(this,arguments)},ue)},count:function(X){var ae=0;return $(X,function(){ae++}),ae},toArray:function(X){return $(X,function(ae){return ae})||[]},only:function(X){if(!z(X))throw Error("React.Children.only expected to receive a single React element child.");return X}};return cn.Activity=p,cn.Children=de,cn.Component=S,cn.Fragment=n,cn.Profiler=i,cn.PureComponent=T,cn.StrictMode=r,cn.Suspense=c,cn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,cn.__COMPILER_RUNTIME={__proto__:null,c:function(X){return I.H.useMemoCache(X)}},cn.cache=function(X){return function(){return X.apply(null,arguments)}},cn.cacheSignal=function(){return null},cn.cloneElement=function(X,ae,ue){if(X==null)throw Error("The argument must be a React element, but you passed "+X+".");var Se=w({},X.props),$e=X.key;if(ae!=null)for(me in ae.key!==void 0&&($e=""+ae.key),ae)!k.call(ae,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&ae.ref===void 0||(Se[me]=ae[me]);var me=arguments.length-2;if(me===1)Se.children=ue;else if(1<me){for(var ve=Array(me),We=0;We<me;We++)ve[We]=arguments[We+2];Se.children=ve}return B(X.type,$e,Se)},cn.createContext=function(X){return X={$$typeof:s,_currentValue:X,_currentValue2:X,_threadCount:0,Provider:null,Consumer:null},X.Provider=X,X.Consumer={$$typeof:a,_context:X},X},cn.createElement=function(X,ae,ue){var Se,$e={},me=null;if(ae!=null)for(Se in ae.key!==void 0&&(me=""+ae.key),ae)k.call(ae,Se)&&Se!=="key"&&Se!=="__self"&&Se!=="__source"&&($e[Se]=ae[Se]);var ve=arguments.length-2;if(ve===1)$e.children=ue;else if(1<ve){for(var We=Array(ve),_e=0;_e<ve;_e++)We[_e]=arguments[_e+2];$e.children=We}if(X&&X.defaultProps)for(Se in ve=X.defaultProps,ve)$e[Se]===void 0&&($e[Se]=ve[Se]);return B(X,me,$e)},cn.createRef=function(){return{current:null}},cn.forwardRef=function(X){return{$$typeof:o,render:X}},cn.isValidElement=z,cn.lazy=function(X){return{$$typeof:h,_payload:{_status:-1,_result:X},_init:Y}},cn.memo=function(X,ae){return{$$typeof:u,type:X,compare:ae===void 0?null:ae}},cn.startTransition=function(X){var ae=I.T,ue={};I.T=ue;try{var Se=X(),$e=I.S;$e!==null&&$e(ue,Se),typeof Se=="object"&&Se!==null&&typeof Se.then=="function"&&Se.then(D,ie)}catch(me){ie(me)}finally{ae!==null&&ue.types!==null&&(ae.types=ue.types),I.T=ae}},cn.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},cn.use=function(X){return I.H.use(X)},cn.useActionState=function(X,ae,ue){return I.H.useActionState(X,ae,ue)},cn.useCallback=function(X,ae){return I.H.useCallback(X,ae)},cn.useContext=function(X){return I.H.useContext(X)},cn.useDebugValue=function(){},cn.useDeferredValue=function(X,ae){return I.H.useDeferredValue(X,ae)},cn.useEffect=function(X,ae){return I.H.useEffect(X,ae)},cn.useEffectEvent=function(X){return I.H.useEffectEvent(X)},cn.useId=function(){return I.H.useId()},cn.useImperativeHandle=function(X,ae,ue){return I.H.useImperativeHandle(X,ae,ue)},cn.useInsertionEffect=function(X,ae){return I.H.useInsertionEffect(X,ae)},cn.useLayoutEffect=function(X,ae){return I.H.useLayoutEffect(X,ae)},cn.useMemo=function(X,ae){return I.H.useMemo(X,ae)},cn.useOptimistic=function(X,ae){return I.H.useOptimistic(X,ae)},cn.useReducer=function(X,ae,ue){return I.H.useReducer(X,ae,ue)},cn.useRef=function(X){return I.H.useRef(X)},cn.useState=function(X){return I.H.useState(X)},cn.useSyncExternalStore=function(X,ae,ue){return I.H.useSyncExternalStore(X,ae,ue)},cn.useTransition=function(){return I.H.useTransition()},cn.version="19.2.3",cn}var P2;function qb(){return P2||(P2=1,mC.exports=qQ()),mC.exports}var j=qb();const fe=ar(j),NB=HQ({__proto__:null,default:fe},[j]);var gC={exports:{}},z0={},vC={exports:{}},yC={};var D2;function $Q(){return D2||(D2=1,(function(t){function e(V,$){var Y=V.length;V.push($);e:for(;0<Y;){var ie=Y-1>>>1,de=V[ie];if(0<i(de,$))V[ie]=$,V[Y]=de,Y=ie;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var $=V[0],Y=V.pop();if(Y!==$){V[0]=Y;e:for(var ie=0,de=V.length,X=de>>>1;ie<X;){var ae=2*(ie+1)-1,ue=V[ae],Se=ae+1,$e=V[Se];if(0>i(ue,Y))Se<de&&0>i($e,ue)?(V[ie]=$e,V[Se]=Y,ie=Se):(V[ie]=ue,V[ae]=Y,ie=ae);else if(Se<de&&0>i($e,Y))V[ie]=$e,V[Se]=Y,ie=Se;else break e}}return $}function i(V,$){var Y=V.sortIndex-$.sortIndex;return Y!==0?Y:V.id-$.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var c=[],u=[],h=1,p=null,v=3,y=!1,b=!1,w=!1,_=!1,S=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function P(V){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=V)r(u),$.sortIndex=$.expirationTime,e(c,$);else break;$=n(u)}}function R(V){if(w=!1,P(V),!b)if(n(c)!==null)b=!0,D||(D=!0,q());else{var $=n(u);$!==null&&Q(R,$.startTime-V)}}var D=!1,I=-1,k=5,B=-1;function U(){return _?!0:!(t.unstable_now()-B<k)}function z(){if(_=!1,D){var V=t.unstable_now();B=V;var $=!0;try{e:{b=!1,w&&(w=!1,E(I),I=-1),y=!0;var Y=v;try{t:{for(P(V),p=n(c);p!==null&&!(p.expirationTime>V&&U());){var ie=p.callback;if(typeof ie=="function"){p.callback=null,v=p.priorityLevel;var de=ie(p.expirationTime<=V);if(V=t.unstable_now(),typeof de=="function"){p.callback=de,P(V),$=!0;break t}p===n(c)&&r(c),P(V)}else r(c);p=n(c)}if(p!==null)$=!0;else{var X=n(u);X!==null&&Q(R,X.startTime-V),$=!1}}break e}finally{p=null,v=Y,y=!1}$=void 0}}finally{$?q():D=!1}}}var q;if(typeof T=="function")q=function(){T(z)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ee=W.port2;W.port1.onmessage=z,q=function(){ee.postMessage(null)}}else q=function(){S(z,0)};function Q(V,$){I=S(function(){V(t.unstable_now())},$)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(V){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var Y=v;v=$;try{return V()}finally{v=Y}},t.unstable_requestPaint=function(){_=!0},t.unstable_runWithPriority=function(V,$){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var Y=v;v=V;try{return $()}finally{v=Y}},t.unstable_scheduleCallback=function(V,$,Y){var ie=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?ie+Y:ie):Y=ie,V){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=Y+de,V={id:h++,callback:$,priorityLevel:V,startTime:Y,expirationTime:de,sortIndex:-1},Y>ie?(V.sortIndex=Y,e(u,V),n(c)===null&&V===n(u)&&(w?(E(I),I=-1):w=!0,Q(R,Y-ie))):(V.sortIndex=de,e(c,V),b||y||(b=!0,D||(D=!0,q()))),V},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(V){var $=v;return function(){var Y=v;v=$;try{return V.apply(this,arguments)}finally{v=Y}}}})(yC)),yC}var N2;function RV(){return N2||(N2=1,vC.exports=$Q()),vC.exports}var xC={exports:{}},Ea={};var I2;function XQ(){if(I2)return Ea;I2=1;var t=qb();function e(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(c,u,h){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:c,containerInfo:u,implementation:h}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Ea.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ea.createPortal=function(c,u){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return a(c,u,null,h)},Ea.flushSync=function(c){var u=s.T,h=r.p;try{if(s.T=null,r.p=2,c)return c()}finally{s.T=u,r.p=h,r.d.f()}},Ea.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},Ea.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Ea.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var h=u.as,p=o(h,u.crossOrigin),v=typeof u.integrity=="string"?u.integrity:void 0,y=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;h==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:p,integrity:v,fetchPriority:y}):h==="script"&&r.d.X(c,{crossOrigin:p,integrity:v,fetchPriority:y,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Ea.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var h=o(u.as,u.crossOrigin);r.d.M(c,{crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(c)},Ea.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var h=u.as,p=o(h,u.crossOrigin);r.d.L(c,h,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Ea.preloadModule=function(c,u){if(typeof c=="string")if(u){var h=o(u.as,u.crossOrigin);r.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(c)},Ea.requestFormReset=function(c){r.d.r(c)},Ea.unstable_batchedUpdates=function(c,u){return c(u)},Ea.useFormState=function(c,u,h){return s.H.useFormState(c,u,h)},Ea.useFormStatus=function(){return s.H.useHostTransitionStatus()},Ea.version="19.2.3",Ea}var B2;function OV(){if(B2)return xC.exports;B2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),xC.exports=XQ(),xC.exports}var L2;function KQ(){if(L2)return z0;L2=1;var t=RV(),e=qb(),n=OV();function r(l){var f="https://react.dev/errors/"+l;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+l+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function a(l){var f=l,g=l;if(l.alternate)for(;f.return;)f=f.return;else{l=f;do f=l,(f.flags&4098)!==0&&(g=f.return),l=f.return;while(l)}return f.tag===3?g:null}function s(l){if(l.tag===13){var f=l.memoizedState;if(f===null&&(l=l.alternate,l!==null&&(f=l.memoizedState)),f!==null)return f.dehydrated}return null}function o(l){if(l.tag===31){var f=l.memoizedState;if(f===null&&(l=l.alternate,l!==null&&(f=l.memoizedState)),f!==null)return f.dehydrated}return null}function c(l){if(a(l)!==l)throw Error(r(188))}function u(l){var f=l.alternate;if(!f){if(f=a(l),f===null)throw Error(r(188));return f!==l?null:l}for(var g=l,x=f;;){var O=g.return;if(O===null)break;var N=O.alternate;if(N===null){if(x=O.return,x!==null){g=x;continue}break}if(O.child===N.child){for(N=O.child;N;){if(N===g)return c(O),l;if(N===x)return c(O),f;N=N.sibling}throw Error(r(188))}if(g.return!==x.return)g=O,x=N;else{for(var G=!1,Z=O.child;Z;){if(Z===g){G=!0,g=O,x=N;break}if(Z===x){G=!0,x=O,g=N;break}Z=Z.sibling}if(!G){for(Z=N.child;Z;){if(Z===g){G=!0,g=N,x=O;break}if(Z===x){G=!0,x=N,g=O;break}Z=Z.sibling}if(!G)throw Error(r(189))}}if(g.alternate!==x)throw Error(r(190))}if(g.tag!==3)throw Error(r(188));return g.stateNode.current===g?l:f}function h(l){var f=l.tag;if(f===5||f===26||f===27||f===6)return l;for(l=l.child;l!==null;){if(f=h(l),f!==null)return f;l=l.sibling}return null}var p=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function q(l){return l===null||typeof l!="object"?null:(l=z&&l[z]||l["@@iterator"],typeof l=="function"?l:null)}var W=Symbol.for("react.client.reference");function ee(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===W?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case w:return"Fragment";case S:return"Profiler";case _:return"StrictMode";case R:return"Suspense";case D:return"SuspenseList";case B:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case b:return"Portal";case T:return l.displayName||"Context";case E:return(l._context.displayName||"Context")+".Consumer";case P:var f=l.render;return l=l.displayName,l||(l=f.displayName||f.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case I:return f=l.displayName||null,f!==null?f:ee(l.type)||"Memo";case k:f=l._payload,l=l._init;try{return ee(l(f))}catch{}}return null}var Q=Array.isArray,V=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},ie=[],de=-1;function X(l){return{current:l}}function ae(l){0>de||(l.current=ie[de],ie[de]=null,de--)}function ue(l,f){de++,ie[de]=l.current,l.current=f}var Se=X(null),$e=X(null),me=X(null),ve=X(null);function We(l,f){switch(ue(me,f),ue($e,l),ue(Se,null),f.nodeType){case 9:case 11:l=(l=f.documentElement)&&(l=l.namespaceURI)?Jk(l):0;break;default:if(l=f.tagName,f=f.namespaceURI)f=Jk(f),l=Zk(f,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}ae(Se),ue(Se,l)}function _e(){ae(Se),ae($e),ae(me)}function Fe(l){l.memoizedState!==null&&ue(ve,l);var f=Se.current,g=Zk(f,l.type);f!==g&&(ue($e,l),ue(Se,g))}function Xe(l){$e.current===l&&(ae(Se),ae($e)),ve.current===l&&(ae(ve),L0._currentValue=Y)}var Re,ot;function we(l){if(Re===void 0)try{throw Error()}catch(g){var f=g.stack.trim().match(/\n( *(at )?)/);Re=f&&f[1]||"",ot=-1<g.stack.indexOf(`
at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Re+l+ot}var Ue=!1;function Be(l,f){if(!l||Ue)return"";Ue=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(f){var Ke=function(){throw Error()};if(Object.defineProperty(Ke.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ke,[])}catch(ke){var Oe=ke}Reflect.construct(l,[],Ke)}else{try{Ke.call()}catch(ke){Oe=ke}l.call(Ke.prototype)}}else{try{throw Error()}catch(ke){Oe=ke}(Ke=l())&&typeof Ke.catch=="function"&&Ke.catch(function(){})}}catch(ke){if(ke&&Oe&&typeof ke.stack=="string")return[ke.stack,Oe.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var O=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");O&&O.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=x.DetermineComponentFrameRoot(),G=N[0],Z=N[1];if(G&&Z){var le=G.split(`
`),Ee=Z.split(`
`);for(O=x=0;x<le.length&&!le[x].includes("DetermineComponentFrameRoot");)x++;for(;O<Ee.length&&!Ee[O].includes("DetermineComponentFrameRoot");)O++;if(x===le.length||O===Ee.length)for(x=le.length-1,O=Ee.length-1;1<=x&&0<=O&&le[x]!==Ee[O];)O--;for(;1<=x&&0<=O;x--,O--)if(le[x]!==Ee[O]){if(x!==1||O!==1)do if(x--,O--,0>O||le[x]!==Ee[O]){var ze=`
`+le[x].replace(" at new "," at ");return l.displayName&&ze.includes("<anonymous>")&&(ze=ze.replace("<anonymous>",l.displayName)),ze}while(1<=x&&0<=O);break}}}finally{Ue=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?we(g):""}function Ye(l,f){switch(l.tag){case 26:case 27:case 5:return we(l.type);case 16:return we("Lazy");case 13:return l.child!==f&&f!==null?we("Suspense Fallback"):we("Suspense");case 19:return we("SuspenseList");case 0:case 15:return Be(l.type,!1);case 11:return Be(l.type.render,!1);case 1:return Be(l.type,!0);case 31:return we("Activity");default:return""}}function re(l){try{var f="",g=null;do f+=Ye(l,g),g=l,l=l.return;while(l);return f}catch(x){return`
Error generating stack: `+x.message+`
`+x.stack}}var At=Object.prototype.hasOwnProperty,ft=t.unstable_scheduleCallback,Et=t.unstable_cancelCallback,Ze=t.unstable_shouldYield,te=t.unstable_requestPaint,H=t.unstable_now,he=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,_t=t.unstable_LowPriority,lt=t.unstable_IdlePriority,Tt=t.log,Gt=t.unstable_setDisableYieldValue,Qe=null,st=null;function vt(l){if(typeof Tt=="function"&&Gt(l),st&&typeof st.setStrictMode=="function")try{st.setStrictMode(Qe,l)}catch{}}var se=Math.clz32?Math.clz32:oe,Ae=Math.log,dt=Math.LN2;function oe(l){return l>>>=0,l===0?32:31-(Ae(l)/dt|0)|0}var it=256,et=262144,pt=4194304;function tt(l){var f=l&42;if(f!==0)return f;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function He(l,f,g){var x=l.pendingLanes;if(x===0)return 0;var O=0,N=l.suspendedLanes,G=l.pingedLanes;l=l.warmLanes;var Z=x&134217727;return Z!==0?(x=Z&~N,x!==0?O=tt(x):(G&=Z,G!==0?O=tt(G):g||(g=Z&~l,g!==0&&(O=tt(g))))):(Z=x&~N,Z!==0?O=tt(Z):G!==0?O=tt(G):g||(g=x&~l,g!==0&&(O=tt(g)))),O===0?0:f!==0&&f!==O&&(f&N)===0&&(N=O&-O,g=f&-f,N>=g||N===32&&(g&4194048)!==0)?f:O}function at(l,f){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&f)===0}function jt(l,f){switch(l){case 1:case 2:case 4:case 8:case 64:return f+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function un(){var l=pt;return pt<<=1,(pt&62914560)===0&&(pt=4194304),l}function hn(l){for(var f=[],g=0;31>g;g++)f.push(l);return f}function Mr(l,f){l.pendingLanes|=f,f!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function oi(l,f,g,x,O,N){var G=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var Z=l.entanglements,le=l.expirationTimes,Ee=l.hiddenUpdates;for(g=G&~g;0<g;){var ze=31-se(g),Ke=1<<ze;Z[ze]=0,le[ze]=-1;var Oe=Ee[ze];if(Oe!==null)for(Ee[ze]=null,ze=0;ze<Oe.length;ze++){var ke=Oe[ze];ke!==null&&(ke.lane&=-536870913)}g&=~Ke}x!==0&&Wl(l,x,0),N!==0&&O===0&&l.tag!==0&&(l.suspendedLanes|=N&~(G&~f))}function Wl(l,f,g){l.pendingLanes|=f,l.suspendedLanes&=~f;var x=31-se(f);l.entangledLanes|=f,l.entanglements[x]=l.entanglements[x]|1073741824|g&261930}function ql(l,f){var g=l.entangledLanes|=f;for(l=l.entanglements;g;){var x=31-se(g),O=1<<x;O&f|l[x]&f&&(l[x]|=f),g&=~O}}function Zc(l,f){var g=f&-f;return g=(g&42)!==0?1:$l(g),(g&(l.suspendedLanes|f))!==0?0:g}function $l(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;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:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function el(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function Qc(){var l=$.p;return l!==0?l:(l=window.event,l===void 0?32:_2(l.type))}function Wi(l,f){var g=$.p;try{return $.p=l,f()}finally{$.p=g}}var Fa=Math.random().toString(36).slice(2),Er="__reactFiber$"+Fa,li="__reactProps$"+Fa,Ua="__reactContainer$"+Fa,ja="__reactEvents$"+Fa,za="__reactListeners$"+Fa,Xl="__reactHandles$"+Fa,eu="__reactResources$"+Fa,Fs="__reactMarker$"+Fa;function tl(l){delete l[Er],delete l[li],delete l[ja],delete l[za],delete l[Xl]}function nl(l){var f=l[Er];if(f)return f;for(var g=l.parentNode;g;){if(f=g[Ua]||g[Er]){if(g=f.alternate,f.child!==null||g!==null&&g.child!==null)for(l=a2(l);l!==null;){if(g=l[Er])return g;l=a2(l)}return f}l=g,g=l.parentNode}return null}function rl(l){if(l=l[Er]||l[Ua]){var f=l.tag;if(f===5||f===6||f===13||f===31||f===26||f===27||f===3)return l}return null}function Kl(l){var f=l.tag;if(f===5||f===26||f===27||f===6)return l.stateNode;throw Error(r(33))}function so(l){var f=l[eu];return f||(f=l[eu]={hoistableStyles:new Map,hoistableScripts:new Map}),f}function J(l){l[Fs]=!0}var ge=new Set,Pe={};function Te(l,f){xe(l,f),xe(l+"Capture",f)}function xe(l,f){for(Pe[l]=f,l=0;l<f.length;l++)ge.add(f[l])}var ct=RegExp("^[: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]*$"),wt={},rt={};function Ct(l){return At.call(rt,l)?!0:At.call(wt,l)?!1:ct.test(l)?rt[l]=!0:(wt[l]=!0,!1)}function Rt(l,f,g){if(Ct(f))if(g===null)l.removeAttribute(f);else{switch(typeof g){case"undefined":case"function":case"symbol":l.removeAttribute(f);return;case"boolean":var x=f.toLowerCase().slice(0,5);if(x!=="data-"&&x!=="aria-"){l.removeAttribute(f);return}}l.setAttribute(f,""+g)}}function Ht(l,f,g){if(g===null)l.removeAttribute(f);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(f);return}l.setAttribute(f,""+g)}}function Dt(l,f,g,x){if(x===null)l.removeAttribute(g);else{switch(typeof x){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(g);return}l.setAttributeNS(f,g,""+x)}}function Xt(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Un(l){var f=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function sr(l,f,g){var x=Object.getOwnPropertyDescriptor(l.constructor.prototype,f);if(!l.hasOwnProperty(f)&&typeof x<"u"&&typeof x.get=="function"&&typeof x.set=="function"){var O=x.get,N=x.set;return Object.defineProperty(l,f,{configurable:!0,get:function(){return O.call(this)},set:function(G){g=""+G,N.call(this,G)}}),Object.defineProperty(l,f,{enumerable:x.enumerable}),{getValue:function(){return g},setValue:function(G){g=""+G},stopTracking:function(){l._valueTracker=null,delete l[f]}}}}function Qn(l){if(!l._valueTracker){var f=Un(l)?"checked":"value";l._valueTracker=sr(l,f,""+l[f])}}function rn(l){if(!l)return!1;var f=l._valueTracker;if(!f)return!0;var g=f.getValue(),x="";return l&&(x=Un(l)?l.checked?"true":"false":l.value),l=x,l!==g?(f.setValue(l),!0):!1}function gt(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Bn=/[\n"\\]/g;function Jt(l){return l.replace(Bn,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function Jr(l,f,g,x,O,N,G,Z){l.name="",G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"?l.type=G:l.removeAttribute("type"),f!=null?G==="number"?(f===0&&l.value===""||l.value!=f)&&(l.value=""+Xt(f)):l.value!==""+Xt(f)&&(l.value=""+Xt(f)):G!=="submit"&&G!=="reset"||l.removeAttribute("value"),f!=null?hr(l,G,Xt(f)):g!=null?hr(l,G,Xt(g)):x!=null&&l.removeAttribute("value"),O==null&&N!=null&&(l.defaultChecked=!!N),O!=null&&(l.checked=O&&typeof O!="function"&&typeof O!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?l.name=""+Xt(Z):l.removeAttribute("name")}function Us(l,f,g,x,O,N,G,Z){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(l.type=N),f!=null||g!=null){if(!(N!=="submit"&&N!=="reset"||f!=null)){Qn(l);return}g=g!=null?""+Xt(g):"",f=f!=null?""+Xt(f):g,Z||f===l.value||(l.value=f),l.defaultValue=f}x=x??O,x=typeof x!="function"&&typeof x!="symbol"&&!!x,l.checked=Z?l.checked:!!x,l.defaultChecked=!!x,G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"&&(l.name=G),Qn(l)}function hr(l,f,g){f==="number"&&gt(l.ownerDocument)===l||l.defaultValue===""+g||(l.defaultValue=""+g)}function ea(l,f,g,x){if(l=l.options,f){f={};for(var O=0;O<g.length;O++)f["$"+g[O]]=!0;for(g=0;g<l.length;g++)O=f.hasOwnProperty("$"+l[g].value),l[g].selected!==O&&(l[g].selected=O),O&&x&&(l[g].defaultSelected=!0)}else{for(g=""+Xt(g),f=null,O=0;O<l.length;O++){if(l[O].value===g){l[O].selected=!0,x&&(l[O].defaultSelected=!0);return}f!==null||l[O].disabled||(f=l[O])}f!==null&&(f.selected=!0)}}function Wn(l,f,g){if(f!=null&&(f=""+Xt(f),f!==l.value&&(l.value=f),g==null)){l.defaultValue!==f&&(l.defaultValue=f);return}l.defaultValue=g!=null?""+Xt(g):""}function ci(l,f,g,x){if(f==null){if(x!=null){if(g!=null)throw Error(r(92));if(Q(x)){if(1<x.length)throw Error(r(93));x=x[0]}g=x}g==null&&(g=""),f=g}g=Xt(f),l.defaultValue=g,x=l.textContent,x===g&&x!==""&&x!==null&&(l.value=x),Qn(l)}function Zr(l,f){if(f){var g=l.firstChild;if(g&&g===l.lastChild&&g.nodeType===3){g.nodeValue=f;return}}l.textContent=f}var yi=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function xi(l,f,g){var x=f.indexOf("--")===0;g==null||typeof g=="boolean"||g===""?x?l.setProperty(f,""):f==="float"?l.cssFloat="":l[f]="":x?l.setProperty(f,g):typeof g!="number"||g===0||yi.has(f)?f==="float"?l.cssFloat=g:l[f]=(""+g).trim():l[f]=g+"px"}function tu(l,f,g){if(f!=null&&typeof f!="object")throw Error(r(62));if(l=l.style,g!=null){for(var x in g)!g.hasOwnProperty(x)||f!=null&&f.hasOwnProperty(x)||(x.indexOf("--")===0?l.setProperty(x,""):x==="float"?l.cssFloat="":l[x]="");for(var O in f)x=f[O],f.hasOwnProperty(O)&&g[O]!==x&&xi(l,O,x)}else for(var N in f)f.hasOwnProperty(N)&&xi(l,N,f[N])}function ds(l){if(l.indexOf("-")===-1)return!1;switch(l){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 E1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),gy=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qd(l){return gy.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function il(){}var Kp=null;function Yp(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var nu=null,Yl=null;function vy(l){var f=rl(l);if(f&&(l=f.stateNode)){var g=l[li]||null;e:switch(l=f.stateNode,f.type){case"input":if(Jr(l,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name),f=g.name,g.type==="radio"&&f!=null){for(g=l;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll('input[name="'+Jt(""+f)+'"][type="radio"]'),f=0;f<g.length;f++){var x=g[f];if(x!==l&&x.form===l.form){var O=x[li]||null;if(!O)throw Error(r(90));Jr(x,O.value,O.defaultValue,O.defaultValue,O.checked,O.defaultChecked,O.type,O.name)}}for(f=0;f<g.length;f++)x=g[f],x.form===l.form&&rn(x)}break e;case"textarea":Wn(l,g.value,g.defaultValue);break e;case"select":f=g.value,f!=null&&ea(l,!!g.multiple,f,!1)}}}var Jp=!1;function yy(l,f,g){if(Jp)return l(f,g);Jp=!0;try{var x=l(f);return x}finally{if(Jp=!1,(nu!==null||Yl!==null)&&(Vs(),nu&&(f=nu,l=Yl,Yl=nu=null,vy(f),l)))for(f=0;f<l.length;f++)vy(l[f])}}function pf(l,f){var g=l.stateNode;if(g===null)return null;var x=g[li]||null;if(x===null)return null;g=x[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(l=l.type,x=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!x;break e;default:l=!1}if(l)return null;if(g&&typeof g!="function")throw Error(r(231,f,typeof g));return g}var oo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xy=!1;if(oo)try{var mf={};Object.defineProperty(mf,"passive",{get:function(){xy=!0}}),window.addEventListener("test",mf,mf),window.removeEventListener("test",mf,mf)}catch{xy=!1}var Ga=null,Zp=null,ru=null;function $d(){if(ru)return ru;var l,f=Zp,g=f.length,x,O="value"in Ga?Ga.value:Ga.textContent,N=O.length;for(l=0;l<g&&f[l]===O[l];l++);var G=g-l;for(x=1;x<=G&&f[g-x]===O[N-x];x++);return ru=O.slice(l,1<x?1-x:void 0)}function Xd(l){var f=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&f===13&&(l=13)):l=f,l===10&&(l=13),32<=l||l===13?l:0}function gf(){return!0}function T1(){return!1}function ta(l){function f(g,x,O,N,G){this._reactName=g,this._targetInst=O,this.type=x,this.nativeEvent=N,this.target=G,this.currentTarget=null;for(var Z in l)l.hasOwnProperty(Z)&&(g=l[Z],this[Z]=g?g(N):N[Z]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?gf:T1,this.isPropagationStopped=T1,this}return p(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=gf)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=gf)},persist:function(){},isPersistent:gf}),f}var Jl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kd=ta(Jl),vf=p({},Jl,{view:0,detail:0}),C1=ta(vf),Yd,Qp,yf,xf=p({},vf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rm,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==yf&&(yf&&l.type==="mousemove"?(Yd=l.screenX-yf.screenX,Qp=l.screenY-yf.screenY):Qp=Yd=0,yf=l),Yd)},movementY:function(l){return"movementY"in l?l.movementY:Qp}}),by=ta(xf),R1=p({},xf,{dataTransfer:0}),O1=ta(R1),_y=p({},vf,{relatedTarget:0}),em=ta(_y),P1=p({},Jl,{animationName:0,elapsedTime:0,pseudoElement:0}),IT=ta(P1),BT=p({},Jl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),D1=ta(BT),Jd=p({},Jl,{data:0}),tm=ta(Jd),nm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},N1={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"},I1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sy(l){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(l):(l=I1[l])?!!f[l]:!1}function rm(){return Sy}var B1=p({},vf,{key:function(l){if(l.key){var f=nm[l.key]||l.key;if(f!=="Unidentified")return f}return l.type==="keypress"?(l=Xd(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?N1[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rm,charCode:function(l){return l.type==="keypress"?Xd(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Xd(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),iu=ta(B1),im=p({},xf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ay=ta(im),wy=p({},vf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rm}),L1=ta(wy),k1=p({},Jl,{propertyName:0,elapsedTime:0,pseudoElement:0}),LT=ta(k1),Pi=p({},xf,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),F1=ta(Pi),U1=p({},Jl,{newState:0,oldState:0}),j1=ta(U1),z1=[9,13,27,32],au=oo&&"CompositionEvent"in window,bf=null;oo&&"documentMode"in document&&(bf=document.documentMode);var am=oo&&"TextEvent"in window&&!bf,My=oo&&(!au||bf&&8<bf&&11>=bf),G1=" ",Zd=!1;function sm(l,f){switch(l){case"keyup":return z1.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ey(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var su=!1;function H1(l,f){switch(l){case"compositionend":return Ey(f);case"keypress":return f.which!==32?null:(Zd=!0,G1);case"textInput":return l=f.data,l===G1&&Zd?null:l;default:return null}}function Ty(l,f){if(su)return l==="compositionend"||!au&&sm(l,f)?(l=$d(),ru=Zp=Ga=null,su=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return My&&f.locale!=="ko"?null:f.data;default:return null}}var Cy={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 Ry(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f==="input"?!!Cy[l.type]:f==="textarea"}function om(l,f,g,x){nu?Yl?Yl.push(x):Yl=[x]:nu=x,f=X_(f,"onChange"),0<f.length&&(g=new Kd("onChange","change",null,g,x),l.push({event:g,listeners:f}))}var Zl=null,ou=null;function V1(l){Wk(l,0)}function _f(l){var f=Kl(l);if(rn(f))return l}function Oy(l,f){if(l==="change")return f}var lo=!1;if(oo){var Qd;if(oo){var Py="oninput"in document;if(!Py){var Dy=document.createElement("div");Dy.setAttribute("oninput","return;"),Py=typeof Dy.oninput=="function"}Qd=Py}else Qd=!1;lo=Qd&&(!document.documentMode||9<document.documentMode)}function hs(){Zl&&(Zl.detachEvent("onpropertychange",eh),ou=Zl=null)}function eh(l){if(l.propertyName==="value"&&_f(ou)){var f=[];om(f,ou,l,Yp(l)),yy(V1,f)}}function W1(l,f,g){l==="focusin"?(hs(),Zl=f,ou=g,Zl.attachEvent("onpropertychange",eh)):l==="focusout"&&hs()}function Ny(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return _f(ou)}function q1(l,f){if(l==="click")return _f(f)}function $1(l,f){if(l==="input"||l==="change")return _f(f)}function Iy(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var na=typeof Object.is=="function"?Object.is:Iy;function Sf(l,f){if(na(l,f))return!0;if(typeof l!="object"||l===null||typeof f!="object"||f===null)return!1;var g=Object.keys(l),x=Object.keys(f);if(g.length!==x.length)return!1;for(x=0;x<g.length;x++){var O=g[x];if(!At.call(f,O)||!na(l[O],f[O]))return!1}return!0}function th(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function Af(l,f){var g=th(l);l=0;for(var x;g;){if(g.nodeType===3){if(x=l+g.textContent.length,l<=f&&x>=f)return{node:g,offset:f-l};l=x}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=th(g)}}function or(l,f){return l&&f?l===f?!0:l&&l.nodeType===3?!1:f&&f.nodeType===3?or(l,f.parentNode):"contains"in l?l.contains(f):l.compareDocumentPosition?!!(l.compareDocumentPosition(f)&16):!1:!1}function X1(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var f=gt(l.document);f instanceof l.HTMLIFrameElement;){try{var g=typeof f.contentWindow.location.href=="string"}catch{g=!1}if(g)l=f.contentWindow;else break;f=gt(l.document)}return f}function By(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f&&(f==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||f==="textarea"||l.contentEditable==="true")}var K1=oo&&"documentMode"in document&&11>=document.documentMode,co=null,uo=null,wf=null,lm=!1;function Mf(l,f,g){var x=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;lm||co==null||co!==gt(x)||(x=co,"selectionStart"in x&&By(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),wf&&Sf(wf,x)||(wf=x,x=X_(uo,"onSelect"),0<x.length&&(f=new Kd("onSelect","select",null,f,g),l.push({event:f,listeners:x}),f.target=co)))}function qi(l,f){var g={};return g[l.toLowerCase()]=f.toLowerCase(),g["Webkit"+l]="webkit"+f,g["Moz"+l]="moz"+f,g}var lu={animationend:qi("Animation","AnimationEnd"),animationiteration:qi("Animation","AnimationIteration"),animationstart:qi("Animation","AnimationStart"),transitionrun:qi("Transition","TransitionRun"),transitionstart:qi("Transition","TransitionStart"),transitioncancel:qi("Transition","TransitionCancel"),transitionend:qi("Transition","TransitionEnd")},nh={},Ly={};oo&&(Ly=document.createElement("div").style,"AnimationEvent"in window||(delete lu.animationend.animation,delete lu.animationiteration.animation,delete lu.animationstart.animation),"TransitionEvent"in window||delete lu.transitionend.transition);function al(l){if(nh[l])return nh[l];if(!lu[l])return l;var f=lu[l],g;for(g in f)if(f.hasOwnProperty(g)&&g in Ly)return nh[l]=f[g];return l}var cm=al("animationend"),rh=al("animationiteration"),ky=al("animationstart"),Y1=al("transitionrun"),kT=al("transitionstart"),J1=al("transitioncancel"),Fy=al("transitionend"),ps=new Map,ih="abort auxClick beforeToggle 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(" ");ih.push("scrollEnd");function ms(l,f){ps.set(l,f),Te(f,[l])}var ah=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},gs=[],sl=0,bi=0;function sh(){for(var l=sl,f=bi=sl=0;f<l;){var g=gs[f];gs[f++]=null;var x=gs[f];gs[f++]=null;var O=gs[f];gs[f++]=null;var N=gs[f];if(gs[f++]=null,x!==null&&O!==null){var G=x.pending;G===null?O.next=O:(O.next=G.next,G.next=O),x.pending=O}N!==0&&Ql(g,O,N)}}function _i(l,f,g,x){gs[sl++]=l,gs[sl++]=f,gs[sl++]=g,gs[sl++]=x,bi|=x,l.lanes|=x,l=l.alternate,l!==null&&(l.lanes|=x)}function um(l,f,g,x){return _i(l,f,g,x),vs(l)}function ra(l,f){return _i(l,null,null,f),vs(l)}function Ql(l,f,g){l.lanes|=g;var x=l.alternate;x!==null&&(x.lanes|=g);for(var O=!1,N=l.return;N!==null;)N.childLanes|=g,x=N.alternate,x!==null&&(x.childLanes|=g),N.tag===22&&(l=N.stateNode,l===null||l._visibility&1||(O=!0)),l=N,N=N.return;return l.tag===3?(N=l.stateNode,O&&f!==null&&(O=31-se(g),l=N.hiddenUpdates,x=l[O],x===null?l[O]=[f]:x.push(f),f.lane=g|536870912),N):null}function vs(l){if(50<yc)throw yc=0,Tu=null,Error(r(185));for(var f=l.return;f!==null;)l=f,f=l.return;return l.tag===3?l.stateNode:null}var ec={};function Uy(l,f,g,x){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(l,f,g,x){return new Uy(l,f,g,x)}function fm(l){return l=l.prototype,!(!l||!l.isReactComponent)}function ga(l,f){var g=l.alternate;return g===null?(g=Tr(l.tag,f,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=f,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&65011712,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,f=l.dependencies,g.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g.refCleanup=l.refCleanup,g}function Ef(l,f){l.flags&=65011714;var g=l.alternate;return g===null?(l.childLanes=0,l.lanes=f,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=g.childLanes,l.lanes=g.lanes,l.child=g.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=g.memoizedProps,l.memoizedState=g.memoizedState,l.updateQueue=g.updateQueue,l.type=g.type,f=g.dependencies,l.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),l}function fo(l,f,g,x,O,N){var G=0;if(x=l,typeof l=="function")fm(l)&&(G=1);else if(typeof l=="string")G=PQ(l,g,Se.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case B:return l=Tr(31,g,f,O),l.elementType=B,l.lanes=N,l;case w:return tc(g.children,O,N,f);case _:G=8,O|=24;break;case S:return l=Tr(12,g,f,O|2),l.elementType=S,l.lanes=N,l;case R:return l=Tr(13,g,f,O),l.elementType=R,l.lanes=N,l;case D:return l=Tr(19,g,f,O),l.elementType=D,l.lanes=N,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case T:G=10;break e;case E:G=9;break e;case P:G=11;break e;case I:G=14;break e;case k:G=16,x=null;break e}G=29,g=Error(r(130,l===null?"null":typeof l,"")),x=null}return f=Tr(G,g,f,O),f.elementType=l,f.type=x,f.lanes=N,f}function tc(l,f,g,x){return l=Tr(7,l,x,f),l.lanes=g,l}function dm(l,f,g){return l=Tr(6,l,null,f),l.lanes=g,l}function Tf(l){var f=Tr(18,null,null,0);return f.stateNode=l,f}function hm(l,f,g){return f=Tr(4,l.children!==null?l.children:[],l.key,f),f.lanes=g,f.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},f}var oh=new WeakMap;function Ha(l,f){if(typeof l=="object"&&l!==null){var g=oh.get(l);return g!==void 0?g:(f={value:l,source:f,stack:re(f)},oh.set(l,f),f)}return{value:l,source:f,stack:re(f)}}var nc=[],rc=0,Cf=null,Rf=0,va=[],yr=0,ol=null,Cr=1,js="";function ho(l,f){nc[rc++]=Rf,nc[rc++]=Cf,Cf=l,Rf=f}function Z1(l,f,g){va[yr++]=Cr,va[yr++]=js,va[yr++]=ol,ol=l;var x=Cr;l=js;var O=32-se(x)-1;x&=~(1<<O),g+=1;var N=32-se(f)+O;if(30<N){var G=O-O%5;N=(x&(1<<G)-1).toString(32),x>>=G,O-=G,Cr=1<<32-se(f)+O|g<<O|x,js=N+l}else Cr=1<<N|g<<O|x,js=l}function po(l){l.return!==null&&(ho(l,1),Z1(l,1,0))}function pm(l){for(;l===Cf;)Cf=nc[--rc],nc[rc]=null,Rf=nc[--rc],nc[rc]=null;for(;l===ol;)ol=va[--yr],va[yr]=null,js=va[--yr],va[yr]=null,Cr=va[--yr],va[yr]=null}function mm(l,f){va[yr++]=Cr,va[yr++]=js,va[yr++]=ol,Cr=f.id,js=f.overflow,ol=l}var Br=null,lr=null,Rn=!1,ll=null,Va=!1,Of=Error(r(519));function mo(l){var f=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw go(Ha(f,l)),Of}function Q1(l){var f=l.stateNode,g=l.type,x=l.memoizedProps;switch(f[Er]=l,f[li]=x,g){case"dialog":Dn("cancel",f),Dn("close",f);break;case"iframe":case"object":case"embed":Dn("load",f);break;case"video":case"audio":for(g=0;g<Os.length;g++)Dn(Os[g],f);break;case"source":Dn("error",f);break;case"img":case"image":case"link":Dn("error",f),Dn("load",f);break;case"details":Dn("toggle",f);break;case"input":Dn("invalid",f),Us(f,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0);break;case"select":Dn("invalid",f);break;case"textarea":Dn("invalid",f),ci(f,x.value,x.defaultValue,x.children)}g=x.children,typeof g!="string"&&typeof g!="number"&&typeof g!="bigint"||f.textContent===""+g||x.suppressHydrationWarning===!0||Kk(f.textContent,g)?(x.popover!=null&&(Dn("beforetoggle",f),Dn("toggle",f)),x.onScroll!=null&&Dn("scroll",f),x.onScrollEnd!=null&&Dn("scrollend",f),x.onClick!=null&&(f.onclick=il),f=!0):f=!1,f||mo(l,!0)}function e_(l){for(Br=l.return;Br;)switch(Br.tag){case 5:case 31:case 13:Va=!1;return;case 27:case 3:Va=!0;return;default:Br=Br.return}}function Pf(l){if(l!==Br)return!1;if(!Rn)return e_(l),Rn=!0,!1;var f=l.tag,g;if((g=f!==3&&f!==27)&&((g=f===5)&&(g=l.type,g=!(g!=="form"&&g!=="button")||QT(l.type,l.memoizedProps)),g=!g),g&&lr&&mo(l),e_(l),f===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));lr=i2(l)}else if(f===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));lr=i2(l)}else f===27?(f=lr,Jf(l.type)?(l=iC,iC=null,lr=l):lr=f):lr=Br?Oo(l.stateNode.nextSibling):null;return!0}function ic(){lr=Br=null,Rn=!1}function gm(){var l=ll;return l!==null&&(kr===null?kr=l:kr.push.apply(kr,l),ll=null),l}function go(l){ll===null?ll=[l]:ll.push(l)}var Df=X(null),ac=null,vo=null;function cl(l,f,g){ue(Df,f._currentValue),f._currentValue=g}function yo(l){l._currentValue=Df.current,ae(Df)}function vm(l,f,g){for(;l!==null;){var x=l.alternate;if((l.childLanes&f)!==f?(l.childLanes|=f,x!==null&&(x.childLanes|=f)):x!==null&&(x.childLanes&f)!==f&&(x.childLanes|=f),l===g)break;l=l.return}}function ym(l,f,g,x){var O=l.child;for(O!==null&&(O.return=l);O!==null;){var N=O.dependencies;if(N!==null){var G=O.child;N=N.firstContext;e:for(;N!==null;){var Z=N;N=O;for(var le=0;le<f.length;le++)if(Z.context===f[le]){N.lanes|=g,Z=N.alternate,Z!==null&&(Z.lanes|=g),vm(N.return,g,l),x||(G=null);break e}N=Z.next}}else if(O.tag===18){if(G=O.return,G===null)throw Error(r(341));G.lanes|=g,N=G.alternate,N!==null&&(N.lanes|=g),vm(G,g,l),G=null}else G=O.child;if(G!==null)G.return=O;else for(G=O;G!==null;){if(G===l){G=null;break}if(O=G.sibling,O!==null){O.return=G.return,G=O;break}G=G.return}O=G}}function xo(l,f,g,x){l=null;for(var O=f,N=!1;O!==null;){if(!N){if((O.flags&524288)!==0)N=!0;else if((O.flags&262144)!==0)break}if(O.tag===10){var G=O.alternate;if(G===null)throw Error(r(387));if(G=G.memoizedProps,G!==null){var Z=O.type;na(O.pendingProps.value,G.value)||(l!==null?l.push(Z):l=[Z])}}else if(O===ve.current){if(G=O.alternate,G===null)throw Error(r(387));G.memoizedState.memoizedState!==O.memoizedState.memoizedState&&(l!==null?l.push(L0):l=[L0])}O=O.return}l!==null&&ym(f,l,g,x),f.flags|=262144}function lh(l){for(l=l.firstContext;l!==null;){if(!na(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function sc(l){ac=l,vo=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Qt(l){return t_(ac,l)}function Nf(l,f){return ac===null&&sc(l),t_(l,f)}function t_(l,f){var g=f._currentValue;if(f={context:f,memoizedValue:g,next:null},vo===null){if(l===null)throw Error(r(308));vo=f,l.dependencies={lanes:0,firstContext:f},l.flags|=524288}else vo=vo.next=f;return g}var n_=typeof AbortController<"u"?AbortController:function(){var l=[],f=this.signal={aborted:!1,addEventListener:function(g,x){l.push(x)}};this.abort=function(){f.aborted=!0,l.forEach(function(g){return g()})}},FT=t.unstable_scheduleCallback,UT=t.unstable_NormalPriority,Qr={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jy(){return{controller:new n_,data:new Map,refCount:0}}function cu(l){l.refCount--,l.refCount===0&&FT(UT,function(){l.controller.abort()})}var Wa=null,xm=0,ul=0,ys=null;function zy(l,f){if(Wa===null){var g=Wa=[];xm=0,ul=De(),ys={status:"pending",value:void 0,then:function(x){g.push(x)}}}return xm++,f.then(Gy,Gy),f}function Gy(){if(--xm===0&&Wa!==null){ys!==null&&(ys.status="fulfilled");var l=Wa;Wa=null,ul=0,ys=null;for(var f=0;f<l.length;f++)(0,l[f])()}}function Hy(l,f){var g=[],x={status:"pending",value:null,reason:null,then:function(O){g.push(O)}};return l.then(function(){x.status="fulfilled",x.value=f;for(var O=0;O<g.length;O++)(0,g[O])(f)},function(O){for(x.status="rejected",x.reason=O,O=0;O<g.length;O++)(0,g[O])(void 0)}),x}var r_=V.S;V.S=function(l,f){O0=H(),typeof f=="object"&&f!==null&&typeof f.then=="function"&&zy(l,f),r_!==null&&r_(l,f)};var oc=X(null);function bm(){var l=oc.current;return l!==null?l:nn.pooledCache}function ch(l,f){f===null?ue(oc,oc.current):ue(oc,f.pool)}function Vy(){var l=bm();return l===null?null:{parent:Qr._currentValue,pool:l}}var uu=Error(r(460)),uh=Error(r(474)),pn=Error(r(542)),_m={then:function(){}};function ya(l){return l=l.status,l==="fulfilled"||l==="rejected"}function Sm(l,f,g){switch(g=l[g],g===void 0?l.push(f):g!==f&&(f.then(il,il),f=g),f.status){case"fulfilled":return f.value;case"rejected":throw l=f.reason,hu(l),l;default:if(typeof f.status=="string")f.then(il,il);else{if(l=nn,l!==null&&100<l.shellSuspendCounter)throw Error(r(482));l=f,l.status="pending",l.then(function(x){if(f.status==="pending"){var O=f;O.status="fulfilled",O.value=x}},function(x){if(f.status==="pending"){var O=f;O.status="rejected",O.reason=x}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw l=f.reason,hu(l),l}throw bo=f,uu}}function fu(l){try{var f=l._init;return f(l._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?(bo=g,uu):g}}var bo=null;function du(){if(bo===null)throw Error(r(459));var l=bo;return bo=null,l}function hu(l){if(l===uu||l===pn)throw Error(r(483))}var pu=null,mu=0;function fh(l){var f=mu;return mu+=1,pu===null&&(pu=[]),Sm(pu,l,f)}function xs(l,f){f=f.props.ref,l.ref=f!==void 0?f:null}function If(l,f){throw f.$$typeof===v?Error(r(525)):(l=Object.prototype.toString.call(f),Error(r(31,l==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":l)))}function Am(l){function f(ye,pe){if(l){var Me=ye.deletions;Me===null?(ye.deletions=[pe],ye.flags|=16):Me.push(pe)}}function g(ye,pe){if(!l)return null;for(;pe!==null;)f(ye,pe),pe=pe.sibling;return null}function x(ye){for(var pe=new Map;ye!==null;)ye.key!==null?pe.set(ye.key,ye):pe.set(ye.index,ye),ye=ye.sibling;return pe}function O(ye,pe){return ye=ga(ye,pe),ye.index=0,ye.sibling=null,ye}function N(ye,pe,Me){return ye.index=Me,l?(Me=ye.alternate,Me!==null?(Me=Me.index,Me<pe?(ye.flags|=67108866,pe):Me):(ye.flags|=67108866,pe)):(ye.flags|=1048576,pe)}function G(ye){return l&&ye.alternate===null&&(ye.flags|=67108866),ye}function Z(ye,pe,Me,qe){return pe===null||pe.tag!==6?(pe=dm(Me,ye.mode,qe),pe.return=ye,pe):(pe=O(pe,Me),pe.return=ye,pe)}function le(ye,pe,Me,qe){var Wt=Me.type;return Wt===w?ze(ye,pe,Me.props.children,qe,Me.key):pe!==null&&(pe.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===k&&fu(Wt)===pe.type)?(pe=O(pe,Me.props),xs(pe,Me),pe.return=ye,pe):(pe=fo(Me.type,Me.key,Me.props,null,ye.mode,qe),xs(pe,Me),pe.return=ye,pe)}function Ee(ye,pe,Me,qe){return pe===null||pe.tag!==4||pe.stateNode.containerInfo!==Me.containerInfo||pe.stateNode.implementation!==Me.implementation?(pe=hm(Me,ye.mode,qe),pe.return=ye,pe):(pe=O(pe,Me.children||[]),pe.return=ye,pe)}function ze(ye,pe,Me,qe,Wt){return pe===null||pe.tag!==7?(pe=tc(Me,ye.mode,qe,Wt),pe.return=ye,pe):(pe=O(pe,Me),pe.return=ye,pe)}function Ke(ye,pe,Me){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return pe=dm(""+pe,ye.mode,Me),pe.return=ye,pe;if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case y:return Me=fo(pe.type,pe.key,pe.props,null,ye.mode,Me),xs(Me,pe),Me.return=ye,Me;case b:return pe=hm(pe,ye.mode,Me),pe.return=ye,pe;case k:return pe=fu(pe),Ke(ye,pe,Me)}if(Q(pe)||q(pe))return pe=tc(pe,ye.mode,Me,null),pe.return=ye,pe;if(typeof pe.then=="function")return Ke(ye,fh(pe),Me);if(pe.$$typeof===T)return Ke(ye,Nf(ye,pe),Me);If(ye,pe)}return null}function Oe(ye,pe,Me,qe){var Wt=pe!==null?pe.key:null;if(typeof Me=="string"&&Me!==""||typeof Me=="number"||typeof Me=="bigint")return Wt!==null?null:Z(ye,pe,""+Me,qe);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case y:return Me.key===Wt?le(ye,pe,Me,qe):null;case b:return Me.key===Wt?Ee(ye,pe,Me,qe):null;case k:return Me=fu(Me),Oe(ye,pe,Me,qe)}if(Q(Me)||q(Me))return Wt!==null?null:ze(ye,pe,Me,qe,null);if(typeof Me.then=="function")return Oe(ye,pe,fh(Me),qe);if(Me.$$typeof===T)return Oe(ye,pe,Nf(ye,Me),qe);If(ye,Me)}return null}function ke(ye,pe,Me,qe,Wt){if(typeof qe=="string"&&qe!==""||typeof qe=="number"||typeof qe=="bigint")return ye=ye.get(Me)||null,Z(pe,ye,""+qe,Wt);if(typeof qe=="object"&&qe!==null){switch(qe.$$typeof){case y:return ye=ye.get(qe.key===null?Me:qe.key)||null,le(pe,ye,qe,Wt);case b:return ye=ye.get(qe.key===null?Me:qe.key)||null,Ee(pe,ye,qe,Wt);case k:return qe=fu(qe),ke(ye,pe,Me,qe,Wt)}if(Q(qe)||q(qe))return ye=ye.get(Me)||null,ze(pe,ye,qe,Wt,null);if(typeof qe.then=="function")return ke(ye,pe,Me,fh(qe),Wt);if(qe.$$typeof===T)return ke(ye,pe,Me,Nf(pe,qe),Wt);If(pe,qe)}return null}function Nt(ye,pe,Me,qe){for(var Wt=null,$n=null,Ft=pe,xn=pe=0,kn=null;Ft!==null&&xn<Me.length;xn++){Ft.index>xn?(kn=Ft,Ft=null):kn=Ft.sibling;var Xn=Oe(ye,Ft,Me[xn],qe);if(Xn===null){Ft===null&&(Ft=kn);break}l&&Ft&&Xn.alternate===null&&f(ye,Ft),pe=N(Xn,pe,xn),$n===null?Wt=Xn:$n.sibling=Xn,$n=Xn,Ft=kn}if(xn===Me.length)return g(ye,Ft),Rn&&ho(ye,xn),Wt;if(Ft===null){for(;xn<Me.length;xn++)Ft=Ke(ye,Me[xn],qe),Ft!==null&&(pe=N(Ft,pe,xn),$n===null?Wt=Ft:$n.sibling=Ft,$n=Ft);return Rn&&ho(ye,xn),Wt}for(Ft=x(Ft);xn<Me.length;xn++)kn=ke(Ft,ye,xn,Me[xn],qe),kn!==null&&(l&&kn.alternate!==null&&Ft.delete(kn.key===null?xn:kn.key),pe=N(kn,pe,xn),$n===null?Wt=kn:$n.sibling=kn,$n=kn);return l&&Ft.forEach(function(nd){return f(ye,nd)}),Rn&&ho(ye,xn),Wt}function Zt(ye,pe,Me,qe){if(Me==null)throw Error(r(151));for(var Wt=null,$n=null,Ft=pe,xn=pe=0,kn=null,Xn=Me.next();Ft!==null&&!Xn.done;xn++,Xn=Me.next()){Ft.index>xn?(kn=Ft,Ft=null):kn=Ft.sibling;var nd=Oe(ye,Ft,Xn.value,qe);if(nd===null){Ft===null&&(Ft=kn);break}l&&Ft&&nd.alternate===null&&f(ye,Ft),pe=N(nd,pe,xn),$n===null?Wt=nd:$n.sibling=nd,$n=nd,Ft=kn}if(Xn.done)return g(ye,Ft),Rn&&ho(ye,xn),Wt;if(Ft===null){for(;!Xn.done;xn++,Xn=Me.next())Xn=Ke(ye,Xn.value,qe),Xn!==null&&(pe=N(Xn,pe,xn),$n===null?Wt=Xn:$n.sibling=Xn,$n=Xn);return Rn&&ho(ye,xn),Wt}for(Ft=x(Ft);!Xn.done;xn++,Xn=Me.next())Xn=ke(Ft,ye,xn,Xn.value,qe),Xn!==null&&(l&&Xn.alternate!==null&&Ft.delete(Xn.key===null?xn:Xn.key),pe=N(Xn,pe,xn),$n===null?Wt=Xn:$n.sibling=Xn,$n=Xn);return l&&Ft.forEach(function(GQ){return f(ye,GQ)}),Rn&&ho(ye,xn),Wt}function fr(ye,pe,Me,qe){if(typeof Me=="object"&&Me!==null&&Me.type===w&&Me.key===null&&(Me=Me.props.children),typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case y:e:{for(var Wt=Me.key;pe!==null;){if(pe.key===Wt){if(Wt=Me.type,Wt===w){if(pe.tag===7){g(ye,pe.sibling),qe=O(pe,Me.props.children),qe.return=ye,ye=qe;break e}}else if(pe.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===k&&fu(Wt)===pe.type){g(ye,pe.sibling),qe=O(pe,Me.props),xs(qe,Me),qe.return=ye,ye=qe;break e}g(ye,pe);break}else f(ye,pe);pe=pe.sibling}Me.type===w?(qe=tc(Me.props.children,ye.mode,qe,Me.key),qe.return=ye,ye=qe):(qe=fo(Me.type,Me.key,Me.props,null,ye.mode,qe),xs(qe,Me),qe.return=ye,ye=qe)}return G(ye);case b:e:{for(Wt=Me.key;pe!==null;){if(pe.key===Wt)if(pe.tag===4&&pe.stateNode.containerInfo===Me.containerInfo&&pe.stateNode.implementation===Me.implementation){g(ye,pe.sibling),qe=O(pe,Me.children||[]),qe.return=ye,ye=qe;break e}else{g(ye,pe);break}else f(ye,pe);pe=pe.sibling}qe=hm(Me,ye.mode,qe),qe.return=ye,ye=qe}return G(ye);case k:return Me=fu(Me),fr(ye,pe,Me,qe)}if(Q(Me))return Nt(ye,pe,Me,qe);if(q(Me)){if(Wt=q(Me),typeof Wt!="function")throw Error(r(150));return Me=Wt.call(Me),Zt(ye,pe,Me,qe)}if(typeof Me.then=="function")return fr(ye,pe,fh(Me),qe);if(Me.$$typeof===T)return fr(ye,pe,Nf(ye,Me),qe);If(ye,Me)}return typeof Me=="string"&&Me!==""||typeof Me=="number"||typeof Me=="bigint"?(Me=""+Me,pe!==null&&pe.tag===6?(g(ye,pe.sibling),qe=O(pe,Me),qe.return=ye,ye=qe):(g(ye,pe),qe=dm(Me,ye.mode,qe),qe.return=ye,ye=qe),G(ye)):g(ye,pe)}return function(ye,pe,Me,qe){try{mu=0;var Wt=fr(ye,pe,Me,qe);return pu=null,Wt}catch(Ft){if(Ft===uu||Ft===pn)throw Ft;var $n=Tr(29,Ft,null,ye.mode);return $n.lanes=qe,$n.return=ye,$n}}}var fl=Am(!0),wm=Am(!1),ia=!1;function dh(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wy(l,f){l=l.updateQueue,f.updateQueue===l&&(f.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function dl(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function lc(l,f,g){var x=l.updateQueue;if(x===null)return null;if(x=x.shared,(Ut&2)!==0){var O=x.pending;return O===null?f.next=f:(f.next=O.next,O.next=f),x.pending=f,f=vs(l),Ql(l,null,g),f}return _i(l,x,f,g),vs(l)}function cc(l,f,g){if(f=f.updateQueue,f!==null&&(f=f.shared,(g&4194048)!==0)){var x=f.lanes;x&=l.pendingLanes,g|=x,f.lanes=g,ql(l,g)}}function Vt(l,f){var g=l.updateQueue,x=l.alternate;if(x!==null&&(x=x.updateQueue,g===x)){var O=null,N=null;if(g=g.firstBaseUpdate,g!==null){do{var G={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};N===null?O=N=G:N=N.next=G,g=g.next}while(g!==null);N===null?O=N=f:N=N.next=f}else O=N=f;g={baseState:x.baseState,firstBaseUpdate:O,lastBaseUpdate:N,shared:x.shared,callbacks:x.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=f:l.next=f,g.lastBaseUpdate=f}var qy=!1;function hh(){if(qy){var l=ys;if(l!==null)throw l}}function Bf(l,f,g,x){qy=!1;var O=l.updateQueue;ia=!1;var N=O.firstBaseUpdate,G=O.lastBaseUpdate,Z=O.shared.pending;if(Z!==null){O.shared.pending=null;var le=Z,Ee=le.next;le.next=null,G===null?N=Ee:G.next=Ee,G=le;var ze=l.alternate;ze!==null&&(ze=ze.updateQueue,Z=ze.lastBaseUpdate,Z!==G&&(Z===null?ze.firstBaseUpdate=Ee:Z.next=Ee,ze.lastBaseUpdate=le))}if(N!==null){var Ke=O.baseState;G=0,ze=Ee=le=null,Z=N;do{var Oe=Z.lane&-536870913,ke=Oe!==Z.lane;if(ke?(fn&Oe)===Oe:(x&Oe)===Oe){Oe!==0&&Oe===ul&&(qy=!0),ze!==null&&(ze=ze.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var Nt=l,Zt=Z;Oe=f;var fr=g;switch(Zt.tag){case 1:if(Nt=Zt.payload,typeof Nt=="function"){Ke=Nt.call(fr,Ke,Oe);break e}Ke=Nt;break e;case 3:Nt.flags=Nt.flags&-65537|128;case 0:if(Nt=Zt.payload,Oe=typeof Nt=="function"?Nt.call(fr,Ke,Oe):Nt,Oe==null)break e;Ke=p({},Ke,Oe);break e;case 2:ia=!0}}Oe=Z.callback,Oe!==null&&(l.flags|=64,ke&&(l.flags|=8192),ke=O.callbacks,ke===null?O.callbacks=[Oe]:ke.push(Oe))}else ke={lane:Oe,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},ze===null?(Ee=ze=ke,le=Ke):ze=ze.next=ke,G|=Oe;if(Z=Z.next,Z===null){if(Z=O.shared.pending,Z===null)break;ke=Z,Z=ke.next,ke.next=null,O.lastBaseUpdate=ke,O.shared.pending=null}}while(!0);ze===null&&(le=Ke),O.baseState=le,O.firstBaseUpdate=Ee,O.lastBaseUpdate=ze,N===null&&(O.shared.lanes=0),To|=G,l.lanes=G,l.memoizedState=Ke}}function Lf(l,f){if(typeof l!="function")throw Error(r(191,l));l.call(f)}function i_(l,f){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;l<g.length;l++)Lf(g[l],f)}var kf=X(null),Mm=X(0);function a_(l,f){l=Ka,ue(Mm,l),ue(kf,f),Ka=l|f.baseLanes}function $y(){ue(Mm,Ka),ue(kf,kf.current)}function ph(){Ka=Mm.current,ae(kf),ae(Mm)}var xa=X(null),aa=null;function hl(l){var f=l.alternate;ue(On,On.current&1),ue(xa,l),aa===null&&(f===null||kf.current!==null||f.memoizedState!==null)&&(aa=l)}function Xy(l){ue(On,On.current),ue(xa,l),aa===null&&(aa=l)}function s_(l){l.tag===22?(ue(On,On.current),ue(xa,l),aa===null&&(aa=l)):ba()}function ba(){ue(On,On.current),ue(xa,xa.current)}function Hr(l){ae(xa),aa===l&&(aa=null),ae(On)}var On=X(0);function qa(l){for(var f=l;f!==null;){if(f.tag===13){var g=f.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||nC(g)||rC(g)))return f}else if(f.tag===19&&(f.memoizedProps.revealOrder==="forwards"||f.memoizedProps.revealOrder==="backwards"||f.memoizedProps.revealOrder==="unstable_legacy-backwards"||f.memoizedProps.revealOrder==="together")){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var xr=0,on=null,er=null,wn=null,bs=!1,Ff=!1,gu=!1,Em=0,mh=0,Uf=null,Ky=0;function Rr(){throw Error(r(321))}function Yy(l,f){if(f===null)return!1;for(var g=0;g<f.length&&g<l.length;g++)if(!na(l[g],f[g]))return!1;return!0}function Tm(l,f,g,x,O,N){return xr=N,on=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,V.H=l===null||l.memoizedState===null?F_:g0,gu=!1,N=g(x,O),gu=!1,Ff&&(N=vu(f,g,x,O)),o_(l),N}function o_(l){V.H=jf;var f=er!==null&&er.next!==null;if(xr=0,wn=er=on=null,bs=!1,mh=0,Uf=null,f)throw Error(r(300));l===null||ei||(l=l.dependencies,l!==null&&lh(l)&&(ei=!0))}function vu(l,f,g,x){on=l;var O=0;do{if(Ff&&(Uf=null),mh=0,Ff=!1,25<=O)throw Error(r(301));if(O+=1,wn=er=null,l.updateQueue!=null){var N=l.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}V.H=_s,N=f(g,x)}while(Ff);return N}function yu(){var l=V.H,f=l.useState()[0];return f=typeof f.then=="function"?gh(f):f,l=l.useState()[0],(er!==null?er.memoizedState:null)!==l&&(on.flags|=1024),f}function Jy(){var l=Em!==0;return Em=0,l}function Zy(l,f,g){f.updateQueue=l.updateQueue,f.flags&=-2053,l.lanes&=~g}function Qy(l){if(bs){for(l=l.memoizedState;l!==null;){var f=l.queue;f!==null&&(f.pending=null),l=l.next}bs=!1}xr=0,wn=er=on=null,Ff=!1,mh=Em=0,Uf=null}function ui(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?on.memoizedState=wn=l:wn=wn.next=l,wn}function Vr(){if(er===null){var l=on.alternate;l=l!==null?l.memoizedState:null}else l=er.next;var f=wn===null?on.memoizedState:wn.next;if(f!==null)wn=f,er=l;else{if(l===null)throw on.alternate===null?Error(r(467)):Error(r(310));er=l,l={memoizedState:er.memoizedState,baseState:er.baseState,baseQueue:er.baseQueue,queue:er.queue,next:null},wn===null?on.memoizedState=wn=l:wn=wn.next=l}return wn}function Cm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gh(l){var f=mh;return mh+=1,Uf===null&&(Uf=[]),l=Sm(Uf,l,f),f=on,(wn===null?f.memoizedState:wn.next)===null&&(f=f.alternate,V.H=f===null||f.memoizedState===null?F_:g0),l}function uc(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return gh(l);if(l.$$typeof===T)return Qt(l)}throw Error(r(438,String(l)))}function e0(l){var f=null,g=on.updateQueue;if(g!==null&&(f=g.memoCache),f==null){var x=on.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(f={data:x.data.map(function(O){return O.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),g===null&&(g=Cm(),on.updateQueue=g),g.memoCache=f,g=f.data[f.index],g===void 0)for(g=f.data[f.index]=Array(l),x=0;x<l;x++)g[x]=U;return f.index++,g}function pl(l,f){return typeof f=="function"?f(l):f}function Rm(l){var f=Vr();return t0(f,er,l)}function t0(l,f,g){var x=l.queue;if(x===null)throw Error(r(311));x.lastRenderedReducer=g;var O=l.baseQueue,N=x.pending;if(N!==null){if(O!==null){var G=O.next;O.next=N.next,N.next=G}f.baseQueue=O=N,x.pending=null}if(N=l.baseState,O===null)l.memoizedState=N;else{f=O.next;var Z=G=null,le=null,Ee=f,ze=!1;do{var Ke=Ee.lane&-536870913;if(Ke!==Ee.lane?(fn&Ke)===Ke:(xr&Ke)===Ke){var Oe=Ee.revertLane;if(Oe===0)le!==null&&(le=le.next={lane:0,revertLane:0,gesture:null,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null}),Ke===ul&&(ze=!0);else if((xr&Oe)===Oe){Ee=Ee.next,Oe===ul&&(ze=!0);continue}else Ke={lane:0,revertLane:Ee.revertLane,gesture:null,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null},le===null?(Z=le=Ke,G=N):le=le.next=Ke,on.lanes|=Oe,To|=Oe;Ke=Ee.action,gu&&g(N,Ke),N=Ee.hasEagerState?Ee.eagerState:g(N,Ke)}else Oe={lane:Ke,revertLane:Ee.revertLane,gesture:Ee.gesture,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null},le===null?(Z=le=Oe,G=N):le=le.next=Oe,on.lanes|=Ke,To|=Ke;Ee=Ee.next}while(Ee!==null&&Ee!==f);if(le===null?G=N:le.next=Z,!na(N,l.memoizedState)&&(ei=!0,ze&&(g=ys,g!==null)))throw g;l.memoizedState=N,l.baseState=G,l.baseQueue=le,x.lastRenderedState=N}return O===null&&(x.lanes=0),[l.memoizedState,x.dispatch]}function n0(l){var f=Vr(),g=f.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=l;var x=g.dispatch,O=g.pending,N=f.memoizedState;if(O!==null){g.pending=null;var G=O=O.next;do N=l(N,G.action),G=G.next;while(G!==O);na(N,f.memoizedState)||(ei=!0),f.memoizedState=N,f.baseQueue===null&&(f.baseState=N),g.lastRenderedState=N}return[N,x]}function l_(l,f,g){var x=on,O=Vr(),N=Rn;if(N){if(g===void 0)throw Error(r(407));g=g()}else g=f();var G=!na((er||O).memoizedState,g);if(G&&(O.memoizedState=g,ei=!0),O=O.queue,u0(f_.bind(null,x,O,l),[l]),O.getSnapshot!==f||G||wn!==null&&wn.memoizedState.tag&1){if(x.flags|=2048,fc(9,{destroy:void 0},u_.bind(null,x,O,g,f),null),nn===null)throw Error(r(349));N||(xr&127)!==0||c_(x,f,g)}return g}function c_(l,f,g){l.flags|=16384,l={getSnapshot:f,value:g},f=on.updateQueue,f===null?(f=Cm(),on.updateQueue=f,f.stores=[l]):(g=f.stores,g===null?f.stores=[l]:g.push(l))}function u_(l,f,g,x){f.value=g,f.getSnapshot=x,d_(f)&&h_(l)}function f_(l,f,g){return g(function(){d_(f)&&h_(l)})}function d_(l){var f=l.getSnapshot;l=l.value;try{var g=f();return!na(l,g)}catch{return!0}}function h_(l){var f=ra(l,2);f!==null&&gn(f,l,2)}function r0(l){var f=ui();if(typeof l=="function"){var g=l;if(l=g(),gu){vt(!0);try{g()}finally{vt(!1)}}}return f.memoizedState=f.baseState=l,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pl,lastRenderedState:l},f}function i0(l,f,g,x){return l.baseState=g,t0(l,er,typeof x=="function"?x:pl)}function jT(l,f,g,x,O){if(Nm(l))throw Error(r(485));if(l=f.action,l!==null){var N={payload:O,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(G){N.listeners.push(G)}};V.T!==null?g(!0):N.isTransition=!1,x(N),g=f.pending,g===null?(N.next=f.pending=N,p_(f,N)):(N.next=g.next,f.pending=g.next=N)}}function p_(l,f){var g=f.action,x=f.payload,O=l.state;if(f.isTransition){var N=V.T,G={};V.T=G;try{var Z=g(O,x),le=V.S;le!==null&&le(G,Z),m_(l,f,Z)}catch(Ee){a0(l,f,Ee)}finally{N!==null&&G.types!==null&&(N.types=G.types),V.T=N}}else try{N=g(O,x),m_(l,f,N)}catch(Ee){a0(l,f,Ee)}}function m_(l,f,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(x){g_(l,f,x)},function(x){return a0(l,f,x)}):g_(l,f,g)}function g_(l,f,g){f.status="fulfilled",f.value=g,v_(f),l.state=g,f=l.pending,f!==null&&(g=f.next,g===f?l.pending=null:(g=g.next,f.next=g,p_(l,g)))}function a0(l,f,g){var x=l.pending;if(l.pending=null,x!==null){x=x.next;do f.status="rejected",f.reason=g,v_(f),f=f.next;while(f!==x)}l.action=null}function v_(l){l=l.listeners;for(var f=0;f<l.length;f++)(0,l[f])()}function s0(l,f){return f}function o0(l,f){if(Rn){var g=nn.formState;if(g!==null){e:{var x=on;if(Rn){if(lr){t:{for(var O=lr,N=Va;O.nodeType!==8;){if(!N){O=null;break t}if(O=Oo(O.nextSibling),O===null){O=null;break t}}N=O.data,O=N==="F!"||N==="F"?O:null}if(O){lr=Oo(O.nextSibling),x=O.data==="F!";break e}}mo(x)}x=!1}x&&(f=g[0])}}return g=ui(),g.memoizedState=g.baseState=f,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s0,lastRenderedState:f},g.queue=x,g=B_.bind(null,on,x),x.dispatch=g,x=r0(!1),N=m0.bind(null,on,!1,x.queue),x=ui(),O={state:f,dispatch:null,action:l,pending:null},x.queue=O,g=jT.bind(null,on,O,N,g),O.dispatch=g,x.memoizedState=l,[f,g,!1]}function y_(l){var f=Vr();return l0(f,er,l)}function l0(l,f,g){if(f=t0(l,f,s0)[0],l=Rm(pl)[0],typeof f=="object"&&f!==null&&typeof f.then=="function")try{var x=gh(f)}catch(G){throw G===uu?pn:G}else x=f;f=Vr();var O=f.queue,N=O.dispatch;return g!==f.memoizedState&&(on.flags|=2048,fc(9,{destroy:void 0},x_.bind(null,O,g),null)),[x,N,l]}function x_(l,f){l.action=f}function c0(l){var f=Vr(),g=er;if(g!==null)return l0(f,g,l);Vr(),f=f.memoizedState,g=Vr();var x=g.queue.dispatch;return g.memoizedState=l,[f,x,!1]}function fc(l,f,g,x){return l={tag:l,create:g,deps:x,inst:f,next:null},f=on.updateQueue,f===null&&(f=Cm(),on.updateQueue=f),g=f.lastEffect,g===null?f.lastEffect=l.next=l:(x=g.next,g.next=l,l.next=x,f.lastEffect=l),l}function Om(){return Vr().memoizedState}function Pm(l,f,g,x){var O=ui();on.flags|=l,O.memoizedState=fc(1|f,{destroy:void 0},g,x===void 0?null:x)}function Dm(l,f,g,x){var O=Vr();x=x===void 0?null:x;var N=O.memoizedState.inst;er!==null&&x!==null&&Yy(x,er.memoizedState.deps)?O.memoizedState=fc(f,N,g,x):(on.flags|=l,O.memoizedState=fc(1|f,N,g,x))}function b_(l,f){Pm(8390656,8,l,f)}function u0(l,f){Dm(2048,8,l,f)}function __(l){on.flags|=4;var f=on.updateQueue;if(f===null)f=Cm(),on.updateQueue=f,f.events=[l];else{var g=f.events;g===null?f.events=[l]:g.push(l)}}function S_(l){var f=Vr().memoizedState;return __({ref:f,nextImpl:l}),function(){if((Ut&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}function A_(l,f){return Dm(4,2,l,f)}function w_(l,f){return Dm(4,4,l,f)}function M_(l,f){if(typeof f=="function"){l=l();var g=f(l);return function(){typeof g=="function"?g():f(null)}}if(f!=null)return l=l(),f.current=l,function(){f.current=null}}function E_(l,f,g){g=g!=null?g.concat([l]):null,Dm(4,4,M_.bind(null,f,l),g)}function f0(){}function T_(l,f){var g=Vr();f=f===void 0?null:f;var x=g.memoizedState;return f!==null&&Yy(f,x[1])?x[0]:(g.memoizedState=[l,f],l)}function C_(l,f){var g=Vr();f=f===void 0?null:f;var x=g.memoizedState;if(f!==null&&Yy(f,x[1]))return x[0];if(x=l(),gu){vt(!0);try{l()}finally{vt(!1)}}return g.memoizedState=[x,f],x}function d0(l,f,g){return g===void 0||(xr&1073741824)!==0&&(fn&261930)===0?l.memoizedState=f:(l.memoizedState=g,l=Sn(),on.lanes|=l,To|=l,g)}function R_(l,f,g,x){return na(g,f)?g:kf.current!==null?(l=d0(l,g,x),na(l,f)||(ei=!0),l):(xr&42)===0||(xr&1073741824)!==0&&(fn&261930)===0?(ei=!0,l.memoizedState=g):(l=Sn(),on.lanes|=l,To|=l,f)}function O_(l,f,g,x,O){var N=$.p;$.p=N!==0&&8>N?N:8;var G=V.T,Z={};V.T=Z,m0(l,!1,f,g);try{var le=O(),Ee=V.S;if(Ee!==null&&Ee(Z,le),le!==null&&typeof le=="object"&&typeof le.then=="function"){var ze=Hy(le,x);vh(l,f,ze,Ja(l))}else vh(l,f,x,Ja(l))}catch(Ke){vh(l,f,{then:function(){},status:"rejected",reason:Ke},Ja())}finally{$.p=N,G!==null&&Z.types!==null&&(G.types=Z.types),V.T=G}}function zT(){}function h0(l,f,g,x){if(l.tag!==5)throw Error(r(476));var O=P_(l).queue;O_(l,O,f,Y,g===null?zT:function(){return D_(l),g(x)})}function P_(l){var f=l.memoizedState;if(f!==null)return f;f={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pl,lastRenderedState:Y},next:null};var g={};return f.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pl,lastRenderedState:g},next:null},l.memoizedState=f,l=l.alternate,l!==null&&(l.memoizedState=f),f}function D_(l){var f=P_(l);f.next===null&&(f=l.alternate.memoizedState),vh(l,f.next.queue,{},Ja())}function p0(){return Qt(L0)}function N_(){return Vr().memoizedState}function I_(){return Vr().memoizedState}function GT(l){for(var f=l.return;f!==null;){switch(f.tag){case 24:case 3:var g=Ja();l=dl(g);var x=lc(f,l,g);x!==null&&(gn(x,f,g),cc(x,f,g)),f={cache:jy()},l.payload=f;return}f=f.return}}function HT(l,f,g){var x=Ja();g={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Nm(l)?L_(f,g):(g=um(l,f,g,x),g!==null&&(gn(g,l,x),k_(g,f,x)))}function B_(l,f,g){var x=Ja();vh(l,f,g,x)}function vh(l,f,g,x){var O={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Nm(l))L_(f,O);else{var N=l.alternate;if(l.lanes===0&&(N===null||N.lanes===0)&&(N=f.lastRenderedReducer,N!==null))try{var G=f.lastRenderedState,Z=N(G,g);if(O.hasEagerState=!0,O.eagerState=Z,na(Z,G))return _i(l,f,O,0),nn===null&&sh(),!1}catch{}if(g=um(l,f,O,x),g!==null)return gn(g,l,x),k_(g,f,x),!0}return!1}function m0(l,f,g,x){if(x={lane:2,revertLane:De(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},Nm(l)){if(f)throw Error(r(479))}else f=um(l,g,x,2),f!==null&&gn(f,l,2)}function Nm(l){var f=l.alternate;return l===on||f!==null&&f===on}function L_(l,f){Ff=bs=!0;var g=l.pending;g===null?f.next=f:(f.next=g.next,g.next=f),l.pending=f}function k_(l,f,g){if((g&4194048)!==0){var x=f.lanes;x&=l.pendingLanes,g|=x,f.lanes=g,ql(l,g)}}var jf={readContext:Qt,use:uc,useCallback:Rr,useContext:Rr,useEffect:Rr,useImperativeHandle:Rr,useLayoutEffect:Rr,useInsertionEffect:Rr,useMemo:Rr,useReducer:Rr,useRef:Rr,useState:Rr,useDebugValue:Rr,useDeferredValue:Rr,useTransition:Rr,useSyncExternalStore:Rr,useId:Rr,useHostTransitionStatus:Rr,useFormState:Rr,useActionState:Rr,useOptimistic:Rr,useMemoCache:Rr,useCacheRefresh:Rr};jf.useEffectEvent=Rr;var F_={readContext:Qt,use:uc,useCallback:function(l,f){return ui().memoizedState=[l,f===void 0?null:f],l},useContext:Qt,useEffect:b_,useImperativeHandle:function(l,f,g){g=g!=null?g.concat([l]):null,Pm(4194308,4,M_.bind(null,f,l),g)},useLayoutEffect:function(l,f){return Pm(4194308,4,l,f)},useInsertionEffect:function(l,f){Pm(4,2,l,f)},useMemo:function(l,f){var g=ui();f=f===void 0?null:f;var x=l();if(gu){vt(!0);try{l()}finally{vt(!1)}}return g.memoizedState=[x,f],x},useReducer:function(l,f,g){var x=ui();if(g!==void 0){var O=g(f);if(gu){vt(!0);try{g(f)}finally{vt(!1)}}}else O=f;return x.memoizedState=x.baseState=O,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:O},x.queue=l,l=l.dispatch=HT.bind(null,on,l),[x.memoizedState,l]},useRef:function(l){var f=ui();return l={current:l},f.memoizedState=l},useState:function(l){l=r0(l);var f=l.queue,g=B_.bind(null,on,f);return f.dispatch=g,[l.memoizedState,g]},useDebugValue:f0,useDeferredValue:function(l,f){var g=ui();return d0(g,l,f)},useTransition:function(){var l=r0(!1);return l=O_.bind(null,on,l.queue,!0,!1),ui().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,f,g){var x=on,O=ui();if(Rn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=f(),nn===null)throw Error(r(349));(fn&127)!==0||c_(x,f,g)}O.memoizedState=g;var N={value:g,getSnapshot:f};return O.queue=N,b_(f_.bind(null,x,N,l),[l]),x.flags|=2048,fc(9,{destroy:void 0},u_.bind(null,x,N,g,f),null),g},useId:function(){var l=ui(),f=nn.identifierPrefix;if(Rn){var g=js,x=Cr;g=(x&~(1<<32-se(x)-1)).toString(32)+g,f="_"+f+"R_"+g,g=Em++,0<g&&(f+="H"+g.toString(32)),f+="_"}else g=Ky++,f="_"+f+"r_"+g.toString(32)+"_";return l.memoizedState=f},useHostTransitionStatus:p0,useFormState:o0,useActionState:o0,useOptimistic:function(l){var f=ui();f.memoizedState=f.baseState=l;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=g,f=m0.bind(null,on,!0,g),g.dispatch=f,[l,f]},useMemoCache:e0,useCacheRefresh:function(){return ui().memoizedState=GT.bind(null,on)},useEffectEvent:function(l){var f=ui(),g={impl:l};return f.memoizedState=g,function(){if((Ut&2)!==0)throw Error(r(440));return g.impl.apply(void 0,arguments)}}},g0={readContext:Qt,use:uc,useCallback:T_,useContext:Qt,useEffect:u0,useImperativeHandle:E_,useInsertionEffect:A_,useLayoutEffect:w_,useMemo:C_,useReducer:Rm,useRef:Om,useState:function(){return Rm(pl)},useDebugValue:f0,useDeferredValue:function(l,f){var g=Vr();return R_(g,er.memoizedState,l,f)},useTransition:function(){var l=Rm(pl)[0],f=Vr().memoizedState;return[typeof l=="boolean"?l:gh(l),f]},useSyncExternalStore:l_,useId:N_,useHostTransitionStatus:p0,useFormState:y_,useActionState:y_,useOptimistic:function(l,f){var g=Vr();return i0(g,er,l,f)},useMemoCache:e0,useCacheRefresh:I_};g0.useEffectEvent=S_;var _s={readContext:Qt,use:uc,useCallback:T_,useContext:Qt,useEffect:u0,useImperativeHandle:E_,useInsertionEffect:A_,useLayoutEffect:w_,useMemo:C_,useReducer:n0,useRef:Om,useState:function(){return n0(pl)},useDebugValue:f0,useDeferredValue:function(l,f){var g=Vr();return er===null?d0(g,l,f):R_(g,er.memoizedState,l,f)},useTransition:function(){var l=n0(pl)[0],f=Vr().memoizedState;return[typeof l=="boolean"?l:gh(l),f]},useSyncExternalStore:l_,useId:N_,useHostTransitionStatus:p0,useFormState:c0,useActionState:c0,useOptimistic:function(l,f){var g=Vr();return er!==null?i0(g,er,l,f):(g.baseState=l,[l,g.queue.dispatch])},useMemoCache:e0,useCacheRefresh:I_};_s.useEffectEvent=S_;function Im(l,f,g,x){f=l.memoizedState,g=g(x,f),g=g==null?f:p({},f,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var yh={enqueueSetState:function(l,f,g){l=l._reactInternals;var x=Ja(),O=dl(x);O.payload=f,g!=null&&(O.callback=g),f=lc(l,O,x),f!==null&&(gn(f,l,x),cc(f,l,x))},enqueueReplaceState:function(l,f,g){l=l._reactInternals;var x=Ja(),O=dl(x);O.tag=1,O.payload=f,g!=null&&(O.callback=g),f=lc(l,O,x),f!==null&&(gn(f,l,x),cc(f,l,x))},enqueueForceUpdate:function(l,f){l=l._reactInternals;var g=Ja(),x=dl(g);x.tag=2,f!=null&&(x.callback=f),f=lc(l,x,g),f!==null&&(gn(f,l,g),cc(f,l,g))}};function v0(l,f,g,x,O,N,G){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,N,G):f.prototype&&f.prototype.isPureReactComponent?!Sf(g,x)||!Sf(O,N):!0}function y0(l,f,g,x){l=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(g,x),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(g,x),f.state!==l&&yh.enqueueReplaceState(f,f.state,null)}function dc(l,f){var g=f;if("ref"in f){g={};for(var x in f)x!=="ref"&&(g[x]=f[x])}if(l=l.defaultProps){g===f&&(g=p({},g));for(var O in l)g[O]===void 0&&(g[O]=l[O])}return g}function U_(l){ah(l)}function x0(l){console.error(l)}function b0(l){ah(l)}function Bm(l,f){try{var g=l.onUncaughtError;g(f.value,{componentStack:f.stack})}catch(x){setTimeout(function(){throw x})}}function j_(l,f,g){try{var x=l.onCaughtError;x(g.value,{componentStack:g.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(O){setTimeout(function(){throw O})}}function _0(l,f,g){return g=dl(g),g.tag=3,g.payload={element:null},g.callback=function(){Bm(l,f)},g}function S0(l){return l=dl(l),l.tag=3,l}function z_(l,f,g,x){var O=g.type.getDerivedStateFromError;if(typeof O=="function"){var N=x.value;l.payload=function(){return O(N)},l.callback=function(){j_(f,g,x)}}var G=g.stateNode;G!==null&&typeof G.componentDidCatch=="function"&&(l.callback=function(){j_(f,g,x),typeof O!="function"&&($r===null?$r=new Set([this]):$r.add(this));var Z=x.stack;this.componentDidCatch(x.value,{componentStack:Z!==null?Z:""})})}function fi(l,f,g,x,O){if(g.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(f=g.alternate,f!==null&&xo(f,g,O,!0),g=xa.current,g!==null){switch(g.tag){case 31:case 13:return aa===null?$f():g.alternate===null&&Or===0&&(Or=3),g.flags&=-257,g.flags|=65536,g.lanes=O,x===_m?g.flags|=16384:(f=g.updateQueue,f===null?g.updateQueue=new Set([x]):f.add(x),Oh(l,x,O)),!1;case 22:return g.flags|=65536,x===_m?g.flags|=16384:(f=g.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([x])},g.updateQueue=f):(g=f.retryQueue,g===null?f.retryQueue=new Set([x]):g.add(x)),Oh(l,x,O)),!1}throw Error(r(435,g.tag))}return Oh(l,x,O),$f(),!1}if(Rn)return f=xa.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=O,x!==Of&&(l=Error(r(422),{cause:x}),go(Ha(l,g)))):(x!==Of&&(f=Error(r(423),{cause:x}),go(Ha(f,g))),l=l.current.alternate,l.flags|=65536,O&=-O,l.lanes|=O,x=Ha(x,g),O=_0(l.stateNode,x,O),Vt(l,O),Or!==4&&(Or=2)),!1;var N=Error(r(520),{cause:x});if(N=Ha(N,g),Eu===null?Eu=[N]:Eu.push(N),Or!==4&&(Or=2),f===null)return!0;x=Ha(x,g),g=f;do{switch(g.tag){case 3:return g.flags|=65536,l=O&-O,g.lanes|=l,l=_0(g.stateNode,x,l),Vt(g,l),!1;case 1:if(f=g.type,N=g.stateNode,(g.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&($r===null||!$r.has(N))))return g.flags|=65536,O&=-O,g.lanes|=O,O=S0(O),z_(O,l,g,x),Vt(g,O),!1}g=g.return}while(g!==null);return!1}var Lm=Error(r(461)),ei=!1;function Si(l,f,g,x){f.child=l===null?wm(f,null,g,x):fl(f,l.child,g,x)}function A0(l,f,g,x,O){g=g.render;var N=f.ref;if("ref"in x){var G={};for(var Z in x)Z!=="ref"&&(G[Z]=x[Z])}else G=x;return sc(f),x=Tm(l,f,g,G,N,O),Z=Jy(),l!==null&&!ei?(Zy(l,f,O),Wr(l,f,O)):(Rn&&Z&&po(f),f.flags|=1,Si(l,f,x,O),f.child)}function xu(l,f,g,x,O){if(l===null){var N=g.type;return typeof N=="function"&&!fm(N)&&N.defaultProps===void 0&&g.compare===null?(f.tag=15,f.type=N,km(l,f,N,x,O)):(l=fo(g.type,null,x,f,f.mode,O),l.ref=f.ref,l.return=f,f.child=l)}if(N=l.child,!Hm(l,O)){var G=N.memoizedProps;if(g=g.compare,g=g!==null?g:Sf,g(G,x)&&l.ref===f.ref)return Wr(l,f,O)}return f.flags|=1,l=ga(N,x),l.ref=f.ref,l.return=f,f.child=l}function km(l,f,g,x,O){if(l!==null){var N=l.memoizedProps;if(Sf(N,x)&&l.ref===f.ref)if(ei=!1,f.pendingProps=x=N,Hm(l,O))(l.flags&131072)!==0&&(ei=!0);else return f.lanes=l.lanes,Wr(l,f,O)}return zf(l,f,g,x,O)}function bu(l,f,g,x){var O=x.children,N=l!==null?l.memoizedState:null;if(l===null&&f.stateNode===null&&(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((f.flags&128)!==0){if(N=N!==null?N.baseLanes|g:g,l!==null){for(x=f.child=l.child,O=0;x!==null;)O=O|x.lanes|x.childLanes,x=x.sibling;x=O&~N}else x=0,f.child=null;return _a(l,f,N,g,x)}if((g&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},l!==null&&ch(f,N!==null?N.cachePool:null),N!==null?a_(f,N):$y(),s_(f);else return x=f.lanes=536870912,_a(l,f,N!==null?N.baseLanes|g:g,g,x)}else N!==null?(ch(f,N.cachePool),a_(f,N),ba(),f.memoizedState=null):(l!==null&&ch(f,null),$y(),ba());return Si(l,f,O,g),f.child}function _o(l,f){return l!==null&&l.tag===22||f.stateNode!==null||(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.sibling}function _a(l,f,g,x,O){var N=bm();return N=N===null?null:{parent:Qr._currentValue,pool:N},f.memoizedState={baseLanes:g,cachePool:N},l!==null&&ch(f,null),$y(),s_(f),l!==null&&xo(l,f,x,!0),f.childLanes=O,null}function Fm(l,f){return f=Gm({mode:f.mode,children:f.children},l.mode),f.ref=l.ref,l.child=f,f.return=l,f}function G_(l,f,g){return fl(f,l.child,null,g),l=Fm(f,f.pendingProps),l.flags|=2,Hr(f),f.memoizedState=null,l}function Um(l,f,g){var x=f.pendingProps,O=(f.flags&128)!==0;if(f.flags&=-129,l===null){if(Rn){if(x.mode==="hidden")return l=Fm(f,x),f.lanes=536870912,_o(null,l);if(Xy(f),(l=lr)?(l=r2(l,Va),l=l!==null&&l.data==="&"?l:null,l!==null&&(f.memoizedState={dehydrated:l,treeContext:ol!==null?{id:Cr,overflow:js}:null,retryLane:536870912,hydrationErrors:null},g=Tf(l),g.return=f,f.child=g,Br=f,lr=null)):l=null,l===null)throw mo(f);return f.lanes=536870912,null}return Fm(f,x)}var N=l.memoizedState;if(N!==null){var G=N.dehydrated;if(Xy(f),O)if(f.flags&256)f.flags&=-257,f=G_(l,f,g);else if(f.memoizedState!==null)f.child=l.child,f.flags|=128,f=null;else throw Error(r(558));else if(ei||xo(l,f,g,!1),O=(g&l.childLanes)!==0,ei||O){if(x=nn,x!==null&&(G=Zc(x,g),G!==0&&G!==N.retryLane))throw N.retryLane=G,ra(l,G),gn(x,l,G),Lm;$f(),f=G_(l,f,g)}else l=N.treeContext,lr=Oo(G.nextSibling),Br=f,Rn=!0,ll=null,Va=!1,l!==null&&mm(f,l),f=Fm(f,x),f.flags|=4096;return f}return l=ga(l.child,{mode:x.mode,children:x.children}),l.ref=f.ref,f.child=l,l.return=f,l}function _u(l,f){var g=f.ref;if(g===null)l!==null&&l.ref!==null&&(f.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(r(284));(l===null||l.ref!==g)&&(f.flags|=4194816)}}function zf(l,f,g,x,O){return sc(f),g=Tm(l,f,g,x,void 0,O),x=Jy(),l!==null&&!ei?(Zy(l,f,O),Wr(l,f,O)):(Rn&&x&&po(f),f.flags|=1,Si(l,f,g,O),f.child)}function xh(l,f,g,x,O,N){return sc(f),f.updateQueue=null,g=vu(f,x,g,O),o_(l),x=Jy(),l!==null&&!ei?(Zy(l,f,N),Wr(l,f,N)):(Rn&&x&&po(f),f.flags|=1,Si(l,f,g,N),f.child)}function jm(l,f,g,x,O){if(sc(f),f.stateNode===null){var N=ec,G=g.contextType;typeof G=="object"&&G!==null&&(N=Qt(G)),N=new g(x,N),f.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=yh,f.stateNode=N,N._reactInternals=f,N=f.stateNode,N.props=x,N.state=f.memoizedState,N.refs={},dh(f),G=g.contextType,N.context=typeof G=="object"&&G!==null?Qt(G):ec,N.state=f.memoizedState,G=g.getDerivedStateFromProps,typeof G=="function"&&(Im(f,g,G,x),N.state=f.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(G=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),G!==N.state&&yh.enqueueReplaceState(N,N.state,null),Bf(f,x,N,O),hh(),N.state=f.memoizedState),typeof N.componentDidMount=="function"&&(f.flags|=4194308),x=!0}else if(l===null){N=f.stateNode;var Z=f.memoizedProps,le=dc(g,Z);N.props=le;var Ee=N.context,ze=g.contextType;G=ec,typeof ze=="object"&&ze!==null&&(G=Qt(ze));var Ke=g.getDerivedStateFromProps;ze=typeof Ke=="function"||typeof N.getSnapshotBeforeUpdate=="function",Z=f.pendingProps!==Z,ze||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z||Ee!==G)&&y0(f,N,x,G),ia=!1;var Oe=f.memoizedState;N.state=Oe,Bf(f,x,N,O),hh(),Ee=f.memoizedState,Z||Oe!==Ee||ia?(typeof Ke=="function"&&(Im(f,g,Ke,x),Ee=f.memoizedState),(le=ia||v0(f,g,le,x,Oe,Ee,G))?(ze||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(f.flags|=4194308)):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=x,f.memoizedState=Ee),N.props=x,N.state=Ee,N.context=G,x=le):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),x=!1)}else{N=f.stateNode,Wy(l,f),G=f.memoizedProps,ze=dc(g,G),N.props=ze,Ke=f.pendingProps,Oe=N.context,Ee=g.contextType,le=ec,typeof Ee=="object"&&Ee!==null&&(le=Qt(Ee)),Z=g.getDerivedStateFromProps,(Ee=typeof Z=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(G!==Ke||Oe!==le)&&y0(f,N,x,le),ia=!1,Oe=f.memoizedState,N.state=Oe,Bf(f,x,N,O),hh();var ke=f.memoizedState;G!==Ke||Oe!==ke||ia||l!==null&&l.dependencies!==null&&lh(l.dependencies)?(typeof Z=="function"&&(Im(f,g,Z,x),ke=f.memoizedState),(ze=ia||v0(f,g,ze,x,Oe,ke,le)||l!==null&&l.dependencies!==null&&lh(l.dependencies))?(Ee||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(x,ke,le),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(x,ke,le)),typeof N.componentDidUpdate=="function"&&(f.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof N.componentDidUpdate!="function"||G===l.memoizedProps&&Oe===l.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||G===l.memoizedProps&&Oe===l.memoizedState||(f.flags|=1024),f.memoizedProps=x,f.memoizedState=ke),N.props=x,N.state=ke,N.context=le,x=ze):(typeof N.componentDidUpdate!="function"||G===l.memoizedProps&&Oe===l.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||G===l.memoizedProps&&Oe===l.memoizedState||(f.flags|=1024),x=!1)}return N=x,_u(l,f),x=(f.flags&128)!==0,N||x?(N=f.stateNode,g=x&&typeof g.getDerivedStateFromError!="function"?null:N.render(),f.flags|=1,l!==null&&x?(f.child=fl(f,l.child,null,O),f.child=fl(f,null,g,O)):Si(l,f,g,O),f.memoizedState=N.state,l=f.child):l=Wr(l,f,O),l}function H_(l,f,g,x){return ic(),f.flags|=256,Si(l,f,g,x),f.child}var w0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $i(l){return{baseLanes:l,cachePool:Vy()}}function zm(l,f,g){return l=l!==null?l.childLanes&~g:0,f&&(l|=la),l}function V_(l,f,g){var x=f.pendingProps,O=!1,N=(f.flags&128)!==0,G;if((G=N)||(G=l!==null&&l.memoizedState===null?!1:(On.current&2)!==0),G&&(O=!0,f.flags&=-129),G=(f.flags&32)!==0,f.flags&=-33,l===null){if(Rn){if(O?hl(f):ba(),(l=lr)?(l=r2(l,Va),l=l!==null&&l.data!=="&"?l:null,l!==null&&(f.memoizedState={dehydrated:l,treeContext:ol!==null?{id:Cr,overflow:js}:null,retryLane:536870912,hydrationErrors:null},g=Tf(l),g.return=f,f.child=g,Br=f,lr=null)):l=null,l===null)throw mo(f);return rC(l)?f.lanes=32:f.lanes=536870912,null}var Z=x.children;return x=x.fallback,O?(ba(),O=f.mode,Z=Gm({mode:"hidden",children:Z},O),x=tc(x,O,g,null),Z.return=f,x.return=f,Z.sibling=x,f.child=Z,x=f.child,x.memoizedState=$i(g),x.childLanes=zm(l,G,g),f.memoizedState=w0,_o(null,x)):(hl(f),bh(f,Z))}var le=l.memoizedState;if(le!==null&&(Z=le.dehydrated,Z!==null)){if(N)f.flags&256?(hl(f),f.flags&=-257,f=M0(l,f,g)):f.memoizedState!==null?(ba(),f.child=l.child,f.flags|=128,f=null):(ba(),Z=x.fallback,O=f.mode,x=Gm({mode:"visible",children:x.children},O),Z=tc(Z,O,g,null),Z.flags|=2,x.return=f,Z.return=f,x.sibling=Z,f.child=x,fl(f,l.child,null,g),x=f.child,x.memoizedState=$i(g),x.childLanes=zm(l,G,g),f.memoizedState=w0,f=_o(null,x));else if(hl(f),rC(Z)){if(G=Z.nextSibling&&Z.nextSibling.dataset,G)var Ee=G.dgst;G=Ee,x=Error(r(419)),x.stack="",x.digest=G,go({value:x,source:null,stack:null}),f=M0(l,f,g)}else if(ei||xo(l,f,g,!1),G=(g&l.childLanes)!==0,ei||G){if(G=nn,G!==null&&(x=Zc(G,g),x!==0&&x!==le.retryLane))throw le.retryLane=x,ra(l,x),gn(G,l,x),Lm;nC(Z)||$f(),f=M0(l,f,g)}else nC(Z)?(f.flags|=192,f.child=l.child,f=null):(l=le.treeContext,lr=Oo(Z.nextSibling),Br=f,Rn=!0,ll=null,Va=!1,l!==null&&mm(f,l),f=bh(f,x.children),f.flags|=4096);return f}return O?(ba(),Z=x.fallback,O=f.mode,le=l.child,Ee=le.sibling,x=ga(le,{mode:"hidden",children:x.children}),x.subtreeFlags=le.subtreeFlags&65011712,Ee!==null?Z=ga(Ee,Z):(Z=tc(Z,O,g,null),Z.flags|=2),Z.return=f,x.return=f,x.sibling=Z,f.child=x,_o(null,x),x=f.child,Z=l.child.memoizedState,Z===null?Z=$i(g):(O=Z.cachePool,O!==null?(le=Qr._currentValue,O=O.parent!==le?{parent:le,pool:le}:O):O=Vy(),Z={baseLanes:Z.baseLanes|g,cachePool:O}),x.memoizedState=Z,x.childLanes=zm(l,G,g),f.memoizedState=w0,_o(l.child,x)):(hl(f),g=l.child,l=g.sibling,g=ga(g,{mode:"visible",children:x.children}),g.return=f,g.sibling=null,l!==null&&(G=f.deletions,G===null?(f.deletions=[l],f.flags|=16):G.push(l)),f.child=g,f.memoizedState=null,g)}function bh(l,f){return f=Gm({mode:"visible",children:f},l.mode),f.return=l,l.child=f}function Gm(l,f){return l=Tr(22,l,null,f),l.lanes=0,l}function M0(l,f,g){return fl(f,l.child,null,g),l=bh(f,f.pendingProps.children),l.flags|=2,f.memoizedState=null,l}function W_(l,f,g){l.lanes|=f;var x=l.alternate;x!==null&&(x.lanes|=f),vm(l.return,f,g)}function Su(l,f,g,x,O,N){var G=l.memoizedState;G===null?l.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:O,treeForkCount:N}:(G.isBackwards=f,G.rendering=null,G.renderingStartTime=0,G.last=x,G.tail=g,G.tailMode=O,G.treeForkCount=N)}function Sa(l,f,g){var x=f.pendingProps,O=x.revealOrder,N=x.tail;x=x.children;var G=On.current,Z=(G&2)!==0;if(Z?(G=G&1|2,f.flags|=128):G&=1,ue(On,G),Si(l,f,x,g),x=Rn?Rf:0,!Z&&l!==null&&(l.flags&128)!==0)e:for(l=f.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&W_(l,g,f);else if(l.tag===19)W_(l,g,f);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===f)break e;for(;l.sibling===null;){if(l.return===null||l.return===f)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(O){case"forwards":for(g=f.child,O=null;g!==null;)l=g.alternate,l!==null&&qa(l)===null&&(O=g),g=g.sibling;g=O,g===null?(O=f.child,f.child=null):(O=g.sibling,g.sibling=null),Su(f,!1,O,g,N,x);break;case"backwards":case"unstable_legacy-backwards":for(g=null,O=f.child,f.child=null;O!==null;){if(l=O.alternate,l!==null&&qa(l)===null){f.child=O;break}l=O.sibling,O.sibling=g,g=O,O=l}Su(f,!0,g,null,N,x);break;case"together":Su(f,!1,null,null,void 0,x);break;default:f.memoizedState=null}return f.child}function Wr(l,f,g){if(l!==null&&(f.dependencies=l.dependencies),To|=f.lanes,(g&f.childLanes)===0)if(l!==null){if(xo(l,f,g,!1),(g&f.childLanes)===0)return null}else return null;if(l!==null&&f.child!==l.child)throw Error(r(153));if(f.child!==null){for(l=f.child,g=ga(l,l.pendingProps),f.child=g,g.return=f;l.sibling!==null;)l=l.sibling,g=g.sibling=ga(l,l.pendingProps),g.return=f;g.sibling=null}return f.child}function Hm(l,f){return(l.lanes&f)!==0?!0:(l=l.dependencies,!!(l!==null&&lh(l)))}function VT(l,f,g){switch(f.tag){case 3:We(f,f.stateNode.containerInfo),cl(f,Qr,l.memoizedState.cache),ic();break;case 27:case 5:Fe(f);break;case 4:We(f,f.stateNode.containerInfo);break;case 10:cl(f,f.type,f.memoizedProps.value);break;case 31:if(f.memoizedState!==null)return f.flags|=128,Xy(f),null;break;case 13:var x=f.memoizedState;if(x!==null)return x.dehydrated!==null?(hl(f),f.flags|=128,null):(g&f.child.childLanes)!==0?V_(l,f,g):(hl(f),l=Wr(l,f,g),l!==null?l.sibling:null);hl(f);break;case 19:var O=(l.flags&128)!==0;if(x=(g&f.childLanes)!==0,x||(xo(l,f,g,!1),x=(g&f.childLanes)!==0),O){if(x)return Sa(l,f,g);f.flags|=128}if(O=f.memoizedState,O!==null&&(O.rendering=null,O.tail=null,O.lastEffect=null),ue(On,On.current),x)break;return null;case 22:return f.lanes=0,bu(l,f,g,f.pendingProps);case 24:cl(f,Qr,l.memoizedState.cache)}return Wr(l,f,g)}function Vm(l,f,g){if(l!==null)if(l.memoizedProps!==f.pendingProps)ei=!0;else{if(!Hm(l,g)&&(f.flags&128)===0)return ei=!1,VT(l,f,g);ei=(l.flags&131072)!==0}else ei=!1,Rn&&(f.flags&1048576)!==0&&Z1(f,Rf,f.index);switch(f.lanes=0,f.tag){case 16:e:{var x=f.pendingProps;if(l=fu(f.elementType),f.type=l,typeof l=="function")fm(l)?(x=dc(l,x),f.tag=1,f=jm(null,f,l,x,g)):(f.tag=0,f=zf(null,f,l,x,g));else{if(l!=null){var O=l.$$typeof;if(O===P){f.tag=11,f=A0(null,f,l,x,g);break e}else if(O===I){f.tag=14,f=xu(null,f,l,x,g);break e}}throw f=ee(l)||l,Error(r(306,f,""))}}return f;case 0:return zf(l,f,f.type,f.pendingProps,g);case 1:return x=f.type,O=dc(x,f.pendingProps),jm(l,f,x,O,g);case 3:e:{if(We(f,f.stateNode.containerInfo),l===null)throw Error(r(387));x=f.pendingProps;var N=f.memoizedState;O=N.element,Wy(l,f),Bf(f,x,null,g);var G=f.memoizedState;if(x=G.cache,cl(f,Qr,x),x!==N.cache&&ym(f,[Qr],g,!0),hh(),x=G.element,N.isDehydrated)if(N={element:x,isDehydrated:!1,cache:G.cache},f.updateQueue.baseState=N,f.memoizedState=N,f.flags&256){f=H_(l,f,x,g);break e}else if(x!==O){O=Ha(Error(r(424)),f),go(O),f=H_(l,f,x,g);break e}else for(l=f.stateNode.containerInfo,l.nodeType===9?l=l.body:l=l.nodeName==="HTML"?l.ownerDocument.body:l,lr=Oo(l.firstChild),Br=f,Rn=!0,ll=null,Va=!0,g=wm(f,null,x,g),f.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(ic(),x===O){f=Wr(l,f,g);break e}Si(l,f,x,g)}f=f.child}return f;case 26:return _u(l,f),l===null?(g=c2(f.type,null,f.pendingProps,null))?f.memoizedState=g:Rn||(g=f.type,l=f.pendingProps,x=K_(me.current).createElement(g),x[Er]=f,x[li]=l,ua(x,g,l),J(x),f.stateNode=x):f.memoizedState=c2(f.type,l.memoizedProps,f.pendingProps,l.memoizedState),null;case 27:return Fe(f),l===null&&Rn&&(x=f.stateNode=s2(f.type,f.pendingProps,me.current),Br=f,Va=!0,O=lr,Jf(f.type)?(iC=O,lr=Oo(x.firstChild)):lr=O),Si(l,f,f.pendingProps.children,g),_u(l,f),l===null&&(f.flags|=4194304),f.child;case 5:return l===null&&Rn&&((O=x=lr)&&(x=yQ(x,f.type,f.pendingProps,Va),x!==null?(f.stateNode=x,Br=f,lr=Oo(x.firstChild),Va=!1,O=!0):O=!1),O||mo(f)),Fe(f),O=f.type,N=f.pendingProps,G=l!==null?l.memoizedProps:null,x=N.children,QT(O,N)?x=null:G!==null&&QT(O,G)&&(f.flags|=32),f.memoizedState!==null&&(O=Tm(l,f,yu,null,null,g),L0._currentValue=O),_u(l,f),Si(l,f,x,g),f.child;case 6:return l===null&&Rn&&((l=g=lr)&&(g=xQ(g,f.pendingProps,Va),g!==null?(f.stateNode=g,Br=f,lr=null,l=!0):l=!1),l||mo(f)),null;case 13:return V_(l,f,g);case 4:return We(f,f.stateNode.containerInfo),x=f.pendingProps,l===null?f.child=fl(f,null,x,g):Si(l,f,x,g),f.child;case 11:return A0(l,f,f.type,f.pendingProps,g);case 7:return Si(l,f,f.pendingProps,g),f.child;case 8:return Si(l,f,f.pendingProps.children,g),f.child;case 12:return Si(l,f,f.pendingProps.children,g),f.child;case 10:return x=f.pendingProps,cl(f,f.type,x.value),Si(l,f,x.children,g),f.child;case 9:return O=f.type._context,x=f.pendingProps.children,sc(f),O=Qt(O),x=x(O),f.flags|=1,Si(l,f,x,g),f.child;case 14:return xu(l,f,f.type,f.pendingProps,g);case 15:return km(l,f,f.type,f.pendingProps,g);case 19:return Sa(l,f,g);case 31:return Um(l,f,g);case 22:return bu(l,f,g,f.pendingProps);case 24:return sc(f),x=Qt(Qr),l===null?(O=bm(),O===null&&(O=nn,N=jy(),O.pooledCache=N,N.refCount++,N!==null&&(O.pooledCacheLanes|=g),O=N),f.memoizedState={parent:x,cache:O},dh(f),cl(f,Qr,O)):((l.lanes&g)!==0&&(Wy(l,f),Bf(f,null,null,g),hh()),O=l.memoizedState,N=f.memoizedState,O.parent!==x?(O={parent:x,cache:x},f.memoizedState=O,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=O),cl(f,Qr,x)):(x=N.cache,cl(f,Qr,x),x!==O.cache&&ym(f,[Qr],g,!0))),Si(l,f,f.pendingProps.children,g),f.child;case 29:throw f.pendingProps}throw Error(r(156,f.tag))}function So(l){l.flags|=4}function _h(l,f,g,x,O){if((f=(l.mode&32)!==0)&&(f=!1),f){if(l.flags|=16777216,(O&335544128)===O)if(l.stateNode.complete)l.flags|=8192;else if(Dr())l.flags|=8192;else throw bo=_m,uh}else l.flags&=-16777217}function E0(l,f){if(f.type!=="stylesheet"||(f.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!p2(f))if(Dr())l.flags|=8192;else throw bo=_m,uh}function ml(l,f){f!==null&&(l.flags|=4),l.flags&16384&&(f=l.tag!==22?un():536870912,l.lanes|=f,pr|=f)}function Ao(l,f){if(!Rn)switch(l.tailMode){case"hidden":f=l.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var x=null;g!==null;)g.alternate!==null&&(x=g),g=g.sibling;x===null?f||l.tail===null?l.tail=null:l.tail.sibling=null:x.sibling=null}}function tr(l){var f=l.alternate!==null&&l.alternate.child===l.child,g=0,x=0;if(f)for(var O=l.child;O!==null;)g|=O.lanes|O.childLanes,x|=O.subtreeFlags&65011712,x|=O.flags&65011712,O.return=l,O=O.sibling;else for(O=l.child;O!==null;)g|=O.lanes|O.childLanes,x|=O.subtreeFlags,x|=O.flags,O.return=l,O=O.sibling;return l.subtreeFlags|=x,l.childLanes=g,f}function Sh(l,f,g){var x=f.pendingProps;switch(pm(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tr(f),null;case 1:return tr(f),null;case 3:return g=f.stateNode,x=null,l!==null&&(x=l.memoizedState.cache),f.memoizedState.cache!==x&&(f.flags|=2048),yo(Qr),_e(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(Pf(f)?So(f):l===null||l.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,gm())),tr(f),null;case 26:var O=f.type,N=f.memoizedState;return l===null?(So(f),N!==null?(tr(f),E0(f,N)):(tr(f),_h(f,O,null,x,g))):N?N!==l.memoizedState?(So(f),tr(f),E0(f,N)):(tr(f),f.flags&=-16777217):(l=l.memoizedProps,l!==x&&So(f),tr(f),_h(f,O,l,x,g)),null;case 27:if(Xe(f),g=me.current,O=f.type,l!==null&&f.stateNode!=null)l.memoizedProps!==x&&So(f);else{if(!x){if(f.stateNode===null)throw Error(r(166));return tr(f),null}l=Se.current,Pf(f)?Q1(f):(l=s2(O,x,g),f.stateNode=l,So(f))}return tr(f),null;case 5:if(Xe(f),O=f.type,l!==null&&f.stateNode!=null)l.memoizedProps!==x&&So(f);else{if(!x){if(f.stateNode===null)throw Error(r(166));return tr(f),null}if(N=Se.current,Pf(f))Q1(f);else{var G=K_(me.current);switch(N){case 1:N=G.createElementNS("http://www.w3.org/2000/svg",O);break;case 2:N=G.createElementNS("http://www.w3.org/1998/Math/MathML",O);break;default:switch(O){case"svg":N=G.createElementNS("http://www.w3.org/2000/svg",O);break;case"math":N=G.createElementNS("http://www.w3.org/1998/Math/MathML",O);break;case"script":N=G.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof x.is=="string"?G.createElement("select",{is:x.is}):G.createElement("select"),x.multiple?N.multiple=!0:x.size&&(N.size=x.size);break;default:N=typeof x.is=="string"?G.createElement(O,{is:x.is}):G.createElement(O)}}N[Er]=f,N[li]=x;e:for(G=f.child;G!==null;){if(G.tag===5||G.tag===6)N.appendChild(G.stateNode);else if(G.tag!==4&&G.tag!==27&&G.child!==null){G.child.return=G,G=G.child;continue}if(G===f)break e;for(;G.sibling===null;){if(G.return===null||G.return===f)break e;G=G.return}G.sibling.return=G.return,G=G.sibling}f.stateNode=N;e:switch(ua(N,O,x),O){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&So(f)}}return tr(f),_h(f,f.type,l===null?null:l.memoizedProps,f.pendingProps,g),null;case 6:if(l&&f.stateNode!=null)l.memoizedProps!==x&&So(f);else{if(typeof x!="string"&&f.stateNode===null)throw Error(r(166));if(l=me.current,Pf(f)){if(l=f.stateNode,g=f.memoizedProps,x=null,O=Br,O!==null)switch(O.tag){case 27:case 5:x=O.memoizedProps}l[Er]=f,l=!!(l.nodeValue===g||x!==null&&x.suppressHydrationWarning===!0||Kk(l.nodeValue,g)),l||mo(f,!0)}else l=K_(l).createTextNode(x),l[Er]=f,f.stateNode=l}return tr(f),null;case 31:if(g=f.memoizedState,l===null||l.memoizedState!==null){if(x=Pf(f),g!==null){if(l===null){if(!x)throw Error(r(318));if(l=f.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(557));l[Er]=f}else ic(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;tr(f),l=!1}else g=gm(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return f.flags&256?(Hr(f),f):(Hr(f),null);if((f.flags&128)!==0)throw Error(r(558))}return tr(f),null;case 13:if(x=f.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(O=Pf(f),x!==null&&x.dehydrated!==null){if(l===null){if(!O)throw Error(r(318));if(O=f.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(r(317));O[Er]=f}else ic(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;tr(f),O=!1}else O=gm(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=O),O=!0;if(!O)return f.flags&256?(Hr(f),f):(Hr(f),null)}return Hr(f),(f.flags&128)!==0?(f.lanes=g,f):(g=x!==null,l=l!==null&&l.memoizedState!==null,g&&(x=f.child,O=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(O=x.alternate.memoizedState.cachePool.pool),N=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(N=x.memoizedState.cachePool.pool),N!==O&&(x.flags|=2048)),g!==l&&g&&(f.child.flags|=8192),ml(f,f.updateQueue),tr(f),null);case 4:return _e(),l===null&&XT(f.stateNode.containerInfo),tr(f),null;case 10:return yo(f.type),tr(f),null;case 19:if(ae(On),x=f.memoizedState,x===null)return tr(f),null;if(O=(f.flags&128)!==0,N=x.rendering,N===null)if(O)Ao(x,!1);else{if(Or!==0||l!==null&&(l.flags&128)!==0)for(l=f.child;l!==null;){if(N=qa(l),N!==null){for(f.flags|=128,Ao(x,!1),l=N.updateQueue,f.updateQueue=l,ml(f,l),f.subtreeFlags=0,l=g,g=f.child;g!==null;)Ef(g,l),g=g.sibling;return ue(On,On.current&1|2),Rn&&ho(f,x.treeForkCount),f.child}l=l.sibling}x.tail!==null&&H()>qr&&(f.flags|=128,O=!0,Ao(x,!1),f.lanes=4194304)}else{if(!O)if(l=qa(N),l!==null){if(f.flags|=128,O=!0,l=l.updateQueue,f.updateQueue=l,ml(f,l),Ao(x,!0),x.tail===null&&x.tailMode==="hidden"&&!N.alternate&&!Rn)return tr(f),null}else 2*H()-x.renderingStartTime>qr&&g!==536870912&&(f.flags|=128,O=!0,Ao(x,!1),f.lanes=4194304);x.isBackwards?(N.sibling=f.child,f.child=N):(l=x.last,l!==null?l.sibling=N:f.child=N,x.last=N)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=H(),l.sibling=null,g=On.current,ue(On,O?g&1|2:g&1),Rn&&ho(f,x.treeForkCount),l):(tr(f),null);case 22:case 23:return Hr(f),ph(),x=f.memoizedState!==null,l!==null?l.memoizedState!==null!==x&&(f.flags|=8192):x&&(f.flags|=8192),x?(g&536870912)!==0&&(f.flags&128)===0&&(tr(f),f.subtreeFlags&6&&(f.flags|=8192)):tr(f),g=f.updateQueue,g!==null&&ml(f,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),x=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(x=f.memoizedState.cachePool.pool),x!==g&&(f.flags|=2048),l!==null&&ae(oc),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),f.memoizedState.cache!==g&&(f.flags|=2048),yo(Qr),tr(f),null;case 25:return null;case 30:return null}throw Error(r(156,f.tag))}function Ss(l,f){switch(pm(f),f.tag){case 1:return l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 3:return yo(Qr),_e(),l=f.flags,(l&65536)!==0&&(l&128)===0?(f.flags=l&-65537|128,f):null;case 26:case 27:case 5:return Xe(f),null;case 31:if(f.memoizedState!==null){if(Hr(f),f.alternate===null)throw Error(r(340));ic()}return l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 13:if(Hr(f),l=f.memoizedState,l!==null&&l.dehydrated!==null){if(f.alternate===null)throw Error(r(340));ic()}return l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 19:return ae(On),null;case 4:return _e(),null;case 10:return yo(f.type),null;case 22:case 23:return Hr(f),ph(),l!==null&&ae(oc),l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 24:return yo(Qr),null;case 25:return null;default:return null}}function $a(l,f){switch(pm(f),f.tag){case 3:yo(Qr),_e();break;case 26:case 27:case 5:Xe(f);break;case 4:_e();break;case 31:f.memoizedState!==null&&Hr(f);break;case 13:Hr(f);break;case 19:ae(On);break;case 10:yo(f.type);break;case 22:case 23:Hr(f),ph(),l!==null&&ae(oc);break;case 24:yo(Qr)}}function As(l,f){try{var g=f.updateQueue,x=g!==null?g.lastEffect:null;if(x!==null){var O=x.next;g=O;do{if((g.tag&l)===l){x=void 0;var N=g.create,G=g.inst;x=N(),G.destroy=x}g=g.next}while(g!==O)}}catch(Z){jn(f,f.return,Z)}}function Di(l,f,g){try{var x=f.updateQueue,O=x!==null?x.lastEffect:null;if(O!==null){var N=O.next;x=N;do{if((x.tag&l)===l){var G=x.inst,Z=G.destroy;if(Z!==void 0){G.destroy=void 0,O=f;var le=g,Ee=Z;try{Ee()}catch(ze){jn(O,le,ze)}}}x=x.next}while(x!==N)}}catch(ze){jn(f,f.return,ze)}}function zs(l){var f=l.updateQueue;if(f!==null){var g=l.stateNode;try{i_(f,g)}catch(x){jn(l,l.return,x)}}}function Ai(l,f,g){g.props=dc(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(x){jn(l,f,x)}}function gl(l,f){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var x=l.stateNode;break;case 30:x=l.stateNode;break;default:x=l.stateNode}typeof g=="function"?l.refCleanup=g(x):g.current=x}}catch(O){jn(l,f,O)}}function Ni(l,f){var g=l.ref,x=l.refCleanup;if(g!==null)if(typeof x=="function")try{x()}catch(O){jn(l,f,O)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(O){jn(l,f,O)}else g.current=null}function Ah(l){var f=l.type,g=l.memoizedProps,x=l.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":g.autoFocus&&x.focus();break e;case"img":g.src?x.src=g.src:g.srcSet&&(x.srcset=g.srcSet)}}catch(O){jn(l,l.return,O)}}function di(l,f,g){try{var x=l.stateNode;dQ(x,l.type,g,f),x[li]=f}catch(O){jn(l,l.return,O)}}function br(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Jf(l.type)||l.tag===4}function Mn(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||br(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.tag===27&&Jf(l.type)||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 wo(l,f,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,f?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(l,f):(f=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,f.appendChild(l),g=g._reactRootContainer,g!=null||f.onclick!==null||(f.onclick=il));else if(x!==4&&(x===27&&Jf(l.type)&&(g=l.stateNode,f=null),l=l.child,l!==null))for(wo(l,f,g),l=l.sibling;l!==null;)wo(l,f,g),l=l.sibling}function sa(l,f,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,f?g.insertBefore(l,f):g.appendChild(l);else if(x!==4&&(x===27&&Jf(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(sa(l,f,g),l=l.sibling;l!==null;)sa(l,f,g),l=l.sibling}function Wm(l){var f=l.stateNode,g=l.memoizedProps;try{for(var x=l.type,O=f.attributes;O.length;)f.removeAttributeNode(O[0]);ua(f,x,g),f[Er]=l,f[li]=g}catch(N){jn(l,l.return,N)}}var ws=!1,cr=!1,Gs=!1,q_=typeof WeakSet=="function"?WeakSet:Set,wi=null;function WT(l,f){if(l=l.containerInfo,JT=nS,l=X1(l),By(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var x=g.getSelection&&g.getSelection();if(x&&x.rangeCount!==0){g=x.anchorNode;var O=x.anchorOffset,N=x.focusNode;x=x.focusOffset;try{g.nodeType,N.nodeType}catch{g=null;break e}var G=0,Z=-1,le=-1,Ee=0,ze=0,Ke=l,Oe=null;t:for(;;){for(var ke;Ke!==g||O!==0&&Ke.nodeType!==3||(Z=G+O),Ke!==N||x!==0&&Ke.nodeType!==3||(le=G+x),Ke.nodeType===3&&(G+=Ke.nodeValue.length),(ke=Ke.firstChild)!==null;)Oe=Ke,Ke=ke;for(;;){if(Ke===l)break t;if(Oe===g&&++Ee===O&&(Z=G),Oe===N&&++ze===x&&(le=G),(ke=Ke.nextSibling)!==null)break;Ke=Oe,Oe=Ke.parentNode}Ke=ke}g=Z===-1||le===-1?null:{start:Z,end:le}}else g=null}g=g||{start:0,end:0}}else g=null;for(ZT={focusedElem:l,selectionRange:g},nS=!1,wi=f;wi!==null;)if(f=wi,l=f.child,(f.subtreeFlags&1028)!==0&&l!==null)l.return=f,wi=l;else for(;wi!==null;){switch(f=wi,N=f.alternate,l=f.flags,f.tag){case 0:if((l&4)!==0&&(l=f.updateQueue,l=l!==null?l.events:null,l!==null))for(g=0;g<l.length;g++)O=l[g],O.ref.impl=O.nextImpl;break;case 11:case 15:break;case 1:if((l&1024)!==0&&N!==null){l=void 0,g=f,O=N.memoizedProps,N=N.memoizedState,x=g.stateNode;try{var Nt=dc(g.type,O);l=x.getSnapshotBeforeUpdate(Nt,N),x.__reactInternalSnapshotBeforeUpdate=l}catch(Zt){jn(g,g.return,Zt)}}break;case 3:if((l&1024)!==0){if(l=f.stateNode.containerInfo,g=l.nodeType,g===9)tC(l);else if(g===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":tC(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(r(163))}if(l=f.sibling,l!==null){l.return=f.return,wi=l;break}wi=f.return}}function _r(l,f,g){var x=g.flags;switch(g.tag){case 0:case 11:case 15:Ts(l,g),x&4&&As(5,g);break;case 1:if(Ts(l,g),x&4)if(l=g.stateNode,f===null)try{l.componentDidMount()}catch(G){jn(g,g.return,G)}else{var O=dc(g.type,f.memoizedProps);f=f.memoizedState;try{l.componentDidUpdate(O,f,l.__reactInternalSnapshotBeforeUpdate)}catch(G){jn(g,g.return,G)}}x&64&&zs(g),x&512&&gl(g,g.return);break;case 3:if(Ts(l,g),x&64&&(l=g.updateQueue,l!==null)){if(f=null,g.child!==null)switch(g.child.tag){case 27:case 5:f=g.child.stateNode;break;case 1:f=g.child.stateNode}try{i_(l,f)}catch(G){jn(g,g.return,G)}}break;case 27:f===null&&x&4&&Wm(g);case 26:case 5:Ts(l,g),f===null&&x&4&&Ah(g),x&512&&gl(g,g.return);break;case 12:Ts(l,g);break;case 31:Ts(l,g),x&4&&hc(l,g);break;case 13:Ts(l,g),x&4&&Gf(l,g),x&64&&(l=g.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(g=A.bind(null,g),bQ(l,g))));break;case 22:if(x=g.memoizedState!==null||ws,!x){f=f!==null&&f.memoizedState!==null||cr,O=ws;var N=cr;ws=x,(cr=f)&&!N?oa(l,g,(g.subtreeFlags&8772)!==0):Ts(l,g),ws=O,cr=N}break;case 30:break;default:Ts(l,g)}}function wh(l){var f=l.alternate;f!==null&&(l.alternate=null,wh(f)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(f=l.stateNode,f!==null&&tl(f)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var Yn=null,Xi=!1;function Ms(l,f,g){for(g=g.child;g!==null;)qm(l,f,g),g=g.sibling}function qm(l,f,g){if(st&&typeof st.onCommitFiberUnmount=="function")try{st.onCommitFiberUnmount(Qe,g)}catch{}switch(g.tag){case 26:cr||Ni(g,f),Ms(l,f,g),g.memoizedState?g.memoizedState.count--:g.stateNode&&(g=g.stateNode,g.parentNode.removeChild(g));break;case 27:cr||Ni(g,f);var x=Yn,O=Xi;Jf(g.type)&&(Yn=g.stateNode,Xi=!1),Ms(l,f,g),N0(g.stateNode),Yn=x,Xi=O;break;case 5:cr||Ni(g,f);case 6:if(x=Yn,O=Xi,Yn=null,Ms(l,f,g),Yn=x,Xi=O,Yn!==null)if(Xi)try{(Yn.nodeType===9?Yn.body:Yn.nodeName==="HTML"?Yn.ownerDocument.body:Yn).removeChild(g.stateNode)}catch(N){jn(g,f,N)}else try{Yn.removeChild(g.stateNode)}catch(N){jn(g,f,N)}break;case 18:Yn!==null&&(Xi?(l=Yn,t2(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,g.stateNode),eg(l)):t2(Yn,g.stateNode));break;case 4:x=Yn,O=Xi,Yn=g.stateNode.containerInfo,Xi=!0,Ms(l,f,g),Yn=x,Xi=O;break;case 0:case 11:case 14:case 15:Di(2,g,f),cr||Di(4,g,f),Ms(l,f,g);break;case 1:cr||(Ni(g,f),x=g.stateNode,typeof x.componentWillUnmount=="function"&&Ai(g,f,x)),Ms(l,f,g);break;case 21:Ms(l,f,g);break;case 22:cr=(x=cr)||g.memoizedState!==null,Ms(l,f,g),cr=x;break;default:Ms(l,f,g)}}function hc(l,f){if(f.memoizedState===null&&(l=f.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{eg(l)}catch(g){jn(f,f.return,g)}}}function Gf(l,f){if(f.memoizedState===null&&(l=f.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{eg(l)}catch(g){jn(f,f.return,g)}}function T0(l){switch(l.tag){case 31:case 13:case 19:var f=l.stateNode;return f===null&&(f=l.stateNode=new q_),f;case 22:return l=l.stateNode,f=l._retryCache,f===null&&(f=l._retryCache=new q_),f;default:throw Error(r(435,l.tag))}}function vl(l,f){var g=T0(l);f.forEach(function(x){if(!g.has(x)){g.add(x);var O=C.bind(null,l,x);x.then(O,O)}})}function hi(l,f){var g=f.deletions;if(g!==null)for(var x=0;x<g.length;x++){var O=g[x],N=l,G=f,Z=G;e:for(;Z!==null;){switch(Z.tag){case 27:if(Jf(Z.type)){Yn=Z.stateNode,Xi=!1;break e}break;case 5:Yn=Z.stateNode,Xi=!1;break e;case 3:case 4:Yn=Z.stateNode.containerInfo,Xi=!0;break e}Z=Z.return}if(Yn===null)throw Error(r(160));qm(N,G,O),Yn=null,Xi=!1,N=O.alternate,N!==null&&(N.return=null),O.return=null}if(f.subtreeFlags&13886)for(f=f.child;f!==null;)pc(f,l),f=f.sibling}var Es=null;function pc(l,f){var g=l.alternate,x=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:hi(f,l),pi(l),x&4&&(Di(3,l,l.return),As(3,l),Di(5,l,l.return));break;case 1:hi(f,l),pi(l),x&512&&(cr||g===null||Ni(g,g.return)),x&64&&ws&&(l=l.updateQueue,l!==null&&(x=l.callbacks,x!==null&&(g=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=g===null?x:g.concat(x))));break;case 26:var O=Es;if(hi(f,l),pi(l),x&512&&(cr||g===null||Ni(g,g.return)),x&4){var N=g!==null?g.memoizedState:null;if(x=l.memoizedState,g===null)if(x===null)if(l.stateNode===null){e:{x=l.type,g=l.memoizedProps,O=O.ownerDocument||O;t:switch(x){case"title":N=O.getElementsByTagName("title")[0],(!N||N[Fs]||N[Er]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=O.createElement(x),O.head.insertBefore(N,O.querySelector("head > title"))),ua(N,x,g),N[Er]=l,J(N),x=N;break e;case"link":var G=d2("link","href",O).get(x+(g.href||""));if(G){for(var Z=0;Z<G.length;Z++)if(N=G[Z],N.getAttribute("href")===(g.href==null||g.href===""?null:g.href)&&N.getAttribute("rel")===(g.rel==null?null:g.rel)&&N.getAttribute("title")===(g.title==null?null:g.title)&&N.getAttribute("crossorigin")===(g.crossOrigin==null?null:g.crossOrigin)){G.splice(Z,1);break t}}N=O.createElement(x),ua(N,x,g),O.head.appendChild(N);break;case"meta":if(G=d2("meta","content",O).get(x+(g.content||""))){for(Z=0;Z<G.length;Z++)if(N=G[Z],N.getAttribute("content")===(g.content==null?null:""+g.content)&&N.getAttribute("name")===(g.name==null?null:g.name)&&N.getAttribute("property")===(g.property==null?null:g.property)&&N.getAttribute("http-equiv")===(g.httpEquiv==null?null:g.httpEquiv)&&N.getAttribute("charset")===(g.charSet==null?null:g.charSet)){G.splice(Z,1);break t}}N=O.createElement(x),ua(N,x,g),O.head.appendChild(N);break;default:throw Error(r(468,x))}N[Er]=l,J(N),x=N}l.stateNode=x}else h2(O,l.type,l.stateNode);else l.stateNode=f2(O,x,l.memoizedProps);else N!==x?(N===null?g.stateNode!==null&&(g=g.stateNode,g.parentNode.removeChild(g)):N.count--,x===null?h2(O,l.type,l.stateNode):f2(O,x,l.memoizedProps)):x===null&&l.stateNode!==null&&di(l,l.memoizedProps,g.memoizedProps)}break;case 27:hi(f,l),pi(l),x&512&&(cr||g===null||Ni(g,g.return)),g!==null&&x&4&&di(l,l.memoizedProps,g.memoizedProps);break;case 5:if(hi(f,l),pi(l),x&512&&(cr||g===null||Ni(g,g.return)),l.flags&32){O=l.stateNode;try{Zr(O,"")}catch(Nt){jn(l,l.return,Nt)}}x&4&&l.stateNode!=null&&(O=l.memoizedProps,di(l,O,g!==null?g.memoizedProps:O)),x&1024&&(Gs=!0);break;case 6:if(hi(f,l),pi(l),x&4){if(l.stateNode===null)throw Error(r(162));x=l.memoizedProps,g=l.stateNode;try{g.nodeValue=x}catch(Nt){jn(l,l.return,Nt)}}break;case 3:if(Z_=null,O=Es,Es=Y_(f.containerInfo),hi(f,l),Es=O,pi(l),x&4&&g!==null&&g.memoizedState.isDehydrated)try{eg(f.containerInfo)}catch(Nt){jn(l,l.return,Nt)}Gs&&(Gs=!1,$m(l));break;case 4:x=Es,Es=Y_(l.stateNode.containerInfo),hi(f,l),pi(l),Es=x;break;case 12:hi(f,l),pi(l);break;case 31:hi(f,l),pi(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,vl(l,x)));break;case 13:hi(f,l),pi(l),l.child.flags&8192&&l.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(Hf=H()),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,vl(l,x)));break;case 22:O=l.memoizedState!==null;var le=g!==null&&g.memoizedState!==null,Ee=ws,ze=cr;if(ws=Ee||O,cr=ze||le,hi(f,l),cr=ze,ws=Ee,pi(l),x&8192)e:for(f=l.stateNode,f._visibility=O?f._visibility&-2:f._visibility|1,O&&(g===null||le||ws||cr||Mo(l)),g=null,f=l;;){if(f.tag===5||f.tag===26){if(g===null){le=g=f;try{if(N=le.stateNode,O)G=N.style,typeof G.setProperty=="function"?G.setProperty("display","none","important"):G.display="none";else{Z=le.stateNode;var Ke=le.memoizedProps.style,Oe=Ke!=null&&Ke.hasOwnProperty("display")?Ke.display:null;Z.style.display=Oe==null||typeof Oe=="boolean"?"":(""+Oe).trim()}}catch(Nt){jn(le,le.return,Nt)}}}else if(f.tag===6){if(g===null){le=f;try{le.stateNode.nodeValue=O?"":le.memoizedProps}catch(Nt){jn(le,le.return,Nt)}}}else if(f.tag===18){if(g===null){le=f;try{var ke=le.stateNode;O?n2(ke,!0):n2(le.stateNode,!1)}catch(Nt){jn(le,le.return,Nt)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===l)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break e;for(;f.sibling===null;){if(f.return===null||f.return===l)break e;g===f&&(g=null),f=f.return}g===f&&(g=null),f.sibling.return=f.return,f=f.sibling}x&4&&(x=l.updateQueue,x!==null&&(g=x.retryQueue,g!==null&&(x.retryQueue=null,vl(l,g))));break;case 19:hi(f,l),pi(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,vl(l,x)));break;case 30:break;case 21:break;default:hi(f,l),pi(l)}}function pi(l){var f=l.flags;if(f&2){try{for(var g,x=l.return;x!==null;){if(br(x)){g=x;break}x=x.return}if(g==null)throw Error(r(160));switch(g.tag){case 27:var O=g.stateNode,N=Mn(l);sa(l,N,O);break;case 5:var G=g.stateNode;g.flags&32&&(Zr(G,""),g.flags&=-33);var Z=Mn(l);sa(l,Z,G);break;case 3:case 4:var le=g.stateNode.containerInfo,Ee=Mn(l);wo(l,Ee,le);break;default:throw Error(r(161))}}catch(ze){jn(l,l.return,ze)}l.flags&=-3}f&4096&&(l.flags&=-4097)}function $m(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var f=l;$m(f),f.tag===5&&f.flags&1024&&f.stateNode.reset(),l=l.sibling}}function Ts(l,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)_r(l,f.alternate,f),f=f.sibling}function Mo(l){for(l=l.child;l!==null;){var f=l;switch(f.tag){case 0:case 11:case 14:case 15:Di(4,f,f.return),Mo(f);break;case 1:Ni(f,f.return);var g=f.stateNode;typeof g.componentWillUnmount=="function"&&Ai(f,f.return,g),Mo(f);break;case 27:N0(f.stateNode);case 26:case 5:Ni(f,f.return),Mo(f);break;case 22:f.memoizedState===null&&Mo(f);break;case 30:Mo(f);break;default:Mo(f)}l=l.sibling}}function oa(l,f,g){for(g=g&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var x=f.alternate,O=l,N=f,G=N.flags;switch(N.tag){case 0:case 11:case 15:oa(O,N,g),As(4,N);break;case 1:if(oa(O,N,g),x=N,O=x.stateNode,typeof O.componentDidMount=="function")try{O.componentDidMount()}catch(Ee){jn(x,x.return,Ee)}if(x=N,O=x.updateQueue,O!==null){var Z=x.stateNode;try{var le=O.shared.hiddenCallbacks;if(le!==null)for(O.shared.hiddenCallbacks=null,O=0;O<le.length;O++)Lf(le[O],Z)}catch(Ee){jn(x,x.return,Ee)}}g&&G&64&&zs(N),gl(N,N.return);break;case 27:Wm(N);case 26:case 5:oa(O,N,g),g&&x===null&&G&4&&Ah(N),gl(N,N.return);break;case 12:oa(O,N,g);break;case 31:oa(O,N,g),g&&G&4&&hc(O,N);break;case 13:oa(O,N,g),g&&G&4&&Gf(O,N);break;case 22:N.memoizedState===null&&oa(O,N,g),gl(N,N.return);break;case 30:break;default:oa(O,N,g)}f=f.sibling}}function mc(l,f){var g=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),l=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(l=f.memoizedState.cachePool.pool),l!==g&&(l!=null&&l.refCount++,g!=null&&cu(g))}function Au(l,f){l=null,f.alternate!==null&&(l=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==l&&(f.refCount++,l!=null&&cu(l))}function Ii(l,f,g,x){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)C0(l,f,g,x),f=f.sibling}function C0(l,f,g,x){var O=f.flags;switch(f.tag){case 0:case 11:case 15:Ii(l,f,g,x),O&2048&&As(9,f);break;case 1:Ii(l,f,g,x);break;case 3:Ii(l,f,g,x),O&2048&&(l=null,f.alternate!==null&&(l=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==l&&(f.refCount++,l!=null&&cu(l)));break;case 12:if(O&2048){Ii(l,f,g,x),l=f.stateNode;try{var N=f.memoizedProps,G=N.id,Z=N.onPostCommit;typeof Z=="function"&&Z(G,f.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(le){jn(f,f.return,le)}}else Ii(l,f,g,x);break;case 31:Ii(l,f,g,x);break;case 13:Ii(l,f,g,x);break;case 23:break;case 22:N=f.stateNode,G=f.alternate,f.memoizedState!==null?N._visibility&2?Ii(l,f,g,x):Eo(l,f):N._visibility&2?Ii(l,f,g,x):(N._visibility|=2,Bi(l,f,g,x,(f.subtreeFlags&10256)!==0||!1)),O&2048&&mc(G,f);break;case 24:Ii(l,f,g,x),O&2048&&Au(f.alternate,f);break;default:Ii(l,f,g,x)}}function Bi(l,f,g,x,O){for(O=O&&((f.subtreeFlags&10256)!==0||!1),f=f.child;f!==null;){var N=l,G=f,Z=g,le=x,Ee=G.flags;switch(G.tag){case 0:case 11:case 15:Bi(N,G,Z,le,O),As(8,G);break;case 23:break;case 22:var ze=G.stateNode;G.memoizedState!==null?ze._visibility&2?Bi(N,G,Z,le,O):Eo(N,G):(ze._visibility|=2,Bi(N,G,Z,le,O)),O&&Ee&2048&&mc(G.alternate,G);break;case 24:Bi(N,G,Z,le,O),O&&Ee&2048&&Au(G.alternate,G);break;default:Bi(N,G,Z,le,O)}f=f.sibling}}function Eo(l,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var g=l,x=f,O=x.flags;switch(x.tag){case 22:Eo(g,x),O&2048&&mc(x.alternate,x);break;case 24:Eo(g,x),O&2048&&Au(x.alternate,x);break;default:Eo(g,x)}f=f.sibling}}var wu=8192;function Xa(l,f,g){if(l.subtreeFlags&wu)for(l=l.child;l!==null;)Xm(l,f,g),l=l.sibling}function Xm(l,f,g){switch(l.tag){case 26:Xa(l,f,g),l.flags&wu&&l.memoizedState!==null&&DQ(g,Es,l.memoizedState,l.memoizedProps);break;case 5:Xa(l,f,g);break;case 3:case 4:var x=Es;Es=Y_(l.stateNode.containerInfo),Xa(l,f,g),Es=x;break;case 22:l.memoizedState===null&&(x=l.alternate,x!==null&&x.memoizedState!==null?(x=wu,wu=16777216,Xa(l,f,g),wu=x):Xa(l,f,g));break;default:Xa(l,f,g)}}function Mu(l){var f=l.alternate;if(f!==null&&(l=f.child,l!==null)){f.child=null;do f=l.sibling,l.sibling=null,l=f;while(l!==null)}}function gc(l){var f=l.deletions;if((l.flags&16)!==0){if(f!==null)for(var g=0;g<f.length;g++){var x=f[g];wi=x,Lr(x,l)}Mu(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Aa(l),l=l.sibling}function Aa(l){switch(l.tag){case 0:case 11:case 15:gc(l),l.flags&2048&&Di(9,l,l.return);break;case 3:gc(l);break;case 12:gc(l);break;case 22:var f=l.stateNode;l.memoizedState!==null&&f._visibility&2&&(l.return===null||l.return.tag!==13)?(f._visibility&=-3,wa(l)):gc(l);break;default:gc(l)}}function wa(l){var f=l.deletions;if((l.flags&16)!==0){if(f!==null)for(var g=0;g<f.length;g++){var x=f[g];wi=x,Lr(x,l)}Mu(l)}for(l=l.child;l!==null;){switch(f=l,f.tag){case 0:case 11:case 15:Di(8,f,f.return),wa(f);break;case 22:g=f.stateNode,g._visibility&2&&(g._visibility&=-3,wa(f));break;default:wa(f)}l=l.sibling}}function Lr(l,f){for(;wi!==null;){var g=wi;switch(g.tag){case 0:case 11:case 15:Di(8,g,f);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var x=g.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:cu(g.memoizedState.cache)}if(x=g.child,x!==null)x.return=g,wi=x;else e:for(g=l;wi!==null;){x=wi;var O=x.sibling,N=x.return;if(wh(x),x===g){wi=null;break e}if(O!==null){O.return=N,wi=O;break e}wi=N}}}var yl={getCacheForType:function(l){var f=Qt(Qr),g=f.data.get(l);return g===void 0&&(g=l(),f.data.set(l,g)),g},cacheSignal:function(){return Qt(Qr).controller.signal}},ln=typeof WeakMap=="function"?WeakMap:Map,Ut=0,nn=null,mn=null,fn=0,Pn=0,Ki=null,Cs=!1,Hs=!1,R0=!1,Ka=0,Or=0,To=0,vc=0,Mh=0,la=0,pr=0,Eu=null,kr=null,Fr=!1,Hf=0,O0=0,qr=1/0,Pr=null,$r=null,Jn=0,Ya=null,Vf=null,Rs=0,Wf=0,qf=null,Eh=null,yc=0,Tu=null;function Ja(){return(Ut&2)!==0&&fn!==0?fn&-fn:V.T!==null?De():Qc()}function Sn(){if(la===0)if((fn&536870912)===0||Rn){var l=et;et<<=1,(et&3932160)===0&&(et=262144),la=l}else la=536870912;return l=xa.current,l!==null&&(l.flags|=32),la}function gn(l,f,g){(l===nn&&(Pn===2||Pn===9)||l.cancelPendingCommit!==null)&&(bc(l,0),ti(l,fn,la,!1)),Mr(l,g),((Ut&2)===0||l!==nn)&&(l===nn&&((Ut&2)===0&&(vc|=g),Or===4&&ti(l,fn,la,!1)),nt(l))}function An(l,f,g){if((Ut&6)!==0)throw Error(r(327));var x=!g&&(f&127)===0&&(f&l.expiredLanes)===0||at(l,f),O=x?Th(l,f):ca(l,f,!0),N=x;do{if(O===0){Hs&&!x&&ti(l,f,0,!1);break}else{if(g=l.current.alternate,N&&!Zn(g)){O=ca(l,f,!1),N=!1;continue}if(O===2){if(N=f,l.errorRecoveryDisabledLanes&N)var G=0;else G=l.pendingLanes&-536870913,G=G!==0?G:G&536870912?536870912:0;if(G!==0){f=G;e:{var Z=l;O=Eu;var le=Z.current.memoizedState.isDehydrated;if(le&&(bc(Z,G).flags|=256),G=ca(Z,G,!1),G!==2){if(R0&&!le){Z.errorRecoveryDisabledLanes|=N,vc|=N,O=4;break e}N=kr,kr=O,N!==null&&(kr===null?kr=N:kr.push.apply(kr,N))}O=G}if(N=!1,O!==2)continue}}if(O===1){bc(l,0),ti(l,f,0,!0);break}e:{switch(x=l,N=O,N){case 0:case 1:throw Error(r(345));case 4:if((f&4194048)!==f)break;case 6:ti(x,f,la,!Cs);break e;case 2:kr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((f&62914560)===f&&(O=Hf+300-H(),10<O)){if(ti(x,f,la,!Cs),He(x,0,!0)!==0)break e;Rs=f,x.timeoutHandle=Qk(En.bind(null,x,g,kr,Pr,Fr,f,la,vc,pr,Cs,N,"Throttled",-0,0),O);break e}En(x,g,kr,Pr,Fr,f,la,vc,pr,Cs,N,null,-0,0)}}break}while(!0);nt(l)}function En(l,f,g,x,O,N,G,Z,le,Ee,ze,Ke,Oe,ke){if(l.timeoutHandle=-1,Ke=f.subtreeFlags,Ke&8192||(Ke&16785408)===16785408){Ke={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:il},Xm(f,N,Ke);var Nt=(N&62914560)===N?Hf-H():(N&4194048)===N?O0-H():0;if(Nt=NQ(Ke,Nt),Nt!==null){Rs=N,l.cancelPendingCommit=Nt(bl.bind(null,l,f,N,g,x,O,G,Z,le,ze,Ke,null,Oe,ke)),ti(l,N,G,!Ee);return}}bl(l,f,N,g,x,O,G,Z,le)}function Zn(l){for(var f=l;;){var g=f.tag;if((g===0||g===11||g===15)&&f.flags&16384&&(g=f.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var x=0;x<g.length;x++){var O=g[x],N=O.getSnapshot;O=O.value;try{if(!na(N(),O))return!1}catch{return!1}}if(g=f.child,f.subtreeFlags&16384&&g!==null)g.return=f,f=g;else{if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function ti(l,f,g,x){f&=~Mh,f&=~vc,l.suspendedLanes|=f,l.pingedLanes&=~f,x&&(l.warmLanes|=f),x=l.expirationTimes;for(var O=f;0<O;){var N=31-se(O),G=1<<N;x[N]=-1,O&=~G}g!==0&&Wl(l,g,f)}function Vs(){return(Ut&6)===0?(Mt(0),!1):!0}function xc(){if(mn!==null){if(Pn===0)var l=mn.return;else l=mn,vo=ac=null,Qy(l),pu=null,mu=0,l=mn;for(;l!==null;)$a(l.alternate,l),l=l.return;mn=null}}function bc(l,f){var g=l.timeoutHandle;g!==-1&&(l.timeoutHandle=-1,mQ(g)),g=l.cancelPendingCommit,g!==null&&(l.cancelPendingCommit=null,g()),Rs=0,xc(),nn=l,mn=g=ga(l.current,null),fn=f,Pn=0,Ki=null,Cs=!1,Hs=at(l,f),R0=!1,pr=la=Mh=vc=To=Or=0,kr=Eu=null,Fr=!1,(f&8)!==0&&(f|=f&32);var x=l.entangledLanes;if(x!==0)for(l=l.entanglements,x&=f;0<x;){var O=31-se(x),N=1<<O;f|=l[O],x&=~N}return Ka=f,sh(),g}function Co(l,f){on=null,V.H=jf,f===uu||f===pn?(f=du(),Pn=3):f===uh?(f=du(),Pn=4):Pn=f===Lm?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,Ki=f,mn===null&&(Or=1,Bm(l,Ha(f,l.current)))}function Dr(){var l=xa.current;return l===null?!0:(fn&4194048)===fn?aa===null:(fn&62914560)===fn||(fn&536870912)!==0?l===aa:!1}function xl(){var l=V.H;return V.H=jf,l===null?jf:l}function _c(){var l=V.A;return V.A=yl,l}function $f(){Or=4,Cs||(fn&4194048)!==fn&&xa.current!==null||(Hs=!0),(To&134217727)===0&&(vc&134217727)===0||nn===null||ti(nn,fn,la,!1)}function ca(l,f,g){var x=Ut;Ut|=2;var O=xl(),N=_c();(nn!==l||fn!==f)&&(Pr=null,bc(l,f)),f=!1;var G=Or;e:do try{if(Pn!==0&&mn!==null){var Z=mn,le=Ki;switch(Pn){case 8:xc(),G=6;break e;case 3:case 2:case 9:case 6:xa.current===null&&(f=!0);var Ee=Pn;if(Pn=0,Ki=null,Cu(l,Z,le,Ee),g&&Hs){G=0;break e}break;default:Ee=Pn,Pn=0,Ki=null,Cu(l,Z,le,Ee)}}Xf(),G=Or;break}catch(ze){Co(l,ze)}while(!0);return f&&l.shellSuspendCounter++,vo=ac=null,Ut=x,V.H=O,V.A=N,mn===null&&(nn=null,fn=0,sh()),G}function Xf(){for(;mn!==null;)Km(mn)}function Th(l,f){var g=Ut;Ut|=2;var x=xl(),O=_c();nn!==l||fn!==f?(Pr=null,qr=H()+500,bc(l,f)):Hs=at(l,f);e:do try{if(Pn!==0&&mn!==null){f=mn;var N=Ki;t:switch(Pn){case 1:Pn=0,Ki=null,Cu(l,f,N,1);break;case 2:case 9:if(ya(N)){Pn=0,Ki=null,Ch(f);break}f=function(){Pn!==2&&Pn!==9||nn!==l||(Pn=7),nt(l)},N.then(f,f);break e;case 3:Pn=7;break e;case 4:Pn=5;break e;case 7:ya(N)?(Pn=0,Ki=null,Ch(f)):(Pn=0,Ki=null,Cu(l,f,N,7));break;case 5:var G=null;switch(mn.tag){case 26:G=mn.memoizedState;case 5:case 27:var Z=mn;if(G?p2(G):Z.stateNode.complete){Pn=0,Ki=null;var le=Z.sibling;if(le!==null)mn=le;else{var Ee=Z.return;Ee!==null?(mn=Ee,Sc(Ee)):mn=null}break t}}Pn=0,Ki=null,Cu(l,f,N,5);break;case 6:Pn=0,Ki=null,Cu(l,f,N,6);break;case 8:xc(),Or=6;break e;default:throw Error(r(462))}}Ma();break}catch(ze){Co(l,ze)}while(!0);return vo=ac=null,V.H=x,V.A=O,Ut=g,mn!==null?0:(nn=null,fn=0,sh(),Or)}function Ma(){for(;mn!==null&&!Ze();)Km(mn)}function Km(l){var f=Vm(l.alternate,l,Ka);l.memoizedProps=l.pendingProps,f===null?Sc(l):mn=f}function Ch(l){var f=l,g=f.alternate;switch(f.tag){case 15:case 0:f=xh(g,f,f.pendingProps,f.type,void 0,fn);break;case 11:f=xh(g,f,f.pendingProps,f.type.render,f.ref,fn);break;case 5:Qy(f);default:$a(g,f),f=mn=Ef(f,Ka),f=Vm(g,f,Ka)}l.memoizedProps=l.pendingProps,f===null?Sc(l):mn=f}function Cu(l,f,g,x){vo=ac=null,Qy(f),pu=null,mu=0;var O=f.return;try{if(fi(l,O,f,g,fn)){Or=1,Bm(l,Ha(g,l.current)),mn=null;return}}catch(N){if(O!==null)throw mn=O,N;Or=1,Bm(l,Ha(g,l.current)),mn=null;return}f.flags&32768?(Rn||x===1?l=!0:Hs||(fn&536870912)!==0?l=!1:(Cs=l=!0,(x===2||x===9||x===3||x===6)&&(x=xa.current,x!==null&&x.tag===13&&(x.flags|=16384))),Rh(f,l)):Sc(f)}function Sc(l){var f=l;do{if((f.flags&32768)!==0){Rh(f,Cs);return}l=f.return;var g=Sh(f.alternate,f,Ka);if(g!==null){mn=g;return}if(f=f.sibling,f!==null){mn=f;return}mn=f=l}while(f!==null);Or===0&&(Or=5)}function Rh(l,f){do{var g=Ss(l.alternate,l);if(g!==null){g.flags&=32767,mn=g;return}if(g=l.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!f&&(l=l.sibling,l!==null)){mn=l;return}mn=l=g}while(l!==null);Or=6,mn=null}function bl(l,f,g,x,O,N,G,Z,le){l.cancelPendingCommit=null;do Kf();while(Jn!==0);if((Ut&6)!==0)throw Error(r(327));if(f!==null){if(f===l.current)throw Error(r(177));if(N=f.lanes|f.childLanes,N|=bi,oi(l,g,N,G,Z,le),l===nn&&(mn=nn=null,fn=0),Vf=f,Ya=l,Rs=g,Wf=N,qf=O,Eh=x,(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,L(Ie,function(){return Ym(),null})):(l.callbackNode=null,l.callbackPriority=0),x=(f.flags&13878)!==0,(f.subtreeFlags&13878)!==0||x){x=V.T,V.T=null,O=$.p,$.p=2,G=Ut,Ut|=4;try{WT(l,f,g)}finally{Ut=G,$.p=O,V.T=x}}Jn=1,ni(),_l(),Ru()}}function ni(){if(Jn===1){Jn=0;var l=Ya,f=Vf,g=(f.flags&13878)!==0;if((f.subtreeFlags&13878)!==0||g){g=V.T,V.T=null;var x=$.p;$.p=2;var O=Ut;Ut|=4;try{pc(f,l);var N=ZT,G=X1(l.containerInfo),Z=N.focusedElem,le=N.selectionRange;if(G!==Z&&Z&&Z.ownerDocument&&or(Z.ownerDocument.documentElement,Z)){if(le!==null&&By(Z)){var Ee=le.start,ze=le.end;if(ze===void 0&&(ze=Ee),"selectionStart"in Z)Z.selectionStart=Ee,Z.selectionEnd=Math.min(ze,Z.value.length);else{var Ke=Z.ownerDocument||document,Oe=Ke&&Ke.defaultView||window;if(Oe.getSelection){var ke=Oe.getSelection(),Nt=Z.textContent.length,Zt=Math.min(le.start,Nt),fr=le.end===void 0?Zt:Math.min(le.end,Nt);!ke.extend&&Zt>fr&&(G=fr,fr=Zt,Zt=G);var ye=Af(Z,Zt),pe=Af(Z,fr);if(ye&&pe&&(ke.rangeCount!==1||ke.anchorNode!==ye.node||ke.anchorOffset!==ye.offset||ke.focusNode!==pe.node||ke.focusOffset!==pe.offset)){var Me=Ke.createRange();Me.setStart(ye.node,ye.offset),ke.removeAllRanges(),Zt>fr?(ke.addRange(Me),ke.extend(pe.node,pe.offset)):(Me.setEnd(pe.node,pe.offset),ke.addRange(Me))}}}}for(Ke=[],ke=Z;ke=ke.parentNode;)ke.nodeType===1&&Ke.push({element:ke,left:ke.scrollLeft,top:ke.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<Ke.length;Z++){var qe=Ke[Z];qe.element.scrollLeft=qe.left,qe.element.scrollTop=qe.top}}nS=!!JT,ZT=JT=null}finally{Ut=O,$.p=x,V.T=g}}l.current=f,Jn=2}}function _l(){if(Jn===2){Jn=0;var l=Ya,f=Vf,g=(f.flags&8772)!==0;if((f.subtreeFlags&8772)!==0||g){g=V.T,V.T=null;var x=$.p;$.p=2;var O=Ut;Ut|=4;try{_r(l,f.alternate,f)}finally{Ut=O,$.p=x,V.T=g}}Jn=3}}function Ru(){if(Jn===4||Jn===3){Jn=0,te();var l=Ya,f=Vf,g=Rs,x=Eh;(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?Jn=5:(Jn=0,Vf=Ya=null,Ro(l,l.pendingLanes));var O=l.pendingLanes;if(O===0&&($r=null),el(g),f=f.stateNode,st&&typeof st.onCommitFiberRoot=="function")try{st.onCommitFiberRoot(Qe,f,void 0,(f.current.flags&128)===128)}catch{}if(x!==null){f=V.T,O=$.p,$.p=2,V.T=null;try{for(var N=l.onRecoverableError,G=0;G<x.length;G++){var Z=x[G];N(Z.value,{componentStack:Z.stack})}}finally{V.T=f,$.p=O}}(Rs&3)!==0&&Kf(),nt(l),O=l.pendingLanes,(g&261930)!==0&&(O&42)!==0?l===Tu?yc++:(yc=0,Tu=l):yc=0,Mt(0)}}function Ro(l,f){(l.pooledCacheLanes&=f)===0&&(f=l.pooledCache,f!=null&&(l.pooledCache=null,cu(f)))}function Kf(){return ni(),_l(),Ru(),Ym()}function Ym(){if(Jn!==5)return!1;var l=Ya,f=Wf;Wf=0;var g=el(Rs),x=V.T,O=$.p;try{$.p=32>g?32:g,V.T=null,g=qf,qf=null;var N=Ya,G=Rs;if(Jn=0,Vf=Ya=null,Rs=0,(Ut&6)!==0)throw Error(r(331));var Z=Ut;if(Ut|=4,Aa(N.current),C0(N,N.current,G,g),Ut=Z,Mt(0,!1),st&&typeof st.onPostCommitFiberRoot=="function")try{st.onPostCommitFiberRoot(Qe,N)}catch{}return!0}finally{$.p=O,V.T=x,Ro(l,f)}}function P0(l,f,g){f=Ha(g,f),f=_0(l.stateNode,f,2),l=lc(l,f,2),l!==null&&(Mr(l,2),nt(l))}function jn(l,f,g){if(l.tag===3)P0(l,l,g);else for(;f!==null;){if(f.tag===3){P0(f,l,g);break}else if(f.tag===1){var x=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&($r===null||!$r.has(x))){l=Ha(g,l),g=S0(2),x=lc(f,g,2),x!==null&&(z_(g,x,f,l),Mr(x,2),nt(x));break}}f=f.return}}function Oh(l,f,g){var x=l.pingCache;if(x===null){x=l.pingCache=new ln;var O=new Set;x.set(f,O)}else O=x.get(f),O===void 0&&(O=new Set,x.set(f,O));O.has(g)||(R0=!0,O.add(g),l=d.bind(null,l,f,g),f.then(l,l))}function d(l,f,g){var x=l.pingCache;x!==null&&x.delete(f),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,nn===l&&(fn&g)===g&&(Or===4||Or===3&&(fn&62914560)===fn&&300>H()-Hf?(Ut&2)===0&&bc(l,0):Mh|=g,pr===fn&&(pr=0)),nt(l)}function m(l,f){f===0&&(f=un()),l=ra(l,f),l!==null&&(Mr(l,f),nt(l))}function A(l){var f=l.memoizedState,g=0;f!==null&&(g=f.retryLane),m(l,g)}function C(l,f){var g=0;switch(l.tag){case 31:case 13:var x=l.stateNode,O=l.memoizedState;O!==null&&(g=O.retryLane);break;case 19:x=l.stateNode;break;case 22:x=l.stateNode._retryCache;break;default:throw Error(r(314))}x!==null&&x.delete(f),m(l,g)}function L(l,f){return ft(l,f)}var F=null,K=null,ce=!1,Le=!1,Je=!1,ht=0;function nt(l){l!==K&&l.next===null&&(K===null?F=K=l:K=K.next=l),Le=!0,ce||(ce=!0,be())}function Mt(l,f){if(!Je&&Le){Je=!0;do for(var g=!1,x=F;x!==null;){if(l!==0){var O=x.pendingLanes;if(O===0)var N=0;else{var G=x.suspendedLanes,Z=x.pingedLanes;N=(1<<31-se(42|l)+1)-1,N&=O&~(G&~Z),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(g=!0,Ce(x,N))}else N=fn,N=He(x,x===nn?N:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(N&3)===0||at(x,N)||(g=!0,Ce(x,N));x=x.next}while(g);Je=!1}}function sn(){Xr()}function Xr(){Le=ce=!1;var l=0;ht!==0&&pQ()&&(l=ht);for(var f=H(),g=null,x=F;x!==null;){var O=x.next,N=Yf(x,f);N===0?(x.next=null,g===null?F=O:g.next=O,O===null&&(K=g)):(g=x,(l!==0||(N&3)!==0)&&(Le=!0)),x=O}Jn!==0&&Jn!==5||Mt(l),ht!==0&&(ht=0)}function Yf(l,f){for(var g=l.suspendedLanes,x=l.pingedLanes,O=l.expirationTimes,N=l.pendingLanes&-62914561;0<N;){var G=31-se(N),Z=1<<G,le=O[G];le===-1?((Z&g)===0||(Z&x)!==0)&&(O[G]=jt(Z,f)):le<=f&&(l.expiredLanes|=Z),N&=~Z}if(f=nn,g=fn,g=He(l,l===f?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),x=l.callbackNode,g===0||l===f&&(Pn===2||Pn===9)||l.cancelPendingCommit!==null)return x!==null&&x!==null&&Et(x),l.callbackNode=null,l.callbackPriority=0;if((g&3)===0||at(l,g)){if(f=g&-g,f===l.callbackPriority)return f;switch(x!==null&&Et(x),el(g)){case 2:case 8:g=je;break;case 32:g=Ie;break;case 268435456:g=lt;break;default:g=Ie}return x=Ac.bind(null,l),g=ft(g,x),l.callbackPriority=f,l.callbackNode=g,f}return x!==null&&x!==null&&Et(x),l.callbackPriority=2,l.callbackNode=null,2}function Ac(l,f){if(Jn!==0&&Jn!==5)return l.callbackNode=null,l.callbackPriority=0,null;var g=l.callbackNode;if(Kf()&&l.callbackNode!==g)return null;var x=fn;return x=He(l,l===nn?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),x===0?null:(An(l,x,f),Yf(l,H()),l.callbackNode!=null&&l.callbackNode===g?Ac.bind(null,l):null)}function Ce(l,f){if(Kf())return null;An(l,f,!0)}function be(){gQ(function(){(Ut&6)!==0?ft(Ne,sn):Xr()})}function De(){if(ht===0){var l=ul;l===0&&(l=it,it<<=1,(it&261888)===0&&(it=256)),ht=l}return ht}function ut(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:qd(""+l)}function $t(l,f){var g=f.ownerDocument.createElement("input");return g.name=f.name,g.value=f.value,l.id&&g.setAttribute("form",l.id),f.parentNode.insertBefore(g,f),l=new FormData(l),g.parentNode.removeChild(g),l}function Nr(l,f,g,x,O){if(f==="submit"&&g&&g.stateNode===O){var N=ut((O[li]||null).action),G=x.submitter;G&&(f=(f=G[li]||null)?ut(f.formAction):G.getAttribute("formAction"),f!==null&&(N=f,G=null));var Z=new Kd("action","action",null,x,O);l.push({event:Z,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(ht!==0){var le=G?$t(O,G):new FormData(O);h0(g,{pending:!0,data:le,method:O.method,action:N},null,le)}}else typeof N=="function"&&(Z.preventDefault(),le=G?$t(O,G):new FormData(O),h0(g,{pending:!0,data:le,method:O.method,action:N},N,le))},currentTarget:O}]})}}for(var Kt=0;Kt<ih.length;Kt++){var Ln=ih[Kt],Mi=Ln.toLowerCase(),Gn=Ln[0].toUpperCase()+Ln.slice(1);ms(Mi,"on"+Gn)}ms(cm,"onAnimationEnd"),ms(rh,"onAnimationIteration"),ms(ky,"onAnimationStart"),ms("dblclick","onDoubleClick"),ms("focusin","onFocus"),ms("focusout","onBlur"),ms(Y1,"onTransitionRun"),ms(kT,"onTransitionStart"),ms(J1,"onTransitionCancel"),ms(Fy,"onTransitionEnd"),xe("onMouseEnter",["mouseout","mouseover"]),xe("onMouseLeave",["mouseout","mouseover"]),xe("onPointerEnter",["pointerout","pointerover"]),xe("onPointerLeave",["pointerout","pointerover"]),Te("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Te("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Te("onBeforeInput",["compositionend","keypress","textInput","paste"]),Te("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Te("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Te("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Os="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(" "),qT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Os));function Wk(l,f){f=(f&4)!==0;for(var g=0;g<l.length;g++){var x=l[g],O=x.event;x=x.listeners;e:{var N=void 0;if(f)for(var G=x.length-1;0<=G;G--){var Z=x[G],le=Z.instance,Ee=Z.currentTarget;if(Z=Z.listener,le!==N&&O.isPropagationStopped())break e;N=Z,O.currentTarget=Ee;try{N(O)}catch(ze){ah(ze)}O.currentTarget=null,N=le}else for(G=0;G<x.length;G++){if(Z=x[G],le=Z.instance,Ee=Z.currentTarget,Z=Z.listener,le!==N&&O.isPropagationStopped())break e;N=Z,O.currentTarget=Ee;try{N(O)}catch(ze){ah(ze)}O.currentTarget=null,N=le}}}}function Dn(l,f){var g=f[ja];g===void 0&&(g=f[ja]=new Set);var x=l+"__bubble";g.has(x)||(qk(f,l,2,!1),g.add(x))}function $T(l,f,g){var x=0;f&&(x|=4),qk(g,l,x,f)}var $_="_reactListening"+Math.random().toString(36).slice(2);function XT(l){if(!l[$_]){l[$_]=!0,ge.forEach(function(g){g!=="selectionchange"&&(qT.has(g)||$T(g,!1,l),$T(g,!0,l))});var f=l.nodeType===9?l:l.ownerDocument;f===null||f[$_]||(f[$_]=!0,$T("selectionchange",!1,f))}}function qk(l,f,g,x){switch(_2(f)){case 2:var O=LQ;break;case 8:O=kQ;break;default:O=cC}g=O.bind(null,f,g,l),O=void 0,!xy||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(O=!0),x?O!==void 0?l.addEventListener(f,g,{capture:!0,passive:O}):l.addEventListener(f,g,!0):O!==void 0?l.addEventListener(f,g,{passive:O}):l.addEventListener(f,g,!1)}function KT(l,f,g,x,O){var N=x;if((f&1)===0&&(f&2)===0&&x!==null)e:for(;;){if(x===null)return;var G=x.tag;if(G===3||G===4){var Z=x.stateNode.containerInfo;if(Z===O)break;if(G===4)for(G=x.return;G!==null;){var le=G.tag;if((le===3||le===4)&&G.stateNode.containerInfo===O)return;G=G.return}for(;Z!==null;){if(G=nl(Z),G===null)return;if(le=G.tag,le===5||le===6||le===26||le===27){x=N=G;continue e}Z=Z.parentNode}}x=x.return}yy(function(){var Ee=N,ze=Yp(g),Ke=[];e:{var Oe=ps.get(l);if(Oe!==void 0){var ke=Kd,Nt=l;switch(l){case"keypress":if(Xd(g)===0)break e;case"keydown":case"keyup":ke=iu;break;case"focusin":Nt="focus",ke=em;break;case"focusout":Nt="blur",ke=em;break;case"beforeblur":case"afterblur":ke=em;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=by;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=O1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=L1;break;case cm:case rh:case ky:ke=IT;break;case Fy:ke=LT;break;case"scroll":case"scrollend":ke=C1;break;case"wheel":ke=F1;break;case"copy":case"cut":case"paste":ke=D1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=Ay;break;case"toggle":case"beforetoggle":ke=j1}var Zt=(f&4)!==0,fr=!Zt&&(l==="scroll"||l==="scrollend"),ye=Zt?Oe!==null?Oe+"Capture":null:Oe;Zt=[];for(var pe=Ee,Me;pe!==null;){var qe=pe;if(Me=qe.stateNode,qe=qe.tag,qe!==5&&qe!==26&&qe!==27||Me===null||ye===null||(qe=pf(pe,ye),qe!=null&&Zt.push(D0(pe,qe,Me))),fr)break;pe=pe.return}0<Zt.length&&(Oe=new ke(Oe,Nt,null,g,ze),Ke.push({event:Oe,listeners:Zt}))}}if((f&7)===0){e:{if(Oe=l==="mouseover"||l==="pointerover",ke=l==="mouseout"||l==="pointerout",Oe&&g!==Kp&&(Nt=g.relatedTarget||g.fromElement)&&(nl(Nt)||Nt[Ua]))break e;if((ke||Oe)&&(Oe=ze.window===ze?ze:(Oe=ze.ownerDocument)?Oe.defaultView||Oe.parentWindow:window,ke?(Nt=g.relatedTarget||g.toElement,ke=Ee,Nt=Nt?nl(Nt):null,Nt!==null&&(fr=a(Nt),Zt=Nt.tag,Nt!==fr||Zt!==5&&Zt!==27&&Zt!==6)&&(Nt=null)):(ke=null,Nt=Ee),ke!==Nt)){if(Zt=by,qe="onMouseLeave",ye="onMouseEnter",pe="mouse",(l==="pointerout"||l==="pointerover")&&(Zt=Ay,qe="onPointerLeave",ye="onPointerEnter",pe="pointer"),fr=ke==null?Oe:Kl(ke),Me=Nt==null?Oe:Kl(Nt),Oe=new Zt(qe,pe+"leave",ke,g,ze),Oe.target=fr,Oe.relatedTarget=Me,qe=null,nl(ze)===Ee&&(Zt=new Zt(ye,pe+"enter",Nt,g,ze),Zt.target=Me,Zt.relatedTarget=fr,qe=Zt),fr=qe,ke&&Nt)t:{for(Zt=cQ,ye=ke,pe=Nt,Me=0,qe=ye;qe;qe=Zt(qe))Me++;qe=0;for(var Wt=pe;Wt;Wt=Zt(Wt))qe++;for(;0<Me-qe;)ye=Zt(ye),Me--;for(;0<qe-Me;)pe=Zt(pe),qe--;for(;Me--;){if(ye===pe||pe!==null&&ye===pe.alternate){Zt=ye;break t}ye=Zt(ye),pe=Zt(pe)}Zt=null}else Zt=null;ke!==null&&$k(Ke,Oe,ke,Zt,!1),Nt!==null&&fr!==null&&$k(Ke,fr,Nt,Zt,!0)}}e:{if(Oe=Ee?Kl(Ee):window,ke=Oe.nodeName&&Oe.nodeName.toLowerCase(),ke==="select"||ke==="input"&&Oe.type==="file")var $n=Oy;else if(Ry(Oe))if(lo)$n=$1;else{$n=Ny;var Ft=W1}else ke=Oe.nodeName,!ke||ke.toLowerCase()!=="input"||Oe.type!=="checkbox"&&Oe.type!=="radio"?Ee&&ds(Ee.elementType)&&($n=Oy):$n=q1;if($n&&($n=$n(l,Ee))){om(Ke,$n,g,ze);break e}Ft&&Ft(l,Oe,Ee),l==="focusout"&&Ee&&Oe.type==="number"&&Ee.memoizedProps.value!=null&&hr(Oe,"number",Oe.value)}switch(Ft=Ee?Kl(Ee):window,l){case"focusin":(Ry(Ft)||Ft.contentEditable==="true")&&(co=Ft,uo=Ee,wf=null);break;case"focusout":wf=uo=co=null;break;case"mousedown":lm=!0;break;case"contextmenu":case"mouseup":case"dragend":lm=!1,Mf(Ke,g,ze);break;case"selectionchange":if(K1)break;case"keydown":case"keyup":Mf(Ke,g,ze)}var xn;if(au)e:{switch(l){case"compositionstart":var kn="onCompositionStart";break e;case"compositionend":kn="onCompositionEnd";break e;case"compositionupdate":kn="onCompositionUpdate";break e}kn=void 0}else su?sm(l,g)&&(kn="onCompositionEnd"):l==="keydown"&&g.keyCode===229&&(kn="onCompositionStart");kn&&(My&&g.locale!=="ko"&&(su||kn!=="onCompositionStart"?kn==="onCompositionEnd"&&su&&(xn=$d()):(Ga=ze,Zp="value"in Ga?Ga.value:Ga.textContent,su=!0)),Ft=X_(Ee,kn),0<Ft.length&&(kn=new tm(kn,l,null,g,ze),Ke.push({event:kn,listeners:Ft}),xn?kn.data=xn:(xn=Ey(g),xn!==null&&(kn.data=xn)))),(xn=am?H1(l,g):Ty(l,g))&&(kn=X_(Ee,"onBeforeInput"),0<kn.length&&(Ft=new tm("onBeforeInput","beforeinput",null,g,ze),Ke.push({event:Ft,listeners:kn}),Ft.data=xn)),Nr(Ke,l,Ee,g,ze)}Wk(Ke,f)})}function D0(l,f,g){return{instance:l,listener:f,currentTarget:g}}function X_(l,f){for(var g=f+"Capture",x=[];l!==null;){var O=l,N=O.stateNode;if(O=O.tag,O!==5&&O!==26&&O!==27||N===null||(O=pf(l,g),O!=null&&x.unshift(D0(l,O,N)),O=pf(l,f),O!=null&&x.push(D0(l,O,N))),l.tag===3)return x;l=l.return}return[]}function cQ(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function $k(l,f,g,x,O){for(var N=f._reactName,G=[];g!==null&&g!==x;){var Z=g,le=Z.alternate,Ee=Z.stateNode;if(Z=Z.tag,le!==null&&le===x)break;Z!==5&&Z!==26&&Z!==27||Ee===null||(le=Ee,O?(Ee=pf(g,N),Ee!=null&&G.unshift(D0(g,Ee,le))):O||(Ee=pf(g,N),Ee!=null&&G.push(D0(g,Ee,le)))),g=g.return}G.length!==0&&l.push({event:f,listeners:G})}var uQ=/\r\n?/g,fQ=/\u0000|\uFFFD/g;function Xk(l){return(typeof l=="string"?l:""+l).replace(uQ,`
`).replace(fQ,"")}function Kk(l,f){return f=Xk(f),Xk(l)===f}function ur(l,f,g,x,O,N){switch(g){case"children":typeof x=="string"?f==="body"||f==="textarea"&&x===""||Zr(l,x):(typeof x=="number"||typeof x=="bigint")&&f!=="body"&&Zr(l,""+x);break;case"className":Ht(l,"class",x);break;case"tabIndex":Ht(l,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":Ht(l,g,x);break;case"style":tu(l,x,N);break;case"data":if(f!=="object"){Ht(l,"data",x);break}case"src":case"href":if(x===""&&(f!=="a"||g!=="href")){l.removeAttribute(g);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){l.removeAttribute(g);break}x=qd(""+x),l.setAttribute(g,x);break;case"action":case"formAction":if(typeof x=="function"){l.setAttribute(g,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof N=="function"&&(g==="formAction"?(f!=="input"&&ur(l,f,"name",O.name,O,null),ur(l,f,"formEncType",O.formEncType,O,null),ur(l,f,"formMethod",O.formMethod,O,null),ur(l,f,"formTarget",O.formTarget,O,null)):(ur(l,f,"encType",O.encType,O,null),ur(l,f,"method",O.method,O,null),ur(l,f,"target",O.target,O,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){l.removeAttribute(g);break}x=qd(""+x),l.setAttribute(g,x);break;case"onClick":x!=null&&(l.onclick=il);break;case"onScroll":x!=null&&Dn("scroll",l);break;case"onScrollEnd":x!=null&&Dn("scrollend",l);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(g=x.__html,g!=null){if(O.children!=null)throw Error(r(60));l.innerHTML=g}}break;case"multiple":l.multiple=x&&typeof x!="function"&&typeof x!="symbol";break;case"muted":l.muted=x&&typeof x!="function"&&typeof x!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(x==null||typeof x=="function"||typeof x=="boolean"||typeof x=="symbol"){l.removeAttribute("xlink:href");break}g=qd(""+x),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",g);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":x!=null&&typeof x!="function"&&typeof x!="symbol"?l.setAttribute(g,""+x):l.removeAttribute(g);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":x&&typeof x!="function"&&typeof x!="symbol"?l.setAttribute(g,""):l.removeAttribute(g);break;case"capture":case"download":x===!0?l.setAttribute(g,""):x!==!1&&x!=null&&typeof x!="function"&&typeof x!="symbol"?l.setAttribute(g,x):l.removeAttribute(g);break;case"cols":case"rows":case"size":case"span":x!=null&&typeof x!="function"&&typeof x!="symbol"&&!isNaN(x)&&1<=x?l.setAttribute(g,x):l.removeAttribute(g);break;case"rowSpan":case"start":x==null||typeof x=="function"||typeof x=="symbol"||isNaN(x)?l.removeAttribute(g):l.setAttribute(g,x);break;case"popover":Dn("beforetoggle",l),Dn("toggle",l),Rt(l,"popover",x);break;case"xlinkActuate":Dt(l,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":Dt(l,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":Dt(l,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":Dt(l,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":Dt(l,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":Dt(l,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":Dt(l,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":Dt(l,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":Dt(l,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":Rt(l,"is",x);break;case"innerText":case"textContent":break;default:(!(2<g.length)||g[0]!=="o"&&g[0]!=="O"||g[1]!=="n"&&g[1]!=="N")&&(g=E1.get(g)||g,Rt(l,g,x))}}function YT(l,f,g,x,O,N){switch(g){case"style":tu(l,x,N);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(g=x.__html,g!=null){if(O.children!=null)throw Error(r(60));l.innerHTML=g}}break;case"children":typeof x=="string"?Zr(l,x):(typeof x=="number"||typeof x=="bigint")&&Zr(l,""+x);break;case"onScroll":x!=null&&Dn("scroll",l);break;case"onScrollEnd":x!=null&&Dn("scrollend",l);break;case"onClick":x!=null&&(l.onclick=il);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pe.hasOwnProperty(g))e:{if(g[0]==="o"&&g[1]==="n"&&(O=g.endsWith("Capture"),f=g.slice(2,O?g.length-7:void 0),N=l[li]||null,N=N!=null?N[g]:null,typeof N=="function"&&l.removeEventListener(f,N,O),typeof x=="function")){typeof N!="function"&&N!==null&&(g in l?l[g]=null:l.hasAttribute(g)&&l.removeAttribute(g)),l.addEventListener(f,x,O);break e}g in l?l[g]=x:x===!0?l.setAttribute(g,""):Rt(l,g,x)}}}function ua(l,f,g){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Dn("error",l),Dn("load",l);var x=!1,O=!1,N;for(N in g)if(g.hasOwnProperty(N)){var G=g[N];if(G!=null)switch(N){case"src":x=!0;break;case"srcSet":O=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,f));default:ur(l,f,N,G,g,null)}}O&&ur(l,f,"srcSet",g.srcSet,g,null),x&&ur(l,f,"src",g.src,g,null);return;case"input":Dn("invalid",l);var Z=N=G=O=null,le=null,Ee=null;for(x in g)if(g.hasOwnProperty(x)){var ze=g[x];if(ze!=null)switch(x){case"name":O=ze;break;case"type":G=ze;break;case"checked":le=ze;break;case"defaultChecked":Ee=ze;break;case"value":N=ze;break;case"defaultValue":Z=ze;break;case"children":case"dangerouslySetInnerHTML":if(ze!=null)throw Error(r(137,f));break;default:ur(l,f,x,ze,g,null)}}Us(l,N,Z,le,Ee,G,O,!1);return;case"select":Dn("invalid",l),x=G=N=null;for(O in g)if(g.hasOwnProperty(O)&&(Z=g[O],Z!=null))switch(O){case"value":N=Z;break;case"defaultValue":G=Z;break;case"multiple":x=Z;default:ur(l,f,O,Z,g,null)}f=N,g=G,l.multiple=!!x,f!=null?ea(l,!!x,f,!1):g!=null&&ea(l,!!x,g,!0);return;case"textarea":Dn("invalid",l),N=O=x=null;for(G in g)if(g.hasOwnProperty(G)&&(Z=g[G],Z!=null))switch(G){case"value":x=Z;break;case"defaultValue":O=Z;break;case"children":N=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(91));break;default:ur(l,f,G,Z,g,null)}ci(l,x,O,N);return;case"option":for(le in g)g.hasOwnProperty(le)&&(x=g[le],x!=null)&&(le==="selected"?l.selected=x&&typeof x!="function"&&typeof x!="symbol":ur(l,f,le,x,g,null));return;case"dialog":Dn("beforetoggle",l),Dn("toggle",l),Dn("cancel",l),Dn("close",l);break;case"iframe":case"object":Dn("load",l);break;case"video":case"audio":for(x=0;x<Os.length;x++)Dn(Os[x],l);break;case"image":Dn("error",l),Dn("load",l);break;case"details":Dn("toggle",l);break;case"embed":case"source":case"link":Dn("error",l),Dn("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ee in g)if(g.hasOwnProperty(Ee)&&(x=g[Ee],x!=null))switch(Ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,f));default:ur(l,f,Ee,x,g,null)}return;default:if(ds(f)){for(ze in g)g.hasOwnProperty(ze)&&(x=g[ze],x!==void 0&&YT(l,f,ze,x,g,void 0));return}}for(Z in g)g.hasOwnProperty(Z)&&(x=g[Z],x!=null&&ur(l,f,Z,x,g,null))}function dQ(l,f,g,x){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var O=null,N=null,G=null,Z=null,le=null,Ee=null,ze=null;for(ke in g){var Ke=g[ke];if(g.hasOwnProperty(ke)&&Ke!=null)switch(ke){case"checked":break;case"value":break;case"defaultValue":le=Ke;default:x.hasOwnProperty(ke)||ur(l,f,ke,null,x,Ke)}}for(var Oe in x){var ke=x[Oe];if(Ke=g[Oe],x.hasOwnProperty(Oe)&&(ke!=null||Ke!=null))switch(Oe){case"type":N=ke;break;case"name":O=ke;break;case"checked":Ee=ke;break;case"defaultChecked":ze=ke;break;case"value":G=ke;break;case"defaultValue":Z=ke;break;case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(r(137,f));break;default:ke!==Ke&&ur(l,f,Oe,ke,x,Ke)}}Jr(l,G,Z,le,Ee,ze,N,O);return;case"select":ke=G=Z=Oe=null;for(N in g)if(le=g[N],g.hasOwnProperty(N)&&le!=null)switch(N){case"value":break;case"multiple":ke=le;default:x.hasOwnProperty(N)||ur(l,f,N,null,x,le)}for(O in x)if(N=x[O],le=g[O],x.hasOwnProperty(O)&&(N!=null||le!=null))switch(O){case"value":Oe=N;break;case"defaultValue":Z=N;break;case"multiple":G=N;default:N!==le&&ur(l,f,O,N,x,le)}f=Z,g=G,x=ke,Oe!=null?ea(l,!!g,Oe,!1):!!x!=!!g&&(f!=null?ea(l,!!g,f,!0):ea(l,!!g,g?[]:"",!1));return;case"textarea":ke=Oe=null;for(Z in g)if(O=g[Z],g.hasOwnProperty(Z)&&O!=null&&!x.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:ur(l,f,Z,null,x,O)}for(G in x)if(O=x[G],N=g[G],x.hasOwnProperty(G)&&(O!=null||N!=null))switch(G){case"value":Oe=O;break;case"defaultValue":ke=O;break;case"children":break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:O!==N&&ur(l,f,G,O,x,N)}Wn(l,Oe,ke);return;case"option":for(var Nt in g)Oe=g[Nt],g.hasOwnProperty(Nt)&&Oe!=null&&!x.hasOwnProperty(Nt)&&(Nt==="selected"?l.selected=!1:ur(l,f,Nt,null,x,Oe));for(le in x)Oe=x[le],ke=g[le],x.hasOwnProperty(le)&&Oe!==ke&&(Oe!=null||ke!=null)&&(le==="selected"?l.selected=Oe&&typeof Oe!="function"&&typeof Oe!="symbol":ur(l,f,le,Oe,x,ke));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Zt in g)Oe=g[Zt],g.hasOwnProperty(Zt)&&Oe!=null&&!x.hasOwnProperty(Zt)&&ur(l,f,Zt,null,x,Oe);for(Ee in x)if(Oe=x[Ee],ke=g[Ee],x.hasOwnProperty(Ee)&&Oe!==ke&&(Oe!=null||ke!=null))switch(Ee){case"children":case"dangerouslySetInnerHTML":if(Oe!=null)throw Error(r(137,f));break;default:ur(l,f,Ee,Oe,x,ke)}return;default:if(ds(f)){for(var fr in g)Oe=g[fr],g.hasOwnProperty(fr)&&Oe!==void 0&&!x.hasOwnProperty(fr)&&YT(l,f,fr,void 0,x,Oe);for(ze in x)Oe=x[ze],ke=g[ze],!x.hasOwnProperty(ze)||Oe===ke||Oe===void 0&&ke===void 0||YT(l,f,ze,Oe,x,ke);return}}for(var ye in g)Oe=g[ye],g.hasOwnProperty(ye)&&Oe!=null&&!x.hasOwnProperty(ye)&&ur(l,f,ye,null,x,Oe);for(Ke in x)Oe=x[Ke],ke=g[Ke],!x.hasOwnProperty(Ke)||Oe===ke||Oe==null&&ke==null||ur(l,f,Ke,Oe,x,ke)}function Yk(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hQ(){if(typeof performance.getEntriesByType=="function"){for(var l=0,f=0,g=performance.getEntriesByType("resource"),x=0;x<g.length;x++){var O=g[x],N=O.transferSize,G=O.initiatorType,Z=O.duration;if(N&&Z&&Yk(G)){for(G=0,Z=O.responseEnd,x+=1;x<g.length;x++){var le=g[x],Ee=le.startTime;if(Ee>Z)break;var ze=le.transferSize,Ke=le.initiatorType;ze&&Yk(Ke)&&(le=le.responseEnd,G+=ze*(le<Z?1:(Z-Ee)/(le-Ee)))}if(--x,f+=8*(N+G)/(O.duration/1e3),l++,10<l)break}}if(0<l)return f/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var JT=null,ZT=null;function K_(l){return l.nodeType===9?l:l.ownerDocument}function Jk(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Zk(l,f){if(l===0)switch(f){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&f==="foreignObject"?0:l}function QT(l,f){return l==="textarea"||l==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.children=="bigint"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var eC=null;function pQ(){var l=window.event;return l&&l.type==="popstate"?l===eC?!1:(eC=l,!0):(eC=null,!1)}var Qk=typeof setTimeout=="function"?setTimeout:void 0,mQ=typeof clearTimeout=="function"?clearTimeout:void 0,e2=typeof Promise=="function"?Promise:void 0,gQ=typeof queueMicrotask=="function"?queueMicrotask:typeof e2<"u"?function(l){return e2.resolve(null).then(l).catch(vQ)}:Qk;function vQ(l){setTimeout(function(){throw l})}function Jf(l){return l==="head"}function t2(l,f){var g=f,x=0;do{var O=g.nextSibling;if(l.removeChild(g),O&&O.nodeType===8)if(g=O.data,g==="/$"||g==="/&"){if(x===0){l.removeChild(O),eg(f);return}x--}else if(g==="$"||g==="$?"||g==="$~"||g==="$!"||g==="&")x++;else if(g==="html")N0(l.ownerDocument.documentElement);else if(g==="head"){g=l.ownerDocument.head,N0(g);for(var N=g.firstChild;N;){var G=N.nextSibling,Z=N.nodeName;N[Fs]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&N.rel.toLowerCase()==="stylesheet"||g.removeChild(N),N=G}}else g==="body"&&N0(l.ownerDocument.body);g=O}while(g);eg(f)}function n2(l,f){var g=l;l=0;do{var x=g.nextSibling;if(g.nodeType===1?f?(g._stashedDisplay=g.style.display,g.style.display="none"):(g.style.display=g._stashedDisplay||"",g.getAttribute("style")===""&&g.removeAttribute("style")):g.nodeType===3&&(f?(g._stashedText=g.nodeValue,g.nodeValue=""):g.nodeValue=g._stashedText||""),x&&x.nodeType===8)if(g=x.data,g==="/$"){if(l===0)break;l--}else g!=="$"&&g!=="$?"&&g!=="$~"&&g!=="$!"||l++;g=x}while(g)}function tC(l){var f=l.firstChild;for(f&&f.nodeType===10&&(f=f.nextSibling);f;){var g=f;switch(f=f.nextSibling,g.nodeName){case"HTML":case"HEAD":case"BODY":tC(g),tl(g);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(g.rel.toLowerCase()==="stylesheet")continue}l.removeChild(g)}}function yQ(l,f,g,x){for(;l.nodeType===1;){var O=g;if(l.nodeName.toLowerCase()!==f.toLowerCase()){if(!x&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(x){if(!l[Fs])switch(f){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(N=l.getAttribute("rel"),N==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(N!==O.rel||l.getAttribute("href")!==(O.href==null||O.href===""?null:O.href)||l.getAttribute("crossorigin")!==(O.crossOrigin==null?null:O.crossOrigin)||l.getAttribute("title")!==(O.title==null?null:O.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(N=l.getAttribute("src"),(N!==(O.src==null?null:O.src)||l.getAttribute("type")!==(O.type==null?null:O.type)||l.getAttribute("crossorigin")!==(O.crossOrigin==null?null:O.crossOrigin))&&N&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(f==="input"&&l.type==="hidden"){var N=O.name==null?null:""+O.name;if(O.type==="hidden"&&l.getAttribute("name")===N)return l}else return l;if(l=Oo(l.nextSibling),l===null)break}return null}function xQ(l,f,g){if(f==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!g||(l=Oo(l.nextSibling),l===null))return null;return l}function r2(l,f){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!f||(l=Oo(l.nextSibling),l===null))return null;return l}function nC(l){return l.data==="$?"||l.data==="$~"}function rC(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function bQ(l,f){var g=l.ownerDocument;if(l.data==="$~")l._reactRetry=f;else if(l.data!=="$?"||g.readyState!=="loading")f();else{var x=function(){f(),g.removeEventListener("DOMContentLoaded",x)};g.addEventListener("DOMContentLoaded",x),l._reactRetry=x}}function Oo(l){for(;l!=null;l=l.nextSibling){var f=l.nodeType;if(f===1||f===3)break;if(f===8){if(f=l.data,f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"||f==="F!"||f==="F")break;if(f==="/$"||f==="/&")return null}}return l}var iC=null;function i2(l){l=l.nextSibling;for(var f=0;l;){if(l.nodeType===8){var g=l.data;if(g==="/$"||g==="/&"){if(f===0)return Oo(l.nextSibling);f--}else g!=="$"&&g!=="$!"&&g!=="$?"&&g!=="$~"&&g!=="&"||f++}l=l.nextSibling}return null}function a2(l){l=l.previousSibling;for(var f=0;l;){if(l.nodeType===8){var g=l.data;if(g==="$"||g==="$!"||g==="$?"||g==="$~"||g==="&"){if(f===0)return l;f--}else g!=="/$"&&g!=="/&"||f++}l=l.previousSibling}return null}function s2(l,f,g){switch(f=K_(g),l){case"html":if(l=f.documentElement,!l)throw Error(r(452));return l;case"head":if(l=f.head,!l)throw Error(r(453));return l;case"body":if(l=f.body,!l)throw Error(r(454));return l;default:throw Error(r(451))}}function N0(l){for(var f=l.attributes;f.length;)l.removeAttributeNode(f[0]);tl(l)}var Po=new Map,o2=new Set;function Y_(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var Ou=$.d;$.d={f:_Q,r:SQ,D:AQ,C:wQ,L:MQ,m:EQ,X:CQ,S:TQ,M:RQ};function _Q(){var l=Ou.f(),f=Vs();return l||f}function SQ(l){var f=rl(l);f!==null&&f.tag===5&&f.type==="form"?D_(f):Ou.r(l)}var Jm=typeof document>"u"?null:document;function l2(l,f,g){var x=Jm;if(x&&typeof f=="string"&&f){var O=Jt(f);O='link[rel="'+l+'"][href="'+O+'"]',typeof g=="string"&&(O+='[crossorigin="'+g+'"]'),o2.has(O)||(o2.add(O),l={rel:l,crossOrigin:g,href:f},x.querySelector(O)===null&&(f=x.createElement("link"),ua(f,"link",l),J(f),x.head.appendChild(f)))}}function AQ(l){Ou.D(l),l2("dns-prefetch",l,null)}function wQ(l,f){Ou.C(l,f),l2("preconnect",l,f)}function MQ(l,f,g){Ou.L(l,f,g);var x=Jm;if(x&&l&&f){var O='link[rel="preload"][as="'+Jt(f)+'"]';f==="image"&&g&&g.imageSrcSet?(O+='[imagesrcset="'+Jt(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(O+='[imagesizes="'+Jt(g.imageSizes)+'"]')):O+='[href="'+Jt(l)+'"]';var N=O;switch(f){case"style":N=Zm(l);break;case"script":N=Qm(l)}Po.has(N)||(l=p({rel:"preload",href:f==="image"&&g&&g.imageSrcSet?void 0:l,as:f},g),Po.set(N,l),x.querySelector(O)!==null||f==="style"&&x.querySelector(I0(N))||f==="script"&&x.querySelector(B0(N))||(f=x.createElement("link"),ua(f,"link",l),J(f),x.head.appendChild(f)))}}function EQ(l,f){Ou.m(l,f);var g=Jm;if(g&&l){var x=f&&typeof f.as=="string"?f.as:"script",O='link[rel="modulepreload"][as="'+Jt(x)+'"][href="'+Jt(l)+'"]',N=O;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=Qm(l)}if(!Po.has(N)&&(l=p({rel:"modulepreload",href:l},f),Po.set(N,l),g.querySelector(O)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(B0(N)))return}x=g.createElement("link"),ua(x,"link",l),J(x),g.head.appendChild(x)}}}function TQ(l,f,g){Ou.S(l,f,g);var x=Jm;if(x&&l){var O=so(x).hoistableStyles,N=Zm(l);f=f||"default";var G=O.get(N);if(!G){var Z={loading:0,preload:null};if(G=x.querySelector(I0(N)))Z.loading=5;else{l=p({rel:"stylesheet",href:l,"data-precedence":f},g),(g=Po.get(N))&&aC(l,g);var le=G=x.createElement("link");J(le),ua(le,"link",l),le._p=new Promise(function(Ee,ze){le.onload=Ee,le.onerror=ze}),le.addEventListener("load",function(){Z.loading|=1}),le.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,J_(G,f,x)}G={type:"stylesheet",instance:G,count:1,state:Z},O.set(N,G)}}}function CQ(l,f){Ou.X(l,f);var g=Jm;if(g&&l){var x=so(g).hoistableScripts,O=Qm(l),N=x.get(O);N||(N=g.querySelector(B0(O)),N||(l=p({src:l,async:!0},f),(f=Po.get(O))&&sC(l,f),N=g.createElement("script"),J(N),ua(N,"link",l),g.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(O,N))}}function RQ(l,f){Ou.M(l,f);var g=Jm;if(g&&l){var x=so(g).hoistableScripts,O=Qm(l),N=x.get(O);N||(N=g.querySelector(B0(O)),N||(l=p({src:l,async:!0,type:"module"},f),(f=Po.get(O))&&sC(l,f),N=g.createElement("script"),J(N),ua(N,"link",l),g.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(O,N))}}function c2(l,f,g,x){var O=(O=me.current)?Y_(O):null;if(!O)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(f=Zm(g.href),g=so(O).hoistableStyles,x=g.get(f),x||(x={type:"style",instance:null,count:0,state:null},g.set(f,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){l=Zm(g.href);var N=so(O).hoistableStyles,G=N.get(l);if(G||(O=O.ownerDocument||O,G={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(l,G),(N=O.querySelector(I0(l)))&&!N._p&&(G.instance=N,G.state.loading=5),Po.has(l)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},Po.set(l,g),N||OQ(O,l,g,G.state))),f&&x===null)throw Error(r(528,""));return G}if(f&&x!==null)throw Error(r(529,""));return null;case"script":return f=g.async,g=g.src,typeof g=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=Qm(g),g=so(O).hoistableScripts,x=g.get(f),x||(x={type:"script",instance:null,count:0,state:null},g.set(f,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function Zm(l){return'href="'+Jt(l)+'"'}function I0(l){return'link[rel="stylesheet"]['+l+"]"}function u2(l){return p({},l,{"data-precedence":l.precedence,precedence:null})}function OQ(l,f,g,x){l.querySelector('link[rel="preload"][as="style"]['+f+"]")?x.loading=1:(f=l.createElement("link"),x.preload=f,f.addEventListener("load",function(){return x.loading|=1}),f.addEventListener("error",function(){return x.loading|=2}),ua(f,"link",g),J(f),l.head.appendChild(f))}function Qm(l){return'[src="'+Jt(l)+'"]'}function B0(l){return"script[async]"+l}function f2(l,f,g){if(f.count++,f.instance===null)switch(f.type){case"style":var x=l.querySelector('style[data-href~="'+Jt(g.href)+'"]');if(x)return f.instance=x,J(x),x;var O=p({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return x=(l.ownerDocument||l).createElement("style"),J(x),ua(x,"style",O),J_(x,g.precedence,l),f.instance=x;case"stylesheet":O=Zm(g.href);var N=l.querySelector(I0(O));if(N)return f.state.loading|=4,f.instance=N,J(N),N;x=u2(g),(O=Po.get(O))&&aC(x,O),N=(l.ownerDocument||l).createElement("link"),J(N);var G=N;return G._p=new Promise(function(Z,le){G.onload=Z,G.onerror=le}),ua(N,"link",x),f.state.loading|=4,J_(N,g.precedence,l),f.instance=N;case"script":return N=Qm(g.src),(O=l.querySelector(B0(N)))?(f.instance=O,J(O),O):(x=g,(O=Po.get(N))&&(x=p({},g),sC(x,O)),l=l.ownerDocument||l,O=l.createElement("script"),J(O),ua(O,"link",x),l.head.appendChild(O),f.instance=O);case"void":return null;default:throw Error(r(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(x=f.instance,f.state.loading|=4,J_(x,g.precedence,l));return f.instance}function J_(l,f,g){for(var x=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),O=x.length?x[x.length-1]:null,N=O,G=0;G<x.length;G++){var Z=x[G];if(Z.dataset.precedence===f)N=Z;else if(N!==O)break}N?N.parentNode.insertBefore(l,N.nextSibling):(f=g.nodeType===9?g.head:g,f.insertBefore(l,f.firstChild))}function aC(l,f){l.crossOrigin==null&&(l.crossOrigin=f.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=f.referrerPolicy),l.title==null&&(l.title=f.title)}function sC(l,f){l.crossOrigin==null&&(l.crossOrigin=f.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=f.referrerPolicy),l.integrity==null&&(l.integrity=f.integrity)}var Z_=null;function d2(l,f,g){if(Z_===null){var x=new Map,O=Z_=new Map;O.set(g,x)}else O=Z_,x=O.get(g),x||(x=new Map,O.set(g,x));if(x.has(l))return x;for(x.set(l,null),g=g.getElementsByTagName(l),O=0;O<g.length;O++){var N=g[O];if(!(N[Fs]||N[Er]||l==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var G=N.getAttribute(f)||"";G=l+G;var Z=x.get(G);Z?Z.push(N):x.set(G,[N])}}return x}function h2(l,f,g){l=l.ownerDocument||l,l.head.insertBefore(g,f==="title"?l.querySelector("head > title"):null)}function PQ(l,f,g){if(g===1||f.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;return f.rel==="stylesheet"?(l=f.disabled,typeof f.precedence=="string"&&l==null):!0;case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function p2(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function DQ(l,f,g,x){if(g.type==="stylesheet"&&(typeof x.media!="string"||matchMedia(x.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var O=Zm(x.href),N=f.querySelector(I0(O));if(N){f=N._p,f!==null&&typeof f=="object"&&typeof f.then=="function"&&(l.count++,l=Q_.bind(l),f.then(l,l)),g.state.loading|=4,g.instance=N,J(N);return}N=f.ownerDocument||f,x=u2(x),(O=Po.get(O))&&aC(x,O),N=N.createElement("link"),J(N);var G=N;G._p=new Promise(function(Z,le){G.onload=Z,G.onerror=le}),ua(N,"link",x),g.instance=N}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(g,f),(f=g.state.preload)&&(g.state.loading&3)===0&&(l.count++,g=Q_.bind(l),f.addEventListener("load",g),f.addEventListener("error",g))}}var oC=0;function NQ(l,f){return l.stylesheets&&l.count===0&&tS(l,l.stylesheets),0<l.count||0<l.imgCount?function(g){var x=setTimeout(function(){if(l.stylesheets&&tS(l,l.stylesheets),l.unsuspend){var N=l.unsuspend;l.unsuspend=null,N()}},6e4+f);0<l.imgBytes&&oC===0&&(oC=62500*hQ());var O=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&tS(l,l.stylesheets),l.unsuspend)){var N=l.unsuspend;l.unsuspend=null,N()}},(l.imgBytes>oC?50:800)+f);return l.unsuspend=g,function(){l.unsuspend=null,clearTimeout(x),clearTimeout(O)}}:null}function Q_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tS(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var eS=null;function tS(l,f){l.stylesheets=null,l.unsuspend!==null&&(l.count++,eS=new Map,f.forEach(IQ,l),eS=null,Q_.call(l))}function IQ(l,f){if(!(f.state.loading&4)){var g=eS.get(l);if(g)var x=g.get(null);else{g=new Map,eS.set(l,g);for(var O=l.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<O.length;N++){var G=O[N];(G.nodeName==="LINK"||G.getAttribute("media")!=="not all")&&(g.set(G.dataset.precedence,G),x=G)}x&&g.set(null,x)}O=f.instance,G=O.getAttribute("data-precedence"),N=g.get(G)||x,N===x&&g.set(null,O),g.set(G,O),this.count++,x=Q_.bind(this),O.addEventListener("load",x),O.addEventListener("error",x),N?N.parentNode.insertBefore(O,N.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(O,l.firstChild)),f.state.loading|=4}}var L0={$$typeof:T,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function BQ(l,f,g,x,O,N,G,Z,le){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=hn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hn(0),this.hiddenUpdates=hn(null),this.identifierPrefix=x,this.onUncaughtError=O,this.onCaughtError=N,this.onRecoverableError=G,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=le,this.incompleteTransitions=new Map}function m2(l,f,g,x,O,N,G,Z,le,Ee,ze,Ke){return l=new BQ(l,f,g,G,le,Ee,ze,Ke,Z),f=1,N===!0&&(f|=24),N=Tr(3,null,null,f),l.current=N,N.stateNode=l,f=jy(),f.refCount++,l.pooledCache=f,f.refCount++,N.memoizedState={element:x,isDehydrated:g,cache:f},dh(N),l}function g2(l){return l?(l=ec,l):ec}function v2(l,f,g,x,O,N){O=g2(O),x.context===null?x.context=O:x.pendingContext=O,x=dl(f),x.payload={element:g},N=N===void 0?null:N,N!==null&&(x.callback=N),g=lc(l,x,f),g!==null&&(gn(g,l,f),cc(g,l,f))}function y2(l,f){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<f?g:f}}function lC(l,f){y2(l,f),(l=l.alternate)&&y2(l,f)}function x2(l){if(l.tag===13||l.tag===31){var f=ra(l,67108864);f!==null&&gn(f,l,67108864),lC(l,67108864)}}function b2(l){if(l.tag===13||l.tag===31){var f=Ja();f=$l(f);var g=ra(l,f);g!==null&&gn(g,l,f),lC(l,f)}}var nS=!0;function LQ(l,f,g,x){var O=V.T;V.T=null;var N=$.p;try{$.p=2,cC(l,f,g,x)}finally{$.p=N,V.T=O}}function kQ(l,f,g,x){var O=V.T;V.T=null;var N=$.p;try{$.p=8,cC(l,f,g,x)}finally{$.p=N,V.T=O}}function cC(l,f,g,x){if(nS){var O=uC(x);if(O===null)KT(l,f,x,rS,g),S2(l,x);else if(UQ(O,l,f,g,x))x.stopPropagation();else if(S2(l,x),f&4&&-1<FQ.indexOf(l)){for(;O!==null;){var N=rl(O);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var G=tt(N.pendingLanes);if(G!==0){var Z=N;for(Z.pendingLanes|=2,Z.entangledLanes|=2;G;){var le=1<<31-se(G);Z.entanglements[1]|=le,G&=~le}nt(N),(Ut&6)===0&&(qr=H()+500,Mt(0))}}break;case 31:case 13:Z=ra(N,2),Z!==null&&gn(Z,N,2),Vs(),lC(N,2)}if(N=uC(x),N===null&&KT(l,f,x,rS,g),N===O)break;O=N}O!==null&&x.stopPropagation()}else KT(l,f,x,null,g)}}function uC(l){return l=Yp(l),fC(l)}var rS=null;function fC(l){if(rS=null,l=nl(l),l!==null){var f=a(l);if(f===null)l=null;else{var g=f.tag;if(g===13){if(l=s(f),l!==null)return l;l=null}else if(g===31){if(l=o(f),l!==null)return l;l=null}else if(g===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;l=null}else f!==l&&(l=null)}}return rS=l,null}function _2(l){switch(l){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(he()){case Ne:return 2;case je:return 8;case Ie:case _t:return 32;case lt:return 268435456;default:return 32}default:return 32}}var dC=!1,Zf=null,Qf=null,ed=null,k0=new Map,F0=new Map,td=[],FQ="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".split(" ");function S2(l,f){switch(l){case"focusin":case"focusout":Zf=null;break;case"dragenter":case"dragleave":Qf=null;break;case"mouseover":case"mouseout":ed=null;break;case"pointerover":case"pointerout":k0.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":F0.delete(f.pointerId)}}function U0(l,f,g,x,O,N){return l===null||l.nativeEvent!==N?(l={blockedOn:f,domEventName:g,eventSystemFlags:x,nativeEvent:N,targetContainers:[O]},f!==null&&(f=rl(f),f!==null&&x2(f)),l):(l.eventSystemFlags|=x,f=l.targetContainers,O!==null&&f.indexOf(O)===-1&&f.push(O),l)}function UQ(l,f,g,x,O){switch(f){case"focusin":return Zf=U0(Zf,l,f,g,x,O),!0;case"dragenter":return Qf=U0(Qf,l,f,g,x,O),!0;case"mouseover":return ed=U0(ed,l,f,g,x,O),!0;case"pointerover":var N=O.pointerId;return k0.set(N,U0(k0.get(N)||null,l,f,g,x,O)),!0;case"gotpointercapture":return N=O.pointerId,F0.set(N,U0(F0.get(N)||null,l,f,g,x,O)),!0}return!1}function A2(l){var f=nl(l.target);if(f!==null){var g=a(f);if(g!==null){if(f=g.tag,f===13){if(f=s(g),f!==null){l.blockedOn=f,Wi(l.priority,function(){b2(g)});return}}else if(f===31){if(f=o(g),f!==null){l.blockedOn=f,Wi(l.priority,function(){b2(g)});return}}else if(f===3&&g.stateNode.current.memoizedState.isDehydrated){l.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}l.blockedOn=null}function iS(l){if(l.blockedOn!==null)return!1;for(var f=l.targetContainers;0<f.length;){var g=uC(l.nativeEvent);if(g===null){g=l.nativeEvent;var x=new g.constructor(g.type,g);Kp=x,g.target.dispatchEvent(x),Kp=null}else return f=rl(g),f!==null&&x2(f),l.blockedOn=g,!1;f.shift()}return!0}function w2(l,f,g){iS(l)&&g.delete(f)}function jQ(){dC=!1,Zf!==null&&iS(Zf)&&(Zf=null),Qf!==null&&iS(Qf)&&(Qf=null),ed!==null&&iS(ed)&&(ed=null),k0.forEach(w2),F0.forEach(w2)}function aS(l,f){l.blockedOn===f&&(l.blockedOn=null,dC||(dC=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jQ)))}var sS=null;function M2(l){sS!==l&&(sS=l,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){sS===l&&(sS=null);for(var f=0;f<l.length;f+=3){var g=l[f],x=l[f+1],O=l[f+2];if(typeof x!="function"){if(fC(x||g)===null)continue;break}var N=rl(g);N!==null&&(l.splice(f,3),f-=3,h0(N,{pending:!0,data:O,method:g.method,action:x},x,O))}}))}function eg(l){function f(le){return aS(le,l)}Zf!==null&&aS(Zf,l),Qf!==null&&aS(Qf,l),ed!==null&&aS(ed,l),k0.forEach(f),F0.forEach(f);for(var g=0;g<td.length;g++){var x=td[g];x.blockedOn===l&&(x.blockedOn=null)}for(;0<td.length&&(g=td[0],g.blockedOn===null);)A2(g),g.blockedOn===null&&td.shift();if(g=(l.ownerDocument||l).$$reactFormReplay,g!=null)for(x=0;x<g.length;x+=3){var O=g[x],N=g[x+1],G=O[li]||null;if(typeof N=="function")G||M2(g);else if(G){var Z=null;if(N&&N.hasAttribute("formAction")){if(O=N,G=N[li]||null)Z=G.formAction;else if(fC(O)!==null)continue}else Z=G.action;typeof Z=="function"?g[x+1]=Z:(g.splice(x,3),x-=3),M2(g)}}}function E2(){function l(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(G){return O=G})},focusReset:"manual",scroll:"manual"})}function f(){O!==null&&(O(),O=null),x||setTimeout(g,20)}function g(){if(!x&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var x=!1,O=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",f),navigation.addEventListener("navigateerror",f),setTimeout(g,100),function(){x=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",f),navigation.removeEventListener("navigateerror",f),O!==null&&(O(),O=null)}}}function hC(l){this._internalRoot=l}oS.prototype.render=hC.prototype.render=function(l){var f=this._internalRoot;if(f===null)throw Error(r(409));var g=f.current,x=Ja();v2(g,x,l,f,null,null)},oS.prototype.unmount=hC.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var f=l.containerInfo;v2(l.current,2,null,l,null,null),Vs(),f[Ua]=null}};function oS(l){this._internalRoot=l}oS.prototype.unstable_scheduleHydration=function(l){if(l){var f=Qc();l={blockedOn:null,target:l,priority:f};for(var g=0;g<td.length&&f!==0&&f<td[g].priority;g++);td.splice(g,0,l),g===0&&A2(l)}};var T2=e.version;if(T2!=="19.2.3")throw Error(r(527,T2,"19.2.3"));$.findDOMNode=function(l){var f=l._reactInternals;if(f===void 0)throw typeof l.render=="function"?Error(r(188)):(l=Object.keys(l).join(","),Error(r(268,l)));return l=u(f),l=l!==null?h(l):null,l=l===null?null:l.stateNode,l};var zQ={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lS=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lS.isDisabled&&lS.supportsFiber)try{Qe=lS.inject(zQ),st=lS}catch{}}return z0.createRoot=function(l,f){if(!i(l))throw Error(r(299));var g=!1,x="",O=U_,N=x0,G=b0;return f!=null&&(f.unstable_strictMode===!0&&(g=!0),f.identifierPrefix!==void 0&&(x=f.identifierPrefix),f.onUncaughtError!==void 0&&(O=f.onUncaughtError),f.onCaughtError!==void 0&&(N=f.onCaughtError),f.onRecoverableError!==void 0&&(G=f.onRecoverableError)),f=m2(l,1,!1,null,null,g,x,null,O,N,G,E2),l[Ua]=f.current,XT(l),new hC(f)},z0.hydrateRoot=function(l,f,g){if(!i(l))throw Error(r(299));var x=!1,O="",N=U_,G=x0,Z=b0,le=null;return g!=null&&(g.unstable_strictMode===!0&&(x=!0),g.identifierPrefix!==void 0&&(O=g.identifierPrefix),g.onUncaughtError!==void 0&&(N=g.onUncaughtError),g.onCaughtError!==void 0&&(G=g.onCaughtError),g.onRecoverableError!==void 0&&(Z=g.onRecoverableError),g.formState!==void 0&&(le=g.formState)),f=m2(l,1,!0,f,g??null,x,O,le,N,G,Z,E2),f.context=g2(null),g=f.current,x=Ja(),x=$l(x),O=dl(x),O.callback=null,lc(g,O,x),g=x,f.current.lanes=g,Mr(f,g),nt(f),l[Ua]=f.current,XT(l),new oS(f)},z0.version="19.2.3",z0}var k2;function YQ(){if(k2)return gC.exports;k2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),gC.exports=KQ(),gC.exports}var PV=YQ();const IB=j.createContext({});function BB(t){const e=j.useRef(null);return e.current===null&&(e.current=t()),e.current}const DV=typeof window<"u",NV=DV?j.useLayoutEffect:j.useEffect,sE=j.createContext(null);function LB(t,e){t.indexOf(e)===-1&&t.push(e)}function WA(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const jc=(t,e,n)=>n>e?e:n<t?t:n;let kB=()=>{};const tf={},IV=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function BV(t){return typeof t=="object"&&t!==null}const LV=t=>/^0[^.\s]+$/u.test(t);function kV(t){let e;return()=>(e===void 0&&(e=t()),e)}const Go=t=>t,JQ=(t,e)=>n=>e(t(n)),$b=(...t)=>t.reduce(JQ),Hx=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class FB{constructor(){this.subscriptions=[]}add(e){return LB(this.subscriptions,e),()=>WA(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let a=0;a<i;a++){const s=this.subscriptions[a];s&&s(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ll=t=>t*1e3,Uo=t=>t/1e3;function FV(t,e){return e?t*(1e3/e):0}const UV=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,ZQ=1e-7,QQ=12;function eee(t,e,n,r,i){let a,s,o=0;do s=e+(n-e)/2,a=UV(s,r,i)-t,a>0?n=s:e=s;while(Math.abs(a)>ZQ&&++o<QQ);return s}function Xb(t,e,n,r){if(t===e&&n===r)return Go;const i=a=>eee(a,0,1,t,n);return a=>a===0||a===1?a:UV(i(a),e,r)}const jV=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,zV=t=>e=>1-t(1-e),GV=Xb(.33,1.53,.69,.99),UB=zV(GV),HV=jV(UB),VV=t=>(t*=2)<1?.5*UB(t):.5*(2-Math.pow(2,-10*(t-1))),jB=t=>1-Math.sin(Math.acos(t)),WV=zV(jB),qV=jV(jB),tee=Xb(.42,0,1,1),nee=Xb(0,0,.58,1),$V=Xb(.42,0,.58,1),ree=t=>Array.isArray(t)&&typeof t[0]!="number",XV=t=>Array.isArray(t)&&typeof t[0]=="number",iee={linear:Go,easeIn:tee,easeInOut:$V,easeOut:nee,circIn:jB,circInOut:qV,circOut:WV,backIn:UB,backInOut:HV,backOut:GV,anticipate:VV},aee=t=>typeof t=="string",F2=t=>{if(XV(t)){kB(t.length===4);const[e,n,r,i]=t;return Xb(e,n,r,i)}else if(aee(t))return iee[t];return t},uS=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function see(t,e){let n=new Set,r=new Set,i=!1,a=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function c(h){s.has(h)&&(u.schedule(h),t()),h(o)}const u={schedule:(h,p=!1,v=!1)=>{const b=v&&i?n:r;return p&&s.add(h),b.has(h)||b.add(h),h},cancel:h=>{r.delete(h),s.delete(h)},process:h=>{if(o=h,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),n.clear(),i=!1,a&&(a=!1,u.process(h))}};return u}const oee=40;function KV(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,s=uS.reduce((T,P)=>(T[P]=see(a),T),{}),{setup:o,read:c,resolveKeyframes:u,preUpdate:h,update:p,preRender:v,render:y,postRender:b}=s,w=()=>{const T=tf.useManualTiming?i.timestamp:performance.now();n=!1,tf.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(T-i.timestamp,oee),1)),i.timestamp=T,i.isProcessing=!0,o.process(i),c.process(i),u.process(i),h.process(i),p.process(i),v.process(i),y.process(i),b.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(w))},_=()=>{n=!0,r=!0,i.isProcessing||t(w)};return{schedule:uS.reduce((T,P)=>{const R=s[P];return T[P]=(D,I=!1,k=!1)=>(n||_(),R.schedule(D,I,k)),T},{}),cancel:T=>{for(let P=0;P<uS.length;P++)s[uS[P]].cancel(T)},state:i,steps:s}}const{schedule:wr,cancel:Td,state:da,steps:bC}=KV(typeof requestAnimationFrame<"u"?requestAnimationFrame:Go,!0);let OA;function lee(){OA=void 0}const rs={now:()=>(OA===void 0&&rs.set(da.isProcessing||tf.useManualTiming?da.timestamp:performance.now()),OA),set:t=>{OA=t,queueMicrotask(lee)}},YV=t=>e=>typeof e=="string"&&e.startsWith(t),JV=YV("--"),cee=YV("var(--"),zB=t=>cee(t)?uee.test(t.split("/*")[0].trim()):!1,uee=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function U2(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Vv={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Vx={...Vv,transform:t=>jc(0,1,t)},fS={...Vv,default:1},Sx=t=>Math.round(t*1e5)/1e5,GB=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function fee(t){return t==null}const dee=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,HB=(t,e)=>n=>!!(typeof n=="string"&&dee.test(n)&&n.startsWith(t)||e&&!fee(n)&&Object.prototype.hasOwnProperty.call(n,e)),ZV=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,a,s,o]=r.match(GB);return{[t]:parseFloat(i),[e]:parseFloat(a),[n]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},hee=t=>jc(0,255,t),_C={...Vv,transform:t=>Math.round(hee(t))},tp={test:HB("rgb","red"),parse:ZV("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+_C.transform(t)+", "+_C.transform(e)+", "+_C.transform(n)+", "+Sx(Vx.transform(r))+")"};function pee(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const iN={test:HB("#"),parse:pee,transform:tp.transform},Kb=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),dd=Kb("deg"),Bc=Kb("%"),Lt=Kb("px"),mee=Kb("vh"),gee=Kb("vw"),j2={...Bc,parse:t=>Bc.parse(t)/100,transform:t=>Bc.transform(t*100)},Bg={test:HB("hsl","hue"),parse:ZV("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Bc.transform(Sx(e))+", "+Bc.transform(Sx(n))+", "+Sx(Vx.transform(r))+")"},Ci={test:t=>tp.test(t)||iN.test(t)||Bg.test(t),parse:t=>tp.test(t)?tp.parse(t):Bg.test(t)?Bg.parse(t):iN.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?tp.transform(t):Bg.transform(t),getAnimatableNone:t=>{const e=Ci.parse(t);return e.alpha=0,Ci.transform(e)}},vee=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function yee(t){return isNaN(t)&&typeof t=="string"&&(t.match(GB)?.length||0)+(t.match(vee)?.length||0)>0}const QV="number",e7="color",xee="var",bee="var(",z2="${}",_ee=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Wx(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=e.replace(_ee,c=>(Ci.test(c)?(r.color.push(a),i.push(e7),n.push(Ci.parse(c))):c.startsWith(bee)?(r.var.push(a),i.push(xee),n.push(c)):(r.number.push(a),i.push(QV),n.push(parseFloat(c))),++a,z2)).split(z2);return{values:n,split:o,indexes:r,types:i}}function t7(t){return Wx(t).values}function n7(t){const{split:e,types:n}=Wx(t),r=e.length;return i=>{let a="";for(let s=0;s<r;s++)if(a+=e[s],i[s]!==void 0){const o=n[s];o===QV?a+=Sx(i[s]):o===e7?a+=Ci.transform(i[s]):a+=i[s]}return a}}const See=t=>typeof t=="number"?0:Ci.test(t)?Ci.getAnimatableNone(t):t;function Aee(t){const e=t7(t);return n7(t)(e.map(See))}const kl={test:yee,parse:t7,createTransformer:n7,getAnimatableNone:Aee};function SC(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function wee({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,a=0,s=0;if(!e)i=a=s=n;else{const o=n<.5?n*(1+e):n+e-n*e,c=2*n-o;i=SC(c,o,t+1/3),a=SC(c,o,t),s=SC(c,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:r}}function qA(t,e){return n=>n>0?e:t}const Kr=(t,e,n)=>t+(e-t)*n,AC=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},Mee=[iN,tp,Bg],Eee=t=>Mee.find(e=>e.test(t));function G2(t){const e=Eee(t);if(!e)return!1;let n=e.parse(t);return e===Bg&&(n=wee(n)),n}const H2=(t,e)=>{const n=G2(t),r=G2(e);if(!n||!r)return qA(t,e);const i={...n};return a=>(i.red=AC(n.red,r.red,a),i.green=AC(n.green,r.green,a),i.blue=AC(n.blue,r.blue,a),i.alpha=Kr(n.alpha,r.alpha,a),tp.transform(i))},aN=new Set(["none","hidden"]);function Tee(t,e){return aN.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Cee(t,e){return n=>Kr(t,e,n)}function VB(t){return typeof t=="number"?Cee:typeof t=="string"?zB(t)?qA:Ci.test(t)?H2:Pee:Array.isArray(t)?r7:typeof t=="object"?Ci.test(t)?H2:Ree:qA}function r7(t,e){const n=[...t],r=n.length,i=t.map((a,s)=>VB(a)(a,e[s]));return a=>{for(let s=0;s<r;s++)n[s]=i[s](a);return n}}function Ree(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=VB(t[i])(t[i],e[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function Oee(t,e){const n=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const a=e.types[i],s=t.indexes[a][r[a]],o=t.values[s]??0;n[i]=o,r[a]++}return n}const Pee=(t,e)=>{const n=kl.createTransformer(e),r=Wx(t),i=Wx(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?aN.has(t)&&!i.values.length||aN.has(e)&&!r.values.length?Tee(t,e):$b(r7(Oee(r,i),i.values),n):qA(t,e)};function i7(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Kr(t,e,n):VB(t)(t,e)}const Dee=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>wr.update(e,n),stop:()=>Td(e),now:()=>da.isProcessing?da.timestamp:rs.now()}},a7=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let a=0;a<i;a++)r+=Math.round(t(a/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},$A=2e4;function WB(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<$A;)e+=n,r=t.next(e);return e>=$A?1/0:e}function Nee(t,e=100,n){const r=n({...t,keyframes:[0,e]}),i=Math.min(WB(r),$A);return{type:"keyframes",ease:a=>r.next(i*a).value/e,duration:Uo(i)}}const Iee=5;function s7(t,e,n){const r=Math.max(e-Iee,0);return FV(n-t(r),e-r)}const ii={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},wC=.001;function Bee({duration:t=ii.duration,bounce:e=ii.bounce,velocity:n=ii.velocity,mass:r=ii.mass}){let i,a,s=1-e;s=jc(ii.minDamping,ii.maxDamping,s),t=jc(ii.minDuration,ii.maxDuration,Uo(t)),s<1?(i=u=>{const h=u*s,p=h*t,v=h-n,y=sN(u,s),b=Math.exp(-p);return wC-v/y*b},a=u=>{const p=u*s*t,v=p*n+n,y=Math.pow(s,2)*Math.pow(u,2)*t,b=Math.exp(-p),w=sN(Math.pow(u,2),s);return(-i(u)+wC>0?-1:1)*((v-y)*b)/w}):(i=u=>{const h=Math.exp(-u*t),p=(u-n)*t+1;return-wC+h*p},a=u=>{const h=Math.exp(-u*t),p=(n-u)*(t*t);return h*p});const o=5/t,c=kee(i,a,o);if(t=Ll(t),isNaN(c))return{stiffness:ii.stiffness,damping:ii.damping,duration:t};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:t}}}const Lee=12;function kee(t,e,n){let r=n;for(let i=1;i<Lee;i++)r=r-t(r)/e(r);return r}function sN(t,e){return t*Math.sqrt(1-e*e)}const Fee=["duration","bounce"],Uee=["stiffness","damping","mass"];function V2(t,e){return e.some(n=>t[n]!==void 0)}function jee(t){let e={velocity:ii.velocity,stiffness:ii.stiffness,damping:ii.damping,mass:ii.mass,isResolvedFromDuration:!1,...t};if(!V2(t,Uee)&&V2(t,Fee))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*jc(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:ii.mass,stiffness:i,damping:a}}else{const n=Bee(t);e={...e,...n,mass:ii.mass},e.isResolvedFromDuration=!0}return e}function XA(t=ii.visualDuration,e=ii.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:a},{stiffness:c,damping:u,mass:h,duration:p,velocity:v,isResolvedFromDuration:y}=jee({...n,velocity:-Uo(n.velocity||0)}),b=v||0,w=u/(2*Math.sqrt(c*h)),_=s-a,S=Uo(Math.sqrt(c/h)),E=Math.abs(_)<5;r||(r=E?ii.restSpeed.granular:ii.restSpeed.default),i||(i=E?ii.restDelta.granular:ii.restDelta.default);let T;if(w<1){const R=sN(S,w);T=D=>{const I=Math.exp(-w*S*D);return s-I*((b+w*S*_)/R*Math.sin(R*D)+_*Math.cos(R*D))}}else if(w===1)T=R=>s-Math.exp(-S*R)*(_+(b+S*_)*R);else{const R=S*Math.sqrt(w*w-1);T=D=>{const I=Math.exp(-w*S*D),k=Math.min(R*D,300);return s-I*((b+w*S*_)*Math.sinh(k)+R*_*Math.cosh(k))/R}}const P={calculatedDuration:y&&p||null,next:R=>{const D=T(R);if(y)o.done=R>=p;else{let I=R===0?b:0;w<1&&(I=R===0?Ll(b):s7(T,R,D));const k=Math.abs(I)<=r,B=Math.abs(s-D)<=i;o.done=k&&B}return o.value=o.done?s:D,o},toString:()=>{const R=Math.min(WB(P),$A),D=a7(I=>P.next(R*I).value,R,30);return R+"ms "+D},toTransition:()=>{}};return P}XA.applyToOptions=t=>{const e=Nee(t,100,XA);return t.ease=e.ease,t.duration=Ll(e.duration),t.type="keyframes",t};function oN({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:c,restDelta:u=.5,restSpeed:h}){const p=t[0],v={done:!1,value:p},y=k=>o!==void 0&&k<o||c!==void 0&&k>c,b=k=>o===void 0?c:c===void 0||Math.abs(o-k)<Math.abs(c-k)?o:c;let w=n*e;const _=p+w,S=s===void 0?_:s(_);S!==_&&(w=S-p);const E=k=>-w*Math.exp(-k/r),T=k=>S+E(k),P=k=>{const B=E(k),U=T(k);v.done=Math.abs(B)<=u,v.value=v.done?S:U};let R,D;const I=k=>{y(v.value)&&(R=k,D=XA({keyframes:[v.value,b(v.value)],velocity:s7(T,k,v.value),damping:i,stiffness:a,restDelta:u,restSpeed:h}))};return I(0),{calculatedDuration:null,next:k=>{let B=!1;return!D&&R===void 0&&(B=!0,P(k),I(k)),R!==void 0&&k>=R?D.next(k-R):(!B&&P(k),v)}}}function zee(t,e,n){const r=[],i=n||tf.mix||i7,a=t.length-1;for(let s=0;s<a;s++){let o=i(t[s],t[s+1]);if(e){const c=Array.isArray(e)?e[s]||Go:e;o=$b(c,o)}r.push(o)}return r}function Gee(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const a=t.length;if(kB(a===e.length),a===1)return()=>e[0];if(a===2&&e[0]===e[1])return()=>e[1];const s=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=zee(e,r,i),c=o.length,u=h=>{if(s&&h<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const v=Hx(t[p],t[p+1],h);return o[p](v)};return n?h=>u(jc(t[0],t[a-1],h)):u}function Hee(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Hx(0,e,r);t.push(Kr(n,1,i))}}function Vee(t){const e=[0];return Hee(e,t.length-1),e}function Wee(t,e){return t.map(n=>n*e)}function qee(t,e){return t.map(()=>e||$V).splice(0,t.length-1)}function Ax({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=ree(r)?r.map(F2):F2(r),a={done:!1,value:e[0]},s=Wee(n&&n.length===e.length?n:Vee(e),t),o=Gee(s,e,{ease:Array.isArray(i)?i:qee(e,i)});return{calculatedDuration:t,next:c=>(a.value=o(c),a.done=c>=t,a)}}const $ee=t=>t!==null;function qB(t,{repeat:e,repeatType:n="loop"},r,i=1){const a=t.filter($ee),o=i<0||e&&n!=="loop"&&e%2===1?0:a.length-1;return!o||r===void 0?a[o]:r}const Xee={decay:oN,inertia:oN,tween:Ax,keyframes:Ax,spring:XA};function o7(t){typeof t.type=="string"&&(t.type=Xee[t.type])}class $B{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Kee=t=>t/100;class XB extends $B{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==rs.now()&&this.tick(rs.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;o7(e);const{type:n=Ax,repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:s=0}=e;let{keyframes:o}=e;const c=n||Ax;c!==Ax&&typeof o[0]!="number"&&(this.mixKeyframes=$b(Kee,i7(o[0],o[1])),o=[0,100]);const u=c({...e,keyframes:o});a==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...o].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=WB(u));const{calculatedDuration:h}=u;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:i,mixKeyframes:a,mirroredGenerator:s,resolvedDuration:o,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:h,repeat:p,repeatType:v,repeatDelay:y,type:b,onUpdate:w,finalKeyframe:_}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const S=this.currentTime-u*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?S<0:S>i;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let T=this.currentTime,P=r;if(p){const k=Math.min(this.currentTime,i)/o;let B=Math.floor(k),U=k%1;!U&&k>=1&&(U=1),U===1&&B--,B=Math.min(B,p+1),B%2&&(v==="reverse"?(U=1-U,y&&(U-=y/o)):v==="mirror"&&(P=s)),T=jc(0,1,U)*o}const R=E?{done:!1,value:h[0]}:P.next(T);a&&(R.value=a(R.value));let{done:D}=R;!E&&c!==null&&(D=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return I&&b!==oN&&(R.value=qB(h,this.options,_,this.speed)),w&&w(R.value),I&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return Uo(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Uo(e)}get time(){return Uo(this.currentTime)}set time(e){e=Ll(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(rs.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Uo(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Dee,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(rs.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Yee(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const np=t=>t*180/Math.PI,lN=t=>{const e=np(Math.atan2(t[1],t[0]));return cN(e)},Jee={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:lN,rotateZ:lN,skewX:t=>np(Math.atan(t[1])),skewY:t=>np(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},cN=t=>(t=t%360,t<0&&(t+=360),t),W2=lN,q2=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),$2=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Zee={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:q2,scaleY:$2,scale:t=>(q2(t)+$2(t))/2,rotateX:t=>cN(np(Math.atan2(t[6],t[5]))),rotateY:t=>cN(np(Math.atan2(-t[2],t[0]))),rotateZ:W2,rotate:W2,skewX:t=>np(Math.atan(t[4])),skewY:t=>np(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function uN(t){return t.includes("scale")?1:0}function fN(t,e){if(!t||t==="none")return uN(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=Zee,i=n;else{const o=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Jee,i=o}if(!i)return uN(e);const a=r[e],s=i[1].split(",").map(ete);return typeof a=="function"?a(s):s[a]}const Qee=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return fN(n,e)};function ete(t){return parseFloat(t.trim())}const Wv=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],qv=new Set(Wv),X2=t=>t===Vv||t===Lt,tte=new Set(["x","y","z"]),nte=Wv.filter(t=>!tte.has(t));function rte(t){const e=[];return nte.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const xd={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>fN(e,"x"),y:(t,{transform:e})=>fN(e,"y")};xd.translateX=xd.x;xd.translateY=xd.y;const gp=new Set;let dN=!1,hN=!1,pN=!1;function l7(){if(hN){const t=Array.from(gp).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=rte(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,s])=>{r.getValue(a)?.set(s)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}hN=!1,dN=!1,gp.forEach(t=>t.complete(pN)),gp.clear()}function c7(){gp.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(hN=!0)})}function ite(){pN=!0,c7(),l7(),pN=!1}class KB{constructor(e,n,r,i,a,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(gp.add(this),dN||(dN=!0,wr.read(c7),wr.resolveKeyframes(l7))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;if(e[0]===null){const a=i?.get(),s=e[e.length-1];if(a!==void 0)e[0]=a;else if(r&&n){const o=r.readValue(n,s);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=s),i&&a===void 0&&i.set(e[0])}Yee(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),gp.delete(this)}cancel(){this.state==="scheduled"&&(gp.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ate=t=>t.startsWith("--");function ste(t,e,n){ate(e)?t.style.setProperty(e,n):t.style[e]=n}const ote={};function u7(t,e){const n=kV(t);return()=>ote[e]??n()}const lte=u7(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),f7=u7(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),px=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,K2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:px([0,.65,.55,1]),circOut:px([.55,0,1,.45]),backIn:px([.31,.01,.66,-.59]),backOut:px([.33,1.53,.69,.99])};function d7(t,e){if(t)return typeof t=="function"?f7()?a7(t,e):"ease-out":XV(t)?px(t):Array.isArray(t)?t.map(n=>d7(n,e)||K2.easeOut):K2[t]}function cte(t,e,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeOut",times:c}={},u=void 0){const h={[e]:n};c&&(h.offset=c);const p=d7(o,i);Array.isArray(p)&&(h.easing=p);const v={delay:r,duration:i,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"};return u&&(v.pseudoElement=u),t.animate(h,v)}function h7(t){return typeof t=="function"&&"applyToOptions"in t}function ute({type:t,...e}){return h7(t)&&f7()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class p7 extends $B{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:i,pseudoElement:a,allowFlatten:s=!1,finalKeyframe:o,onComplete:c}=e;this.isPseudoElement=!!a,this.allowFlatten=s,this.options=e,kB(typeof e.type!="string");const u=ute(e);this.animation=cte(n,r,i,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const h=qB(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(h):ste(n,r,h),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Uo(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Uo(e)}get time(){return Uo(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ll(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&lte()?(this.animation.timeline=e,Go):n(this)}}const m7={anticipate:VV,backInOut:HV,circInOut:qV};function fte(t){return t in m7}function dte(t){typeof t.ease=="string"&&fte(t.ease)&&(t.ease=m7[t.ease])}const MC=10;class hte extends p7{constructor(e){dte(e),o7(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:i,element:a,...s}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const o=new XB({...s,autoplay:!1}),c=Math.max(MC,rs.now()-this.startTime),u=jc(0,MC,c-MC);n.setWithVelocity(o.sample(Math.max(0,c-u)).value,o.sample(c).value,u),o.stop()}}const Y2=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(kl.test(t)||t==="0")&&!t.startsWith("url("));function pte(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function mte(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const a=t[t.length-1],s=Y2(i,e),o=Y2(a,e);return!s||!o?!1:pte(t)||(n==="spring"||h7(n))&&r}function mN(t){t.duration=0,t.type="keyframes"}const gte=new Set(["opacity","clipPath","filter","transform"]),vte=kV(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function yte(t){const{motionValue:e,name:n,repeatDelay:r,repeatType:i,damping:a,type:s}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return vte()&&n&&gte.has(n)&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&a!==0&&s!=="inertia"}const xte=40;class bte extends $B{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",keyframes:o,name:c,motionValue:u,element:h,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=rs.now();const v={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:s,name:c,motionValue:u,element:h,...p},y=h?.KeyframeResolver||KB;this.keyframeResolver=new y(o,(b,w,_)=>this.onKeyframesResolved(b,w,v,!_),c,u,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,r,i){this.keyframeResolver=void 0;const{name:a,type:s,velocity:o,delay:c,isHandoff:u,onUpdate:h}=r;this.resolvedAt=rs.now(),mte(e,a,s,o)||((tf.instantAnimations||!c)&&h?.(qB(e,r,n)),e[0]=e[e.length-1],mN(r),r.repeat=0);const v={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>xte?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},y=!u&&yte(v),b=v.motionValue?.owner?.current,w=y?new hte({...v,element:b}):new XB(v);w.finished.then(()=>{this.notifyFinished()}).catch(Go),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ite()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function g7(t,e,n,r=0,i=1){const a=Array.from(t).sort((u,h)=>u.sortNodePosition(h)).indexOf(e),s=t.size,o=(s-1)*r;return typeof n=="function"?n(a,s):i===1?a*r:o-a*r}const _te=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ste(t){const e=_te.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function v7(t,e,n=1){const[r,i]=Ste(t);if(!r)return;const a=window.getComputedStyle(e).getPropertyValue(r);if(a){const s=a.trim();return IV(s)?parseFloat(s):s}return zB(i)?v7(i,e,n+1):i}const Ate={type:"spring",stiffness:500,damping:25,restSpeed:10},wte=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Mte={type:"keyframes",duration:.8},Ete={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Tte=(t,{keyframes:e})=>e.length>2?Mte:qv.has(t)?t.startsWith("scale")?wte(e[1]):Ate:Ete,Cte=t=>t!==null;function Rte(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(Cte),a=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[a]}function y7(t,e){if(t?.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function YB(t,e){const n=t?.[e]??t?.default??t;return n!==t?y7(n,t):n}function Ote({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:c,elapsed:u,...h}){return!!Object.keys(h).length}const JB=(t,e,n,r={},i,a)=>s=>{const o=YB(r,t)||{},c=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Ll(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:v=>{e.set(v),o.onUpdate&&o.onUpdate(v)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:a?void 0:i};Ote(o)||Object.assign(h,Tte(t,h)),h.duration&&(h.duration=Ll(h.duration)),h.repeatDelay&&(h.repeatDelay=Ll(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(mN(h),h.delay===0&&(p=!0)),(tf.instantAnimations||tf.skipAnimations||i?.shouldSkipAnimations)&&(p=!0,mN(h),h.delay=0),h.allowFlatten=!o.type&&!o.ease,p&&!a&&e.get()!==void 0){const v=Rte(h.keyframes,o);if(v!==void 0){wr.update(()=>{h.onUpdate(v),h.onComplete()});return}}return o.isSync?new XB(h):new bte(h)};function J2(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function ZB(t,e,n,r){if(typeof e=="function"){const[i,a]=J2(r);e=e(n!==void 0?n:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=J2(r);e=e(n!==void 0?n:t.custom,i,a)}return e}function Vg(t,e,n){const r=t.getProps();return ZB(r,e,n!==void 0?n:r.custom,t)}const x7=new Set(["width","height","top","left","right","bottom",...Wv]),Z2=30,Pte=t=>!isNaN(parseFloat(t));class Dte{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const i=rs.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=rs.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Pte(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new FB);const r=this.events[e].add(n);return e==="change"?()=>{r(),wr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=rs.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Z2)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Z2);return FV(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function nv(t,e){return new Dte(t,e)}const gN=t=>Array.isArray(t);function Nte(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,nv(n))}function Ite(t){return gN(t)?t[t.length-1]||0:t}function Bte(t,e){const n=Vg(t,e);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const s in a){const o=Ite(a[s]);Nte(t,s,o)}}const Ia=t=>!!(t&&t.getVelocity);function Lte(t){return!!(Ia(t)&&t.add)}function vN(t,e){const n=t.getValue("willChange");if(Lte(n))return n.add(e);if(!n&&tf.WillChange){const r=new tf.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function QB(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const kte="framerAppearId",b7="data-"+QB(kte);function _7(t){return t.props[b7]}function Fte({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function S7(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:s,...o}=e;const c=t.getDefaultTransition();a=a?y7(a,c):c;const u=a?.reduceMotion;r&&(a=r);const h=[],p=i&&t.animationState&&t.animationState.getState()[i];for(const v in o){const y=t.getValue(v,t.latestValues[v]??null),b=o[v];if(b===void 0||p&&Fte(p,v))continue;const w={delay:n,...YB(a||{},v)},_=y.get();if(_!==void 0&&!y.isAnimating&&!Array.isArray(b)&&b===_&&!w.velocity)continue;let S=!1;if(window.MotionHandoffAnimation){const P=_7(t);if(P){const R=window.MotionHandoffAnimation(P,v,wr);R!==null&&(w.startTime=R,S=!0)}}vN(t,v);const E=u??t.shouldReduceMotion;y.start(JB(v,y,b,E&&x7.has(v)?{type:!1}:w,t,S));const T=y.animation;T&&h.push(T)}if(s){const v=()=>wr.update(()=>{s&&Bte(t,s)});h.length?Promise.all(h).then(v):v()}return h}function yN(t,e,n={}){const r=Vg(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const a=r?()=>Promise.all(S7(t,r,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:p}=i;return Ute(t,e,c,u,h,p,n)}:()=>Promise.resolve(),{when:o}=i;if(o){const[c,u]=o==="beforeChildren"?[a,s]:[s,a];return c().then(()=>u())}else return Promise.all([a(),s(n.delay)])}function Ute(t,e,n=0,r=0,i=0,a=1,s){const o=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),o.push(yN(c,e,{...s,delay:n+(typeof r=="function"?0:r)+g7(t.variantChildren,c,r,i,a)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(o)}function jte(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(a=>yN(t,a,n));r=Promise.all(i)}else if(typeof e=="string")r=yN(t,e,n);else{const i=typeof e=="function"?Vg(t,e,n.custom):e;r=Promise.all(S7(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const zte={test:t=>t==="auto",parse:t=>t},A7=t=>e=>e.test(t),w7=[Vv,Lt,Bc,dd,gee,mee,zte],Q2=t=>w7.find(A7(t));function Gte(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||LV(t):!0}const Hte=new Set(["brightness","contrast","saturate","opacity"]);function Vte(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(GB)||[];if(!r)return t;const i=n.replace(r,"");let a=Hte.has(e)?1:0;return r!==n&&(a*=100),e+"("+a+i+")"}const Wte=/\b([a-z-]*)\(.*?\)/gu,xN={...kl,getAnimatableNone:t=>{const e=t.match(Wte);return e?e.map(Vte).join(" "):t}},bN={...kl,getAnimatableNone:t=>{const e=kl.parse(t);return kl.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},eF={...Vv,transform:Math.round},qte={rotate:dd,rotateX:dd,rotateY:dd,rotateZ:dd,scale:fS,scaleX:fS,scaleY:fS,scaleZ:fS,skew:dd,skewX:dd,skewY:dd,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Vx,originX:j2,originY:j2,originZ:Lt},eL={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,inset:Lt,insetBlock:Lt,insetBlockStart:Lt,insetBlockEnd:Lt,insetInline:Lt,insetInlineStart:Lt,insetInlineEnd:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,paddingBlock:Lt,paddingBlockStart:Lt,paddingBlockEnd:Lt,paddingInline:Lt,paddingInlineStart:Lt,paddingInlineEnd:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,marginBlock:Lt,marginBlockStart:Lt,marginBlockEnd:Lt,marginInline:Lt,marginInlineStart:Lt,marginInlineEnd:Lt,fontSize:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt,...qte,zIndex:eF,fillOpacity:Vx,strokeOpacity:Vx,numOctaves:eF},$te={...eL,color:Ci,backgroundColor:Ci,outlineColor:Ci,fill:Ci,stroke:Ci,borderColor:Ci,borderTopColor:Ci,borderRightColor:Ci,borderBottomColor:Ci,borderLeftColor:Ci,filter:xN,WebkitFilter:xN,mask:bN,WebkitMask:bN},M7=t=>$te[t],Xte=new Set([xN,bN]);function E7(t,e){let n=M7(t);return Xte.has(n)||(n=kl),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Kte=new Set(["auto","none","0"]);function Yte(t,e,n){let r=0,i;for(;r<t.length&&!i;){const a=t[r];typeof a=="string"&&!Kte.has(a)&&Wx(a).values.length&&(i=t[r]),r++}if(i&&n)for(const a of e)t[a]=E7(n,i)}class Jte extends KB{constructor(e,n,r,i,a){super(e,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),zB(p))){const v=v7(p,n.current);v!==void 0&&(e[h]=v),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!x7.has(r)||e.length!==2)return;const[i,a]=e,s=Q2(i),o=Q2(a),c=U2(i),u=U2(a);if(c!==u&&xd[r]){this.needsMeasurement=!0;return}if(s!==o)if(X2(s)&&X2(o))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else xd[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||Gte(e[i]))&&r.push(i);r.length&&Yte(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xd[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=r.length-1,s=r[a];r[a]=xd[n](e.measureViewportBox(),window.getComputedStyle(e.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([o,c])=>{e.getValue(o).set(c)}),this.resolveNoneKeyframes()}}const Zte=new Set(["opacity","clipPath","filter","transform"]);function T7(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const i=n?.[t]??r.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(r=>r!=null)}const C7=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function _N(t){return BV(t)&&"offsetHeight"in t}const{schedule:tL}=KV(queueMicrotask,!1),Tl={x:!1,y:!1};function R7(){return Tl.x||Tl.y}function Qte(t){return t==="x"||t==="y"?Tl[t]?null:(Tl[t]=!0,()=>{Tl[t]=!1}):Tl.x||Tl.y?null:(Tl.x=Tl.y=!0,()=>{Tl.x=Tl.y=!1})}function O7(t,e){const n=T7(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function ene(t){return!(t.pointerType==="touch"||R7())}function tne(t,e,n={}){const[r,i,a]=O7(t,n);return r.forEach(s=>{let o=!1,c=!1,u;const h=()=>{s.removeEventListener("pointerleave",b)},p=_=>{u&&(u(_),u=void 0),h()},v=_=>{o=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),c&&(c=!1,p(_))},y=()=>{o=!0,window.addEventListener("pointerup",v,i),window.addEventListener("pointercancel",v,i)},b=_=>{if(_.pointerType!=="touch"){if(o){c=!0;return}p(_)}},w=_=>{if(!ene(_))return;c=!1;const S=e(s,_);typeof S=="function"&&(u=S,s.addEventListener("pointerleave",b,i))};s.addEventListener("pointerenter",w,i),s.addEventListener("pointerdown",y,i)}),a}const P7=(t,e)=>e?t===e?!0:P7(t,e.parentElement):!1,nL=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,nne=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function rne(t){return nne.has(t.tagName)||t.isContentEditable===!0}const ine=new Set(["INPUT","SELECT","TEXTAREA"]);function ane(t){return ine.has(t.tagName)||t.isContentEditable===!0}const PA=new WeakSet;function tF(t){return e=>{e.key==="Enter"&&t(e)}}function EC(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const sne=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=tF(()=>{if(PA.has(n))return;EC(n,"down");const i=tF(()=>{EC(n,"up")}),a=()=>EC(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",a,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function nF(t){return nL(t)&&!R7()}const rF=new WeakSet;function one(t,e,n={}){const[r,i,a]=O7(t,n),s=o=>{const c=o.currentTarget;if(!nF(o)||rF.has(o))return;PA.add(c),n.stopPropagation&&rF.add(o);const u=e(c,o),h=(y,b)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",v),PA.has(c)&&PA.delete(c),nF(y)&&typeof u=="function"&&u(y,{success:b})},p=y=>{h(y,c===window||c===document||n.useGlobalTarget||P7(c,y.target))},v=y=>{h(y,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",v,i)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",s,i),_N(o)&&(o.addEventListener("focus",u=>sne(u,i)),!rne(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),a}function rL(t){return BV(t)&&"ownerSVGElement"in t}const DA=new WeakMap;let NA;const D7=(t,e,n)=>(r,i)=>i&&i[0]?i[0][t+"Size"]:rL(r)&&"getBBox"in r?r.getBBox()[e]:r[n],lne=D7("inline","width","offsetWidth"),cne=D7("block","height","offsetHeight");function une({target:t,borderBoxSize:e}){DA.get(t)?.forEach(n=>{n(t,{get width(){return lne(t,e)},get height(){return cne(t,e)}})})}function fne(t){t.forEach(une)}function dne(){typeof ResizeObserver>"u"||(NA=new ResizeObserver(fne))}function hne(t,e){NA||dne();const n=T7(t);return n.forEach(r=>{let i=DA.get(r);i||(i=new Set,DA.set(r,i)),i.add(e),NA?.observe(r)}),()=>{n.forEach(r=>{const i=DA.get(r);i?.delete(e),i?.size||NA?.unobserve(r)})}}const IA=new Set;let Lg;function pne(){Lg=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};IA.forEach(e=>e(t))},window.addEventListener("resize",Lg)}function mne(t){return IA.add(t),Lg||pne(),()=>{IA.delete(t),!IA.size&&typeof Lg=="function"&&(window.removeEventListener("resize",Lg),Lg=void 0)}}function iF(t,e){return typeof t=="function"?mne(t):hne(t,e)}function gne(t){return rL(t)&&t.tagName==="svg"}const vne=[...w7,Ci,kl],yne=t=>vne.find(A7(t)),aF=()=>({translate:0,scale:1,origin:0,originPoint:0}),kg=()=>({x:aF(),y:aF()}),sF=()=>({min:0,max:0}),Ui=()=>({x:sF(),y:sF()}),xne=new WeakMap;function oE(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function qx(t){return typeof t=="string"||Array.isArray(t)}const iL=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],aL=["initial",...iL];function lE(t){return oE(t.animate)||aL.some(e=>qx(t[e]))}function N7(t){return!!(lE(t)||t.variants)}function bne(t,e,n){for(const r in e){const i=e[r],a=n[r];if(Ia(i))t.addValue(r,i);else if(Ia(a))t.addValue(r,nv(i,{owner:t}));else if(a!==i)if(t.hasValue(r)){const s=t.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=t.getStaticValue(r);t.addValue(r,nv(s!==void 0?s:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const SN={current:null},I7={current:!1},_ne=typeof window<"u";function Sne(){if(I7.current=!0,!!_ne)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>SN.current=t.matches;t.addEventListener("change",e),e()}else SN.current=!1}const oF=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let KA={};function B7(t){KA=t}function Ane(){return KA}class wne{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:s,visualState:o},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=KB,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=rs.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,wr.render(this.render,!1,!0))};const{latestValues:u,renderState:h}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=c,this.blockInitialAnimation=!!s,this.isControllingVariants=lE(n),this.isVariantNode=N7(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in v){const b=v[y];u[y]!==void 0&&Ia(b)&&b.set(u[y])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,xne.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(I7.current||Sne(),this.shouldReduceMotion=SN.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Td(this.notifyUpdate),Td(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Zte.has(e)&&this.current instanceof HTMLElement){const{factory:s,keyframes:o,times:c,ease:u,duration:h}=n.accelerate,p=new p7({element:this.current,name:e,keyframes:o,times:c,ease:u,duration:Ll(h)}),v=s(p);this.valueSubscriptions.set(e,()=>{v(),p.cancel()});return}const r=qv.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&wr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in KA){const n=KA[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ui()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<oF.length;r++){const i=oF[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,s=e[a];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=bne(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=nv(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(IV(r)||LV(r))?r=parseFloat(r):!yne(r)&&kl.test(n)&&(r=E7(e,n)),this.setBaseTarget(e,Ia(r)?r.get():r)),Ia(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=ZB(this.props,n,this.presenceContext?.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Ia(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new FB),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){tL.render(this.render)}}class L7 extends wne{constructor(){super(...arguments),this.KeyframeResolver=Jte}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ia(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Bd{constructor(e){this.isMounted=!1,this.node=e}update(){}}function k7({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Mne({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Ene(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function TC(t){return t===void 0||t===1}function AN({scale:t,scaleX:e,scaleY:n}){return!TC(t)||!TC(e)||!TC(n)}function Kh(t){return AN(t)||F7(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function F7(t){return lF(t.x)||lF(t.y)}function lF(t){return t&&t!=="0%"}function YA(t,e,n){const r=t-n,i=e*r;return n+i}function cF(t,e,n,r,i){return i!==void 0&&(t=YA(t,i,r)),YA(t,n,r)+e}function wN(t,e=0,n=1,r,i){t.min=cF(t.min,e,n,r,i),t.max=cF(t.max,e,n,r,i)}function U7(t,{x:e,y:n}){wN(t.x,e.translate,e.scale,e.originPoint),wN(t.y,n.translate,n.scale,n.originPoint)}const uF=.999999999999,fF=1.0000000000001;function Tne(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let a,s;for(let o=0;o<i;o++){a=n[o],s=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ug(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,U7(t,s)),r&&Kh(a.latestValues)&&Ug(t,a.latestValues))}e.x<fF&&e.x>uF&&(e.x=1),e.y<fF&&e.y>uF&&(e.y=1)}function Fg(t,e){t.min=t.min+e,t.max=t.max+e}function dF(t,e,n,r,i=.5){const a=Kr(t.min,t.max,i);wN(t,e,n,a,r)}function Ug(t,e){dF(t.x,e.x,e.scaleX,e.scale,e.originX),dF(t.y,e.y,e.scaleY,e.scale,e.originY)}function j7(t,e){return k7(Ene(t.getBoundingClientRect(),e))}function Cne(t,e,n){const r=j7(t,n),{scroll:i}=e;return i&&(Fg(r.x,i.offset.x),Fg(r.y,i.offset.y)),r}const Rne={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},One=Wv.length;function Pne(t,e,n){let r="",i=!0;for(let a=0;a<One;a++){const s=Wv[a],o=t[s];if(o===void 0)continue;let c=!0;if(typeof o=="number")c=o===(s.startsWith("scale")?1:0);else{const u=parseFloat(o);c=s.startsWith("scale")?u===1:u===0}if(!c||n){const u=C7(o,eL[s]);if(!c){i=!1;const h=Rne[s]||s;r+=`${h}(${u}) `}n&&(e[s]=u)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function sL(t,e,n){const{style:r,vars:i,transformOrigin:a}=t;let s=!1,o=!1;for(const c in e){const u=e[c];if(qv.has(c)){s=!0;continue}else if(JV(c)){i[c]=u;continue}else{const h=C7(u,eL[c]);c.startsWith("origin")?(o=!0,a[c]=h):r[c]=h}}if(e.transform||(s||n?r.transform=Pne(e,t.transform,n):r.transform&&(r.transform="none")),o){const{originX:c="50%",originY:u="50%",originZ:h=0}=a;r.transformOrigin=`${c} ${u} ${h}`}}function z7(t,{style:e,vars:n},r,i){const a=t.style;let s;for(s in e)a[s]=e[s];i?.applyProjectionStyles(a,r);for(s in n)a.setProperty(s,n[s])}function hF(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const G0={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Lt.test(t))t=parseFloat(t);else return t;const n=hF(t,e.target.x),r=hF(t,e.target.y);return`${n}% ${r}%`}},Dne={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=kl.parse(t);if(i.length>5)return r;const a=kl.createTransformer(t),s=typeof i[0]!="number"?1:0,o=n.x.scale*e.x,c=n.y.scale*e.y;i[0+s]/=o,i[1+s]/=c;const u=Kr(o,c,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),a(i)}},MN={borderRadius:{...G0,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:G0,borderTopRightRadius:G0,borderBottomLeftRadius:G0,borderBottomRightRadius:G0,boxShadow:Dne};function G7(t,{layout:e,layoutId:n}){return qv.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!MN[t]||t==="opacity")}function oL(t,e,n){const r=t.style,i=e?.style,a={};if(!r)return a;for(const s in r)(Ia(r[s])||i&&Ia(i[s])||G7(s,t)||n?.getValue(s)?.liveStyle!==void 0)&&(a[s]=r[s]);return a}function Nne(t){return window.getComputedStyle(t)}class Ine extends L7{constructor(){super(...arguments),this.type="html",this.renderInstance=z7}readValueFromInstance(e,n){if(qv.has(n))return this.projection?.isProjecting?uN(n):Qee(e,n);{const r=Nne(e),i=(JV(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return j7(e,n)}build(e,n,r){sL(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return oL(e,n,r)}}const Bne={offset:"stroke-dashoffset",array:"stroke-dasharray"},Lne={offset:"strokeDashoffset",array:"strokeDasharray"};function kne(t,e,n=1,r=0,i=!0){t.pathLength=1;const a=i?Bne:Lne;t[a.offset]=`${-r}`,t[a.array]=`${e} ${n}`}const Fne=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function H7(t,{attrX:e,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:s=0,...o},c,u,h){if(sL(t,o,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:v}=t;p.transform&&(v.transform=p.transform,delete p.transform),(v.transform||p.transformOrigin)&&(v.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),v.transform&&(v.transformBox=h?.transformBox??"fill-box",delete p.transformBox);for(const y of Fne)p[y]!==void 0&&(v[y]=p[y],delete p[y]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),i!==void 0&&kne(p,i,a,s,!1)}const V7=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),W7=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Une(t,e,n,r){z7(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(V7.has(i)?i:QB(i),e.attrs[i])}function q7(t,e,n){const r=oL(t,e,n);for(const i in t)if(Ia(t[i])||Ia(e[i])){const a=Wv.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=t[i]}return r}class jne extends L7{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ui}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(qv.has(n)){const r=M7(n);return r&&r.default||0}return n=V7.has(n)?n:QB(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return q7(e,n,r)}build(e,n,r){H7(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,i){Une(e,n,r,i)}mount(e){this.isSVGTag=W7(e.tagName),super.mount(e)}}const zne=aL.length;function $7(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?$7(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<zne;n++){const r=aL[n],i=t.props[r];(qx(i)||i===!1)&&(e[r]=i)}return e}function X7(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const Gne=[...iL].reverse(),Hne=iL.length;function Vne(t){return e=>Promise.all(e.map(({animation:n,options:r})=>jte(t,n,r)))}function Wne(t){let e=Vne(t),n=pF(),r=!0;const i=c=>(u,h)=>{const p=Vg(t,h,c==="exit"?t.presenceContext?.custom:void 0);if(p){const{transition:v,transitionEnd:y,...b}=p;u={...u,...b,...y}}return u};function a(c){e=c(t)}function s(c){const{props:u}=t,h=$7(t.parent)||{},p=[],v=new Set;let y={},b=1/0;for(let _=0;_<Hne;_++){const S=Gne[_],E=n[S],T=u[S]!==void 0?u[S]:h[S],P=qx(T),R=S===c?E.isActive:null;R===!1&&(b=_);let D=T===h[S]&&T!==u[S]&&P;if(D&&r&&t.manuallyAnimateOnMount&&(D=!1),E.protectedKeys={...y},!E.isActive&&R===null||!T&&!E.prevProp||oE(T)||typeof T=="boolean")continue;if(S==="exit"&&E.isActive&&R!==!0){E.prevResolvedValues&&(y={...y,...E.prevResolvedValues});continue}const I=qne(E.prevProp,T);let k=I||S===c&&E.isActive&&!D&&P||_>b&&P,B=!1;const U=Array.isArray(T)?T:[T];let z=U.reduce(i(S),{});R===!1&&(z={});const{prevResolvedValues:q={}}=E,W={...q,...z},ee=$=>{k=!0,v.has($)&&(B=!0,v.delete($)),E.needsAnimating[$]=!0;const Y=t.getValue($);Y&&(Y.liveStyle=!1)};for(const $ in W){const Y=z[$],ie=q[$];if(y.hasOwnProperty($))continue;let de=!1;gN(Y)&&gN(ie)?de=!X7(Y,ie):de=Y!==ie,de?Y!=null?ee($):v.add($):Y!==void 0&&v.has($)?ee($):E.protectedKeys[$]=!0}E.prevProp=T,E.prevResolvedValues=z,E.isActive&&(y={...y,...z}),r&&t.blockInitialAnimation&&(k=!1);const Q=D&&I;k&&(!Q||B)&&p.push(...U.map($=>{const Y={type:S};if(typeof $=="string"&&r&&!Q&&t.manuallyAnimateOnMount&&t.parent){const{parent:ie}=t,de=Vg(ie,$);if(ie.enteringChildren&&de){const{delayChildren:X}=de.transition||{};Y.delay=g7(ie.enteringChildren,t,X)}}return{animation:$,options:Y}}))}if(v.size){const _={};if(typeof u.initial!="boolean"){const S=Vg(t,Array.isArray(u.initial)?u.initial[0]:u.initial);S&&S.transition&&(_.transition=S.transition)}v.forEach(S=>{const E=t.getBaseTarget(S),T=t.getValue(S);T&&(T.liveStyle=!0),_[S]=E??null}),p.push({animation:_})}let w=!!p.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,w?e(p):Promise.resolve()}function o(c,u){if(n[c].isActive===u)return Promise.resolve();t.variantChildren?.forEach(p=>p.animationState?.setActive(c,u)),n[c].isActive=u;const h=s(c);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:s,setActive:o,setAnimateFunction:a,getState:()=>n,reset:()=>{n=pF()}}}function qne(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!X7(e,t):!1}function Ph(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pF(){return{animate:Ph(!0),whileInView:Ph(),whileHover:Ph(),whileTap:Ph(),whileDrag:Ph(),whileFocus:Ph(),exit:Ph()}}function mF(t,e){t.min=e.min,t.max=e.max}function Sl(t,e){mF(t.x,e.x),mF(t.y,e.y)}function gF(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const K7=1e-4,$ne=1-K7,Xne=1+K7,Y7=.01,Kne=0-Y7,Yne=0+Y7;function is(t){return t.max-t.min}function Jne(t,e,n){return Math.abs(t-e)<=n}function vF(t,e,n,r=.5){t.origin=r,t.originPoint=Kr(e.min,e.max,t.origin),t.scale=is(n)/is(e),t.translate=Kr(n.min,n.max,t.origin)-t.originPoint,(t.scale>=$ne&&t.scale<=Xne||isNaN(t.scale))&&(t.scale=1),(t.translate>=Kne&&t.translate<=Yne||isNaN(t.translate))&&(t.translate=0)}function wx(t,e,n,r){vF(t.x,e.x,n.x,r?r.originX:void 0),vF(t.y,e.y,n.y,r?r.originY:void 0)}function yF(t,e,n){t.min=n.min+e.min,t.max=t.min+is(e)}function Zne(t,e,n){yF(t.x,e.x,n.x),yF(t.y,e.y,n.y)}function xF(t,e,n){t.min=e.min-n.min,t.max=t.min+is(e)}function JA(t,e,n){xF(t.x,e.x,n.x),xF(t.y,e.y,n.y)}function bF(t,e,n,r,i){return t-=e,t=YA(t,1/n,r),i!==void 0&&(t=YA(t,1/i,r)),t}function Qne(t,e=0,n=1,r=.5,i,a=t,s=t){if(Bc.test(e)&&(e=parseFloat(e),e=Kr(s.min,s.max,e/100)-s.min),typeof e!="number")return;let o=Kr(a.min,a.max,r);t===a&&(o-=e),t.min=bF(t.min,e,n,o,i),t.max=bF(t.max,e,n,o,i)}function _F(t,e,[n,r,i],a,s){Qne(t,e[n],e[r],e[i],e.scale,a,s)}const ere=["x","scaleX","originX"],tre=["y","scaleY","originY"];function SF(t,e,n,r){_F(t.x,e,ere,n?n.x:void 0,r?r.x:void 0),_F(t.y,e,tre,n?n.y:void 0,r?r.y:void 0)}function AF(t){return t.translate===0&&t.scale===1}function J7(t){return AF(t.x)&&AF(t.y)}function wF(t,e){return t.min===e.min&&t.max===e.max}function nre(t,e){return wF(t.x,e.x)&&wF(t.y,e.y)}function MF(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Z7(t,e){return MF(t.x,e.x)&&MF(t.y,e.y)}function EF(t){return is(t.x)/is(t.y)}function TF(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Tc(t){return[t("x"),t("y")]}function rre(t,e,n){let r="";const i=t.x.translate/e.x,a=t.y.translate/e.y,s=n?.z||0;if((i||a||s)&&(r=`translate3d(${i}px, ${a}px, ${s}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:h,rotateX:p,rotateY:v,skewX:y,skewY:b}=n;u&&(r=`perspective(${u}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotateX(${p}deg) `),v&&(r+=`rotateY(${v}deg) `),y&&(r+=`skewX(${y}deg) `),b&&(r+=`skewY(${b}deg) `)}const o=t.x.scale*e.x,c=t.y.scale*e.y;return(o!==1||c!==1)&&(r+=`scale(${o}, ${c})`),r||"none"}const Q7=["TopLeft","TopRight","BottomLeft","BottomRight"],ire=Q7.length,CF=t=>typeof t=="string"?parseFloat(t):t,RF=t=>typeof t=="number"||Lt.test(t);function are(t,e,n,r,i,a){i?(t.opacity=Kr(0,n.opacity??1,sre(r)),t.opacityExit=Kr(e.opacity??1,0,ore(r))):a&&(t.opacity=Kr(e.opacity??1,n.opacity??1,r));for(let s=0;s<ire;s++){const o=`border${Q7[s]}Radius`;let c=OF(e,o),u=OF(n,o);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||RF(c)===RF(u)?(t[o]=Math.max(Kr(CF(c),CF(u),r),0),(Bc.test(u)||Bc.test(c))&&(t[o]+="%")):t[o]=u}(e.rotate||n.rotate)&&(t.rotate=Kr(e.rotate||0,n.rotate||0,r))}function OF(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const sre=eW(0,.5,WV),ore=eW(.5,.95,Go);function eW(t,e,n){return r=>r<t?0:r>e?1:n(Hx(t,e,r))}function lre(t,e,n){const r=Ia(t)?t:nv(t);return r.start(JB("",r,e,n)),r.animation}function $x(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const cre=(t,e)=>t.depth-e.depth;class ure{constructor(){this.children=[],this.isDirty=!1}add(e){LB(this.children,e),this.isDirty=!0}remove(e){WA(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(cre),this.isDirty=!1,this.children.forEach(e)}}function fre(t,e){const n=rs.now(),r=({timestamp:i})=>{const a=i-n;a>=e&&(Td(r),t(a-e))};return wr.setup(r,!0),()=>Td(r)}function BA(t){return Ia(t)?t.get():t}class dre{constructor(){this.members=[]}add(e){LB(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const i=r.instance;i&&i.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&WA(this.members,r)}e.scheduleRender()}remove(e){if(WA(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const a=this.members[i],s=a.instance;if(a.isPresent!==!1&&(!s||s.isConnected!==!1)){r=a;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender();const i=r.options.layoutDependency,a=e.options.layoutDependency;if(!(i!==void 0&&a!==void 0&&i===a)){const c=r.instance;c&&c.isConnected===!1&&!r.snapshot||(e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:o}=e.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const LA={hasAnimatedSinceResize:!0,hasEverUpdated:!1},CC=["","X","Y","Z"],hre=1e3;let pre=0;function RC(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function tW(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=_7(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",wr,!(i||a))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&tW(r)}function nW({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},o=e?.()){this.id=pre++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(vre),this.nodes.forEach(_re),this.nodes.forEach(Sre),this.nodes.forEach(yre)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new ure)}addEventListener(s,o){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new FB),this.eventHandlers.get(s).add(o)}notifyListeners(s,...o){const c=this.eventHandlers.get(s);c&&c.notify(...o)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=rL(s)&&!gne(s),this.instance=s;const{layoutId:o,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||o)&&(this.isLayoutDirty=!0),t){let h,p=0;const v=()=>this.root.updateBlockedByResize=!1;wr.read(()=>{p=window.innerWidth}),t(s,()=>{const y=window.innerWidth;y!==p&&(p=y,this.root.updateBlockedByResize=!0,h&&h(),h=fre(v,250),LA.hasAnimatedSinceResize&&(LA.hasAnimatedSinceResize=!1,this.nodes.forEach(NF)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:v,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||u.getDefaultTransition()||Tre,{onLayoutAnimationStart:w,onLayoutAnimationComplete:_}=u.getProps(),S=!this.targetLayout||!Z7(this.targetLayout,y),E=!p&&v;if(this.options.layoutRoot||this.resumeFrom||E||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...YB(b,"layout"),onPlay:w,onComplete:_};(u.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(h,E)}else p||NF(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Td(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Are),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&tW(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:o,layout:c}=this.options;if(o===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(PF);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(DF);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(bre),this.nodes.forEach(mre),this.nodes.forEach(gre)):this.nodes.forEach(DF),this.clearAllSnapshots();const o=rs.now();da.delta=jc(0,1e3/60,o-da.timestamp),da.timestamp=o,da.isProcessing=!0,bC.update.process(da),bC.preRender.process(da),bC.render.process(da),da.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tL.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(xre),this.sharedNodes.forEach(wre)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!is(this.snapshot.measuredBox.x)&&!is(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Ui(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(o=!1),o&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!J7(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,h=u!==this.prevTransformTemplateValue;s&&this.instance&&(o||Kh(this.latestValues)||h)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const o=this.measurePageBox();let c=this.removeElementScroll(o);return s&&(c=this.removeTransform(c)),Cre(c),{animationId:this.root.animationId,measuredBox:o,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return Ui();const o=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Rre))){const{scroll:u}=this.root;u&&(Fg(o.x,u.offset.x),Fg(o.y,u.offset.y))}return o}removeElementScroll(s){const o=Ui();if(Sl(o,s),this.scroll?.wasRoot)return o;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:p}=u;u!==this.root&&h&&p.layoutScroll&&(h.wasRoot&&Sl(o,s),Fg(o.x,h.offset.x),Fg(o.y,h.offset.y))}return o}applyTransform(s,o=!1){const c=Ui();Sl(c,s);for(let u=0;u<this.path.length;u++){const h=this.path[u];!o&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Ug(c,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),Kh(h.latestValues)&&Ug(c,h.latestValues)}return Kh(this.latestValues)&&Ug(c,this.latestValues),c}removeTransform(s){const o=Ui();Sl(o,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Kh(u.latestValues))continue;AN(u.latestValues)&&u.updateSnapshot();const h=Ui(),p=u.measurePageBox();Sl(h,p),SF(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,h)}return Kh(this.latestValues)&&SF(o,this.latestValues),o}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==da.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==o;if(!(s||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=da.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ui(),this.targetWithTransforms=Ui()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Zne(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Sl(this.target,this.layout.layoutBox),U7(this.target,this.targetDelta)):Sl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||AN(this.parent.latestValues)||F7(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,o,c){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ui(),this.relativeTargetOrigin=Ui(),JA(this.relativeTargetOrigin,o,c),Sl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),o=!!this.resumingFrom||this!==s;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===da.timestamp&&(c=!1),c)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;Sl(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,v=this.treeScale.y;Tne(this.layoutCorrected,this.treeScale,this.path,o),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Ui());const{target:y}=s;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(gF(this.prevProjectionDelta.x,this.projectionDelta.x),gF(this.prevProjectionDelta.y,this.projectionDelta.y)),wx(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==v||!TF(this.projectionDelta.x,this.prevProjectionDelta.x)||!TF(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const o=this.getStack();o&&o.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=kg(),this.projectionDelta=kg(),this.projectionDeltaWithTransform=kg()}setAnimationOrigin(s,o=!1){const c=this.snapshot,u=c?c.latestValues:{},h={...this.latestValues},p=kg();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const v=Ui(),y=c?c.source:void 0,b=this.layout?this.layout.source:void 0,w=y!==b,_=this.getStack(),S=!_||_.members.length<=1,E=!!(w&&!S&&this.options.crossfade===!0&&!this.path.some(Ere));this.animationProgress=0;let T;this.mixTargetDelta=P=>{const R=P/1e3;IF(p.x,s.x,R),IF(p.y,s.y,R),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(JA(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Mre(this.relativeTarget,this.relativeTargetOrigin,v,R),T&&nre(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Ui()),Sl(T,this.relativeTarget)),w&&(this.animationValues=h,are(h,u,this.latestValues,R,E,S)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Td(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wr.update(()=>{LA.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=nv(0)),this.currentAnimation=lre(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:o=>{this.mixTargetDelta(o),s.onUpdate&&s.onUpdate(o)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(hre),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:c,layout:u,latestValues:h}=s;if(!(!o||!c||!u)){if(this!==s&&this.layout&&u&&rW(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Ui();const p=is(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+p;const v=is(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+v}Sl(o,c),Ug(o,h),wx(this.projectionDeltaWithTransform,this.layoutCorrected,o,h)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new dre),this.sharedNodes.get(s).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(o=!0),!o)return;const u={};c.z&&RC("z",s,u,this.animationValues);for(let h=0;h<CC.length;h++)RC(`rotate${CC[h]}`,s,u,this.animationValues),RC(`skew${CC[h]}`,s,u,this.animationValues);s.render();for(const h in u)s.setStaticValue(h,u[h]),this.animationValues&&(this.animationValues[h]=u[h]);s.scheduleRender()}applyProjectionStyles(s,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=BA(o?.pointerEvents)||"",s.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=BA(o?.pointerEvents)||""),this.hasProjected&&!Kh(this.latestValues)&&(s.transform=c?c({},""):"none",this.hasProjected=!1);return}s.visibility="";const h=u.animationValues||u.latestValues;this.applyTransformsToTarget();let p=rre(this.projectionDeltaWithTransform,this.treeScale,h);c&&(p=c(h,p)),s.transform=p;const{x:v,y}=this.projectionDelta;s.transformOrigin=`${v.origin*100}% ${y.origin*100}% 0`,u.animationValues?s.opacity=u===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:s.opacity=u===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const b in MN){if(h[b]===void 0)continue;const{correct:w,applyTo:_,isCSSVariable:S}=MN[b],E=p==="none"?h[b]:w(h[b],u);if(_){const T=_.length;for(let P=0;P<T;P++)s[_[P]]=E}else S?this.options.visualElement.renderState.vars[b]=E:s[b]=E}this.options.layoutId&&(s.pointerEvents=u===this?BA(o?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(PF),this.root.sharedNodes.clear()}}}function mre(t){t.updateLayout()}function gre(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=t.layout,{animationType:i}=t.options,a=e.source!==t.layout.source;i==="size"?Tc(h=>{const p=a?e.measuredBox[h]:e.layoutBox[h],v=is(p);p.min=n[h].min,p.max=p.min+v}):rW(i,e.layoutBox,n)&&Tc(h=>{const p=a?e.measuredBox[h]:e.layoutBox[h],v=is(n[h]);p.max=p.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+v)});const s=kg();wx(s,n,e.layoutBox);const o=kg();a?wx(o,t.applyTransform(r,!0),e.measuredBox):wx(o,n,e.layoutBox);const c=!J7(s);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:v}=h;if(p&&v){const y=Ui();JA(y,e.layoutBox,p.layoutBox);const b=Ui();JA(b,n,v.layoutBox),Z7(y,b)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=y,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:o,layoutDelta:s,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function vre(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function yre(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function xre(t){t.clearSnapshot()}function PF(t){t.clearMeasurements()}function DF(t){t.isLayoutDirty=!1}function bre(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function NF(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function _re(t){t.resolveTargetDelta()}function Sre(t){t.calcProjection()}function Are(t){t.resetSkewAndRotation()}function wre(t){t.removeLeadSnapshot()}function IF(t,e,n){t.translate=Kr(e.translate,0,n),t.scale=Kr(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function BF(t,e,n,r){t.min=Kr(e.min,n.min,r),t.max=Kr(e.max,n.max,r)}function Mre(t,e,n,r){BF(t.x,e.x,n.x,r),BF(t.y,e.y,n.y,r)}function Ere(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Tre={duration:.45,ease:[.4,0,.1,1]},LF=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),kF=LF("applewebkit/")&&!LF("chrome/")?Math.round:Go;function FF(t){t.min=kF(t.min),t.max=kF(t.max)}function Cre(t){FF(t.x),FF(t.y)}function rW(t,e,n){return t==="position"||t==="preserve-aspect"&&!Jne(EF(e),EF(n),.2)}function Rre(t){return t!==t.root&&t.scroll?.wasRoot}const Ore=nW({attachResizeListener:(t,e)=>$x(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),OC={current:void 0},iW=nW({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!OC.current){const t=new Ore({});t.mount(window),t.setOptions({layoutScroll:!0}),OC.current=t}return OC.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),lL=j.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function UF(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Pre(...t){return e=>{let n=!1;const r=t.map(i=>{const a=UF(i,e);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():UF(t[i],null)}}}}function Dre(...t){return j.useCallback(Pre(...t),t)}class Nre extends j.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=_N(r)&&r.offsetWidth||0,a=_N(r)&&r.offsetHeight||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left,s.bottom=a-s.height-s.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Ire({children:t,isPresent:e,anchorX:n,anchorY:r,root:i,pop:a}){const s=j.useId(),o=j.useRef(null),c=j.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=j.useContext(lL),h=t.props?.ref??t?.ref,p=Dre(o,h);return j.useInsertionEffect(()=>{const{width:v,height:y,top:b,left:w,right:_,bottom:S}=c.current;if(e||a===!1||!o.current||!v||!y)return;const E=n==="left"?`left: ${w}`:`right: ${_}`,T=r==="bottom"?`bottom: ${S}`:`top: ${b}`;o.current.dataset.motionPopId=s;const P=document.createElement("style");u&&(P.nonce=u);const R=i??document.head;return R.appendChild(P),P.sheet&&P.sheet.insertRule(`
[data-motion-pop-id="${s}"] {
position: absolute !important;
width: ${v}px !important;
height: ${y}px !important;
${E}px !important;
${T}px !important;
}
`),()=>{R.contains(P)&&R.removeChild(P)}},[e]),M.jsx(Nre,{isPresent:e,childRef:o,sizeRef:c,pop:a,children:a===!1?t:j.cloneElement(t,{ref:p})})}const Bre=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s,anchorX:o,anchorY:c,root:u})=>{const h=BB(Lre),p=j.useId();let v=!0,y=j.useMemo(()=>(v=!1,{id:p,initial:e,isPresent:n,custom:i,onExitComplete:b=>{h.set(b,!0);for(const w of h.values())if(!w)return;r&&r()},register:b=>(h.set(b,!1),()=>h.delete(b))}),[n,h,r]);return a&&v&&(y={...y}),j.useMemo(()=>{h.forEach((b,w)=>h.set(w,!1))},[n]),j.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=M.jsx(Ire,{pop:s==="popLayout",isPresent:n,anchorX:o,anchorY:c,root:u,children:t}),M.jsx(sE.Provider,{value:y,children:t})};function Lre(){return new Map}function aW(t=!0){const e=j.useContext(sE);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,a=j.useId();j.useEffect(()=>{if(t)return i(a)},[t]);const s=j.useCallback(()=>t&&r&&r(a),[a,r,t]);return!n&&r?[!1,s]:[!0]}const dS=t=>t.key||"";function jF(t){const e=[];return j.Children.forEach(t,n=>{j.isValidElement(n)&&e.push(n)}),e}const Bs=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:s=!1,anchorX:o="left",anchorY:c="top",root:u})=>{const[h,p]=aW(s),v=j.useMemo(()=>jF(t),[t]),y=s&&!h?[]:v.map(dS),b=j.useRef(!0),w=j.useRef(v),_=BB(()=>new Map),S=j.useRef(new Set),[E,T]=j.useState(v),[P,R]=j.useState(v);NV(()=>{b.current=!1,w.current=v;for(let k=0;k<P.length;k++){const B=dS(P[k]);y.includes(B)?(_.delete(B),S.current.delete(B)):_.get(B)!==!0&&_.set(B,!1)}},[P,y.length,y.join("-")]);const D=[];if(v!==E){let k=[...v];for(let B=0;B<P.length;B++){const U=P[B],z=dS(U);y.includes(z)||(k.splice(B,0,U),D.push(U))}return a==="wait"&&D.length&&(k=D),R(jF(k)),T(v),null}const{forceRender:I}=j.useContext(IB);return M.jsx(M.Fragment,{children:P.map(k=>{const B=dS(k),U=s&&!h?!1:v===P||y.includes(B),z=()=>{if(S.current.has(B))return;if(S.current.add(B),_.has(B))_.set(B,!0);else return;let q=!0;_.forEach(W=>{W||(q=!1)}),q&&(I?.(),R(w.current),s&&p?.(),r&&r())};return M.jsx(Bre,{isPresent:U,initial:!b.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:a,root:u,onExitComplete:U?void 0:z,anchorX:o,anchorY:c,children:k},B)})})},sW=j.createContext({strict:!1}),zF={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let GF=!1;function kre(){if(GF)return;const t={};for(const e in zF)t[e]={isEnabled:n=>zF[e].some(r=>!!n[r])};B7(t),GF=!0}function oW(){return kre(),Ane()}function Fre(t){const e=oW();for(const n in t)e[n]={...e[n],...t[n]};B7(e)}const Ure=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ZA(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ure.has(t)}let lW=t=>!ZA(t);function jre(t){typeof t=="function"&&(lW=e=>e.startsWith("on")?!ZA(e):t(e))}try{jre(require("@emotion/is-prop-valid").default)}catch{}function zre(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(lW(i)||n===!0&&ZA(i)||!e&&!ZA(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}const cE=j.createContext({});function Gre(t,e){if(lE(t)){const{initial:n,animate:r}=t;return{initial:n===!1||qx(n)?n:void 0,animate:qx(r)?r:void 0}}return t.inherit!==!1?e:{}}function Hre(t){const{initial:e,animate:n}=Gre(t,j.useContext(cE));return j.useMemo(()=>({initial:e,animate:n}),[HF(e),HF(n)])}function HF(t){return Array.isArray(t)?t.join(" "):t}const cL=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function cW(t,e,n){for(const r in e)!Ia(e[r])&&!G7(r,n)&&(t[r]=e[r])}function Vre({transformTemplate:t},e){return j.useMemo(()=>{const n=cL();return sL(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Wre(t,e){const n=t.style||{},r={};return cW(r,n,t),Object.assign(r,Vre(t,e)),r}function qre(t,e){const n={},r=Wre(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const uW=()=>({...cL(),attrs:{}});function $re(t,e,n,r){const i=j.useMemo(()=>{const a=uW();return H7(a,e,W7(r),t.transformTemplate,t.style),{...a.attrs,style:{...a.style}}},[e]);if(t.style){const a={};cW(a,t.style,t),i.style={...a,...i.style}}return i}const Xre=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function uL(t){return typeof t!="string"||t.includes("-")?!1:!!(Xre.indexOf(t)>-1||/[A-Z]/u.test(t))}function Kre(t,e,n,{latestValues:r},i,a=!1,s){const c=(s??uL(t)?$re:qre)(e,r,i,t),u=zre(e,typeof t=="string",a),h=t!==j.Fragment?{...u,...c,ref:n}:{},{children:p}=e,v=j.useMemo(()=>Ia(p)?p.get():p,[p]);return j.createElement(t,{...h,children:v})}function Yre({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,i){return{latestValues:Jre(n,r,i,t),renderState:e()}}function Jre(t,e,n,r){const i={},a=r(t,{});for(const v in a)i[v]=BA(a[v]);let{initial:s,animate:o}=t;const c=lE(t),u=N7(t);e&&u&&!c&&t.inherit!==!1&&(s===void 0&&(s=e.initial),o===void 0&&(o=e.animate));let h=n?n.initial===!1:!1;h=h||s===!1;const p=h?o:s;if(p&&typeof p!="boolean"&&!oE(p)){const v=Array.isArray(p)?p:[p];for(let y=0;y<v.length;y++){const b=ZB(t,v[y]);if(b){const{transitionEnd:w,transition:_,...S}=b;for(const E in S){let T=S[E];if(Array.isArray(T)){const P=h?T.length-1:0;T=T[P]}T!==null&&(i[E]=T)}for(const E in w)i[E]=w[E]}}}return i}const fW=t=>(e,n)=>{const r=j.useContext(cE),i=j.useContext(sE),a=()=>Yre(t,e,r,i);return n?a():BB(a)},Zre=fW({scrapeMotionValuesFromProps:oL,createRenderState:cL}),Qre=fW({scrapeMotionValuesFromProps:q7,createRenderState:uW}),eie=Symbol.for("motionComponentSymbol");function tie(t,e,n){const r=j.useRef(n);j.useInsertionEffect(()=>{r.current=n});const i=j.useRef(null);return j.useCallback(a=>{a&&t.onMount?.(a),e&&(a?e.mount(a):e.unmount());const s=r.current;if(typeof s=="function")if(a){const o=s(a);typeof o=="function"&&(i.current=o)}else i.current?(i.current(),i.current=null):s(a);else s&&(s.current=a)},[e])}const dW=j.createContext({});function Ig(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function nie(t,e,n,r,i,a){const{visualElement:s}=j.useContext(cE),o=j.useContext(sW),c=j.useContext(sE),u=j.useContext(lL),h=u.reducedMotion,p=u.skipAnimations,v=j.useRef(null),y=j.useRef(!1);r=r||o.renderer,!v.current&&r&&(v.current=r(t,{visualState:e,parent:s,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:a}),y.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const b=v.current,w=j.useContext(dW);b&&!b.projection&&i&&(b.type==="html"||b.type==="svg")&&rie(v.current,n,i,w);const _=j.useRef(!1);j.useInsertionEffect(()=>{b&&_.current&&b.update(n,c)});const S=n[b7],E=j.useRef(!!S&&!window.MotionHandoffIsComplete?.(S)&&window.MotionHasOptimisedAnimation?.(S));return NV(()=>{y.current=!0,b&&(_.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),E.current&&b.animationState&&b.animationState.animateChanges())}),j.useEffect(()=>{b&&(!E.current&&b.animationState&&b.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(S)}),E.current=!1),b.enteringChildren=void 0)}),b}function rie(t,e,n,r){const{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:c,layoutRoot:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:hW(t.parent)),t.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&Ig(o),visualElement:t,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:c,layoutRoot:u})}function hW(t){if(t)return t.options.allowProjection!==!1?t.projection:hW(t.parent)}function PC(t,{forwardMotionProps:e=!1,type:n}={},r,i){r&&Fre(r);const a=n?n==="svg":uL(t),s=a?Qre:Zre;function o(u,h){let p;const v={...j.useContext(lL),...u,layoutId:iie(u)},{isStatic:y}=v,b=Hre(u),w=s(u,y);if(!y&&DV){aie();const _=sie(v);p=_.MeasureLayout,b.visualElement=nie(t,w,v,i,_.ProjectionNode,a)}return M.jsxs(cE.Provider,{value:b,children:[p&&b.visualElement?M.jsx(p,{visualElement:b.visualElement,...v}):null,Kre(t,u,tie(w,b.visualElement,h),w,y,e,a)]})}o.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=j.forwardRef(o);return c[eie]=t,c}function iie({layoutId:t}){const e=j.useContext(IB).id;return e&&t!==void 0?e+"-"+t:t}function aie(t,e){j.useContext(sW).strict}function sie(t){const e=oW(),{drag:n,layout:r}=e;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n?.isEnabled(t)||r?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function oie(t,e){if(typeof Proxy>"u")return PC;const n=new Map,r=(a,s)=>PC(a,s,t,e),i=(a,s)=>r(a,s);return new Proxy(i,{get:(a,s)=>s==="create"?r:(n.has(s)||n.set(s,PC(s,void 0,t,e)),n.get(s))})}const lie=(t,e)=>e.isSVG??uL(t)?new jne(e):new Ine(e,{allowProjection:t!==j.Fragment});class cie extends Bd{constructor(e){super(e),e.animationState||(e.animationState=Wne(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();oE(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let uie=0;class fie extends Bd{constructor(){super(...arguments),this.id=uie++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const die={animation:{Feature:cie},exit:{Feature:fie}};function Yb(t){return{point:{x:t.pageX,y:t.pageY}}}const hie=t=>e=>nL(e)&&t(e,Yb(e));function Mx(t,e,n,r){return $x(t,e,hie(n),r)}const pW=({current:t})=>t?t.ownerDocument.defaultView:null,VF=(t,e)=>Math.abs(t-e);function pie(t,e){const n=VF(t.x,e.x),r=VF(t.y,e.y);return Math.sqrt(n**2+r**2)}const WF=new Set(["auto","scroll"]);class mW{constructor(e,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:s=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=NC(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,w=pie(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!w)return;const{point:_}=y,{timestamp:S}=da;this.history.push({..._,timestamp:S});const{onStart:E,onMove:T}=this.handlers;b||(E&&E(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,y)},this.handlePointerMove=(y,b)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=DC(b,this.transformPagePoint),wr.update(this.updatePoint,!0)},this.handlePointerUp=(y,b)=>{this.end();const{onEnd:w,onSessionEnd:_,resumeAnimation:S}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=NC(y.type==="pointercancel"?this.lastMoveEventInfo:DC(b,this.transformPagePoint),this.history);this.startEvent&&w&&w(y,E),_&&_(y,E)},!nL(e))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=i||window;const c=Yb(e),u=DC(c,this.transformPagePoint),{point:h}=u,{timestamp:p}=da;this.history=[{...h,timestamp:p}];const{onSessionStart:v}=n;v&&v(e,NC(u,this.history)),this.removeListeners=$b(Mx(this.contextWindow,"pointermove",this.handlePointerMove),Mx(this.contextWindow,"pointerup",this.handlePointerUp),Mx(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(WF.has(r.overflowX)||WF.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a={x:i.x-n.x,y:i.y-n.y};a.x===0&&a.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(e,i),wr.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Td(this.updatePoint)}}function DC(t,e){return e?{point:e(t.point)}:t}function qF(t,e){return{x:t.x-e.x,y:t.y-e.y}}function NC({point:t},e){return{point:t,delta:qF(t,gW(e)),offset:qF(t,mie(e)),velocity:gie(e,.1)}}function mie(t){return t[0]}function gW(t){return t[t.length-1]}function gie(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=gW(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Ll(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&i.timestamp-r.timestamp>Ll(e)*2&&(r=t[1]);const a=Uo(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const s={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function vie(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Kr(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Kr(n,t,r.max):Math.min(t,n)),t}function $F(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function yie(t,{top:e,left:n,bottom:r,right:i}){return{x:$F(t.x,n,i),y:$F(t.y,e,r)}}function XF(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function xie(t,e){return{x:XF(t.x,e.x),y:XF(t.y,e.y)}}function bie(t,e){let n=.5;const r=is(t),i=is(e);return i>r?n=Hx(e.min,e.max-r,t.min):r>i&&(n=Hx(t.min,t.max-i,e.min)),jc(0,1,n)}function _ie(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const EN=.35;function Sie(t=EN){return t===!1?t=0:t===!0&&(t=EN),{x:KF(t,"left","right"),y:KF(t,"top","bottom")}}function KF(t,e,n){return{min:YF(t,e),max:YF(t,n)}}function YF(t,e){return typeof t=="number"?t:t[e]||0}const Aie=new WeakMap;class wie{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ui(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const a=p=>{n&&this.snapToCursor(Yb(p).point),this.stopAnimation()},s=(p,v)=>{const{drag:y,dragPropagation:b,onDragStart:w}=this.getProps();if(y&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Qte(y),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tc(S=>{let E=this.getAxisMotionValue(S).get()||0;if(Bc.test(E)){const{projection:T}=this.visualElement;if(T&&T.layout){const P=T.layout.layoutBox[S];P&&(E=is(P)*(parseFloat(E)/100))}}this.originPoint[S]=E}),w&&wr.update(()=>w(p,v),!1,!0),vN(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},o=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v;const{dragPropagation:y,dragDirectionLock:b,onDirectionLock:w,onDrag:_}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:S}=v;if(b&&this.currentDirection===null){this.currentDirection=Eie(S),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",v.point,S),this.updateAxis("y",v.point,S),this.visualElement.render(),_&&wr.update(()=>_(p,v),!1,!0)},c=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v,this.stop(p,v),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new mW(e,{onSessionStart:a,onStart:s,onMove:o,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:pW(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,i=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&wr.postRender(()=>o(r,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!hS(e,i,this.currentDirection))return;const a=this.getAxisMotionValue(e);let s=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(s=vie(s,this.constraints[e],this.elastic[e])),a.set(s)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&Ig(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=yie(r.layoutBox,e):this.constraints=!1,this.elastic=Sie(n),i!==this.constraints&&!Ig(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Tc(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=_ie(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ig(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=Cne(r,i.root,this.visualElement.getTransformPagePoint());let s=xie(i.layout.layoutBox,a);if(n){const o=n(Mne(s));this.hasMutatedConstraints=!!o,o&&(s=k7(o))}return s}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=Tc(h=>{if(!hS(h,n,this.currentDirection))return;let p=c&&c[h]||{};s&&(p={min:0,max:0});const v=i?200:1e6,y=i?40:1e7,b={type:"inertia",velocity:r?e[h]:0,bounceStiffness:v,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(h,b)});return Promise.all(u).then(o)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return vN(this.visualElement,e),r.start(JB(e,r,0,n,this.visualElement,!1))}stopAnimation(){Tc(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Tc(n=>{const{drag:r}=this.getProps();if(!hS(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:o}=i.layout.layoutBox[n],c=a.get()||0;a.set(e[n]-Kr(s,o,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ig(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Tc(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const c=o.get();i[s]=bie({min:c,max:c},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tc(s=>{if(!hS(s,e,null))return;const o=this.getAxisMotionValue(s),{min:c,max:u}=this.constraints[s];o.set(Kr(c,u,i[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Aie.set(this.visualElement,this);const e=this.visualElement.current,n=Mx(e,"pointerdown",u=>{const{drag:h,dragListener:p=!0}=this.getProps(),v=u.target,y=v!==e&&ane(v);h&&p&&!y&&this.start(u)});let r;const i=()=>{const{dragConstraints:u}=this.getProps();Ig(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Mie(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,s=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),wr.read(i);const o=$x(window,"resize",()=>this.scalePositionWithinConstraints()),c=a.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:h})=>{this.isDragging&&h&&(Tc(p=>{const v=this.getAxisMotionValue(p);v&&(this.originPoint[p]+=u[p].translate,v.set(v.get()+u[p].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:s=EN,dragMomentum:o=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:s,dragMomentum:o}}}function JF(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Mie(t,e,n){const r=iF(t,JF(n)),i=iF(e,JF(n));return()=>{r(),i()}}function hS(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Eie(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Tie extends Bd{constructor(e){super(e),this.removeGroupControls=Go,this.removeListeners=Go,this.controls=new wie(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Go}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const IC=t=>(e,n)=>{t&&wr.update(()=>t(e,n),!1,!0)};class Cie extends Bd{constructor(){super(...arguments),this.removePointerDownListener=Go}onPointerDown(e){this.session=new mW(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pW(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:IC(e),onStart:IC(n),onMove:IC(r),onEnd:(a,s)=>{delete this.session,i&&wr.postRender(()=>i(a,s))}}}mount(){this.removePointerDownListener=Mx(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let BC=!1;class Rie extends j.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=e;a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),BC&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),LA.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:s}=r;return s&&(s.isPresent=a,e.layoutDependency!==n&&s.setOptions({...s.options,layoutDependency:n}),BC=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==a?s.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?s.promote():s.relegate()||wr.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),tL.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;BC=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function vW(t){const[e,n]=aW(),r=j.useContext(IB);return M.jsx(Rie,{...t,layoutGroup:r,switchLayoutGroup:j.useContext(dW),isPresent:e,safeToRemove:n})}const Oie={pan:{Feature:Cie},drag:{Feature:Tie,ProjectionNode:iW,MeasureLayout:vW}};function ZF(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=r[i];a&&wr.postRender(()=>a(e,Yb(e)))}class Pie extends Bd{mount(){const{current:e}=this.node;e&&(this.unmount=tne(e,(n,r)=>(ZF(this.node,r,"Start"),i=>ZF(this.node,i,"End"))))}unmount(){}}class Die extends Bd{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$b($x(this.node.current,"focus",()=>this.onFocus()),$x(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function QF(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=r[i];a&&wr.postRender(()=>a(e,Yb(e)))}class Nie extends Bd{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=one(e,(i,a)=>(QF(this.node,a,"Start"),(s,{success:o})=>QF(this.node,s,o?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const TN=new WeakMap,LC=new WeakMap,Iie=t=>{const e=TN.get(t.target);e&&e(t)},Bie=t=>{t.forEach(Iie)};function Lie({root:t,...e}){const n=t||document;LC.has(n)||LC.set(n,{});const r=LC.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Bie,{root:t,...e})),r[i]}function kie(t,e,n){const r=Lie(e);return TN.set(t,n),r.observe(t),()=>{TN.delete(t),r.unobserve(t)}}const Fie={some:0,all:1};class Uie extends Bd{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=e,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Fie[i]},o=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:p}=this.node.getProps(),v=u?h:p;v&&v(c)};return kie(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(jie(e,n))&&this.startObserver()}unmount(){}}function jie({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const zie={inView:{Feature:Uie},tap:{Feature:Nie},focus:{Feature:Die},hover:{Feature:Pie}},Gie={layout:{ProjectionNode:iW,MeasureLayout:vW}},Hie={...die,...zie,...Oie,...Gie},yt=oie(Hie,lie),e4=t=>{let e;const n=new Set,r=(u,h)=>{const p=typeof u=="function"?u(e):u;if(!Object.is(p,e)){const v=e;e=h??(typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(y=>y(e,v))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=e=t(r,i,o);return o},yW=(t=>t?e4(t):e4),Vie=t=>t;function Wie(t,e=Vie){const n=fe.useSyncExternalStore(t.subscribe,fe.useCallback(()=>e(t.getState()),[t,e]),fe.useCallback(()=>e(t.getInitialState()),[t,e]));return fe.useDebugValue(n),n}const qie=t=>{const e=yW(t),n=r=>Wie(e,r);return Object.assign(n,e),n},$ie=(t=>qie);function Xie(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var a;const s=c=>c===null?null:JSON.parse(c,void 0),o=(a=n.getItem(i))!=null?a:null;return o instanceof Promise?o.then(s):s(o)},setItem:(i,a)=>n.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>n.removeItem(i)}}const CN=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return CN(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return CN(r)(n)}}}},Kie=(t,e)=>(n,r,i)=>{let a={storage:Xie(()=>window.localStorage),partialize:_=>_,version:0,merge:(_,S)=>({...S,..._}),...e},s=!1,o=0;const c=new Set,u=new Set;let h=a.storage;if(!h)return t((..._)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(..._)},r,i);const p=()=>{const _=a.partialize({...r()});return h.setItem(a.name,{state:_,version:a.version})},v=i.setState;i.setState=(_,S)=>(v(_,S),p());const y=t((..._)=>(n(..._),p()),r,i);i.getInitialState=()=>y;let b;const w=()=>{var _,S;if(!h)return;const E=++o;s=!1,c.forEach(P=>{var R;return P((R=r())!=null?R:y)});const T=((S=a.onRehydrateStorage)==null?void 0:S.call(a,(_=r())!=null?_:y))||void 0;return CN(h.getItem.bind(h))(a.name).then(P=>{if(P)if(typeof P.version=="number"&&P.version!==a.version){if(a.migrate){const R=a.migrate(P.state,P.version);return R instanceof Promise?R.then(D=>[!0,D]):[!0,R]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,P.state];return[!1,void 0]}).then(P=>{var R;if(E!==o)return;const[D,I]=P;if(b=a.merge(I,(R=r())!=null?R:y),n(b,!0),D)return p()}).then(()=>{E===o&&(T?.(b,void 0),b=r(),s=!0,u.forEach(P=>P(b)))}).catch(P=>{E===o&&T?.(void 0,P)})};return i.persist={setOptions:_=>{a={...a,..._},_.storage&&(h=_.storage)},clearStorage:()=>{h?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>w(),hasHydrated:()=>s,onHydrate:_=>(c.add(_),()=>{c.delete(_)}),onFinishHydration:_=>(u.add(_),()=>{u.delete(_)})},a.skipHydration||w(),b||y},Yie=Kie,Jie=[{id:"1",name:"Mohammed Al-Rashid",phone:"+971 55 123 4567",source:"whatsapp",status:"hot",lastMessage:"Can we schedule a viewing for the penthouse tomorrow?",lastActive:new Date(Date.now()-1e3*60*5),unreadCount:2,qualification:"whale",budget:"AED 15M+",interest:"Penthouse Suite"},{id:"2",name:"Sarah Chen",phone:"+971 50 987 6543",source:"walkin",status:"engaged",lastMessage:"Thank you for the brochure. I will review with my partner.",lastActive:new Date(Date.now()-1e3*60*30),unreadCount:0,qualification:"potential",budget:"AED 5-8M",interest:"2 Bedroom Sea View"},{id:"3",name:"James Wilson",phone:"+971 52 456 7890",source:"website",status:"new",lastMessage:"Interested in investment opportunities.",lastActive:new Date(Date.now()-1e3*60*60*2),unreadCount:1,qualification:"potential",budget:"AED 3-5M",interest:"1 Bedroom Investment"},{id:"4",name:"Fatima Hassan",phone:"+971 54 321 0987",source:"whatsapp",status:"qualified",lastMessage:"What are the payment plan options?",lastActive:new Date(Date.now()-1e3*60*60*4),unreadCount:0,qualification:"whale",budget:"AED 12M+",interest:"3 Bedroom + Maid"},{id:"5",name:"David Kumar",phone:"+971 56 789 0123",source:"walkin",status:"closed",lastMessage:"Contract signed. Thank you!",lastActive:new Date(Date.now()-1e3*60*60*24),unreadCount:0,qualification:"whale",budget:"AED 20M",interest:"Full Floor"}],Zie={1:[{id:"m1",sender:"user",content:"Hi, I am interested in the penthouse units.",timestamp:new Date(Date.now()-1e3*60*60*2)},{id:"m2",sender:"oracle",content:"Welcome! Our penthouse collection features 4 exclusive units with panoramic sea views. Prices start at AED 15M. Would you like to know more about specific floor plans?",timestamp:new Date(Date.now()-1e3*60*60*2+1e3*30)},{id:"m3",sender:"user",content:"Can we schedule a viewing for the penthouse tomorrow?",timestamp:new Date(Date.now()-1e3*60*5)}],2:[{id:"m4",sender:"oracle",content:"Hello Sarah! Thank you for visiting our Experience Center today. Here is the digital brochure for the 2-bedroom units we discussed.",timestamp:new Date(Date.now()-1e3*60*60*4)},{id:"m5",sender:"user",content:"Thank you for the brochure. I will review with my partner.",timestamp:new Date(Date.now()-1e3*60*30)}]},Qie=[{id:"v1",faceId:"face_001",sentiment:"excited",confidence:.92,dwellTime:450,zone:"Penthouse Showroom",timestamp:new Date},{id:"v2",faceId:"face_002",sentiment:"interested",confidence:.87,dwellTime:320,zone:"Amenity Deck VR",timestamp:new Date},{id:"v3",faceId:"face_003",sentiment:"neutral",confidence:.78,dwellTime:180,zone:"Reception",timestamp:new Date}],eae=Array.from({length:12},(t,e)=>({time:`${9+Math.floor(e/2)}:${e%2===0?"00":"30"}`,generated:Math.floor(Math.random()*8)+2,closed:Math.floor(Math.random()*3)})),tae=[{id:"u1",unitNumber:"PH-01",type:"penthouse",floor:45,area:520,price:25e6,status:"available",view:"Panoramic Sea",lastUpdated:new Date},{id:"u2",unitNumber:"PH-02",type:"penthouse",floor:45,area:480,price:22e6,status:"reserved",view:"Sea & Marina",lastUpdated:new Date},{id:"u3",unitNumber:"4501",type:"3br",floor:45,area:280,price:12e6,status:"available",view:"Sea View",lastUpdated:new Date},{id:"u4",unitNumber:"4502",type:"3br",floor:45,area:265,price:115e5,status:"sold",view:"Marina View",lastUpdated:new Date},{id:"u5",unitNumber:"4401",type:"2br",floor:44,area:180,price:75e5,status:"available",view:"Sea View",lastUpdated:new Date},{id:"u6",unitNumber:"4402",type:"2br",floor:44,area:175,price:72e5,status:"hold",view:"City View",lastUpdated:new Date},{id:"u7",unitNumber:"4301",type:"1br",floor:43,area:95,price:42e5,status:"available",view:"Sea View",lastUpdated:new Date},{id:"u8",unitNumber:"4302",type:"1br",floor:43,area:92,price:4e6,status:"available",view:"City View",lastUpdated:new Date}],ao=$ie()(Yie(t=>({isAuthenticated:!1,user:null,login:e=>t({isAuthenticated:!0,user:e}),logout:()=>t({isAuthenticated:!1,user:null}),activeModule:"dashboard",sidebarExpanded:!1,setActiveModule:e=>t({activeModule:e}),toggleSidebar:()=>t(e=>({sidebarExpanded:!e.sidebarExpanded})),setSidebarExpanded:e=>t({sidebarExpanded:e}),leads:Jie,activeLeadId:null,messages:Zie,isOracleThinking:!1,setActiveLead:e=>t({activeLeadId:e}),addMessage:(e,n)=>t(r=>({messages:{...r.messages,[e]:[...r.messages[e]||[],n]}})),setOracleThinking:e=>t({isOracleThinking:e}),markLeadAsRead:e=>t(n=>({leads:n.leads.map(r=>r.id===e?{...r,unreadCount:0}:r)})),visitors:Qie,isAlertActive:!1,alertMessage:"",addVisitor:e=>t(n=>({visitors:[...n.visitors,e]})),removeVisitor:e=>t(n=>({visitors:n.visitors.filter(r=>r.id!==e)})),triggerAlert:e=>t({isAlertActive:!0,alertMessage:e}),clearAlert:()=>t({isAlertActive:!1,alertMessage:""}),metrics:{activeVisitors:12,todayLeads:24,closedDeals:3,conversionRate:12.5,sentiment:78,systemHealth:{cpu:34,gpu:28,memory:42,temperature:58}},velocityData:eae,updateMetrics:e=>t(n=>({metrics:{...n.metrics,...e}})),addVelocityDataPoint:e=>t(n=>({velocityData:[...n.velocityData.slice(1),e]})),units:tae,selectedUnitId:null,filterStatus:"all",setSelectedUnit:e=>t({selectedUnitId:e}),setFilterStatus:e=>t({filterStatus:e}),status:{isConnected:!0,serverStatus:"online",lastSync:new Date,version:"2.1.0"},updateStatus:e=>t(n=>({status:{...n.status,...e}}))}),{name:"velocity-webos-storage",partialize:t=>({user:t.user,activeModule:t.activeModule})}));const nae=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rae=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),t4=t=>{const e=rae(t);return e.charAt(0).toUpperCase()+e.slice(1)},xW=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),iae=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var aae={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const sae=j.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...o},c)=>j.createElement("svg",{ref:c,...aae,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:xW("lucide",i),...!a&&!iae(o)&&{"aria-hidden":"true"},...o},[...s.map(([u,h])=>j.createElement(u,h)),...Array.isArray(a)?a:[a]]));const kt=(t,e)=>{const n=j.forwardRef(({className:r,...i},a)=>j.createElement(sae,{ref:a,iconNode:e,className:xW(`lucide-${nae(t4(t))}`,`lucide-${t}`,r),...i}));return n.displayName=t4(t),n};const oae=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],fL=kt("activity",oae);const lae=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],n4=kt("arrow-right",lae);const cae=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],bW=kt("arrow-up-right",cae);const uae=[["path",{d:"M10 4 8 6",key:"1rru8s"}],["path",{d:"M17 19v2",key:"ts1sot"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M7 19v2",key:"12npes"}],["path",{d:"M9 5 7.621 3.621A2.121 2.121 0 0 0 4 5v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5",key:"14ym8i"}]],fae=kt("bath",uae);const dae=[["path",{d:"M2 4v16",key:"vw9hq8"}],["path",{d:"M2 8h18a2 2 0 0 1 2 2v10",key:"1dgv2r"}],["path",{d:"M2 17h20",key:"18nfp3"}],["path",{d:"M6 8v9",key:"1yriud"}]],hae=kt("bed",dae);const pae=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],mae=kt("bell",pae);const gae=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],vae=kt("bot",gae);const yae=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],xae=kt("brain",yae);const bae=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],_ae=kt("briefcase",bae);const Sae=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],Aae=kt("building-2",Sae);const wae=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Ex=kt("calendar-clock",wae);const Mae=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Eae=kt("calendar",Mae);const Tae=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],r4=kt("check",Tae);const Cae=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_W=kt("chevron-down",Cae);const Rae=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Oae=kt("chevron-right",Rae);const Pae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Dae=kt("circle-check",Pae);const Nae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Iae=kt("circle-x",Nae);const Bae=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],RN=kt("clock",Bae);const Lae=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],kae=kt("compass",Lae);const Fae=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],i4=kt("copy",Fae);const Uae=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],jae=kt("cpu",Uae);const zae=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Gae=kt("database",zae);const Hae=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Vae=kt("ellipsis-vertical",Hae);const Wae=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],SW=kt("eye",Wae);const qae=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],$ae=kt("folder",qae);const Xae=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Kae=kt("git-branch",Xae);const Yae=[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]],a4=kt("kanban",Yae);const Jae=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],AW=kt("layers",Jae);const Zae=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Qae=kt("layout-grid",Zae);const ese=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],tse=kt("lock",ese);const nse=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],rse=kt("log-out",nse);const ise=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],dL=kt("map-pin",ise);const ase=[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]],Tx=kt("map-pinned",ase);const sse=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ose=kt("maximize-2",sse);const lse=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],cse=kt("message-square-plus",lse);const use=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],fse=kt("message-square-text",use);const dse=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],hse=kt("message-square",dse);const pse=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],mse=kt("mic",pse);const gse=[["path",{d:"M5 12h14",key:"1ays0h"}]],wW=kt("minus",gse);const vse=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],yse=kt("monitor",vse);const xse=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],kA=kt("phone",xse);const bse=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],_se=kt("power",bse);const Sse=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],MW=kt("refresh-cw",Sse);const Ase=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 9h.01",key:"x1ddxp"}]],hL=kt("scan-face",Ase);const wse=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],Mse=kt("scan",wse);const Ese=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Tse=kt("search",Ese);const Cse=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Rse=kt("send",Cse);const Ose=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Pse=kt("server",Ose);const Dse=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Nse=kt("settings-2",Dse);const Ise=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Bse=kt("shield",Ise);const Lse=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],kse=kt("sliders-vertical",Lse);const Fse=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],s4=kt("smartphone",Fse);const Use=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ON=kt("sparkles",Use);const jse=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],zse=kt("tag",jse);const Gse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],EW=kt("target",Gse);const Hse=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],TW=kt("trending-down",Hse);const Vse=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Jb=kt("trending-up",Vse);const Wse=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],PN=kt("triangle-alert",Wse);const qse=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],$se=kt("trophy",qse);const Xse=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],CW=kt("user",Xse);const Kse=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Cx=kt("users",Kse);const Yse=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],RW=kt("wifi",Yse);const Jse=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zse=kt("x",Jse);const Qse=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],eoe=kt("zap",Qse),toe=[{id:"dashboard",label:"Dashboard",icon:Qae},{id:"oracle",label:"The Oracle",icon:cse},{id:"sentinel",label:"The Sentinel",icon:hL},{id:"inventory",label:"Inventory",icon:Aae},{id:"settings",label:"Settings",icon:kse}];function noe(){const{activeModule:t,setActiveModule:e,sidebarExpanded:n,setSidebarExpanded:r,status:i}=ao();return M.jsxs(yt.aside,{"code-path":"src\\components\\layout\\Sidebar.tsx:25:5",className:"fixed left-0 top-0 h-screen z-50 flex flex-col overflow-hidden",initial:{width:72},animate:{width:n?232:72},transition:{type:"spring",stiffness:320,damping:32,mass:.8},onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[M.jsx("div",{"code-path":"src\\components\\layout\\Sidebar.tsx:34:7",className:"absolute inset-0",style:{background:"rgba(13, 14, 18, 0.65)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",borderRight:"1px solid rgba(255,255,255,0.07)"}}),M.jsxs("div",{"code-path":"src\\components\\layout\\Sidebar.tsx:45:7",className:"relative flex flex-col h-full py-5",children:[M.jsx("div",{"code-path":"src\\components\\layout\\Sidebar.tsx:48:9",className:"flex items-center px-4 mb-8 overflow-hidden",style:{height:36},children:M.jsxs(yt.div,{"code-path":"src\\components\\layout\\Sidebar.tsx:50:11",className:"overflow-hidden whitespace-nowrap",initial:{opacity:0,width:0},animate:{opacity:n?1:0,width:n?"auto":0},transition:{duration:.2},children:[M.jsx("p",{"code-path":"src\\components\\layout\\Sidebar.tsx:56:13",className:"font-bold text-white tracking-tight",style:{fontSize:18},children:"Velocity"}),M.jsx("p",{"code-path":"src\\components\\layout\\Sidebar.tsx:57:13",className:"text-[10px]",style:{color:"hsl(var(--muted-fg))"},children:"v.1.1"})]})}),M.jsx("nav",{"code-path":"src\\components\\layout\\Sidebar.tsx:63:9",className:"flex-1 px-3 space-y-1",children:toe.map(a=>{const s=a.icon,o=t===a.id;return M.jsxs(yt.button,{"code-path":"src\\components\\layout\\Sidebar.tsx:69:15",onClick:()=>e(a.id),className:"relative w-full flex items-center rounded-xl transition-colors duration-150",style:{height:44,background:o?"hsl(var(--accent) / 0.12)":"transparent",color:o?"hsl(var(--accent))":"hsl(var(--muted-fg))"},whileHover:{x:2},whileTap:{scale:.97},onHoverStart:c=>{o||(c.target.style.background="hsl(var(--surface-2))")},onHoverEnd:c=>{o||(c.target.style.background="transparent")},children:[o&&M.jsx(yt.div,{"code-path":"src\\components\\layout\\Sidebar.tsx:89:19",layoutId:"activeBar",className:"absolute left-0 top-2 bottom-2 w-0.5 rounded-full",style:{background:"hsl(var(--accent))"},transition:{type:"spring",stiffness:400,damping:30}}),M.jsx("div",{"code-path":"src\\components\\layout\\Sidebar.tsx:97:17",className:"w-11 flex justify-center flex-shrink-0",children:M.jsx(s,{"code-path":"src\\components\\layout\\Sidebar.tsx:98:19",className:"w-[18px] h-[18px]"})}),M.jsx(yt.span,{"code-path":"src\\components\\layout\\Sidebar.tsx:101:17",className:"whitespace-nowrap font-medium text-sm overflow-hidden",initial:{opacity:0},animate:{opacity:n?1:0},transition:{duration:.15,delay:n?.08:0},children:a.label})]},a.id)})}),M.jsx("div",{"code-path":"src\\components\\layout\\Sidebar.tsx:115:9",className:"px-4 pt-4",style:{borderTop:"1px solid hsl(var(--border-subtle))"},children:M.jsxs("div",{"code-path":"src\\components\\layout\\Sidebar.tsx:116:11",className:"flex items-center gap-3",children:[M.jsxs("div",{"code-path":"src\\components\\layout\\Sidebar.tsx:117:13",className:"relative flex-shrink-0",children:[M.jsx("div",{"code-path":"src\\components\\layout\\Sidebar.tsx:118:15",className:`w-2 h-2 rounded-full ${i.serverStatus==="online"?"bg-green-500":i.serverStatus==="offline"?"bg-red-500":"bg-amber-500"}`}),i.serverStatus==="online"&&M.jsx("div",{"code-path":"src\\components\\layout\\Sidebar.tsx:124:17",className:"absolute inset-0 rounded-full bg-green-500 status-pulse"})]}),M.jsx(Bs,{"code-path":"src\\components\\layout\\Sidebar.tsx:127:13",children:n&&M.jsxs(yt.div,{"code-path":"src\\components\\layout\\Sidebar.tsx:129:17",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[M.jsxs("p",{"code-path":"src\\components\\layout\\Sidebar.tsx:135:19",className:"text-xs whitespace-nowrap",style:{color:"hsl(var(--muted-fg))"},children:[i.serverStatus==="online"&&"Server Connected",i.serverStatus==="offline"&&"Server Offline",i.serverStatus==="syncing"&&"Syncing…"]}),M.jsxs("p",{"code-path":"src\\components\\layout\\Sidebar.tsx:140:19",className:"text-[10px] whitespace-nowrap",style:{color:"hsl(var(--subtle-fg))"},children:["v",i.version]})]})})]})})]})]})}function roe(){const{login:t}=ao(),[e,n]=j.useState("idle"),[r,i]=j.useState(!1),[a,s]=j.useState(""),[o,c]=j.useState(""),u=e!=="idle",h=()=>{n("scanning"),c(""),setTimeout(()=>{n("success")},2100),setTimeout(()=>{n("idle"),t({id:"1",name:"Ahmed Al-Farsi",role:"sales_director"})},2500)},p=v=>{v.preventDefault(),a==="admin"||a===""?t({id:"1",name:"Ahmed Al-Farsi",role:"sales_director"}):c("Invalid credentials")};return M.jsxs("div",{"code-path":"src\\components\\layout\\LoginScreen.tsx:47:5",className:"min-h-screen flex items-center justify-center relative overflow-hidden",style:{background:"hsl(var(--background))"},children:[M.jsx(yt.div,{"code-path":"src\\components\\layout\\LoginScreen.tsx:51:7",className:"absolute top-1/4 left-1/3 w-[500px] h-[500px] rounded-full blur-3xl pointer-events-none",style:{background:"hsl(var(--accent) / 0.06)"},animate:{scale:[1,1.15,1],opacity:[.5,.8,.5]},transition:{duration:9,repeat:1/0,ease:"easeInOut"}}),M.jsx(yt.div,{"code-path":"src\\components\\layout\\LoginScreen.tsx:57:7",className:"absolute bottom-1/4 right-1/3 w-96 h-96 rounded-full blur-3xl pointer-events-none",style:{background:"hsl(var(--info) / 0.07)"},animate:{scale:[1.15,1,1.15],opacity:[.4,.7,.4]},transition:{duration:9,repeat:1/0,ease:"easeInOut",delay:2}}),M.jsxs(yt.div,{"code-path":"src\\components\\layout\\LoginScreen.tsx:64:7",className:"relative z-10 w-full max-w-sm p-8 rounded-3xl",style:{background:"hsl(var(--surface))",border:"1px solid hsl(var(--border-subtle))",boxShadow:"var(--shadow-xl)"},initial:{opacity:0,y:24,scale:.96},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:220,damping:26,mass:.8},children:[M.jsx(yt.div,{"code-path":"src\\components\\layout\\LoginScreen.tsx:75:9",className:"flex justify-center mb-7",initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring",stiffness:300},children:M.jsx("div",{"code-path":"src\\components\\layout\\LoginScreen.tsx:81:11",className:"w-14 h-14 rounded-2xl flex items-center justify-center",style:{background:"hsl(var(--accent))",boxShadow:"0 0 32px hsl(var(--accent) / 0.35)"},children:M.jsx(Mse,{"code-path":"src\\components\\layout\\LoginScreen.tsx:88:13",className:"w-7 h-7",style:{color:"hsl(var(--accent-fg))"}})})}),M.jsxs(yt.div,{"code-path":"src\\components\\layout\\LoginScreen.tsx:92:9",className:"text-center mb-7",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},children:[M.jsx("h1",{"code-path":"src\\components\\layout\\LoginScreen.tsx:98:11",className:"text-xl font-bold text-white tracking-tight mb-1",children:"Velocity WebOS"}),M.jsx("p",{"code-path":"src\\components\\layout\\LoginScreen.tsx:99:11",className:"text-sm",style:{color:"hsl(var(--muted-fg))"},children:"Real Estate Operating System"})]}),M.jsx(Bs,{"code-path":"src\\components\\layout\\LoginScreen.tsx:102:9",mode:"wait",children:r?M.jsxs(yt.form,{"code-path":"src\\components\\layout\\LoginScreen.tsx:183:13",onSubmit:p,className:"space-y-3",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[M.jsxs("div",{"code-path":"src\\components\\layout\\LoginScreen.tsx:191:15",className:"relative",children:[M.jsx(tse,{"code-path":"src\\components\\layout\\LoginScreen.tsx:192:17",className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4",style:{color:"hsl(var(--muted-fg))"}}),M.jsx("input",{"code-path":"src\\components\\layout\\LoginScreen.tsx:196:17",type:"password",value:a,onChange:v=>s(v.target.value),placeholder:"Enter password",className:"w-full rounded-xl py-3 pl-10 pr-4 text-sm text-white placeholder:text-zinc-500 focus:outline-none transition-all",style:{background:"hsl(var(--surface-2))",border:"1px solid hsl(var(--border-subtle))"},autoFocus:!0})]}),o&&M.jsx(yt.p,{"code-path":"src\\components\\layout\\LoginScreen.tsx:211:17",className:"text-red-400 text-sm text-center",initial:{opacity:0,y:-8},animate:{opacity:1,y:0},children:o}),M.jsx("button",{"code-path":"src\\components\\layout\\LoginScreen.tsx:220:15",type:"submit",className:"w-full font-semibold py-3 rounded-xl transition-opacity hover:opacity-90 text-sm",style:{background:"hsl(var(--accent))",color:"hsl(var(--accent-fg))"},children:"Sign In"}),M.jsx("button",{"code-path":"src\\components\\layout\\LoginScreen.tsx:231:15",type:"button",onClick:()=>{i(!1),c("")},className:"w-full text-sm transition-colors py-1",style:{color:"hsl(var(--subtle-fg))"},children:"Back to FaceID"})]},"password"):M.jsxs(yt.div,{"code-path":"src\\components\\layout\\LoginScreen.tsx:104:13",className:"flex flex-col items-center",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[M.jsxs(yt.button,{"code-path":"src\\components\\layout\\LoginScreen.tsx:111:15",onClick:h,disabled:u,className:"relative w-28 h-28 rounded-full flex items-center justify-center mb-5 transition-colors",style:{border:"2px solid hsl(var(--border))"},whileHover:{scale:1.03,borderColor:"hsl(var(--accent) / 0.5)"},whileTap:{scale:.97},children:[u&&M.jsxs(M.Fragment,{children:[M.jsx(yt.div,{"code-path":"src\\components\\layout\\LoginScreen.tsx:121:21",className:"absolute inset-0 rounded-full",style:{border:`2px solid ${e==="success"?"hsl(var(--success))":"hsl(var(--accent))"}`,boxShadow:e==="success"?"0 0 26px rgba(34,197,94,0.8), 0 0 58px rgba(34,197,94,0.45), inset 0 0 16px rgba(34,197,94,0.3)":"0 0 32px rgba(59,130,246,0.95), 0 0 86px rgba(59,130,246,0.6), 0 0 140px rgba(59,130,246,0.35), inset 0 0 24px rgba(59,130,246,0.25)"},animate:{scale:[1,1.08,1],opacity:[.86,1,.86]},transition:{duration:e==="success"?.35:1.05,repeat:e==="success"?0:1/0,ease:"easeInOut"}}),M.jsx(yt.div,{"code-path":"src\\components\\layout\\LoginScreen.tsx:137:21",className:"absolute -inset-2 rounded-full",style:{background:e==="success"?"radial-gradient(circle, rgba(34,197,94,0.22) 0%, rgba(34,197,94,0.08) 38%, transparent 72%)":"radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(59,130,246,0.12) 40%, transparent 72%)",filter:"blur(10px)"},animate:{opacity:[.65,1,.65]},transition:{duration:1.2,repeat:1/0,ease:"easeInOut"}})]}),M.jsx(CW,{"code-path":"src\\components\\layout\\LoginScreen.tsx:151:17",className:"w-10 h-10 transition-colors",style:{color:e==="success"?"hsl(var(--success))":u?"hsl(var(--accent))":"hsl(var(--muted-fg))"}})]}),M.jsx("p",{"code-path":"src\\components\\layout\\LoginScreen.tsx:164:15",className:"text-sm mb-5",style:{color:"hsl(var(--muted-fg))"},children:e==="success"?"Face verified":u?"Scanning...":"Tap to authenticate with FaceID"}),M.jsx("button",{"code-path":"src\\components\\layout\\LoginScreen.tsx:172:15",onClick:()=>i(!0),className:"text-sm transition-colors",style:{color:"hsl(var(--subtle-fg))"},onMouseEnter:v=>v.currentTarget.style.color="hsl(var(--muted-fg))",onMouseLeave:v=>v.currentTarget.style.color="hsl(var(--subtle-fg))",children:"Use password instead"})]},"faceid")}),M.jsx(yt.p,{"code-path":"src\\components\\layout\\LoginScreen.tsx:243:9",className:"mt-7 text-center text-xs",style:{color:"hsl(var(--subtle-fg))"},initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:"Secured by On-Premise Python Backend"})]})]})}function OW(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=OW(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function In(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=OW(t))&&(r&&(r+=" "),r+=e);return r}var kC,o4;function ks(){if(o4)return kC;o4=1;var t=Array.isArray;return kC=t,kC}var FC,l4;function PW(){if(l4)return FC;l4=1;var t=typeof cS=="object"&&cS&&cS.Object===Object&&cS;return FC=t,FC}var UC,c4;function Kc(){if(c4)return UC;c4=1;var t=PW(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return UC=n,UC}var jC,u4;function Zb(){if(u4)return jC;u4=1;var t=Kc(),e=t.Symbol;return jC=e,jC}var zC,f4;function ioe(){if(f4)return zC;f4=1;var t=Zb(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;function a(s){var o=n.call(s,i),c=s[i];try{s[i]=void 0;var u=!0}catch{}var h=r.call(s);return u&&(o?s[i]=c:delete s[i]),h}return zC=a,zC}var GC,d4;function aoe(){if(d4)return GC;d4=1;var t=Object.prototype,e=t.toString;function n(r){return e.call(r)}return GC=n,GC}var HC,h4;function uf(){if(h4)return HC;h4=1;var t=Zb(),e=ioe(),n=aoe(),r="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function s(o){return o==null?o===void 0?i:r:a&&a in Object(o)?e(o):n(o)}return HC=s,HC}var VC,p4;function ff(){if(p4)return VC;p4=1;function t(e){return e!=null&&typeof e=="object"}return VC=t,VC}var WC,m4;function $v(){if(m4)return WC;m4=1;var t=uf(),e=ff(),n="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&t(i)==n}return WC=r,WC}var qC,g4;function pL(){if(g4)return qC;g4=1;var t=ks(),e=$v(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,s){if(t(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||e(a)?!0:r.test(a)||!n.test(a)||s!=null&&a in Object(s)}return qC=i,qC}var $C,v4;function Ld(){if(v4)return $C;v4=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return $C=t,$C}var XC,y4;function mL(){if(y4)return XC;y4=1;var t=uf(),e=Ld(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!e(o))return!1;var c=t(o);return c==r||c==i||c==n||c==a}return XC=s,XC}var KC,x4;function soe(){if(x4)return KC;x4=1;var t=Kc(),e=t["__core-js_shared__"];return KC=e,KC}var YC,b4;function ooe(){if(b4)return YC;b4=1;var t=soe(),e=(function(){var r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!e&&e in r}return YC=n,YC}var JC,_4;function DW(){if(_4)return JC;_4=1;var t=Function.prototype,e=t.toString;function n(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return JC=n,JC}var ZC,S4;function loe(){if(S4)return ZC;S4=1;var t=mL(),e=ooe(),n=Ld(),r=DW(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,c=s.toString,u=o.hasOwnProperty,h=RegExp("^"+c.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(v){if(!n(v)||e(v))return!1;var y=t(v)?h:a;return y.test(r(v))}return ZC=p,ZC}var QC,A4;function coe(){if(A4)return QC;A4=1;function t(e,n){return e?.[n]}return QC=t,QC}var eR,w4;function kp(){if(w4)return eR;w4=1;var t=loe(),e=coe();function n(r,i){var a=e(r,i);return t(a)?a:void 0}return eR=n,eR}var tR,M4;function uE(){if(M4)return tR;M4=1;var t=kp(),e=t(Object,"create");return tR=e,tR}var nR,E4;function uoe(){if(E4)return nR;E4=1;var t=uE();function e(){this.__data__=t?t(null):{},this.size=0}return nR=e,nR}var rR,T4;function foe(){if(T4)return rR;T4=1;function t(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}return rR=t,rR}var iR,C4;function doe(){if(C4)return iR;C4=1;var t=uE(),e="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(a){var s=this.__data__;if(t){var o=s[a];return o===e?void 0:o}return r.call(s,a)?s[a]:void 0}return iR=i,iR}var aR,R4;function hoe(){if(R4)return aR;R4=1;var t=uE(),e=Object.prototype,n=e.hasOwnProperty;function r(i){var a=this.__data__;return t?a[i]!==void 0:n.call(a,i)}return aR=r,aR}var sR,O4;function poe(){if(O4)return sR;O4=1;var t=uE(),e="__lodash_hash_undefined__";function n(r,i){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=t&&i===void 0?e:i,this}return sR=n,sR}var oR,P4;function moe(){if(P4)return oR;P4=1;var t=uoe(),e=foe(),n=doe(),r=hoe(),i=poe();function a(s){var o=-1,c=s==null?0:s.length;for(this.clear();++o<c;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,oR=a,oR}var lR,D4;function goe(){if(D4)return lR;D4=1;function t(){this.__data__=[],this.size=0}return lR=t,lR}var cR,N4;function gL(){if(N4)return cR;N4=1;function t(e,n){return e===n||e!==e&&n!==n}return cR=t,cR}var uR,I4;function fE(){if(I4)return uR;I4=1;var t=gL();function e(n,r){for(var i=n.length;i--;)if(t(n[i][0],r))return i;return-1}return uR=e,uR}var fR,B4;function voe(){if(B4)return fR;B4=1;var t=fE(),e=Array.prototype,n=e.splice;function r(i){var a=this.__data__,s=t(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():n.call(a,s,1),--this.size,!0}return fR=r,fR}var dR,L4;function yoe(){if(L4)return dR;L4=1;var t=fE();function e(n){var r=this.__data__,i=t(r,n);return i<0?void 0:r[i][1]}return dR=e,dR}var hR,k4;function xoe(){if(k4)return hR;k4=1;var t=fE();function e(n){return t(this.__data__,n)>-1}return hR=e,hR}var pR,F4;function boe(){if(F4)return pR;F4=1;var t=fE();function e(n,r){var i=this.__data__,a=t(i,n);return a<0?(++this.size,i.push([n,r])):i[a][1]=r,this}return pR=e,pR}var mR,U4;function dE(){if(U4)return mR;U4=1;var t=goe(),e=voe(),n=yoe(),r=xoe(),i=boe();function a(s){var o=-1,c=s==null?0:s.length;for(this.clear();++o<c;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,mR=a,mR}var gR,j4;function vL(){if(j4)return gR;j4=1;var t=kp(),e=Kc(),n=t(e,"Map");return gR=n,gR}var vR,z4;function _oe(){if(z4)return vR;z4=1;var t=moe(),e=dE(),n=vL();function r(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}return vR=r,vR}var yR,G4;function Soe(){if(G4)return yR;G4=1;function t(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}return yR=t,yR}var xR,H4;function hE(){if(H4)return xR;H4=1;var t=Soe();function e(n,r){var i=n.__data__;return t(r)?i[typeof r=="string"?"string":"hash"]:i.map}return xR=e,xR}var bR,V4;function Aoe(){if(V4)return bR;V4=1;var t=hE();function e(n){var r=t(this,n).delete(n);return this.size-=r?1:0,r}return bR=e,bR}var _R,W4;function woe(){if(W4)return _R;W4=1;var t=hE();function e(n){return t(this,n).get(n)}return _R=e,_R}var SR,q4;function Moe(){if(q4)return SR;q4=1;var t=hE();function e(n){return t(this,n).has(n)}return SR=e,SR}var AR,$4;function Eoe(){if($4)return AR;$4=1;var t=hE();function e(n,r){var i=t(this,n),a=i.size;return i.set(n,r),this.size+=i.size==a?0:1,this}return AR=e,AR}var wR,X4;function yL(){if(X4)return wR;X4=1;var t=_oe(),e=Aoe(),n=woe(),r=Moe(),i=Eoe();function a(s){var o=-1,c=s==null?0:s.length;for(this.clear();++o<c;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,wR=a,wR}var MR,K4;function NW(){if(K4)return MR;K4=1;var t=yL(),e="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],c=a.cache;if(c.has(o))return c.get(o);var u=r.apply(this,s);return a.cache=c.set(o,u)||c,u};return a.cache=new(n.Cache||t),a}return n.Cache=t,MR=n,MR}var ER,Y4;function Toe(){if(Y4)return ER;Y4=1;var t=NW(),e=500;function n(r){var i=t(r,function(s){return a.size===e&&a.clear(),s}),a=i.cache;return i}return ER=n,ER}var TR,J4;function Coe(){if(J4)return TR;J4=1;var t=Toe(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(s,o,c,u){a.push(c?u.replace(n,"$1"):o||s)}),a});return TR=r,TR}var CR,Z4;function xL(){if(Z4)return CR;Z4=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,a=Array(i);++r<i;)a[r]=n(e[r],r,e);return a}return CR=t,CR}var RR,Q4;function Roe(){if(Q4)return RR;Q4=1;var t=Zb(),e=xL(),n=ks(),r=$v(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(n(o))return e(o,s)+"";if(r(o))return a?a.call(o):"";var c=o+"";return c=="0"&&1/o==-1/0?"-0":c}return RR=s,RR}var OR,eU;function IW(){if(eU)return OR;eU=1;var t=Roe();function e(n){return n==null?"":t(n)}return OR=e,OR}var PR,tU;function BW(){if(tU)return PR;tU=1;var t=ks(),e=pL(),n=Coe(),r=IW();function i(a,s){return t(a)?a:e(a,s)?[a]:n(r(a))}return PR=i,PR}var DR,nU;function pE(){if(nU)return DR;nU=1;var t=$v();function e(n){if(typeof n=="string"||t(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return DR=e,DR}var NR,rU;function bL(){if(rU)return NR;rU=1;var t=BW(),e=pE();function n(r,i){i=t(i,r);for(var a=0,s=i.length;r!=null&&a<s;)r=r[e(i[a++])];return a&&a==s?r:void 0}return NR=n,NR}var IR,iU;function LW(){if(iU)return IR;iU=1;var t=bL();function e(n,r,i){var a=n==null?void 0:t(n,r);return a===void 0?i:a}return IR=e,IR}var Ooe=LW();const Ho=ar(Ooe);var BR,aU;function Poe(){if(aU)return BR;aU=1;function t(e){return e==null}return BR=t,BR}var Doe=Poe();const Cn=ar(Doe);var LR,sU;function Noe(){if(sU)return LR;sU=1;var t=uf(),e=ks(),n=ff(),r="[object String]";function i(a){return typeof a=="string"||!e(a)&&n(a)&&t(a)==r}return LR=i,LR}var Ioe=Noe();const Sp=ar(Ioe);var Boe=mL();const yn=ar(Boe);var Loe=Ld();const Xv=ar(Loe);var kR={exports:{}},nr={};var oU;function koe(){if(oU)return nr;oU=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function w(_){if(typeof _=="object"&&_!==null){var S=_.$$typeof;switch(S){case t:switch(_=_.type,_){case n:case i:case r:case u:case h:return _;default:switch(_=_&&_.$$typeof,_){case o:case s:case c:case v:case p:case a:return _;default:return S}}case e:return S}}}return nr.ContextConsumer=s,nr.ContextProvider=a,nr.Element=t,nr.ForwardRef=c,nr.Fragment=n,nr.Lazy=v,nr.Memo=p,nr.Portal=e,nr.Profiler=i,nr.StrictMode=r,nr.Suspense=u,nr.SuspenseList=h,nr.isAsyncMode=function(){return!1},nr.isConcurrentMode=function(){return!1},nr.isContextConsumer=function(_){return w(_)===s},nr.isContextProvider=function(_){return w(_)===a},nr.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===t},nr.isForwardRef=function(_){return w(_)===c},nr.isFragment=function(_){return w(_)===n},nr.isLazy=function(_){return w(_)===v},nr.isMemo=function(_){return w(_)===p},nr.isPortal=function(_){return w(_)===e},nr.isProfiler=function(_){return w(_)===i},nr.isStrictMode=function(_){return w(_)===r},nr.isSuspense=function(_){return w(_)===u},nr.isSuspenseList=function(_){return w(_)===h},nr.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===n||_===i||_===r||_===u||_===h||_===y||typeof _=="object"&&_!==null&&(_.$$typeof===v||_.$$typeof===p||_.$$typeof===a||_.$$typeof===s||_.$$typeof===c||_.$$typeof===b||_.getModuleId!==void 0)},nr.typeOf=w,nr}var lU;function Foe(){return lU||(lU=1,kR.exports=koe()),kR.exports}var Uoe=Foe(),FR,cU;function kW(){if(cU)return FR;cU=1;var t=uf(),e=ff(),n="[object Number]";function r(i){return typeof i=="number"||e(i)&&t(i)==n}return FR=r,FR}var UR,uU;function joe(){if(uU)return UR;uU=1;var t=kW();function e(n){return t(n)&&n!=+n}return UR=e,UR}var zoe=joe();const Kv=ar(zoe);var Goe=kW();const Hoe=ar(Goe);var Il=function(e){return e===0?0:e>0?1:-1},rp=function(e){return Sp(e)&&e.indexOf("%")===e.length-1},mt=function(e){return Hoe(e)&&!Kv(e)},Voe=function(e){return Cn(e)},ji=function(e){return mt(e)||Sp(e)},Woe=0,Yv=function(e){var n=++Woe;return"".concat(e||"").concat(n)},Ap=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!mt(e)&&!Sp(e))return r;var a;if(rp(e)){var s=e.indexOf("%");a=n*parseFloat(e.slice(0,s))/100}else a=+e;return Kv(a)&&(a=r),i&&a>n&&(a=n),a},gd=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},qoe=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i<n;i++)if(!r[e[i]])r[e[i]]=!0;else return!0;return!1},ha=function(e,n){return mt(e)&&mt(n)?function(r){return e+r*(n-e)}:function(){return n}};function QA(t,e,n){return!t||!t.length?null:t.find(function(r){return r&&(typeof e=="function"?e(r):Ho(r,e))===n})}var $oe=function(e,n){return mt(e)&&mt(n)?e-n:Sp(e)&&Sp(n)?e.localeCompare(n):e instanceof Date&&n instanceof Date?e.getTime()-n.getTime():String(e).localeCompare(String(n))};function Wg(t,e){for(var n in t)if({}.hasOwnProperty.call(t,n)&&(!{}.hasOwnProperty.call(e,n)||t[n]!==e[n]))return!1;for(var r in e)if({}.hasOwnProperty.call(e,r)&&!{}.hasOwnProperty.call(t,r))return!1;return!0}function DN(t){"@babel/helpers - typeof";return DN=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},DN(t)}var Xoe=["viewBox","children"],Koe=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],fU=["points","pathLength"],jR={svg:Xoe,polygon:fU,polyline:fU},_L=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],ew=function(e,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(j.isValidElement(e)&&(r=e.props),!Xv(r))return null;var i={};return Object.keys(r).forEach(function(a){_L.includes(a)&&(i[a]=n||function(s){return r[a](r,s)})}),i},Yoe=function(e,n,r){return function(i){return e(n,r,i),null}},tw=function(e,n,r){if(!Xv(e)||DN(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var s=e[a];_L.includes(a)&&typeof s=="function"&&(i||(i={}),i[a]=Yoe(s,n,r))}),i},Joe=["children"],Zoe=["children"];function dU(t,e){if(t==null)return{};var n=Qoe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Qoe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function NN(t){"@babel/helpers - typeof";return NN=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},NN(t)}var hU={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Xu=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},pU=null,zR=null,SL=function t(e){if(e===pU&&Array.isArray(zR))return zR;var n=[];return j.Children.forEach(e,function(r){Cn(r)||(Uoe.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),zR=n,pU=e,n};function Vo(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Xu(i)}):r=[Xu(e)],SL(t).forEach(function(i){var a=Ho(i,"type.displayName")||Ho(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Ks(t,e){var n=Vo(t,e);return n&&n[0]}var mU=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!mt(r)||r<=0||!mt(i)||i<=0)},ele=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],tle=function(e){return e&&e.type&&Sp(e.type)&&ele.indexOf(e.type)>=0},FW=function(e){return e&&NN(e)==="object"&&"clipDot"in e},nle=function(e,n,r,i){var a,s=(a=jR?.[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!yn(e)&&(i&&s.includes(n)||Koe.includes(n))||r&&_L.includes(n)},_n=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(j.isValidElement(e)&&(i=e.props),!Xv(i))return null;var a={};return Object.keys(i).forEach(function(s){var o;nle((o=i)===null||o===void 0?void 0:o[s],s,n,r)&&(a[s]=i[s])}),a},IN=function t(e,n){if(e===n)return!0;var r=j.Children.count(e);if(r!==j.Children.count(n))return!1;if(r===0)return!0;if(r===1)return gU(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=e[i],s=n[i];if(Array.isArray(a)||Array.isArray(s)){if(!t(a,s))return!1}else if(!gU(a,s))return!1}return!0},gU=function(e,n){if(Cn(e)&&Cn(n))return!0;if(!Cn(e)&&!Cn(n)){var r=e.props||{},i=r.children,a=dU(r,Joe),s=n.props||{},o=s.children,c=dU(s,Zoe);return i&&o?Wg(a,c)&&IN(i,o):!i&&!o?Wg(a,c):!1}return!1},vU=function(e,n){var r=[],i={};return SL(e).forEach(function(a,s){if(tle(a))r.push(a);else if(a){var o=Xu(a.type),c=n[o]||{},u=c.handler,h=c.once;if(u&&(!h||!i[o])){var p=u(a,o,s);r.push(p),i[o]=!0}}}),r},rle=function(e){var n=e&&e.type;return n&&hU[n]?hU[n]:null},ile=function(e,n){return SL(n).indexOf(e)},ale=["children","width","height","viewBox","className","style","title","desc"];function BN(){return BN=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},BN.apply(this,arguments)}function sle(t,e){if(t==null)return{};var n=ole(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ole(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function LN(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,a=t.className,s=t.style,o=t.title,c=t.desc,u=sle(t,ale),h=i||{width:n,height:r,x:0,y:0},p=In("recharts-surface",a);return fe.createElement("svg",BN({},_n(u,!0,"svg"),{className:p,width:n,height:r,style:s,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),fe.createElement("title",null,o),fe.createElement("desc",null,c),e)}var lle=["children","className"];function kN(){return kN=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},kN.apply(this,arguments)}function cle(t,e){if(t==null)return{};var n=ule(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ule(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var Ar=fe.forwardRef(function(t,e){var n=t.children,r=t.className,i=cle(t,lle),a=In("recharts-layer",r);return fe.createElement("g",kN({className:a},_n(i,!0),{ref:e}),n)}),Ku=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a]},GR,yU;function fle(){if(yU)return GR;yU=1;function t(e,n,r){var i=-1,a=e.length;n<0&&(n=-n>a?0:a+n),r=r>a?a:r,r<0&&(r+=a),a=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(a);++i<a;)s[i]=e[i+n];return s}return GR=t,GR}var HR,xU;function dle(){if(xU)return HR;xU=1;var t=fle();function e(n,r,i){var a=n.length;return i=i===void 0?a:i,!r&&i>=a?n:t(n,r,i)}return HR=e,HR}var VR,bU;function UW(){if(bU)return VR;bU=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+n+r,a="\\ufe0e\\ufe0f",s="\\u200d",o=RegExp("["+s+t+i+a+"]");function c(u){return o.test(u)}return VR=c,VR}var WR,_U;function hle(){if(_U)return WR;_U=1;function t(e){return e.split("")}return WR=t,WR}var qR,SU;function ple(){if(SU)return qR;SU=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+n+r,a="\\ufe0e\\ufe0f",s="["+t+"]",o="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+o+"|"+c+")",h="[^"+t+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",b=u+"?",w="["+a+"]?",_="(?:"+y+"(?:"+[h,p,v].join("|")+")"+w+b+")*",S=w+b+_,E="(?:"+[h+o+"?",o,p,v,s].join("|")+")",T=RegExp(c+"(?="+c+")|"+E+S,"g");function P(R){return R.match(T)||[]}return qR=P,qR}var $R,AU;function mle(){if(AU)return $R;AU=1;var t=hle(),e=UW(),n=ple();function r(i){return e(i)?n(i):t(i)}return $R=r,$R}var XR,wU;function gle(){if(wU)return XR;wU=1;var t=dle(),e=UW(),n=mle(),r=IW();function i(a){return function(s){s=r(s);var o=e(s)?n(s):void 0,c=o?o[0]:s.charAt(0),u=o?t(o,1).join(""):s.slice(1);return c[a]()+u}}return XR=i,XR}var KR,MU;function vle(){if(MU)return KR;MU=1;var t=gle(),e=t("toUpperCase");return KR=e,KR}var yle=vle();const mE=ar(yle);function Sr(t){return function(){return t}}const jW=Math.cos,nw=Math.sin,Gl=Math.sqrt,rw=Math.PI,gE=2*rw,FN=Math.PI,UN=2*FN,Yh=1e-6,xle=UN-Yh;function zW(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function ble(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return zW;const n=10**e;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let _le=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?zW:ble(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,a,s){this._append`C${+e},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,n,r,i,a){if(e=+e,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,c=r-e,u=i-n,h=s-e,p=o-n,v=h*h+p*p;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(v>Yh)if(!(Math.abs(p*c-u*h)>Yh)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let y=r-s,b=i-o,w=c*c+u*u,_=y*y+b*b,S=Math.sqrt(w),E=Math.sqrt(v),T=a*Math.tan((FN-Math.acos((w+v-_)/(2*S*E)))/2),P=T/E,R=T/S;Math.abs(P-1)>Yh&&this._append`L${e+P*h},${n+P*p}`,this._append`A${a},${a},0,0,${+(p*y>h*b)},${this._x1=e+R*c},${this._y1=n+R*u}`}}arc(e,n,r,i,a,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),c=r*Math.sin(i),u=e+o,h=n+c,p=1^s,v=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Yh||Math.abs(this._y1-h)>Yh)&&this._append`L${u},${h}`,r&&(v<0&&(v=v%UN+UN),v>xle?this._append`A${r},${r},0,1,${p},${e-o},${n-c}A${r},${r},0,1,${p},${this._x1=u},${this._y1=h}`:v>Yh&&this._append`A${r},${r},0,${+(v>=FN)},${p},${this._x1=e+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function AL(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new _le(e)}function wL(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function GW(t){this._context=t}GW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function vE(t){return new GW(t)}function HW(t){return t[0]}function VW(t){return t[1]}function WW(t,e){var n=Sr(!0),r=null,i=vE,a=null,s=AL(o);t=typeof t=="function"?t:t===void 0?HW:Sr(t),e=typeof e=="function"?e:e===void 0?VW:Sr(e);function o(c){var u,h=(c=wL(c)).length,p,v=!1,y;for(r==null&&(a=i(y=s())),u=0;u<=h;++u)!(u<h&&n(p=c[u],u,c))===v&&((v=!v)?a.lineStart():a.lineEnd()),v&&a.point(+t(p,u,c),+e(p,u,c));if(y)return a=null,y+""||null}return o.x=function(c){return arguments.length?(t=typeof c=="function"?c:Sr(+c),o):t},o.y=function(c){return arguments.length?(e=typeof c=="function"?c:Sr(+c),o):e},o.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Sr(!!c),o):n},o.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),o):i},o.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),o):r},o}function pS(t,e,n){var r=null,i=Sr(!0),a=null,s=vE,o=null,c=AL(u);t=typeof t=="function"?t:t===void 0?HW:Sr(+t),e=typeof e=="function"?e:Sr(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?VW:Sr(+n);function u(p){var v,y,b,w=(p=wL(p)).length,_,S=!1,E,T=new Array(w),P=new Array(w);for(a==null&&(o=s(E=c())),v=0;v<=w;++v){if(!(v<w&&i(_=p[v],v,p))===S)if(S=!S)y=v,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),b=v-1;b>=y;--b)o.point(T[b],P[b]);o.lineEnd(),o.areaEnd()}S&&(T[v]=+t(_,v,p),P[v]=+e(_,v,p),o.point(r?+r(_,v,p):T[v],n?+n(_,v,p):P[v]))}if(E)return o=null,E+""||null}function h(){return WW().defined(i).curve(s).context(a)}return u.x=function(p){return arguments.length?(t=typeof p=="function"?p:Sr(+p),r=null,u):t},u.x0=function(p){return arguments.length?(t=typeof p=="function"?p:Sr(+p),u):t},u.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Sr(+p),u):r},u.y=function(p){return arguments.length?(e=typeof p=="function"?p:Sr(+p),n=null,u):e},u.y0=function(p){return arguments.length?(e=typeof p=="function"?p:Sr(+p),u):e},u.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Sr(+p),u):n},u.lineX0=u.lineY0=function(){return h().x(t).y(e)},u.lineY1=function(){return h().x(t).y(n)},u.lineX1=function(){return h().x(r).y(e)},u.defined=function(p){return arguments.length?(i=typeof p=="function"?p:Sr(!!p),u):i},u.curve=function(p){return arguments.length?(s=p,a!=null&&(o=s(a)),u):s},u.context=function(p){return arguments.length?(p==null?a=o=null:o=s(a=p),u):a},u}class qW{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Sle(t){return new qW(t,!0)}function Ale(t){return new qW(t,!1)}const ML={draw(t,e){const n=Gl(e/rw);t.moveTo(n,0),t.arc(0,0,n,0,gE)}},wle={draw(t,e){const n=Gl(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},$W=Gl(1/3),Mle=$W*2,Ele={draw(t,e){const n=Gl(e/Mle),r=n*$W;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Tle={draw(t,e){const n=Gl(e),r=-n/2;t.rect(r,r,n,n)}},Cle=.8908130915292852,XW=nw(rw/10)/nw(7*rw/10),Rle=nw(gE/10)*XW,Ole=-jW(gE/10)*XW,Ple={draw(t,e){const n=Gl(e*Cle),r=Rle*n,i=Ole*n;t.moveTo(0,-n),t.lineTo(r,i);for(let a=1;a<5;++a){const s=gE*a/5,o=jW(s),c=nw(s);t.lineTo(c*n,-o*n),t.lineTo(o*r-c*i,c*r+o*i)}t.closePath()}},YR=Gl(3),Dle={draw(t,e){const n=-Gl(e/(YR*3));t.moveTo(0,n*2),t.lineTo(-YR*n,-n),t.lineTo(YR*n,-n),t.closePath()}},Do=-.5,No=Gl(3)/2,jN=1/Gl(12),Nle=(jN/2+1)*3,Ile={draw(t,e){const n=Gl(e/Nle),r=n/2,i=n*jN,a=r,s=n*jN+n,o=-a,c=s;t.moveTo(r,i),t.lineTo(a,s),t.lineTo(o,c),t.lineTo(Do*r-No*i,No*r+Do*i),t.lineTo(Do*a-No*s,No*a+Do*s),t.lineTo(Do*o-No*c,No*o+Do*c),t.lineTo(Do*r+No*i,Do*i-No*r),t.lineTo(Do*a+No*s,Do*s-No*a),t.lineTo(Do*o+No*c,Do*c-No*o),t.closePath()}};function Ble(t,e){let n=null,r=AL(i);t=typeof t=="function"?t:Sr(t||ML),e=typeof e=="function"?e:Sr(e===void 0?64:+e);function i(){let a;if(n||(n=a=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(t=typeof a=="function"?a:Sr(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:Sr(+a),i):e},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function iw(){}function aw(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function KW(t){this._context=t}KW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:aw(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:aw(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Lle(t){return new KW(t)}function YW(t){this._context=t}YW.prototype={areaStart:iw,areaEnd:iw,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:aw(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function kle(t){return new YW(t)}function JW(t){this._context=t}JW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:aw(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Fle(t){return new JW(t)}function ZW(t){this._context=t}ZW.prototype={areaStart:iw,areaEnd:iw,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Ule(t){return new ZW(t)}function EU(t){return t<0?-1:1}function TU(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(EU(a)+EU(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function CU(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function JR(t,e,n){var r=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-r)/3;t._context.bezierCurveTo(r+o,i+o*e,a-o,s-o*n,a,s)}function sw(t){this._context=t}sw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:JR(this,this._t0,CU(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,JR(this,CU(this,n=TU(this,t,e)),n);break;default:JR(this,this._t0,n=TU(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function QW(t){this._context=new eq(t)}(QW.prototype=Object.create(sw.prototype)).point=function(t,e){sw.prototype.point.call(this,e,t)};function eq(t){this._context=t}eq.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}};function jle(t){return new sw(t)}function zle(t){return new QW(t)}function tq(t){this._context=t}tq.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=RU(t),i=RU(e),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],t[s],e[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function RU(t){var e,n=t.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/a[e-1],a[e]-=r,s[e]-=r*s[e-1];for(i[n-1]=s[n-1]/a[n-1],e=n-2;e>=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function Gle(t){return new tq(t)}function yE(t,e){this._context=t,this._t=e}yE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Hle(t){return new yE(t,.5)}function Vle(t){return new yE(t,0)}function Wle(t){return new yE(t,1)}function rv(t,e){if((s=t.length)>1)for(var n=1,r,i,a=t[e[0]],s,o=a.length;n<s;++n)for(i=a,a=t[e[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function zN(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function qle(t,e){return t[e]}function $le(t){const e=[];return e.key=t,e}function Xle(){var t=Sr([]),e=zN,n=rv,r=qle;function i(a){var s=Array.from(t.apply(this,arguments),$le),o,c=s.length,u=-1,h;for(const p of a)for(o=0,++u;o<c;++o)(s[o][u]=[0,+r(p,s[o].key,u,a)]).data=p;for(o=0,h=wL(e(s));o<c;++o)s[h[o]].index=o;return n(s,h),s}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:Sr(Array.from(a)),i):t},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Sr(+a),i):r},i.order=function(a){return arguments.length?(e=a==null?zN:typeof a=="function"?a:Sr(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(n=a??rv,i):n},i}function Kle(t,e){if((r=t.length)>0){for(var n,r,i=0,a=t[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=t[n][i][1]||0;if(s)for(n=0;n<r;++n)t[n][i][1]/=s}rv(t,e)}}function Yle(t,e){if((i=t.length)>0){for(var n=0,r=t[e[0]],i,a=r.length;n<a;++n){for(var s=0,o=0;s<i;++s)o+=t[s][n][1]||0;r[n][1]+=r[n][0]=-o/2}rv(t,e)}}function Jle(t,e){if(!(!((s=t.length)>0)||!((a=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var o=0,c=0,u=0;o<s;++o){for(var h=t[e[o]],p=h[r][1]||0,v=h[r-1][1]||0,y=(p-v)/2,b=0;b<o;++b){var w=t[e[b]],_=w[r][1]||0,S=w[r-1][1]||0;y+=_-S}c+=p,u+=y*p}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,rv(t,e)}}function Xx(t){"@babel/helpers - typeof";return Xx=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},Xx(t)}var Zle=["type","size","sizeType"];function GN(){return GN=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},GN.apply(this,arguments)}function OU(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function PU(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?OU(Object(n),!0).forEach(function(r){Qle(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):OU(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Qle(t,e,n){return e=ece(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ece(t){var e=tce(t,"string");return Xx(e)=="symbol"?e:e+""}function tce(t,e){if(Xx(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Xx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nce(t,e){if(t==null)return{};var n=rce(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function rce(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var nq={symbolCircle:ML,symbolCross:wle,symbolDiamond:Ele,symbolSquare:Tle,symbolStar:Ple,symbolTriangle:Dle,symbolWye:Ile},ice=Math.PI/180,ace=function(e){var n="symbol".concat(mE(e));return nq[n]||ML},sce=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*ice;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},oce=function(e,n){nq["symbol".concat(mE(e))]=n},EL=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,a=i===void 0?64:i,s=e.sizeType,o=s===void 0?"area":s,c=nce(e,Zle),u=PU(PU({},c),{},{type:r,size:a,sizeType:o}),h=function(){var _=ace(r),S=Ble().type(_).size(sce(a,o,r));return S()},p=u.className,v=u.cx,y=u.cy,b=_n(u,!0);return v===+v&&y===+y&&a===+a?fe.createElement("path",GN({},b,{className:In("recharts-symbols",p),transform:"translate(".concat(v,", ").concat(y,")"),d:h()})):null};EL.registerSymbol=oce;function iv(t){"@babel/helpers - typeof";return iv=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},iv(t)}function HN(){return HN=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},HN.apply(this,arguments)}function DU(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function lce(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?DU(Object(n),!0).forEach(function(r){Kx(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):DU(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function cce(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uce(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,iq(r.key),r)}}function fce(t,e,n){return e&&uce(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function dce(t,e,n){return e=ow(e),hce(t,rq()?Reflect.construct(e,n||[],ow(t).constructor):e.apply(t,n))}function hce(t,e){if(e&&(iv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pce(t)}function pce(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rq(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rq=function(){return!!t})()}function ow(t){return ow=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ow(t)}function mce(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&VN(t,e)}function VN(t,e){return VN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},VN(t,e)}function Kx(t,e,n){return e=iq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iq(t){var e=gce(t,"string");return iv(e)=="symbol"?e:e+""}function gce(t,e){if(iv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(iv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Io=32,TL=(function(t){function e(){return cce(this,e),dce(this,e,arguments)}return mce(e,t),fce(e,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=Io/2,s=Io/6,o=Io/3,c=r.inactive?i:r.color;if(r.type==="plainline")return fe.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:Io,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return fe.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(o,`
A`).concat(s,",").concat(s,",0,1,1,").concat(2*o,",").concat(a,`
H`).concat(Io,"M").concat(2*o,",").concat(a,`
A`).concat(s,",").concat(s,",0,1,1,").concat(o,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return fe.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Io/8,"h").concat(Io,"v").concat(Io*3/4,"h").concat(-Io,"z"),className:"recharts-legend-icon"});if(fe.isValidElement(r.legendIcon)){var u=lce({},r);return delete u.legendIcon,fe.cloneElement(r.legendIcon,u)}return fe.createElement(EL,{fill:c,cx:a,cy:a,size:Io,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,a=i.payload,s=i.iconSize,o=i.layout,c=i.formatter,u=i.inactiveColor,h={x:0,y:0,width:Io,height:Io},p={display:o==="horizontal"?"inline-block":"block",marginRight:10},v={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(y,b){var w=y.formatter||c,_=In(Kx(Kx({"recharts-legend-item":!0},"legend-item-".concat(b),!0),"inactive",y.inactive));if(y.type==="none")return null;var S=yn(y.value)?null:y.value;Ku(!yn(y.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var E=y.inactive?u:y.color;return fe.createElement("li",HN({className:_,style:p,key:"legend-item-".concat(b)},tw(r.props,y,b)),fe.createElement(LN,{width:s,height:s,viewBox:h,style:v},r.renderIcon(y)),fe.createElement("span",{className:"recharts-legend-item-text",style:{color:E}},w?w(S,y,b):S))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,s=r.align;if(!i||!i.length)return null;var o={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return fe.createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}])})(j.PureComponent);Kx(TL,"displayName","Legend");Kx(TL,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var ZR,NU;function vce(){if(NU)return ZR;NU=1;var t=dE();function e(){this.__data__=new t,this.size=0}return ZR=e,ZR}var QR,IU;function yce(){if(IU)return QR;IU=1;function t(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r}return QR=t,QR}var eO,BU;function xce(){if(BU)return eO;BU=1;function t(e){return this.__data__.get(e)}return eO=t,eO}var tO,LU;function bce(){if(LU)return tO;LU=1;function t(e){return this.__data__.has(e)}return tO=t,tO}var nO,kU;function _ce(){if(kU)return nO;kU=1;var t=dE(),e=vL(),n=yL(),r=200;function i(a,s){var o=this.__data__;if(o instanceof t){var c=o.__data__;if(!e||c.length<r-1)return c.push([a,s]),this.size=++o.size,this;o=this.__data__=new n(c)}return o.set(a,s),this.size=o.size,this}return nO=i,nO}var rO,FU;function aq(){if(FU)return rO;FU=1;var t=dE(),e=vce(),n=yce(),r=xce(),i=bce(),a=_ce();function s(o){var c=this.__data__=new t(o);this.size=c.size}return s.prototype.clear=e,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,rO=s,rO}var iO,UU;function Sce(){if(UU)return iO;UU=1;var t="__lodash_hash_undefined__";function e(n){return this.__data__.set(n,t),this}return iO=e,iO}var aO,jU;function Ace(){if(jU)return aO;jU=1;function t(e){return this.__data__.has(e)}return aO=t,aO}var sO,zU;function sq(){if(zU)return sO;zU=1;var t=yL(),e=Sce(),n=Ace();function r(i){var a=-1,s=i==null?0:i.length;for(this.__data__=new t;++a<s;)this.add(i[a])}return r.prototype.add=r.prototype.push=e,r.prototype.has=n,sO=r,sO}var oO,GU;function oq(){if(GU)return oO;GU=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(e[r],r,e))return!0;return!1}return oO=t,oO}var lO,HU;function lq(){if(HU)return lO;HU=1;function t(e,n){return e.has(n)}return lO=t,lO}var cO,VU;function cq(){if(VU)return cO;VU=1;var t=sq(),e=oq(),n=lq(),r=1,i=2;function a(s,o,c,u,h,p){var v=c&r,y=s.length,b=o.length;if(y!=b&&!(v&&b>y))return!1;var w=p.get(s),_=p.get(o);if(w&&_)return w==o&&_==s;var S=-1,E=!0,T=c&i?new t:void 0;for(p.set(s,o),p.set(o,s);++S<y;){var P=s[S],R=o[S];if(u)var D=v?u(R,P,S,o,s,p):u(P,R,S,s,o,p);if(D!==void 0){if(D)continue;E=!1;break}if(T){if(!e(o,function(I,k){if(!n(T,k)&&(P===I||h(P,I,c,u,p)))return T.push(k)})){E=!1;break}}else if(!(P===R||h(P,R,c,u,p))){E=!1;break}}return p.delete(s),p.delete(o),E}return cO=a,cO}var uO,WU;function wce(){if(WU)return uO;WU=1;var t=Kc(),e=t.Uint8Array;return uO=e,uO}var fO,qU;function Mce(){if(qU)return fO;qU=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i,a){r[++n]=[a,i]}),r}return fO=t,fO}var dO,$U;function CL(){if($U)return dO;$U=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i){r[++n]=i}),r}return dO=t,dO}var hO,XU;function Ece(){if(XU)return hO;XU=1;var t=Zb(),e=wce(),n=gL(),r=cq(),i=Mce(),a=CL(),s=1,o=2,c="[object Boolean]",u="[object Date]",h="[object Error]",p="[object Map]",v="[object Number]",y="[object RegExp]",b="[object Set]",w="[object String]",_="[object Symbol]",S="[object ArrayBuffer]",E="[object DataView]",T=t?t.prototype:void 0,P=T?T.valueOf:void 0;function R(D,I,k,B,U,z,q){switch(k){case E:if(D.byteLength!=I.byteLength||D.byteOffset!=I.byteOffset)return!1;D=D.buffer,I=I.buffer;case S:return!(D.byteLength!=I.byteLength||!z(new e(D),new e(I)));case c:case u:case v:return n(+D,+I);case h:return D.name==I.name&&D.message==I.message;case y:case w:return D==I+"";case p:var W=i;case b:var ee=B&s;if(W||(W=a),D.size!=I.size&&!ee)return!1;var Q=q.get(D);if(Q)return Q==I;B|=o,q.set(D,I);var V=r(W(D),W(I),B,U,z,q);return q.delete(D),V;case _:if(P)return P.call(D)==P.call(I)}return!1}return hO=R,hO}var pO,KU;function uq(){if(KU)return pO;KU=1;function t(e,n){for(var r=-1,i=n.length,a=e.length;++r<i;)e[a+r]=n[r];return e}return pO=t,pO}var mO,YU;function Tce(){if(YU)return mO;YU=1;var t=uq(),e=ks();function n(r,i,a){var s=i(r);return e(r)?s:t(s,a(r))}return mO=n,mO}var gO,JU;function Cce(){if(JU)return gO;JU=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,a=0,s=[];++r<i;){var o=e[r];n(o,r,e)&&(s[a++]=o)}return s}return gO=t,gO}var vO,ZU;function Rce(){if(ZU)return vO;ZU=1;function t(){return[]}return vO=t,vO}var yO,QU;function Oce(){if(QU)return yO;QU=1;var t=Cce(),e=Rce(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(s){return s==null?[]:(s=Object(s),t(i(s),function(o){return r.call(s,o)}))}:e;return yO=a,yO}var xO,ej;function Pce(){if(ej)return xO;ej=1;function t(e,n){for(var r=-1,i=Array(e);++r<e;)i[r]=n(r);return i}return xO=t,xO}var bO,tj;function Dce(){if(tj)return bO;tj=1;var t=uf(),e=ff(),n="[object Arguments]";function r(i){return e(i)&&t(i)==n}return bO=r,bO}var _O,nj;function RL(){if(nj)return _O;nj=1;var t=Dce(),e=ff(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,a=t((function(){return arguments})())?t:function(s){return e(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return _O=a,_O}var mx={exports:{}},SO,rj;function Nce(){if(rj)return SO;rj=1;function t(){return!1}return SO=t,SO}mx.exports;var ij;function fq(){return ij||(ij=1,(function(t,e){var n=Kc(),r=Nce(),i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,s=a&&a.exports===i,o=s?n.Buffer:void 0,c=o?o.isBuffer:void 0,u=c||r;t.exports=u})(mx,mx.exports)),mx.exports}var AO,aj;function OL(){if(aj)return AO;aj=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function n(r,i){var a=typeof r;return i=i??t,!!i&&(a=="number"||a!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return AO=n,AO}var wO,sj;function PL(){if(sj)return wO;sj=1;var t=9007199254740991;function e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=t}return wO=e,wO}var MO,oj;function Ice(){if(oj)return MO;oj=1;var t=uf(),e=PL(),n=ff(),r="[object Arguments]",i="[object Array]",a="[object Boolean]",s="[object Date]",o="[object Error]",c="[object Function]",u="[object Map]",h="[object Number]",p="[object Object]",v="[object RegExp]",y="[object Set]",b="[object String]",w="[object WeakMap]",_="[object ArrayBuffer]",S="[object DataView]",E="[object Float32Array]",T="[object Float64Array]",P="[object Int8Array]",R="[object Int16Array]",D="[object Int32Array]",I="[object Uint8Array]",k="[object Uint8ClampedArray]",B="[object Uint16Array]",U="[object Uint32Array]",z={};z[E]=z[T]=z[P]=z[R]=z[D]=z[I]=z[k]=z[B]=z[U]=!0,z[r]=z[i]=z[_]=z[a]=z[S]=z[s]=z[o]=z[c]=z[u]=z[h]=z[p]=z[v]=z[y]=z[b]=z[w]=!1;function q(W){return n(W)&&e(W.length)&&!!z[t(W)]}return MO=q,MO}var EO,lj;function dq(){if(lj)return EO;lj=1;function t(e){return function(n){return e(n)}}return EO=t,EO}var gx={exports:{}};gx.exports;var cj;function Bce(){return cj||(cj=1,(function(t,e){var n=PW(),r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===r,s=a&&n.process,o=(function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}})();t.exports=o})(gx,gx.exports)),gx.exports}var TO,uj;function hq(){if(uj)return TO;uj=1;var t=Ice(),e=dq(),n=Bce(),r=n&&n.isTypedArray,i=r?e(r):t;return TO=i,TO}var CO,fj;function Lce(){if(fj)return CO;fj=1;var t=Pce(),e=RL(),n=ks(),r=fq(),i=OL(),a=hq(),s=Object.prototype,o=s.hasOwnProperty;function c(u,h){var p=n(u),v=!p&&e(u),y=!p&&!v&&r(u),b=!p&&!v&&!y&&a(u),w=p||v||y||b,_=w?t(u.length,String):[],S=_.length;for(var E in u)(h||o.call(u,E))&&!(w&&(E=="length"||y&&(E=="offset"||E=="parent")||b&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||i(E,S)))&&_.push(E);return _}return CO=c,CO}var RO,dj;function kce(){if(dj)return RO;dj=1;var t=Object.prototype;function e(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||t;return n===i}return RO=e,RO}var OO,hj;function pq(){if(hj)return OO;hj=1;function t(e,n){return function(r){return e(n(r))}}return OO=t,OO}var PO,pj;function Fce(){if(pj)return PO;pj=1;var t=pq(),e=t(Object.keys,Object);return PO=e,PO}var DO,mj;function Uce(){if(mj)return DO;mj=1;var t=kce(),e=Fce(),n=Object.prototype,r=n.hasOwnProperty;function i(a){if(!t(a))return e(a);var s=[];for(var o in Object(a))r.call(a,o)&&o!="constructor"&&s.push(o);return s}return DO=i,DO}var NO,gj;function Qb(){if(gj)return NO;gj=1;var t=mL(),e=PL();function n(r){return r!=null&&e(r.length)&&!t(r)}return NO=n,NO}var IO,vj;function xE(){if(vj)return IO;vj=1;var t=Lce(),e=Uce(),n=Qb();function r(i){return n(i)?t(i):e(i)}return IO=r,IO}var BO,yj;function jce(){if(yj)return BO;yj=1;var t=Tce(),e=Oce(),n=xE();function r(i){return t(i,n,e)}return BO=r,BO}var LO,xj;function zce(){if(xj)return LO;xj=1;var t=jce(),e=1,n=Object.prototype,r=n.hasOwnProperty;function i(a,s,o,c,u,h){var p=o&e,v=t(a),y=v.length,b=t(s),w=b.length;if(y!=w&&!p)return!1;for(var _=y;_--;){var S=v[_];if(!(p?S in s:r.call(s,S)))return!1}var E=h.get(a),T=h.get(s);if(E&&T)return E==s&&T==a;var P=!0;h.set(a,s),h.set(s,a);for(var R=p;++_<y;){S=v[_];var D=a[S],I=s[S];if(c)var k=p?c(I,D,S,s,a,h):c(D,I,S,a,s,h);if(!(k===void 0?D===I||u(D,I,o,c,h):k)){P=!1;break}R||(R=S=="constructor")}if(P&&!R){var B=a.constructor,U=s.constructor;B!=U&&"constructor"in a&&"constructor"in s&&!(typeof B=="function"&&B instanceof B&&typeof U=="function"&&U instanceof U)&&(P=!1)}return h.delete(a),h.delete(s),P}return LO=i,LO}var kO,bj;function Gce(){if(bj)return kO;bj=1;var t=kp(),e=Kc(),n=t(e,"DataView");return kO=n,kO}var FO,_j;function Hce(){if(_j)return FO;_j=1;var t=kp(),e=Kc(),n=t(e,"Promise");return FO=n,FO}var UO,Sj;function mq(){if(Sj)return UO;Sj=1;var t=kp(),e=Kc(),n=t(e,"Set");return UO=n,UO}var jO,Aj;function Vce(){if(Aj)return jO;Aj=1;var t=kp(),e=Kc(),n=t(e,"WeakMap");return jO=n,jO}var zO,wj;function Wce(){if(wj)return zO;wj=1;var t=Gce(),e=vL(),n=Hce(),r=mq(),i=Vce(),a=uf(),s=DW(),o="[object Map]",c="[object Object]",u="[object Promise]",h="[object Set]",p="[object WeakMap]",v="[object DataView]",y=s(t),b=s(e),w=s(n),_=s(r),S=s(i),E=a;return(t&&E(new t(new ArrayBuffer(1)))!=v||e&&E(new e)!=o||n&&E(n.resolve())!=u||r&&E(new r)!=h||i&&E(new i)!=p)&&(E=function(T){var P=a(T),R=P==c?T.constructor:void 0,D=R?s(R):"";if(D)switch(D){case y:return v;case b:return o;case w:return u;case _:return h;case S:return p}return P}),zO=E,zO}var GO,Mj;function qce(){if(Mj)return GO;Mj=1;var t=aq(),e=cq(),n=Ece(),r=zce(),i=Wce(),a=ks(),s=fq(),o=hq(),c=1,u="[object Arguments]",h="[object Array]",p="[object Object]",v=Object.prototype,y=v.hasOwnProperty;function b(w,_,S,E,T,P){var R=a(w),D=a(_),I=R?h:i(w),k=D?h:i(_);I=I==u?p:I,k=k==u?p:k;var B=I==p,U=k==p,z=I==k;if(z&&s(w)){if(!s(_))return!1;R=!0,B=!1}if(z&&!B)return P||(P=new t),R||o(w)?e(w,_,S,E,T,P):n(w,_,I,S,E,T,P);if(!(S&c)){var q=B&&y.call(w,"__wrapped__"),W=U&&y.call(_,"__wrapped__");if(q||W){var ee=q?w.value():w,Q=W?_.value():_;return P||(P=new t),T(ee,Q,S,E,P)}}return z?(P||(P=new t),r(w,_,S,E,T,P)):!1}return GO=b,GO}var HO,Ej;function DL(){if(Ej)return HO;Ej=1;var t=qce(),e=ff();function n(r,i,a,s,o){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:t(r,i,a,s,n,o)}return HO=n,HO}var VO,Tj;function $ce(){if(Tj)return VO;Tj=1;var t=aq(),e=DL(),n=1,r=2;function i(a,s,o,c){var u=o.length,h=u,p=!c;if(a==null)return!h;for(a=Object(a);u--;){var v=o[u];if(p&&v[2]?v[1]!==a[v[0]]:!(v[0]in a))return!1}for(;++u<h;){v=o[u];var y=v[0],b=a[y],w=v[1];if(p&&v[2]){if(b===void 0&&!(y in a))return!1}else{var _=new t;if(c)var S=c(b,w,y,a,s,_);if(!(S===void 0?e(w,b,n|r,c,_):S))return!1}}return!0}return VO=i,VO}var WO,Cj;function gq(){if(Cj)return WO;Cj=1;var t=Ld();function e(n){return n===n&&!t(n)}return WO=e,WO}var qO,Rj;function Xce(){if(Rj)return qO;Rj=1;var t=gq(),e=xE();function n(r){for(var i=e(r),a=i.length;a--;){var s=i[a],o=r[s];i[a]=[s,o,t(o)]}return i}return qO=n,qO}var $O,Oj;function vq(){if(Oj)return $O;Oj=1;function t(e,n){return function(r){return r==null?!1:r[e]===n&&(n!==void 0||e in Object(r))}}return $O=t,$O}var XO,Pj;function Kce(){if(Pj)return XO;Pj=1;var t=$ce(),e=Xce(),n=vq();function r(i){var a=e(i);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(s){return s===i||t(s,i,a)}}return XO=r,XO}var KO,Dj;function Yce(){if(Dj)return KO;Dj=1;function t(e,n){return e!=null&&n in Object(e)}return KO=t,KO}var YO,Nj;function Jce(){if(Nj)return YO;Nj=1;var t=BW(),e=RL(),n=ks(),r=OL(),i=PL(),a=pE();function s(o,c,u){c=t(c,o);for(var h=-1,p=c.length,v=!1;++h<p;){var y=a(c[h]);if(!(v=o!=null&&u(o,y)))break;o=o[y]}return v||++h!=p?v:(p=o==null?0:o.length,!!p&&i(p)&&r(y,p)&&(n(o)||e(o)))}return YO=s,YO}var JO,Ij;function Zce(){if(Ij)return JO;Ij=1;var t=Yce(),e=Jce();function n(r,i){return r!=null&&e(r,i,t)}return JO=n,JO}var ZO,Bj;function Qce(){if(Bj)return ZO;Bj=1;var t=DL(),e=LW(),n=Zce(),r=pL(),i=gq(),a=vq(),s=pE(),o=1,c=2;function u(h,p){return r(h)&&i(p)?a(s(h),p):function(v){var y=e(v,h);return y===void 0&&y===p?n(v,h):t(p,y,o|c)}}return ZO=u,ZO}var QO,Lj;function Jv(){if(Lj)return QO;Lj=1;function t(e){return e}return QO=t,QO}var eP,kj;function eue(){if(kj)return eP;kj=1;function t(e){return function(n){return n?.[e]}}return eP=t,eP}var tP,Fj;function tue(){if(Fj)return tP;Fj=1;var t=bL();function e(n){return function(r){return t(r,n)}}return tP=e,tP}var nP,Uj;function nue(){if(Uj)return nP;Uj=1;var t=eue(),e=tue(),n=pL(),r=pE();function i(a){return n(a)?t(r(a)):e(a)}return nP=i,nP}var rP,jj;function kd(){if(jj)return rP;jj=1;var t=Kce(),e=Qce(),n=Jv(),r=ks(),i=nue();function a(s){return typeof s=="function"?s:s==null?n:typeof s=="object"?r(s)?e(s[0],s[1]):t(s):i(s)}return rP=a,rP}var iP,zj;function yq(){if(zj)return iP;zj=1;function t(e,n,r,i){for(var a=e.length,s=r+(i?1:-1);i?s--:++s<a;)if(n(e[s],s,e))return s;return-1}return iP=t,iP}var aP,Gj;function rue(){if(Gj)return aP;Gj=1;function t(e){return e!==e}return aP=t,aP}var sP,Hj;function iue(){if(Hj)return sP;Hj=1;function t(e,n,r){for(var i=r-1,a=e.length;++i<a;)if(e[i]===n)return i;return-1}return sP=t,sP}var oP,Vj;function aue(){if(Vj)return oP;Vj=1;var t=yq(),e=rue(),n=iue();function r(i,a,s){return a===a?n(i,a,s):t(i,e,s)}return oP=r,oP}var lP,Wj;function sue(){if(Wj)return lP;Wj=1;var t=aue();function e(n,r){var i=n==null?0:n.length;return!!i&&t(n,r,0)>-1}return lP=e,lP}var cP,qj;function oue(){if(qj)return cP;qj=1;function t(e,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;)if(r(n,e[i]))return!0;return!1}return cP=t,cP}var uP,$j;function lue(){if($j)return uP;$j=1;function t(){}return uP=t,uP}var fP,Xj;function cue(){if(Xj)return fP;Xj=1;var t=mq(),e=lue(),n=CL(),r=1/0,i=t&&1/n(new t([,-0]))[1]==r?function(a){return new t(a)}:e;return fP=i,fP}var dP,Kj;function uue(){if(Kj)return dP;Kj=1;var t=sq(),e=sue(),n=oue(),r=lq(),i=cue(),a=CL(),s=200;function o(c,u,h){var p=-1,v=e,y=c.length,b=!0,w=[],_=w;if(h)b=!1,v=n;else if(y>=s){var S=u?null:i(c);if(S)return a(S);b=!1,v=r,_=new t}else _=u?[]:w;e:for(;++p<y;){var E=c[p],T=u?u(E):E;if(E=h||E!==0?E:0,b&&T===T){for(var P=_.length;P--;)if(_[P]===T)continue e;u&&_.push(T),w.push(E)}else v(_,T,h)||(_!==w&&_.push(T),w.push(E))}return w}return dP=o,dP}var hP,Yj;function fue(){if(Yj)return hP;Yj=1;var t=kd(),e=uue();function n(r,i){return r&&r.length?e(r,t(i,2)):[]}return hP=n,hP}var due=fue();const Jj=ar(due);function xq(t,e,n){return e===!0?Jj(t,n):yn(e)?Jj(t,e):t}function av(t){"@babel/helpers - typeof";return av=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},av(t)}var hue=["ref"];function Zj(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Pu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Zj(Object(n),!0).forEach(function(r){bE(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zj(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function pue(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qj(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_q(r.key),r)}}function mue(t,e,n){return e&&Qj(t.prototype,e),n&&Qj(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function gue(t,e,n){return e=lw(e),vue(t,bq()?Reflect.construct(e,n||[],lw(t).constructor):e.apply(t,n))}function vue(t,e){if(e&&(av(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yue(t)}function yue(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bq(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bq=function(){return!!t})()}function lw(t){return lw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lw(t)}function xue(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&WN(t,e)}function WN(t,e){return WN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},WN(t,e)}function bE(t,e,n){return e=_q(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _q(t){var e=bue(t,"string");return av(e)=="symbol"?e:e+""}function bue(t,e){if(av(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(av(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function _ue(t,e){if(t==null)return{};var n=Sue(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Sue(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Aue(t){return t.value}function wue(t,e){if(fe.isValidElement(t))return fe.cloneElement(t,e);if(typeof t=="function")return fe.createElement(t,e);e.ref;var n=_ue(e,hue);return fe.createElement(TL,n)}var ez=1,qg=(function(t){function e(){var n;pue(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=gue(this,e,[].concat(i)),bE(n,"lastBoundingBox",{width:-1,height:-1}),n}return xue(e,t),mue(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>ez||Math.abs(i.height-this.lastBoundingBox.height)>ez)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Pu({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,s=i.align,o=i.verticalAlign,c=i.margin,u=i.chartWidth,h=i.chartHeight,p,v;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&a==="vertical"){var y=this.getBBoxSnapshot();p={left:((u||0)-y.width)/2}}else p=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(o==="middle"){var b=this.getBBoxSnapshot();v={top:((h||0)-b.height)/2}}else v=o==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Pu(Pu({},p),v)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,s=i.width,o=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,h=i.payload,p=Pu(Pu({position:"absolute",width:s||"auto",height:o||"auto"},this.getDefaultPosition(c)),c);return fe.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(y){r.wrapperNode=y}},wue(a,Pu(Pu({},this.props),{},{payload:xq(h,u,Aue)})))}}],[{key:"getWithHeight",value:function(r,i){var a=Pu(Pu({},this.defaultProps),r.props),s=a.layout;return s==="vertical"&&mt(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])})(j.PureComponent);bE(qg,"displayName","Legend");bE(qg,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var pP,tz;function Mue(){if(tz)return pP;tz=1;var t=Zb(),e=RL(),n=ks(),r=t?t.isConcatSpreadable:void 0;function i(a){return n(a)||e(a)||!!(r&&a&&a[r])}return pP=i,pP}var mP,nz;function Sq(){if(nz)return mP;nz=1;var t=uq(),e=Mue();function n(r,i,a,s,o){var c=-1,u=r.length;for(a||(a=e),o||(o=[]);++c<u;){var h=r[c];i>0&&a(h)?i>1?n(h,i-1,a,s,o):t(o,h):s||(o[o.length]=h)}return o}return mP=n,mP}var gP,rz;function Eue(){if(rz)return gP;rz=1;function t(e){return function(n,r,i){for(var a=-1,s=Object(n),o=i(n),c=o.length;c--;){var u=o[e?c:++a];if(r(s[u],u,s)===!1)break}return n}}return gP=t,gP}var vP,iz;function Tue(){if(iz)return vP;iz=1;var t=Eue(),e=t();return vP=e,vP}var yP,az;function Aq(){if(az)return yP;az=1;var t=Tue(),e=xE();function n(r,i){return r&&t(r,i,e)}return yP=n,yP}var xP,sz;function Cue(){if(sz)return xP;sz=1;var t=Qb();function e(n,r){return function(i,a){if(i==null)return i;if(!t(i))return n(i,a);for(var s=i.length,o=r?s:-1,c=Object(i);(r?o--:++o<s)&&a(c[o],o,c)!==!1;);return i}}return xP=e,xP}var bP,oz;function NL(){if(oz)return bP;oz=1;var t=Aq(),e=Cue(),n=e(t);return bP=n,bP}var _P,lz;function wq(){if(lz)return _P;lz=1;var t=NL(),e=Qb();function n(r,i){var a=-1,s=e(r)?Array(r.length):[];return t(r,function(o,c,u){s[++a]=i(o,c,u)}),s}return _P=n,_P}var SP,cz;function Rue(){if(cz)return SP;cz=1;function t(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}return SP=t,SP}var AP,uz;function Oue(){if(uz)return AP;uz=1;var t=$v();function e(n,r){if(n!==r){var i=n!==void 0,a=n===null,s=n===n,o=t(n),c=r!==void 0,u=r===null,h=r===r,p=t(r);if(!u&&!p&&!o&&n>r||o&&c&&h&&!u&&!p||a&&c&&h||!i&&h||!s)return 1;if(!a&&!o&&!p&&n<r||p&&i&&s&&!a&&!o||u&&i&&s||!c&&s||!h)return-1}return 0}return AP=e,AP}var wP,fz;function Pue(){if(fz)return wP;fz=1;var t=Oue();function e(n,r,i){for(var a=-1,s=n.criteria,o=r.criteria,c=s.length,u=i.length;++a<c;){var h=t(s[a],o[a]);if(h){if(a>=u)return h;var p=i[a];return h*(p=="desc"?-1:1)}}return n.index-r.index}return wP=e,wP}var MP,dz;function Due(){if(dz)return MP;dz=1;var t=xL(),e=bL(),n=kd(),r=wq(),i=Rue(),a=dq(),s=Pue(),o=Jv(),c=ks();function u(h,p,v){p.length?p=t(p,function(w){return c(w)?function(_){return e(_,w.length===1?w[0]:w)}:w}):p=[o];var y=-1;p=t(p,a(n));var b=r(h,function(w,_,S){var E=t(p,function(T){return T(w)});return{criteria:E,index:++y,value:w}});return i(b,function(w,_){return s(w,_,v)})}return MP=u,MP}var EP,hz;function Nue(){if(hz)return EP;hz=1;function t(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}return EP=t,EP}var TP,pz;function Iue(){if(pz)return TP;pz=1;var t=Nue(),e=Math.max;function n(r,i,a){return i=e(i===void 0?r.length-1:i,0),function(){for(var s=arguments,o=-1,c=e(s.length-i,0),u=Array(c);++o<c;)u[o]=s[i+o];o=-1;for(var h=Array(i+1);++o<i;)h[o]=s[o];return h[i]=a(u),t(r,this,h)}}return TP=n,TP}var CP,mz;function Bue(){if(mz)return CP;mz=1;function t(e){return function(){return e}}return CP=t,CP}var RP,gz;function Mq(){if(gz)return RP;gz=1;var t=kp(),e=(function(){try{var n=t(Object,"defineProperty");return n({},"",{}),n}catch{}})();return RP=e,RP}var OP,vz;function Lue(){if(vz)return OP;vz=1;var t=Bue(),e=Mq(),n=Jv(),r=e?function(i,a){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(a),writable:!0})}:n;return OP=r,OP}var PP,yz;function kue(){if(yz)return PP;yz=1;var t=800,e=16,n=Date.now;function r(i){var a=0,s=0;return function(){var o=n(),c=e-(o-s);if(s=o,c>0){if(++a>=t)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return PP=r,PP}var DP,xz;function Fue(){if(xz)return DP;xz=1;var t=Lue(),e=kue(),n=e(t);return DP=n,DP}var NP,bz;function Uue(){if(bz)return NP;bz=1;var t=Jv(),e=Iue(),n=Fue();function r(i,a){return n(e(i,a,t),i+"")}return NP=r,NP}var IP,_z;function _E(){if(_z)return IP;_z=1;var t=gL(),e=Qb(),n=OL(),r=Ld();function i(a,s,o){if(!r(o))return!1;var c=typeof s;return(c=="number"?e(o)&&n(s,o.length):c=="string"&&s in o)?t(o[s],a):!1}return IP=i,IP}var BP,Sz;function jue(){if(Sz)return BP;Sz=1;var t=Sq(),e=Due(),n=Uue(),r=_E(),i=n(function(a,s){if(a==null)return[];var o=s.length;return o>1&&r(a,s[0],s[1])?s=[]:o>2&&r(s[0],s[1],s[2])&&(s=[s[0]]),e(a,t(s,1),[])});return BP=i,BP}var zue=jue();const IL=ar(zue);function Yx(t){"@babel/helpers - typeof";return Yx=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},Yx(t)}function qN(){return qN=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},qN.apply(this,arguments)}function Gue(t,e){return que(t)||Wue(t,e)||Vue(t,e)||Hue()}function Hue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vue(t,e){if(t){if(typeof t=="string")return Az(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Az(t,e)}}function Az(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Wue(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function que(t){if(Array.isArray(t))return t}function wz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function LP(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wz(Object(n),!0).forEach(function(r){$ue(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $ue(t,e,n){return e=Xue(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xue(t){var e=Kue(t,"string");return Yx(e)=="symbol"?e:e+""}function Kue(t,e){if(Yx(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Yx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yue(t){return Array.isArray(t)&&ji(t[0])&&ji(t[1])?t.join(" ~ "):t}var Jue=function(e){var n=e.separator,r=n===void 0?" : ":n,i=e.contentStyle,a=i===void 0?{}:i,s=e.itemStyle,o=s===void 0?{}:s,c=e.labelStyle,u=c===void 0?{}:c,h=e.payload,p=e.formatter,v=e.itemSorter,y=e.wrapperClassName,b=e.labelClassName,w=e.label,_=e.labelFormatter,S=e.accessibilityLayer,E=S===void 0?!1:S,T=function(){if(h&&h.length){var q={padding:0,margin:0},W=(v?IL(h,v):h).map(function(ee,Q){if(ee.type==="none")return null;var V=LP({display:"block",paddingTop:4,paddingBottom:4,color:ee.color||"#000"},o),$=ee.formatter||p||Yue,Y=ee.value,ie=ee.name,de=Y,X=ie;if($&&de!=null&&X!=null){var ae=$(Y,ie,ee,Q,h);if(Array.isArray(ae)){var ue=Gue(ae,2);de=ue[0],X=ue[1]}else de=ae}return fe.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Q),style:V},ji(X)?fe.createElement("span",{className:"recharts-tooltip-item-name"},X):null,ji(X)?fe.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,fe.createElement("span",{className:"recharts-tooltip-item-value"},de),fe.createElement("span",{className:"recharts-tooltip-item-unit"},ee.unit||""))});return fe.createElement("ul",{className:"recharts-tooltip-item-list",style:q},W)}return null},P=LP({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),R=LP({margin:0},u),D=!Cn(w),I=D?w:"",k=In("recharts-default-tooltip",y),B=In("recharts-tooltip-label",b);D&&_&&h!==void 0&&h!==null&&(I=_(w,h));var U=E?{role:"status","aria-live":"assertive"}:{};return fe.createElement("div",qN({className:k,style:P},U),fe.createElement("p",{className:B,style:R},fe.isValidElement(I)?I:"".concat(I)),T())};function Jx(t){"@babel/helpers - typeof";return Jx=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},Jx(t)}function mS(t,e,n){return e=Zue(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zue(t){var e=Que(t,"string");return Jx(e)=="symbol"?e:e+""}function Que(t,e){if(Jx(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Jx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var H0="recharts-tooltip-wrapper",efe={visibility:"hidden"};function tfe(t){var e=t.coordinate,n=t.translateX,r=t.translateY;return In(H0,mS(mS(mS(mS({},"".concat(H0,"-right"),mt(n)&&e&&mt(e.x)&&n>=e.x),"".concat(H0,"-left"),mt(n)&&e&&mt(e.x)&&n<e.x),"".concat(H0,"-bottom"),mt(r)&&e&&mt(e.y)&&r>=e.y),"".concat(H0,"-top"),mt(r)&&e&&mt(e.y)&&r<e.y))}function Mz(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.key,i=t.offsetTopLeft,a=t.position,s=t.reverseDirection,o=t.tooltipDimension,c=t.viewBox,u=t.viewBoxDimension;if(a&&mt(a[r]))return a[r];var h=n[r]-o-i,p=n[r]+i;if(e[r])return s[r]?h:p;if(s[r]){var v=h,y=c[r];return v<y?Math.max(p,c[r]):Math.max(h,c[r])}var b=p+o,w=c[r]+u;return b>w?Math.max(h,c[r]):Math.max(p,c[r])}function nfe(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function rfe(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,a=t.reverseDirection,s=t.tooltipBox,o=t.useTranslate3d,c=t.viewBox,u,h,p;return s.height>0&&s.width>0&&n?(h=Mz({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),p=Mz({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=nfe({translateX:h,translateY:p,useTranslate3d:o})):u=efe,{cssProperties:u,cssClasses:tfe({translateX:h,translateY:p,coordinate:n})}}function sv(t){"@babel/helpers - typeof";return sv=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},sv(t)}function Ez(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Tz(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ez(Object(n),!0).forEach(function(r){XN(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ez(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ife(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function afe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Tq(r.key),r)}}function sfe(t,e,n){return e&&afe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ofe(t,e,n){return e=cw(e),lfe(t,Eq()?Reflect.construct(e,n||[],cw(t).constructor):e.apply(t,n))}function lfe(t,e){if(e&&(sv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cfe(t)}function cfe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Eq(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Eq=function(){return!!t})()}function cw(t){return cw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cw(t)}function ufe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$N(t,e)}function $N(t,e){return $N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$N(t,e)}function XN(t,e,n){return e=Tq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tq(t){var e=ffe(t,"string");return sv(e)=="symbol"?e:e+""}function ffe(t,e){if(sv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(sv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Cz=1,dfe=(function(t){function e(){var n;ife(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=ofe(this,e,[].concat(i)),XN(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),XN(n,"handleKeyDown",function(s){if(s.key==="Escape"){var o,c,u,h;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(o=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&o!==void 0?o:0,y:(u=(h=n.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&u!==void 0?u:0}})}}),n}return ufe(e,t),sfe(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>Cz||Math.abs(r.height-this.state.lastBoundingBox.height)>Cz)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.children,h=i.coordinate,p=i.hasPayload,v=i.isAnimationActive,y=i.offset,b=i.position,w=i.reverseDirection,_=i.useTranslate3d,S=i.viewBox,E=i.wrapperStyle,T=rfe({allowEscapeViewBox:s,coordinate:h,offsetTopLeft:y,position:b,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:_,viewBox:S}),P=T.cssClasses,R=T.cssProperties,D=Tz(Tz({transition:v&&a?"transform ".concat(o,"ms ").concat(c):void 0},R),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&p?"visible":"hidden",position:"absolute",top:0,left:0},E);return fe.createElement("div",{tabIndex:-1,className:P,style:D,ref:function(k){r.wrapperNode=k}},u)}}])})(j.PureComponent),hfe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Fp={isSsr:hfe()};function ov(t){"@babel/helpers - typeof";return ov=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},ov(t)}function Rz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Oz(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Rz(Object(n),!0).forEach(function(r){BL(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function pfe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mfe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Rq(r.key),r)}}function gfe(t,e,n){return e&&mfe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function vfe(t,e,n){return e=uw(e),yfe(t,Cq()?Reflect.construct(e,n||[],uw(t).constructor):e.apply(t,n))}function yfe(t,e){if(e&&(ov(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xfe(t)}function xfe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Cq(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Cq=function(){return!!t})()}function uw(t){return uw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},uw(t)}function bfe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&KN(t,e)}function KN(t,e){return KN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},KN(t,e)}function BL(t,e,n){return e=Rq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rq(t){var e=_fe(t,"string");return ov(e)=="symbol"?e:e+""}function _fe(t,e){if(ov(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(ov(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Sfe(t){return t.dataKey}function Afe(t,e){return fe.isValidElement(t)?fe.cloneElement(t,e):typeof t=="function"?fe.createElement(t,e):fe.createElement(Jue,e)}var Rl=(function(t){function e(){return pfe(this,e),vfe(this,e,arguments)}return bfe(e,t),gfe(e,[{key:"render",value:function(){var r=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.content,h=i.coordinate,p=i.filterNull,v=i.isAnimationActive,y=i.offset,b=i.payload,w=i.payloadUniqBy,_=i.position,S=i.reverseDirection,E=i.useTranslate3d,T=i.viewBox,P=i.wrapperStyle,R=b??[];p&&R.length&&(R=xq(b.filter(function(I){return I.value!=null&&(I.hide!==!0||r.props.includeHidden)}),w,Sfe));var D=R.length>0;return fe.createElement(dfe,{allowEscapeViewBox:s,animationDuration:o,animationEasing:c,isAnimationActive:v,active:a,coordinate:h,hasPayload:D,offset:y,position:_,reverseDirection:S,useTranslate3d:E,viewBox:T,wrapperStyle:P},Afe(u,Oz(Oz({},this.props),{},{payload:R})))}}])})(j.PureComponent);BL(Rl,"displayName","Tooltip");BL(Rl,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Fp.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var kP,Pz;function wfe(){if(Pz)return kP;Pz=1;var t=Kc(),e=function(){return t.Date.now()};return kP=e,kP}var FP,Dz;function Mfe(){if(Dz)return FP;Dz=1;var t=/\s/;function e(n){for(var r=n.length;r--&&t.test(n.charAt(r)););return r}return FP=e,FP}var UP,Nz;function Efe(){if(Nz)return UP;Nz=1;var t=Mfe(),e=/^\s+/;function n(r){return r&&r.slice(0,t(r)+1).replace(e,"")}return UP=n,UP}var jP,Iz;function Oq(){if(Iz)return jP;Iz=1;var t=Efe(),e=Ld(),n=$v(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function c(u){if(typeof u=="number")return u;if(n(u))return r;if(e(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=e(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=t(u);var p=a.test(u);return p||s.test(u)?o(u.slice(2),p?2:8):i.test(u)?r:+u}return jP=c,jP}var zP,Bz;function Tfe(){if(Bz)return zP;Bz=1;var t=Ld(),e=wfe(),n=Oq(),r="Expected a function",i=Math.max,a=Math.min;function s(o,c,u){var h,p,v,y,b,w,_=0,S=!1,E=!1,T=!0;if(typeof o!="function")throw new TypeError(r);c=n(c)||0,t(u)&&(S=!!u.leading,E="maxWait"in u,v=E?i(n(u.maxWait)||0,c):v,T="trailing"in u?!!u.trailing:T);function P(W){var ee=h,Q=p;return h=p=void 0,_=W,y=o.apply(Q,ee),y}function R(W){return _=W,b=setTimeout(k,c),S?P(W):y}function D(W){var ee=W-w,Q=W-_,V=c-ee;return E?a(V,v-Q):V}function I(W){var ee=W-w,Q=W-_;return w===void 0||ee>=c||ee<0||E&&Q>=v}function k(){var W=e();if(I(W))return B(W);b=setTimeout(k,D(W))}function B(W){return b=void 0,T&&h?P(W):(h=p=void 0,y)}function U(){b!==void 0&&clearTimeout(b),_=0,h=w=p=b=void 0}function z(){return b===void 0?y:B(e())}function q(){var W=e(),ee=I(W);if(h=arguments,p=this,w=W,ee){if(b===void 0)return R(w);if(E)return clearTimeout(b),b=setTimeout(k,c),P(w)}return b===void 0&&(b=setTimeout(k,c)),y}return q.cancel=U,q.flush=z,q}return zP=s,zP}var GP,Lz;function Cfe(){if(Lz)return GP;Lz=1;var t=Tfe(),e=Ld(),n="Expected a function";function r(i,a,s){var o=!0,c=!0;if(typeof i!="function")throw new TypeError(n);return e(s)&&(o="leading"in s?!!s.leading:o,c="trailing"in s?!!s.trailing:c),t(i,a,{leading:o,maxWait:a,trailing:c})}return GP=r,GP}var Rfe=Cfe();const Pq=ar(Rfe);function Zx(t){"@babel/helpers - typeof";return Zx=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},Zx(t)}function kz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function gS(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?kz(Object(n),!0).forEach(function(r){Ofe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ofe(t,e,n){return e=Pfe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pfe(t){var e=Dfe(t,"string");return Zx(e)=="symbol"?e:e+""}function Dfe(t,e){if(Zx(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Zx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Nfe(t,e){return kfe(t)||Lfe(t,e)||Bfe(t,e)||Ife()}function Ife(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bfe(t,e){if(t){if(typeof t=="string")return Fz(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fz(t,e)}}function Fz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Lfe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function kfe(t){if(Array.isArray(t))return t}var Dq=j.forwardRef(function(t,e){var n=t.aspect,r=t.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=t.width,s=a===void 0?"100%":a,o=t.height,c=o===void 0?"100%":o,u=t.minWidth,h=u===void 0?0:u,p=t.minHeight,v=t.maxHeight,y=t.children,b=t.debounce,w=b===void 0?0:b,_=t.id,S=t.className,E=t.onResize,T=t.style,P=T===void 0?{}:T,R=j.useRef(null),D=j.useRef();D.current=E,j.useImperativeHandle(e,function(){return Object.defineProperty(R.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),R.current},configurable:!0})});var I=j.useState({containerWidth:i.width,containerHeight:i.height}),k=Nfe(I,2),B=k[0],U=k[1],z=j.useCallback(function(W,ee){U(function(Q){var V=Math.round(W),$=Math.round(ee);return Q.containerWidth===V&&Q.containerHeight===$?Q:{containerWidth:V,containerHeight:$}})},[]);j.useEffect(function(){var W=function(ie){var de,X=ie[0].contentRect,ae=X.width,ue=X.height;z(ae,ue),(de=D.current)===null||de===void 0||de.call(D,ae,ue)};w>0&&(W=Pq(W,w,{trailing:!0,leading:!1}));var ee=new ResizeObserver(W),Q=R.current.getBoundingClientRect(),V=Q.width,$=Q.height;return z(V,$),ee.observe(R.current),function(){ee.disconnect()}},[z,w]);var q=j.useMemo(function(){var W=B.containerWidth,ee=B.containerHeight;if(W<0||ee<0)return null;Ku(rp(s)||rp(c),`The width(%s) and height(%s) are both fixed numbers,
maybe you don't need to use a ResponsiveContainer.`,s,c),Ku(!n||n>0,"The aspect(%s) must be greater than zero.",n);var Q=rp(s)?W:s,V=rp(c)?ee:c;n&&n>0&&(Q?V=Q/n:V&&(Q=V*n),v&&V>v&&(V=v)),Ku(Q>0||V>0,`The width(%s) and height(%s) of chart should be greater than 0,
please check the style of container, or the props width(%s) and height(%s),
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
height and width.`,Q,V,s,c,h,p,n);var $=!Array.isArray(y)&&Xu(y.type).endsWith("Chart");return fe.Children.map(y,function(Y){return fe.isValidElement(Y)?j.cloneElement(Y,gS({width:Q,height:V},$?{style:gS({height:"100%",width:"100%",maxHeight:V,maxWidth:Q},Y.props.style)}:{})):Y})},[n,y,c,v,p,h,B,s]);return fe.createElement("div",{id:_?"".concat(_):void 0,className:In("recharts-responsive-container",S),style:gS(gS({},P),{},{width:s,height:c,minWidth:h,minHeight:p,maxHeight:v}),ref:R},q)}),Nq=function(e){return null};Nq.displayName="Cell";function Qx(t){"@babel/helpers - typeof";return Qx=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},Qx(t)}function Uz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function YN(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Uz(Object(n),!0).forEach(function(r){Ffe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Uz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ffe(t,e,n){return e=Ufe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ufe(t){var e=jfe(t,"string");return Qx(e)=="symbol"?e:e+""}function jfe(t,e){if(Qx(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Qx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tg={widthCache:{},cacheCount:0},zfe=2e3,Gfe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},jz="recharts_measurement_span";function Hfe(t){var e=YN({},t);return Object.keys(e).forEach(function(n){e[n]||delete e[n]}),e}var Rx=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Fp.isSsr)return{width:0,height:0};var r=Hfe(n),i=JSON.stringify({text:e,copyStyle:r});if(tg.widthCache[i])return tg.widthCache[i];try{var a=document.getElementById(jz);a||(a=document.createElement("span"),a.setAttribute("id",jz),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var s=YN(YN({},Gfe),r);Object.assign(a.style,s),a.textContent="".concat(e);var o=a.getBoundingClientRect(),c={width:o.width,height:o.height};return tg.widthCache[i]=c,++tg.cacheCount>zfe&&(tg.cacheCount=0,tg.widthCache={}),c}catch{return{width:0,height:0}}},Vfe=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function eb(t){"@babel/helpers - typeof";return eb=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},eb(t)}function fw(t,e){return Xfe(t)||$fe(t,e)||qfe(t,e)||Wfe()}function Wfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qfe(t,e){if(t){if(typeof t=="string")return zz(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zz(t,e)}}function zz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $fe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Xfe(t){if(Array.isArray(t))return t}function Kfe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gz(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jfe(r.key),r)}}function Yfe(t,e,n){return e&&Gz(t.prototype,e),n&&Gz(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jfe(t){var e=Zfe(t,"string");return eb(e)=="symbol"?e:e+""}function Zfe(t,e){if(eb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(eb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Hz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Vz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Qfe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,ede=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Iq={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},tde=Object.keys(Iq),jg="NaN";function nde(t,e){return t*Iq[e]}var vS=(function(){function t(e,n){Kfe(this,t),this.num=e,this.unit=n,this.num=e,this.unit=n,Number.isNaN(e)&&(this.unit=""),n!==""&&!Qfe.test(n)&&(this.num=NaN,this.unit=""),tde.includes(n)&&(this.num=nde(e,n),this.unit="px")}return Yfe(t,[{key:"add",value:function(n){return this.unit!==n.unit?new t(NaN,""):new t(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new t(NaN,""):new t(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new t(NaN,""):new t(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new t(NaN,""):new t(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=ede.exec(n))!==null&&r!==void 0?r:[],a=fw(i,3),s=a[1],o=a[2];return new t(parseFloat(s),o??"")}}])})();function Bq(t){if(t.includes(jg))return jg;for(var e=t;e.includes("*")||e.includes("/");){var n,r=(n=Hz.exec(e))!==null&&n!==void 0?n:[],i=fw(r,4),a=i[1],s=i[2],o=i[3],c=vS.parse(a??""),u=vS.parse(o??""),h=s==="*"?c.multiply(u):c.divide(u);if(h.isNaN())return jg;e=e.replace(Hz,h.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var p,v=(p=Vz.exec(e))!==null&&p!==void 0?p:[],y=fw(v,4),b=y[1],w=y[2],_=y[3],S=vS.parse(b??""),E=vS.parse(_??""),T=w==="+"?S.add(E):S.subtract(E);if(T.isNaN())return jg;e=e.replace(Vz,T.toString())}return e}var Wz=/\(([^()]*)\)/;function rde(t){for(var e=t;e.includes("(");){var n=Wz.exec(e),r=fw(n,2),i=r[1];e=e.replace(Wz,Bq(i))}return e}function ide(t){var e=t.replace(/\s+/g,"");return e=rde(e),e=Bq(e),e}function ade(t){try{return ide(t)}catch{return jg}}function HP(t){var e=ade(t.slice(5,-1));return e===jg?"":e}var sde=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],ode=["dx","dy","angle","className","breakAll"];function JN(){return JN=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},JN.apply(this,arguments)}function qz(t,e){if(t==null)return{};var n=lde(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lde(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function $z(t,e){return dde(t)||fde(t,e)||ude(t,e)||cde()}function cde(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ude(t,e){if(t){if(typeof t=="string")return Xz(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xz(t,e)}}function Xz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fde(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function dde(t){if(Array.isArray(t))return t}var Lq=/[ \f\n\r\t\v\u2028\u2029]+/,kq=function(e){var n=e.children,r=e.breakAll,i=e.style;try{var a=[];Cn(n)||(r?a=n.toString().split(""):a=n.toString().split(Lq));var s=a.map(function(c){return{word:c,width:Rx(c,i).width}}),o=r?0:Rx(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:o}}catch{return null}},hde=function(e,n,r,i,a){var s=e.maxLines,o=e.children,c=e.style,u=e.breakAll,h=mt(s),p=o,v=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Q.reduce(function(V,$){var Y=$.word,ie=$.width,de=V[V.length-1];if(de&&(i==null||a||de.width+ie+r<Number(i)))de.words.push(Y),de.width+=ie+r;else{var X={words:[Y],width:ie};V.push(X)}return V},[])},y=v(n),b=function(Q){return Q.reduce(function(V,$){return V.width>$.width?V:$})};if(!h)return y;for(var w="…",_=function(Q){var V=p.slice(0,Q),$=kq({breakAll:u,style:c,children:V+w}).wordsWithComputedWidth,Y=v($),ie=Y.length>s||b(Y).width>Number(i);return[ie,Y]},S=0,E=p.length-1,T=0,P;S<=E&&T<=p.length-1;){var R=Math.floor((S+E)/2),D=R-1,I=_(D),k=$z(I,2),B=k[0],U=k[1],z=_(R),q=$z(z,1),W=q[0];if(!B&&!W&&(S=R+1),B&&W&&(E=R-1),!B&&W){P=U;break}T++}return P||y},Kz=function(e){var n=Cn(e)?[]:e.toString().split(Lq);return[{words:n}]},pde=function(e){var n=e.width,r=e.scaleToFit,i=e.children,a=e.style,s=e.breakAll,o=e.maxLines;if((n||r)&&!Fp.isSsr){var c,u,h=kq({breakAll:s,children:i,style:a});if(h){var p=h.wordsWithComputedWidth,v=h.spaceWidth;c=p,u=v}else return Kz(i);return hde({breakAll:s,children:i,maxLines:o,style:a},c,u,n,r)}return Kz(i)},Yz="#808080",dw=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,s=e.lineHeight,o=s===void 0?"1em":s,c=e.capHeight,u=c===void 0?"0.71em":c,h=e.scaleToFit,p=h===void 0?!1:h,v=e.textAnchor,y=v===void 0?"start":v,b=e.verticalAnchor,w=b===void 0?"end":b,_=e.fill,S=_===void 0?Yz:_,E=qz(e,sde),T=j.useMemo(function(){return pde({breakAll:E.breakAll,children:E.children,maxLines:E.maxLines,scaleToFit:p,style:E.style,width:E.width})},[E.breakAll,E.children,E.maxLines,p,E.style,E.width]),P=E.dx,R=E.dy,D=E.angle,I=E.className,k=E.breakAll,B=qz(E,ode);if(!ji(r)||!ji(a))return null;var U=r+(mt(P)?P:0),z=a+(mt(R)?R:0),q;switch(w){case"start":q=HP("calc(".concat(u,")"));break;case"middle":q=HP("calc(".concat((T.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:q=HP("calc(".concat(T.length-1," * -").concat(o,")"));break}var W=[];if(p){var ee=T[0].width,Q=E.width;W.push("scale(".concat((mt(Q)?Q/ee:1)/ee,")"))}return D&&W.push("rotate(".concat(D,", ").concat(U,", ").concat(z,")")),W.length&&(B.transform=W.join(" ")),fe.createElement("text",JN({},_n(B,!0),{x:U,y:z,className:In("recharts-text",I),textAnchor:y,fill:S.includes("url")?Yz:S}),T.map(function(V,$){var Y=V.words.join(k?"":" ");return fe.createElement("tspan",{x:U,dy:$===0?q:o,key:"".concat(Y,"-").concat($)},Y)}))};function Md(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function mde(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function LL(t){let e,n,r;t.length!==2?(e=Md,n=(o,c)=>Md(t(o),c),r=(o,c)=>t(o)-c):(e=t===Md||t===mde?t:gde,n=t,r=t);function i(o,c,u=0,h=o.length){if(u<h){if(e(c,c)!==0)return h;do{const p=u+h>>>1;n(o[p],c)<0?u=p+1:h=p}while(u<h)}return u}function a(o,c,u=0,h=o.length){if(u<h){if(e(c,c)!==0)return h;do{const p=u+h>>>1;n(o[p],c)<=0?u=p+1:h=p}while(u<h)}return u}function s(o,c,u=0,h=o.length){const p=i(o,c,u,h-1);return p>u&&r(o[p-1],c)>-r(o[p],c)?p-1:p}return{left:i,center:s,right:a}}function gde(){return 0}function Fq(t){return t===null?NaN:+t}function*vde(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const yde=LL(Md),e1=yde.right;LL(Fq).center;class Jz extends Map{constructor(e,n=_de){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Zz(this,e))}has(e){return super.has(Zz(this,e))}set(e,n){return super.set(xde(this,e),n)}delete(e){return super.delete(bde(this,e))}}function Zz({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function xde({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function bde({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function _de(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Sde(t=Md){if(t===Md)return Uq;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function Uq(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const Ade=Math.sqrt(50),wde=Math.sqrt(10),Mde=Math.sqrt(2);function hw(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=Ade?10:a>=wde?5:a>=Mde?2:1;let o,c,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),c=Math.round(e*u),o/u<t&&++o,c/u>e&&--c,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),c=Math.round(e/u),o*u<t&&++o,c*u>e&&--c),c<o&&.5<=n&&n<2?hw(t,e,n*2):[o,c,u]}function ZN(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,s]=r?hw(e,t,n):hw(t,e,n);if(!(a>=i))return[];const o=a-i+1,c=new Array(o);if(r)if(s<0)for(let u=0;u<o;++u)c[u]=(a-u)/-s;else for(let u=0;u<o;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<o;++u)c[u]=(i+u)/-s;else for(let u=0;u<o;++u)c[u]=(i+u)*s;return c}function QN(t,e,n){return e=+e,t=+t,n=+n,hw(t,e,n)[2]}function eI(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?QN(e,t,n):QN(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Qz(t,e){let n;for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function e9(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function jq(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?Uq:Sde(i);r>n;){if(r-n>600){const c=r-n+1,u=e-n+1,h=Math.log(c),p=.5*Math.exp(2*h/3),v=.5*Math.sqrt(h*p*(c-p)/c)*(u-c/2<0?-1:1),y=Math.max(n,Math.floor(e-u*p/c+v)),b=Math.min(r,Math.floor(e+(c-u)*p/c+v));jq(t,e,y,b,i)}const a=t[e];let s=n,o=r;for(V0(t,n,e),i(t[r],a)>0&&V0(t,n,r);s<o;){for(V0(t,s,o),++s,--o;i(t[s],a)<0;)++s;for(;i(t[o],a)>0;)--o}i(t[n],a)===0?V0(t,n,o):(++o,V0(t,o,r)),o<=e&&(n=o+1),e<=o&&(r=o-1)}return t}function V0(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Ede(t,e,n){if(t=Float64Array.from(vde(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return e9(t);if(e>=1)return Qz(t);var r,i=(r-1)*e,a=Math.floor(i),s=Qz(jq(t,a).subarray(0,a+1)),o=e9(t.subarray(a+1));return s+(o-s)*(i-a)}}function Tde(t,e,n=Fq){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),s=+n(t[a],a,t),o=+n(t[a+1],a+1,t);return s+(o-s)*(i-a)}}function Cde(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(i);++r<i;)a[r]=t+r*n;return a}function Jo(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function df(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const tI=Symbol("implicit");function kL(){var t=new Jz,e=[],n=[],r=tI;function i(a){let s=t.get(a);if(s===void 0){if(r!==tI)return r;t.set(a,s=e.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new Jz;for(const s of a)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return kL(e,n).unknown(r)},Jo.apply(i,arguments),i}function tb(){var t=kL().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,s,o=!1,c=0,u=0,h=.5;delete t.unknown;function p(){var v=e().length,y=i<r,b=y?i:r,w=y?r:i;a=(w-b)/Math.max(1,v-c+u*2),o&&(a=Math.floor(a)),b+=(w-b-a*(v-c))*h,s=a*(1-c),o&&(b=Math.round(b),s=Math.round(s));var _=Cde(v).map(function(S){return b+a*S});return n(y?_.reverse():_)}return t.domain=function(v){return arguments.length?(e(v),p()):e()},t.range=function(v){return arguments.length?([r,i]=v,r=+r,i=+i,p()):[r,i]},t.rangeRound=function(v){return[r,i]=v,r=+r,i=+i,o=!0,p()},t.bandwidth=function(){return s},t.step=function(){return a},t.round=function(v){return arguments.length?(o=!!v,p()):o},t.padding=function(v){return arguments.length?(c=Math.min(1,u=+v),p()):c},t.paddingInner=function(v){return arguments.length?(c=Math.min(1,v),p()):c},t.paddingOuter=function(v){return arguments.length?(u=+v,p()):u},t.align=function(v){return arguments.length?(h=Math.max(0,Math.min(1,v)),p()):h},t.copy=function(){return tb(e(),[r,i]).round(o).paddingInner(c).paddingOuter(u).align(h)},Jo.apply(p(),arguments)}function zq(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return zq(e())},t}function Ox(){return zq(tb.apply(null,arguments).paddingInner(1))}function FL(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Gq(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function t1(){}var nb=.7,pw=1/nb,$g="\\s*([+-]?\\d+)\\s*",rb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Lc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rde=/^#([0-9a-f]{3,8})$/,Ode=new RegExp(`^rgb\\(${$g},${$g},${$g}\\)$`),Pde=new RegExp(`^rgb\\(${Lc},${Lc},${Lc}\\)$`),Dde=new RegExp(`^rgba\\(${$g},${$g},${$g},${rb}\\)$`),Nde=new RegExp(`^rgba\\(${Lc},${Lc},${Lc},${rb}\\)$`),Ide=new RegExp(`^hsl\\(${rb},${Lc},${Lc}\\)$`),Bde=new RegExp(`^hsla\\(${rb},${Lc},${Lc},${rb}\\)$`),t9={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};FL(t1,ib,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:n9,formatHex:n9,formatHex8:Lde,formatHsl:kde,formatRgb:r9,toString:r9});function n9(){return this.rgb().formatHex()}function Lde(){return this.rgb().formatHex8()}function kde(){return Hq(this).formatHsl()}function r9(){return this.rgb().formatRgb()}function ib(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Rde.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?i9(e):n===3?new Is(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?yS(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?yS(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ode.exec(t))?new Is(e[1],e[2],e[3],1):(e=Pde.exec(t))?new Is(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Dde.exec(t))?yS(e[1],e[2],e[3],e[4]):(e=Nde.exec(t))?yS(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ide.exec(t))?o9(e[1],e[2]/100,e[3]/100,1):(e=Bde.exec(t))?o9(e[1],e[2]/100,e[3]/100,e[4]):t9.hasOwnProperty(t)?i9(t9[t]):t==="transparent"?new Is(NaN,NaN,NaN,0):null}function i9(t){return new Is(t>>16&255,t>>8&255,t&255,1)}function yS(t,e,n,r){return r<=0&&(t=e=n=NaN),new Is(t,e,n,r)}function Fde(t){return t instanceof t1||(t=ib(t)),t?(t=t.rgb(),new Is(t.r,t.g,t.b,t.opacity)):new Is}function nI(t,e,n,r){return arguments.length===1?Fde(t):new Is(t,e,n,r??1)}function Is(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}FL(Is,nI,Gq(t1,{brighter(t){return t=t==null?pw:Math.pow(pw,t),new Is(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?nb:Math.pow(nb,t),new Is(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Is(vp(this.r),vp(this.g),vp(this.b),mw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:a9,formatHex:a9,formatHex8:Ude,formatRgb:s9,toString:s9}));function a9(){return`#${ip(this.r)}${ip(this.g)}${ip(this.b)}`}function Ude(){return`#${ip(this.r)}${ip(this.g)}${ip(this.b)}${ip((isNaN(this.opacity)?1:this.opacity)*255)}`}function s9(){const t=mw(this.opacity);return`${t===1?"rgb(":"rgba("}${vp(this.r)}, ${vp(this.g)}, ${vp(this.b)}${t===1?")":`, ${t})`}`}function mw(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function vp(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ip(t){return t=vp(t),(t<16?"0":"")+t.toString(16)}function o9(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Nl(t,e,n,r)}function Hq(t){if(t instanceof Nl)return new Nl(t.h,t.s,t.l,t.opacity);if(t instanceof t1||(t=ib(t)),!t)return new Nl;if(t instanceof Nl)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,o=a-i,c=(a+i)/2;return o?(e===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-e)/o+2:s=(e-n)/o+4,o/=c<.5?a+i:2-a-i,s*=60):o=c>0&&c<1?0:s,new Nl(s,o,c,t.opacity)}function jde(t,e,n,r){return arguments.length===1?Hq(t):new Nl(t,e,n,r??1)}function Nl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}FL(Nl,jde,Gq(t1,{brighter(t){return t=t==null?pw:Math.pow(pw,t),new Nl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?nb:Math.pow(nb,t),new Nl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Is(VP(t>=240?t-240:t+120,i,r),VP(t,i,r),VP(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Nl(l9(this.h),xS(this.s),xS(this.l),mw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=mw(this.opacity);return`${t===1?"hsl(":"hsla("}${l9(this.h)}, ${xS(this.s)*100}%, ${xS(this.l)*100}%${t===1?")":`, ${t})`}`}}));function l9(t){return t=(t||0)%360,t<0?t+360:t}function xS(t){return Math.max(0,Math.min(1,t||0))}function VP(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const UL=t=>()=>t;function zde(t,e){return function(n){return t+n*e}}function Gde(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Hde(t){return(t=+t)==1?Vq:function(e,n){return n-e?Gde(e,n,t):UL(isNaN(e)?n:e)}}function Vq(t,e){var n=e-t;return n?zde(t,n):UL(isNaN(t)?e:t)}const c9=(function t(e){var n=Hde(e);function r(i,a){var s=n((i=nI(i)).r,(a=nI(a)).r),o=n(i.g,a.g),c=n(i.b,a.b),u=Vq(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=c(h),i.opacity=u(h),i+""}}return r.gamma=t,r})(1);function Vde(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function Wde(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function qde(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=Zv(t[s],e[s]);for(;s<n;++s)a[s]=e[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function $de(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function gw(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Xde(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Zv(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var rI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,WP=new RegExp(rI.source,"g");function Kde(t){return function(){return t}}function Yde(t){return function(e){return t(e)+""}}function Jde(t,e){var n=rI.lastIndex=WP.lastIndex=0,r,i,a,s=-1,o=[],c=[];for(t=t+"",e=e+"";(r=rI.exec(t))&&(i=WP.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,c.push({i:s,x:gw(r,i)})),n=WP.lastIndex;return n<e.length&&(a=e.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?c[0]?Yde(c[0].x):Kde(e):(e=c.length,function(u){for(var h=0,p;h<e;++h)o[(p=c[h]).i]=p.x(u);return o.join("")})}function Zv(t,e){var n=typeof e,r;return e==null||n==="boolean"?UL(e):(n==="number"?gw:n==="string"?(r=ib(e))?(e=r,c9):Jde:e instanceof ib?c9:e instanceof Date?$de:Wde(e)?Vde:Array.isArray(e)?qde:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Xde:gw)(t,e)}function jL(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Zde(t,e){e===void 0&&(e=t,t=Zv);for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n<r;)a[n]=t(i,i=e[++n]);return function(s){var o=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return a[o](s-o)}}function Qde(t){return function(){return t}}function vw(t){return+t}var u9=[0,1];function as(t){return t}function iI(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Qde(isNaN(e)?NaN:.5)}function ehe(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function the(t,e,n){var r=t[0],i=t[1],a=e[0],s=e[1];return i<r?(r=iI(i,r),a=n(s,a)):(r=iI(r,i),a=n(a,s)),function(o){return a(r(o))}}function nhe(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)i[s]=iI(t[s],t[s+1]),a[s]=n(e[s],e[s+1]);return function(o){var c=e1(t,o,1,r)-1;return a[c](i[c](o))}}function n1(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function SE(){var t=u9,e=u9,n=Zv,r,i,a,s=as,o,c,u;function h(){var v=Math.min(t.length,e.length);return s!==as&&(s=ehe(t[0],t[v-1])),o=v>2?nhe:the,c=u=null,p}function p(v){return v==null||isNaN(v=+v)?a:(c||(c=o(t.map(r),e,n)))(r(s(v)))}return p.invert=function(v){return s(i((u||(u=o(e,t.map(r),gw)))(v)))},p.domain=function(v){return arguments.length?(t=Array.from(v,vw),h()):t.slice()},p.range=function(v){return arguments.length?(e=Array.from(v),h()):e.slice()},p.rangeRound=function(v){return e=Array.from(v),n=jL,h()},p.clamp=function(v){return arguments.length?(s=v?!0:as,h()):s!==as},p.interpolate=function(v){return arguments.length?(n=v,h()):n},p.unknown=function(v){return arguments.length?(a=v,p):a},function(v,y){return r=v,i=y,h()}}function zL(){return SE()(as,as)}function rhe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function yw(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function lv(t){return t=yw(Math.abs(t)),t?t[1]:NaN}function ihe(t,e){return function(n,r){for(var i=n.length,a=[],s=0,o=t[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),a.push(n.substring(i-=o,i+o)),!((c+=o+1)>r));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function ahe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var she=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ab(t){if(!(e=she.exec(t)))throw new Error("invalid format: "+t);var e;return new GL({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}ab.prototype=GL.prototype;function GL(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}GL.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ohe(t){e:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break e;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Wq;function lhe(t,e){var n=yw(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Wq=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+yw(t,Math.max(0,e+a-1))[0]}function f9(t,e){var n=yw(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const d9={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:rhe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>f9(t*100,e),r:f9,s:lhe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function h9(t){return t}var p9=Array.prototype.map,m9=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function che(t){var e=t.grouping===void 0||t.thousands===void 0?h9:ihe(p9.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?h9:ahe(p9.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function u(p){p=ab(p);var v=p.fill,y=p.align,b=p.sign,w=p.symbol,_=p.zero,S=p.width,E=p.comma,T=p.precision,P=p.trim,R=p.type;R==="n"?(E=!0,R="g"):d9[R]||(T===void 0&&(T=12),P=!0,R="g"),(_||v==="0"&&y==="=")&&(_=!0,v="0",y="=");var D=w==="$"?n:w==="#"&&/[boxX]/.test(R)?"0"+R.toLowerCase():"",I=w==="$"?r:/[%p]/.test(R)?s:"",k=d9[R],B=/[defgprs%]/.test(R);T=T===void 0?6:/[gprs]/.test(R)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function U(z){var q=D,W=I,ee,Q,V;if(R==="c")W=k(z)+W,z="";else{z=+z;var $=z<0||1/z<0;if(z=isNaN(z)?c:k(Math.abs(z),T),P&&(z=ohe(z)),$&&+z==0&&b!=="+"&&($=!1),q=($?b==="("?b:o:b==="-"||b==="("?"":b)+q,W=(R==="s"?m9[8+Wq/3]:"")+W+($&&b==="("?")":""),B){for(ee=-1,Q=z.length;++ee<Q;)if(V=z.charCodeAt(ee),48>V||V>57){W=(V===46?i+z.slice(ee+1):z.slice(ee))+W,z=z.slice(0,ee);break}}}E&&!_&&(z=e(z,1/0));var Y=q.length+z.length+W.length,ie=Y<S?new Array(S-Y+1).join(v):"";switch(E&&_&&(z=e(ie+z,ie.length?S-W.length:1/0),ie=""),y){case"<":z=q+z+W+ie;break;case"=":z=q+ie+z+W;break;case"^":z=ie.slice(0,Y=ie.length>>1)+q+z+W+ie.slice(Y);break;default:z=ie+q+z+W;break}return a(z)}return U.toString=function(){return p+""},U}function h(p,v){var y=u((p=ab(p),p.type="f",p)),b=Math.max(-8,Math.min(8,Math.floor(lv(v)/3)))*3,w=Math.pow(10,-b),_=m9[8+b/3];return function(S){return y(w*S)+_}}return{format:u,formatPrefix:h}}var bS,HL,qq;uhe({thousands:",",grouping:[3],currency:["$",""]});function uhe(t){return bS=che(t),HL=bS.format,qq=bS.formatPrefix,bS}function fhe(t){return Math.max(0,-lv(Math.abs(t)))}function dhe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(lv(e)/3)))*3-lv(Math.abs(t)))}function hhe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,lv(e)-lv(t))+1}function $q(t,e,n,r){var i=eI(t,e,n),a;switch(r=ab(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=dhe(i,s))&&(r.precision=a),qq(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=hhe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=fhe(i))&&(r.precision=a-(r.type==="%")*2);break}}return HL(r)}function Fd(t){var e=t.domain;return t.ticks=function(n){var r=e();return ZN(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return $q(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,s=r[i],o=r[a],c,u,h=10;for(o<s&&(u=s,s=o,o=u,u=i,i=a,a=u);h-- >0;){if(u=QN(s,o,n),u===c)return r[i]=s,r[a]=o,e(r);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;c=u}return t},t}function xw(){var t=zL();return t.copy=function(){return n1(t,xw())},Jo.apply(t,arguments),Fd(t)}function Xq(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,vw),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Xq(t).unknown(e)},t=arguments.length?Array.from(t,vw):[0,1],Fd(n)}function Kq(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],a=t[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),t[n]=e.floor(i),t[r]=e.ceil(a),t}function g9(t){return Math.log(t)}function v9(t){return Math.exp(t)}function phe(t){return-Math.log(-t)}function mhe(t){return-Math.exp(-t)}function ghe(t){return isFinite(t)?+("1e"+t):t<0?0:t}function vhe(t){return t===10?ghe:t===Math.E?Math.exp:e=>Math.pow(t,e)}function yhe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function y9(t){return(e,n)=>-t(-e,n)}function VL(t){const e=t(g9,v9),n=e.domain;let r=10,i,a;function s(){return i=yhe(r),a=vhe(r),n()[0]<0?(i=y9(i),a=y9(a),t(phe,mhe)):t(g9,v9),e}return e.base=function(o){return arguments.length?(r=+o,s()):r},e.domain=function(o){return arguments.length?(n(o),s()):n()},e.ticks=o=>{const c=n();let u=c[0],h=c[c.length-1];const p=h<u;p&&([u,h]=[h,u]);let v=i(u),y=i(h),b,w;const _=o==null?10:+o;let S=[];if(!(r%1)&&y-v<_){if(v=Math.floor(v),y=Math.ceil(y),u>0){for(;v<=y;++v)for(b=1;b<r;++b)if(w=v<0?b/a(-v):b*a(v),!(w<u)){if(w>h)break;S.push(w)}}else for(;v<=y;++v)for(b=r-1;b>=1;--b)if(w=v>0?b/a(-v):b*a(v),!(w<u)){if(w>h)break;S.push(w)}S.length*2<_&&(S=ZN(u,h,_))}else S=ZN(v,y,Math.min(y-v,_)).map(a);return p?S.reverse():S},e.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=ab(c)).precision==null&&(c.trim=!0),c=HL(c)),o===1/0)return c;const u=Math.max(1,r*o/e.ticks().length);return h=>{let p=h/a(Math.round(i(h)));return p*r<r-.5&&(p*=r),p<=u?c(h):""}},e.nice=()=>n(Kq(n(),{floor:o=>a(Math.floor(i(o))),ceil:o=>a(Math.ceil(i(o)))})),e}function Yq(){const t=VL(SE()).domain([1,10]);return t.copy=()=>n1(t,Yq()).base(t.base()),Jo.apply(t,arguments),t}function x9(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function b9(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function WL(t){var e=1,n=t(x9(e),b9(e));return n.constant=function(r){return arguments.length?t(x9(e=+r),b9(e)):e},Fd(n)}function Jq(){var t=WL(SE());return t.copy=function(){return n1(t,Jq()).constant(t.constant())},Jo.apply(t,arguments)}function _9(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function xhe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function bhe(t){return t<0?-t*t:t*t}function qL(t){var e=t(as,as),n=1;function r(){return n===1?t(as,as):n===.5?t(xhe,bhe):t(_9(n),_9(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Fd(e)}function $L(){var t=qL(SE());return t.copy=function(){return n1(t,$L()).exponent(t.exponent())},Jo.apply(t,arguments),t}function _he(){return $L.apply(null,arguments).exponent(.5)}function S9(t){return Math.sign(t)*t*t}function She(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Zq(){var t=zL(),e=[0,1],n=!1,r;function i(a){var s=She(t(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return t.invert(S9(a))},i.domain=function(a){return arguments.length?(t.domain(a),i):t.domain()},i.range=function(a){return arguments.length?(t.range((e=Array.from(a,vw)).map(S9)),i):e.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(t.clamp(a),i):t.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Zq(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Jo.apply(i,arguments),Fd(i)}function Qq(){var t=[],e=[],n=[],r;function i(){var s=0,o=Math.max(1,e.length);for(n=new Array(o-1);++s<o;)n[s-1]=Tde(t,s/o);return a}function a(s){return s==null||isNaN(s=+s)?r:e[e1(n,s)]}return a.invertExtent=function(s){var o=e.indexOf(s);return o<0?[NaN,NaN]:[o>0?n[o-1]:t[0],o<n.length?n[o]:t[t.length-1]]},a.domain=function(s){if(!arguments.length)return t.slice();t=[];for(let o of s)o!=null&&!isNaN(o=+o)&&t.push(o);return t.sort(Md),i()},a.range=function(s){return arguments.length?(e=Array.from(s),i()):e.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return Qq().domain(t).range(e).unknown(r)},Jo.apply(a,arguments)}function e$(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[e1(r,c,0,n)]:a}function o(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*e-(c-n)*t)/(n+1);return s}return s.domain=function(c){return arguments.length?([t,e]=c,t=+t,e=+e,o()):[t,e]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,o()):i.slice()},s.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[t,r[0]]:u>=n?[r[n-1],e]:[r[u-1],r[u]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return e$().domain([t,e]).range(i).unknown(a)},Jo.apply(Fd(s),arguments)}function t$(){var t=[.5],e=[0,1],n,r=1;function i(a){return a!=null&&a<=a?e[e1(t,a,0,r)]:n}return i.domain=function(a){return arguments.length?(t=Array.from(a),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(a){return arguments.length?(e=Array.from(a),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(a){var s=e.indexOf(a);return[t[s-1],t[s]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return t$().domain(t).range(e).unknown(n)},Jo.apply(i,arguments)}const qP=new Date,$P=new Date;function Vi(t,e,n,r){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const c=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return c;let u;do c.push(u=new Date(+a)),e(a,o),t(a);while(u<a&&a<s);return c},i.filter=a=>Vi(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),n&&(i.count=(a,s)=>(qP.setTime(+a),$P.setTime(+s),t(qP),t($P),Math.floor(n(qP,$P))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const bw=Vi(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);bw.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Vi(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):bw);bw.range;const Hu=1e3,jo=Hu*60,Vu=jo*60,nf=Vu*24,XL=nf*7,A9=nf*30,XP=nf*365,ap=Vi(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Hu)},(t,e)=>(e-t)/Hu,t=>t.getUTCSeconds());ap.range;const KL=Vi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hu)},(t,e)=>{t.setTime(+t+e*jo)},(t,e)=>(e-t)/jo,t=>t.getMinutes());KL.range;const YL=Vi(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*jo)},(t,e)=>(e-t)/jo,t=>t.getUTCMinutes());YL.range;const JL=Vi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hu-t.getMinutes()*jo)},(t,e)=>{t.setTime(+t+e*Vu)},(t,e)=>(e-t)/Vu,t=>t.getHours());JL.range;const ZL=Vi(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Vu)},(t,e)=>(e-t)/Vu,t=>t.getUTCHours());ZL.range;const r1=Vi(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*jo)/nf,t=>t.getDate()-1);r1.range;const AE=Vi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/nf,t=>t.getUTCDate()-1);AE.range;const n$=Vi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/nf,t=>Math.floor(t/nf));n$.range;function Up(t){return Vi(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*jo)/XL)}const wE=Up(0),_w=Up(1),Ahe=Up(2),whe=Up(3),cv=Up(4),Mhe=Up(5),Ehe=Up(6);wE.range;_w.range;Ahe.range;whe.range;cv.range;Mhe.range;Ehe.range;function jp(t){return Vi(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/XL)}const ME=jp(0),Sw=jp(1),The=jp(2),Che=jp(3),uv=jp(4),Rhe=jp(5),Ohe=jp(6);ME.range;Sw.range;The.range;Che.range;uv.range;Rhe.range;Ohe.range;const QL=Vi(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());QL.range;const e5=Vi(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());e5.range;const rf=Vi(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());rf.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Vi(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});rf.range;const af=Vi(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());af.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Vi(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});af.range;function r$(t,e,n,r,i,a){const s=[[ap,1,Hu],[ap,5,5*Hu],[ap,15,15*Hu],[ap,30,30*Hu],[a,1,jo],[a,5,5*jo],[a,15,15*jo],[a,30,30*jo],[i,1,Vu],[i,3,3*Vu],[i,6,6*Vu],[i,12,12*Vu],[r,1,nf],[r,2,2*nf],[n,1,XL],[e,1,A9],[e,3,3*A9],[t,1,XP]];function o(u,h,p){const v=h<u;v&&([u,h]=[h,u]);const y=p&&typeof p.range=="function"?p:c(u,h,p),b=y?y.range(u,+h+1):[];return v?b.reverse():b}function c(u,h,p){const v=Math.abs(h-u)/p,y=LL(([,,_])=>_).right(s,v);if(y===s.length)return t.every(eI(u/XP,h/XP,p));if(y===0)return bw.every(Math.max(eI(u,h,p),1));const[b,w]=s[v/s[y-1][2]<s[y][2]/v?y-1:y];return b.every(w)}return[o,c]}const[Phe,Dhe]=r$(af,e5,ME,n$,ZL,YL),[Nhe,Ihe]=r$(rf,QL,wE,r1,JL,KL);function KP(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function YP(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function W0(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Bhe(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,s=t.shortDays,o=t.months,c=t.shortMonths,u=q0(i),h=$0(i),p=q0(a),v=$0(a),y=q0(s),b=$0(s),w=q0(o),_=$0(o),S=q0(c),E=$0(c),T={a:$,A:Y,b:ie,B:de,c:null,d:R9,e:R9,f:ipe,g:ppe,G:gpe,H:tpe,I:npe,j:rpe,L:i$,m:ape,M:spe,p:X,q:ae,Q:D9,s:N9,S:ope,u:lpe,U:cpe,V:upe,w:fpe,W:dpe,x:null,X:null,y:hpe,Y:mpe,Z:vpe,"%":P9},P={a:ue,A:Se,b:$e,B:me,c:null,d:O9,e:O9,f:_pe,g:Ppe,G:Npe,H:ype,I:xpe,j:bpe,L:s$,m:Spe,M:Ape,p:ve,q:We,Q:D9,s:N9,S:wpe,u:Mpe,U:Epe,V:Tpe,w:Cpe,W:Rpe,x:null,X:null,y:Ope,Y:Dpe,Z:Ipe,"%":P9},R={a:U,A:z,b:q,B:W,c:ee,d:T9,e:T9,f:Jhe,g:E9,G:M9,H:C9,I:C9,j:$he,L:Yhe,m:qhe,M:Xhe,p:B,q:Whe,Q:Qhe,s:epe,S:Khe,u:jhe,U:zhe,V:Ghe,w:Uhe,W:Hhe,x:Q,X:V,y:E9,Y:M9,Z:Vhe,"%":Zhe};T.x=D(n,T),T.X=D(r,T),T.c=D(e,T),P.x=D(n,P),P.X=D(r,P),P.c=D(e,P);function D(_e,Fe){return function(Xe){var Re=[],ot=-1,we=0,Ue=_e.length,Be,Ye,re;for(Xe instanceof Date||(Xe=new Date(+Xe));++ot<Ue;)_e.charCodeAt(ot)===37&&(Re.push(_e.slice(we,ot)),(Ye=w9[Be=_e.charAt(++ot)])!=null?Be=_e.charAt(++ot):Ye=Be==="e"?" ":"0",(re=Fe[Be])&&(Be=re(Xe,Ye)),Re.push(Be),we=ot+1);return Re.push(_e.slice(we,ot)),Re.join("")}}function I(_e,Fe){return function(Xe){var Re=W0(1900,void 0,1),ot=k(Re,_e,Xe+="",0),we,Ue;if(ot!=Xe.length)return null;if("Q"in Re)return new Date(Re.Q);if("s"in Re)return new Date(Re.s*1e3+("L"in Re?Re.L:0));if(Fe&&!("Z"in Re)&&(Re.Z=0),"p"in Re&&(Re.H=Re.H%12+Re.p*12),Re.m===void 0&&(Re.m="q"in Re?Re.q:0),"V"in Re){if(Re.V<1||Re.V>53)return null;"w"in Re||(Re.w=1),"Z"in Re?(we=YP(W0(Re.y,0,1)),Ue=we.getUTCDay(),we=Ue>4||Ue===0?Sw.ceil(we):Sw(we),we=AE.offset(we,(Re.V-1)*7),Re.y=we.getUTCFullYear(),Re.m=we.getUTCMonth(),Re.d=we.getUTCDate()+(Re.w+6)%7):(we=KP(W0(Re.y,0,1)),Ue=we.getDay(),we=Ue>4||Ue===0?_w.ceil(we):_w(we),we=r1.offset(we,(Re.V-1)*7),Re.y=we.getFullYear(),Re.m=we.getMonth(),Re.d=we.getDate()+(Re.w+6)%7)}else("W"in Re||"U"in Re)&&("w"in Re||(Re.w="u"in Re?Re.u%7:"W"in Re?1:0),Ue="Z"in Re?YP(W0(Re.y,0,1)).getUTCDay():KP(W0(Re.y,0,1)).getDay(),Re.m=0,Re.d="W"in Re?(Re.w+6)%7+Re.W*7-(Ue+5)%7:Re.w+Re.U*7-(Ue+6)%7);return"Z"in Re?(Re.H+=Re.Z/100|0,Re.M+=Re.Z%100,YP(Re)):KP(Re)}}function k(_e,Fe,Xe,Re){for(var ot=0,we=Fe.length,Ue=Xe.length,Be,Ye;ot<we;){if(Re>=Ue)return-1;if(Be=Fe.charCodeAt(ot++),Be===37){if(Be=Fe.charAt(ot++),Ye=R[Be in w9?Fe.charAt(ot++):Be],!Ye||(Re=Ye(_e,Xe,Re))<0)return-1}else if(Be!=Xe.charCodeAt(Re++))return-1}return Re}function B(_e,Fe,Xe){var Re=u.exec(Fe.slice(Xe));return Re?(_e.p=h.get(Re[0].toLowerCase()),Xe+Re[0].length):-1}function U(_e,Fe,Xe){var Re=y.exec(Fe.slice(Xe));return Re?(_e.w=b.get(Re[0].toLowerCase()),Xe+Re[0].length):-1}function z(_e,Fe,Xe){var Re=p.exec(Fe.slice(Xe));return Re?(_e.w=v.get(Re[0].toLowerCase()),Xe+Re[0].length):-1}function q(_e,Fe,Xe){var Re=S.exec(Fe.slice(Xe));return Re?(_e.m=E.get(Re[0].toLowerCase()),Xe+Re[0].length):-1}function W(_e,Fe,Xe){var Re=w.exec(Fe.slice(Xe));return Re?(_e.m=_.get(Re[0].toLowerCase()),Xe+Re[0].length):-1}function ee(_e,Fe,Xe){return k(_e,e,Fe,Xe)}function Q(_e,Fe,Xe){return k(_e,n,Fe,Xe)}function V(_e,Fe,Xe){return k(_e,r,Fe,Xe)}function $(_e){return s[_e.getDay()]}function Y(_e){return a[_e.getDay()]}function ie(_e){return c[_e.getMonth()]}function de(_e){return o[_e.getMonth()]}function X(_e){return i[+(_e.getHours()>=12)]}function ae(_e){return 1+~~(_e.getMonth()/3)}function ue(_e){return s[_e.getUTCDay()]}function Se(_e){return a[_e.getUTCDay()]}function $e(_e){return c[_e.getUTCMonth()]}function me(_e){return o[_e.getUTCMonth()]}function ve(_e){return i[+(_e.getUTCHours()>=12)]}function We(_e){return 1+~~(_e.getUTCMonth()/3)}return{format:function(_e){var Fe=D(_e+="",T);return Fe.toString=function(){return _e},Fe},parse:function(_e){var Fe=I(_e+="",!1);return Fe.toString=function(){return _e},Fe},utcFormat:function(_e){var Fe=D(_e+="",P);return Fe.toString=function(){return _e},Fe},utcParse:function(_e){var Fe=I(_e+="",!0);return Fe.toString=function(){return _e},Fe}}}var w9={"-":"",_:" ",0:"0"},Qi=/^\s*\d+/,Lhe=/^%/,khe=/[\\^$*+?|[\]().{}]/g;function Kn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(e)+i:i)}function Fhe(t){return t.replace(khe,"\\$&")}function q0(t){return new RegExp("^(?:"+t.map(Fhe).join("|")+")","i")}function $0(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Uhe(t,e,n){var r=Qi.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function jhe(t,e,n){var r=Qi.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function zhe(t,e,n){var r=Qi.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Ghe(t,e,n){var r=Qi.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hhe(t,e,n){var r=Qi.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function M9(t,e,n){var r=Qi.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function E9(t,e,n){var r=Qi.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Vhe(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Whe(t,e,n){var r=Qi.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function qhe(t,e,n){var r=Qi.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function T9(t,e,n){var r=Qi.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function $he(t,e,n){var r=Qi.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function C9(t,e,n){var r=Qi.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Xhe(t,e,n){var r=Qi.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Khe(t,e,n){var r=Qi.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Yhe(t,e,n){var r=Qi.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Jhe(t,e,n){var r=Qi.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Zhe(t,e,n){var r=Lhe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Qhe(t,e,n){var r=Qi.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function epe(t,e,n){var r=Qi.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function R9(t,e){return Kn(t.getDate(),e,2)}function tpe(t,e){return Kn(t.getHours(),e,2)}function npe(t,e){return Kn(t.getHours()%12||12,e,2)}function rpe(t,e){return Kn(1+r1.count(rf(t),t),e,3)}function i$(t,e){return Kn(t.getMilliseconds(),e,3)}function ipe(t,e){return i$(t,e)+"000"}function ape(t,e){return Kn(t.getMonth()+1,e,2)}function spe(t,e){return Kn(t.getMinutes(),e,2)}function ope(t,e){return Kn(t.getSeconds(),e,2)}function lpe(t){var e=t.getDay();return e===0?7:e}function cpe(t,e){return Kn(wE.count(rf(t)-1,t),e,2)}function a$(t){var e=t.getDay();return e>=4||e===0?cv(t):cv.ceil(t)}function upe(t,e){return t=a$(t),Kn(cv.count(rf(t),t)+(rf(t).getDay()===4),e,2)}function fpe(t){return t.getDay()}function dpe(t,e){return Kn(_w.count(rf(t)-1,t),e,2)}function hpe(t,e){return Kn(t.getFullYear()%100,e,2)}function ppe(t,e){return t=a$(t),Kn(t.getFullYear()%100,e,2)}function mpe(t,e){return Kn(t.getFullYear()%1e4,e,4)}function gpe(t,e){var n=t.getDay();return t=n>=4||n===0?cv(t):cv.ceil(t),Kn(t.getFullYear()%1e4,e,4)}function vpe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Kn(e/60|0,"0",2)+Kn(e%60,"0",2)}function O9(t,e){return Kn(t.getUTCDate(),e,2)}function ype(t,e){return Kn(t.getUTCHours(),e,2)}function xpe(t,e){return Kn(t.getUTCHours()%12||12,e,2)}function bpe(t,e){return Kn(1+AE.count(af(t),t),e,3)}function s$(t,e){return Kn(t.getUTCMilliseconds(),e,3)}function _pe(t,e){return s$(t,e)+"000"}function Spe(t,e){return Kn(t.getUTCMonth()+1,e,2)}function Ape(t,e){return Kn(t.getUTCMinutes(),e,2)}function wpe(t,e){return Kn(t.getUTCSeconds(),e,2)}function Mpe(t){var e=t.getUTCDay();return e===0?7:e}function Epe(t,e){return Kn(ME.count(af(t)-1,t),e,2)}function o$(t){var e=t.getUTCDay();return e>=4||e===0?uv(t):uv.ceil(t)}function Tpe(t,e){return t=o$(t),Kn(uv.count(af(t),t)+(af(t).getUTCDay()===4),e,2)}function Cpe(t){return t.getUTCDay()}function Rpe(t,e){return Kn(Sw.count(af(t)-1,t),e,2)}function Ope(t,e){return Kn(t.getUTCFullYear()%100,e,2)}function Ppe(t,e){return t=o$(t),Kn(t.getUTCFullYear()%100,e,2)}function Dpe(t,e){return Kn(t.getUTCFullYear()%1e4,e,4)}function Npe(t,e){var n=t.getUTCDay();return t=n>=4||n===0?uv(t):uv.ceil(t),Kn(t.getUTCFullYear()%1e4,e,4)}function Ipe(){return"+0000"}function P9(){return"%"}function D9(t){return+t}function N9(t){return Math.floor(+t/1e3)}var ng,l$,c$;Bpe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Bpe(t){return ng=Bhe(t),l$=ng.format,ng.parse,c$=ng.utcFormat,ng.utcParse,ng}function Lpe(t){return new Date(t)}function kpe(t){return t instanceof Date?+t:+new Date(+t)}function t5(t,e,n,r,i,a,s,o,c,u){var h=zL(),p=h.invert,v=h.domain,y=u(".%L"),b=u(":%S"),w=u("%I:%M"),_=u("%I %p"),S=u("%a %d"),E=u("%b %d"),T=u("%B"),P=u("%Y");function R(D){return(c(D)<D?y:o(D)<D?b:s(D)<D?w:a(D)<D?_:r(D)<D?i(D)<D?S:E:n(D)<D?T:P)(D)}return h.invert=function(D){return new Date(p(D))},h.domain=function(D){return arguments.length?v(Array.from(D,kpe)):v().map(Lpe)},h.ticks=function(D){var I=v();return t(I[0],I[I.length-1],D??10)},h.tickFormat=function(D,I){return I==null?R:u(I)},h.nice=function(D){var I=v();return(!D||typeof D.range!="function")&&(D=e(I[0],I[I.length-1],D??10)),D?v(Kq(I,D)):h},h.copy=function(){return n1(h,t5(t,e,n,r,i,a,s,o,c,u))},h}function Fpe(){return Jo.apply(t5(Nhe,Ihe,rf,QL,wE,r1,JL,KL,ap,l$).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Upe(){return Jo.apply(t5(Phe,Dhe,af,e5,ME,AE,ZL,YL,ap,c$).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function EE(){var t=0,e=1,n,r,i,a,s=as,o=!1,c;function u(p){return p==null||isNaN(p=+p)?c:s(i===0?.5:(p=(a(p)-n)*i,o?Math.max(0,Math.min(1,p)):p))}u.domain=function(p){return arguments.length?([t,e]=p,n=a(t=+t),r=a(e=+e),i=n===r?0:1/(r-n),u):[t,e]},u.clamp=function(p){return arguments.length?(o=!!p,u):o},u.interpolator=function(p){return arguments.length?(s=p,u):s};function h(p){return function(v){var y,b;return arguments.length?([y,b]=v,s=p(y,b),u):[s(0),s(1)]}}return u.range=h(Zv),u.rangeRound=h(jL),u.unknown=function(p){return arguments.length?(c=p,u):c},function(p){return a=p,n=p(t),r=p(e),i=n===r?0:1/(r-n),u}}function Ud(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function u$(){var t=Fd(EE()(as));return t.copy=function(){return Ud(t,u$())},df.apply(t,arguments)}function f$(){var t=VL(EE()).domain([1,10]);return t.copy=function(){return Ud(t,f$()).base(t.base())},df.apply(t,arguments)}function d$(){var t=WL(EE());return t.copy=function(){return Ud(t,d$()).constant(t.constant())},df.apply(t,arguments)}function n5(){var t=qL(EE());return t.copy=function(){return Ud(t,n5()).exponent(t.exponent())},df.apply(t,arguments)}function jpe(){return n5.apply(null,arguments).exponent(.5)}function h$(){var t=[],e=as;function n(r){if(r!=null&&!isNaN(r=+r))return e((e1(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(Md),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>Ede(t,a/r))},n.copy=function(){return h$(e).domain(t)},df.apply(n,arguments)}function TE(){var t=0,e=.5,n=1,r=1,i,a,s,o,c,u=as,h,p=!1,v;function y(w){return isNaN(w=+w)?v:(w=.5+((w=+h(w))-a)*(r*w<r*a?o:c),u(p?Math.max(0,Math.min(1,w)):w))}y.domain=function(w){return arguments.length?([t,e,n]=w,i=h(t=+t),a=h(e=+e),s=h(n=+n),o=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,y):[t,e,n]},y.clamp=function(w){return arguments.length?(p=!!w,y):p},y.interpolator=function(w){return arguments.length?(u=w,y):u};function b(w){return function(_){var S,E,T;return arguments.length?([S,E,T]=_,u=Zde(w,[S,E,T]),y):[u(0),u(.5),u(1)]}}return y.range=b(Zv),y.rangeRound=b(jL),y.unknown=function(w){return arguments.length?(v=w,y):v},function(w){return h=w,i=w(t),a=w(e),s=w(n),o=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,y}}function p$(){var t=Fd(TE()(as));return t.copy=function(){return Ud(t,p$())},df.apply(t,arguments)}function m$(){var t=VL(TE()).domain([.1,1,10]);return t.copy=function(){return Ud(t,m$()).base(t.base())},df.apply(t,arguments)}function g$(){var t=WL(TE());return t.copy=function(){return Ud(t,g$()).constant(t.constant())},df.apply(t,arguments)}function r5(){var t=qL(TE());return t.copy=function(){return Ud(t,r5()).exponent(t.exponent())},df.apply(t,arguments)}function zpe(){return r5.apply(null,arguments).exponent(.5)}const I9=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:tb,scaleDiverging:p$,scaleDivergingLog:m$,scaleDivergingPow:r5,scaleDivergingSqrt:zpe,scaleDivergingSymlog:g$,scaleIdentity:Xq,scaleImplicit:tI,scaleLinear:xw,scaleLog:Yq,scaleOrdinal:kL,scalePoint:Ox,scalePow:$L,scaleQuantile:Qq,scaleQuantize:e$,scaleRadial:Zq,scaleSequential:u$,scaleSequentialLog:f$,scaleSequentialPow:n5,scaleSequentialQuantile:h$,scaleSequentialSqrt:jpe,scaleSequentialSymlog:d$,scaleSqrt:_he,scaleSymlog:Jq,scaleThreshold:t$,scaleTime:Fpe,scaleUtc:Upe,tickFormat:$q},Symbol.toStringTag,{value:"Module"}));var JP,B9;function v$(){if(B9)return JP;B9=1;var t=$v();function e(n,r,i){for(var a=-1,s=n.length;++a<s;){var o=n[a],c=r(o);if(c!=null&&(u===void 0?c===c&&!t(c):i(c,u)))var u=c,h=o}return h}return JP=e,JP}var ZP,L9;function Gpe(){if(L9)return ZP;L9=1;function t(e,n){return e>n}return ZP=t,ZP}var QP,k9;function Hpe(){if(k9)return QP;k9=1;var t=v$(),e=Gpe(),n=Jv();function r(i){return i&&i.length?t(i,n,e):void 0}return QP=r,QP}var Vpe=Hpe();const bd=ar(Vpe);var e3,F9;function Wpe(){if(F9)return e3;F9=1;function t(e,n){return e<n}return e3=t,e3}var t3,U9;function qpe(){if(U9)return t3;U9=1;var t=v$(),e=Wpe(),n=Jv();function r(i){return i&&i.length?t(i,n,e):void 0}return t3=r,t3}var $pe=qpe();const CE=ar($pe);var n3,j9;function Xpe(){if(j9)return n3;j9=1;var t=xL(),e=kd(),n=wq(),r=ks();function i(a,s){var o=r(a)?t:n;return o(a,e(s,3))}return n3=i,n3}var r3,z9;function Kpe(){if(z9)return r3;z9=1;var t=Sq(),e=Xpe();function n(r,i){return t(e(r,i),1)}return r3=n,r3}var Ype=Kpe();const Jpe=ar(Ype);var i3,G9;function Zpe(){if(G9)return i3;G9=1;var t=DL();function e(n,r){return t(n,r)}return i3=e,i3}var Qpe=Zpe();const fv=ar(Qpe);var Qv=1e9,eme={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},a5,zr=!0,Xo="[DecimalError] ",yp=Xo+"Invalid argument: ",i5=Xo+"Exponent out of range: ",ey=Math.floor,Jh=Math.pow,tme=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Js,Ji=1e7,Ir=7,y$=9007199254740991,Aw=ey(y$/Ir),Ot={};Ot.absoluteValue=Ot.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};Ot.comparedTo=Ot.cmp=function(t){var e,n,r,i,a=this;if(t=new a.constructor(t),a.s!==t.s)return a.s||-t.s;if(a.e!==t.e)return a.e>t.e^a.s<0?1:-1;for(r=a.d.length,i=t.d.length,e=0,n=r<i?r:i;e<n;++e)if(a.d[e]!==t.d[e])return a.d[e]>t.d[e]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Ot.decimalPlaces=Ot.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Ir;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Ot.dividedBy=Ot.div=function(t){return Yu(this,new this.constructor(t))};Ot.dividedToIntegerBy=Ot.idiv=function(t){var e=this,n=e.constructor;return gr(Yu(e,new n(t),0,1),n.precision)};Ot.equals=Ot.eq=function(t){return!this.cmp(t)};Ot.exponent=function(){return Ri(this)};Ot.greaterThan=Ot.gt=function(t){return this.cmp(t)>0};Ot.greaterThanOrEqualTo=Ot.gte=function(t){return this.cmp(t)>=0};Ot.isInteger=Ot.isint=function(){return this.e>this.d.length-2};Ot.isNegative=Ot.isneg=function(){return this.s<0};Ot.isPositive=Ot.ispos=function(){return this.s>0};Ot.isZero=function(){return this.s===0};Ot.lessThan=Ot.lt=function(t){return this.cmp(t)<0};Ot.lessThanOrEqualTo=Ot.lte=function(t){return this.cmp(t)<1};Ot.logarithm=Ot.log=function(t){var e,n=this,r=n.constructor,i=r.precision,a=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(Js))throw Error(Xo+"NaN");if(n.s<1)throw Error(Xo+(n.s?"NaN":"-Infinity"));return n.eq(Js)?new r(0):(zr=!1,e=Yu(sb(n,a),sb(t,a),a),zr=!0,gr(e,i))};Ot.minus=Ot.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?_$(e,t):x$(e,(t.s=-t.s,t))};Ot.modulo=Ot.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Xo+"NaN");return n.s?(zr=!1,e=Yu(n,t,0,1).times(t),zr=!0,n.minus(e)):gr(new r(n),i)};Ot.naturalExponential=Ot.exp=function(){return b$(this)};Ot.naturalLogarithm=Ot.ln=function(){return sb(this)};Ot.negated=Ot.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Ot.plus=Ot.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?x$(e,t):_$(e,(t.s=-t.s,t))};Ot.precision=Ot.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(yp+t);if(e=Ri(i)+1,r=i.d.length-1,n=r*Ir+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Ot.squareRoot=Ot.sqrt=function(){var t,e,n,r,i,a,s,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(Xo+"NaN")}for(t=Ri(o),zr=!1,i=Math.sqrt(+o),i==0||i==1/0?(e=Oc(o.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=ey((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new c(e)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(a=r,r=a.plus(Yu(o,a,s+2)).times(.5),Oc(a.d).slice(0,s)===(e=Oc(r.d)).slice(0,s)){if(e=e.slice(s-3,s+1),i==s&&e=="4999"){if(gr(a,n+1,0),a.times(a).eq(o)){r=a;break}}else if(e!="9999")break;s+=4}return zr=!0,gr(r,n)};Ot.times=Ot.mul=function(t){var e,n,r,i,a,s,o,c,u,h=this,p=h.constructor,v=h.d,y=(t=new p(t)).d;if(!h.s||!t.s)return new p(0);for(t.s*=h.s,n=h.e+t.e,c=v.length,u=y.length,c<u&&(a=v,v=y,y=a,s=c,c=u,u=s),a=[],s=c+u,r=s;r--;)a.push(0);for(r=u;--r>=0;){for(e=0,i=c+r;i>r;)o=a[i]+y[r]*v[i-r-1]+e,a[i--]=o%Ji|0,e=o/Ji|0;a[i]=(a[i]+e)%Ji|0}for(;!a[--s];)a.pop();return e?++n:a.shift(),t.d=a,t.e=n,zr?gr(t,p.precision):t};Ot.toDecimalPlaces=Ot.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(zc(t,0,Qv),e===void 0?e=r.rounding:zc(e,0,8),gr(n,t+Ri(n)+1,e))};Ot.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=wp(r,!0):(zc(t,0,Qv),e===void 0?e=i.rounding:zc(e,0,8),r=gr(new i(r),t+1,e),n=wp(r,!0,t+1)),n};Ot.toFixed=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?wp(i):(zc(t,0,Qv),e===void 0?e=a.rounding:zc(e,0,8),r=gr(new a(i),t+Ri(i)+1,e),n=wp(r.abs(),!1,t+Ri(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ot.toInteger=Ot.toint=function(){var t=this,e=t.constructor;return gr(new e(t),Ri(t)+1,e.rounding)};Ot.toNumber=function(){return+this};Ot.toPower=Ot.pow=function(t){var e,n,r,i,a,s,o=this,c=o.constructor,u=12,h=+(t=new c(t));if(!t.s)return new c(Js);if(o=new c(o),!o.s){if(t.s<1)throw Error(Xo+"Infinity");return o}if(o.eq(Js))return o;if(r=c.precision,t.eq(Js))return gr(o,r);if(e=t.e,n=t.d.length-1,s=e>=n,a=o.s,s){if((n=h<0?-h:h)<=y$){for(i=new c(Js),e=Math.ceil(r/Ir+4),zr=!1;n%2&&(i=i.times(o),V9(i.d,e)),n=ey(n/2),n!==0;)o=o.times(o),V9(o.d,e);return zr=!0,t.s<0?new c(Js).div(i):gr(i,r)}}else if(a<0)throw Error(Xo+"NaN");return a=a<0&&t.d[Math.max(e,n)]&1?-1:1,o.s=1,zr=!1,i=t.times(sb(o,r+u)),zr=!0,i=b$(i),i.s=a,i};Ot.toPrecision=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?(n=Ri(i),r=wp(i,n<=a.toExpNeg||n>=a.toExpPos)):(zc(t,1,Qv),e===void 0?e=a.rounding:zc(e,0,8),i=gr(new a(i),t,e),n=Ri(i),r=wp(i,t<=n||n<=a.toExpNeg,t)),r};Ot.toSignificantDigits=Ot.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(zc(t,1,Qv),e===void 0?e=r.rounding:zc(e,0,8)),gr(new r(n),t,e)};Ot.toString=Ot.valueOf=Ot.val=Ot.toJSON=Ot[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Ri(t),n=t.constructor;return wp(t,e<=n.toExpNeg||e>=n.toExpPos)};function x$(t,e){var n,r,i,a,s,o,c,u,h=t.constructor,p=h.precision;if(!t.s||!e.s)return e.s||(e=new h(t)),zr?gr(e,p):e;if(c=t.d,u=e.d,s=t.e,i=e.e,c=c.slice(),a=s-i,a){for(a<0?(r=c,a=-a,o=u.length):(r=u,i=s,o=c.length),s=Math.ceil(p/Ir),o=s>o?s+1:o+1,a>o&&(a=o,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(o=c.length,a=u.length,o-a<0&&(a=o,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Ji|0,c[a]%=Ji;for(n&&(c.unshift(n),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=i,zr?gr(e,p):e}function zc(t,e,n){if(t!==~~t||t<e||t>n)throw Error(yp+t)}function Oc(t){var e,n,r,i=t.length-1,a="",s=t[0];if(i>0){for(a+=s,e=1;e<i;e++)r=t[e]+"",n=Ir-r.length,n&&(a+=md(n)),a+=r;s=t[e],r=s+"",n=Ir-r.length,n&&(a+=md(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var Yu=(function(){function t(r,i){var a,s=0,o=r.length;for(r=r.slice();o--;)a=r[o]*i+s,r[o]=a%Ji|0,s=a/Ji|0;return s&&r.unshift(s),r}function e(r,i,a,s){var o,c;if(a!=s)c=a>s?1:-1;else for(o=c=0;o<a;o++)if(r[o]!=i[o]){c=r[o]>i[o]?1:-1;break}return c}function n(r,i,a){for(var s=0;a--;)r[a]-=s,s=r[a]<i[a]?1:0,r[a]=s*Ji+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,s){var o,c,u,h,p,v,y,b,w,_,S,E,T,P,R,D,I,k,B=r.constructor,U=r.s==i.s?1:-1,z=r.d,q=i.d;if(!r.s)return new B(r);if(!i.s)throw Error(Xo+"Division by zero");for(c=r.e-i.e,I=q.length,R=z.length,y=new B(U),b=y.d=[],u=0;q[u]==(z[u]||0);)++u;if(q[u]>(z[u]||0)&&--c,a==null?E=a=B.precision:s?E=a+(Ri(r)-Ri(i))+1:E=a,E<0)return new B(0);if(E=E/Ir+2|0,u=0,I==1)for(h=0,q=q[0],E++;(u<R||h)&&E--;u++)T=h*Ji+(z[u]||0),b[u]=T/q|0,h=T%q|0;else{for(h=Ji/(q[0]+1)|0,h>1&&(q=t(q,h),z=t(z,h),I=q.length,R=z.length),P=I,w=z.slice(0,I),_=w.length;_<I;)w[_++]=0;k=q.slice(),k.unshift(0),D=q[0],q[1]>=Ji/2&&++D;do h=0,o=e(q,w,I,_),o<0?(S=w[0],I!=_&&(S=S*Ji+(w[1]||0)),h=S/D|0,h>1?(h>=Ji&&(h=Ji-1),p=t(q,h),v=p.length,_=w.length,o=e(p,w,v,_),o==1&&(h--,n(p,I<v?k:q,v))):(h==0&&(o=h=1),p=q.slice()),v=p.length,v<_&&p.unshift(0),n(w,p,_),o==-1&&(_=w.length,o=e(q,w,I,_),o<1&&(h++,n(w,I<_?k:q,_))),_=w.length):o===0&&(h++,w=[0]),b[u++]=h,o&&w[0]?w[_++]=z[P]||0:(w=[z[P]],_=1);while((P++<R||w[0]!==void 0)&&E--)}return b[0]||b.shift(),y.e=c,gr(y,s?a+Ri(y)+1:a)}})();function b$(t,e){var n,r,i,a,s,o,c=0,u=0,h=t.constructor,p=h.precision;if(Ri(t)>16)throw Error(i5+Ri(t));if(!t.s)return new h(Js);for(zr=!1,o=p,s=new h(.03125);t.abs().gte(.1);)t=t.times(s),u+=5;for(r=Math.log(Jh(2,u))/Math.LN10*2+5|0,o+=r,n=i=a=new h(Js),h.precision=o;;){if(i=gr(i.times(t),o),n=n.times(++c),s=a.plus(Yu(i,n,o)),Oc(s.d).slice(0,o)===Oc(a.d).slice(0,o)){for(;u--;)a=gr(a.times(a),o);return h.precision=p,e==null?(zr=!0,gr(a,p)):a}a=s}}function Ri(t){for(var e=t.e*Ir,n=t.d[0];n>=10;n/=10)e++;return e}function a3(t,e,n){if(e>t.LN10.sd())throw zr=!0,n&&(t.precision=n),Error(Xo+"LN10 precision limit exceeded");return gr(new t(t.LN10),e)}function md(t){for(var e="";t--;)e+="0";return e}function sb(t,e){var n,r,i,a,s,o,c,u,h,p=1,v=10,y=t,b=y.d,w=y.constructor,_=w.precision;if(y.s<1)throw Error(Xo+(y.s?"NaN":"-Infinity"));if(y.eq(Js))return new w(0);if(e==null?(zr=!1,u=_):u=e,y.eq(10))return e==null&&(zr=!0),a3(w,u);if(u+=v,w.precision=u,n=Oc(b),r=n.charAt(0),a=Ri(y),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(t),n=Oc(y.d),r=n.charAt(0),p++;a=Ri(y),r>1?(y=new w("0."+n),a++):y=new w(r+"."+n.slice(1))}else return c=a3(w,u+2,_).times(a+""),y=sb(new w(r+"."+n.slice(1)),u-v).plus(c),w.precision=_,e==null?(zr=!0,gr(y,_)):y;for(o=s=y=Yu(y.minus(Js),y.plus(Js),u),h=gr(y.times(y),u),i=3;;){if(s=gr(s.times(h),u),c=o.plus(Yu(s,new w(i),u)),Oc(c.d).slice(0,u)===Oc(o.d).slice(0,u))return o=o.times(2),a!==0&&(o=o.plus(a3(w,u+2,_).times(a+""))),o=Yu(o,new w(p),u),w.precision=_,e==null?(zr=!0,gr(o,_)):o;o=c,i+=2}}function H9(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=ey(n/Ir),t.d=[],r=(n+1)%Ir,n<0&&(r+=Ir),r<i){for(r&&t.d.push(+e.slice(0,r)),i-=Ir;r<i;)t.d.push(+e.slice(r,r+=Ir));e=e.slice(r),r=Ir-e.length}else r-=i;for(;r--;)e+="0";if(t.d.push(+e),zr&&(t.e>Aw||t.e<-Aw))throw Error(i5+n)}else t.s=0,t.e=0,t.d=[0];return t}function gr(t,e,n){var r,i,a,s,o,c,u,h,p=t.d;for(s=1,a=p[0];a>=10;a/=10)s++;if(r=e-s,r<0)r+=Ir,i=e,u=p[h=0];else{if(h=Math.ceil((r+1)/Ir),a=p.length,h>=a)return t;for(u=a=p[h],s=1;a>=10;a/=10)s++;r%=Ir,i=r-Ir+s}if(n!==void 0&&(a=Jh(10,s-i-1),o=u/a%10|0,c=e<0||p[h+1]!==void 0||u%a,c=n<4?(o||c)&&(n==0||n==(t.s<0?3:2)):o>5||o==5&&(n==4||c||n==6&&(r>0?i>0?u/Jh(10,s-i):0:p[h-1])%10&1||n==(t.s<0?8:7))),e<1||!p[0])return c?(a=Ri(t),p.length=1,e=e-a-1,p[0]=Jh(10,(Ir-e%Ir)%Ir),t.e=ey(-e/Ir)||0):(p.length=1,p[0]=t.e=t.s=0),t;if(r==0?(p.length=h,a=1,h--):(p.length=h+1,a=Jh(10,Ir-r),p[h]=i>0?(u/Jh(10,s-i)%Jh(10,i)|0)*a:0),c)for(;;)if(h==0){(p[0]+=a)==Ji&&(p[0]=1,++t.e);break}else{if(p[h]+=a,p[h]!=Ji)break;p[h--]=0,a=1}for(r=p.length;p[--r]===0;)p.pop();if(zr&&(t.e>Aw||t.e<-Aw))throw Error(i5+Ri(t));return t}function _$(t,e){var n,r,i,a,s,o,c,u,h,p,v=t.constructor,y=v.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new v(t),zr?gr(e,y):e;if(c=t.d,p=e.d,r=e.e,u=t.e,c=c.slice(),s=u-r,s){for(h=s<0,h?(n=c,s=-s,o=p.length):(n=p,r=u,o=c.length),i=Math.max(Math.ceil(y/Ir),o)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,o=p.length,h=i<o,h&&(o=i),i=0;i<o;i++)if(c[i]!=p[i]){h=c[i]<p[i];break}s=0}for(h&&(n=c,c=p,p=n,e.s=-e.s),o=c.length,i=p.length-o;i>0;--i)c[o++]=0;for(i=p.length;i>s;){if(c[--i]<p[i]){for(a=i;a&&c[--a]===0;)c[a]=Ji-1;--c[a],c[i]+=Ji}c[i]-=p[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(e.d=c,e.e=r,zr?gr(e,y):e):new v(0)}function wp(t,e,n){var r,i=Ri(t),a=Oc(t.d),s=a.length;return e?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+md(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+md(-i-1)+a,n&&(r=n-s)>0&&(a+=md(r))):i>=s?(a+=md(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+md(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=md(r))),t.s<0?"-"+a:a}function V9(t,e){if(t.length>e)return t.length=e,!0}function S$(t){var e,n,r;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(yp+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return H9(s,a.toString())}else if(typeof a!="string")throw Error(yp+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,tme.test(a))H9(s,a);else throw Error(yp+a)}if(i.prototype=Ot,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=S$,i.config=i.set=nme,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<r.length;)t.hasOwnProperty(n=r[e++])||(t[n]=this[n]);return i.config(t),i}function nme(t){if(!t||typeof t!="object")throw Error(Xo+"Object expected");var e,n,r,i=["precision",1,Qv,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<i.length;e+=3)if((r=t[n=i[e]])!==void 0)if(ey(r)===r&&r>=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(yp+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(yp+n+": "+r);return this}var a5=S$(eme);Js=new a5(1);const dr=a5;function rme(t){return ome(t)||sme(t)||ame(t)||ime()}function ime(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ame(t,e){if(t){if(typeof t=="string")return aI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aI(t,e)}}function sme(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function ome(t){if(Array.isArray(t))return aI(t)}function aI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var lme=function(e){return e},A$={},w$=function(e){return e===A$},W9=function(e){return function n(){return arguments.length===0||arguments.length===1&&w$(arguments.length<=0?void 0:arguments[0])?n:e.apply(void 0,arguments)}},cme=function t(e,n){return e===1?n:W9(function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var s=i.filter(function(o){return o!==A$}).length;return s>=e?n.apply(void 0,i):t(e-s,W9(function(){for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];var h=i.map(function(p){return w$(p)?c.shift():p});return n.apply(void 0,rme(h).concat(c))}))})},RE=function(e){return cme(e.length,e)},sI=function(e,n){for(var r=[],i=e;i<n;++i)r[i-e]=i;return r},ume=RE(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(n){return e[n]}).map(t)}),fme=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.length)return lme;var i=n.reverse(),a=i[0],s=i.slice(1);return function(){return s.reduce(function(o,c){return c(o)},a.apply(void 0,arguments))}},oI=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},M$=function(e){var n=null,r=null;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n&&a.every(function(o,c){return o===n[c]})||(n=a,r=e.apply(void 0,a)),r}};function dme(t){var e;return t===0?e=1:e=Math.floor(new dr(t).abs().log(10).toNumber())+1,e}function hme(t,e,n){for(var r=new dr(t),i=0,a=[];r.lt(e)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var pme=RE(function(t,e,n){var r=+t,i=+e;return r+n*(i-r)}),mme=RE(function(t,e,n){var r=e-+t;return r=r||1/0,(n-t)/r}),gme=RE(function(t,e,n){var r=e-+t;return r=r||1/0,Math.max(0,Math.min(1,(n-t)/r))});const OE={rangeStep:hme,getDigitCount:dme,interpolateNumber:pme,uninterpolateNumber:mme,uninterpolateTruncation:gme};function lI(t){return xme(t)||yme(t)||E$(t)||vme()}function vme(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yme(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function xme(t){if(Array.isArray(t))return cI(t)}function ob(t,e){return Sme(t)||_me(t,e)||E$(t,e)||bme()}function bme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E$(t,e){if(t){if(typeof t=="string")return cI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cI(t,e)}}function cI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _me(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,a=void 0;try{for(var s=t[Symbol.iterator](),o;!(r=(o=s.next()).done)&&(n.push(o.value),!(e&&n.length===e));r=!0);}catch(c){i=!0,a=c}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw a}}return n}}function Sme(t){if(Array.isArray(t))return t}function T$(t){var e=ob(t,2),n=e[0],r=e[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function C$(t,e,n){if(t.lte(0))return new dr(0);var r=OE.getDigitCount(t.toNumber()),i=new dr(10).pow(r),a=t.div(i),s=r!==1?.05:.1,o=new dr(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=o.mul(i);return e?c:new dr(Math.ceil(c))}function Ame(t,e,n){var r=1,i=new dr(t);if(!i.isint()&&n){var a=Math.abs(t);a<1?(r=new dr(10).pow(OE.getDigitCount(t)-1),i=new dr(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new dr(Math.floor(t)))}else t===0?i=new dr(Math.floor((e-1)/2)):n||(i=new dr(Math.floor(t)));var s=Math.floor((e-1)/2),o=fme(ume(function(c){return i.add(new dr(c-s).mul(r)).toNumber()}),sI);return o(0,e)}function R$(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new dr(0),tickMin:new dr(0),tickMax:new dr(0)};var a=C$(new dr(e).sub(t).div(n-1),r,i),s;t<=0&&e>=0?s=new dr(0):(s=new dr(t).add(e).div(2),s=s.sub(new dr(s).mod(a)));var o=Math.ceil(s.sub(t).div(a).toNumber()),c=Math.ceil(new dr(e).sub(s).div(a).toNumber()),u=o+c+1;return u>n?R$(t,e,n,r,i+1):(u<n&&(c=e>0?c+(n-u):c,o=e>0?o:o+(n-u)),{step:a,tickMin:s.sub(new dr(o).mul(a)),tickMax:s.add(new dr(c).mul(a))})}function wme(t){var e=ob(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),o=T$([n,r]),c=ob(o,2),u=c[0],h=c[1];if(u===-1/0||h===1/0){var p=h===1/0?[u].concat(lI(sI(0,i-1).map(function(){return 1/0}))):[].concat(lI(sI(0,i-1).map(function(){return-1/0})),[h]);return n>r?oI(p):p}if(u===h)return Ame(u,i,a);var v=R$(u,h,s,a),y=v.step,b=v.tickMin,w=v.tickMax,_=OE.rangeStep(b,w.add(new dr(.1).mul(y)),y);return n>r?oI(_):_}function Mme(t,e){var n=ob(t,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=T$([r,i]),o=ob(s,2),c=o[0],u=o[1];if(c===-1/0||u===1/0)return[r,i];if(c===u)return[c];var h=Math.max(e,2),p=C$(new dr(u).sub(c).div(h-1),a,0),v=[].concat(lI(OE.rangeStep(new dr(c),new dr(u).sub(new dr(.99).mul(p)),p)),[u]);return r>i?oI(v):v}var Eme=M$(wme),Tme=M$(Mme),Cme="Invariant failed";function Mp(t,e){throw new Error(Cme)}var Rme=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function dv(t){"@babel/helpers - typeof";return dv=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},dv(t)}function ww(){return ww=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ww.apply(this,arguments)}function Ome(t,e){return Ime(t)||Nme(t,e)||Dme(t,e)||Pme()}function Pme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dme(t,e){if(t){if(typeof t=="string")return q9(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q9(t,e)}}function q9(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nme(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Ime(t){if(Array.isArray(t))return t}function Bme(t,e){if(t==null)return{};var n=Lme(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Lme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function kme(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fme(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,D$(r.key),r)}}function Ume(t,e,n){return e&&Fme(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function jme(t,e,n){return e=Mw(e),zme(t,O$()?Reflect.construct(e,n||[],Mw(t).constructor):e.apply(t,n))}function zme(t,e){if(e&&(dv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gme(t)}function Gme(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(O$=function(){return!!t})()}function Mw(t){return Mw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mw(t)}function Hme(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uI(t,e)}function uI(t,e){return uI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},uI(t,e)}function P$(t,e,n){return e=D$(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D$(t){var e=Vme(t,"string");return dv(e)=="symbol"?e:e+""}function Vme(t,e){if(dv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(dv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var i1=(function(t){function e(){return kme(this,e),jme(this,e,arguments)}return Hme(e,t),Ume(e,[{key:"render",value:function(){var r=this.props,i=r.offset,a=r.layout,s=r.width,o=r.dataKey,c=r.data,u=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,v=Bme(r,Rme),y=_n(v,!1);this.props.direction==="x"&&h.type!=="number"&&Mp();var b=c.map(function(w){var _=u(w,o),S=_.x,E=_.y,T=_.value,P=_.errorVal;if(!P)return null;var R=[],D,I;if(Array.isArray(P)){var k=Ome(P,2);D=k[0],I=k[1]}else D=I=P;if(a==="vertical"){var B=h.scale,U=E+i,z=U+s,q=U-s,W=B(T-D),ee=B(T+I);R.push({x1:ee,y1:z,x2:ee,y2:q}),R.push({x1:W,y1:U,x2:ee,y2:U}),R.push({x1:W,y1:z,x2:W,y2:q})}else if(a==="horizontal"){var Q=p.scale,V=S+i,$=V-s,Y=V+s,ie=Q(T-D),de=Q(T+I);R.push({x1:$,y1:de,x2:Y,y2:de}),R.push({x1:V,y1:ie,x2:V,y2:de}),R.push({x1:$,y1:ie,x2:Y,y2:ie})}return fe.createElement(Ar,ww({className:"recharts-errorBar",key:"bar-".concat(R.map(function(X){return"".concat(X.x1,"-").concat(X.x2,"-").concat(X.y1,"-").concat(X.y2)}))},y),R.map(function(X){return fe.createElement("line",ww({},X,{key:"line-".concat(X.x1,"-").concat(X.x2,"-").concat(X.y1,"-").concat(X.y2)}))}))});return fe.createElement(Ar,{className:"recharts-errorBars"},b)}}])})(fe.Component);P$(i1,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});P$(i1,"displayName","ErrorBar");function lb(t){"@babel/helpers - typeof";return lb=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},lb(t)}function $9(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Dh(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$9(Object(n),!0).forEach(function(r){Wme(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$9(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Wme(t,e,n){return e=qme(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qme(t){var e=$me(t,"string");return lb(e)=="symbol"?e:e+""}function $me(t,e){if(lb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(lb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var N$=function(e){var n=e.children,r=e.formattedGraphicalItems,i=e.legendWidth,a=e.legendContent,s=Ks(n,qg);if(!s)return null;var o=qg.defaultProps,c=o!==void 0?Dh(Dh({},o),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:a==="children"?u=(r||[]).reduce(function(h,p){var v=p.item,y=p.props,b=y.sectors||y.data||[];return h.concat(b.map(function(w){return{type:s.props.iconType||v.props.legendType,value:w.name,color:w.fill,payload:w}}))},[]):u=(r||[]).map(function(h){var p=h.item,v=p.type.defaultProps,y=v!==void 0?Dh(Dh({},v),p.props):{},b=y.dataKey,w=y.name,_=y.legendType,S=y.hide;return{inactive:S,dataKey:b,type:c.iconType||_||"square",color:s5(p),value:w||b,payload:y}}),Dh(Dh(Dh({},c),qg.getWithHeight(s,i)),{},{payload:u,item:s})};function cb(t){"@babel/helpers - typeof";return cb=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},cb(t)}function X9(t){return Jme(t)||Yme(t)||Kme(t)||Xme()}function Xme(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kme(t,e){if(t){if(typeof t=="string")return fI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fI(t,e)}}function Yme(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Jme(t){if(Array.isArray(t))return fI(t)}function fI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function K9(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ai(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?K9(Object(n),!0).forEach(function(r){Xg(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):K9(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xg(t,e,n){return e=Zme(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zme(t){var e=Qme(t,"string");return cb(e)=="symbol"?e:e+""}function Qme(t,e){if(cb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(cb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cs(t,e,n){return Cn(t)||Cn(e)?n:ji(e)?Ho(t,e,n):yn(e)?e(t):n}function Px(t,e,n,r){var i=Jpe(t,function(o){return cs(o,e)});if(n==="number"){var a=i.filter(function(o){return mt(o)||parseFloat(o)});return a.length?[CE(a),bd(a)]:[1/0,-1/0]}var s=r?i.filter(function(o){return!Cn(o)}):i;return s.map(function(o){return ji(o)||o instanceof Date?o:""})}var ege=function(e){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,s=-1,o=(n=r?.length)!==null&&n!==void 0?n:0;if(o<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<o;u++){var h=u>0?i[u-1].coordinate:i[o-1].coordinate,p=i[u].coordinate,v=u>=o-1?i[0].coordinate:i[u+1].coordinate,y=void 0;if(Il(p-h)!==Il(v-p)){var b=[];if(Il(v-p)===Il(c[1]-c[0])){y=v;var w=p+c[1]-c[0];b[0]=Math.min(w,(w+h)/2),b[1]=Math.max(w,(w+h)/2)}else{y=h;var _=v+c[1]-c[0];b[0]=Math.min(p,(_+p)/2),b[1]=Math.max(p,(_+p)/2)}var S=[Math.min(p,(y+p)/2),Math.max(p,(y+p)/2)];if(e>S[0]&&e<=S[1]||e>=b[0]&&e<=b[1]){s=i[u].index;break}}else{var E=Math.min(h,v),T=Math.max(h,v);if(e>(E+p)/2&&e<=(T+p)/2){s=i[u].index;break}}}else for(var P=0;P<o;P++)if(P===0&&e<=(r[P].coordinate+r[P+1].coordinate)/2||P>0&&P<o-1&&e>(r[P].coordinate+r[P-1].coordinate)/2&&e<=(r[P].coordinate+r[P+1].coordinate)/2||P===o-1&&e>(r[P].coordinate+r[P-1].coordinate)/2){s=r[P].index;break}return s},s5=function(e){var n,r=e,i=r.type.displayName,a=(n=e.type)!==null&&n!==void 0&&n.defaultProps?ai(ai({},e.type.defaultProps),e.props):e.props,s=a.stroke,o=a.fill,c;switch(i){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:o;break;default:c=o;break}return c},tge=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var s={},o=Object.keys(a),c=0,u=o.length;c<u;c++)for(var h=a[o[c]].stackGroups,p=Object.keys(h),v=0,y=p.length;v<y;v++){var b=h[p[v]],w=b.items,_=b.cateAxisId,S=w.filter(function(I){return Xu(I.type).indexOf("Bar")>=0});if(S&&S.length){var E=S[0].type.defaultProps,T=E!==void 0?ai(ai({},E),S[0].props):S[0].props,P=T.barSize,R=T[_];s[R]||(s[R]=[]);var D=Cn(P)?n:P;s[R].push({item:S[0],stackList:S.slice(1),barSize:Cn(D)?void 0:Ap(D,r,0)})}}return s},nge=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,a=e.sizeList,s=a===void 0?[]:a,o=e.maxBarSize,c=s.length;if(c<1)return null;var u=Ap(n,i,0,!0),h,p=[];if(s[0].barSize===+s[0].barSize){var v=!1,y=i/c,b=s.reduce(function(P,R){return P+R.barSize||0},0);b+=(c-1)*u,b>=i&&(b-=(c-1)*u,u=0),b>=i&&y>0&&(v=!0,y*=.9,b=c*y);var w=(i-b)/2>>0,_={offset:w-u,size:0};h=s.reduce(function(P,R){var D={item:R.item,position:{offset:_.offset+_.size+u,size:v?y:R.barSize}},I=[].concat(X9(P),[D]);return _=I[I.length-1].position,R.stackList&&R.stackList.length&&R.stackList.forEach(function(k){I.push({item:k,position:_})}),I},p)}else{var S=Ap(r,i,0,!0);i-2*S-(c-1)*u<=0&&(u=0);var E=(i-2*S-(c-1)*u)/c;E>1&&(E>>=0);var T=o===+o?Math.min(E,o):E;h=s.reduce(function(P,R,D){var I=[].concat(X9(P),[{item:R.item,position:{offset:S+(E+u)*D+(E-T)/2,size:T}}]);return R.stackList&&R.stackList.length&&R.stackList.forEach(function(k){I.push({item:k,position:I[I.length-1].position})}),I},p)}return h},rge=function(e,n,r,i){var a=r.children,s=r.width,o=r.margin,c=s-(o.left||0)-(o.right||0),u=N$({children:a,legendWidth:c});if(u){var h=i||{},p=h.width,v=h.height,y=u.align,b=u.verticalAlign,w=u.layout;if((w==="vertical"||w==="horizontal"&&b==="middle")&&y!=="center"&&mt(e[y]))return ai(ai({},e),{},Xg({},y,e[y]+(p||0)));if((w==="horizontal"||w==="vertical"&&y==="center")&&b!=="middle"&&mt(e[b]))return ai(ai({},e),{},Xg({},b,e[b]+(v||0)))}return e},ige=function(e,n,r){return Cn(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},I$=function(e,n,r,i,a){var s=n.props.children,o=Vo(s,i1).filter(function(u){return ige(i,a,u.props.direction)});if(o&&o.length){var c=o.map(function(u){return u.props.dataKey});return e.reduce(function(u,h){var p=cs(h,r);if(Cn(p))return u;var v=Array.isArray(p)?[CE(p),bd(p)]:[p,p],y=c.reduce(function(b,w){var _=cs(h,w,0),S=v[0]-Math.abs(Array.isArray(_)?_[0]:_),E=v[1]+Math.abs(Array.isArray(_)?_[1]:_);return[Math.min(S,b[0]),Math.max(E,b[1])]},[1/0,-1/0]);return[Math.min(y[0],u[0]),Math.max(y[1],u[1])]},[1/0,-1/0])}return null},age=function(e,n,r,i,a){var s=n.map(function(o){return I$(e,o,r,a,i)}).filter(function(o){return!Cn(o)});return s&&s.length?s.reduce(function(o,c){return[Math.min(o[0],c[0]),Math.max(o[1],c[1])]},[1/0,-1/0]):null},B$=function(e,n,r,i,a){var s=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&I$(e,c,u,i)||Px(e,u,r,a)});if(r==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var o={};return s.reduce(function(c,u){for(var h=0,p=u.length;h<p;h++)o[u[h]]||(o[u[h]]=!0,c.push(u[h]));return c},[])},L$=function(e,n){return e==="horizontal"&&n==="xAxis"||e==="vertical"&&n==="yAxis"||e==="centric"&&n==="angleAxis"||e==="radial"&&n==="radiusAxis"},k$=function(e,n,r,i){if(i)return e.map(function(c){return c.coordinate});var a,s,o=e.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(s=!0),c.coordinate});return a||o.push(n),s||o.push(r),o},Wu=function(e,n,r){if(!e)return null;var i=e.scale,a=e.duplicateDomain,s=e.type,o=e.range,c=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&s==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=e.axisType==="angleAxis"&&o?.length>=2?Il(o[0]-o[1])*2*u:u,n&&(e.ticks||e.niceTicks)){var h=(e.ticks||e.niceTicks).map(function(p){var v=a?a.indexOf(p):p;return{coordinate:i(v)+u,value:p,offset:u}});return h.filter(function(p){return!Kv(p.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(p,v){return{coordinate:i(p)+u,value:p,index:v,offset:u}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(p){return{coordinate:i(p)+u,value:p,offset:u}}):i.domain().map(function(p,v){return{coordinate:i(p)+u,value:a?a[p]:p,index:v,offset:u}})},s3=new WeakMap,_S=function(e,n){if(typeof n!="function")return e;s3.has(e)||s3.set(e,new WeakMap);var r=s3.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},sge=function(e,n,r){var i=e.scale,a=e.type,s=e.layout,o=e.axisType;if(i==="auto")return s==="radial"&&o==="radiusAxis"?{scale:tb(),realScaleType:"band"}:s==="radial"&&o==="angleAxis"?{scale:xw(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Ox(),realScaleType:"point"}:a==="category"?{scale:tb(),realScaleType:"band"}:{scale:xw(),realScaleType:"linear"};if(Sp(i)){var c="scale".concat(mE(i));return{scale:(I9[c]||Ox)(),realScaleType:I9[c]?c:"point"}}return yn(i)?{scale:i}:{scale:Ox(),realScaleType:"point"}},Y9=1e-4,oge=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),a=Math.min(i[0],i[1])-Y9,s=Math.max(i[0],i[1])+Y9,o=e(n[0]),c=e(n[r-1]);(o<a||o>s||c<a||c>s)&&e.domain([n[0],n[r-1]])}},lge=function(e,n){if(!e)return null;for(var r=0,i=e.length;r<i;r++)if(e[r].item===n)return e[r].position;return null},cge=function(e,n){if(!n||n.length!==2||!mt(n[0])||!mt(n[1]))return e;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=[e[0],e[1]];return(!mt(e[0])||e[0]<r)&&(a[0]=r),(!mt(e[1])||e[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},uge=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r<i;++r)for(var a=0,s=0,o=0;o<n;++o){var c=Kv(e[o][r][1])?e[o][r][0]:e[o][r][1];c>=0?(e[o][r][0]=a,e[o][r][1]=a+c,a=e[o][r][1]):(e[o][r][0]=s,e[o][r][1]=s+c,s=e[o][r][1])}},fge=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r<i;++r)for(var a=0,s=0;s<n;++s){var o=Kv(e[s][r][1])?e[s][r][0]:e[s][r][1];o>=0?(e[s][r][0]=a,e[s][r][1]=a+o,a=e[s][r][1]):(e[s][r][0]=0,e[s][r][1]=0)}},dge={sign:uge,expand:Kle,none:rv,silhouette:Yle,wiggle:Jle,positive:fge},hge=function(e,n,r){var i=n.map(function(o){return o.props.dataKey}),a=dge[r],s=Xle().keys(i).value(function(o,c){return+cs(o,c,0)}).order(zN).offset(a);return s(e)},pge=function(e,n,r,i,a,s){if(!e)return null;var o=s?n.reverse():n,c={},u=o.reduce(function(p,v){var y,b=(y=v.type)!==null&&y!==void 0&&y.defaultProps?ai(ai({},v.type.defaultProps),v.props):v.props,w=b.stackId,_=b.hide;if(_)return p;var S=b[r],E=p[S]||{hasStack:!1,stackGroups:{}};if(ji(w)){var T=E.stackGroups[w]||{numericAxisId:r,cateAxisId:i,items:[]};T.items.push(v),E.hasStack=!0,E.stackGroups[w]=T}else E.stackGroups[Yv("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[v]};return ai(ai({},p),{},Xg({},S,E))},c),h={};return Object.keys(u).reduce(function(p,v){var y=u[v];if(y.hasStack){var b={};y.stackGroups=Object.keys(y.stackGroups).reduce(function(w,_){var S=y.stackGroups[_];return ai(ai({},w),{},Xg({},_,{numericAxisId:r,cateAxisId:i,items:S.items,stackedData:hge(e,S.items,a)}))},b)}return ai(ai({},p),{},Xg({},v,y))},h)},mge=function(e,n){var r=n.realScaleType,i=n.type,a=n.tickCount,s=n.originalDomain,o=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=e.domain();if(!u.length)return null;var h=Eme(u,a,o);return e.domain([CE(h),bd(h)]),{niceTicks:h}}if(a&&i==="number"){var p=e.domain(),v=Tme(p,a,o);return{niceTicks:v}}return null};function Ew(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,a=t.index,s=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Cn(i[e.dataKey])){var o=QA(n,"value",i[e.dataKey]);if(o)return o.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=cs(i,Cn(s)?e.dataKey:s);return Cn(c)?null:e.scale(c)}var J9=function(e){var n=e.axis,r=e.ticks,i=e.offset,a=e.bandSize,s=e.entry,o=e.index;if(n.type==="category")return r[o]?r[o].coordinate+i:null;var c=cs(s,n.dataKey,n.domain[o]);return Cn(c)?null:n.scale(c)-a/2+i},gge=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return i<=0&&a>=0?0:a<0?a:i}return r[0]},vge=function(e,n){var r,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?ai(ai({},e.type.defaultProps),e.props):e.props,a=i.stackId;if(ji(a)){var s=n[a];if(s){var o=s.items.indexOf(e);return o>=0?s.stackedData[o]:null}}return null},yge=function(e){return e.reduce(function(n,r){return[CE(r.concat([n[0]]).filter(mt)),bd(r.concat([n[1]]).filter(mt))]},[1/0,-1/0])},F$=function(e,n,r){return Object.keys(e).reduce(function(i,a){var s=e[a],o=s.stackedData,c=o.reduce(function(u,h){var p=yge(h.slice(n,r+1));return[Math.min(u[0],p[0]),Math.max(u[1],p[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},Z9=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Q9=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dI=function(e,n,r){if(yn(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(mt(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(Z9.test(e[0])){var a=+Z9.exec(e[0])[1];i[0]=n[0]-a}else yn(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(mt(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(Q9.test(e[1])){var s=+Q9.exec(e[1])[1];i[1]=n[1]+s}else yn(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},Tw=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var a=IL(n,function(p){return p.coordinate}),s=1/0,o=1,c=a.length;o<c;o++){var u=a[o],h=a[o-1];s=Math.min((u.coordinate||0)-(h.coordinate||0),s)}return s===1/0?0:s}return r?void 0:0},e8=function(e,n,r){return!e||!e.length||fv(e,Ho(r,"type.defaultProps.domain"))?n:e},U$=function(e,n){var r=e.type.defaultProps?ai(ai({},e.type.defaultProps),e.props):e.props,i=r.dataKey,a=r.name,s=r.unit,o=r.formatter,c=r.tooltipType,u=r.chartType,h=r.hide;return ai(ai({},_n(e,!1)),{},{dataKey:i,unit:s,formatter:o,name:a||i,color:s5(e),value:cs(n,i),type:c,payload:n,chartType:u,hide:h})};function ub(t){"@babel/helpers - typeof";return ub=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},ub(t)}function t8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function n8(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?t8(Object(n),!0).forEach(function(r){xge(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):t8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function xge(t,e,n){return e=bge(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bge(t){var e=_ge(t,"string");return ub(e)=="symbol"?e:e+""}function _ge(t,e){if(ub(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(ub(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Cw=Math.PI/180,Sge=function(e){return e*180/Math.PI},ma=function(e,n,r,i){return{x:e+Math.cos(-Cw*i)*r,y:n+Math.sin(-Cw*i)*r}},Age=function(e,n){var r=e.x,i=e.y,a=n.x,s=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-s,2))},wge=function(e,n){var r=e.x,i=e.y,a=n.cx,s=n.cy,o=Age({x:r,y:i},{x:a,y:s});if(o<=0)return{radius:o};var c=(r-a)/o,u=Math.acos(c);return i>s&&(u=2*Math.PI-u),{radius:o,angle:Sge(u),angleInRadian:u}},Mge=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),s=Math.min(i,a);return{startAngle:n-s*360,endAngle:r-s*360}},Ege=function(e,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),s=Math.floor(i/360),o=Math.min(a,s);return e+o*360},r8=function(e,n){var r=e.x,i=e.y,a=wge({x:r,y:i},n),s=a.radius,o=a.angle,c=n.innerRadius,u=n.outerRadius;if(s<c||s>u)return!1;if(s===0)return!0;var h=Mge(n),p=h.startAngle,v=h.endAngle,y=o,b;if(p<=v){for(;y>v;)y-=360;for(;y<p;)y+=360;b=y>=p&&y<=v}else{for(;y>p;)y-=360;for(;y<v;)y+=360;b=y>=v&&y<=p}return b?n8(n8({},n),{},{radius:s,angle:Ege(y,n)}):null};function fb(t){"@babel/helpers - typeof";return fb=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},fb(t)}var Tge=["offset"];function Cge(t){return Dge(t)||Pge(t)||Oge(t)||Rge()}function Rge(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oge(t,e){if(t){if(typeof t=="string")return hI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hI(t,e)}}function Pge(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Dge(t){if(Array.isArray(t))return hI(t)}function hI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nge(t,e){if(t==null)return{};var n=Ige(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ige(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function i8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Fi(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?i8(Object(n),!0).forEach(function(r){Bge(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Bge(t,e,n){return e=Lge(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lge(t){var e=kge(t,"string");return fb(e)=="symbol"?e:e+""}function kge(t,e){if(fb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(fb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function db(){return db=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},db.apply(this,arguments)}var Fge=function(e){var n=e.value,r=e.formatter,i=Cn(e.children)?n:e.children;return yn(r)?r(i):i},Uge=function(e,n){var r=Il(n-e),i=Math.min(Math.abs(n-e),360);return r*i},jge=function(e,n,r){var i=e.position,a=e.viewBox,s=e.offset,o=e.className,c=a,u=c.cx,h=c.cy,p=c.innerRadius,v=c.outerRadius,y=c.startAngle,b=c.endAngle,w=c.clockWise,_=(p+v)/2,S=Uge(y,b),E=S>=0?1:-1,T,P;i==="insideStart"?(T=y+E*s,P=w):i==="insideEnd"?(T=b-E*s,P=!w):i==="end"&&(T=b+E*s,P=w),P=S<=0?P:!P;var R=ma(u,h,_,T),D=ma(u,h,_,T+(P?1:-1)*359),I="M".concat(R.x,",").concat(R.y,`
A`).concat(_,",").concat(_,",0,1,").concat(P?0:1,`,
`).concat(D.x,",").concat(D.y),k=Cn(e.id)?Yv("recharts-radial-line-"):e.id;return fe.createElement("text",db({},r,{dominantBaseline:"central",className:In("recharts-radial-bar-label",o)}),fe.createElement("defs",null,fe.createElement("path",{id:k,d:I})),fe.createElement("textPath",{xlinkHref:"#".concat(k)},n))},zge=function(e){var n=e.viewBox,r=e.offset,i=e.position,a=n,s=a.cx,o=a.cy,c=a.innerRadius,u=a.outerRadius,h=a.startAngle,p=a.endAngle,v=(h+p)/2;if(i==="outside"){var y=ma(s,o,u+r,v),b=y.x,w=y.y;return{x:b,y:w,textAnchor:b>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"end"};var _=(c+u)/2,S=ma(s,o,_,v),E=S.x,T=S.y;return{x:E,y:T,textAnchor:"middle",verticalAnchor:"middle"}},Gge=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,a=e.position,s=n,o=s.x,c=s.y,u=s.width,h=s.height,p=h>=0?1:-1,v=p*i,y=p>0?"end":"start",b=p>0?"start":"end",w=u>=0?1:-1,_=w*i,S=w>0?"end":"start",E=w>0?"start":"end";if(a==="top"){var T={x:o+u/2,y:c-p*i,textAnchor:"middle",verticalAnchor:y};return Fi(Fi({},T),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var P={x:o+u/2,y:c+h+v,textAnchor:"middle",verticalAnchor:b};return Fi(Fi({},P),r?{height:Math.max(r.y+r.height-(c+h),0),width:u}:{})}if(a==="left"){var R={x:o-_,y:c+h/2,textAnchor:S,verticalAnchor:"middle"};return Fi(Fi({},R),r?{width:Math.max(R.x-r.x,0),height:h}:{})}if(a==="right"){var D={x:o+u+_,y:c+h/2,textAnchor:E,verticalAnchor:"middle"};return Fi(Fi({},D),r?{width:Math.max(r.x+r.width-D.x,0),height:h}:{})}var I=r?{width:u,height:h}:{};return a==="insideLeft"?Fi({x:o+_,y:c+h/2,textAnchor:E,verticalAnchor:"middle"},I):a==="insideRight"?Fi({x:o+u-_,y:c+h/2,textAnchor:S,verticalAnchor:"middle"},I):a==="insideTop"?Fi({x:o+u/2,y:c+v,textAnchor:"middle",verticalAnchor:b},I):a==="insideBottom"?Fi({x:o+u/2,y:c+h-v,textAnchor:"middle",verticalAnchor:y},I):a==="insideTopLeft"?Fi({x:o+_,y:c+v,textAnchor:E,verticalAnchor:b},I):a==="insideTopRight"?Fi({x:o+u-_,y:c+v,textAnchor:S,verticalAnchor:b},I):a==="insideBottomLeft"?Fi({x:o+_,y:c+h-v,textAnchor:E,verticalAnchor:y},I):a==="insideBottomRight"?Fi({x:o+u-_,y:c+h-v,textAnchor:S,verticalAnchor:y},I):Xv(a)&&(mt(a.x)||rp(a.x))&&(mt(a.y)||rp(a.y))?Fi({x:o+Ap(a.x,u),y:c+Ap(a.y,h),textAnchor:"end",verticalAnchor:"end"},I):Fi({x:o+u/2,y:c+h/2,textAnchor:"middle",verticalAnchor:"middle"},I)},Hge=function(e){return"cx"in e&&mt(e.cx)};function Da(t){var e=t.offset,n=e===void 0?5:e,r=Nge(t,Tge),i=Fi({offset:n},r),a=i.viewBox,s=i.position,o=i.value,c=i.children,u=i.content,h=i.className,p=h===void 0?"":h,v=i.textBreakAll;if(!a||Cn(o)&&Cn(c)&&!j.isValidElement(u)&&!yn(u))return null;if(j.isValidElement(u))return j.cloneElement(u,i);var y;if(yn(u)){if(y=j.createElement(u,i),j.isValidElement(y))return y}else y=Fge(i);var b=Hge(a),w=_n(i,!0);if(b&&(s==="insideStart"||s==="insideEnd"||s==="end"))return jge(i,y,w);var _=b?zge(i):Gge(i);return fe.createElement(dw,db({className:In("recharts-label",p)},w,_,{breakAll:v}),y)}Da.displayName="Label";var j$=function(e){var n=e.cx,r=e.cy,i=e.angle,a=e.startAngle,s=e.endAngle,o=e.r,c=e.radius,u=e.innerRadius,h=e.outerRadius,p=e.x,v=e.y,y=e.top,b=e.left,w=e.width,_=e.height,S=e.clockWise,E=e.labelViewBox;if(E)return E;if(mt(w)&&mt(_)){if(mt(p)&&mt(v))return{x:p,y:v,width:w,height:_};if(mt(y)&&mt(b))return{x:y,y:b,width:w,height:_}}return mt(p)&&mt(v)?{x:p,y:v,width:0,height:0}:mt(n)&&mt(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:s||i||0,innerRadius:u||0,outerRadius:h||c||o||0,clockWise:S}:e.viewBox?e.viewBox:{}},Vge=function(e,n){return e?e===!0?fe.createElement(Da,{key:"label-implicit",viewBox:n}):ji(e)?fe.createElement(Da,{key:"label-implicit",viewBox:n,value:e}):j.isValidElement(e)?e.type===Da?j.cloneElement(e,{key:"label-implicit",viewBox:n}):fe.createElement(Da,{key:"label-implicit",content:e,viewBox:n}):yn(e)?fe.createElement(Da,{key:"label-implicit",content:e,viewBox:n}):Xv(e)?fe.createElement(Da,db({viewBox:n},e,{key:"label-implicit"})):null:null},Wge=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,a=j$(e),s=Vo(i,Da).map(function(c,u){return j.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return s;var o=Vge(e.label,n||a);return[o].concat(Cge(s))};Da.parseViewBox=j$;Da.renderCallByParent=Wge;var o3,a8;function qge(){if(a8)return o3;a8=1;function t(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}return o3=t,o3}var $ge=qge();const Xge=ar($ge);function hb(t){"@babel/helpers - typeof";return hb=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},hb(t)}var Kge=["valueAccessor"],Yge=["data","dataKey","clockWise","id","textBreakAll"];function Jge(t){return tve(t)||eve(t)||Qge(t)||Zge()}function Zge(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qge(t,e){if(t){if(typeof t=="string")return pI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pI(t,e)}}function eve(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function tve(t){if(Array.isArray(t))return pI(t)}function pI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rw(){return Rw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Rw.apply(this,arguments)}function s8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function o8(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?s8(Object(n),!0).forEach(function(r){nve(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nve(t,e,n){return e=rve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rve(t){var e=ive(t,"string");return hb(e)=="symbol"?e:e+""}function ive(t,e){if(hb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(hb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function l8(t,e){if(t==null)return{};var n=ave(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ave(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var sve=function(e){return Array.isArray(e.value)?Xge(e.value):e.value};function Ju(t){var e=t.valueAccessor,n=e===void 0?sve:e,r=l8(t,Kge),i=r.data,a=r.dataKey,s=r.clockWise,o=r.id,c=r.textBreakAll,u=l8(r,Yge);return!i||!i.length?null:fe.createElement(Ar,{className:"recharts-label-list"},i.map(function(h,p){var v=Cn(a)?n(h,p):cs(h&&h.payload,a),y=Cn(o)?{}:{id:"".concat(o,"-").concat(p)};return fe.createElement(Da,Rw({},_n(h,!0),u,y,{parentViewBox:h.parentViewBox,value:v,textBreakAll:c,viewBox:Da.parseViewBox(Cn(s)?h:o8(o8({},h),{},{clockWise:s})),key:"label-".concat(p),index:p}))}))}Ju.displayName="LabelList";function ove(t,e){return t?t===!0?fe.createElement(Ju,{key:"labelList-implicit",data:e}):fe.isValidElement(t)||yn(t)?fe.createElement(Ju,{key:"labelList-implicit",data:e,content:t}):Xv(t)?fe.createElement(Ju,Rw({data:e},t,{key:"labelList-implicit"})):null:null}function lve(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=Vo(r,Ju).map(function(s,o){return j.cloneElement(s,{data:e,key:"labelList-".concat(o)})});if(!n)return i;var a=ove(t.label,e);return[a].concat(Jge(i))}Ju.renderCallByParent=lve;function pb(t){"@babel/helpers - typeof";return pb=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},pb(t)}function mI(){return mI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},mI.apply(this,arguments)}function c8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function u8(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?c8(Object(n),!0).forEach(function(r){cve(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function cve(t,e,n){return e=uve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uve(t){var e=fve(t,"string");return pb(e)=="symbol"?e:e+""}function fve(t,e){if(pb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(pb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var dve=function(e,n){var r=Il(n-e),i=Math.min(Math.abs(n-e),359.999);return r*i},SS=function(e){var n=e.cx,r=e.cy,i=e.radius,a=e.angle,s=e.sign,o=e.isExternal,c=e.cornerRadius,u=e.cornerIsExternal,h=c*(o?1:-1)+i,p=Math.asin(c/h)/Cw,v=u?a:a+s*p,y=ma(n,r,h,v),b=ma(n,r,i,v),w=u?a-s*p:a,_=ma(n,r,h*Math.cos(p*Cw),w);return{center:y,circleTangency:b,lineTangency:_,theta:p}},z$=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,a=e.outerRadius,s=e.startAngle,o=e.endAngle,c=dve(s,o),u=s+c,h=ma(n,r,a,s),p=ma(n,r,a,u),v="M ".concat(h.x,",").concat(h.y,`
A `).concat(a,",").concat(a,`,0,
`).concat(+(Math.abs(c)>180),",").concat(+(s>u),`,
`).concat(p.x,",").concat(p.y,`
`);if(i>0){var y=ma(n,r,i,s),b=ma(n,r,i,u);v+="L ".concat(b.x,",").concat(b.y,`
A `).concat(i,",").concat(i,`,0,
`).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`,
`).concat(y.x,",").concat(y.y," Z")}else v+="L ".concat(n,",").concat(r," Z");return v},hve=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,a=e.outerRadius,s=e.cornerRadius,o=e.forceCornerRadius,c=e.cornerIsExternal,u=e.startAngle,h=e.endAngle,p=Il(h-u),v=SS({cx:n,cy:r,radius:a,angle:u,sign:p,cornerRadius:s,cornerIsExternal:c}),y=v.circleTangency,b=v.lineTangency,w=v.theta,_=SS({cx:n,cy:r,radius:a,angle:h,sign:-p,cornerRadius:s,cornerIsExternal:c}),S=_.circleTangency,E=_.lineTangency,T=_.theta,P=c?Math.abs(u-h):Math.abs(u-h)-w-T;if(P<0)return o?"M ".concat(b.x,",").concat(b.y,`
a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
`):z$({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:h});var R="M ".concat(b.x,",").concat(b.y,`
A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(y.x,",").concat(y.y,`
A`).concat(a,",").concat(a,",0,").concat(+(P>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(E.x,",").concat(E.y,`
`);if(i>0){var D=SS({cx:n,cy:r,radius:i,angle:u,sign:p,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),I=D.circleTangency,k=D.lineTangency,B=D.theta,U=SS({cx:n,cy:r,radius:i,angle:h,sign:-p,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),z=U.circleTangency,q=U.lineTangency,W=U.theta,ee=c?Math.abs(u-h):Math.abs(u-h)-B-W;if(ee<0&&s===0)return"".concat(R,"L").concat(n,",").concat(r,"Z");R+="L".concat(q.x,",").concat(q.y,`
A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(z.x,",").concat(z.y,`
A`).concat(i,",").concat(i,",0,").concat(+(ee>180),",").concat(+(p>0),",").concat(I.x,",").concat(I.y,`
A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(k.x,",").concat(k.y,"Z")}else R+="L".concat(n,",").concat(r,"Z");return R},pve={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},G$=function(e){var n=u8(u8({},pve),e),r=n.cx,i=n.cy,a=n.innerRadius,s=n.outerRadius,o=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,v=n.className;if(s<a||h===p)return null;var y=In("recharts-sector",v),b=s-a,w=Ap(o,b,0,!0),_;return w>0&&Math.abs(h-p)<360?_=hve({cx:r,cy:i,innerRadius:a,outerRadius:s,cornerRadius:Math.min(w,b/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:h,endAngle:p}):_=z$({cx:r,cy:i,innerRadius:a,outerRadius:s,startAngle:h,endAngle:p}),fe.createElement("path",mI({},_n(n,!0),{className:y,d:_,role:"img"}))};function mb(t){"@babel/helpers - typeof";return mb=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},mb(t)}function gI(){return gI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gI.apply(this,arguments)}function f8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function d8(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?f8(Object(n),!0).forEach(function(r){mve(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function mve(t,e,n){return e=gve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gve(t){var e=vve(t,"string");return mb(e)=="symbol"?e:e+""}function vve(t,e){if(mb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(mb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var h8={curveBasisClosed:kle,curveBasisOpen:Fle,curveBasis:Lle,curveBumpX:Sle,curveBumpY:Ale,curveLinearClosed:Ule,curveLinear:vE,curveMonotoneX:jle,curveMonotoneY:zle,curveNatural:Gle,curveStep:Hle,curveStepAfter:Wle,curveStepBefore:Vle},AS=function(e){return e.x===+e.x&&e.y===+e.y},X0=function(e){return e.x},K0=function(e){return e.y},yve=function(e,n){if(yn(e))return e;var r="curve".concat(mE(e));return(r==="curveMonotone"||r==="curveBump")&&n?h8["".concat(r).concat(n==="vertical"?"Y":"X")]:h8[r]||vE},xve=function(e){var n=e.type,r=n===void 0?"linear":n,i=e.points,a=i===void 0?[]:i,s=e.baseLine,o=e.layout,c=e.connectNulls,u=c===void 0?!1:c,h=yve(r,o),p=u?a.filter(function(w){return AS(w)}):a,v;if(Array.isArray(s)){var y=u?s.filter(function(w){return AS(w)}):s,b=p.map(function(w,_){return d8(d8({},w),{},{base:y[_]})});return o==="vertical"?v=pS().y(K0).x1(X0).x0(function(w){return w.base.x}):v=pS().x(X0).y1(K0).y0(function(w){return w.base.y}),v.defined(AS).curve(h),v(b)}return o==="vertical"&&mt(s)?v=pS().y(K0).x1(X0).x0(s):mt(s)?v=pS().x(X0).y1(K0).y0(s):v=WW().x(X0).y(K0),v.defined(AS).curve(h),v(p)},Kg=function(e){var n=e.className,r=e.points,i=e.path,a=e.pathRef;if((!r||!r.length)&&!i)return null;var s=r&&r.length?xve(e):i;return j.createElement("path",gI({},_n(e,!1),ew(e),{className:In("recharts-curve",n),d:s,ref:a}))},l3={exports:{}},c3,p8;function bve(){if(p8)return c3;p8=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return c3=t,c3}var u3,m8;function _ve(){if(m8)return u3;m8=1;var t=bve();function e(){}function n(){}return n.resetWarningCache=e,u3=function(){function r(s,o,c,u,h,p){if(p!==t){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return a.PropTypes=a,a},u3}var g8;function Sve(){return g8||(g8=1,l3.exports=_ve()()),l3.exports}var Ave=Sve();const rr=ar(Ave),{getOwnPropertyNames:wve,getOwnPropertySymbols:Mve}=Object,{hasOwnProperty:Eve}=Object.prototype;function f3(t,e){return function(r,i,a){return t(r,i,a)&&e(r,i,a)}}function wS(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);const{cache:a}=i,s=a.get(n),o=a.get(r);if(s&&o)return s===r&&o===n;a.set(n,r),a.set(r,n);const c=t(n,r,i);return a.delete(n),a.delete(r),c}}function Tve(t){return t?.[Symbol.toStringTag]}function v8(t){return wve(t).concat(Mve(t))}const Cve=Object.hasOwn||((t,e)=>Eve.call(t,e));function zp(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const Rve="__v",Ove="__o",Pve="_owner",{getOwnPropertyDescriptor:y8,keys:x8}=Object;function Dve(t,e){return t.byteLength===e.byteLength&&Ow(new Uint8Array(t),new Uint8Array(e))}function Nve(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function Ive(t,e){return t.byteLength===e.byteLength&&Ow(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Bve(t,e){return zp(t.getTime(),e.getTime())}function Lve(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function kve(t,e){return t===e}function b8(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),a=t.entries();let s,o,c=0;for(;(s=a.next())&&!s.done;){const u=e.entries();let h=!1,p=0;for(;(o=u.next())&&!o.done;){if(i[p]){p++;continue}const v=s.value,y=o.value;if(n.equals(v[0],y[0],c,p,t,e,n)&&n.equals(v[1],y[1],v[0],y[0],t,e,n)){h=i[p]=!0;break}p++}if(!h)return!1;c++}return!0}const Fve=zp;function Uve(t,e,n){const r=x8(t);let i=r.length;if(x8(e).length!==i)return!1;for(;i-- >0;)if(!H$(t,e,n,r[i]))return!1;return!0}function Y0(t,e,n){const r=v8(t);let i=r.length;if(v8(e).length!==i)return!1;let a,s,o;for(;i-- >0;)if(a=r[i],!H$(t,e,n,a)||(s=y8(t,a),o=y8(e,a),(s||o)&&(!s||!o||s.configurable!==o.configurable||s.enumerable!==o.enumerable||s.writable!==o.writable)))return!1;return!0}function jve(t,e){return zp(t.valueOf(),e.valueOf())}function zve(t,e){return t.source===e.source&&t.flags===e.flags}function _8(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),a=t.values();let s,o;for(;(s=a.next())&&!s.done;){const c=e.values();let u=!1,h=0;for(;(o=c.next())&&!o.done;){if(!i[h]&&n.equals(s.value,o.value,s.value,o.value,t,e,n)){u=i[h]=!0;break}h++}if(!u)return!1}return!0}function Ow(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function Gve(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function H$(t,e,n,r){return(r===Pve||r===Ove||r===Rve)&&(t.$$typeof||e.$$typeof)?!0:Cve(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const Hve="[object ArrayBuffer]",Vve="[object Arguments]",Wve="[object Boolean]",qve="[object DataView]",$ve="[object Date]",Xve="[object Error]",Kve="[object Map]",Yve="[object Number]",Jve="[object Object]",Zve="[object RegExp]",Qve="[object Set]",eye="[object String]",tye={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},nye="[object URL]",rye=Object.prototype.toString;function iye({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:s,areNumbersEqual:o,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:v,areUrlsEqual:y,unknownTagComparators:b}){return function(_,S,E){if(_===S)return!0;if(_==null||S==null)return!1;const T=typeof _;if(T!==typeof S)return!1;if(T!=="object")return T==="number"?o(_,S,E):T==="function"?a(_,S,E):!1;const P=_.constructor;if(P!==S.constructor)return!1;if(P===Object)return c(_,S,E);if(Array.isArray(_))return e(_,S,E);if(P===Date)return r(_,S,E);if(P===RegExp)return h(_,S,E);if(P===Map)return s(_,S,E);if(P===Set)return p(_,S,E);const R=rye.call(_);if(R===$ve)return r(_,S,E);if(R===Zve)return h(_,S,E);if(R===Kve)return s(_,S,E);if(R===Qve)return p(_,S,E);if(R===Jve)return typeof _.then!="function"&&typeof S.then!="function"&&c(_,S,E);if(R===nye)return y(_,S,E);if(R===Xve)return i(_,S,E);if(R===Vve)return c(_,S,E);if(tye[R])return v(_,S,E);if(R===Hve)return t(_,S,E);if(R===qve)return n(_,S,E);if(R===Wve||R===Yve||R===eye)return u(_,S,E);if(b){let D=b[R];if(!D){const I=Tve(_);I&&(D=b[I])}if(D)return D(_,S,E)}return!1}}function aye({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:Dve,areArraysEqual:n?Y0:Nve,areDataViewsEqual:Ive,areDatesEqual:Bve,areErrorsEqual:Lve,areFunctionsEqual:kve,areMapsEqual:n?f3(b8,Y0):b8,areNumbersEqual:Fve,areObjectsEqual:n?Y0:Uve,arePrimitiveWrappersEqual:jve,areRegExpsEqual:zve,areSetsEqual:n?f3(_8,Y0):_8,areTypedArraysEqual:n?f3(Ow,Y0):Ow,areUrlsEqual:Gve,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const i=wS(r.areArraysEqual),a=wS(r.areMapsEqual),s=wS(r.areObjectsEqual),o=wS(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:o})}return r}function sye(t){return function(e,n,r,i,a,s,o){return t(e,n,o)}}function oye({circular:t,comparator:e,createState:n,equals:r,strict:i}){if(n)return function(o,c){const{cache:u=t?new WeakMap:void 0,meta:h}=n();return e(o,c,{cache:u,equals:r,meta:h,strict:i})};if(t)return function(o,c){return e(o,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const a={cache:void 0,equals:r,meta:void 0,strict:i};return function(o,c){return e(o,c,a)}}const lye=jd();jd({strict:!0});jd({circular:!0});jd({circular:!0,strict:!0});jd({createInternalComparator:()=>zp});jd({strict:!0,createInternalComparator:()=>zp});jd({circular:!0,createInternalComparator:()=>zp});jd({circular:!0,createInternalComparator:()=>zp,strict:!0});function jd(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:i=!1}=t,a=aye(t),s=iye(a),o=n?n(s):sye(s);return oye({circular:e,comparator:s,createState:r,equals:o,strict:i})}function cye(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function S8(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>e?(t(a),n=-1):cye(i)};requestAnimationFrame(r)}function vI(t){"@babel/helpers - typeof";return vI=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},vI(t)}function uye(t){return pye(t)||hye(t)||dye(t)||fye()}function fye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dye(t,e){if(t){if(typeof t=="string")return A8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A8(t,e)}}function A8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function hye(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function pye(t){if(Array.isArray(t))return t}function mye(){var t={},e=function(){return null},n=!1,r=function i(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var s=a,o=uye(s),c=o[0],u=o.slice(1);if(typeof c=="number"){S8(i.bind(null,u),c);return}i(c),S8(i.bind(null,u));return}vI(a)==="object"&&(t=a,e(t)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return e=a,function(){e=function(){return null}}}}}function gb(t){"@babel/helpers - typeof";return gb=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},gb(t)}function w8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function M8(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?w8(Object(n),!0).forEach(function(r){V$(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function V$(t,e,n){return e=gye(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gye(t){var e=vye(t,"string");return gb(e)==="symbol"?e:String(e)}function vye(t,e){if(gb(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(gb(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yye=function(e,n){return[Object.keys(e),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},xye=function(e){return e},bye=function(e){return e.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Dx=function(e,n){return Object.keys(n).reduce(function(r,i){return M8(M8({},r),{},V$({},i,e(i,n[i])))},{})},E8=function(e,n,r){return e.map(function(i){return"".concat(bye(i)," ").concat(n,"ms ").concat(r)}).join(",")};function _ye(t,e){return wye(t)||Aye(t,e)||W$(t,e)||Sye()}function Sye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Aye(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function wye(t){if(Array.isArray(t))return t}function Mye(t){return Cye(t)||Tye(t)||W$(t)||Eye()}function Eye(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W$(t,e){if(t){if(typeof t=="string")return yI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yI(t,e)}}function Tye(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Cye(t){if(Array.isArray(t))return yI(t)}function yI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Pw=1e-4,q$=function(e,n){return[0,3*e,3*n-6*e,3*e-3*n+1]},$$=function(e,n){return e.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},T8=function(e,n){return function(r){var i=q$(e,n);return $$(i,r)}},Rye=function(e,n){return function(r){var i=q$(e,n),a=[].concat(Mye(i.map(function(s,o){return s*o}).slice(1)),[0]);return $$(a,r)}},C8=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],a=n[1],s=n[2],o=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,a=0,s=1,o=1;break;case"ease":i=.25,a=.1,s=.25,o=1;break;case"ease-in":i=.42,a=0,s=1,o=1;break;case"ease-out":i=.42,a=0,s=.58,o=1;break;case"ease-in-out":i=0,a=0,s=.58,o=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(_){return parseFloat(_)}),h=_ye(u,4);i=h[0],a=h[1],s=h[2],o=h[3]}}}var p=T8(i,s),v=T8(a,o),y=Rye(i,s),b=function(S){return S>1?1:S<0?0:S},w=function(S){for(var E=S>1?1:S,T=E,P=0;P<8;++P){var R=p(T)-E,D=y(T);if(Math.abs(R-E)<Pw||D<Pw)return v(T);T=b(T-R/D)}return v(T)};return w.isStepper=!1,w},Oye=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,a=i===void 0?8:i,s=e.dt,o=s===void 0?17:s,c=function(h,p,v){var y=-(h-p)*r,b=v*a,w=v+(y-b)*o/1e3,_=v*o/1e3+h;return Math.abs(_-p)<Pw&&Math.abs(w)<Pw?[p,0]:[_,w]};return c.isStepper=!0,c.dt=o,c},Pye=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return C8(i);case"spring":return Oye();default:if(i.split("(")[0]==="cubic-bezier")return C8(i)}return typeof i=="function"?i:null};function vb(t){"@babel/helpers - typeof";return vb=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},vb(t)}function R8(t){return Iye(t)||Nye(t)||X$(t)||Dye()}function Dye(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nye(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Iye(t){if(Array.isArray(t))return bI(t)}function O8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function fa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?O8(Object(n),!0).forEach(function(r){xI(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function xI(t,e,n){return e=Bye(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bye(t){var e=Lye(t,"string");return vb(e)==="symbol"?e:String(e)}function Lye(t,e){if(vb(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(vb(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function kye(t,e){return jye(t)||Uye(t,e)||X$(t,e)||Fye()}function Fye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X$(t,e){if(t){if(typeof t=="string")return bI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bI(t,e)}}function bI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Uye(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function jye(t){if(Array.isArray(t))return t}var Dw=function(e,n,r){return e+(n-e)*r},_I=function(e){var n=e.from,r=e.to;return n!==r},zye=function t(e,n,r){var i=Dx(function(a,s){if(_I(s)){var o=e(s.from,s.to,s.velocity),c=kye(o,2),u=c[0],h=c[1];return fa(fa({},s),{},{from:u,velocity:h})}return s},n);return r<1?Dx(function(a,s){return _I(s)?fa(fa({},s),{},{velocity:Dw(s.velocity,i[a].velocity,r),from:Dw(s.from,i[a].from,r)}):s},n):t(e,i,r-1)};const Gye=(function(t,e,n,r,i){var a=yye(t,e),s=a.reduce(function(_,S){return fa(fa({},_),{},xI({},S,[t[S],e[S]]))},{}),o=a.reduce(function(_,S){return fa(fa({},_),{},xI({},S,{from:t[S],velocity:0,to:e[S]}))},{}),c=-1,u,h,p=function(){return null},v=function(){return Dx(function(S,E){return E.from},o)},y=function(){return!Object.values(o).filter(_I).length},b=function(S){u||(u=S);var E=S-u,T=E/n.dt;o=zye(n,o,T),i(fa(fa(fa({},t),e),v())),u=S,y()||(c=requestAnimationFrame(p))},w=function(S){h||(h=S);var E=(S-h)/r,T=Dx(function(R,D){return Dw.apply(void 0,R8(D).concat([n(E)]))},s);if(i(fa(fa(fa({},t),e),T)),E<1)c=requestAnimationFrame(p);else{var P=Dx(function(R,D){return Dw.apply(void 0,R8(D).concat([n(1)]))},s);i(fa(fa(fa({},t),e),P))}};return p=n.isStepper?b:w,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(c)}}});function hv(t){"@babel/helpers - typeof";return hv=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},hv(t)}var Hye=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Vye(t,e){if(t==null)return{};var n=Wye(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Wye(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function d3(t){return Kye(t)||Xye(t)||$ye(t)||qye()}function qye(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ye(t,e){if(t){if(typeof t=="string")return SI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SI(t,e)}}function Xye(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Kye(t){if(Array.isArray(t))return SI(t)}function SI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function P8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Al(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?P8(Object(n),!0).forEach(function(r){vx(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function vx(t,e,n){return e=K$(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jye(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,K$(r.key),r)}}function Zye(t,e,n){return e&&Jye(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function K$(t){var e=Qye(t,"string");return hv(e)==="symbol"?e:String(e)}function Qye(t,e){if(hv(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(hv(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function e0e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&AI(t,e)}function AI(t,e){return AI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},AI(t,e)}function t0e(t){var e=n0e();return function(){var r=Nw(t),i;if(e){var a=Nw(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return wI(this,i)}}function wI(t,e){if(e&&(hv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MI(t)}function MI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n0e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Nw(t){return Nw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nw(t)}var Gc=(function(t){e0e(n,t);var e=t0e(n);function n(r,i){var a;Yye(this,n),a=e.call(this,r,i);var s=a.props,o=s.isActive,c=s.attributeName,u=s.from,h=s.to,p=s.steps,v=s.children,y=s.duration;if(a.handleStyleChange=a.handleStyleChange.bind(MI(a)),a.changeStyle=a.changeStyle.bind(MI(a)),!o||y<=0)return a.state={style:{}},typeof v=="function"&&(a.state={style:h}),wI(a);if(p&&p.length)a.state={style:p[0].style};else if(u){if(typeof v=="function")return a.state={style:u},wI(a);a.state={style:c?vx({},c,u):u}}else a.state={style:{}};return a}return Zye(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,s=i.canBegin;this.mounted=!0,!(!a||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,s=a.isActive,o=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,h=a.to,p=a.from,v=this.state.style;if(o){if(!s){var y={style:c?vx({},c,h):h};this.state&&v&&(c&&v[c]!==h||!c&&v!==h)&&this.setState(y);return}if(!(lye(i.to,h)&&i.canBegin&&i.isActive)){var b=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=b||u?p:i.to;if(this.state&&v){var _={style:c?vx({},c,w):w};(c&&v[c]!==w||!c&&v!==w)&&this.setState(_)}this.runAnimation(Al(Al({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,s=i.from,o=i.to,c=i.duration,u=i.easing,h=i.begin,p=i.onAnimationEnd,v=i.onAnimationStart,y=Gye(s,o,Pye(u),c,this.changeStyle),b=function(){a.stopJSAnimation=y()};this.manager.start([v,h,b,c,p])}},{key:"runStepAnimation",value:function(i){var a=this,s=i.steps,o=i.begin,c=i.onAnimationStart,u=s[0],h=u.style,p=u.duration,v=p===void 0?0:p,y=function(w,_,S){if(S===0)return w;var E=_.duration,T=_.easing,P=T===void 0?"ease":T,R=_.style,D=_.properties,I=_.onAnimationEnd,k=S>0?s[S-1]:_,B=D||Object.keys(R);if(typeof P=="function"||P==="spring")return[].concat(d3(w),[a.runJSAnimation.bind(a,{from:k.style,to:R,duration:E,easing:P}),E]);var U=E8(B,E,P),z=Al(Al(Al({},k.style),R),{},{transition:U});return[].concat(d3(w),[z,E,I]).filter(xye)};return this.manager.start([c].concat(d3(s.reduce(y,[h,Math.max(v,o)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=mye());var a=i.begin,s=i.duration,o=i.attributeName,c=i.to,u=i.easing,h=i.onAnimationStart,p=i.onAnimationEnd,v=i.steps,y=i.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof u=="function"||typeof y=="function"||u==="spring"){this.runJSAnimation(i);return}if(v.length>1){this.runStepAnimation(i);return}var w=o?vx({},o,c):c,_=E8(Object.keys(w),s,u);b.start([h,a,Al(Al({},w),{},{transition:_}),s,p])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var o=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=Vye(i,Hye),u=j.Children.count(a),h=this.state.style;if(typeof a=="function")return a(h);if(!o||u===0||s<=0)return a;var p=function(y){var b=y.props,w=b.style,_=w===void 0?{}:w,S=b.className,E=j.cloneElement(y,Al(Al({},c),{},{style:Al(Al({},_),h),className:S}));return E};return u===1?p(j.Children.only(a)):fe.createElement("div",null,j.Children.map(a,function(v){return p(v)}))}}]),n})(j.PureComponent);Gc.displayName="Animate";Gc.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Gc.propTypes={from:rr.oneOfType([rr.object,rr.string]),to:rr.oneOfType([rr.object,rr.string]),attributeName:rr.string,duration:rr.number,begin:rr.number,easing:rr.oneOfType([rr.string,rr.func]),steps:rr.arrayOf(rr.shape({duration:rr.number.isRequired,style:rr.object.isRequired,easing:rr.oneOfType([rr.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),rr.func]),properties:rr.arrayOf("string"),onAnimationEnd:rr.func})),children:rr.oneOfType([rr.node,rr.func]),isActive:rr.bool,canBegin:rr.bool,onAnimationEnd:rr.func,shouldReAnimate:rr.bool,onAnimationStart:rr.func,onAnimationReStart:rr.func};function Iw(){return Iw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Iw.apply(null,arguments)}var o5=OV();const r0e=ar(o5);function yb(t){"@babel/helpers - typeof";return yb=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},yb(t)}function Bw(){return Bw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Bw.apply(this,arguments)}function i0e(t,e){return l0e(t)||o0e(t,e)||s0e(t,e)||a0e()}function a0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s0e(t,e){if(t){if(typeof t=="string")return D8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D8(t,e)}}function D8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o0e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function l0e(t){if(Array.isArray(t))return t}function N8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function I8(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?N8(Object(n),!0).forEach(function(r){c0e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function c0e(t,e,n){return e=u0e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u0e(t){var e=f0e(t,"string");return yb(e)=="symbol"?e:e+""}function f0e(t,e){if(yb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(yb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var B8=function(e,n,r,i,a){var s=Math.min(Math.abs(r)/2,Math.abs(i)/2),o=i>=0?1:-1,c=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,h;if(s>0&&a instanceof Array){for(var p=[0,0,0,0],v=0,y=4;v<y;v++)p[v]=a[v]>s?s:a[v];h="M".concat(e,",").concat(n+o*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(u,",").concat(e+c*p[0],",").concat(n)),h+="L ".concat(e+r-c*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(u,`,
`).concat(e+r,",").concat(n+o*p[1])),h+="L ".concat(e+r,",").concat(n+i-o*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(u,`,
`).concat(e+r-c*p[2],",").concat(n+i)),h+="L ".concat(e+c*p[3],",").concat(n+i),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(u,`,
`).concat(e,",").concat(n+i-o*p[3])),h+="Z"}else if(s>0&&a===+a&&a>0){var b=Math.min(s,a);h="M ".concat(e,",").concat(n+o*b,`
A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(e+c*b,",").concat(n,`
L `).concat(e+r-c*b,",").concat(n,`
A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(e+r,",").concat(n+o*b,`
L `).concat(e+r,",").concat(n+i-o*b,`
A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(e+r-c*b,",").concat(n+i,`
L `).concat(e+c*b,",").concat(n+i,`
A `).concat(b,",").concat(b,",0,0,").concat(u,",").concat(e,",").concat(n+i-o*b," Z")}else h="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return h},d0e=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,a=n.x,s=n.y,o=n.width,c=n.height;if(Math.abs(o)>0&&Math.abs(c)>0){var u=Math.min(a,a+o),h=Math.max(a,a+o),p=Math.min(s,s+c),v=Math.max(s,s+c);return r>=u&&r<=h&&i>=p&&i<=v}return!1},h0e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},l5=function(e){var n=I8(I8({},h0e),e),r=j.useRef(),i=j.useState(-1),a=i0e(i,2),s=a[0],o=a[1];j.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var P=r.current.getTotalLength();P&&o(P)}catch{}},[]);var c=n.x,u=n.y,h=n.width,p=n.height,v=n.radius,y=n.className,b=n.animationEasing,w=n.animationDuration,_=n.animationBegin,S=n.isAnimationActive,E=n.isUpdateAnimationActive;if(c!==+c||u!==+u||h!==+h||p!==+p||h===0||p===0)return null;var T=In("recharts-rectangle",y);return E?fe.createElement(Gc,{canBegin:s>0,from:{width:h,height:p,x:c,y:u},to:{width:h,height:p,x:c,y:u},duration:w,animationEasing:b,isActive:E},function(P){var R=P.width,D=P.height,I=P.x,k=P.y;return fe.createElement(Gc,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:_,duration:w,isActive:S,easing:b},fe.createElement("path",Bw({},_n(n,!0),{className:T,d:B8(I,k,R,D,v),ref:r})))}):fe.createElement("path",Bw({},_n(n,!0),{className:T,d:B8(c,u,h,p,v)}))};function EI(){return EI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},EI.apply(this,arguments)}var PE=function(e){var n=e.cx,r=e.cy,i=e.r,a=e.className,s=In("recharts-dot",a);return n===+n&&r===+r&&i===+i?j.createElement("circle",EI({},_n(e,!1),ew(e),{className:s,cx:n,cy:r,r:i})):null};function xb(t){"@babel/helpers - typeof";return xb=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},xb(t)}var p0e=["x","y","top","left","width","height","className"];function TI(){return TI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},TI.apply(this,arguments)}function L8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function m0e(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?L8(Object(n),!0).forEach(function(r){g0e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function g0e(t,e,n){return e=v0e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v0e(t){var e=y0e(t,"string");return xb(e)=="symbol"?e:e+""}function y0e(t,e){if(xb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(xb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function x0e(t,e){if(t==null)return{};var n=b0e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function b0e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var _0e=function(e,n,r,i,a,s){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},S0e=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,s=e.top,o=s===void 0?0:s,c=e.left,u=c===void 0?0:c,h=e.width,p=h===void 0?0:h,v=e.height,y=v===void 0?0:v,b=e.className,w=x0e(e,p0e),_=m0e({x:r,y:a,top:o,left:u,width:p,height:y},w);return!mt(r)||!mt(a)||!mt(p)||!mt(y)||!mt(o)||!mt(u)?null:fe.createElement("path",TI({},_n(_,!0),{className:In("recharts-cross",b),d:_0e(r,a,p,y,o,u)}))},h3,k8;function A0e(){if(k8)return h3;k8=1;var t=pq(),e=t(Object.getPrototypeOf,Object);return h3=e,h3}var p3,F8;function w0e(){if(F8)return p3;F8=1;var t=uf(),e=A0e(),n=ff(),r="[object Object]",i=Function.prototype,a=Object.prototype,s=i.toString,o=a.hasOwnProperty,c=s.call(Object);function u(h){if(!n(h)||t(h)!=r)return!1;var p=e(h);if(p===null)return!0;var v=o.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&s.call(v)==c}return p3=u,p3}var M0e=w0e();const E0e=ar(M0e);var m3,U8;function T0e(){if(U8)return m3;U8=1;var t=uf(),e=ff(),n="[object Boolean]";function r(i){return i===!0||i===!1||e(i)&&t(i)==n}return m3=r,m3}var C0e=T0e();const R0e=ar(C0e);function bb(t){"@babel/helpers - typeof";return bb=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},bb(t)}function Lw(){return Lw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Lw.apply(this,arguments)}function O0e(t,e){return I0e(t)||N0e(t,e)||D0e(t,e)||P0e()}function P0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D0e(t,e){if(t){if(typeof t=="string")return j8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j8(t,e)}}function j8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function N0e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function I0e(t){if(Array.isArray(t))return t}function z8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function G8(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?z8(Object(n),!0).forEach(function(r){B0e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function B0e(t,e,n){return e=L0e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function L0e(t){var e=k0e(t,"string");return bb(e)=="symbol"?e:e+""}function k0e(t,e){if(bb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(bb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var H8=function(e,n,r,i,a){var s=r-i,o;return o="M ".concat(e,",").concat(n),o+="L ".concat(e+r,",").concat(n),o+="L ".concat(e+r-s/2,",").concat(n+a),o+="L ".concat(e+r-s/2-i,",").concat(n+a),o+="L ".concat(e,",").concat(n," Z"),o},F0e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},U0e=function(e){var n=G8(G8({},F0e),e),r=j.useRef(),i=j.useState(-1),a=O0e(i,2),s=a[0],o=a[1];j.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var T=r.current.getTotalLength();T&&o(T)}catch{}},[]);var c=n.x,u=n.y,h=n.upperWidth,p=n.lowerWidth,v=n.height,y=n.className,b=n.animationEasing,w=n.animationDuration,_=n.animationBegin,S=n.isUpdateAnimationActive;if(c!==+c||u!==+u||h!==+h||p!==+p||v!==+v||h===0&&p===0||v===0)return null;var E=In("recharts-trapezoid",y);return S?fe.createElement(Gc,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:v,x:c,y:u},to:{upperWidth:h,lowerWidth:p,height:v,x:c,y:u},duration:w,animationEasing:b,isActive:S},function(T){var P=T.upperWidth,R=T.lowerWidth,D=T.height,I=T.x,k=T.y;return fe.createElement(Gc,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:_,duration:w,easing:b},fe.createElement("path",Lw({},_n(n,!0),{className:E,d:H8(I,k,P,R,D),ref:r})))}):fe.createElement("g",null,fe.createElement("path",Lw({},_n(n,!0),{className:E,d:H8(c,u,h,p,v)})))},j0e=["option","shapeType","propTransformer","activeClassName","isActive"];function _b(t){"@babel/helpers - typeof";return _b=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},_b(t)}function z0e(t,e){if(t==null)return{};var n=G0e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function G0e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function V8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function kw(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?V8(Object(n),!0).forEach(function(r){H0e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function H0e(t,e,n){return e=V0e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V0e(t){var e=W0e(t,"string");return _b(e)=="symbol"?e:e+""}function W0e(t,e){if(_b(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(_b(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function q0e(t,e){return kw(kw({},e),t)}function $0e(t,e){return t==="symbols"}function W8(t){var e=t.shapeType,n=t.elementProps;switch(e){case"rectangle":return fe.createElement(l5,n);case"trapezoid":return fe.createElement(U0e,n);case"sector":return fe.createElement(G$,n);case"symbols":if($0e(e))return fe.createElement(EL,n);break;default:return null}}function X0e(t){return j.isValidElement(t)?t.props:t}function K0e(t){var e=t.option,n=t.shapeType,r=t.propTransformer,i=r===void 0?q0e:r,a=t.activeClassName,s=a===void 0?"recharts-active-shape":a,o=t.isActive,c=z0e(t,j0e),u;if(j.isValidElement(e))u=j.cloneElement(e,kw(kw({},c),X0e(e)));else if(yn(e))u=e(c);else if(E0e(e)&&!R0e(e)){var h=i(e,c);u=fe.createElement(W8,{shapeType:n,elementProps:h})}else{var p=c;u=fe.createElement(W8,{shapeType:n,elementProps:p})}return o?fe.createElement(Ar,{className:s},u):u}function DE(t,e){return e!=null&&"trapezoids"in t.props}function NE(t,e){return e!=null&&"sectors"in t.props}function Sb(t,e){return e!=null&&"points"in t.props}function Y0e(t,e){var n,r,i=t.x===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.x)||t.x===e.x,a=t.y===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.y)||t.y===e.y;return i&&a}function J0e(t,e){var n=t.endAngle===e.endAngle,r=t.startAngle===e.startAngle;return n&&r}function Z0e(t,e){var n=t.x===e.x,r=t.y===e.y,i=t.z===e.z;return n&&r&&i}function Q0e(t,e){var n;return DE(t,e)?n=Y0e:NE(t,e)?n=J0e:Sb(t,e)&&(n=Z0e),n}function exe(t,e){var n;return DE(t,e)?n="trapezoids":NE(t,e)?n="sectors":Sb(t,e)&&(n="points"),n}function txe(t,e){if(DE(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(NE(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return Sb(t,e)?e.payload:{}}function nxe(t){var e=t.activeTooltipItem,n=t.graphicalItem,r=t.itemData,i=exe(n,e),a=txe(n,e),s=r.filter(function(c,u){var h=fv(a,c),p=n.props[i].filter(function(b){var w=Q0e(n,e);return w(b,e)}),v=n.props[i].indexOf(p[p.length-1]),y=u===v;return h&&y}),o=r.indexOf(s[s.length-1]);return o}var g3,q8;function rxe(){if(q8)return g3;q8=1;var t=Math.ceil,e=Math.max;function n(r,i,a,s){for(var o=-1,c=e(t((i-r)/(a||1)),0),u=Array(c);c--;)u[s?c:++o]=r,r+=a;return u}return g3=n,g3}var v3,$8;function Y$(){if($8)return v3;$8=1;var t=Oq(),e=1/0,n=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=t(i),i===e||i===-e){var a=i<0?-1:1;return a*n}return i===i?i:0}return v3=r,v3}var y3,X8;function ixe(){if(X8)return y3;X8=1;var t=rxe(),e=_E(),n=Y$();function r(i){return function(a,s,o){return o&&typeof o!="number"&&e(a,s,o)&&(s=o=void 0),a=n(a),s===void 0?(s=a,a=0):s=n(s),o=o===void 0?a<s?1:-1:n(o),t(a,s,o,i)}}return y3=r,y3}var x3,K8;function axe(){if(K8)return x3;K8=1;var t=ixe(),e=t();return x3=e,x3}var sxe=axe();const Fw=ar(sxe);function Ab(t){"@babel/helpers - typeof";return Ab=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},Ab(t)}function Y8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function J8(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Y8(Object(n),!0).forEach(function(r){J$(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Y8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function J$(t,e,n){return e=oxe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oxe(t){var e=lxe(t,"string");return Ab(e)=="symbol"?e:e+""}function lxe(t,e){if(Ab(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ab(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var cxe=["Webkit","Moz","O","ms"],uxe=function(e,n){var r=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=cxe.reduce(function(a,s){return J8(J8({},a),{},J$({},s+r,n))},{});return i[e]=n,i};function pv(t){"@babel/helpers - typeof";return pv=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},pv(t)}function Uw(){return Uw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Uw.apply(this,arguments)}function Z8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function b3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Z8(Object(n),!0).forEach(function(r){Xs(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function fxe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q8(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Q$(r.key),r)}}function dxe(t,e,n){return e&&Q8(t.prototype,e),n&&Q8(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function hxe(t,e,n){return e=jw(e),pxe(t,Z$()?Reflect.construct(e,n||[],jw(t).constructor):e.apply(t,n))}function pxe(t,e){if(e&&(pv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mxe(t)}function mxe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Z$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Z$=function(){return!!t})()}function jw(t){return jw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jw(t)}function gxe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&CI(t,e)}function CI(t,e){return CI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},CI(t,e)}function Xs(t,e,n){return e=Q$(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q$(t){var e=vxe(t,"string");return pv(e)=="symbol"?e:e+""}function vxe(t,e){if(pv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(pv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var yxe=function(e){var n=e.data,r=e.startIndex,i=e.endIndex,a=e.x,s=e.width,o=e.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=Ox().domain(Fw(0,c)).range([a,a+s-o]),h=u.domain().map(function(p){return u(p)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(i),scale:u,scaleValues:h}},e6=function(e){return e.changedTouches&&!!e.changedTouches.length},mv=(function(t){function e(n){var r;return fxe(this,e),r=hxe(this,e,[n]),Xs(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),Xs(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),Xs(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,s=i.onDragEnd,o=i.startIndex;s?.({endIndex:a,startIndex:o})}),r.detachDragEndListener()}),Xs(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Xs(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Xs(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Xs(r,"handleSlideDragStart",function(i){var a=e6(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return gxe(e,t),dxe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,s=this.state.scaleValues,o=this.props,c=o.gap,u=o.data,h=u.length-1,p=Math.min(i,a),v=Math.max(i,a),y=e.getIndexInRange(s,p),b=e.getIndexInRange(s,v);return{startIndex:y-y%c,endIndex:b===h?h:b-b%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,a=i.data,s=i.tickFormatter,o=i.dataKey,c=cs(a[r],o,r);return yn(s)?s(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,a=i.slideMoveStartX,s=i.startX,o=i.endX,c=this.props,u=c.x,h=c.width,p=c.travellerWidth,v=c.startIndex,y=c.endIndex,b=c.onChange,w=r.pageX-a;w>0?w=Math.min(w,u+h-p-o,u+h-p-s):w<0&&(w=Math.max(w,u-s,u-o));var _=this.getIndex({startX:s+w,endX:o+w});(_.startIndex!==v||_.endIndex!==y)&&b&&b(_),this.setState({startX:s+w,endX:o+w,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=e6(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,s=i.movingTravellerId,o=i.endX,c=i.startX,u=this.state[s],h=this.props,p=h.x,v=h.width,y=h.travellerWidth,b=h.onChange,w=h.gap,_=h.data,S={startX:this.state.startX,endX:this.state.endX},E=r.pageX-a;E>0?E=Math.min(E,p+v-y-u):E<0&&(E=Math.max(E,p-u)),S[s]=u+E;var T=this.getIndex(S),P=T.startIndex,R=T.endIndex,D=function(){var k=_.length-1;return s==="startX"&&(o>c?P%w===0:R%w===0)||o<c&&R===k||s==="endX"&&(o>c?R%w===0:P%w===0)||o>c&&R===k};this.setState(Xs(Xs({},s,u+E),"brushMoveStartX",r.pageX),function(){b&&D()&&b(T)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,s=this.state,o=s.scaleValues,c=s.startX,u=s.endX,h=this.state[i],p=o.indexOf(h);if(p!==-1){var v=p+r;if(!(v===-1||v>=o.length)){var y=o[v];i==="startX"&&y>=u||i==="endX"&&y<=c||this.setState(Xs({},i,y),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,s=r.width,o=r.height,c=r.fill,u=r.stroke;return fe.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:s,height:o})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,s=r.width,o=r.height,c=r.data,u=r.children,h=r.padding,p=j.Children.only(u);return p?fe.cloneElement(p,{x:i,y:a,width:s,height:o,margin:h,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var a,s,o=this,c=this.props,u=c.y,h=c.travellerWidth,p=c.height,v=c.traveller,y=c.ariaLabel,b=c.data,w=c.startIndex,_=c.endIndex,S=Math.max(r,this.props.x),E=b3(b3({},_n(this.props,!1)),{},{x:S,y:u,width:h,height:p}),T=y||"Min value: ".concat((a=b[w])===null||a===void 0?void 0:a.name,", Max value: ").concat((s=b[_])===null||s===void 0?void 0:s.name);return fe.createElement(Ar,{tabIndex:0,role:"slider","aria-label":T,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(R){["ArrowLeft","ArrowRight"].includes(R.key)&&(R.preventDefault(),R.stopPropagation(),o.handleTravellerMoveKeyboard(R.key==="ArrowRight"?1:-1,i))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(v,E))}},{key:"renderSlide",value:function(r,i){var a=this.props,s=a.y,o=a.height,c=a.stroke,u=a.travellerWidth,h=Math.min(r,i)+u,p=Math.max(Math.abs(i-r)-u,0);return fe.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:h,y:s,width:p,height:o})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,a=r.endIndex,s=r.y,o=r.height,c=r.travellerWidth,u=r.stroke,h=this.state,p=h.startX,v=h.endX,y=5,b={pointerEvents:"none",fill:u};return fe.createElement(Ar,{className:"recharts-brush-texts"},fe.createElement(dw,Uw({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,v)-y,y:s+o/2},b),this.getTextOfTick(i)),fe.createElement(dw,Uw({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,v)+c+y,y:s+o/2},b),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=r.className,s=r.children,o=r.x,c=r.y,u=r.width,h=r.height,p=r.alwaysShowText,v=this.state,y=v.startX,b=v.endX,w=v.isTextActive,_=v.isSlideMoving,S=v.isTravellerMoving,E=v.isTravellerFocused;if(!i||!i.length||!mt(o)||!mt(c)||!mt(u)||!mt(h)||u<=0||h<=0)return null;var T=In("recharts-brush",a),P=fe.Children.count(s)===1,R=uxe("userSelect","none");return fe.createElement(Ar,{className:T,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:R},this.renderBackground(),P&&this.renderPanorama(),this.renderSlide(y,b),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(b,"endX"),(w||_||S||E||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,s=r.width,o=r.height,c=r.stroke,u=Math.floor(a+o/2)-1;return fe.createElement(fe.Fragment,null,fe.createElement("rect",{x:i,y:a,width:s,height:o,fill:c,stroke:"none"}),fe.createElement("line",{x1:i+1,y1:u,x2:i+s-1,y2:u,fill:"none",stroke:"#fff"}),fe.createElement("line",{x1:i+1,y1:u+2,x2:i+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return fe.isValidElement(r)?a=fe.cloneElement(r,i):yn(r)?a=r(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,s=r.width,o=r.x,c=r.travellerWidth,u=r.updateId,h=r.startIndex,p=r.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return b3({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:s},a&&a.length?yxe({data:a,width:s,x:o,travellerWidth:c,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||o!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([o,o+s-c]);var v=i.scale.domain().map(function(y){return i.scale(y)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:v}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,s=0,o=a-1;o-s>1;){var c=Math.floor((s+o)/2);r[c]>i?o=c:s=c}return i>=r[o]?o:s}}])})(j.PureComponent);Xs(mv,"displayName","Brush");Xs(mv,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var _3,t6;function xxe(){if(t6)return _3;t6=1;var t=NL();function e(n,r){var i;return t(n,function(a,s,o){return i=r(a,s,o),!i}),!!i}return _3=e,_3}var S3,n6;function bxe(){if(n6)return S3;n6=1;var t=oq(),e=kd(),n=xxe(),r=ks(),i=_E();function a(s,o,c){var u=r(s)?t:n;return c&&i(s,o,c)&&(o=void 0),u(s,e(o,3))}return S3=a,S3}var _xe=bxe();const Sxe=ar(_xe);var kc=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},A3,r6;function Axe(){if(r6)return A3;r6=1;var t=Mq();function e(n,r,i){r=="__proto__"&&t?t(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return A3=e,A3}var w3,i6;function wxe(){if(i6)return w3;i6=1;var t=Axe(),e=Aq(),n=kd();function r(i,a){var s={};return a=n(a,3),e(i,function(o,c,u){t(s,c,a(o,c,u))}),s}return w3=r,w3}var Mxe=wxe();const Exe=ar(Mxe);var M3,a6;function Txe(){if(a6)return M3;a6=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(!n(e[r],r,e))return!1;return!0}return M3=t,M3}var E3,s6;function Cxe(){if(s6)return E3;s6=1;var t=NL();function e(n,r){var i=!0;return t(n,function(a,s,o){return i=!!r(a,s,o),i}),i}return E3=e,E3}var T3,o6;function Rxe(){if(o6)return T3;o6=1;var t=Txe(),e=Cxe(),n=kd(),r=ks(),i=_E();function a(s,o,c){var u=r(s)?t:e;return c&&i(s,o,c)&&(o=void 0),u(s,n(o,3))}return T3=a,T3}var Oxe=Rxe();const eX=ar(Oxe);var Pxe=["x","y"];function wb(t){"@babel/helpers - typeof";return wb=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},wb(t)}function RI(){return RI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},RI.apply(this,arguments)}function l6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function J0(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?l6(Object(n),!0).forEach(function(r){Dxe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Dxe(t,e,n){return e=Nxe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nxe(t){var e=Ixe(t,"string");return wb(e)=="symbol"?e:e+""}function Ixe(t,e){if(wb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(wb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bxe(t,e){if(t==null)return{};var n=Lxe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Lxe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function kxe(t,e){var n=t.x,r=t.y,i=Bxe(t,Pxe),a="".concat(n),s=parseInt(a,10),o="".concat(r),c=parseInt(o,10),u="".concat(e.height||i.height),h=parseInt(u,10),p="".concat(e.width||i.width),v=parseInt(p,10);return J0(J0(J0(J0(J0({},e),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:h,width:v,name:e.name,radius:e.radius})}function c6(t){return fe.createElement(K0e,RI({shapeType:"rectangle",propTransformer:kxe,activeClassName:"recharts-active-bar"},t))}var Fxe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var a=mt(r)||Voe(r);return a?e(r,i):(a||Mp(),n)}},Uxe=["value","background"],tX;function gv(t){"@babel/helpers - typeof";return gv=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},gv(t)}function jxe(t,e){if(t==null)return{};var n=zxe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zxe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function zw(){return zw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},zw.apply(this,arguments)}function u6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ti(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?u6(Object(n),!0).forEach(function(r){_d(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Gxe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f6(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rX(r.key),r)}}function Hxe(t,e,n){return e&&f6(t.prototype,e),n&&f6(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Vxe(t,e,n){return e=Gw(e),Wxe(t,nX()?Reflect.construct(e,n||[],Gw(t).constructor):e.apply(t,n))}function Wxe(t,e){if(e&&(gv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qxe(t)}function qxe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nX=function(){return!!t})()}function Gw(t){return Gw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gw(t)}function $xe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&OI(t,e)}function OI(t,e){return OI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},OI(t,e)}function _d(t,e,n){return e=rX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rX(t){var e=Xxe(t,"string");return gv(e)=="symbol"?e:e+""}function Xxe(t,e){if(gv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(gv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var a1=(function(t){function e(){var n;Gxe(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Vxe(this,e,[].concat(i)),_d(n,"state",{isAnimationFinished:!1}),_d(n,"id",Yv("recharts-bar-")),_d(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),s&&s()}),_d(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),s&&s()}),n}return $xe(e,t),Hxe(e,[{key:"renderRectanglesStatically",value:function(r){var i=this,a=this.props,s=a.shape,o=a.dataKey,c=a.activeIndex,u=a.activeBar,h=_n(this.props,!1);return r&&r.map(function(p,v){var y=v===c,b=y?u:s,w=Ti(Ti(Ti({},h),p),{},{isActive:y,option:b,index:v,dataKey:o,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return fe.createElement(Ar,zw({className:"recharts-bar-rectangle"},tw(i.props,p,v),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(v)}),fe.createElement(c6,w))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,a=i.data,s=i.layout,o=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,h=i.animationEasing,p=i.animationId,v=this.state.prevData;return fe.createElement(Gc,{begin:c,duration:u,isActive:o,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var b=y.t,w=a.map(function(_,S){var E=v&&v[S];if(E){var T=ha(E.x,_.x),P=ha(E.y,_.y),R=ha(E.width,_.width),D=ha(E.height,_.height);return Ti(Ti({},_),{},{x:T(b),y:P(b),width:R(b),height:D(b)})}if(s==="horizontal"){var I=ha(0,_.height),k=I(b);return Ti(Ti({},_),{},{y:_.y+_.height-k,height:k})}var B=ha(0,_.width),U=B(b);return Ti(Ti({},_),{},{width:U})});return fe.createElement(Ar,null,r.renderRectanglesStatically(w))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,a=r.isAnimationActive,s=this.state.prevData;return a&&i&&i.length&&(!s||!fv(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,a=i.data,s=i.dataKey,o=i.activeIndex,c=_n(this.props.background,!1);return a.map(function(u,h){u.value;var p=u.background,v=jxe(u,Uxe);if(!p)return null;var y=Ti(Ti(Ti(Ti(Ti({},v),{},{fill:"#eee"},p),c),tw(r.props,u,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:s,index:h,className:"recharts-bar-background-rectangle"});return fe.createElement(c6,zw({key:"background-bar-".concat(h),option:r.props.background,isActive:h===o},y))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.data,o=a.xAxis,c=a.yAxis,u=a.layout,h=a.children,p=Vo(h,i1);if(!p)return null;var v=u==="vertical"?s[0].height/2:s[0].width/2,y=function(_,S){var E=Array.isArray(_.value)?_.value[1]:_.value;return{x:_.x,y:_.y,value:E,errorVal:cs(_,S)}},b={clipPath:r?"url(#clipPath-".concat(i,")"):null};return fe.createElement(Ar,b,p.map(function(w){return fe.cloneElement(w,{key:"error-bar-".concat(i,"-").concat(w.props.dataKey),data:s,xAxis:o,yAxis:c,layout:u,offset:v,dataPointFormatter:y})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,a=r.data,s=r.className,o=r.xAxis,c=r.yAxis,u=r.left,h=r.top,p=r.width,v=r.height,y=r.isAnimationActive,b=r.background,w=r.id;if(i||!a||!a.length)return null;var _=this.state.isAnimationFinished,S=In("recharts-bar",s),E=o&&o.allowDataOverflow,T=c&&c.allowDataOverflow,P=E||T,R=Cn(w)?this.id:w;return fe.createElement(Ar,{className:S},E||T?fe.createElement("defs",null,fe.createElement("clipPath",{id:"clipPath-".concat(R)},fe.createElement("rect",{x:E?u:u-p/2,y:T?h:h-v/2,width:E?p:p*2,height:T?v:v*2}))):null,fe.createElement(Ar,{className:"recharts-bar-rectangles",clipPath:P?"url(#clipPath-".concat(R,")"):null},b?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(P,R),(!y||_)&&Ju.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])})(j.PureComponent);tX=a1;_d(a1,"displayName","Bar");_d(a1,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Fp.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});_d(a1,"getComposedData",function(t){var e=t.props,n=t.item,r=t.barPosition,i=t.bandSize,a=t.xAxis,s=t.yAxis,o=t.xAxisTicks,c=t.yAxisTicks,u=t.stackedData,h=t.dataStartIndex,p=t.displayedData,v=t.offset,y=lge(r,n);if(!y)return null;var b=e.layout,w=n.type.defaultProps,_=w!==void 0?Ti(Ti({},w),n.props):n.props,S=_.dataKey,E=_.children,T=_.minPointSize,P=b==="horizontal"?s:a,R=u?P.scale.domain():null,D=gge({numericAxis:P}),I=Vo(E,Nq),k=p.map(function(B,U){var z,q,W,ee,Q,V;u?z=cge(u[h+U],R):(z=cs(B,S),Array.isArray(z)||(z=[D,z]));var $=Fxe(T,tX.defaultProps.minPointSize)(z[1],U);if(b==="horizontal"){var Y,ie=[s.scale(z[0]),s.scale(z[1])],de=ie[0],X=ie[1];q=J9({axis:a,ticks:o,bandSize:i,offset:y.offset,entry:B,index:U}),W=(Y=X??de)!==null&&Y!==void 0?Y:void 0,ee=y.size;var ae=de-X;if(Q=Number.isNaN(ae)?0:ae,V={x:q,y:s.y,width:ee,height:s.height},Math.abs($)>0&&Math.abs(Q)<Math.abs($)){var ue=Il(Q||$)*(Math.abs($)-Math.abs(Q));W-=ue,Q+=ue}}else{var Se=[a.scale(z[0]),a.scale(z[1])],$e=Se[0],me=Se[1];if(q=$e,W=J9({axis:s,ticks:c,bandSize:i,offset:y.offset,entry:B,index:U}),ee=me-$e,Q=y.size,V={x:a.x,y:W,width:a.width,height:Q},Math.abs($)>0&&Math.abs(ee)<Math.abs($)){var ve=Il(ee||$)*(Math.abs($)-Math.abs(ee));ee+=ve}}return Ti(Ti(Ti({},B),{},{x:q,y:W,width:ee,height:Q,value:u?z:z[1],payload:B,background:V},I&&I[U]&&I[U].props),{},{tooltipPayload:[U$(n,B)],tooltipPosition:{x:q+ee/2,y:W+Q/2}})});return Ti({data:k,layout:b},v)});function Mb(t){"@babel/helpers - typeof";return Mb=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},Mb(t)}function Kxe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d6(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,iX(r.key),r)}}function Yxe(t,e,n){return e&&d6(t.prototype,e),n&&d6(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function h6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ol(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?h6(Object(n),!0).forEach(function(r){IE(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function IE(t,e,n){return e=iX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iX(t){var e=Jxe(t,"string");return Mb(e)=="symbol"?e:e+""}function Jxe(t,e){if(Mb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Mb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var aX=function(e,n,r,i,a){var s=e.width,o=e.height,c=e.layout,u=e.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:s-r.right,rightMirror:s-r.right,top:r.top,topMirror:r.top,bottom:o-r.bottom,bottomMirror:o-r.bottom},v=!!Ks(u,a1);return h.reduce(function(y,b){var w=n[b],_=w.orientation,S=w.domain,E=w.padding,T=E===void 0?{}:E,P=w.mirror,R=w.reversed,D="".concat(_).concat(P?"Mirror":""),I,k,B,U,z;if(w.type==="number"&&(w.padding==="gap"||w.padding==="no-gap")){var q=S[1]-S[0],W=1/0,ee=w.categoricalDomain.sort($oe);if(ee.forEach(function(Se,$e){$e>0&&(W=Math.min((Se||0)-(ee[$e-1]||0),W))}),Number.isFinite(W)){var Q=W/q,V=w.layout==="vertical"?r.height:r.width;if(w.padding==="gap"&&(I=Q*V/2),w.padding==="no-gap"){var $=Ap(e.barCategoryGap,Q*V),Y=Q*V/2;I=Y-$-(Y-$)/V*$}}}i==="xAxis"?k=[r.left+(T.left||0)+(I||0),r.left+r.width-(T.right||0)-(I||0)]:i==="yAxis"?k=c==="horizontal"?[r.top+r.height-(T.bottom||0),r.top+(T.top||0)]:[r.top+(T.top||0)+(I||0),r.top+r.height-(T.bottom||0)-(I||0)]:k=w.range,R&&(k=[k[1],k[0]]);var ie=sge(w,a,v),de=ie.scale,X=ie.realScaleType;de.domain(S).range(k),oge(de);var ae=mge(de,Ol(Ol({},w),{},{realScaleType:X}));i==="xAxis"?(z=_==="top"&&!P||_==="bottom"&&P,B=r.left,U=p[D]-z*w.height):i==="yAxis"&&(z=_==="left"&&!P||_==="right"&&P,B=p[D]-z*w.width,U=r.top);var ue=Ol(Ol(Ol({},w),ae),{},{realScaleType:X,x:B,y:U,scale:de,width:i==="xAxis"?r.width:w.width,height:i==="yAxis"?r.height:w.height});return ue.bandSize=Tw(ue,ae),!w.hide&&i==="xAxis"?p[D]+=(z?-1:1)*ue.height:w.hide||(p[D]+=(z?-1:1)*ue.width),Ol(Ol({},y),{},IE({},b,ue))},{})},sX=function(e,n){var r=e.x,i=e.y,a=n.x,s=n.y;return{x:Math.min(r,a),y:Math.min(i,s),width:Math.abs(a-r),height:Math.abs(s-i)}},Zxe=function(e){var n=e.x1,r=e.y1,i=e.x2,a=e.y2;return sX({x:n,y:r},{x:i,y:a})},oX=(function(){function t(e){Kxe(this,t),this.scale=e}return Yxe(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(n)+o}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}])})();IE(oX,"EPS",1e-4);var c5=function(e){var n=Object.keys(e).reduce(function(r,i){return Ol(Ol({},r),{},IE({},i,oX.create(e[i])))},{});return Ol(Ol({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.bandAware,o=a.position;return Exe(i,function(c,u){return n[u].apply(c,{bandAware:s,position:o})})},isInRange:function(i){return eX(i,function(a,s){return n[s].isInRange(a)})}})};function Qxe(t){return(t%180+180)%180}var ebe=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Qxe(i),s=a*Math.PI/180,o=Math.atan(r/n),c=s>o&&s<Math.PI-o?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},C3,p6;function tbe(){if(p6)return C3;p6=1;var t=kd(),e=Qb(),n=xE();function r(i){return function(a,s,o){var c=Object(a);if(!e(a)){var u=t(s,3);a=n(a),s=function(p){return u(c[p],p,c)}}var h=i(a,s,o);return h>-1?c[u?a[h]:h]:void 0}}return C3=r,C3}var R3,m6;function nbe(){if(m6)return R3;m6=1;var t=Y$();function e(n){var r=t(n),i=r%1;return r===r?i?r-i:r:0}return R3=e,R3}var O3,g6;function rbe(){if(g6)return O3;g6=1;var t=yq(),e=kd(),n=nbe(),r=Math.max;function i(a,s,o){var c=a==null?0:a.length;if(!c)return-1;var u=o==null?0:n(o);return u<0&&(u=r(c+u,0)),t(a,e(s,3),u)}return O3=i,O3}var P3,v6;function ibe(){if(v6)return P3;v6=1;var t=tbe(),e=rbe(),n=t(e);return P3=n,P3}var abe=ibe();const sbe=ar(abe);var obe=NW();const lbe=ar(obe);var cbe=lbe(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),u5=j.createContext(void 0),f5=j.createContext(void 0),lX=j.createContext(void 0),cX=j.createContext({}),uX=j.createContext(void 0),fX=j.createContext(0),dX=j.createContext(0),y6=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,s=e.clipPathId,o=e.children,c=e.width,u=e.height,h=cbe(a);return fe.createElement(u5.Provider,{value:r},fe.createElement(f5.Provider,{value:i},fe.createElement(cX.Provider,{value:a},fe.createElement(lX.Provider,{value:h},fe.createElement(uX.Provider,{value:s},fe.createElement(fX.Provider,{value:u},fe.createElement(dX.Provider,{value:c},o)))))))},ube=function(){return j.useContext(uX)},hX=function(e){var n=j.useContext(u5);n==null&&Mp();var r=n[e];return r==null&&Mp(),r},fbe=function(){var e=j.useContext(u5);return gd(e)},dbe=function(){var e=j.useContext(f5),n=sbe(e,function(r){return eX(r.domain,Number.isFinite)});return n||gd(e)},pX=function(e){var n=j.useContext(f5);n==null&&Mp();var r=n[e];return r==null&&Mp(),r},hbe=function(){var e=j.useContext(lX);return e},pbe=function(){return j.useContext(cX)},d5=function(){return j.useContext(dX)},h5=function(){return j.useContext(fX)};function vv(t){"@babel/helpers - typeof";return vv=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},vv(t)}function mbe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gbe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gX(r.key),r)}}function vbe(t,e,n){return e&&gbe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ybe(t,e,n){return e=Hw(e),xbe(t,mX()?Reflect.construct(e,n||[],Hw(t).constructor):e.apply(t,n))}function xbe(t,e){if(e&&(vv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bbe(t)}function bbe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mX=function(){return!!t})()}function Hw(t){return Hw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hw(t)}function _be(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&PI(t,e)}function PI(t,e){return PI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},PI(t,e)}function x6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function b6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?x6(Object(n),!0).forEach(function(r){p5(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function p5(t,e,n){return e=gX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gX(t){var e=Sbe(t,"string");return vv(e)=="symbol"?e:e+""}function Sbe(t,e){if(vv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(vv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Abe(t,e){return Tbe(t)||Ebe(t,e)||Mbe(t,e)||wbe()}function wbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mbe(t,e){if(t){if(typeof t=="string")return _6(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _6(t,e)}}function _6(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ebe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Tbe(t){if(Array.isArray(t))return t}function DI(){return DI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},DI.apply(this,arguments)}var Cbe=function(e,n){var r;return fe.isValidElement(e)?r=fe.cloneElement(e,n):yn(e)?r=e(n):r=fe.createElement("line",DI({},n,{className:"recharts-reference-line-line"})),r},Rbe=function(e,n,r,i,a,s,o,c,u){var h=a.x,p=a.y,v=a.width,y=a.height;if(r){var b=u.y,w=e.y.apply(b,{position:s});if(kc(u,"discard")&&!e.y.isInRange(w))return null;var _=[{x:h+v,y:w},{x:h,y:w}];return c==="left"?_.reverse():_}if(n){var S=u.x,E=e.x.apply(S,{position:s});if(kc(u,"discard")&&!e.x.isInRange(E))return null;var T=[{x:E,y:p+y},{x:E,y:p}];return o==="top"?T.reverse():T}if(i){var P=u.segment,R=P.map(function(D){return e.apply(D,{position:s})});return kc(u,"discard")&&Sxe(R,function(D){return!e.isInRange(D)})?null:R}return null};function Obe(t){var e=t.x,n=t.y,r=t.segment,i=t.xAxisId,a=t.yAxisId,s=t.shape,o=t.className,c=t.alwaysShow,u=ube(),h=hX(i),p=pX(a),v=hbe();if(!u||!v)return null;Ku(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var y=c5({x:h.scale,y:p.scale}),b=ji(e),w=ji(n),_=r&&r.length===2,S=Rbe(y,b,w,_,v,t.position,h.orientation,p.orientation,t);if(!S)return null;var E=Abe(S,2),T=E[0],P=T.x,R=T.y,D=E[1],I=D.x,k=D.y,B=kc(t,"hidden")?"url(#".concat(u,")"):void 0,U=b6(b6({clipPath:B},_n(t,!0)),{},{x1:P,y1:R,x2:I,y2:k});return fe.createElement(Ar,{className:In("recharts-reference-line",o)},Cbe(s,U),Da.renderCallByParent(t,Zxe({x1:P,y1:R,x2:I,y2:k})))}var m5=(function(t){function e(){return mbe(this,e),ybe(this,e,arguments)}return _be(e,t),vbe(e,[{key:"render",value:function(){return fe.createElement(Obe,this.props)}}])})(fe.Component);p5(m5,"displayName","ReferenceLine");p5(m5,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function NI(){return NI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},NI.apply(this,arguments)}function yv(t){"@babel/helpers - typeof";return yv=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},yv(t)}function S6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function A6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?S6(Object(n),!0).forEach(function(r){BE(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Pbe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dbe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yX(r.key),r)}}function Nbe(t,e,n){return e&&Dbe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ibe(t,e,n){return e=Vw(e),Bbe(t,vX()?Reflect.construct(e,n||[],Vw(t).constructor):e.apply(t,n))}function Bbe(t,e){if(e&&(yv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lbe(t)}function Lbe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vX=function(){return!!t})()}function Vw(t){return Vw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vw(t)}function kbe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&II(t,e)}function II(t,e){return II=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},II(t,e)}function BE(t,e,n){return e=yX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yX(t){var e=Fbe(t,"string");return yv(e)=="symbol"?e:e+""}function Fbe(t,e){if(yv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(yv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Ube=function(e){var n=e.x,r=e.y,i=e.xAxis,a=e.yAxis,s=c5({x:i.scale,y:a.scale}),o=s.apply({x:n,y:r},{bandAware:!0});return kc(e,"discard")&&!s.isInRange(o)?null:o},LE=(function(t){function e(){return Pbe(this,e),Ibe(this,e,arguments)}return kbe(e,t),Nbe(e,[{key:"render",value:function(){var r=this.props,i=r.x,a=r.y,s=r.r,o=r.alwaysShow,c=r.clipPathId,u=ji(i),h=ji(a);if(Ku(o===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!h)return null;var p=Ube(this.props);if(!p)return null;var v=p.x,y=p.y,b=this.props,w=b.shape,_=b.className,S=kc(this.props,"hidden")?"url(#".concat(c,")"):void 0,E=A6(A6({clipPath:S},_n(this.props,!0)),{},{cx:v,cy:y});return fe.createElement(Ar,{className:In("recharts-reference-dot",_)},e.renderDot(w,E),Da.renderCallByParent(this.props,{x:v-s,y:y-s,width:2*s,height:2*s}))}}])})(fe.Component);BE(LE,"displayName","ReferenceDot");BE(LE,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});BE(LE,"renderDot",function(t,e){var n;return fe.isValidElement(t)?n=fe.cloneElement(t,e):yn(t)?n=t(e):n=fe.createElement(PE,NI({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),n});function BI(){return BI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},BI.apply(this,arguments)}function xv(t){"@babel/helpers - typeof";return xv=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},xv(t)}function w6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function M6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?w6(Object(n),!0).forEach(function(r){kE(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function jbe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zbe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,bX(r.key),r)}}function Gbe(t,e,n){return e&&zbe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Hbe(t,e,n){return e=Ww(e),Vbe(t,xX()?Reflect.construct(e,n||[],Ww(t).constructor):e.apply(t,n))}function Vbe(t,e){if(e&&(xv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wbe(t)}function Wbe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xX=function(){return!!t})()}function Ww(t){return Ww=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ww(t)}function qbe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&LI(t,e)}function LI(t,e){return LI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},LI(t,e)}function kE(t,e,n){return e=bX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bX(t){var e=$be(t,"string");return xv(e)=="symbol"?e:e+""}function $be(t,e){if(xv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(xv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Xbe=function(e,n,r,i,a){var s=a.x1,o=a.x2,c=a.y1,u=a.y2,h=a.xAxis,p=a.yAxis;if(!h||!p)return null;var v=c5({x:h.scale,y:p.scale}),y={x:e?v.x.apply(s,{position:"start"}):v.x.rangeMin,y:r?v.y.apply(c,{position:"start"}):v.y.rangeMin},b={x:n?v.x.apply(o,{position:"end"}):v.x.rangeMax,y:i?v.y.apply(u,{position:"end"}):v.y.rangeMax};return kc(a,"discard")&&(!v.isInRange(y)||!v.isInRange(b))?null:sX(y,b)},FE=(function(t){function e(){return jbe(this,e),Hbe(this,e,arguments)}return qbe(e,t),Gbe(e,[{key:"render",value:function(){var r=this.props,i=r.x1,a=r.x2,s=r.y1,o=r.y2,c=r.className,u=r.alwaysShow,h=r.clipPathId;Ku(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=ji(i),v=ji(a),y=ji(s),b=ji(o),w=this.props.shape;if(!p&&!v&&!y&&!b&&!w)return null;var _=Xbe(p,v,y,b,this.props);if(!_&&!w)return null;var S=kc(this.props,"hidden")?"url(#".concat(h,")"):void 0;return fe.createElement(Ar,{className:In("recharts-reference-area",c)},e.renderRect(w,M6(M6({clipPath:S},_n(this.props,!0)),_)),Da.renderCallByParent(this.props,_))}}])})(fe.Component);kE(FE,"displayName","ReferenceArea");kE(FE,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});kE(FE,"renderRect",function(t,e){var n;return fe.isValidElement(t)?n=fe.cloneElement(t,e):yn(t)?n=t(e):n=fe.createElement(l5,BI({},e,{className:"recharts-reference-area-rect"})),n});function _X(t,e,n){if(e<1)return[];if(e===1&&n===void 0)return t;for(var r=[],i=0;i<t.length;i+=e)r.push(t[i]);return r}function Kbe(t,e,n){var r={width:t.width+e.width,height:t.height+e.height};return ebe(r,n)}function Ybe(t,e,n){var r=n==="width",i=t.x,a=t.y,s=t.width,o=t.height;return e===1?{start:r?i:a,end:r?i+s:a+o}:{start:r?i+s:a+o,end:r?i:a}}function qw(t,e,n,r,i){if(t*e<t*r||t*e>t*i)return!1;var a=n();return t*(e-t*a/2-r)>=0&&t*(e+t*a/2-i)<=0}function Jbe(t,e){return _X(t,e+1)}function Zbe(t,e,n,r,i){for(var a=(r||[]).slice(),s=e.start,o=e.end,c=0,u=1,h=s,p=function(){var b=r?.[c];if(b===void 0)return{v:_X(r,u)};var w=c,_,S=function(){return _===void 0&&(_=n(b,w)),_},E=b.coordinate,T=c===0||qw(t,E,S,h,o);T||(c=0,h=s,u+=1),T&&(h=E+t*(S()/2+i),c+=u)},v;u<=a.length;)if(v=p(),v)return v.v;return[]}function Eb(t){"@babel/helpers - typeof";return Eb=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},Eb(t)}function E6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Oa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?E6(Object(n),!0).forEach(function(r){Qbe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Qbe(t,e,n){return e=e1e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e1e(t){var e=t1e(t,"string");return Eb(e)=="symbol"?e:e+""}function t1e(t,e){if(Eb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Eb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function n1e(t,e,n,r,i){for(var a=(r||[]).slice(),s=a.length,o=e.start,c=e.end,u=function(v){var y=a[v],b,w=function(){return b===void 0&&(b=n(y,v)),b};if(v===s-1){var _=t*(y.coordinate+t*w()/2-c);a[v]=y=Oa(Oa({},y),{},{tickCoord:_>0?y.coordinate-_*t:y.coordinate})}else a[v]=y=Oa(Oa({},y),{},{tickCoord:y.coordinate});var S=qw(t,y.tickCoord,w,o,c);S&&(c=y.tickCoord-t*(w()/2+i),a[v]=Oa(Oa({},y),{},{isShow:!0}))},h=s-1;h>=0;h--)u(h);return a}function r1e(t,e,n,r,i,a){var s=(r||[]).slice(),o=s.length,c=e.start,u=e.end;if(a){var h=r[o-1],p=n(h,o-1),v=t*(h.coordinate+t*p/2-u);s[o-1]=h=Oa(Oa({},h),{},{tickCoord:v>0?h.coordinate-v*t:h.coordinate});var y=qw(t,h.tickCoord,function(){return p},c,u);y&&(u=h.tickCoord-t*(p/2+i),s[o-1]=Oa(Oa({},h),{},{isShow:!0}))}for(var b=a?o-1:o,w=function(E){var T=s[E],P,R=function(){return P===void 0&&(P=n(T,E)),P};if(E===0){var D=t*(T.coordinate-t*R()/2-c);s[E]=T=Oa(Oa({},T),{},{tickCoord:D<0?T.coordinate-D*t:T.coordinate})}else s[E]=T=Oa(Oa({},T),{},{tickCoord:T.coordinate});var I=qw(t,T.tickCoord,R,c,u);I&&(c=T.tickCoord+t*(R()/2+i),s[E]=Oa(Oa({},T),{},{isShow:!0}))},_=0;_<b;_++)w(_);return s}function g5(t,e,n){var r=t.tick,i=t.ticks,a=t.viewBox,s=t.minTickGap,o=t.orientation,c=t.interval,u=t.tickFormatter,h=t.unit,p=t.angle;if(!i||!i.length||!r)return[];if(mt(c)||Fp.isSsr)return Jbe(i,typeof c=="number"&&mt(c)?c:0);var v=[],y=o==="top"||o==="bottom"?"width":"height",b=h&&y==="width"?Rx(h,{fontSize:e,letterSpacing:n}):{width:0,height:0},w=function(T,P){var R=yn(u)?u(T.value,P):T.value;return y==="width"?Kbe(Rx(R,{fontSize:e,letterSpacing:n}),b,p):Rx(R,{fontSize:e,letterSpacing:n})[y]},_=i.length>=2?Il(i[1].coordinate-i[0].coordinate):1,S=Ybe(a,_,y);return c==="equidistantPreserveStart"?Zbe(_,S,w,i,s):(c==="preserveStart"||c==="preserveStartEnd"?v=r1e(_,S,w,i,s,c==="preserveStartEnd"):v=n1e(_,S,w,i,s),v.filter(function(E){return E.isShow}))}var i1e=["viewBox"],a1e=["viewBox"],s1e=["ticks"];function bv(t){"@babel/helpers - typeof";return bv=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},bv(t)}function zg(){return zg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},zg.apply(this,arguments)}function T6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Li(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?T6(Object(n),!0).forEach(function(r){v5(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function D3(t,e){if(t==null)return{};var n=o1e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function o1e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function l1e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C6(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,AX(r.key),r)}}function c1e(t,e,n){return e&&C6(t.prototype,e),n&&C6(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u1e(t,e,n){return e=$w(e),f1e(t,SX()?Reflect.construct(e,n||[],$w(t).constructor):e.apply(t,n))}function f1e(t,e){if(e&&(bv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d1e(t)}function d1e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function SX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SX=function(){return!!t})()}function $w(t){return $w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$w(t)}function h1e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kI(t,e)}function kI(t,e){return kI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},kI(t,e)}function v5(t,e,n){return e=AX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AX(t){var e=p1e(t,"string");return bv(e)=="symbol"?e:e+""}function p1e(t,e){if(bv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(bv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ty=(function(t){function e(n){var r;return l1e(this,e),r=u1e(this,e,[n]),r.state={fontSize:"",letterSpacing:""},r}return h1e(e,t),c1e(e,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,s=D3(r,i1e),o=this.props,c=o.viewBox,u=D3(o,a1e);return!Wg(a,c)||!Wg(s,u)||!Wg(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.x,s=i.y,o=i.width,c=i.height,u=i.orientation,h=i.tickSize,p=i.mirror,v=i.tickMargin,y,b,w,_,S,E,T=p?-1:1,P=r.tickSize||h,R=mt(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":y=b=r.coordinate,_=s+ +!p*c,w=_-T*P,E=w-T*v,S=R;break;case"left":w=_=r.coordinate,b=a+ +!p*o,y=b-T*P,S=y-T*v,E=R;break;case"right":w=_=r.coordinate,b=a+ +p*o,y=b+T*P,S=y+T*v,E=R;break;default:y=b=r.coordinate,_=s+ +p*c,w=_+T*P,E=w+T*v,S=R;break}return{line:{x1:y,y1:w,x2:b,y2:_},tick:{x:S,y:E}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,s;switch(i){case"left":s=a?"start":"end";break;case"right":s=a?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=a?"start":"end";break;default:s=a?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,s=r.width,o=r.height,c=r.orientation,u=r.mirror,h=r.axisLine,p=Li(Li(Li({},_n(this.props,!1)),_n(h,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var v=+(c==="top"&&!u||c==="bottom"&&u);p=Li(Li({},p),{},{x1:i,y1:a+v*o,x2:i+s,y2:a+v*o})}else{var y=+(c==="left"&&!u||c==="right"&&u);p=Li(Li({},p),{},{x1:i+y*s,y1:a,x2:i+y*s,y2:a+o})}return fe.createElement("line",zg({},p,{className:In("recharts-cartesian-axis-line",Ho(h,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var s=this,o=this.props,c=o.tickLine,u=o.stroke,h=o.tick,p=o.tickFormatter,v=o.unit,y=g5(Li(Li({},this.props),{},{ticks:r}),i,a),b=this.getTickTextAnchor(),w=this.getTickVerticalAnchor(),_=_n(this.props,!1),S=_n(h,!1),E=Li(Li({},_),{},{fill:"none"},_n(c,!1)),T=y.map(function(P,R){var D=s.getTickLineCoord(P),I=D.line,k=D.tick,B=Li(Li(Li(Li({textAnchor:b,verticalAnchor:w},_),{},{stroke:"none",fill:u},S),k),{},{index:R,payload:P,visibleTicksCount:y.length,tickFormatter:p});return fe.createElement(Ar,zg({className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},tw(s.props,P,R)),c&&fe.createElement("line",zg({},E,I,{className:In("recharts-cartesian-axis-tick-line",Ho(c,"className"))})),h&&e.renderTickItem(h,B,"".concat(yn(p)?p(P.value,R):P.value).concat(v||"")))});return fe.createElement("g",{className:"recharts-cartesian-axis-ticks"},T)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,s=i.width,o=i.height,c=i.ticksGenerator,u=i.className,h=i.hide;if(h)return null;var p=this.props,v=p.ticks,y=D3(p,s1e),b=v;return yn(c)&&(b=v&&v.length>0?c(this.props):c(y)),s<=0||o<=0||!b||!b.length?null:fe.createElement(Ar,{className:In("recharts-cartesian-axis",u),ref:function(_){r.layerReference=_}},a&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Da.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var s,o=In(i.className,"recharts-cartesian-axis-tick-value");return fe.isValidElement(r)?s=fe.cloneElement(r,Li(Li({},i),{},{className:o})):yn(r)?s=r(Li(Li({},i),{},{className:o})):s=fe.createElement(dw,zg({},i,{className:"recharts-cartesian-axis-tick-value"}),a),s}}])})(j.Component);v5(ty,"displayName","CartesianAxis");v5(ty,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var m1e=["x1","y1","x2","y2","key"],g1e=["offset"];function Ep(t){"@babel/helpers - typeof";return Ep=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},Ep(t)}function R6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Na(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?R6(Object(n),!0).forEach(function(r){v1e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function v1e(t,e,n){return e=y1e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y1e(t){var e=x1e(t,"string");return Ep(e)=="symbol"?e:e+""}function x1e(t,e){if(Ep(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ep(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sp(){return sp=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},sp.apply(this,arguments)}function O6(t,e){if(t==null)return{};var n=b1e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function b1e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var _1e=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,a=e.y,s=e.width,o=e.height,c=e.ry;return fe.createElement("rect",{x:i,y:a,ry:c,width:s,height:o,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function wX(t,e){var n;if(fe.isValidElement(t))n=fe.cloneElement(t,e);else if(yn(t))n=t(e);else{var r=e.x1,i=e.y1,a=e.x2,s=e.y2,o=e.key,c=O6(e,m1e),u=_n(c,!1);u.offset;var h=O6(u,g1e);n=fe.createElement("line",sp({},h,{x1:r,y1:i,x2:a,y2:s,fill:"none",key:o}))}return n}function S1e(t){var e=t.x,n=t.width,r=t.horizontal,i=r===void 0?!0:r,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(o,c){var u=Na(Na({},t),{},{x1:e,y1:o,x2:e+n,y2:o,key:"line-".concat(c),index:c});return wX(i,u)});return fe.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function A1e(t){var e=t.y,n=t.height,r=t.vertical,i=r===void 0?!0:r,a=t.verticalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(o,c){var u=Na(Na({},t),{},{x1:o,y1:e,x2:o,y2:e+n,key:"line-".concat(c),index:c});return wX(i,u)});return fe.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function w1e(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,a=t.width,s=t.height,o=t.horizontalPoints,c=t.horizontal,u=c===void 0?!0:c;if(!u||!e||!e.length)return null;var h=o.map(function(v){return Math.round(v+i-i)}).sort(function(v,y){return v-y});i!==h[0]&&h.unshift(0);var p=h.map(function(v,y){var b=!h[y+1],w=b?i+s-v:h[y+1]-v;if(w<=0)return null;var _=y%e.length;return fe.createElement("rect",{key:"react-".concat(y),y:v,x:r,height:w,width:a,stroke:"none",fill:e[_],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return fe.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function M1e(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,a=t.x,s=t.y,o=t.width,c=t.height,u=t.verticalPoints;if(!n||!r||!r.length)return null;var h=u.map(function(v){return Math.round(v+a-a)}).sort(function(v,y){return v-y});a!==h[0]&&h.unshift(0);var p=h.map(function(v,y){var b=!h[y+1],w=b?a+o-v:h[y+1]-v;if(w<=0)return null;var _=y%r.length;return fe.createElement("rect",{key:"react-".concat(y),x:v,y:s,width:w,height:c,stroke:"none",fill:r[_],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return fe.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var E1e=function(e,n){var r=e.xAxis,i=e.width,a=e.height,s=e.offset;return k$(g5(Na(Na(Na({},ty.defaultProps),r),{},{ticks:Wu(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.left,s.left+s.width,n)},T1e=function(e,n){var r=e.yAxis,i=e.width,a=e.height,s=e.offset;return k$(g5(Na(Na(Na({},ty.defaultProps),r),{},{ticks:Wu(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.top,s.top+s.height,n)},rg={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function MX(t){var e,n,r,i,a,s,o=d5(),c=h5(),u=pbe(),h=Na(Na({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:rg.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:rg.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:rg.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:rg.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:rg.vertical,verticalFill:(s=t.verticalFill)!==null&&s!==void 0?s:rg.verticalFill,x:mt(t.x)?t.x:u.left,y:mt(t.y)?t.y:u.top,width:mt(t.width)?t.width:u.width,height:mt(t.height)?t.height:u.height}),p=h.x,v=h.y,y=h.width,b=h.height,w=h.syncWithTicks,_=h.horizontalValues,S=h.verticalValues,E=fbe(),T=dbe();if(!mt(y)||y<=0||!mt(b)||b<=0||!mt(p)||p!==+p||!mt(v)||v!==+v)return null;var P=h.verticalCoordinatesGenerator||E1e,R=h.horizontalCoordinatesGenerator||T1e,D=h.horizontalPoints,I=h.verticalPoints;if((!D||!D.length)&&yn(R)){var k=_&&_.length,B=R({yAxis:T?Na(Na({},T),{},{ticks:k?_:T.ticks}):void 0,width:o,height:c,offset:u},k?!0:w);Ku(Array.isArray(B),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Ep(B),"]")),Array.isArray(B)&&(D=B)}if((!I||!I.length)&&yn(P)){var U=S&&S.length,z=P({xAxis:E?Na(Na({},E),{},{ticks:U?S:E.ticks}):void 0,width:o,height:c,offset:u},U?!0:w);Ku(Array.isArray(z),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Ep(z),"]")),Array.isArray(z)&&(I=z)}return fe.createElement("g",{className:"recharts-cartesian-grid"},fe.createElement(_1e,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),fe.createElement(S1e,sp({},h,{offset:u,horizontalPoints:D,xAxis:E,yAxis:T})),fe.createElement(A1e,sp({},h,{offset:u,verticalPoints:I,xAxis:E,yAxis:T})),fe.createElement(w1e,sp({},h,{horizontalPoints:D})),fe.createElement(M1e,sp({},h,{verticalPoints:I})))}MX.displayName="CartesianGrid";var C1e=["type","layout","connectNulls","ref"],R1e=["key"];function _v(t){"@babel/helpers - typeof";return _v=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},_v(t)}function P6(t,e){if(t==null)return{};var n=O1e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function O1e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Nx(){return Nx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Nx.apply(this,arguments)}function D6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function $s(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?D6(Object(n),!0).forEach(function(r){Pl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ig(t){return I1e(t)||N1e(t)||D1e(t)||P1e()}function P1e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D1e(t,e){if(t){if(typeof t=="string")return FI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return FI(t,e)}}function N1e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function I1e(t){if(Array.isArray(t))return FI(t)}function FI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function B1e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function N6(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,TX(r.key),r)}}function L1e(t,e,n){return e&&N6(t.prototype,e),n&&N6(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function k1e(t,e,n){return e=Xw(e),F1e(t,EX()?Reflect.construct(e,n||[],Xw(t).constructor):e.apply(t,n))}function F1e(t,e){if(e&&(_v(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U1e(t)}function U1e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function EX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EX=function(){return!!t})()}function Xw(t){return Xw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xw(t)}function j1e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&UI(t,e)}function UI(t,e){return UI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},UI(t,e)}function Pl(t,e,n){return e=TX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TX(t){var e=z1e(t,"string");return _v(e)=="symbol"?e:e+""}function z1e(t,e){if(_v(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(_v(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Sv=(function(t){function e(){var n;B1e(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=k1e(this,e,[].concat(i)),Pl(n,"state",{isAnimationFinished:!0,totalLength:0}),Pl(n,"generateSimpleStrokeDasharray",function(s,o){return"".concat(o,"px ").concat(s-o,"px")}),Pl(n,"getStrokeDasharray",function(s,o,c){var u=c.reduce(function(S,E){return S+E});if(!u)return n.generateSimpleStrokeDasharray(o,s);for(var h=Math.floor(s/u),p=s%u,v=o-s,y=[],b=0,w=0;b<c.length;w+=c[b],++b)if(w+c[b]>p){y=[].concat(ig(c.slice(0,b)),[p-w]);break}var _=y.length%2===0?[0,v]:[v];return[].concat(ig(e.repeat(c,h)),ig(y),_).map(function(S){return"".concat(S,"px")}).join(", ")}),Pl(n,"id",Yv("recharts-line-")),Pl(n,"pathRef",function(s){n.mainCurve=s}),Pl(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Pl(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return j1e(e,t),L1e(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.points,o=a.xAxis,c=a.yAxis,u=a.layout,h=a.children,p=Vo(h,i1);if(!p)return null;var v=function(w,_){return{x:w.x,y:w.y,value:w.value,errorVal:cs(w.payload,_)}},y={clipPath:r?"url(#clipPath-".concat(i,")"):null};return fe.createElement(Ar,y,p.map(function(b){return fe.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:s,xAxis:o,yAxis:c,layout:u,dataPointFormatter:v})}))}},{key:"renderDots",value:function(r,i,a){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var o=this.props,c=o.dot,u=o.points,h=o.dataKey,p=_n(this.props,!1),v=_n(c,!0),y=u.map(function(w,_){var S=$s($s($s({key:"dot-".concat(_),r:3},p),v),{},{index:_,cx:w.x,cy:w.y,value:w.value,dataKey:h,payload:w.payload,points:u});return e.renderDotItem(c,S)}),b={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return fe.createElement(Ar,Nx({className:"recharts-line-dots",key:"dots"},b),y)}},{key:"renderCurveStatically",value:function(r,i,a,s){var o=this.props,c=o.type,u=o.layout,h=o.connectNulls;o.ref;var p=P6(o,C1e),v=$s($s($s({},_n(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:r},s),{},{type:c,layout:u,connectNulls:h});return fe.createElement(Kg,Nx({},v,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var a=this,s=this.props,o=s.points,c=s.strokeDasharray,u=s.isAnimationActive,h=s.animationBegin,p=s.animationDuration,v=s.animationEasing,y=s.animationId,b=s.animateNewValues,w=s.width,_=s.height,S=this.state,E=S.prevPoints,T=S.totalLength;return fe.createElement(Gc,{begin:h,duration:p,isActive:u,easing:v,from:{t:0},to:{t:1},key:"line-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var R=P.t;if(E){var D=E.length/o.length,I=o.map(function(q,W){var ee=Math.floor(W*D);if(E[ee]){var Q=E[ee],V=ha(Q.x,q.x),$=ha(Q.y,q.y);return $s($s({},q),{},{x:V(R),y:$(R)})}if(b){var Y=ha(w*2,q.x),ie=ha(_/2,q.y);return $s($s({},q),{},{x:Y(R),y:ie(R)})}return $s($s({},q),{},{x:q.x,y:q.y})});return a.renderCurveStatically(I,r,i)}var k=ha(0,T),B=k(R),U;if(c){var z="".concat(c).split(/[,\s]+/gim).map(function(q){return parseFloat(q)});U=a.getStrokeDasharray(B,T,z)}else U=a.generateSimpleStrokeDasharray(T,B);return a.renderCurveStatically(o,r,i,{strokeDasharray:U})})}},{key:"renderCurve",value:function(r,i){var a=this.props,s=a.points,o=a.isAnimationActive,c=this.state,u=c.prevPoints,h=c.totalLength;return o&&s&&s.length&&(!u&&h>0||!fv(u,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,a=i.hide,s=i.dot,o=i.points,c=i.className,u=i.xAxis,h=i.yAxis,p=i.top,v=i.left,y=i.width,b=i.height,w=i.isAnimationActive,_=i.id;if(a||!o||!o.length)return null;var S=this.state.isAnimationFinished,E=o.length===1,T=In("recharts-line",c),P=u&&u.allowDataOverflow,R=h&&h.allowDataOverflow,D=P||R,I=Cn(_)?this.id:_,k=(r=_n(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},B=k.r,U=B===void 0?3:B,z=k.strokeWidth,q=z===void 0?2:z,W=FW(s)?s:{},ee=W.clipDot,Q=ee===void 0?!0:ee,V=U*2+q;return fe.createElement(Ar,{className:T},P||R?fe.createElement("defs",null,fe.createElement("clipPath",{id:"clipPath-".concat(I)},fe.createElement("rect",{x:P?v:v-y/2,y:R?p:p-b/2,width:P?y:y*2,height:R?b:b*2})),!Q&&fe.createElement("clipPath",{id:"clipPath-dots-".concat(I)},fe.createElement("rect",{x:v-V/2,y:p-V/2,width:y+V,height:b+V}))):null,!E&&this.renderCurve(D,I),this.renderErrorBar(D,I),(E||s)&&this.renderDots(D,Q,I),(!w||S)&&Ju.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var a=r.length%2!==0?[].concat(ig(r),[0]):r,s=[],o=0;o<i;++o)s=[].concat(ig(s),ig(a));return s}},{key:"renderDotItem",value:function(r,i){var a;if(fe.isValidElement(r))a=fe.cloneElement(r,i);else if(yn(r))a=r(i);else{var s=i.key,o=P6(i,R1e),c=In("recharts-line-dot",typeof r!="boolean"?r.className:"");a=fe.createElement(PE,Nx({key:s},o,{className:c}))}return a}}])})(j.PureComponent);Pl(Sv,"displayName","Line");Pl(Sv,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Fp.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Pl(Sv,"getComposedData",function(t){var e=t.props,n=t.xAxis,r=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,s=t.dataKey,o=t.bandSize,c=t.displayedData,u=t.offset,h=e.layout,p=c.map(function(v,y){var b=cs(v,s);return h==="horizontal"?{x:Ew({axis:n,ticks:i,bandSize:o,entry:v,index:y}),y:Cn(b)?null:r.scale(b),value:b,payload:v}:{x:Cn(b)?null:n.scale(b),y:Ew({axis:r,ticks:a,bandSize:o,entry:v,index:y}),value:b,payload:v}});return $s({points:p,layout:h},u)});var G1e=["layout","type","stroke","connectNulls","isRange","ref"],H1e=["key"],CX;function Av(t){"@babel/helpers - typeof";return Av=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},Av(t)}function RX(t,e){if(t==null)return{};var n=V1e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function V1e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function op(){return op=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},op.apply(this,arguments)}function I6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function hd(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?I6(Object(n),!0).forEach(function(r){Pc(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function W1e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B6(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,PX(r.key),r)}}function q1e(t,e,n){return e&&B6(t.prototype,e),n&&B6(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function $1e(t,e,n){return e=Kw(e),X1e(t,OX()?Reflect.construct(e,n||[],Kw(t).constructor):e.apply(t,n))}function X1e(t,e){if(e&&(Av(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K1e(t)}function K1e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function OX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OX=function(){return!!t})()}function Kw(t){return Kw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Kw(t)}function Y1e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jI(t,e)}function jI(t,e){return jI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jI(t,e)}function Pc(t,e,n){return e=PX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PX(t){var e=J1e(t,"string");return Av(e)=="symbol"?e:e+""}function J1e(t,e){if(Av(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Av(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var sf=(function(t){function e(){var n;W1e(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=$1e(this,e,[].concat(i)),Pc(n,"state",{isAnimationFinished:!0}),Pc(n,"id",Yv("recharts-area-")),Pc(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),yn(s)&&s()}),Pc(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),yn(s)&&s()}),n}return Y1e(e,t),q1e(e,[{key:"renderDots",value:function(r,i,a){var s=this.props.isAnimationActive,o=this.state.isAnimationFinished;if(s&&!o)return null;var c=this.props,u=c.dot,h=c.points,p=c.dataKey,v=_n(this.props,!1),y=_n(u,!0),b=h.map(function(_,S){var E=hd(hd(hd({key:"dot-".concat(S),r:3},v),y),{},{index:S,cx:_.x,cy:_.y,dataKey:p,value:_.value,payload:_.payload,points:h});return e.renderDotItem(u,E)}),w={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return fe.createElement(Ar,op({className:"recharts-area-dots"},w),b)}},{key:"renderHorizontalRect",value:function(r){var i=this.props,a=i.baseLine,s=i.points,o=i.strokeWidth,c=s[0].x,u=s[s.length-1].x,h=r*Math.abs(c-u),p=bd(s.map(function(v){return v.y||0}));return mt(a)&&typeof a=="number"?p=Math.max(a,p):a&&Array.isArray(a)&&a.length&&(p=Math.max(bd(a.map(function(v){return v.y||0})),p)),mt(p)?fe.createElement("rect",{x:c<u?c:c-h,y:0,width:h,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var i=this.props,a=i.baseLine,s=i.points,o=i.strokeWidth,c=s[0].y,u=s[s.length-1].y,h=r*Math.abs(c-u),p=bd(s.map(function(v){return v.x||0}));return mt(a)&&typeof a=="number"?p=Math.max(a,p):a&&Array.isArray(a)&&a.length&&(p=Math.max(bd(a.map(function(v){return v.x||0})),p)),mt(p)?fe.createElement("rect",{x:0,y:c<u?c:c-h,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(h)}):null}},{key:"renderClipRect",value:function(r){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,i,a,s){var o=this.props,c=o.layout,u=o.type,h=o.stroke,p=o.connectNulls,v=o.isRange;o.ref;var y=RX(o,G1e);return fe.createElement(Ar,{clipPath:a?"url(#clipPath-".concat(s,")"):null},fe.createElement(Kg,op({},_n(y,!0),{points:r,connectNulls:p,type:u,baseLine:i,layout:c,stroke:"none",className:"recharts-area-area"})),h!=="none"&&fe.createElement(Kg,op({},_n(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:p,fill:"none",points:r})),h!=="none"&&v&&fe.createElement(Kg,op({},_n(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:p,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(r,i){var a=this,s=this.props,o=s.points,c=s.baseLine,u=s.isAnimationActive,h=s.animationBegin,p=s.animationDuration,v=s.animationEasing,y=s.animationId,b=this.state,w=b.prevPoints,_=b.prevBaseLine;return fe.createElement(Gc,{begin:h,duration:p,isActive:u,easing:v,from:{t:0},to:{t:1},key:"area-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var E=S.t;if(w){var T=w.length/o.length,P=o.map(function(k,B){var U=Math.floor(B*T);if(w[U]){var z=w[U],q=ha(z.x,k.x),W=ha(z.y,k.y);return hd(hd({},k),{},{x:q(E),y:W(E)})}return k}),R;if(mt(c)&&typeof c=="number"){var D=ha(_,c);R=D(E)}else if(Cn(c)||Kv(c)){var I=ha(_,0);R=I(E)}else R=c.map(function(k,B){var U=Math.floor(B*T);if(_[U]){var z=_[U],q=ha(z.x,k.x),W=ha(z.y,k.y);return hd(hd({},k),{},{x:q(E),y:W(E)})}return k});return a.renderAreaStatically(P,R,r,i)}return fe.createElement(Ar,null,fe.createElement("defs",null,fe.createElement("clipPath",{id:"animationClipPath-".concat(i)},a.renderClipRect(E))),fe.createElement(Ar,{clipPath:"url(#animationClipPath-".concat(i,")")},a.renderAreaStatically(o,c,r,i)))})}},{key:"renderArea",value:function(r,i){var a=this.props,s=a.points,o=a.baseLine,c=a.isAnimationActive,u=this.state,h=u.prevPoints,p=u.prevBaseLine,v=u.totalLength;return c&&s&&s.length&&(!h&&v>0||!fv(h,s)||!fv(p,o))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,o,r,i)}},{key:"render",value:function(){var r,i=this.props,a=i.hide,s=i.dot,o=i.points,c=i.className,u=i.top,h=i.left,p=i.xAxis,v=i.yAxis,y=i.width,b=i.height,w=i.isAnimationActive,_=i.id;if(a||!o||!o.length)return null;var S=this.state.isAnimationFinished,E=o.length===1,T=In("recharts-area",c),P=p&&p.allowDataOverflow,R=v&&v.allowDataOverflow,D=P||R,I=Cn(_)?this.id:_,k=(r=_n(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},B=k.r,U=B===void 0?3:B,z=k.strokeWidth,q=z===void 0?2:z,W=FW(s)?s:{},ee=W.clipDot,Q=ee===void 0?!0:ee,V=U*2+q;return fe.createElement(Ar,{className:T},P||R?fe.createElement("defs",null,fe.createElement("clipPath",{id:"clipPath-".concat(I)},fe.createElement("rect",{x:P?h:h-y/2,y:R?u:u-b/2,width:P?y:y*2,height:R?b:b*2})),!Q&&fe.createElement("clipPath",{id:"clipPath-dots-".concat(I)},fe.createElement("rect",{x:h-V/2,y:u-V/2,width:y+V,height:b+V}))):null,E?null:this.renderArea(D,I),(s||E)&&this.renderDots(D,Q,I),(!w||S)&&Ju.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])})(j.PureComponent);CX=sf;Pc(sf,"displayName","Area");Pc(sf,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Fp.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Pc(sf,"getBaseValue",function(t,e,n,r){var i=t.layout,a=t.baseValue,s=e.props.baseValue,o=s??a;if(mt(o)&&typeof o=="number")return o;var c=i==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var h=Math.max(u[0],u[1]),p=Math.min(u[0],u[1]);return o==="dataMin"?p:o==="dataMax"||h<0?h:Math.max(Math.min(u[0],u[1]),0)}return o==="dataMin"?u[0]:o==="dataMax"?u[1]:u[0]});Pc(sf,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,a=t.xAxisTicks,s=t.yAxisTicks,o=t.bandSize,c=t.dataKey,u=t.stackedData,h=t.dataStartIndex,p=t.displayedData,v=t.offset,y=e.layout,b=u&&u.length,w=CX.getBaseValue(e,n,r,i),_=y==="horizontal",S=!1,E=p.map(function(P,R){var D;b?D=u[h+R]:(D=cs(P,c),Array.isArray(D)?S=!0:D=[w,D]);var I=D[1]==null||b&&cs(P,c)==null;return _?{x:Ew({axis:r,ticks:a,bandSize:o,entry:P,index:R}),y:I?null:i.scale(D[1]),value:D,payload:P}:{x:I?null:r.scale(D[1]),y:Ew({axis:i,ticks:s,bandSize:o,entry:P,index:R}),value:D,payload:P}}),T;return b||S?T=E.map(function(P){var R=Array.isArray(P.value)?P.value[0]:null;return _?{x:P.x,y:R!=null&&P.y!=null?i.scale(R):null}:{x:R!=null?r.scale(R):null,y:P.y}}):T=_?i.scale(w):r.scale(w),hd({points:E,baseLine:T,layout:y,isRange:S},v)});Pc(sf,"renderDotItem",function(t,e){var n;if(fe.isValidElement(t))n=fe.cloneElement(t,e);else if(yn(t))n=t(e);else{var r=In("recharts-area-dot",typeof t!="boolean"?t.className:""),i=e.key,a=RX(e,H1e);n=fe.createElement(PE,op({},a,{key:i,className:r}))}return n});function wv(t){"@babel/helpers - typeof";return wv=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},wv(t)}function Z1e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q1e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,IX(r.key),r)}}function e_e(t,e,n){return e&&Q1e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function t_e(t,e,n){return e=Yw(e),n_e(t,DX()?Reflect.construct(e,n||[],Yw(t).constructor):e.apply(t,n))}function n_e(t,e){if(e&&(wv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return r_e(t)}function r_e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function DX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DX=function(){return!!t})()}function Yw(t){return Yw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yw(t)}function i_e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zI(t,e)}function zI(t,e){return zI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},zI(t,e)}function NX(t,e,n){return e=IX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function IX(t){var e=a_e(t,"string");return wv(e)=="symbol"?e:e+""}function a_e(t,e){if(wv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(wv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function GI(){return GI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},GI.apply(this,arguments)}function s_e(t){var e=t.xAxisId,n=d5(),r=h5(),i=hX(e);return i==null?null:j.createElement(ty,GI({},i,{className:In("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(s){return Wu(s,!0)}}))}var ny=(function(t){function e(){return Z1e(this,e),t_e(this,e,arguments)}return i_e(e,t),e_e(e,[{key:"render",value:function(){return j.createElement(s_e,this.props)}}])})(j.Component);NX(ny,"displayName","XAxis");NX(ny,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Mv(t){"@babel/helpers - typeof";return Mv=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},Mv(t)}function o_e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l_e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kX(r.key),r)}}function c_e(t,e,n){return e&&l_e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function u_e(t,e,n){return e=Jw(e),f_e(t,BX()?Reflect.construct(e,n||[],Jw(t).constructor):e.apply(t,n))}function f_e(t,e){if(e&&(Mv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d_e(t)}function d_e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function BX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BX=function(){return!!t})()}function Jw(t){return Jw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jw(t)}function h_e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&HI(t,e)}function HI(t,e){return HI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},HI(t,e)}function LX(t,e,n){return e=kX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kX(t){var e=p_e(t,"string");return Mv(e)=="symbol"?e:e+""}function p_e(t,e){if(Mv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Mv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function VI(){return VI=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},VI.apply(this,arguments)}var m_e=function(e){var n=e.yAxisId,r=d5(),i=h5(),a=pX(n);return a==null?null:j.createElement(ty,VI({},a,{className:In("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(o){return Wu(o,!0)}}))},ry=(function(t){function e(){return o_e(this,e),u_e(this,e,arguments)}return h_e(e,t),c_e(e,[{key:"render",value:function(){return j.createElement(m_e,this.props)}}])})(j.Component);LX(ry,"displayName","YAxis");LX(ry,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function L6(t){return x_e(t)||y_e(t)||v_e(t)||g_e()}function g_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v_e(t,e){if(t){if(typeof t=="string")return WI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return WI(t,e)}}function y_e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function x_e(t){if(Array.isArray(t))return WI(t)}function WI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var qI=function(e,n,r,i,a){var s=Vo(e,m5),o=Vo(e,LE),c=[].concat(L6(s),L6(o)),u=Vo(e,FE),h="".concat(i,"Id"),p=i[0],v=n;if(c.length&&(v=c.reduce(function(w,_){if(_.props[h]===r&&kc(_.props,"extendDomain")&&mt(_.props[p])){var S=_.props[p];return[Math.min(w[0],S),Math.max(w[1],S)]}return w},v)),u.length){var y="".concat(p,"1"),b="".concat(p,"2");v=u.reduce(function(w,_){if(_.props[h]===r&&kc(_.props,"extendDomain")&&mt(_.props[y])&&mt(_.props[b])){var S=_.props[y],E=_.props[b];return[Math.min(w[0],S,E),Math.max(w[1],S,E)]}return w},v)}return a&&a.length&&(v=a.reduce(function(w,_){return mt(_)?[Math.min(w[0],_),Math.max(w[1],_)]:w},v)),v},N3={exports:{}},k6;function b_e(){return k6||(k6=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,h){this.fn=c,this.context=u,this.once=h||!1}function a(c,u,h,p,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var y=new i(h,p||c,v),b=n?n+u:u;return c._events[b]?c._events[b].fn?c._events[b]=[c._events[b],y]:c._events[b].push(y):(c._events[b]=y,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],h,p;if(this._eventsCount===0)return u;for(p in h=this._events)e.call(h,p)&&u.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},o.prototype.listeners=function(u){var h=n?n+u:u,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var v=0,y=p.length,b=new Array(y);v<y;v++)b[v]=p[v].fn;return b},o.prototype.listenerCount=function(u){var h=n?n+u:u,p=this._events[h];return p?p.fn?1:p.length:0},o.prototype.emit=function(u,h,p,v,y,b){var w=n?n+u:u;if(!this._events[w])return!1;var _=this._events[w],S=arguments.length,E,T;if(_.fn){switch(_.once&&this.removeListener(u,_.fn,void 0,!0),S){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,h),!0;case 3:return _.fn.call(_.context,h,p),!0;case 4:return _.fn.call(_.context,h,p,v),!0;case 5:return _.fn.call(_.context,h,p,v,y),!0;case 6:return _.fn.call(_.context,h,p,v,y,b),!0}for(T=1,E=new Array(S-1);T<S;T++)E[T-1]=arguments[T];_.fn.apply(_.context,E)}else{var P=_.length,R;for(T=0;T<P;T++)switch(_[T].once&&this.removeListener(u,_[T].fn,void 0,!0),S){case 1:_[T].fn.call(_[T].context);break;case 2:_[T].fn.call(_[T].context,h);break;case 3:_[T].fn.call(_[T].context,h,p);break;case 4:_[T].fn.call(_[T].context,h,p,v);break;default:if(!E)for(R=1,E=new Array(S-1);R<S;R++)E[R-1]=arguments[R];_[T].fn.apply(_[T].context,E)}}return!0},o.prototype.on=function(u,h,p){return a(this,u,h,p,!1)},o.prototype.once=function(u,h,p){return a(this,u,h,p,!0)},o.prototype.removeListener=function(u,h,p,v){var y=n?n+u:u;if(!this._events[y])return this;if(!h)return s(this,y),this;var b=this._events[y];if(b.fn)b.fn===h&&(!v||b.once)&&(!p||b.context===p)&&s(this,y);else{for(var w=0,_=[],S=b.length;w<S;w++)(b[w].fn!==h||v&&!b[w].once||p&&b[w].context!==p)&&_.push(b[w]);_.length?this._events[y]=_.length===1?_[0]:_:s(this,y)}return this},o.prototype.removeAllListeners=function(u){var h;return u?(h=n?n+u:u,this._events[h]&&s(this,h)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(N3)),N3.exports}var __e=b_e();const S_e=ar(__e);var I3=new S_e,B3="recharts.syncMouseEvents";function Tb(t){"@babel/helpers - typeof";return Tb=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},Tb(t)}function A_e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w_e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,FX(r.key),r)}}function M_e(t,e,n){return e&&w_e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function L3(t,e,n){return e=FX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FX(t){var e=E_e(t,"string");return Tb(e)=="symbol"?e:e+""}function E_e(t,e){if(Tb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Tb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var T_e=(function(){function t(){A_e(this,t),L3(this,"activeIndex",0),L3(this,"coordinateList",[]),L3(this,"layout","horizontal")}return M_e(t,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,a=i===void 0?null:i,s=n.container,o=s===void 0?null:s,c=n.layout,u=c===void 0?null:c,h=n.offset,p=h===void 0?null:h,v=n.mouseHandlerCallback,y=v===void 0?null:v;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=o??this.container,this.layout=u??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=y??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,s=i.y,o=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,h=((r=window)===null||r===void 0?void 0:r.scrollY)||0,p=a+c+u,v=s+this.offset.top+o/2+h;this.mouseHandlerCallback({pageX:p,pageY:v})}}}])})();function C_e(t,e,n){if(n==="number"&&e===!0&&Array.isArray(t)){var r=t?.[0],i=t?.[1];if(r&&i&&mt(r)&&mt(i))return!0}return!1}function R_e(t,e,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-i:n.left+.5,y:t==="horizontal"?n.top+.5:e.y-i,width:t==="horizontal"?r:n.width-1,height:t==="horizontal"?n.height-1:r}}function UX(t){var e=t.cx,n=t.cy,r=t.radius,i=t.startAngle,a=t.endAngle,s=ma(e,n,r,i),o=ma(e,n,r,a);return{points:[s,o],cx:e,cy:n,radius:r,startAngle:i,endAngle:a}}function O_e(t,e,n){var r,i,a,s;if(t==="horizontal")r=e.x,a=r,i=n.top,s=n.top+n.height;else if(t==="vertical")i=e.y,s=i,r=n.left,a=n.left+n.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var o=e.cx,c=e.cy,u=e.innerRadius,h=e.outerRadius,p=e.angle,v=ma(o,c,u,p),y=ma(o,c,h,p);r=v.x,i=v.y,a=y.x,s=y.y}else return UX(e);return[{x:r,y:i},{x:a,y:s}]}function Cb(t){"@babel/helpers - typeof";return Cb=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},Cb(t)}function F6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function MS(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?F6(Object(n),!0).forEach(function(r){P_e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function P_e(t,e,n){return e=D_e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D_e(t){var e=N_e(t,"string");return Cb(e)=="symbol"?e:e+""}function N_e(t,e){if(Cb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Cb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function I_e(t){var e,n,r=t.element,i=t.tooltipEventType,a=t.isActive,s=t.activeCoordinate,o=t.activePayload,c=t.offset,u=t.activeTooltipIndex,h=t.tooltipAxisBandSize,p=t.layout,v=t.chartName,y=(e=r.props.cursor)!==null&&e!==void 0?e:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!y||!a||!s||v!=="ScatterChart"&&i!=="axis")return null;var b,w=Kg;if(v==="ScatterChart")b=s,w=S0e;else if(v==="BarChart")b=R_e(p,s,c,h),w=l5;else if(p==="radial"){var _=UX(s),S=_.cx,E=_.cy,T=_.radius,P=_.startAngle,R=_.endAngle;b={cx:S,cy:E,startAngle:P,endAngle:R,innerRadius:T,outerRadius:T},w=G$}else b={points:O_e(p,s,c)},w=Kg;var D=MS(MS(MS(MS({stroke:"#ccc",pointerEvents:"none"},c),b),_n(y,!1)),{},{payload:o,payloadIndex:u,className:In("recharts-tooltip-cursor",y.className)});return j.isValidElement(y)?j.cloneElement(y,D):j.createElement(w,D)}var B_e=["item"],L_e=["children","className","width","height","style","compact","title","desc"];function Ev(t){"@babel/helpers - typeof";return Ev=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},Ev(t)}function Gg(){return Gg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Gg.apply(this,arguments)}function U6(t,e){return U_e(t)||F_e(t,e)||zX(t,e)||k_e()}function k_e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F_e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(h){u=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function U_e(t){if(Array.isArray(t))return t}function j6(t,e){if(t==null)return{};var n=j_e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function j_e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function z_e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function G_e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,GX(r.key),r)}}function H_e(t,e,n){return e&&G_e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function V_e(t,e,n){return e=Zw(e),W_e(t,jX()?Reflect.construct(e,n||[],Zw(t).constructor):e.apply(t,n))}function W_e(t,e){if(e&&(Ev(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q_e(t)}function q_e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jX=function(){return!!t})()}function Zw(t){return Zw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zw(t)}function $_e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$I(t,e)}function $I(t,e){return $I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$I(t,e)}function Tv(t){return Y_e(t)||K_e(t)||zX(t)||X_e()}function X_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zX(t,e){if(t){if(typeof t=="string")return XI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XI(t,e)}}function K_e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Y_e(t){if(Array.isArray(t))return XI(t)}function XI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function z6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ge(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?z6(Object(n),!0).forEach(function(r){en(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function en(t,e,n){return e=GX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GX(t){var e=J_e(t,"string");return Ev(e)=="symbol"?e:e+""}function J_e(t,e){if(Ev(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ev(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Z_e={xAxis:["bottom","top"],yAxis:["left","right"]},Q_e={width:"100%",height:"100%"},HX={x:0,y:0};function ES(t){return t}var eSe=function(e,n){return n==="horizontal"?e.x:n==="vertical"?e.y:n==="centric"?e.angle:e.radius},tSe=function(e,n,r,i){var a=n.find(function(h){return h&&h.index===r});if(a){if(e==="horizontal")return{x:a.coordinate,y:i.y};if(e==="vertical")return{x:i.x,y:a.coordinate};if(e==="centric"){var s=a.coordinate,o=i.radius;return Ge(Ge(Ge({},i),ma(i.cx,i.cy,o,s)),{},{angle:s,radius:o})}var c=a.coordinate,u=i.angle;return Ge(Ge(Ge({},i),ma(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return HX},UE=function(e,n){var r=n.graphicalItems,i=n.dataStartIndex,a=n.dataEndIndex,s=(r??[]).reduce(function(o,c){var u=c.props.data;return u&&u.length?[].concat(Tv(o),Tv(u)):o},[]);return s.length>0?s:e&&e.length&&mt(i)&&mt(a)?e.slice(i,a+1):[]};function VX(t){return t==="number"?[0,"auto"]:void 0}var KI=function(e,n,r,i){var a=e.graphicalItems,s=e.tooltipAxis,o=UE(n,e);return r<0||!a||!a.length||r>=o.length?null:a.reduce(function(c,u){var h,p=(h=u.props.data)!==null&&h!==void 0?h:n;p&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(p=p.slice(e.dataStartIndex,e.dataEndIndex+1));var v;if(s.dataKey&&!s.allowDuplicatedCategory){var y=p===void 0?o:p;v=QA(y,s.dataKey,i)}else v=p&&p[r]||o[r];return v?[].concat(Tv(c),[U$(u,v)]):c},[])},G6=function(e,n,r,i){var a=i||{x:e.chartX,y:e.chartY},s=eSe(a,r),o=e.orderedTooltipTicks,c=e.tooltipAxis,u=e.tooltipTicks,h=ege(s,o,u,c);if(h>=0&&u){var p=u[h]&&u[h].value,v=KI(e,n,h,p),y=tSe(r,o,h,a);return{activeTooltipIndex:h,activeLabel:p,activePayload:v,activeCoordinate:y}}return null},nSe=function(e,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,s=n.axisIdKey,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,h=e.layout,p=e.children,v=e.stackOffset,y=L$(h,a);return r.reduce(function(b,w){var _,S=w.type.defaultProps!==void 0?Ge(Ge({},w.type.defaultProps),w.props):w.props,E=S.type,T=S.dataKey,P=S.allowDataOverflow,R=S.allowDuplicatedCategory,D=S.scale,I=S.ticks,k=S.includeHidden,B=S[s];if(b[B])return b;var U=UE(e.data,{graphicalItems:i.filter(function(ae){var ue,Se=s in ae.props?ae.props[s]:(ue=ae.type.defaultProps)===null||ue===void 0?void 0:ue[s];return Se===B}),dataStartIndex:c,dataEndIndex:u}),z=U.length,q,W,ee;C_e(S.domain,P,E)&&(q=dI(S.domain,null,P),y&&(E==="number"||D!=="auto")&&(ee=Px(U,T,"category")));var Q=VX(E);if(!q||q.length===0){var V,$=(V=S.domain)!==null&&V!==void 0?V:Q;if(T){if(q=Px(U,T,E),E==="category"&&y){var Y=qoe(q);R&&Y?(W=q,q=Fw(0,z)):R||(q=e8($,q,w).reduce(function(ae,ue){return ae.indexOf(ue)>=0?ae:[].concat(Tv(ae),[ue])},[]))}else if(E==="category")R?q=q.filter(function(ae){return ae!==""&&!Cn(ae)}):q=e8($,q,w).reduce(function(ae,ue){return ae.indexOf(ue)>=0||ue===""||Cn(ue)?ae:[].concat(Tv(ae),[ue])},[]);else if(E==="number"){var ie=age(U,i.filter(function(ae){var ue,Se,$e=s in ae.props?ae.props[s]:(ue=ae.type.defaultProps)===null||ue===void 0?void 0:ue[s],me="hide"in ae.props?ae.props.hide:(Se=ae.type.defaultProps)===null||Se===void 0?void 0:Se.hide;return $e===B&&(k||!me)}),T,a,h);ie&&(q=ie)}y&&(E==="number"||D!=="auto")&&(ee=Px(U,T,"category"))}else y?q=Fw(0,z):o&&o[B]&&o[B].hasStack&&E==="number"?q=v==="expand"?[0,1]:F$(o[B].stackGroups,c,u):q=B$(U,i.filter(function(ae){var ue=s in ae.props?ae.props[s]:ae.type.defaultProps[s],Se="hide"in ae.props?ae.props.hide:ae.type.defaultProps.hide;return ue===B&&(k||!Se)}),E,h,!0);if(E==="number")q=qI(p,q,B,a,I),$&&(q=dI($,q,P));else if(E==="category"&&$){var de=$,X=q.every(function(ae){return de.indexOf(ae)>=0});X&&(q=de)}}return Ge(Ge({},b),{},en({},B,Ge(Ge({},S),{},{axisType:a,domain:q,categoricalDomain:ee,duplicateDomain:W,originalDomain:(_=S.domain)!==null&&_!==void 0?_:Q,isCategorical:y,layout:h})))},{})},rSe=function(e,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,s=n.axisIdKey,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,h=e.layout,p=e.children,v=UE(e.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),y=v.length,b=L$(h,a),w=-1;return r.reduce(function(_,S){var E=S.type.defaultProps!==void 0?Ge(Ge({},S.type.defaultProps),S.props):S.props,T=E[s],P=VX("number");if(!_[T]){w++;var R;return b?R=Fw(0,y):o&&o[T]&&o[T].hasStack?(R=F$(o[T].stackGroups,c,u),R=qI(p,R,T,a)):(R=dI(P,B$(v,r.filter(function(D){var I,k,B=s in D.props?D.props[s]:(I=D.type.defaultProps)===null||I===void 0?void 0:I[s],U="hide"in D.props?D.props.hide:(k=D.type.defaultProps)===null||k===void 0?void 0:k.hide;return B===T&&!U}),"number",h),i.defaultProps.allowDataOverflow),R=qI(p,R,T,a)),Ge(Ge({},_),{},en({},T,Ge(Ge({axisType:a},i.defaultProps),{},{hide:!0,orientation:Ho(Z_e,"".concat(a,".").concat(w%2),null),domain:R,originalDomain:P,isCategorical:b,layout:h})))}return _},{})},iSe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,s=n.graphicalItems,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,h=e.children,p="".concat(i,"Id"),v=Vo(h,a),y={};return v&&v.length?y=nSe(e,{axes:v,graphicalItems:s,axisType:i,axisIdKey:p,stackGroups:o,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(y=rSe(e,{Axis:a,graphicalItems:s,axisType:i,axisIdKey:p,stackGroups:o,dataStartIndex:c,dataEndIndex:u})),y},aSe=function(e){var n=gd(e),r=Wu(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:IL(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Tw(n,r)}},H6=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ks(n,mv),a=0,s=0;return e.data&&e.data.length!==0&&(s=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},sSe=function(e){return!e||!e.length?!1:e.some(function(n){var r=Xu(n&&n.type);return r&&r.indexOf("Bar")>=0})},V6=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},oSe=function(e,n){var r=e.props,i=e.graphicalItems,a=e.xAxisMap,s=a===void 0?{}:a,o=e.yAxisMap,c=o===void 0?{}:o,u=r.width,h=r.height,p=r.children,v=r.margin||{},y=Ks(p,mv),b=Ks(p,qg),w=Object.keys(c).reduce(function(R,D){var I=c[D],k=I.orientation;return!I.mirror&&!I.hide?Ge(Ge({},R),{},en({},k,R[k]+I.width)):R},{left:v.left||0,right:v.right||0}),_=Object.keys(s).reduce(function(R,D){var I=s[D],k=I.orientation;return!I.mirror&&!I.hide?Ge(Ge({},R),{},en({},k,Ho(R,"".concat(k))+I.height)):R},{top:v.top||0,bottom:v.bottom||0}),S=Ge(Ge({},_),w),E=S.bottom;y&&(S.bottom+=y.props.height||mv.defaultProps.height),b&&n&&(S=rge(S,i,r,n));var T=u-S.left-S.right,P=h-S.top-S.bottom;return Ge(Ge({brushBottom:E},S),{},{width:Math.max(T,0),height:Math.max(P,0)})},lSe=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},WX=function(e){var n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,s=e.validateTooltipEventTypes,o=s===void 0?["axis"]:s,c=e.axisComponents,u=e.legendContent,h=e.formatAxisMap,p=e.defaultProps,v=function(S,E){var T=E.graphicalItems,P=E.stackGroups,R=E.offset,D=E.updateId,I=E.dataStartIndex,k=E.dataEndIndex,B=S.barSize,U=S.layout,z=S.barGap,q=S.barCategoryGap,W=S.maxBarSize,ee=V6(U),Q=ee.numericAxisName,V=ee.cateAxisName,$=sSe(T),Y=[];return T.forEach(function(ie,de){var X=UE(S.data,{graphicalItems:[ie],dataStartIndex:I,dataEndIndex:k}),ae=ie.type.defaultProps!==void 0?Ge(Ge({},ie.type.defaultProps),ie.props):ie.props,ue=ae.dataKey,Se=ae.maxBarSize,$e=ae["".concat(Q,"Id")],me=ae["".concat(V,"Id")],ve={},We=c.reduce(function(Et,Ze){var te=E["".concat(Ze.axisType,"Map")],H=ae["".concat(Ze.axisType,"Id")];te&&te[H]||Ze.axisType==="zAxis"||Mp();var he=te[H];return Ge(Ge({},Et),{},en(en({},Ze.axisType,he),"".concat(Ze.axisType,"Ticks"),Wu(he)))},ve),_e=We[V],Fe=We["".concat(V,"Ticks")],Xe=P&&P[$e]&&P[$e].hasStack&&vge(ie,P[$e].stackGroups),Re=Xu(ie.type).indexOf("Bar")>=0,ot=Tw(_e,Fe),we=[],Ue=$&&tge({barSize:B,stackGroups:P,totalSize:lSe(We,V)});if(Re){var Be,Ye,re=Cn(Se)?W:Se,At=(Be=(Ye=Tw(_e,Fe,!0))!==null&&Ye!==void 0?Ye:re)!==null&&Be!==void 0?Be:0;we=nge({barGap:z,barCategoryGap:q,bandSize:At!==ot?At:ot,sizeList:Ue[me],maxBarSize:re}),At!==ot&&(we=we.map(function(Et){return Ge(Ge({},Et),{},{position:Ge(Ge({},Et.position),{},{offset:Et.position.offset-At/2})})}))}var ft=ie&&ie.type&&ie.type.getComposedData;ft&&Y.push({props:Ge(Ge({},ft(Ge(Ge({},We),{},{displayedData:X,props:S,dataKey:ue,item:ie,bandSize:ot,barPosition:we,offset:R,stackedData:Xe,layout:U,dataStartIndex:I,dataEndIndex:k}))),{},en(en(en({key:ie.key||"item-".concat(de)},Q,We[Q]),V,We[V]),"animationId",D)),childIndex:ile(ie,S.children),item:ie})}),Y},y=function(S,E){var T=S.props,P=S.dataStartIndex,R=S.dataEndIndex,D=S.updateId;if(!mU({props:T}))return null;var I=T.children,k=T.layout,B=T.stackOffset,U=T.data,z=T.reverseStackOrder,q=V6(k),W=q.numericAxisName,ee=q.cateAxisName,Q=Vo(I,r),V=pge(U,Q,"".concat(W,"Id"),"".concat(ee,"Id"),B,z),$=c.reduce(function(ae,ue){var Se="".concat(ue.axisType,"Map");return Ge(Ge({},ae),{},en({},Se,iSe(T,Ge(Ge({},ue),{},{graphicalItems:Q,stackGroups:ue.axisType===W&&V,dataStartIndex:P,dataEndIndex:R}))))},{}),Y=oSe(Ge(Ge({},$),{},{props:T,graphicalItems:Q}),E?.legendBBox);Object.keys($).forEach(function(ae){$[ae]=h(T,$[ae],Y,ae.replace("Map",""),n)});var ie=$["".concat(ee,"Map")],de=aSe(ie),X=v(T,Ge(Ge({},$),{},{dataStartIndex:P,dataEndIndex:R,updateId:D,graphicalItems:Q,stackGroups:V,offset:Y}));return Ge(Ge({formattedGraphicalItems:X,graphicalItems:Q,offset:Y,stackGroups:V},de),$)},b=(function(_){function S(E){var T,P,R;return z_e(this,S),R=V_e(this,S,[E]),en(R,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),en(R,"accessibilityManager",new T_e),en(R,"handleLegendBBoxUpdate",function(D){if(D){var I=R.state,k=I.dataStartIndex,B=I.dataEndIndex,U=I.updateId;R.setState(Ge({legendBBox:D},y({props:R.props,dataStartIndex:k,dataEndIndex:B,updateId:U},Ge(Ge({},R.state),{},{legendBBox:D}))))}}),en(R,"handleReceiveSyncEvent",function(D,I,k){if(R.props.syncId===D){if(k===R.eventEmitterSymbol&&typeof R.props.syncMethod!="function")return;R.applySyncEvent(I)}}),en(R,"handleBrushChange",function(D){var I=D.startIndex,k=D.endIndex;if(I!==R.state.dataStartIndex||k!==R.state.dataEndIndex){var B=R.state.updateId;R.setState(function(){return Ge({dataStartIndex:I,dataEndIndex:k},y({props:R.props,dataStartIndex:I,dataEndIndex:k,updateId:B},R.state))}),R.triggerSyncEvent({dataStartIndex:I,dataEndIndex:k})}}),en(R,"handleMouseEnter",function(D){var I=R.getMouseInfo(D);if(I){var k=Ge(Ge({},I),{},{isTooltipActive:!0});R.setState(k),R.triggerSyncEvent(k);var B=R.props.onMouseEnter;yn(B)&&B(k,D)}}),en(R,"triggeredAfterMouseMove",function(D){var I=R.getMouseInfo(D),k=I?Ge(Ge({},I),{},{isTooltipActive:!0}):{isTooltipActive:!1};R.setState(k),R.triggerSyncEvent(k);var B=R.props.onMouseMove;yn(B)&&B(k,D)}),en(R,"handleItemMouseEnter",function(D){R.setState(function(){return{isTooltipActive:!0,activeItem:D,activePayload:D.tooltipPayload,activeCoordinate:D.tooltipPosition||{x:D.cx,y:D.cy}}})}),en(R,"handleItemMouseLeave",function(){R.setState(function(){return{isTooltipActive:!1}})}),en(R,"handleMouseMove",function(D){D.persist(),R.throttleTriggeredAfterMouseMove(D)}),en(R,"handleMouseLeave",function(D){R.throttleTriggeredAfterMouseMove.cancel();var I={isTooltipActive:!1};R.setState(I),R.triggerSyncEvent(I);var k=R.props.onMouseLeave;yn(k)&&k(I,D)}),en(R,"handleOuterEvent",function(D){var I=rle(D),k=Ho(R.props,"".concat(I));if(I&&yn(k)){var B,U;/.*touch.*/i.test(I)?U=R.getMouseInfo(D.changedTouches[0]):U=R.getMouseInfo(D),k((B=U)!==null&&B!==void 0?B:{},D)}}),en(R,"handleClick",function(D){var I=R.getMouseInfo(D);if(I){var k=Ge(Ge({},I),{},{isTooltipActive:!0});R.setState(k),R.triggerSyncEvent(k);var B=R.props.onClick;yn(B)&&B(k,D)}}),en(R,"handleMouseDown",function(D){var I=R.props.onMouseDown;if(yn(I)){var k=R.getMouseInfo(D);I(k,D)}}),en(R,"handleMouseUp",function(D){var I=R.props.onMouseUp;if(yn(I)){var k=R.getMouseInfo(D);I(k,D)}}),en(R,"handleTouchMove",function(D){D.changedTouches!=null&&D.changedTouches.length>0&&R.throttleTriggeredAfterMouseMove(D.changedTouches[0])}),en(R,"handleTouchStart",function(D){D.changedTouches!=null&&D.changedTouches.length>0&&R.handleMouseDown(D.changedTouches[0])}),en(R,"handleTouchEnd",function(D){D.changedTouches!=null&&D.changedTouches.length>0&&R.handleMouseUp(D.changedTouches[0])}),en(R,"handleDoubleClick",function(D){var I=R.props.onDoubleClick;if(yn(I)){var k=R.getMouseInfo(D);I(k,D)}}),en(R,"handleContextMenu",function(D){var I=R.props.onContextMenu;if(yn(I)){var k=R.getMouseInfo(D);I(k,D)}}),en(R,"triggerSyncEvent",function(D){R.props.syncId!==void 0&&I3.emit(B3,R.props.syncId,D,R.eventEmitterSymbol)}),en(R,"applySyncEvent",function(D){var I=R.props,k=I.layout,B=I.syncMethod,U=R.state.updateId,z=D.dataStartIndex,q=D.dataEndIndex;if(D.dataStartIndex!==void 0||D.dataEndIndex!==void 0)R.setState(Ge({dataStartIndex:z,dataEndIndex:q},y({props:R.props,dataStartIndex:z,dataEndIndex:q,updateId:U},R.state)));else if(D.activeTooltipIndex!==void 0){var W=D.chartX,ee=D.chartY,Q=D.activeTooltipIndex,V=R.state,$=V.offset,Y=V.tooltipTicks;if(!$)return;if(typeof B=="function")Q=B(Y,D);else if(B==="value"){Q=-1;for(var ie=0;ie<Y.length;ie++)if(Y[ie].value===D.activeLabel){Q=ie;break}}var de=Ge(Ge({},$),{},{x:$.left,y:$.top}),X=Math.min(W,de.x+de.width),ae=Math.min(ee,de.y+de.height),ue=Y[Q]&&Y[Q].value,Se=KI(R.state,R.props.data,Q),$e=Y[Q]?{x:k==="horizontal"?Y[Q].coordinate:X,y:k==="horizontal"?ae:Y[Q].coordinate}:HX;R.setState(Ge(Ge({},D),{},{activeLabel:ue,activeCoordinate:$e,activePayload:Se,activeTooltipIndex:Q}))}else R.setState(D)}),en(R,"renderCursor",function(D){var I,k=R.state,B=k.isTooltipActive,U=k.activeCoordinate,z=k.activePayload,q=k.offset,W=k.activeTooltipIndex,ee=k.tooltipAxisBandSize,Q=R.getTooltipEventType(),V=(I=D.props.active)!==null&&I!==void 0?I:B,$=R.props.layout,Y=D.key||"_recharts-cursor";return fe.createElement(I_e,{key:Y,activeCoordinate:U,activePayload:z,activeTooltipIndex:W,chartName:n,element:D,isActive:V,layout:$,offset:q,tooltipAxisBandSize:ee,tooltipEventType:Q})}),en(R,"renderPolarAxis",function(D,I,k){var B=Ho(D,"type.axisType"),U=Ho(R.state,"".concat(B,"Map")),z=D.type.defaultProps,q=z!==void 0?Ge(Ge({},z),D.props):D.props,W=U&&U[q["".concat(B,"Id")]];return j.cloneElement(D,Ge(Ge({},W),{},{className:In(B,W.className),key:D.key||"".concat(I,"-").concat(k),ticks:Wu(W,!0)}))}),en(R,"renderPolarGrid",function(D){var I=D.props,k=I.radialLines,B=I.polarAngles,U=I.polarRadius,z=R.state,q=z.radiusAxisMap,W=z.angleAxisMap,ee=gd(q),Q=gd(W),V=Q.cx,$=Q.cy,Y=Q.innerRadius,ie=Q.outerRadius;return j.cloneElement(D,{polarAngles:Array.isArray(B)?B:Wu(Q,!0).map(function(de){return de.coordinate}),polarRadius:Array.isArray(U)?U:Wu(ee,!0).map(function(de){return de.coordinate}),cx:V,cy:$,innerRadius:Y,outerRadius:ie,key:D.key||"polar-grid",radialLines:k})}),en(R,"renderLegend",function(){var D=R.state.formattedGraphicalItems,I=R.props,k=I.children,B=I.width,U=I.height,z=R.props.margin||{},q=B-(z.left||0)-(z.right||0),W=N$({children:k,formattedGraphicalItems:D,legendWidth:q,legendContent:u});if(!W)return null;var ee=W.item,Q=j6(W,B_e);return j.cloneElement(ee,Ge(Ge({},Q),{},{chartWidth:B,chartHeight:U,margin:z,onBBoxUpdate:R.handleLegendBBoxUpdate}))}),en(R,"renderTooltip",function(){var D,I=R.props,k=I.children,B=I.accessibilityLayer,U=Ks(k,Rl);if(!U)return null;var z=R.state,q=z.isTooltipActive,W=z.activeCoordinate,ee=z.activePayload,Q=z.activeLabel,V=z.offset,$=(D=U.props.active)!==null&&D!==void 0?D:q;return j.cloneElement(U,{viewBox:Ge(Ge({},V),{},{x:V.left,y:V.top}),active:$,label:Q,payload:$?ee:[],coordinate:W,accessibilityLayer:B})}),en(R,"renderBrush",function(D){var I=R.props,k=I.margin,B=I.data,U=R.state,z=U.offset,q=U.dataStartIndex,W=U.dataEndIndex,ee=U.updateId;return j.cloneElement(D,{key:D.key||"_recharts-brush",onChange:_S(R.handleBrushChange,D.props.onChange),data:B,x:mt(D.props.x)?D.props.x:z.left,y:mt(D.props.y)?D.props.y:z.top+z.height+z.brushBottom-(k.bottom||0),width:mt(D.props.width)?D.props.width:z.width,startIndex:q,endIndex:W,updateId:"brush-".concat(ee)})}),en(R,"renderReferenceElement",function(D,I,k){if(!D)return null;var B=R,U=B.clipPathId,z=R.state,q=z.xAxisMap,W=z.yAxisMap,ee=z.offset,Q=D.type.defaultProps||{},V=D.props,$=V.xAxisId,Y=$===void 0?Q.xAxisId:$,ie=V.yAxisId,de=ie===void 0?Q.yAxisId:ie;return j.cloneElement(D,{key:D.key||"".concat(I,"-").concat(k),xAxis:q[Y],yAxis:W[de],viewBox:{x:ee.left,y:ee.top,width:ee.width,height:ee.height},clipPathId:U})}),en(R,"renderActivePoints",function(D){var I=D.item,k=D.activePoint,B=D.basePoint,U=D.childIndex,z=D.isRange,q=[],W=I.props.key,ee=I.item.type.defaultProps!==void 0?Ge(Ge({},I.item.type.defaultProps),I.item.props):I.item.props,Q=ee.activeDot,V=ee.dataKey,$=Ge(Ge({index:U,dataKey:V,cx:k.x,cy:k.y,r:4,fill:s5(I.item),strokeWidth:2,stroke:"#fff",payload:k.payload,value:k.value},_n(Q,!1)),ew(Q));return q.push(S.renderActiveDot(Q,$,"".concat(W,"-activePoint-").concat(U))),B?q.push(S.renderActiveDot(Q,Ge(Ge({},$),{},{cx:B.x,cy:B.y}),"".concat(W,"-basePoint-").concat(U))):z&&q.push(null),q}),en(R,"renderGraphicChild",function(D,I,k){var B=R.filterFormatItem(D,I,k);if(!B)return null;var U=R.getTooltipEventType(),z=R.state,q=z.isTooltipActive,W=z.tooltipAxis,ee=z.activeTooltipIndex,Q=z.activeLabel,V=R.props.children,$=Ks(V,Rl),Y=B.props,ie=Y.points,de=Y.isRange,X=Y.baseLine,ae=B.item.type.defaultProps!==void 0?Ge(Ge({},B.item.type.defaultProps),B.item.props):B.item.props,ue=ae.activeDot,Se=ae.hide,$e=ae.activeBar,me=ae.activeShape,ve=!!(!Se&&q&&$&&(ue||$e||me)),We={};U!=="axis"&&$&&$.props.trigger==="click"?We={onClick:_S(R.handleItemMouseEnter,D.props.onClick)}:U!=="axis"&&(We={onMouseLeave:_S(R.handleItemMouseLeave,D.props.onMouseLeave),onMouseEnter:_S(R.handleItemMouseEnter,D.props.onMouseEnter)});var _e=j.cloneElement(D,Ge(Ge({},B.props),We));function Fe(Ze){return typeof W.dataKey=="function"?W.dataKey(Ze.payload):null}if(ve)if(ee>=0){var Xe,Re;if(W.dataKey&&!W.allowDuplicatedCategory){var ot=typeof W.dataKey=="function"?Fe:"payload.".concat(W.dataKey.toString());Xe=QA(ie,ot,Q),Re=de&&X&&QA(X,ot,Q)}else Xe=ie?.[ee],Re=de&&X&&X[ee];if(me||$e){var we=D.props.activeIndex!==void 0?D.props.activeIndex:ee;return[j.cloneElement(D,Ge(Ge(Ge({},B.props),We),{},{activeIndex:we})),null,null]}if(!Cn(Xe))return[_e].concat(Tv(R.renderActivePoints({item:B,activePoint:Xe,basePoint:Re,childIndex:ee,isRange:de})))}else{var Ue,Be=(Ue=R.getItemByXY(R.state.activeCoordinate))!==null&&Ue!==void 0?Ue:{graphicalItem:_e},Ye=Be.graphicalItem,re=Ye.item,At=re===void 0?D:re,ft=Ye.childIndex,Et=Ge(Ge(Ge({},B.props),We),{},{activeIndex:ft});return[j.cloneElement(At,Et),null,null]}return de?[_e,null,null]:[_e,null]}),en(R,"renderCustomized",function(D,I,k){return j.cloneElement(D,Ge(Ge({key:"recharts-customized-".concat(k)},R.props),R.state))}),en(R,"renderMap",{CartesianGrid:{handler:ES,once:!0},ReferenceArea:{handler:R.renderReferenceElement},ReferenceLine:{handler:ES},ReferenceDot:{handler:R.renderReferenceElement},XAxis:{handler:ES},YAxis:{handler:ES},Brush:{handler:R.renderBrush,once:!0},Bar:{handler:R.renderGraphicChild},Line:{handler:R.renderGraphicChild},Area:{handler:R.renderGraphicChild},Radar:{handler:R.renderGraphicChild},RadialBar:{handler:R.renderGraphicChild},Scatter:{handler:R.renderGraphicChild},Pie:{handler:R.renderGraphicChild},Funnel:{handler:R.renderGraphicChild},Tooltip:{handler:R.renderCursor,once:!0},PolarGrid:{handler:R.renderPolarGrid,once:!0},PolarAngleAxis:{handler:R.renderPolarAxis},PolarRadiusAxis:{handler:R.renderPolarAxis},Customized:{handler:R.renderCustomized}}),R.clipPathId="".concat((T=E.id)!==null&&T!==void 0?T:Yv("recharts"),"-clip"),R.throttleTriggeredAfterMouseMove=Pq(R.triggeredAfterMouseMove,(P=E.throttleDelay)!==null&&P!==void 0?P:1e3/60),R.state={},R}return $_e(S,_),H_e(S,[{key:"componentDidMount",value:function(){var T,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var T=this.props,P=T.children,R=T.data,D=T.height,I=T.layout,k=Ks(P,Rl);if(k){var B=k.props.defaultIndex;if(!(typeof B!="number"||B<0||B>this.state.tooltipTicks.length-1)){var U=this.state.tooltipTicks[B]&&this.state.tooltipTicks[B].value,z=KI(this.state,R,B,U),q=this.state.tooltipTicks[B].coordinate,W=(this.state.offset.top+D)/2,ee=I==="horizontal",Q=ee?{x:q,y:W}:{y:q,x:W},V=this.state.formattedGraphicalItems.find(function(Y){var ie=Y.item;return ie.type.name==="Scatter"});V&&(Q=Ge(Ge({},Q),V.props.points[B].tooltipPosition),z=V.props.points[B].tooltipPayload);var $={activeTooltipIndex:B,isTooltipActive:!0,activeLabel:U,activePayload:z,activeCoordinate:Q};this.setState($),this.renderCursor(k),this.accessibilityManager.setIndex(B)}}}},{key:"getSnapshotBeforeUpdate",value:function(T,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==T.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==T.margin){var R,D;this.accessibilityManager.setDetails({offset:{left:(R=this.props.margin.left)!==null&&R!==void 0?R:0,top:(D=this.props.margin.top)!==null&&D!==void 0?D:0}})}return null}},{key:"componentDidUpdate",value:function(T){IN([Ks(T.children,Rl)],[Ks(this.props.children,Rl)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var T=Ks(this.props.children,Rl);if(T&&typeof T.props.shared=="boolean"){var P=T.props.shared?"axis":"item";return o.indexOf(P)>=0?P:a}return a}},{key:"getMouseInfo",value:function(T){if(!this.container)return null;var P=this.container,R=P.getBoundingClientRect(),D=Vfe(R),I={chartX:Math.round(T.pageX-D.left),chartY:Math.round(T.pageY-D.top)},k=R.width/P.offsetWidth||1,B=this.inRange(I.chartX,I.chartY,k);if(!B)return null;var U=this.state,z=U.xAxisMap,q=U.yAxisMap,W=this.getTooltipEventType(),ee=G6(this.state,this.props.data,this.props.layout,B);if(W!=="axis"&&z&&q){var Q=gd(z).scale,V=gd(q).scale,$=Q&&Q.invert?Q.invert(I.chartX):null,Y=V&&V.invert?V.invert(I.chartY):null;return Ge(Ge({},I),{},{xValue:$,yValue:Y},ee)}return ee?Ge(Ge({},I),ee):null}},{key:"inRange",value:function(T,P){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,D=this.props.layout,I=T/R,k=P/R;if(D==="horizontal"||D==="vertical"){var B=this.state.offset,U=I>=B.left&&I<=B.left+B.width&&k>=B.top&&k<=B.top+B.height;return U?{x:I,y:k}:null}var z=this.state,q=z.angleAxisMap,W=z.radiusAxisMap;if(q&&W){var ee=gd(q);return r8({x:I,y:k},ee)}return null}},{key:"parseEventsOfWrapper",value:function(){var T=this.props.children,P=this.getTooltipEventType(),R=Ks(T,Rl),D={};R&&P==="axis"&&(R.props.trigger==="click"?D={onClick:this.handleClick}:D={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var I=ew(this.props,this.handleOuterEvent);return Ge(Ge({},I),D)}},{key:"addListener",value:function(){I3.on(B3,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){I3.removeListener(B3,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(T,P,R){for(var D=this.state.formattedGraphicalItems,I=0,k=D.length;I<k;I++){var B=D[I];if(B.item===T||B.props.key===T.key||P===Xu(B.item.type)&&R===B.childIndex)return B}return null}},{key:"renderClipPath",value:function(){var T=this.clipPathId,P=this.state.offset,R=P.left,D=P.top,I=P.height,k=P.width;return fe.createElement("defs",null,fe.createElement("clipPath",{id:T},fe.createElement("rect",{x:R,y:D,height:I,width:k})))}},{key:"getXScales",value:function(){var T=this.state.xAxisMap;return T?Object.entries(T).reduce(function(P,R){var D=U6(R,2),I=D[0],k=D[1];return Ge(Ge({},P),{},en({},I,k.scale))},{}):null}},{key:"getYScales",value:function(){var T=this.state.yAxisMap;return T?Object.entries(T).reduce(function(P,R){var D=U6(R,2),I=D[0],k=D[1];return Ge(Ge({},P),{},en({},I,k.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(T){var P;return(P=this.state.xAxisMap)===null||P===void 0||(P=P[T])===null||P===void 0?void 0:P.scale}},{key:"getYScaleByAxisId",value:function(T){var P;return(P=this.state.yAxisMap)===null||P===void 0||(P=P[T])===null||P===void 0?void 0:P.scale}},{key:"getItemByXY",value:function(T){var P=this.state,R=P.formattedGraphicalItems,D=P.activeItem;if(R&&R.length)for(var I=0,k=R.length;I<k;I++){var B=R[I],U=B.props,z=B.item,q=z.type.defaultProps!==void 0?Ge(Ge({},z.type.defaultProps),z.props):z.props,W=Xu(z.type);if(W==="Bar"){var ee=(U.data||[]).find(function(Y){return d0e(T,Y)});if(ee)return{graphicalItem:B,payload:ee}}else if(W==="RadialBar"){var Q=(U.data||[]).find(function(Y){return r8(T,Y)});if(Q)return{graphicalItem:B,payload:Q}}else if(DE(B,D)||NE(B,D)||Sb(B,D)){var V=nxe({graphicalItem:B,activeTooltipItem:D,itemData:q.data}),$=q.activeIndex===void 0?V:q.activeIndex;return{graphicalItem:Ge(Ge({},B),{},{childIndex:$}),payload:Sb(B,D)?q.data[V]:B.props.data[V]}}}return null}},{key:"render",value:function(){var T=this;if(!mU(this))return null;var P=this.props,R=P.children,D=P.className,I=P.width,k=P.height,B=P.style,U=P.compact,z=P.title,q=P.desc,W=j6(P,L_e),ee=_n(W,!1);if(U)return fe.createElement(y6,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},fe.createElement(LN,Gg({},ee,{width:I,height:k,title:z,desc:q}),this.renderClipPath(),vU(R,this.renderMap)));if(this.props.accessibilityLayer){var Q,V;ee.tabIndex=(Q=this.props.tabIndex)!==null&&Q!==void 0?Q:0,ee.role=(V=this.props.role)!==null&&V!==void 0?V:"application",ee.onKeyDown=function(Y){T.accessibilityManager.keyboardEvent(Y)},ee.onFocus=function(){T.accessibilityManager.focus()}}var $=this.parseEventsOfWrapper();return fe.createElement(y6,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},fe.createElement("div",Gg({className:In("recharts-wrapper",D),style:Ge({position:"relative",cursor:"default",width:I,height:k},B)},$,{ref:function(ie){T.container=ie}}),fe.createElement(LN,Gg({},ee,{width:I,height:k,title:z,desc:q,style:Q_e}),this.renderClipPath(),vU(R,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(j.Component);en(b,"displayName",n),en(b,"defaultProps",Ge({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),en(b,"getDerivedStateFromProps",function(_,S){var E=_.dataKey,T=_.data,P=_.children,R=_.width,D=_.height,I=_.layout,k=_.stackOffset,B=_.margin,U=S.dataStartIndex,z=S.dataEndIndex;if(S.updateId===void 0){var q=H6(_);return Ge(Ge(Ge({},q),{},{updateId:0},y(Ge(Ge({props:_},q),{},{updateId:0}),S)),{},{prevDataKey:E,prevData:T,prevWidth:R,prevHeight:D,prevLayout:I,prevStackOffset:k,prevMargin:B,prevChildren:P})}if(E!==S.prevDataKey||T!==S.prevData||R!==S.prevWidth||D!==S.prevHeight||I!==S.prevLayout||k!==S.prevStackOffset||!Wg(B,S.prevMargin)){var W=H6(_),ee={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},Q=Ge(Ge({},G6(S,T,I)),{},{updateId:S.updateId+1}),V=Ge(Ge(Ge({},W),ee),Q);return Ge(Ge(Ge({},V),y(Ge({props:_},V),S)),{},{prevDataKey:E,prevData:T,prevWidth:R,prevHeight:D,prevLayout:I,prevStackOffset:k,prevMargin:B,prevChildren:P})}if(!IN(P,S.prevChildren)){var $,Y,ie,de,X=Ks(P,mv),ae=X&&($=(Y=X.props)===null||Y===void 0?void 0:Y.startIndex)!==null&&$!==void 0?$:U,ue=X&&(ie=(de=X.props)===null||de===void 0?void 0:de.endIndex)!==null&&ie!==void 0?ie:z,Se=ae!==U||ue!==z,$e=!Cn(T),me=$e&&!Se?S.updateId:S.updateId+1;return Ge(Ge({updateId:me},y(Ge(Ge({props:_},S),{},{updateId:me,dataStartIndex:ae,dataEndIndex:ue}),S)),{},{prevChildren:P,dataStartIndex:ae,dataEndIndex:ue})}return null}),en(b,"renderActiveDot",function(_,S,E){var T;return j.isValidElement(_)?T=j.cloneElement(_,S):yn(_)?T=_(S):T=fe.createElement(PE,S),fe.createElement(Ar,{className:"recharts-active-dot",key:E},T)});var w=j.forwardRef(function(S,E){return fe.createElement(b,Gg({},S,{ref:E}))});return w.displayName=b.displayName,w},cSe=WX({chartName:"LineChart",GraphicalChild:Sv,axisComponents:[{axisType:"xAxis",AxisComp:ny},{axisType:"yAxis",AxisComp:ry}],formatAxisMap:aX}),uSe=WX({chartName:"AreaChart",GraphicalChild:sf,axisComponents:[{axisType:"xAxis",AxisComp:ny},{axisType:"yAxis",AxisComp:ry}],formatAxisMap:aX});function W6(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Gp(...t){return e=>{let n=!1;const r=t.map(i=>{const a=W6(i,e);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():W6(t[i],null)}}}}function Ls(...t){return j.useCallback(Gp(...t),t)}var fSe=Symbol.for("react.lazy"),Qw=NB[" use ".trim().toString()];function dSe(t){return typeof t=="object"&&t!==null&&"then"in t}function qX(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===fSe&&"_payload"in t&&dSe(t._payload)}function $X(t){const e=hSe(t),n=j.forwardRef((r,i)=>{let{children:a,...s}=r;qX(a)&&typeof Qw=="function"&&(a=Qw(a._payload));const o=j.Children.toArray(a),c=o.find(mSe);if(c){const u=c.props.children,h=o.map(p=>p===c?j.Children.count(u)>1?j.Children.only(null):j.isValidElement(u)?u.props.children:null:p);return M.jsx(e,{...s,ref:i,children:j.isValidElement(u)?j.cloneElement(u,void 0,h):null})}return M.jsx(e,{...s,ref:i,children:a})});return n.displayName=`${t}.Slot`,n}var XX=$X("Slot");function hSe(t){const e=j.forwardRef((n,r)=>{let{children:i,...a}=n;if(qX(i)&&typeof Qw=="function"&&(i=Qw(i._payload)),j.isValidElement(i)){const s=vSe(i),o=gSe(a,i.props);return i.type!==j.Fragment&&(o.ref=r?Gp(r,s):s),j.cloneElement(i,o)}return j.Children.count(i)>1?j.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var pSe=Symbol("radix.slottable");function mSe(t){return j.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===pSe}function gSe(t,e){const n={...e};for(const r in e){const i=t[r],a=e[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const c=a(...o);return i(...o),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...t,...n}}function vSe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}const q6=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,$6=In,KX=(t,e)=>n=>{var r;if(e?.variants==null)return $6(t,n?.class,n?.className);const{variants:i,defaultVariants:a}=e,s=Object.keys(i).map(u=>{const h=n?.[u],p=a?.[u];if(h===null)return null;const v=q6(h)||q6(p);return i[u][v]}),o=n&&Object.entries(n).reduce((u,h)=>{let[p,v]=h;return v===void 0||(u[p]=v),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,h)=>{let{class:p,className:v,...y}=h;return Object.entries(y).every(b=>{let[w,_]=b;return Array.isArray(_)?_.includes({...a,...o}[w]):{...a,...o}[w]===_})?[...u,p,v]:u},[]);return $6(t,s,c,n?.class,n?.className)},ySe=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},xSe=(t,e)=>({classGroupId:t,validator:e}),YX=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),eM="-",X6=[],bSe="arbitrary..",_Se=t=>{const e=ASe(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return SSe(s);const o=s.split(eM),c=o[0]===""&&o.length>1?1:0;return JX(o,c,e)},getConflictingClassGroupIds:(s,o)=>{if(o){const c=r[s],u=n[s];return c?u?ySe(u,c):c:u||X6}return n[s]||X6}}},JX=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],a=n.nextPart.get(i);if(a){const u=JX(t,e+1,a);if(u)return u}const s=n.validators;if(s===null)return;const o=e===0?t.join(eM):t.slice(e).join(eM),c=s.length;for(let u=0;u<c;u++){const h=s[u];if(h.validator(o))return h.classGroupId}},SSe=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?bSe+r:void 0})(),ASe=t=>{const{theme:e,classGroups:n}=t;return wSe(n,e)},wSe=(t,e)=>{const n=YX();for(const r in t){const i=t[r];y5(i,n,r,e)}return n},y5=(t,e,n,r)=>{const i=t.length;for(let a=0;a<i;a++){const s=t[a];MSe(s,e,n,r)}},MSe=(t,e,n,r)=>{if(typeof t=="string"){ESe(t,e,n);return}if(typeof t=="function"){TSe(t,e,n,r);return}CSe(t,e,n,r)},ESe=(t,e,n)=>{const r=t===""?e:ZX(e,t);r.classGroupId=n},TSe=(t,e,n,r)=>{if(RSe(t)){y5(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(xSe(n,t))},CSe=(t,e,n,r)=>{const i=Object.entries(t),a=i.length;for(let s=0;s<a;s++){const[o,c]=i[s];y5(c,ZX(e,o),n,r)}},ZX=(t,e)=>{let n=t;const r=e.split(eM),i=r.length;for(let a=0;a<i;a++){const s=r[a];let o=n.nextPart.get(s);o||(o=YX(),n.nextPart.set(s,o)),n=o}return n},RSe=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,OSe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(a,s)=>{n[a]=s,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(a){let s=n[a];if(s!==void 0)return s;if((s=r[a])!==void 0)return i(a,s),s},set(a,s){a in n?n[a]=s:i(a,s)}}},YI="!",K6=":",PSe=[],Y6=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),DSe=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const a=[];let s=0,o=0,c=0,u;const h=i.length;for(let w=0;w<h;w++){const _=i[w];if(s===0&&o===0){if(_===K6){a.push(i.slice(c,w)),c=w+1;continue}if(_==="/"){u=w;continue}}_==="["?s++:_==="]"?s--:_==="("?o++:_===")"&&o--}const p=a.length===0?i:i.slice(c);let v=p,y=!1;p.endsWith(YI)?(v=p.slice(0,-1),y=!0):p.startsWith(YI)&&(v=p.slice(1),y=!0);const b=u&&u>c?u-c:void 0;return Y6(a,y,v,b)};if(e){const i=e+K6,a=r;r=s=>s.startsWith(i)?a(s.slice(i.length)):Y6(PSe,!1,s,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},NSe=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const s=n[a],o=s[0]==="[",c=e.has(s);o||c?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(s)):i.push(s)}return i.length>0&&(i.sort(),r.push(...i)),r}},ISe=t=>({cache:OSe(t.cacheSize),parseClassName:DSe(t),sortModifiers:NSe(t),..._Se(t)}),BSe=/\s+/,LSe=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=e,s=[],o=t.trim().split(BSe);let c="";for(let u=o.length-1;u>=0;u-=1){const h=o[u],{isExternal:p,modifiers:v,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:w}=n(h);if(p){c=h+(c.length>0?" "+c:c);continue}let _=!!w,S=r(_?b.substring(0,w):b);if(!S){if(!_){c=h+(c.length>0?" "+c:c);continue}if(S=r(b),!S){c=h+(c.length>0?" "+c:c);continue}_=!1}const E=v.length===0?"":v.length===1?v[0]:a(v).join(":"),T=y?E+YI:E,P=T+S;if(s.indexOf(P)>-1)continue;s.push(P);const R=i(S,_);for(let D=0;D<R.length;++D){const I=R[D];s.push(T+I)}c=h+(c.length>0?" "+c:c)}return c},kSe=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=QX(n))&&(i&&(i+=" "),i+=r);return i},QX=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=QX(t[r]))&&(n&&(n+=" "),n+=e);return n},FSe=(t,...e)=>{let n,r,i,a;const s=c=>{const u=e.reduce((h,p)=>p(h),t());return n=ISe(u),r=n.cache.get,i=n.cache.set,a=o,o(c)},o=c=>{const u=r(c);if(u)return u;const h=LSe(c,n);return i(c,h),h};return a=s,(...c)=>a(kSe(...c))},USe=[],ki=t=>{const e=n=>n[t]||USe;return e.isThemeGetter=!0,e},eK=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tK=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jSe=/^\d+\/\d+$/,zSe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GSe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,HSe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,VSe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,WSe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ag=t=>jSe.test(t),Tn=t=>!!t&&!Number.isNaN(Number(t)),rd=t=>!!t&&Number.isInteger(Number(t)),k3=t=>t.endsWith("%")&&Tn(t.slice(0,-1)),Du=t=>zSe.test(t),qSe=()=>!0,$Se=t=>GSe.test(t)&&!HSe.test(t),nK=()=>!1,XSe=t=>VSe.test(t),KSe=t=>WSe.test(t),YSe=t=>!It(t)&&!Bt(t),JSe=t=>iy(t,aK,nK),It=t=>eK.test(t),Nh=t=>iy(t,sK,$Se),F3=t=>iy(t,nAe,Tn),J6=t=>iy(t,rK,nK),ZSe=t=>iy(t,iK,KSe),TS=t=>iy(t,oK,XSe),Bt=t=>tK.test(t),Z0=t=>ay(t,sK),QSe=t=>ay(t,rAe),Z6=t=>ay(t,rK),eAe=t=>ay(t,aK),tAe=t=>ay(t,iK),CS=t=>ay(t,oK,!0),iy=(t,e,n)=>{const r=eK.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},ay=(t,e,n=!1)=>{const r=tK.exec(t);return r?r[1]?e(r[1]):n:!1},rK=t=>t==="position"||t==="percentage",iK=t=>t==="image"||t==="url",aK=t=>t==="length"||t==="size"||t==="bg-size",sK=t=>t==="length",nAe=t=>t==="number",rAe=t=>t==="family-name",oK=t=>t==="shadow",iAe=()=>{const t=ki("color"),e=ki("font"),n=ki("text"),r=ki("font-weight"),i=ki("tracking"),a=ki("leading"),s=ki("breakpoint"),o=ki("container"),c=ki("spacing"),u=ki("radius"),h=ki("shadow"),p=ki("inset-shadow"),v=ki("text-shadow"),y=ki("drop-shadow"),b=ki("blur"),w=ki("perspective"),_=ki("aspect"),S=ki("ease"),E=ki("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...P(),Bt,It],D=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],k=()=>[Bt,It,c],B=()=>[ag,"full","auto",...k()],U=()=>[rd,"none","subgrid",Bt,It],z=()=>["auto",{span:["full",rd,Bt,It]},rd,Bt,It],q=()=>[rd,"auto",Bt,It],W=()=>["auto","min","max","fr",Bt,It],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...k()],$=()=>[ag,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],Y=()=>[t,Bt,It],ie=()=>[...P(),Z6,J6,{position:[Bt,It]}],de=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",eAe,JSe,{size:[Bt,It]}],ae=()=>[k3,Z0,Nh],ue=()=>["","none","full",u,Bt,It],Se=()=>["",Tn,Z0,Nh],$e=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[Tn,k3,Z6,J6],We=()=>["","none",b,Bt,It],_e=()=>["none",Tn,Bt,It],Fe=()=>["none",Tn,Bt,It],Xe=()=>[Tn,Bt,It],Re=()=>[ag,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Du],breakpoint:[Du],color:[qSe],container:[Du],"drop-shadow":[Du],ease:["in","out","in-out"],font:[YSe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Du],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Du],shadow:[Du],spacing:["px",Tn],text:[Du],"text-shadow":[Du],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ag,It,Bt,_]}],container:["container"],columns:[{columns:[Tn,It,Bt,o]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[rd,"auto",Bt,It]}],basis:[{basis:[ag,"full","auto",o,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Tn,ag,"auto","initial","none",It]}],grow:[{grow:["",Tn,Bt,It]}],shrink:[{shrink:["",Tn,Bt,It]}],order:[{order:[rd,"first","last","none",Bt,It]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[o,"screen",...$()]}],"min-w":[{"min-w":[o,"screen","none",...$()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Z0,Nh]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Bt,F3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",k3,It]}],"font-family":[{font:[QSe,It,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Bt,It]}],"line-clamp":[{"line-clamp":[Tn,"none",Bt,F3]}],leading:[{leading:[a,...k()]}],"list-image":[{"list-image":["none",Bt,It]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Bt,It]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$e(),"wavy"]}],"text-decoration-thickness":[{decoration:[Tn,"from-font","auto",Bt,Nh]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Tn,"auto",Bt,It]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Bt,It]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Bt,It]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:de()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},rd,Bt,It],radial:["",Bt,It],conic:[rd,Bt,It]},tAe,ZSe]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:Se()}],"border-w-x":[{"border-x":Se()}],"border-w-y":[{"border-y":Se()}],"border-w-s":[{"border-s":Se()}],"border-w-e":[{"border-e":Se()}],"border-w-t":[{"border-t":Se()}],"border-w-r":[{"border-r":Se()}],"border-w-b":[{"border-b":Se()}],"border-w-l":[{"border-l":Se()}],"divide-x":[{"divide-x":Se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...$e(),"hidden","none"]}],"divide-style":[{divide:[...$e(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...$e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Tn,Bt,It]}],"outline-w":[{outline:["",Tn,Z0,Nh]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",h,CS,TS]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",p,CS,TS]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Tn,Nh]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":Se()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",v,CS,TS]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Tn,Bt,It]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Tn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[Bt,It]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[Tn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:de()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Bt,It]}],filter:[{filter:["","none",Bt,It]}],blur:[{blur:We()}],brightness:[{brightness:[Tn,Bt,It]}],contrast:[{contrast:[Tn,Bt,It]}],"drop-shadow":[{"drop-shadow":["","none",y,CS,TS]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",Tn,Bt,It]}],"hue-rotate":[{"hue-rotate":[Tn,Bt,It]}],invert:[{invert:["",Tn,Bt,It]}],saturate:[{saturate:[Tn,Bt,It]}],sepia:[{sepia:["",Tn,Bt,It]}],"backdrop-filter":[{"backdrop-filter":["","none",Bt,It]}],"backdrop-blur":[{"backdrop-blur":We()}],"backdrop-brightness":[{"backdrop-brightness":[Tn,Bt,It]}],"backdrop-contrast":[{"backdrop-contrast":[Tn,Bt,It]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Tn,Bt,It]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Tn,Bt,It]}],"backdrop-invert":[{"backdrop-invert":["",Tn,Bt,It]}],"backdrop-opacity":[{"backdrop-opacity":[Tn,Bt,It]}],"backdrop-saturate":[{"backdrop-saturate":[Tn,Bt,It]}],"backdrop-sepia":[{"backdrop-sepia":["",Tn,Bt,It]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Bt,It]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Tn,"initial",Bt,It]}],ease:[{ease:["linear","initial",S,Bt,It]}],delay:[{delay:[Tn,Bt,It]}],animate:[{animate:["none",E,Bt,It]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Bt,It]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:Fe()}],"scale-x":[{"scale-x":Fe()}],"scale-y":[{"scale-y":Fe()}],"scale-z":[{"scale-z":Fe()}],"scale-3d":["scale-3d"],skew:[{skew:Xe()}],"skew-x":[{"skew-x":Xe()}],"skew-y":[{"skew-y":Xe()}],transform:[{transform:[Bt,It,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Bt,It]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Bt,It]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[Tn,Z0,Nh,F3]}],stroke:[{stroke:["none",...Y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},aAe=FSe(iAe);function hf(...t){return aAe(In(t))}function lp(t,e="AED"){return new Intl.NumberFormat("en-US",{style:"currency",currency:e,minimumFractionDigits:0,maximumFractionDigits:0}).format(t)}const sAe=KX("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function jE({className:t,variant:e,asChild:n=!1,...r}){const i=n?XX:"span";return M.jsx(i,{"code-path":"src\\components\\ui\\badge.tsx:38:5","data-slot":"badge",className:hf(sAe({variant:e}),t),...r})}function lK({className:t,type:e,...n}){return M.jsx("input",{"code-path":"src\\components\\ui\\input.tsx:7:5",type:e,"data-slot":"input",className:hf("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}const oAe=KX("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function tM({className:t,variant:e="default",size:n="default",asChild:r=!1,...i}){const a=r?XX:"button";return M.jsx(a,{"code-path":"src\\components\\ui\\button.tsx:52:5","data-slot":"button","data-variant":e,"data-size":n,className:hf(oAe({variant:e,size:n,className:t})),...i})}const lAe={background:"rgba(8, 10, 18, 0.82)",border:"1px solid rgba(59,130,246,0.14)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",boxShadow:"0 0 0 1px rgba(255,255,255,0.04), 0 4px 32px rgba(0,0,0,0.55), 0 0 60px rgba(59,130,246,0.06)"};function sy({children:t,className:e="",delay:n=0,colSpan:r=1,rowSpan:i=1,glow:a=!1}){return M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Dashboard.tsx:60:5",className:`relative rounded-2xl p-5 overflow-hidden ${e}`,style:{gridColumn:`span ${r}`,gridRow:`span ${i}`,...lAe,...a?{boxShadow:"0 0 0 1px rgba(59,130,246,0.18), 0 8px 48px rgba(0,0,0,0.6), 0 0 80px rgba(59,130,246,0.12)"}:{}},initial:{opacity:0,y:18,scale:.97},animate:{opacity:1,y:0,scale:1},transition:{duration:.38,delay:n,ease:[.4,0,.2,1]},children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:75:7",className:"absolute inset-x-0 top-0 h-px pointer-events-none",style:{background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent)"}}),t]})}function x5({icon:t,label:e,value:n,sub:r,badge:i,glowColor:a="rgba(59,130,246,0.18)",delay:s=0}){return M.jsxs(sy,{"code-path":"src\\components\\modules\\Dashboard.tsx:97:5",delay:s,colSpan:1,className:"flex flex-col justify-between min-h-[148px]",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:99:7",className:"absolute -bottom-8 -right-8 w-56 h-56 pointer-events-none",style:{background:`radial-gradient(ellipse at 70% 80%, ${a} 0%, transparent 65%)`,filter:"blur(20px)"}}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:107:7",className:"absolute bottom-0 left-0 w-40 h-24 pointer-events-none",style:{background:`radial-gradient(ellipse at 20% 100%, ${a.replace("0.","0.0")} 0%, transparent 70%)`,filter:"blur(16px)"}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:115:7",className:"flex items-start justify-between",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:117:9",className:"flex-shrink-0",style:{color:"rgba(148,163,184,0.7)"},children:t}),i]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:123:7",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Dashboard.tsx:124:9",className:"text-xs font-medium uppercase tracking-widest mb-1",style:{color:"rgba(148,163,184,0.65)"},children:e}),M.jsx(yt.p,{"code-path":"src\\components\\modules\\Dashboard.tsx:127:9",className:"text-4xl font-semibold text-white leading-none",initial:{opacity:0,scale:.6},animate:{opacity:1,scale:1},transition:{duration:.45,delay:s+.15,type:"spring",stiffness:200},children:n}),M.jsx("p",{"code-path":"src\\components\\modules\\Dashboard.tsx:135:9",className:"text-xs mt-1.5",style:{color:"rgba(148,163,184,0.5)"},children:r})]})]})}function cK(){return M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:146:5",className:"flex items-center gap-1.5 text-xs font-medium",style:{color:"#4ade80"},children:[M.jsx(yt.div,{"code-path":"src\\components\\modules\\Dashboard.tsx:147:7",className:"w-1.5 h-1.5 rounded-full bg-green-400",animate:{opacity:[1,.3,1]},transition:{repeat:1/0,duration:1.6}}),"Live"]})}function uK({text:t}){return M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:160:5",className:"flex items-center gap-0.5 text-xs font-medium",style:{color:"#4ade80"},children:[M.jsx(bW,{"code-path":"src\\components\\modules\\Dashboard.tsx:161:7",className:"w-3.5 h-3.5"}),t]})}function cAe({delay:t=0}){const{metrics:e}=ao();return M.jsx(x5,{"code-path":"src\\components\\modules\\Dashboard.tsx:171:5",delay:t,icon:M.jsx(Cx,{"code-path":"src\\components\\modules\\Dashboard.tsx:173:13",className:"w-4 h-4 text-blue-400"}),label:"Active Visitors",value:e.activeVisitors,sub:"In Experience Center",badge:M.jsx(cK,{"code-path":"src\\components\\modules\\Dashboard.tsx:177:14"}),glowColor:"rgba(59,130,246,0.22)"})}function uAe({delay:t=0}){const{metrics:e}=ao();return M.jsx(x5,{"code-path":"src\\components\\modules\\Dashboard.tsx:187:5",delay:t,icon:M.jsx(EW,{"code-path":"src\\components\\modules\\Dashboard.tsx:189:13",className:"w-4 h-4 text-cyan-400"}),label:"Today's Leads",value:e.todayLeads,sub:`${e.closedDeals} converted`,badge:M.jsx(uK,{"code-path":"src\\components\\modules\\Dashboard.tsx:193:14",text:"+12%"}),glowColor:"rgba(34,211,238,0.18)"})}function fAe({delay:t=0}){const{metrics:e}=ao();return M.jsx(x5,{"code-path":"src\\components\\modules\\Dashboard.tsx:203:5",delay:t,icon:M.jsx(eoe,{"code-path":"src\\components\\modules\\Dashboard.tsx:205:13",className:"w-4 h-4 text-blue-300"}),label:"Conversion Rate",value:`${e.conversionRate}%`,sub:"Industry avg: 8.5%",badge:M.jsx(uK,{"code-path":"src\\components\\modules\\Dashboard.tsx:209:14",text:"+2.4%"}),glowColor:"rgba(99,102,241,0.20)"})}function dAe({delay:t=0}){return M.jsxs(sy,{"code-path":"src\\components\\modules\\Dashboard.tsx:218:5",delay:t,colSpan:1,className:"flex flex-col justify-between min-h-[148px]",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:220:7",className:"absolute -bottom-8 -right-8 w-56 h-56 pointer-events-none",style:{background:"radial-gradient(ellipse at 70% 80%, rgba(251,191,36,0.22) 0%, transparent 65%)",filter:"blur(20px)"}}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:227:7",className:"absolute bottom-0 left-0 w-40 h-24 pointer-events-none",style:{background:"radial-gradient(ellipse at 20% 100%, rgba(251,191,36,0.06) 0%, transparent 70%)",filter:"blur(16px)"}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:234:7",className:"flex items-start justify-between",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:235:9",className:"w-9 h-9 rounded-xl flex items-center justify-center",style:{background:"rgba(251,191,36,0.10)",border:"1px solid rgba(251,191,36,0.2)"},children:M.jsx($se,{"code-path":"src\\components\\modules\\Dashboard.tsx:239:11",className:"w-4 h-4 text-amber-400"})}),M.jsx(jE,{"code-path":"src\\components\\modules\\Dashboard.tsx:241:9",variant:"secondary",className:"bg-amber-400/10 text-amber-300 border border-amber-400/20 text-[10px]",children:"This Month"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:245:7",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Dashboard.tsx:246:9",className:"text-xs font-medium uppercase tracking-widest mb-1",style:{color:"rgba(148,163,184,0.65)"},children:"Top Performer"}),M.jsx("p",{"code-path":"src\\components\\modules\\Dashboard.tsx:249:9",className:"text-2xl font-semibold text-white leading-tight",children:"Rania Al-Farsi"}),M.jsx("p",{"code-path":"src\\components\\modules\\Dashboard.tsx:250:9",className:"text-xs mt-1.5",style:{color:"rgba(148,163,184,0.5)"},children:"42 deals · $2.1M closed"})]})]})}function hAe({value:t,delay:e=0}){const n=t>=70?"Excellent":t>=50?"Good":"Needs Attention",r=t>=70?"#4ade80":t>=50?"#fbbf24":"#f87171";return M.jsxs(sy,{"code-path":"src\\components\\modules\\Dashboard.tsx:262:5",delay:e,colSpan:2,children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:264:7",className:"absolute -bottom-10 left-1/2 -translate-x-1/2 w-96 h-40 pointer-events-none",style:{background:"radial-gradient(ellipse at 50% 100%, rgba(59,130,246,0.35) 0%, transparent 65%)",filter:"blur(24px)"}}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:271:7",className:"absolute bottom-0 left-0 w-48 h-32 pointer-events-none",style:{background:"radial-gradient(ellipse at 0% 100%, rgba(99,102,241,0.15) 0%, transparent 70%)",filter:"blur(20px)"}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:279:7",className:"flex items-center justify-between mb-5",children:[M.jsxs("h3",{"code-path":"src\\components\\modules\\Dashboard.tsx:280:9",className:"text-sm font-semibold text-white flex items-center gap-2",children:[M.jsx(fL,{"code-path":"src\\components\\modules\\Dashboard.tsx:281:11",className:"w-4 h-4 text-blue-400"}),"Sentiment Thermometer"]}),M.jsx(cK,{"code-path":"src\\components\\modules\\Dashboard.tsx:284:9"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:288:7",className:"relative h-7 rounded-full overflow-hidden mb-4",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.07)"},children:[M.jsx(yt.div,{"code-path":"src\\components\\modules\\Dashboard.tsx:289:9",className:"absolute left-0 top-0 h-full rounded-full",style:{background:"linear-gradient(90deg, #1d4ed8, #3b82f6, #60a5fa)",boxShadow:"0 0 20px rgba(59,130,246,0.6)"},initial:{width:0},animate:{width:`${t}%`},transition:{duration:1.1,delay:e+.3,ease:[.4,0,.2,1]}}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:299:9",className:"absolute inset-0 flex items-center justify-center",children:M.jsxs("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:300:11",className:"text-white text-sm font-semibold drop-shadow",children:[t,"%"]})})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:304:7",className:"flex items-center justify-between",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:305:9",className:"text-xs",style:{color:"rgba(148,163,184,0.6)"},children:"Showroom Vibe"}),M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:306:9",className:"text-xs font-semibold",style:{color:r},children:n})]})]})}function pAe({delay:t=0}){const{metrics:e}=ao(),{systemHealth:n}=e,r=[{label:"CPU",value:n.cpu,stroke:"#3b82f6",glow:"rgba(59,130,246,0.6)"},{label:"GPU",value:n.gpu,stroke:"#818cf8",glow:"rgba(129,140,248,0.6)"},{label:"Memory",value:n.memory,stroke:"#22d3ee",glow:"rgba(34,211,238,0.6)"},{label:"Temp",value:n.temperature,stroke:"#4ade80",glow:"rgba(74,222,128,0.6)",suffix:"°"}],i=24,a=2*Math.PI*i;return M.jsxs(sy,{"code-path":"src\\components\\modules\\Dashboard.tsx:328:5",delay:t,colSpan:2,children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:330:7",className:"absolute -bottom-10 left-0 w-1/2 h-40 pointer-events-none",style:{background:"radial-gradient(ellipse at 0% 100%, rgba(59,130,246,0.28) 0%, transparent 65%)",filter:"blur(22px)"}}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:337:7",className:"absolute -bottom-10 right-0 w-1/2 h-40 pointer-events-none",style:{background:"radial-gradient(ellipse at 100% 100%, rgba(34,211,238,0.22) 0%, transparent 65%)",filter:"blur(22px)"}}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:344:7",className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-48 h-28 pointer-events-none",style:{background:"radial-gradient(ellipse at 50% 100%, rgba(129,140,248,0.15) 0%, transparent 70%)",filter:"blur(18px)"}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:351:7",className:"flex items-center justify-between mb-5",children:[M.jsxs("h3",{"code-path":"src\\components\\modules\\Dashboard.tsx:352:9",className:"text-sm font-semibold text-white flex items-center gap-2",children:[M.jsx(jae,{"code-path":"src\\components\\modules\\Dashboard.tsx:353:11",className:"w-4 h-4 text-blue-400"}),"System Health"]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:356:9",className:"flex items-center gap-2",children:[M.jsx(yt.div,{"code-path":"src\\components\\modules\\Dashboard.tsx:357:11",className:"w-1.5 h-1.5 rounded-full bg-green-400",animate:{opacity:[1,.3,1]},transition:{repeat:1/0,duration:1.6}}),M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:362:11",className:"text-xs font-medium text-green-400",children:"Optimal"})]})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:366:7",className:"grid grid-cols-4 gap-3",children:r.map((s,o)=>M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:368:11",className:"flex flex-col items-center gap-2",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:369:13",className:"relative w-14 h-14",children:[M.jsxs("svg",{"code-path":"src\\components\\modules\\Dashboard.tsx:370:15",className:"w-full h-full -rotate-90",viewBox:"0 0 56 56",children:[M.jsx("circle",{"code-path":"src\\components\\modules\\Dashboard.tsx:372:17",cx:"28",cy:"28",r:i,fill:"none",stroke:"rgba(255,255,255,0.07)",strokeWidth:"4"}),M.jsx(yt.circle,{"code-path":"src\\components\\modules\\Dashboard.tsx:374:17",cx:"28",cy:"28",r:i,fill:"none",stroke:s.stroke,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:a,initial:{strokeDashoffset:a},animate:{strokeDashoffset:a*(1-s.value/100)},transition:{duration:1.1,delay:t+.2+o*.08},style:{filter:`drop-shadow(0 0 6px ${s.glow})`}})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:389:15",className:"absolute inset-0 flex items-center justify-center",children:M.jsxs("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:390:17",className:"text-white text-xs font-semibold",children:[s.value,s.suffix??"%"]})})]}),M.jsx("p",{"code-path":"src\\components\\modules\\Dashboard.tsx:395:13",className:"text-xs",style:{color:"rgba(148,163,184,0.6)"},children:s.label})]},s.label))})]})}function mAe({delay:t=0,colSpan:e=2,rowSpan:n=2}){const{velocityData:r}=ao();return M.jsxs(sy,{"code-path":"src\\components\\modules\\Dashboard.tsx:408:5",delay:t,colSpan:e,rowSpan:n,children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:410:7",className:"absolute -bottom-10 left-1/2 -translate-x-1/2 w-full h-48 pointer-events-none",style:{background:"radial-gradient(ellipse at 50% 100%, rgba(59,130,246,0.22) 0%, transparent 60%)",filter:"blur(28px)"}}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:417:7",className:"absolute bottom-0 right-0 w-1/3 h-40 pointer-events-none",style:{background:"radial-gradient(ellipse at 100% 100%, rgba(34,211,238,0.14) 0%, transparent 65%)",filter:"blur(20px)"}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:425:7",className:"flex items-center justify-between mb-5",children:[M.jsxs("h3",{"code-path":"src\\components\\modules\\Dashboard.tsx:426:9",className:"text-sm font-semibold text-white flex items-center gap-2",children:[M.jsx(Jb,{"code-path":"src\\components\\modules\\Dashboard.tsx:427:11",className:"w-4 h-4 text-blue-400"}),"Lead Velocity"]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:430:9",className:"flex items-center gap-4 text-xs",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:431:11",className:"flex items-center gap-1.5",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:432:13",className:"w-2 h-2 rounded-full",style:{background:"#3b82f6",boxShadow:"0 0 6px #3b82f6"}}),M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:433:13",style:{color:"rgba(148,163,184,0.65)"},children:"Generated"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:435:11",className:"flex items-center gap-1.5",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:436:13",className:"w-2 h-2 rounded-full",style:{background:"#22d3ee",boxShadow:"0 0 6px #22d3ee"}}),M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:437:13",style:{color:"rgba(148,163,184,0.65)"},children:"Closed"})]})]})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:442:7",className:"h-64",children:M.jsx(Dq,{"code-path":"src\\components\\modules\\Dashboard.tsx:443:9",width:"100%",height:"100%",children:M.jsxs(uSe,{"code-path":"src\\components\\modules\\Dashboard.tsx:444:11",data:r,margin:{top:4,right:4,left:-20,bottom:0},children:[M.jsxs("defs",{"code-path":"src\\components\\modules\\Dashboard.tsx:445:13",children:[M.jsxs("linearGradient",{"code-path":"src\\components\\modules\\Dashboard.tsx:446:15",id:"gradBlue",x1:"0",y1:"0",x2:"0",y2:"1",children:[M.jsx("stop",{"code-path":"src\\components\\modules\\Dashboard.tsx:447:17",offset:"5%",stopColor:"#3b82f6",stopOpacity:.35}),M.jsx("stop",{"code-path":"src\\components\\modules\\Dashboard.tsx:448:17",offset:"95%",stopColor:"#3b82f6",stopOpacity:0})]}),M.jsxs("linearGradient",{"code-path":"src\\components\\modules\\Dashboard.tsx:450:15",id:"gradCyan",x1:"0",y1:"0",x2:"0",y2:"1",children:[M.jsx("stop",{"code-path":"src\\components\\modules\\Dashboard.tsx:451:17",offset:"5%",stopColor:"#22d3ee",stopOpacity:.28}),M.jsx("stop",{"code-path":"src\\components\\modules\\Dashboard.tsx:452:17",offset:"95%",stopColor:"#22d3ee",stopOpacity:0})]})]}),M.jsx(MX,{"code-path":"src\\components\\modules\\Dashboard.tsx:455:13",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.04)"}),M.jsx(ny,{"code-path":"src\\components\\modules\\Dashboard.tsx:456:13",dataKey:"time",stroke:"rgba(148,163,184,0.3)",fontSize:11,tickLine:!1,axisLine:!1}),M.jsx(ry,{"code-path":"src\\components\\modules\\Dashboard.tsx:457:13",stroke:"rgba(148,163,184,0.3)",fontSize:11,tickLine:!1,axisLine:!1}),M.jsx(Rl,{"code-path":"src\\components\\modules\\Dashboard.tsx:458:13",contentStyle:{backgroundColor:"rgba(8,10,18,0.92)",border:"1px solid rgba(59,130,246,0.2)",borderRadius:"10px",backdropFilter:"blur(16px)",boxShadow:"0 8px 32px rgba(0,0,0,0.5)"},labelStyle:{color:"rgba(148,163,184,0.8)",fontSize:11},itemStyle:{color:"#93c5fd",fontSize:12}}),M.jsx(sf,{"code-path":"src\\components\\modules\\Dashboard.tsx:469:13",type:"monotone",dataKey:"generated",stroke:"#3b82f6",strokeWidth:2.2,fillOpacity:1,fill:"url(#gradBlue)",style:{filter:"drop-shadow(0 0 4px rgba(59,130,246,0.5))"}}),M.jsx(sf,{"code-path":"src\\components\\modules\\Dashboard.tsx:473:13",type:"monotone",dataKey:"closed",stroke:"#22d3ee",strokeWidth:2.2,fillOpacity:1,fill:"url(#gradCyan)",style:{filter:"drop-shadow(0 0 4px rgba(34,211,238,0.5))"}})]})})})]})}function gAe({delay:t=0,colSpan:e=2,rowSpan:n=2}){const[r,i]=j.useState(""),[a,s]=j.useState([{id:"1",role:"assistant",text:'Hello, Ahmed. I have analyzed the Q3 pipeline. Would you like a refined strategy for the "Apex Innovations" deal?'}]),[o,c]=j.useState(!1),[u,h]=j.useState(!1),p=j.useRef(null),v=()=>{p.current?.scrollIntoView({behavior:"smooth"})};j.useEffect(()=>{v()},[a,o]);const y=async()=>{if(!r.trim())return;const b={id:Date.now().toString(),role:"user",text:r};s(w=>[...w,b]),i(""),c(!0),setTimeout(()=>{const w={id:(Date.now()+1).toString(),role:"assistant",text:"I've updated the probability score for Apex based on recent email sentiment. It's now at 85%. I recommend scheduling a closing meeting for next Tuesday."};s(_=>[..._,w]),c(!1)},1500)};return M.jsxs(sy,{"code-path":"src\\components\\modules\\Dashboard.tsx:528:5",delay:t,colSpan:e,rowSpan:n,className:"flex flex-col",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:529:7",className:"flex items-center justify-between mb-4 border-b border-white/5 pb-3",children:M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:530:9",className:"flex items-center gap-3",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:531:11",className:"h-8 w-8 rounded-full bg-blue-500/20 flex items-center justify-center border border-blue-500/30",children:M.jsx(vae,{"code-path":"src\\components\\modules\\Dashboard.tsx:532:13",className:"h-4 w-4 text-blue-400"})}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:534:11",children:[M.jsxs("h3",{"code-path":"src\\components\\modules\\Dashboard.tsx:535:13",className:"text-sm font-semibold text-zinc-100 flex items-center gap-2",children:["AI Onboard",M.jsx(ON,{"code-path":"src\\components\\modules\\Dashboard.tsx:537:15",className:"w-3 h-3 text-blue-400"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:539:13",className:"flex items-center gap-1.5 pl-0.5",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:540:15",className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:541:15",className:"text-[10px] text-zinc-400",children:"Online"})]})]})]})}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:547:7",className:"flex-1 overflow-y-auto space-y-4 mb-4 pr-1 min-h-[300px]",children:[a.map(b=>M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:549:11",className:`flex ${b.role==="user"?"justify-end":"justify-start"}`,children:M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:553:13",className:`max-w-[85%] rounded-2xl px-4 py-2.5 text-sm leading-relaxed ${b.role==="user"?"bg-blue-600/90 text-white rounded-tr-sm shadow-md":"bg-white/5 border border-white/10 text-zinc-200 rounded-tl-sm backdrop-blur-md"}`,children:b.text})},b.id)),o&&M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:564:11",className:"flex justify-start",children:M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:565:13",className:"bg-white/5 border border-white/10 rounded-2xl rounded-tl-sm px-4 py-3 flex items-center gap-1",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:566:15",className:"w-1.5 h-1.5 bg-zinc-500 rounded-full animate-bounce [animation-delay:-0.3s]"}),M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:567:15",className:"w-1.5 h-1.5 bg-zinc-500 rounded-full animate-bounce [animation-delay:-0.15s]"}),M.jsx("span",{"code-path":"src\\components\\modules\\Dashboard.tsx:568:15",className:"w-1.5 h-1.5 bg-zinc-500 rounded-full animate-bounce"})]})}),M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:572:9",ref:p})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:575:7",className:"relative mt-auto",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:577:9",className:"absolute pointer-events-none transition-opacity duration-300",style:{inset:"-20px -20px -20px -20px",background:"radial-gradient(ellipse 50% 60% at 50% 50%, rgba(59,130,246,0.3) 0%, transparent 70%)",filter:"blur(16px)",opacity:u?1:0,zIndex:0}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:589:9",className:`relative rounded-xl transition-all duration-300 ${u?"bg-zinc-950/80":"bg-zinc-950/40"}`,style:{border:u?"1px solid rgba(59,130,246,0.5)":"1px solid rgba(255,255,255,0.08)",boxShadow:u?"0 0 24px rgba(59,130,246,0.2)":"none",zIndex:1},children:[M.jsx(lK,{"code-path":"src\\components\\modules\\Dashboard.tsx:597:11",value:r,onChange:b=>i(b.target.value),onKeyDown:b=>b.key==="Enter"&&y(),onFocus:()=>h(!0),onBlur:()=>h(!1),placeholder:"Ask AI assistant...",className:"w-full bg-transparent border-0 focus-visible:ring-0 pr-12 h-11 text-zinc-100 placeholder:text-zinc-500"}),M.jsx(tM,{"code-path":"src\\components\\modules\\Dashboard.tsx:606:11",onClick:y,disabled:!r.trim(),size:"icon",className:`absolute right-1 top-1 h-9 w-9 transition-colors ${u?"bg-blue-600 hover:bg-blue-500":"bg-white/10 hover:bg-white/20"} text-white`,children:M.jsx(bW,{"code-path":"src\\components\\modules\\Dashboard.tsx:612:13",className:"h-4 w-4"})})]})]})]})}function vAe(){return M.jsx("section",{"code-path":"src\\components\\modules\\Dashboard.tsx:623:5",className:"p-6 h-full overflow-y-auto",children:M.jsxs("div",{"code-path":"src\\components\\modules\\Dashboard.tsx:628:7",className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-5 auto-rows-[minmax(140px,auto)] pb-8",children:[M.jsx(cAe,{"code-path":"src\\components\\modules\\Dashboard.tsx:630:9",delay:0}),M.jsx(uAe,{"code-path":"src\\components\\modules\\Dashboard.tsx:631:9",delay:.08}),M.jsx(fAe,{"code-path":"src\\components\\modules\\Dashboard.tsx:632:9",delay:.16}),M.jsx(dAe,{"code-path":"src\\components\\modules\\Dashboard.tsx:633:9",delay:.24}),M.jsx(hAe,{"code-path":"src\\components\\modules\\Dashboard.tsx:636:9",value:78,delay:.32}),M.jsx(pAe,{"code-path":"src\\components\\modules\\Dashboard.tsx:637:9",delay:.4}),M.jsx(gAe,{"code-path":"src\\components\\modules\\Dashboard.tsx:641:9",delay:.48,colSpan:2,rowSpan:2}),M.jsx(mAe,{"code-path":"src\\components\\modules\\Dashboard.tsx:644:9",delay:.56,colSpan:2,rowSpan:2})]})})}function yAe(t,e=[]){let n=[];function r(a,s){const o=j.createContext(s);o.displayName=a+"Context";const c=n.length;n=[...n,s];const u=p=>{const{scope:v,children:y,...b}=p,w=v?.[t]?.[c]||o,_=j.useMemo(()=>b,Object.values(b));return M.jsx(w.Provider,{value:_,children:y})};u.displayName=a+"Provider";function h(p,v){const y=v?.[t]?.[c]||o,b=j.useContext(y);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[u,h]}const i=()=>{const a=n.map(s=>j.createContext(s));return function(o){const c=o?.[t]||a;return j.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return i.scopeName=t,[r,xAe(i,...e)]}function xAe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:u})=>{const p=c(a)[`__scope${u}`];return{...o,...p}},{});return j.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function Hc(t){const e=j.useRef(t);return j.useEffect(()=>{e.current=t}),j.useMemo(()=>(...n)=>e.current?.(...n),[])}var Ul=globalThis?.document?j.useLayoutEffect:()=>{},bAe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],b5=bAe.reduce((t,e)=>{const n=$X(`Primitive.${e}`),r=j.forwardRef((i,a)=>{const{asChild:s,...o}=i,c=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),M.jsx(c,{...o,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),U3={exports:{}},j3={};var Q6;function _Ae(){if(Q6)return j3;Q6=1;var t=qb();function e(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,a=t.useLayoutEffect,s=t.useDebugValue;function o(p,v){var y=v(),b=r({inst:{value:y,getSnapshot:v}}),w=b[0].inst,_=b[1];return a(function(){w.value=y,w.getSnapshot=v,c(w)&&_({inst:w})},[p,y,v]),i(function(){return c(w)&&_({inst:w}),p(function(){c(w)&&_({inst:w})})},[p]),s(y),y}function c(p){var v=p.getSnapshot;p=p.value;try{var y=v();return!n(p,y)}catch{return!0}}function u(p,v){return v()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return j3.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,j3}var eG;function fK(){return eG||(eG=1,U3.exports=_Ae()),U3.exports}var SAe=fK();function AAe(){return SAe.useSyncExternalStore(wAe,()=>!0,()=>!1)}function wAe(){return()=>{}}var _5="Avatar",[MAe]=yAe(_5),[EAe,dK]=MAe(_5),hK=j.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[i,a]=j.useState("idle");return M.jsx(EAe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:M.jsx(b5.span,{...r,ref:e})})});hK.displayName=_5;var pK="AvatarImage",mK=j.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=t,s=dK(pK,n),o=TAe(r,a),c=Hc(u=>{i(u),s.onImageLoadingStatusChange(u)});return Ul(()=>{o!=="idle"&&c(o)},[o,c]),o==="loaded"?M.jsx(b5.img,{...a,ref:e,src:r}):null});mK.displayName=pK;var gK="AvatarFallback",vK=j.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...i}=t,a=dK(gK,n),[s,o]=j.useState(r===void 0);return j.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(c)}},[r]),s&&a.imageLoadingStatus!=="loaded"?M.jsx(b5.span,{...i,ref:e}):null});vK.displayName=gK;function tG(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function TAe(t,{referrerPolicy:e,crossOrigin:n}){const r=AAe(),i=j.useRef(null),a=r?(i.current||(i.current=new window.Image),i.current):null,[s,o]=j.useState(()=>tG(a,t));return Ul(()=>{o(tG(a,t))},[a,t]),Ul(()=>{const c=p=>()=>{o(p)};if(!a)return;const u=c("loaded"),h=c("error");return a.addEventListener("load",u),a.addEventListener("error",h),e&&(a.referrerPolicy=e),typeof n=="string"&&(a.crossOrigin=n),()=>{a.removeEventListener("load",u),a.removeEventListener("error",h)}},[a,n,e]),s}var CAe=hK,RAe=mK,OAe=vK;function S5({className:t,...e}){return M.jsx(CAe,{"code-path":"src\\components\\ui\\avatar.tsx:11:5","data-slot":"avatar",className:hf("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...e})}function A5({className:t,...e}){return M.jsx(RAe,{"code-path":"src\\components\\ui\\avatar.tsx:27:5","data-slot":"avatar-image",className:hf("aspect-square size-full",t),...e})}function w5({className:t,...e}){return M.jsx(OAe,{"code-path":"src\\components\\ui\\avatar.tsx:40:5","data-slot":"avatar-fallback",className:hf("bg-muted flex size-full items-center justify-center rounded-full",t),...e})}const PAe={view:"pipeline",insight:"Pipeline Velocity: Average deal cycle is 21 days, 10% faster than Q3.",summary:"Pipeline view generated for Q4 by stage.",payload:{pipeline:{"New Leads":[{id:"n1",name:"Elena Rostova",company:"Rostova Ventures",value:"$120k",avatar:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=80&q=80"},{id:"n2",name:"Mary Iluskimon",company:"Nexloop",value:"$130k",avatar:"https://images.unsplash.com/photo-1554151228-14d9def656e4?auto=format&fit=crop&w=80&q=80"}],Qualified:[{id:"q1",name:"Etlena Roya",company:"Mianaperson",value:"$120k",avatar:"https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?auto=format&fit=crop&w=80&q=80"},{id:"q2",name:"Silver Rostova",company:"Silverline Co",value:"$130k",avatar:"https://images.unsplash.com/photo-1542206395-9feb3edaa68d?auto=format&fit=crop&w=80&q=80"}],"Proposal Sent":[{id:"p1",name:"Magulanta Senneciton",company:"Senneciton",value:"$140k",avatar:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?auto=format&fit=crop&w=80&q=80"},{id:"p2",name:"Minatie Ganrison",company:"Ganrison Group",value:"$130k",avatar:"https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?auto=format&fit=crop&w=80&q=80"}],Negotiation:[{id:"g1",name:"Jomath Bilotmberg",company:"Biotmberg",value:"$130k",avatar:"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?auto=format&fit=crop&w=80&q=80"},{id:"g2",name:"Josen Oateliars",company:"Oateliars",value:"$100k",avatar:"https://images.unsplash.com/photo-1560250097-0b93528c311a?auto=format&fit=crop&w=80&q=80"}]}}},DAe={pipeline:"Show me a pipeline view by stage for Q4.",team_performance:"What's the performance of the sales team this month?",account_timeline:"Find all contacts at 'Apex Innovations' and their recent activity.",lead_map:"Give me a map of all leads in California.",calendar_tasks:"Schedule a follow-up with the top 3 high-value leads."};function JI(t){const e=t.toLowerCase();return e.includes("performance")||e.includes("team")?{view:"team_performance",insight:"Team is on track to exceed monthly quota by 15%.",summary:"Performance dashboard for current month.",payload:{revenueSeries:[{month:"Jan",revenue:10,goal:20},{month:"Feb",revenue:30,goal:35},{month:"Mar",revenue:28,goal:40},{month:"Sep",revenue:52,goal:55},{month:"Oct",revenue:56,goal:60},{month:"Nov",revenue:74,goal:70},{month:"Dec",revenue:88,goal:80}],quotaAttainment:85,team:[{id:"t1",name:"Elena Rostova",dealsClosed:12,revenueGenerated:"$1.2M",avatar:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=80&q=80"},{id:"t2",name:"Etlena Roya",dealsClosed:12,revenueGenerated:"$1.2M",avatar:"https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?auto=format&fit=crop&w=80&q=80"},{id:"t3",name:"Minatie Ganrison",dealsClosed:13,revenueGenerated:"$1.2M",avatar:"https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?auto=format&fit=crop&w=80&q=80"},{id:"t4",name:"Josen Oateliars",dealsClosed:18,revenueGenerated:"$0.8M",avatar:"https://images.unsplash.com/photo-1560250097-0b93528c311a?auto=format&fit=crop&w=80&q=80"}]}}:e.includes("apex")||e.includes("activity")||e.includes("contacts")?{view:"account_timeline",insight:"Action: Schedule a check-in call with Apex's CEO regarding the proposal.",summary:"Account history and associated contacts for Apex Innovations.",payload:{account:{name:"Apex Innovations",totalDealValue:"$4.5M",primaryContact:"Elena Rostova, CEO",industry:"Technology",contacts:[{name:"Elena Rostova",role:"CEO",avatar:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=80&q=80"},{name:"Mary Iluskimon",role:"COO",avatar:"https://images.unsplash.com/photo-1554151228-14d9def656e4?auto=format&fit=crop&w=80&q=80"},{name:"Entin Veenos",role:"VP Finance",avatar:"https://images.unsplash.com/photo-1560250097-0b93528c311a?auto=format&fit=crop&w=80&q=80"}],timeline:[{id:"a1",type:"email",title:"Email Sent",when:"Today, 10:30 AM",summary:"Proposal Follow-up"},{id:"a2",type:"meeting",title:"Meeting",when:"Yesterday, 2:00 PM",summary:"Q4 Strategy"},{id:"a3",type:"call",title:"Call Logged",when:"Yesterday, 6:20 PM",summary:"Discussed pricing"}]}}}:e.includes("map")||e.includes("california")||e.includes("geographic")?{view:"lead_map",insight:"Insight: 60% of high-value leads are concentrated in the Bay Area.",summary:"Geographic lead distribution in California.",payload:{map:{region:"California",pins:[{id:"m1",label:"SF",x:26,y:32,temperature:"warm",count:24},{id:"m2",label:"Oakland",x:29,y:35,temperature:"cold",count:19},{id:"m3",label:"San Jose",x:32,y:42,temperature:"hot"},{id:"m4",label:"LA",x:44,y:78,temperature:"warm",count:8},{id:"m5",label:"San Diego",x:46,y:88,temperature:"cold"},{id:"m6",label:"Sacramento",x:36,y:28,temperature:"hot"}]}}}:e.includes("schedule")||e.includes("calendar")||e.includes("follow-up")?{view:"calendar_tasks",insight:"Scheduling: Proposed times minimize conflicts and align with contact's preferred hours.",summary:"Weekly calendar and follow-up actions generated.",payload:{calendar:{weekLabel:"Week 21",events:[{id:"c1",day:"Mon",time:"10:00",title:"Elena Rostova"},{id:"c2",day:"Tue",time:"12:00",title:"Appointments"},{id:"c3",day:"Wed",time:"13:00",title:"Follow-up",suggested:!0},{id:"c4",day:"Thu",time:"14:00",title:"Meeting"},{id:"c5",day:"Fri",time:"12:00",title:"Follow-up",suggested:!0}],tasks:[{id:"k1",title:"Follow-up",subtitle:"Elena Rostova",due:"Due Today"},{id:"k2",title:"Prepare Proposal",subtitle:"Apex Innovations",due:"Due Tomorrow"},{id:"k3",title:"Confirm Slot",subtitle:"Mr. Kapoor",due:"Due Today"}]}}}:PAe}async function NAe(t){return t.preferredView?JI(DAe[t.preferredView]):JI(t.prompt)}const z3="Show me a pipeline view by stage for Q4.",nG={pipeline:"Pipeline",team_performance:"Team Performance",account_timeline:"Account Timeline",lead_map:"Lead Map",calendar_tasks:"Calendar and Tasks"},rG=[{view:"pipeline",label:"Kanban Pipeline",samplePrompt:"Show me a pipeline view by stage for Q4."},{view:"team_performance",label:"Team Performance",samplePrompt:"What's the performance of the sales team this month?"},{view:"account_timeline",label:"Account Timeline",samplePrompt:"Find all contacts at 'Apex Innovations' and their recent activity."},{view:"lead_map",label:"Geographic Lead Map",samplePrompt:"Give me a map of all leads in California."},{view:"calendar_tasks",label:"Calendar and Tasks",samplePrompt:"Schedule a follow-up with the top 3 high-value leads."}],IAe={background:"rgba(10, 12, 20, 0.70)",border:"1px solid rgba(59,130,246,0.15)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",boxShadow:"0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03)",borderRadius:"16px"},zE={background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.05)",borderRadius:"12px",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},M5={background:"rgba(59,130,246,0.08)",border:"1px solid rgba(59,130,246,0.3)",boxShadow:"0 0 20px rgba(59,130,246,0.15), 0 0 0 1px rgba(59,130,246,0.1)"};function Zu({children:t,className:e=""}){return M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:67:5",className:`p-5 ${e}`,style:IAe,children:t})}function BAe({item:t}){return M.jsxs(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:76:5",layout:!0,className:"group relative p-3",style:zE,whileHover:M5,children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:83:7",className:"absolute left-0 top-3 bottom-3 w-[2px] rounded-r-full bg-blue-500 opacity-0 transition-opacity group-hover:opacity-100"}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:85:7",className:"mb-3 flex items-center gap-3 pl-1",children:[M.jsxs(S5,{"code-path":"src\\app\\oracle\\page.tsx:86:9",className:"h-9 w-9 border border-white/10",children:[M.jsx(A5,{"code-path":"src\\app\\oracle\\page.tsx:87:11",src:t.avatar,alt:t.name}),M.jsx(w5,{"code-path":"src\\app\\oracle\\page.tsx:88:11",className:"bg-zinc-800 text-zinc-400",children:t.name.slice(0,2)})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:90:9",className:"min-w-0",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:91:11",className:"truncate text-sm font-medium text-zinc-100 group-hover:text-blue-100 transition-colors",children:t.name}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:92:11",className:"truncate text-xs text-zinc-500 group-hover:text-blue-200/60 transition-colors",children:t.company})]})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:95:7",className:"pl-1",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:96:9",className:"text-[10px] uppercase tracking-wider text-zinc-500 mb-0.5",children:"Deal Value"}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:97:9",className:"text-lg font-semibold text-zinc-200 group-hover:text-white transition-colors",children:t.value})]})]})}function LAe({result:t}){const e=t.payload.pipeline??{};return M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:106:5",className:"grid gap-4 xl:grid-cols-4",children:Object.entries(e).map(([n,r])=>M.jsxs(Zu,{"code-path":"src\\app\\oracle\\page.tsx:108:9",className:"flex flex-col h-full",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:109:11",className:"mb-4 flex items-center justify-between",children:[M.jsx("h3",{"code-path":"src\\app\\oracle\\page.tsx:110:13",className:"text-sm font-medium uppercase tracking-widest text-zinc-400",children:n}),M.jsx(jE,{"code-path":"src\\app\\oracle\\page.tsx:111:13",variant:"outline",className:"border-white/10 bg-white/5 text-zinc-400 text-[10px]",children:r.length})]}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:113:11",className:"space-y-3 flex-1",children:r.map(i=>M.jsx(BAe,{"code-path":"src\\app\\oracle\\page.tsx:115:15",item:i},i.id))})]},n))})}function kAe({result:t}){const e=t.payload.revenueSeries??[],n=t.payload.quotaAttainment??0,r=t.payload.team??[];return M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:130:5",className:"space-y-4",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:131:7",className:"grid gap-4 xl:grid-cols-2",children:[M.jsxs(Zu,{"code-path":"src\\app\\oracle\\page.tsx:132:9",children:[M.jsxs("h3",{"code-path":"src\\app\\oracle\\page.tsx:133:11",className:"mb-4 text-base font-medium text-zinc-100 flex items-center gap-2",children:[M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:134:13",className:"w-1.5 h-1.5 rounded-full bg-blue-500 shadow-[0_0_8px_#3b82f6]"}),"Monthly Revenue vs. Goal"]}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:137:11",className:"h-60",children:M.jsx(Dq,{"code-path":"src\\app\\oracle\\page.tsx:138:13",width:"100%",height:"100%",children:M.jsxs(cSe,{"code-path":"src\\app\\oracle\\page.tsx:139:15",data:e,children:[M.jsx("defs",{"code-path":"src\\app\\oracle\\page.tsx:140:17",children:M.jsxs("linearGradient",{"code-path":"src\\app\\oracle\\page.tsx:141:19",id:"gradRevenue",x1:"0",y1:"0",x2:"1",y2:"0",children:[M.jsx("stop",{"code-path":"src\\app\\oracle\\page.tsx:142:21",offset:"0%",stopColor:"#3b82f6"}),M.jsx("stop",{"code-path":"src\\app\\oracle\\page.tsx:143:21",offset:"100%",stopColor:"#22d3ee"})]})}),M.jsx(ny,{"code-path":"src\\app\\oracle\\page.tsx:146:17",dataKey:"month",stroke:"#52525b",tick:{fontSize:11,fill:"#71717a"},axisLine:!1,tickLine:!1,dy:10}),M.jsx(ry,{"code-path":"src\\app\\oracle\\page.tsx:147:17",stroke:"#52525b",tick:{fontSize:11,fill:"#71717a"},axisLine:!1,tickLine:!1}),M.jsx(Rl,{"code-path":"src\\app\\oracle\\page.tsx:148:17",contentStyle:{backgroundColor:"rgba(10,12,20,0.9)",border:"1px solid rgba(59,130,246,0.2)",backdropFilter:"blur(8px)",borderRadius:"8px"},itemStyle:{color:"#e4e4e7"}}),M.jsx(Sv,{"code-path":"src\\app\\oracle\\page.tsx:157:17",type:"monotone",dataKey:"goal",stroke:"#52525b",strokeDasharray:"4 4",dot:!1,strokeWidth:1.5}),M.jsx(Sv,{"code-path":"src\\app\\oracle\\page.tsx:158:17",type:"monotone",dataKey:"revenue",stroke:"url(#gradRevenue)",strokeWidth:3,dot:{r:4,fill:"#0a0a0a",stroke:"#22d3ee",strokeWidth:2},activeDot:{r:6,fill:"#22d3ee"}})]})})})]}),M.jsxs(Zu,{"code-path":"src\\app\\oracle\\page.tsx:170:9",className:"relative overflow-hidden",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:172:11",className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-48 h-48 bg-blue-500/10 blur-3xl rounded-full pointer-events-none"}),M.jsxs("h3",{"code-path":"src\\app\\oracle\\page.tsx:174:11",className:"mb-4 text-base font-medium text-zinc-100 flex items-center gap-2",children:[M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:175:13",className:"w-1.5 h-1.5 rounded-full bg-cyan-500 shadow-[0_0_8px_#22d3ee]"}),"Quota Attainment"]}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:178:11",className:"grid h-60 place-items-center",children:M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:179:13",className:"relative h-48 w-48",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:181:15",className:"absolute inset-0 rounded-full border-[12px] border-white/5"}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:183:15",className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(from 0deg, #3b82f6, #22d3ee ${n*3.6}deg, transparent 0deg)`,maskImage:"radial-gradient(transparent 62%, black 64%)",WebkitMaskImage:"radial-gradient(transparent 62%, black 64%)",borderRadius:"50%"}}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:192:15",className:"absolute inset-0 grid place-items-center",children:M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:193:17",className:"text-center",children:[M.jsxs("p",{"code-path":"src\\app\\oracle\\page.tsx:194:19",className:"text-5xl font-bold bg-clip-text text-transparent bg-gradient-to-br from-white to-zinc-400 drop-shadow-[0_0_10px_rgba(59,130,246,0.5)]",children:[n,"%"]}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:197:19",className:"text-sm font-medium text-blue-400 uppercase tracking-wider mt-1",children:"Attained"})]})})]})})]})]}),M.jsxs(Zu,{"code-path":"src\\app\\oracle\\page.tsx:205:7",children:[M.jsxs("h3",{"code-path":"src\\app\\oracle\\page.tsx:206:9",className:"mb-4 text-base font-medium text-zinc-100 flex items-center gap-2",children:[M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:207:11",className:"w-1.5 h-1.5 rounded-full bg-indigo-500 shadow-[0_0_8px_#6366f1]"}),"Team Member Performance"]}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:210:9",className:"grid gap-3 xl:grid-cols-2",children:r.map(i=>M.jsxs(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:212:13",className:"group flex items-center justify-between gap-3 p-3",style:zE,whileHover:M5,children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:218:15",className:"flex items-center gap-3",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:219:17",className:"relative",children:[M.jsxs(S5,{"code-path":"src\\app\\oracle\\page.tsx:220:19",className:"h-10 w-10 border border-white/10 group-hover:border-blue-500/30 transition-colors",children:[M.jsx(A5,{"code-path":"src\\app\\oracle\\page.tsx:221:21",src:i.avatar,alt:i.name}),M.jsx(w5,{"code-path":"src\\app\\oracle\\page.tsx:222:21",className:"bg-zinc-800 text-zinc-400",children:i.name.slice(0,2)})]}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:224:19",className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 bg-green-500 border-2 border-zinc-950 rounded-full"})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:226:17",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:227:19",className:"text-sm font-medium text-zinc-100 group-hover:text-blue-100 transition-colors",children:i.name}),M.jsxs("p",{"code-path":"src\\app\\oracle\\page.tsx:228:19",className:"text-xs text-zinc-500 group-hover:text-blue-200/50 transition-colors",children:[i.dealsClosed," deals closed"]})]})]}),M.jsx(jE,{"code-path":"src\\app\\oracle\\page.tsx:231:15",className:"bg-blue-500/10 text-blue-300 border border-blue-500/20 px-3 py-1 font-mono group-hover:bg-blue-500/20 group-hover:border-blue-500/40 transition-all",children:i.revenueGenerated})]},i.id))})]})]})}function FAe({result:t}){const e=t.payload.account;return e?M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:247:5",className:"grid gap-4 xl:grid-cols-[1fr_1.5fr]",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:248:7",className:"space-y-4",children:[M.jsxs(Zu,{"code-path":"src\\app\\oracle\\page.tsx:249:9",className:"relative overflow-hidden",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:250:11",className:"absolute top-0 right-0 w-64 h-64 bg-blue-600/5 blur-[80px] rounded-full pointer-events-none"}),M.jsx("h3",{"code-path":"src\\app\\oracle\\page.tsx:251:11",className:"mb-1 text-sm font-medium uppercase tracking-widest text-blue-400",children:"Account Overview"}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:252:11",className:"text-3xl font-bold text-white tracking-tight mt-2 mb-4 drop-shadow-[0_0_15px_rgba(59,130,246,0.3)]",children:e.name}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:256:11",className:"space-y-4",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:257:13",className:"p-3 bg-white/5 rounded-xl border border-white/5",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:258:15",className:"text-xs text-zinc-400 uppercase tracking-wider mb-1",children:"Total Deal Value"}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:259:15",className:"text-xl font-semibold text-blue-300",children:e.totalDealValue})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:261:13",className:"grid grid-cols-2 gap-3",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:262:15",className:"p-3 bg-white/5 rounded-xl border border-white/5",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:263:17",className:"text-xs text-zinc-400 uppercase tracking-wider mb-1",children:"Primary Contact"}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:264:17",className:"text-sm font-medium text-zinc-200 truncate",children:e.primaryContact})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:266:15",className:"p-3 bg-white/5 rounded-xl border border-white/5",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:267:17",className:"text-xs text-zinc-400 uppercase tracking-wider mb-1",children:"Industry"}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:268:17",className:"text-sm font-medium text-zinc-200 truncate",children:e.industry})]})]})]})]}),M.jsxs(Zu,{"code-path":"src\\app\\oracle\\page.tsx:274:9",children:[M.jsx("h3",{"code-path":"src\\app\\oracle\\page.tsx:275:11",className:"mb-4 text-base font-medium text-zinc-100",children:"Key Stakeholders"}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:276:11",className:"space-y-2",children:e.contacts.map(n=>M.jsxs(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:278:15",className:"flex items-center gap-3 p-2.5 rounded-xl border border-white/5 bg-white/5 hover:bg-white/10 transition-colors",children:[M.jsxs(S5,{"code-path":"src\\app\\oracle\\page.tsx:282:17",className:"h-9 w-9 border border-white/10",children:[M.jsx(A5,{"code-path":"src\\app\\oracle\\page.tsx:283:19",src:n.avatar,alt:n.name}),M.jsx(w5,{"code-path":"src\\app\\oracle\\page.tsx:284:19",className:"bg-zinc-800 text-zinc-400",children:n.name.slice(0,2)})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:286:17",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:287:19",className:"text-sm font-medium text-zinc-100",children:n.name}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:288:19",className:"text-xs text-blue-300/80",children:n.role})]})]},n.name))})]})]}),M.jsxs(Zu,{"code-path":"src\\app\\oracle\\page.tsx:296:7",children:[M.jsxs("h3",{"code-path":"src\\app\\oracle\\page.tsx:297:9",className:"mb-6 text-base font-medium text-zinc-100 flex items-center gap-2",children:[M.jsx(Ex,{"code-path":"src\\app\\oracle\\page.tsx:298:11",className:"w-4 h-4 text-blue-400"}),"Activity Timeline"]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:301:9",className:"relative space-y-6 pl-6 pb-2",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:303:11",className:"absolute left-[20px] top-2 bottom-4 w-[2px] bg-gradient-to-b from-blue-500 via-cyan-500/50 to-transparent shadow-[0_0_8px_#3b82f6]"}),e.timeline.map((n,r)=>M.jsxs(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:306:13",initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:r*.1},className:"relative pl-6",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:314:15",className:"absolute -left-[5px] top-1.5 h-3.5 w-3.5 rounded-full bg-zinc-950 border-2 border-blue-400 shadow-[0_0_12px_#3b82f6] z-10"}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:316:15",className:"p-4 rounded-xl relative overflow-hidden group",style:zE,children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:321:17",className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/5 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700 ease-in-out"}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:323:17",className:"flex items-start justify-between gap-4 relative z-10",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:324:19",children:[M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:325:21",className:"inline-block px-2 py-0.5 rounded text-[10px] font-bold uppercase tracking-widest bg-blue-500/20 text-blue-300 border border-blue-500/20 mb-2",children:n.title}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:328:21",className:"text-lg font-medium text-zinc-100 leading-tight mb-1",children:n.summary})]}),M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:330:19",className:"text-xs font-mono text-zinc-500 whitespace-nowrap pt-1",children:n.when})]})]})]},n.id))]})]})]}):null}function UAe({result:t}){const e=t.payload.map;return e?M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:346:5",className:"relative min-h-[36rem] overflow-hidden rounded-2xl border border-blue-500/20 bg-zinc-950 shadow-[0_0_40px_rgba(10,12,20,0.8)]",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:348:7",className:"absolute inset-0 flex items-center justify-center opacity-60",children:M.jsx("img",{"code-path":"src\\app\\oracle\\page.tsx:349:9",src:"/us_map_dark.png",alt:"US Map",className:"w-full h-full object-contain",style:{filter:"drop-shadow(0 0 20px rgba(59,130,246,0.3))"}})}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:357:7",className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(0,0,0,0)_40%,rgba(10,12,20,0.5)_100%)]"}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:360:7",className:"absolute left-4 top-4 z-10 p-4 rounded-xl bg-zinc-900/80 backdrop-blur-md border border-white/10 shadow-lg",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:361:9",className:"text-xs font-bold uppercase tracking-widest text-zinc-400 mb-3",children:"Lead Intensity"}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:362:9",className:"space-y-2 text-sm",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:363:11",className:"flex items-center gap-2",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:364:13",className:"w-2.5 h-2.5 rounded-full bg-slate-400 shadow-[0_0_8px_rgba(148,163,184,0.6)]"}),M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:365:13",className:"text-slate-300",children:"Cold Lead"})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:367:11",className:"flex items-center gap-2",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:368:13",className:"w-2.5 h-2.5 rounded-full bg-cyan-400 shadow-[0_0_10px_rgba(34,211,238,0.8)]"}),M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:369:13",className:"text-cyan-200",children:"Warm Lead"})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:371:11",className:"flex items-center gap-2",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:372:13",className:"w-2.5 h-2.5 rounded-full bg-blue-500 shadow-[0_0_12px_rgba(59,130,246,1)] border border-white/20"}),M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:373:13",className:"text-blue-200 font-medium",children:"Hot Lead"})]})]})]}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:379:7",className:"absolute right-4 top-4 z-10",children:M.jsxs(tM,{"code-path":"src\\app\\oracle\\page.tsx:380:9",variant:"outline",className:"bg-zinc-900/80 backdrop-blur-md border-white/10 text-zinc-300 hover:bg-zinc-800 hover:text-white",children:[M.jsx(Tx,{"code-path":"src\\app\\oracle\\page.tsx:381:11",className:"w-3.5 h-3.5 mr-2 text-blue-400"}),"Map Filters"]})}),e.pins.map(n=>{const r=n.temperature==="cold"?"bg-slate-400/80 shadow-[0_0_15px_rgba(148,163,184,0.4)]":n.temperature==="warm"?"bg-cyan-400 shadow-[0_0_20px_rgba(34,211,238,0.6)]":"bg-blue-600 border-2 border-white/80 shadow-[0_0_25px_rgba(59,130,246,0.9)]";return M.jsxs(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:396:11",initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",damping:12},className:"absolute z-20 flex flex-col items-center -translate-x-1/2 -translate-y-1/2",style:{left:`${n.x}%`,top:`${n.y}%`},children:[M.jsx(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:404:13",className:`h-4 w-4 rounded-full ${r} cursor-pointer`,whileHover:{scale:1.4}}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:408:13",className:"mt-2 px-2.5 py-1 rounded-lg bg-zinc-900/90 backdrop-blur border border-blue-500/20 text-[10px] font-medium text-blue-100 whitespace-nowrap shadow-xl",children:[n.label,n.count&&M.jsxs("span",{"code-path":"src\\app\\oracle\\page.tsx:410:29",className:"ml-1 opacity-60",children:["(",n.count,")"]})]})]},n.id)})]}):null}function jAe({result:t}){const e=t.payload.calendar;if(!e)return null;const n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:425:5",className:"grid gap-4 xl:grid-cols-[1.5fr_340px]",children:[M.jsxs(Zu,{"code-path":"src\\app\\oracle\\page.tsx:426:7",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:427:9",className:"mb-4 flex items-center justify-between",children:[M.jsxs("h3",{"code-path":"src\\app\\oracle\\page.tsx:428:11",className:"text-base font-medium text-zinc-100 flex items-center gap-2",children:[M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:429:13",className:"w-1.5 h-1.5 rounded-full bg-blue-400 shadow-[0_0_8px_#60a5fa]"}),"Weekly ",e.weekLabel]}),M.jsx(tM,{"code-path":"src\\app\\oracle\\page.tsx:432:11",size:"sm",variant:"outline",className:"h-8 border-white/10 bg-white/5 hover:bg-white/10 text-zinc-300",children:"Today"})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:436:9",className:"grid grid-cols-7 gap-3",children:[n.map(r=>M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:438:13",className:"text-center text-xs font-medium uppercase tracking-wider text-zinc-500 pb-2",children:r},r)),n.map(r=>M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:443:13",className:"min-h-[16rem] rounded-xl border border-white/5 bg-zinc-950/40 p-2 transition-colors hover:bg-zinc-950/60 hover:border-blue-500/20",children:M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:444:15",className:"space-y-2",children:e.events.filter(i=>i.day===r).map(i=>M.jsxs(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:448:21",layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:["rounded-lg border px-2.5 py-2 text-xs backdrop-blur-md shadow-sm cursor-pointer",i.suggested?"border-indigo-500/30 bg-indigo-500/10 text-indigo-200 hover:bg-indigo-500/20":"border-blue-400/30 bg-blue-400/10 text-blue-100 hover:bg-blue-400/20"].join(" "),children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:460:23",className:"font-semibold mb-0.5",children:i.time}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:461:23",className:"opacity-90 leading-tight",children:i.title})]},i.id))})},`${r}-slot`))]})]}),M.jsxs(Zu,{"code-path":"src\\app\\oracle\\page.tsx:469:7",className:"flex flex-col",children:[M.jsxs("h3",{"code-path":"src\\app\\oracle\\page.tsx:470:9",className:"mb-4 text-base font-medium text-zinc-100 flex items-center gap-2",children:[M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:471:11",className:"w-1.5 h-1.5 rounded-full bg-cyan-400 shadow-[0_0_8px_#22d3ee]"}),"Tasks and Actions"]}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:474:9",className:"space-y-2.5 overflow-y-auto pr-1",children:e.tasks.map(r=>M.jsxs(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:476:13",layout:!0,className:"p-3.5",style:zE,whileHover:M5,children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:483:15",className:"flex justify-between items-start gap-2 mb-1",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:484:17",className:"text-sm font-medium text-zinc-100",children:r.title}),M.jsx(jE,{"code-path":"src\\app\\oracle\\page.tsx:485:17",variant:"secondary",className:"bg-zinc-800 text-zinc-400 text-[10px] h-5 px-1.5",children:"Action"})]}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:487:15",className:"text-xs text-zinc-400 mb-3 leading-relaxed",children:r.subtitle}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:488:15",className:"flex items-center justify-between",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:489:17",className:"flex items-center gap-1.5 text-xs text-blue-300",children:[M.jsx(Ex,{"code-path":"src\\app\\oracle\\page.tsx:490:19",className:"w-3 h-3"}),M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:491:19",children:r.due})]}),M.jsx(tM,{"code-path":"src\\app\\oracle\\page.tsx:493:17",size:"sm",className:"h-7 text-xs bg-blue-600 hover:bg-blue-500 text-white border-none shadow-[0_0_10px_rgba(37,99,235,0.4)]",children:"Schedule"})]})]},r.id))})]})]})}function zAe({result:t}){return t.view==="pipeline"?M.jsx(LAe,{"code-path":"src\\app\\oracle\\page.tsx:507:42",result:t}):t.view==="team_performance"?M.jsx(kAe,{"code-path":"src\\app\\oracle\\page.tsx:508:50",result:t}):t.view==="account_timeline"?M.jsx(FAe,{"code-path":"src\\app\\oracle\\page.tsx:509:50",result:t}):t.view==="lead_map"?M.jsx(UAe,{"code-path":"src\\app\\oracle\\page.tsx:510:42",result:t}):M.jsx(jAe,{"code-path":"src\\app\\oracle\\page.tsx:511:10",result:t})}function GAe(){const[t,e]=j.useState(z3),[n,r]=j.useState("pipeline"),[i,a]=j.useState(!1),[s,o]=j.useState(!1),[c,u]=j.useState(!1),[h,p]=j.useState([{role:"user",content:z3}]),[v,y]=j.useState(JI(z3)),b=j.useMemo(()=>`${v.view}-${v.summary}`,[v.view,v.summary]),w=()=>{const T=window,P=T.SpeechRecognition??T.webkitSpeechRecognition;if(!P)return;const R=new P;R.lang="en-US",R.interimResults=!1,R.onstart=()=>u(!0),R.onend=()=>u(!1),R.onerror=()=>u(!1),R.onresult=D=>{const I=D.results[0][0].transcript;e(I)},R.start()},_=async()=>{const T=t.trim();if(!T||s)return;o(!0);const R=`[UI Direction: ${nG[n]}] ${T}`,D=[...h,{role:"user",content:T}];p(D);try{const I=await NAe({prompt:R,history:D,mode:"cot-rag",preferredView:n});y(I),p(k=>[...k,{role:"assistant",content:I.summary}])}catch{p(I=>[...I,{role:"assistant",content:"Could not reach COT-RAG endpoint. Showing cached intelligent view."}])}finally{o(!1)}},E=v.view==="pipeline"?fse:v.view==="team_performance"?Cx:v.view==="account_timeline"?kA:v.view==="lead_map"?Tx:Ex;return M.jsxs("section",{"code-path":"src\\app\\oracle\\page.tsx:588:5",className:"relative flex flex-col rounded-3xl border border-white/10 bg-zinc-950 text-zinc-100",style:{minHeight:"calc(100vh - 80px)"},children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:593:7",className:"pointer-events-none absolute inset-0 rounded-3xl bg-[radial-gradient(circle_at_30%_0%,rgba(14,116,144,0.15),transparent_40%),radial-gradient(circle_at_70%_100%,rgba(59,130,246,0.10),transparent_35%)]"}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:596:7",className:"relative z-10 px-4 pt-4 pb-3",children:M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:597:9",className:"flex items-stretch rounded-2xl overflow-hidden",style:{background:"linear-gradient(135deg, rgba(23,37,84,0.55) 0%, rgba(10,12,20,0.88) 100%)",border:"1px solid rgba(59,130,246,0.20)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",boxShadow:"0 0 0 1px rgba(59,130,246,0.07), 0 4px 24px rgba(0,0,0,0.45)"},children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:608:11",className:"w-[3px] flex-shrink-0",style:{background:"linear-gradient(180deg, #93c5fd 0%, #3b82f6 55%, rgba(59,130,246,0.25) 100%)"}}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:614:11",className:"flex items-center justify-between flex-1 px-4 py-3 min-w-0 gap-4",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:615:13",className:"min-w-0",children:[M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:616:15",className:"text-[10px] font-semibold uppercase tracking-widest text-blue-400 mb-0.5",children:"AI Insight"}),M.jsx("p",{"code-path":"src\\app\\oracle\\page.tsx:617:15",className:"text-sm text-zinc-200 leading-snug",children:v.insight})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:619:13",className:"flex items-center gap-2 flex-shrink-0",children:[M.jsx(E,{"code-path":"src\\app\\oracle\\page.tsx:620:15",className:"h-3.5 w-3.5 text-blue-400"}),M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:621:15",className:"text-xs font-medium text-blue-300 whitespace-nowrap",children:nG[v.view]})]})]})]})}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:628:7",className:"relative z-10 flex-1 overflow-y-auto px-4 pb-28",children:M.jsx(Bs,{"code-path":"src\\app\\oracle\\page.tsx:629:9",mode:"wait",children:M.jsx(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:630:11",initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.22},children:M.jsx(zAe,{"code-path":"src\\app\\oracle\\page.tsx:637:13",result:v})},b)})}),M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:643:7",className:"absolute inset-x-0 bottom-4 z-30 flex justify-center px-4",children:M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:644:9",className:"relative w-full max-w-3xl",children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:647:11",className:"absolute pointer-events-none",style:{inset:"-28px",background:"radial-gradient(ellipse 50% 80% at 8% 50%, rgba(59,130,246,0.32) 0%, transparent 70%), radial-gradient(ellipse 50% 80% at 92% 50%, rgba(99,102,241,0.38) 0%, transparent 70%)",filter:"blur(22px)",borderRadius:"32px",zIndex:-1}}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:659:11",className:"rounded-2xl",style:{background:"rgba(10, 11, 16, 0.95)",border:"1px solid rgba(255,255,255,0.11)",backdropFilter:"blur(32px)",WebkitBackdropFilter:"blur(32px)",boxShadow:"0 0 0 1px rgba(255,255,255,0.04), 0 8px 32px rgba(0,0,0,0.6)"},children:[M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:670:13",className:"px-4 pt-3.5 pb-1",children:M.jsx(lK,{"code-path":"src\\app\\oracle\\page.tsx:671:15",value:t,onChange:T=>e(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),_())},placeholder:"Ask Oracle anything…",className:"border-0 bg-transparent text-[15px] text-zinc-100 placeholder:text-zinc-500 focus-visible:ring-0 px-0 h-auto py-0"})}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:686:13",className:"flex items-center justify-between px-3 pb-3 pt-2",children:[M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:689:15",className:"relative",children:[M.jsxs("button",{"code-path":"src\\app\\oracle\\page.tsx:690:17",type:"button",onClick:()=>a(T=>!T),className:"flex items-center gap-2 rounded-full px-3 py-1.5 text-xs font-medium transition-all",style:{background:"rgba(59,130,246,0.15)",color:"#93c5fd",border:"1px solid rgba(59,130,246,0.3)"},children:[n==="pipeline"&&M.jsx(a4,{"code-path":"src\\app\\oracle\\page.tsx:696:51",className:"h-3 w-3"}),n==="team_performance"&&M.jsx(Cx,{"code-path":"src\\app\\oracle\\page.tsx:697:59",className:"h-3 w-3"}),n==="account_timeline"&&M.jsx(kA,{"code-path":"src\\app\\oracle\\page.tsx:698:59",className:"h-3 w-3"}),n==="lead_map"&&M.jsx(Tx,{"code-path":"src\\app\\oracle\\page.tsx:699:51",className:"h-3 w-3"}),n==="calendar_tasks"&&M.jsx(Ex,{"code-path":"src\\app\\oracle\\page.tsx:700:57",className:"h-3 w-3"}),M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:701:19",children:rG.find(T=>T.view===n)?.label}),M.jsx(_W,{"code-path":"src\\app\\oracle\\page.tsx:702:19",className:"h-3 w-3 transition-transform duration-200",style:{transform:i?"rotate(180deg)":"rotate(0deg)"}})]}),M.jsx(Bs,{"code-path":"src\\app\\oracle\\page.tsx:709:17",children:i&&M.jsx(yt.div,{"code-path":"src\\app\\oracle\\page.tsx:711:21",className:"absolute left-0 bottom-full mb-2 z-[999] rounded-xl min-w-[220px] py-1",style:{background:"rgb(18, 20, 30)",border:"1px solid rgba(255,255,255,0.14)",boxShadow:"0 -20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05)"},initial:{opacity:0,y:10,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.96},transition:{duration:.14,ease:"easeOut"},children:rG.map(T=>{const P=T.view===n;return M.jsxs("button",{"code-path":"src\\app\\oracle\\page.tsx:726:27",type:"button",onClick:()=>{r(T.view),e(T.samplePrompt),a(!1)},className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm text-left",style:{color:P?"#93c5fd":"#e4e4e7",background:P?"rgba(59,130,246,0.14)":"transparent",transition:"background 0.1s"},onMouseEnter:R=>{P||(R.currentTarget.style.background="rgba(255,255,255,0.06)")},onMouseLeave:R=>{P||(R.currentTarget.style.background="transparent")},children:[T.view==="pipeline"&&M.jsx(a4,{"code-path":"src\\app\\oracle\\page.tsx:747:58",className:"h-4 w-4 flex-shrink-0"}),T.view==="team_performance"&&M.jsx(Cx,{"code-path":"src\\app\\oracle\\page.tsx:748:66",className:"h-4 w-4 flex-shrink-0"}),T.view==="account_timeline"&&M.jsx(kA,{"code-path":"src\\app\\oracle\\page.tsx:749:66",className:"h-4 w-4 flex-shrink-0"}),T.view==="lead_map"&&M.jsx(Tx,{"code-path":"src\\app\\oracle\\page.tsx:750:58",className:"h-4 w-4 flex-shrink-0"}),T.view==="calendar_tasks"&&M.jsx(Ex,{"code-path":"src\\app\\oracle\\page.tsx:751:64",className:"h-4 w-4 flex-shrink-0"}),M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:752:29",children:T.label})]},T.view)})})}),i&&M.jsx("div",{"code-path":"src\\app\\oracle\\page.tsx:762:19",className:"fixed inset-0 z-[998]",onClick:()=>a(!1)})]}),M.jsxs("div",{"code-path":"src\\app\\oracle\\page.tsx:767:15",className:"flex items-center gap-2 ml-2 flex-shrink-0",children:[M.jsxs(yt.button,{"code-path":"src\\app\\oracle\\page.tsx:768:17",type:"button",onClick:w,className:"flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs",style:c?{background:"rgba(239,68,68,0.18)",color:"#fca5a5",border:"1px solid rgba(239,68,68,0.35)"}:{background:"rgba(255,255,255,0.06)",color:"rgba(255,255,255,0.5)",border:"1px solid rgba(255,255,255,0.09)"},animate:c?{scale:[1,1.05,1]}:{scale:1},transition:c?{repeat:1/0,duration:.9}:{},children:[M.jsx(mse,{"code-path":"src\\app\\oracle\\page.tsx:779:19",className:"h-3.5 w-3.5"}),M.jsx("span",{"code-path":"src\\app\\oracle\\page.tsx:780:19",children:c?"Listening…":"Voice"})]}),M.jsx(yt.button,{"code-path":"src\\app\\oracle\\page.tsx:783:17",type:"button",onClick:()=>{_()},disabled:s,className:"h-8 w-8 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"hsl(217 91% 60%)",boxShadow:"0 0 18px hsl(217 91% 60% / 0.5)"},whileHover:{scale:1.1},whileTap:{scale:.91},children:M.jsx(Rse,{"code-path":"src\\app\\oracle\\page.tsx:792:19",className:"h-3.5 w-3.5 text-white"})})]})]})]})]})})]})}function HAe(){return M.jsx(GAe,{"code-path":"src\\components\\modules\\Oracle.tsx:4:10"})}function VAe(t,e=.4){if(t.length===0)return"";if(t.length===1)return`M ${t[0].x},${t[0].y}`;const n=[`M ${t[0].x},${t[0].y}`];for(let r=0;r<t.length-1;r++){const i=t[Math.max(r-1,0)],a=t[r],s=t[r+1],o=t[Math.min(r+2,t.length-1)],c=a.x+(s.x-i.x)/6*e*3,u=a.y+(s.y-i.y)/6*e*3,h=s.x-(o.x-a.x)/6*e*3,p=s.y-(o.y-a.y)/6*e*3;n.push(`C ${c.toFixed(2)},${u.toFixed(2)} ${h.toFixed(2)},${p.toFixed(2)} ${s.x},${s.y}`)}return n.join(" ")}function WAe(t,e,n=40){const r=e-n*2;return n+t/100*r}function qAe(t,e,n,r=40){if(e<=1)return n/2;const i=n-r*2;return r+t/(e-1)*i}const $Ae={call:kA,visit:SW,chat:hse,negotiation:Jb},G3="riverGradient";function XAe({events:t,onSelectEvent:e,selectedEventId:n}){const r=j.useRef(null),[i,a]=j.useState({width:600,height:500}),[s,o]=j.useState(null);j.useEffect(()=>{const b=r.current;if(!b)return;const w=new ResizeObserver(_=>{const{width:S,height:E}=_[0].contentRect;a({width:Math.max(S,200),height:Math.max(E,300)})});return w.observe(b),()=>w.disconnect()},[]);const{width:c,height:u}=i,h=48,p=48,v=t.map((b,w)=>({x:WAe(b.sentimentScore,c,h),y:qAe(w,t.length,u,p),ev:b})),y=VAe(v.map(b=>({x:b.x,y:b.y})),.45);return M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:56:9",ref:r,className:"relative w-full h-full overflow-hidden",children:[M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:58:13",className:"absolute inset-0 pointer-events-none",style:{backgroundImage:"linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)",backgroundSize:"32px 32px"}}),M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:67:13",className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.6) 100%)"}}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:74:13",className:"absolute bottom-2 left-0 right-0 flex justify-between px-12 pointer-events-none",children:[M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:75:17",className:"text-[10px] text-red-400/60 font-mono",children:"LOW"}),M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:76:17",className:"text-[10px] text-white/30 font-mono",children:"SENTIMENT"}),M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:77:17",className:"text-[10px] text-green-400/60 font-mono",children:"HIGH"})]}),M.jsxs("svg",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:80:13",width:c,height:u,className:"absolute inset-0",style:{overflow:"visible"},children:[M.jsxs("defs",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:86:17",children:[M.jsxs("linearGradient",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:88:21",id:G3,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[M.jsx("stop",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:89:25",offset:"0%",stopColor:"#ef4444",stopOpacity:"0.9"}),M.jsx("stop",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:90:25",offset:"40%",stopColor:"#f59e0b",stopOpacity:"0.9"}),M.jsx("stop",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:91:25",offset:"100%",stopColor:"#22c55e",stopOpacity:"0.9"})]}),M.jsxs("filter",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:95:21",id:"nodeGlow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[M.jsx("feGaussianBlur",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:96:25",stdDeviation:"4",result:"blur"}),M.jsxs("feMerge",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:97:25",children:[M.jsx("feMergeNode",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:98:29",in:"blur"}),M.jsx("feMergeNode",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:99:29",in:"SourceGraphic"})]})]}),M.jsxs("filter",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:104:21",id:"pathGlow",x:"-10%",y:"-10%",width:"120%",height:"120%",children:[M.jsx("feGaussianBlur",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:105:25",stdDeviation:"3",result:"blur"}),M.jsxs("feMerge",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:106:25",children:[M.jsx("feMergeNode",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:107:29",in:"blur"}),M.jsx("feMergeNode",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:108:29",in:"SourceGraphic"})]})]})]}),y&&M.jsx("path",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:115:21",d:y,fill:"none",stroke:`url(#${G3})`,strokeWidth:10,strokeLinecap:"round",opacity:.25,filter:"url(#pathGlow)"}),y&&M.jsx(yt.path,{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:128:21",d:y,fill:"none",stroke:`url(#${G3})`,strokeWidth:5,strokeLinecap:"round",initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{duration:1.2,ease:"easeInOut"}}),v.map(({x:b,y:w,ev:_})=>{const S=$Ae[_.type],E=s===_.id,T=n===_.id,P=E||T,R=_.sentimentScore>=70?"#22c55e":_.sentimentScore>=40?"#f59e0b":"#ef4444";return M.jsxs("g",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:153:25",children:[!P&&M.jsx(yt.circle,{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:156:33",cx:b,cy:w,r:14,fill:"none",stroke:R,strokeWidth:1,opacity:.4,animate:{r:[12,18,12],opacity:[.4,.1,.4]},transition:{duration:2.5,repeat:1/0,ease:"easeInOut"}}),M.jsx(yt.circle,{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:168:29",cx:b,cy:w,r:P?18:12,fill:`${R}22`,stroke:R,strokeWidth:P?2:1.5,style:P?{filter:`drop-shadow(0 0 8px ${R})`}:{},animate:{r:P?18:12},transition:{type:"spring",stiffness:300,damping:20},className:"cursor-pointer",onMouseEnter:()=>o(_.id),onMouseLeave:()=>o(null),onClick:()=>e(_.id)}),M.jsx("foreignObject",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:184:29",x:b-8,y:w-8,width:16,height:16,className:"pointer-events-none",children:M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:189:33",className:"w-4 h-4 flex items-center justify-center",children:fe.createElement(S,{style:{width:10,height:10,color:R,strokeWidth:2.5}})})}),E&&!T&&M.jsxs(yt.g,{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:198:33",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},transition:{duration:.15},children:[M.jsx("rect",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:203:37",x:b-60,y:w-42,width:120,height:26,rx:6,fill:"rgba(0,0,0,0.85)",stroke:R,strokeWidth:.8,strokeOpacity:.6}),M.jsx("text",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:212:37",x:b,y:w-24,textAnchor:"middle",fill:"white",fontSize:10,fontFamily:"Inter, sans-serif",fontWeight:500,children:_.title}),M.jsxs("text",{"code-path":"src\\components\\sentinel\\JourneyRiver\\RiverPath.tsx:222:37",x:b,y:w-13,textAnchor:"middle",fill:R,fontSize:8.5,fontFamily:"Inter, sans-serif",children:[_.sentimentScore,"% sentiment"]})]})]},_.id)})]})]})}function KAe({score:t}){const i=82*Math.PI,a=i*.75,s=a-t/100*a,o=t>=70?"#22c55e":t>=40?"#f59e0b":"#ef4444";return M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:20:9",className:"relative flex items-center justify-center",style:{width:100,height:100},children:[M.jsxs("svg",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:21:13",width:100,height:100,style:{transform:"rotate(135deg)"},children:[M.jsx("circle",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:23:17",cx:50,cy:50,r:41,fill:"none",stroke:"rgba(255,255,255,0.06)",strokeWidth:6,strokeDasharray:`${a} ${i}`,strokeLinecap:"round"}),M.jsx(yt.circle,{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:32:17",cx:50,cy:50,r:41,fill:"none",stroke:o,strokeWidth:6,strokeDasharray:`${a} ${i}`,strokeLinecap:"round",initial:{strokeDashoffset:a},animate:{strokeDashoffset:s},transition:{duration:.8,ease:"easeOut"},style:{filter:`drop-shadow(0 0 6px ${o})`}})]}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:46:13",className:"absolute inset-0 flex flex-col items-center justify-center",children:[M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:47:17",className:"text-xl font-bold text-white leading-none",children:t}),M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:48:17",className:"text-[9px] text-white/40 uppercase tracking-wider mt-0.5",children:"score"})]})]})}const YAe={call:"Phone Call",visit:"Site Visit",chat:"Chat Session",negotiation:"Negotiation"};function JAe({event:t,onClose:e}){const n=t&&t.sentimentScore>=70?Jb:t&&t.sentimentScore>=40?wW:TW,r=t&&t.sentimentScore>=70?"text-green-400":t&&t.sentimentScore>=40?"text-amber-400":"text-red-400";return M.jsx(Bs,{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:77:9",children:t&&M.jsx(yt.div,{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:79:17",layout:!0,initial:{width:0,opacity:0},animate:{width:"30%",opacity:1},exit:{width:0,opacity:0},transition:{type:"spring",stiffness:280,damping:30},className:"flex-shrink-0 h-full overflow-hidden border-l border-white/5",style:{background:"rgba(255,255,255,0.03)",backdropFilter:"blur(12px)"},children:M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:92:21",className:"h-full overflow-y-auto custom-scrollbar p-4 flex flex-col gap-4 min-w-[220px]",children:[M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:94:25",className:"flex items-start justify-between gap-2",children:[M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:95:29",className:"flex-1 min-w-0",children:[M.jsx("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:96:33",className:"text-[10px] uppercase tracking-widest text-white/30 mb-1",children:YAe[t.type]}),M.jsx("h4",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:99:33",className:"text-white font-semibold text-sm leading-tight truncate",children:t.title}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:102:33",className:"flex items-center gap-1 mt-1 text-white/40 text-[10px]",children:[M.jsx(Eae,{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:103:37",className:"w-3 h-3"}),t.timestamp]})]}),M.jsx("button",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:107:29",onClick:e,className:"w-7 h-7 rounded-lg bg-white/5 hover:bg-white/10 flex items-center justify-center flex-shrink-0 transition-colors",children:M.jsx(Zse,{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:111:33",className:"w-3.5 h-3.5 text-white/50"})})]}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:116:25",className:"flex flex-col items-center gap-2 py-2",children:[M.jsx(KAe,{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:117:29",score:t.sentimentScore}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:118:29",className:`flex items-center gap-1 text-xs font-medium ${r}`,children:[M.jsx(n,{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:119:33",className:"w-3.5 h-3.5"}),t.sentimentScore>=70?"High Interest":t.sentimentScore>=40?"Neutral":"Low Engagement"]})]}),M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:126:25",className:"h-px bg-white/5"}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:129:25",children:[M.jsx("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:130:29",className:"text-[10px] uppercase tracking-widest text-white/30 mb-2",children:"Summary"}),M.jsx("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:131:29",className:"text-white/70 text-xs leading-relaxed",children:t.summary})]}),t.aiInsight&&M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:136:29",className:"rounded-xl bg-blue-500/5 border border-blue-500/15 p-3",children:[M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:137:33",className:"flex items-center gap-1.5 mb-2",children:[M.jsx(xae,{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:138:37",className:"w-3.5 h-3.5 text-blue-400"}),M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:139:37",className:"text-[10px] uppercase tracking-widest text-blue-400 font-semibold",children:"AI Insight"})]}),M.jsx("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:143:33",className:"text-white/70 text-xs leading-relaxed",children:t.aiInsight})]}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:148:25",children:[M.jsx("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:149:29",className:"text-[10px] uppercase tracking-widest text-white/30 mb-2",children:"Evidence"}),M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:150:29",className:"rounded-xl overflow-hidden border border-white/5 bg-white/3 aspect-video flex items-center justify-center",children:M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:151:33",className:"text-center",children:[M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:152:37",className:"w-8 h-8 rounded-full bg-white/5 flex items-center justify-center mx-auto mb-2",children:M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:153:41",className:"text-lg",children:"📷"})}),M.jsx("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\InspectorPanel.tsx:155:37",className:"text-white/30 text-[10px]",children:t.evidenceLabel??"Camera snapshot"})]})})]})]})},t.id)})}const Q0=[{id:"c1",name:"Quantum Dynamics",initials:"QD",stage:"Negotiation",overallScore:88,events:[{id:"e1",type:"visit",timestamp:"Feb 10, 10:30 AM",sentimentScore:42,title:"Initial Showroom Visit",summary:"Client toured the main lobby and reception area. Showed moderate interest in the view from upper floors.",aiInsight:"Client lingered 4 mins near the floor plan display — a strong signal of spatial curiosity.",evidenceLabel:"Lobby cam · Frame 0:04:12"},{id:"e2",type:"call",timestamp:"Feb 12, 2:00 PM",sentimentScore:58,title:"Follow-up Call",summary:"Discussed pricing tiers and payment schedule. Client requested a custom ROI breakdown.",aiInsight:"Vocal tone analysis indicates growing confidence. Recommend sending ROI deck within 24h.",evidenceLabel:"Call recording · 18 min"},{id:"e3",type:"visit",timestamp:"Feb 14, 11:00 AM",sentimentScore:75,title:"Unit 402 Tour",summary:"Detailed walkthrough of the penthouse unit. Client spent 5 mins examining the Italian marble flooring.",aiInsight:"Dwell time on premium finishes was 3× the average. High purchase intent signal.",evidenceLabel:"Unit 402 cam · Frame 0:05:44"},{id:"e4",type:"negotiation",timestamp:"Feb 17, 4:00 PM",sentimentScore:91,title:"Contract Review",summary:"Legal team reviewed terms. Minor pushback on payment timeline. Positive overall tone.",aiInsight:"Sentiment peaked during the amenities discussion. Close probability: 87%.",evidenceLabel:"Meeting room cam · Frame 0:22:10"}]},{id:"c2",name:"Nebula Ventures",initials:"NV",stage:"Discovery",overallScore:45,events:[{id:"e5",type:"chat",timestamp:"Feb 15, 9:00 AM",sentimentScore:35,title:"WhatsApp Inquiry",summary:"Client asked about availability and pricing for 2BR units. Seemed price-sensitive.",aiInsight:"Short message length and delayed replies suggest low urgency. Nurture with value content.",evidenceLabel:"Chat log · 6 messages"},{id:"e6",type:"visit",timestamp:"Feb 16, 3:00 PM",sentimentScore:52,title:"Showroom Walk-in",summary:"Unscheduled visit. Toured the 2BR model unit. Hesitated at the pricing board.",aiInsight:"Micro-expressions detected: confusion near pricing. Suggest a tailored payment plan.",evidenceLabel:"Showroom cam · Frame 0:08:30"}]},{id:"c3",name:"Apex Industries",initials:"AI",stage:"Proposal",overallScore:68,events:[{id:"e7",type:"call",timestamp:"Feb 13, 10:00 AM",sentimentScore:60,title:"Discovery Call",summary:"Initial qualification call. Client interested in bulk purchase for corporate housing.",aiInsight:"High-value opportunity. Bulk discount framing will accelerate decision.",evidenceLabel:"Call recording · 25 min"},{id:"e8",type:"visit",timestamp:"Feb 15, 2:00 PM",sentimentScore:78,title:"Corporate Tour",summary:"Toured 3 units simultaneously with their facilities manager. Strong engagement.",aiInsight:"Facilities manager asked about smart home integration — a key buying signal.",evidenceLabel:"Floor 7 cam · Frame 0:12:05"},{id:"e9",type:"negotiation",timestamp:"Feb 18, 11:00 AM",sentimentScore:65,title:"Proposal Presentation",summary:"Presented bulk pricing proposal. Legal team raised concerns about contract clauses.",aiInsight:"Blocker identified: legal review. Recommend offering a compliance workshop.",evidenceLabel:"Boardroom cam · Frame 0:31:20"}]}];function ZAe({client:t,isActive:e,onClick:n}){const r=t.overallScore>=70?"text-green-400":t.overallScore>=40?"text-amber-400":"text-red-400";return M.jsxs(yt.button,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:117:9",onClick:n,whileHover:{x:2},className:`w-full text-left p-3 rounded-xl border transition-all relative overflow-hidden ${e?"bg-blue-500/10 border-blue-500/30":"bg-white/3 border-white/5 hover:bg-white/6 hover:border-white/10"}`,children:[e&&M.jsx(yt.div,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:126:17",layoutId:"activeClientGlow",className:"absolute inset-0 bg-blue-500/5 rounded-xl pointer-events-none",style:{boxShadow:"inset 0 0 20px rgba(59,130,246,0.1)"}}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:132:13",className:"relative flex items-center gap-2.5",children:[M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:134:17",className:`w-9 h-9 rounded-lg flex items-center justify-center text-xs font-bold flex-shrink-0 ${e?"bg-blue-500/20 text-blue-300":"bg-white/8 text-white/60"}`,children:t.initials}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:138:17",className:"flex-1 min-w-0",children:[M.jsx("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:139:21",className:"text-white text-xs font-medium truncate",children:t.name}),M.jsx("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:140:21",className:"text-white/40 text-[10px] truncate",children:t.stage})]}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:142:17",className:"flex flex-col items-end gap-1",children:[M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:143:21",className:`text-xs font-bold ${r}`,children:t.overallScore}),e&&M.jsx(Oae,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:144:34",className:"w-3 h-3 text-blue-400"})]})]}),M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:148:13",className:"mt-2 h-0.5 rounded-full bg-white/5 overflow-hidden",children:M.jsx(yt.div,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:149:17",className:`h-full rounded-full ${t.overallScore>=70?"bg-green-400":t.overallScore>=40?"bg-amber-400":"bg-red-400"}`,initial:{width:0},animate:{width:`${t.overallScore}%`},transition:{duration:.6,ease:"easeOut"}})})]})}function QAe(){const[t,e]=j.useState(Q0[0].id),[n,r]=j.useState(null),i=Q0.find(o=>o.id===t)??Q0[0],a=i.events.find(o=>o.id===n)??null,s=o=>{e(o),r(null)};return M.jsxs(yt.div,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:176:9",initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3},className:"relative w-full h-full rounded-2xl overflow-hidden flex",style:{background:"rgba(8, 10, 18, 0.82)",border:"1px solid rgba(59,130,246,0.14)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",boxShadow:"0 0 0 1px rgba(255,255,255,0.04), 0 4px 32px rgba(0,0,0,0.55), 0 0 60px rgba(59,130,246,0.06)"},children:[M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:190:13",className:"flex-shrink-0 flex flex-col border-r border-white/5",style:{width:"22%"},children:[M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:195:17",className:"p-3 border-b border-white/5 flex-shrink-0",children:M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:196:21",className:"flex items-center gap-2",children:[M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:197:25",className:"w-8 h-8 rounded-xl bg-blue-500/20 flex items-center justify-center",children:M.jsx(Kae,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:198:29",className:"w-3.5 h-3.5 text-blue-400"})}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:200:25",children:[M.jsx("h3",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:201:29",className:"text-white text-sm font-medium",children:"Journey River"}),M.jsxs("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:202:29",className:"text-white/40 text-[10px]",children:[Q0.length," clients tracked"]})]})]})}),M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:208:17",className:"flex-1 overflow-y-auto custom-scrollbar p-2 space-y-1.5",children:Q0.map(o=>M.jsx(ZAe,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:210:25",client:o,isActive:o.id===t,onClick:()=>s(o.id)},o.id))}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:220:17",className:"p-3 border-t border-white/5 flex-shrink-0",children:[M.jsx("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:221:21",className:"text-[9px] text-white/20 uppercase tracking-widest mb-1.5",children:"Sentiment Axis"}),M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:222:21",className:"h-3 rounded-full",style:{background:"linear-gradient(to right, #ef4444, #f59e0b, #22c55e)"}}),M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:225:21",className:"flex justify-between mt-1",children:[M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:226:25",className:"text-[9px] text-red-400/60",children:"Low"}),M.jsx("span",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:227:25",className:"text-[9px] text-green-400/60",children:"High"})]})]})]}),M.jsxs(yt.div,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:233:13",layout:!0,className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[M.jsxs("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:235:17",className:"px-4 py-3 border-b border-white/5 flex-shrink-0 flex items-center justify-between",children:[M.jsx(Bs,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:236:21",mode:"wait",children:M.jsxs(yt.div,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:237:25",initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{duration:.2},children:[M.jsx("h4",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:244:29",className:"text-white font-semibold text-sm",children:i.name}),M.jsxs("p",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:245:29",className:"text-white/40 text-[10px]",children:[i.events.length," events · ",i.stage]})]},t)}),M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:250:21",className:"text-[10px] text-white/30 font-mono",children:"X = Sentiment Score"})]}),M.jsx("div",{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:256:17",className:"flex-1 overflow-hidden relative",children:M.jsx(Bs,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:257:21",mode:"wait",children:M.jsx(yt.div,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:258:25",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"absolute inset-0",children:M.jsx(XAe,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:266:29",events:i.events,onSelectEvent:r,selectedEventId:n})},t)})})]}),M.jsx(JAe,{"code-path":"src\\components\\sentinel\\JourneyRiver\\index.tsx:277:13",event:a,onClose:()=>r(null)})]})}let H3=!1;const ewe={background:"rgba(8, 10, 18, 0.82)",border:"1px solid rgba(59,130,246,0.14)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",boxShadow:"0 0 0 1px rgba(255,255,255,0.04), 0 4px 32px rgba(0,0,0,0.55), 0 0 60px rgba(59,130,246,0.06)"};function qu({children:t,className:e="",delay:n=0,colSpan:r=1,rowSpan:i=1,glow:a=!1}){return M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Sentinel.tsx:53:5",className:`relative rounded-2xl p-5 overflow-hidden ${e}`,style:{gridColumn:`span ${r}`,gridRow:`span ${i}`,...ewe,...a?{boxShadow:"0 0 0 1px rgba(59,130,246,0.18), 0 8px 48px rgba(0,0,0,0.6), 0 0 80px rgba(59,130,246,0.12)"}:{}},initial:{opacity:0,y:18,scale:.97},animate:{opacity:1,y:0,scale:1},transition:{duration:.38,delay:n,ease:[.4,0,.2,1]},children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:68:7",className:"absolute inset-x-0 top-0 h-px pointer-events-none",style:{background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent)"}}),t]})}function twe({delay:t=0}){const e=[{id:"A",name:"Main Showroom",count:5,sentiment:72},{id:"B",name:"Penthouse Gallery",count:3,sentiment:85},{id:"C",name:"Amenity Deck VR",count:2,sentiment:68},{id:"D",name:"Reception",count:2,sentiment:90}];return M.jsxs(qu,{"code-path":"src\\components\\modules\\Sentinel.tsx:87:5",delay:t,className:"flex h-full flex-col",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:88:7",className:"flex items-center justify-between mb-4",children:M.jsxs("h3",{"code-path":"src\\components\\modules\\Sentinel.tsx:89:9",className:"text-white font-medium flex items-center gap-2",children:[M.jsx(dL,{"code-path":"src\\components\\modules\\Sentinel.tsx:90:11",className:"w-5 h-5 text-blue-400"}),"Zone Analytics"]})}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:95:7",className:"space-y-3 flex-1",children:e.map(n=>M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Sentinel.tsx:97:11",className:"flex items-center justify-between p-3 rounded-xl bg-white/5 hover:bg-white/10 transition-colors",whileHover:{x:4},children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:102:13",className:"flex items-center gap-3",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:103:15",className:"w-8 h-8 rounded-lg bg-blue-500/20 flex items-center justify-center",children:M.jsx("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:104:17",className:"text-blue-400 text-sm font-medium",children:n.id})}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:106:15",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:107:17",className:"text-white text-sm font-medium",children:n.name}),M.jsxs("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:108:17",className:"text-white/50 text-xs",children:[n.count," visitors"]})]})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:111:13",className:"flex items-center gap-2",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:112:15",className:`w-2 h-2 rounded-full ${n.sentiment>=80?"bg-green-500":n.sentiment>=60?"bg-blue-500":"bg-amber-500"}`}),M.jsxs("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:116:15",className:"text-white text-sm font-medium",children:[n.sentiment,"%"]})]})]},n.id))})]})}function nwe({visitors:t,delay:e=0}){const n={excited:t.filter(a=>a.sentiment==="excited").length,interested:t.filter(a=>a.sentiment==="interested").length,neutral:t.filter(a=>a.sentiment==="neutral").length,confused:t.filter(a=>a.sentiment==="confused").length,disinterested:t.filter(a=>a.sentiment==="disinterested").length},r=t.length||1,i=[{label:"Excited",count:n.excited,color:"bg-green-500",emoji:"😃"},{label:"Interested",count:n.interested,color:"bg-blue-500",emoji:"🤔"},{label:"Neutral",count:n.neutral,color:"bg-white/40",emoji:"😐"},{label:"Confused",count:n.confused,color:"bg-amber-500",emoji:"😕"},{label:"Disinterested",count:n.disinterested,color:"bg-red-500",emoji:"😴"}];return M.jsxs(qu,{"code-path":"src\\components\\modules\\Sentinel.tsx:146:5",delay:e,className:"flex flex-col",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:147:7",className:"flex items-center justify-between mb-4",children:M.jsxs("h3",{"code-path":"src\\components\\modules\\Sentinel.tsx:148:9",className:"text-white font-medium flex items-center gap-2",children:[M.jsx(fL,{"code-path":"src\\components\\modules\\Sentinel.tsx:149:11",className:"w-5 h-5 text-blue-400"}),"Sentiment Distribution"]})}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:154:7",className:"space-y-3",children:i.map(a=>M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:156:11",className:"flex items-center gap-3",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:157:13",className:"text-lg",children:a.emoji}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:158:13",className:"flex-1",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:159:15",className:"flex items-center justify-between mb-1",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:160:17",className:"text-white/70 text-sm",children:a.label}),M.jsx("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:161:17",className:"text-white text-sm",children:a.count})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:163:15",className:"h-2 bg-white/10 rounded-full overflow-hidden",children:M.jsx(yt.div,{"code-path":"src\\components\\modules\\Sentinel.tsx:164:17",className:`h-full ${a.color} rounded-full`,initial:{width:0},animate:{width:`${a.count/r*100}%`},transition:{duration:.5,ease:"easeOut"}})})]})]},a.label))})]})}function rwe({delay:t=0}){const e=[{range:"< 5 min",count:3,trend:"down"},{range:"5-15 min",count:5,trend:"up"},{range:"15-30 min",count:8,trend:"up"},{range:"> 30 min",count:4,trend:"stable"}];return M.jsxs(qu,{"code-path":"src\\components\\modules\\Sentinel.tsx:189:5",delay:t,children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:190:7",className:"flex items-center justify-between mb-4",children:M.jsxs("h3",{"code-path":"src\\components\\modules\\Sentinel.tsx:191:9",className:"text-white font-medium flex items-center gap-2",children:[M.jsx(RN,{"code-path":"src\\components\\modules\\Sentinel.tsx:192:11",className:"w-5 h-5 text-blue-400"}),"Dwell Time"]})}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:197:7",className:"grid grid-cols-2 gap-3",children:e.map(n=>M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:199:11",className:"p-3 rounded-xl bg-white/5",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:200:13",className:"flex items-center justify-between mb-2",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:201:15",className:"text-white/50 text-xs",children:n.range}),n.trend==="up"&&M.jsx(Jb,{"code-path":"src\\components\\modules\\Sentinel.tsx:202:39",className:"w-4 h-4 text-green-400"}),n.trend==="down"&&M.jsx(TW,{"code-path":"src\\components\\modules\\Sentinel.tsx:203:41",className:"w-4 h-4 text-red-400"}),n.trend==="stable"&&M.jsx(wW,{"code-path":"src\\components\\modules\\Sentinel.tsx:204:43",className:"w-4 h-4 text-white/40"})]}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:206:13",className:"text-white text-xl font-semibold",children:n.count}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:207:13",className:"text-white/40 text-xs",children:"visitors"})]},n.range))})]})}function iwe({isActive:t,message:e,delay:n=0}){return M.jsxs(qu,{"code-path":"src\\components\\modules\\Sentinel.tsx:218:5",delay:n,children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:219:7",className:"flex items-center justify-between mb-4",children:[M.jsxs("h3",{"code-path":"src\\components\\modules\\Sentinel.tsx:220:9",className:"text-white font-medium flex items-center gap-2",children:[M.jsx(PN,{"code-path":"src\\components\\modules\\Sentinel.tsx:221:11",className:"w-5 h-5 text-amber-400"}),"Alerts"]}),M.jsx("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:224:9",className:`px-2 py-1 rounded-full text-xs ${t?"bg-amber-500/20 text-amber-400":"bg-green-500/20 text-green-400"}`,children:t?"Active":"Clear"})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:230:7",style:{minHeight:88},className:"relative",children:M.jsx(Bs,{"code-path":"src\\components\\modules\\Sentinel.tsx:231:9",mode:"wait",children:t?M.jsx(yt.div,{"code-path":"src\\components\\modules\\Sentinel.tsx:233:13",className:"p-4 rounded-xl bg-amber-500/10 border border-amber-500/30",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:240:15",className:"flex items-start gap-3",children:[M.jsx(PN,{"code-path":"src\\components\\modules\\Sentinel.tsx:241:17",className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:242:17",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:243:19",className:"text-amber-400 font-medium text-sm",children:"Sentiment Alert"}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:244:19",className:"text-white/70 text-sm mt-1",children:e}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:245:19",className:"text-white/40 text-xs mt-2",children:"2 minutes ago"})]})]})},"active"):M.jsx(yt.div,{"code-path":"src\\components\\modules\\Sentinel.tsx:250:13",className:"p-4 rounded-xl bg-green-500/10 border border-green-500/30",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:257:15",className:"flex items-start gap-3",children:[M.jsx(hL,{"code-path":"src\\components\\modules\\Sentinel.tsx:258:17",className:"w-5 h-5 text-green-400 flex-shrink-0 mt-0.5"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:259:17",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:260:19",className:"text-green-400 font-medium text-sm",children:"All Clear"}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:261:19",className:"text-white/50 text-sm mt-1",children:"No alerts at this time"}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:262:19",className:"text-white/40 text-xs mt-2",children:"System nominal"})]})]})},"clear")})})]})}function awe({delay:t=0}){const e=[{id:1,client:"Quantum Dynamics",stage:"Proposal Review",sentiment:"Positive",score:92,insight:"Key decision maker showed high engagement during the VR amenity tour. Recommend emphasizing the custom penthouse integration.",urgency:"High",icon:Jb,color:"text-green-400",bg:"bg-green-500/20"},{id:2,client:"Nebula Ventures",stage:"Discovery",sentiment:"Neutral",score:45,insight:"Initial interest in the main showroom, but dwell time analysis indicates hesitation around the pricing model tier.",urgency:"Medium",icon:PN,color:"text-amber-400",bg:"bg-amber-500/20"},{id:3,client:"Apex Industries",stage:"Negotiation",sentiment:"Mixed",score:68,insight:"Detected confusion markers during the contract terms review. The legal team seems to be the blocker.",urgency:"High",icon:EW,color:"text-red-400",bg:"bg-red-500/20"},{id:4,client:"Starlight Systems",stage:"Initial Contact",sentiment:"Positive",score:78,insight:"Strong engagement with the sustainability features. Aligning the pitch with their new ESG goals will accelerate velocity.",urgency:"Low",icon:ON,color:"text-blue-400",bg:"bg-blue-500/20"}];return M.jsxs(qu,{"code-path":"src\\components\\modules\\Sentinel.tsx:327:5",delay:t,className:"flex h-full flex-col",glow:!0,children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:328:7",className:"flex items-center justify-between mb-4 flex-shrink-0",children:[M.jsxs("h3",{"code-path":"src\\components\\modules\\Sentinel.tsx:329:9",className:"text-white font-medium flex items-center gap-2 text-lg",children:[M.jsx(ON,{"code-path":"src\\components\\modules\\Sentinel.tsx:330:11",className:"w-5 h-5 text-blue-400"}),"AI Strategic Insights"]}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:333:9",className:"flex items-center gap-2",children:M.jsx("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:334:11",className:"px-2 py-0.5 bg-blue-500/10 text-blue-400 text-[10px] uppercase tracking-wider font-semibold rounded-md border border-blue-500/20",children:"Live Analysis"})})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:340:7",className:"flex-1 overflow-y-auto custom-scrollbar pr-2 grid grid-cols-1 md:grid-cols-2 gap-3 content-start",children:e.map((n,r)=>M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Sentinel.tsx:342:11",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t+r*.1},className:"group relative p-3 rounded-xl bg-white/5 border border-white/5 hover:bg-white/10 hover:border-white/10 transition-all cursor-pointer flex flex-col gap-2",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:350:13",className:"absolute inset-0 bg-blue-500/5 opacity-0 group-hover:opacity-100 transition-opacity rounded-xl pointer-events-none"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:353:13",className:"flex items-center justify-between relative z-10",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:354:15",className:"flex items-center gap-2 overflow-hidden",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:355:17",className:`w-8 h-8 rounded-lg ${n.bg} flex items-center justify-center flex-shrink-0`,children:M.jsx(n.icon,{"code-path":"src\\components\\modules\\Sentinel.tsx:356:19",className:`w-4 h-4 ${n.color}`})}),M.jsx("h4",{"code-path":"src\\components\\modules\\Sentinel.tsx:358:17",className:"text-white font-medium text-sm truncate",children:n.client})]}),M.jsx("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:360:15",className:`text-[10px] font-bold px-1.5 py-0.5 rounded ${n.score>=80?"bg-green-500/20 text-green-400":n.score>=50?"bg-amber-500/20 text-amber-400":"bg-red-500/20 text-red-400"}`,children:n.score})]}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:369:13",className:"text-white/70 text-xs leading-relaxed line-clamp-2 relative z-10 min-h-[2.5em]",children:n.insight}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:374:13",className:"mt-auto pt-2 border-t border-white/5 flex items-center justify-between text-[10px] relative z-10",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:375:15",className:"flex items-center gap-2 text-white/40",children:M.jsxs("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:376:17",className:"flex items-center gap-1",children:[M.jsx(_ae,{"code-path":"src\\components\\modules\\Sentinel.tsx:377:19",className:"w-3 h-3"})," ",n.stage]})}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:380:15",className:`flex items-center gap-1 font-medium ${n.sentiment==="Positive"?"text-green-400":n.sentiment==="Negative"?"text-red-400":"text-amber-400"}`,children:n.sentiment})]})]},n.id))})]})}function swe(){const{visitors:t,isAlertActive:e,alertMessage:n,triggerAlert:r,clearAlert:i}=ao(),[a,s]=j.useState(!H3);return j.useEffect(()=>{const o=setInterval(()=>{Math.random()>.8&&!e&&(r("Confusion detected in Zone B - Penthouse Gallery"),setTimeout(()=>i(),5e3))},1e4);return()=>clearInterval(o)},[e,r,i]),j.useEffect(()=>{if(H3)return;const o=setTimeout(()=>{H3=!0,s(!1)},280);return()=>clearTimeout(o)},[]),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:422:5",className:"space-y-6",children:M.jsx(Bs,{"code-path":"src\\components\\modules\\Sentinel.tsx:423:7",mode:"wait",children:a?M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Sentinel.tsx:425:11",className:"space-y-6",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:432:13",className:"grid grid-cols-4 gap-6",children:Array.from({length:4},(o,c)=>M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:434:17",className:"h-[156px] rounded-2xl border border-white/10 bg-white/5 skeleton-pulse"},`s-top-${c}`))}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:440:13",className:"grid grid-cols-12 gap-6",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:441:15",className:"col-span-12 lg:col-span-4 h-[340px] rounded-2xl border border-white/10 bg-white/5 skeleton-pulse"}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:442:15",className:"col-span-12 lg:col-span-8 h-[340px] rounded-2xl border border-white/10 bg-white/5 skeleton-pulse"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:444:13",className:"grid grid-cols-12 gap-6",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:445:15",className:"col-span-12 lg:col-span-4 space-y-4",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:446:17",className:"h-[220px] rounded-2xl border border-white/10 bg-white/5 skeleton-pulse"}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:447:17",className:"h-[180px] rounded-2xl border border-white/10 bg-white/5 skeleton-pulse"}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:448:17",className:"h-[130px] rounded-2xl border border-white/10 bg-white/5 skeleton-pulse"})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:450:15",className:"col-span-12 lg:col-span-8 h-[560px] rounded-2xl border border-white/10 bg-white/5 skeleton-pulse"})]})]},"sentinel-skeleton"):M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Sentinel.tsx:454:11",className:"space-y-6",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.28,ease:[.4,0,.2,1]},children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:462:13",className:"grid grid-cols-4 gap-6",children:[M.jsxs(qu,{"code-path":"src\\components\\modules\\Sentinel.tsx:463:15",delay:0,children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:464:17",className:"flex items-center justify-between mb-4",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:465:19",className:"w-10 h-10 rounded-xl bg-blue-500/20 flex items-center justify-center",children:M.jsx(Cx,{"code-path":"src\\components\\modules\\Sentinel.tsx:466:21",className:"w-5 h-5 text-blue-400"})}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:468:19",className:"flex items-center gap-1 text-green-400 text-sm",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:469:21",className:"w-2 h-2 rounded-full bg-green-500 status-pulse"}),M.jsx("span",{"code-path":"src\\components\\modules\\Sentinel.tsx:470:21",children:"Live"})]})]}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:473:17",className:"text-white/50 text-sm mb-1",children:"Active Visitors"}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:474:17",className:"text-3xl font-semibold text-white",children:t.length}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:475:17",className:"text-white/40 text-xs mt-2",children:"Currently tracked"})]}),M.jsxs(qu,{"code-path":"src\\components\\modules\\Sentinel.tsx:478:15",delay:0,children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:479:17",className:"flex items-center justify-between mb-4",children:M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:480:19",className:"w-10 h-10 rounded-xl bg-green-500/20 flex items-center justify-center",children:M.jsx(fL,{"code-path":"src\\components\\modules\\Sentinel.tsx:481:21",className:"w-5 h-5 text-green-400"})})}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:484:17",className:"text-white/50 text-sm mb-1",children:"Avg Sentiment"}),M.jsxs("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:485:17",className:"text-3xl font-semibold text-white",children:[Math.round(t.reduce((o,c)=>o+{excited:100,interested:80,neutral:50,confused:30,disinterested:10}[c.sentiment],0)/(t.length||1)),"%"]}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:493:17",className:"text-white/40 text-xs mt-2",children:"Overall mood"})]}),M.jsxs(qu,{"code-path":"src\\components\\modules\\Sentinel.tsx:496:15",delay:0,children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:497:17",className:"flex items-center justify-between mb-4",children:M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:498:19",className:"w-10 h-10 rounded-xl bg-purple-500/20 flex items-center justify-center",children:M.jsx(SW,{"code-path":"src\\components\\modules\\Sentinel.tsx:499:21",className:"w-5 h-5 text-purple-400"})})}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:502:17",className:"text-white/50 text-sm mb-1",children:"Detection Accuracy"}),M.jsxs("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:503:17",className:"text-3xl font-semibold text-white",children:[(t.reduce((o,c)=>o+c.confidence,0)/(t.length||1)*100).toFixed(0),"%"]}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:506:17",className:"text-white/40 text-xs mt-2",children:"Average confidence"})]}),M.jsxs(qu,{"code-path":"src\\components\\modules\\Sentinel.tsx:509:15",delay:0,children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:510:17",className:"flex items-center justify-between mb-4",children:M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:511:19",className:"w-10 h-10 rounded-xl bg-amber-500/20 flex items-center justify-center",children:M.jsx(hL,{"code-path":"src\\components\\modules\\Sentinel.tsx:512:21",className:"w-5 h-5 text-amber-400"})})}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:515:17",className:"text-white/50 text-sm mb-1",children:"Tracked Today"}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:516:17",className:"text-3xl font-semibold text-white",children:"47"}),M.jsx("p",{"code-path":"src\\components\\modules\\Sentinel.tsx:517:17",className:"text-white/40 text-xs mt-2",children:"Unique faces"})]})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:521:13",className:"grid grid-cols-12 items-stretch gap-6",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:522:15",className:"col-span-12 lg:col-span-4 h-[340px]",children:M.jsx(twe,{"code-path":"src\\components\\modules\\Sentinel.tsx:523:17",delay:0})}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:525:15",className:"col-span-12 lg:col-span-8 h-[340px]",children:M.jsx(awe,{"code-path":"src\\components\\modules\\Sentinel.tsx:526:17",delay:0})})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:530:13",className:"grid grid-cols-12 items-stretch gap-6",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:531:15",className:"col-span-12 lg:col-span-4 space-y-4",children:[M.jsx(nwe,{"code-path":"src\\components\\modules\\Sentinel.tsx:532:17",visitors:t,delay:0}),M.jsx(rwe,{"code-path":"src\\components\\modules\\Sentinel.tsx:533:17",delay:0}),M.jsx(iwe,{"code-path":"src\\components\\modules\\Sentinel.tsx:534:17",isActive:e,message:n,delay:0})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Sentinel.tsx:536:15",className:"col-span-12 lg:col-span-8 h-full",children:M.jsx(QAe,{"code-path":"src\\components\\modules\\Sentinel.tsx:537:17"})})]})]},"sentinel-content")})})}const s1="182",Cc={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Zh={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},yK=0,ZI=1,xK=2,owe=3,bK=0,Yg=1,Ix=2,cp=3,Vc=0,ls=1,Fo=2,Fc=0,xp=1,QI=2,eB=3,tB=4,_K=5,vd=100,SK=101,AK=102,wK=103,MK=104,EK=200,TK=201,CK=202,RK=203,nM=204,rM=205,OK=206,PK=207,DK=208,NK=209,IK=210,BK=211,LK=212,kK=213,FK=214,iM=0,aM=1,sM=2,Tp=3,oM=4,lM=5,cM=6,uM=7,o1=0,UK=1,jK=2,Wo=0,E5=1,T5=2,C5=3,GE=4,R5=5,O5=6,P5=7,nB="attached",zK="detached",HE=300,Wc=301,Cd=302,Rb=303,Ob=304,oy=306,Rd=1e3,ss=1001,Cv=1002,si=1003,VE=1004,lwe=1004,up=1005,cwe=1005,vr=1006,Jg=1007,uwe=1007,zo=1008,fwe=1008,ts=1009,D5=1010,N5=1011,Rv=1012,WE=1013,Ko=1014,os=1015,qc=1016,qE=1017,$E=1018,Ov=1020,I5=35902,B5=35899,L5=1021,k5=1022,Ba=1023,$c=1026,Sd=1027,XE=1028,l1=1029,Cp=1030,KE=1031,dwe=1032,YE=1033,Bx=33776,Lx=33777,kx=33778,Fx=33779,fM=35840,dM=35841,hM=35842,pM=35843,mM=36196,gM=37492,vM=37496,yM=37488,xM=37489,bM=37490,_M=37491,SM=37808,AM=37809,wM=37810,MM=37811,EM=37812,TM=37813,CM=37814,RM=37815,OM=37816,PM=37817,DM=37818,NM=37819,IM=37820,BM=37821,LM=36492,kM=36494,FM=36495,UM=36283,jM=36284,zM=36285,GM=36286,GK=2200,HK=2201,VK=2202,Pv=2300,Dv=2301,FA=2302,fp=2400,dp=2401,Pb=2402,JE=2500,F5=2501,WK=0,U5=1,HM=2,qK=3200,hwe=3201,pwe=3202,mwe=3203,zd=0,$K=1,zu="",Pa="srgb",Od="srgb-linear",Db="linear",ir="srgb",gwe="",vwe="rg",ywe="ga",xwe=0,Qh=7680,bwe=7681,_we=7682,Swe=7683,Awe=34055,wwe=34056,Mwe=5386,Ewe=512,Twe=513,Cwe=514,Rwe=515,Owe=516,Pwe=517,Dwe=518,rB=519,XK=512,KK=513,YK=514,ZE=515,JK=516,ZK=517,QE=518,QK=519,Nb=35044,Nwe=35048,Iwe=35040,Bwe=35045,Lwe=35049,kwe=35041,Fwe=35046,Uwe=35050,jwe=35042,zwe="100",iB="300 es",Zs=2e3,Nv=2001,Gwe={COMPUTE:"compute",RENDER:"render"},Hwe={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},Vwe={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function eY(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Wwe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Hg(t,e){return new Wwe[t](e)}function tY(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ib(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function nY(){const t=Ib("canvas");return t.style.display="block",t}const iG={};let Pd=null;function qwe(t){Pd=t}function $we(){return Pd}function Bb(...t){const e="THREE."+t.shift();Pd?Pd("log",e,...t):console.log(e,...t)}function xt(...t){const e="THREE."+t.shift();Pd?Pd("warn",e,...t):console.warn(e,...t)}function zt(...t){const e="THREE."+t.shift();Pd?Pd("error",e,...t):console.error(e,...t)}function Iv(...t){const e=t.join(" ");e in iG||(iG[e]=!0,xt(...t))}function Xwe(t,e,n){return new Promise(function(r,i){function a(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}let Yc=class{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){const r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){const r=this._listeners;if(r===void 0)return;const i=r[e];if(i!==void 0){const a=i.indexOf(n);a!==-1&&i.splice(a,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const r=n[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let a=0,s=i.length;a<s;a++)i[a].call(this,e);e.target=null}}};const Ta=["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 aG=1234567;const bp=Math.PI/180,Bv=180/Math.PI;function eo(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Ta[t&255]+Ta[t>>8&255]+Ta[t>>16&255]+Ta[t>>24&255]+"-"+Ta[e&255]+Ta[e>>8&255]+"-"+Ta[e>>16&15|64]+Ta[e>>24&255]+"-"+Ta[n&63|128]+Ta[n>>8&255]+"-"+Ta[n>>16&255]+Ta[n>>24&255]+Ta[r&255]+Ta[r>>8&255]+Ta[r>>16&255]+Ta[r>>24&255]).toLowerCase()}function tn(t,e,n){return Math.max(e,Math.min(n,t))}function j5(t,e){return(t%e+e)%e}function Kwe(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function Ywe(t,e,n){return t!==e?(n-t)/(e-t):0}function Ux(t,e,n){return(1-n)*t+n*e}function Jwe(t,e,n,r){return Ux(t,e,1-Math.exp(-n*r))}function Zwe(t,e=1){return e-Math.abs(j5(t,e*2)-e)}function Qwe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function eMe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function tMe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function nMe(t,e){return t+Math.random()*(e-t)}function rMe(t){return t*(.5-Math.random())}function iMe(t){t!==void 0&&(aG=t);let e=aG+=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 aMe(t){return t*bp}function sMe(t){return t*Bv}function oMe(t){return(t&t-1)===0&&t!==0}function lMe(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function cMe(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function uMe(t,e,n,r,i){const a=Math.cos,s=Math.sin,o=a(n/2),c=s(n/2),u=a((e+r)/2),h=s((e+r)/2),p=a((e-r)/2),v=s((e-r)/2),y=a((r-e)/2),b=s((r-e)/2);switch(i){case"XYX":t.set(o*h,c*p,c*v,o*u);break;case"YZY":t.set(c*v,o*h,c*p,o*u);break;case"ZXZ":t.set(c*p,c*v,o*h,o*u);break;case"XZX":t.set(o*h,c*b,c*y,o*u);break;case"YXY":t.set(c*y,o*h,c*b,o*u);break;case"ZYZ":t.set(c*b,c*y,o*h,o*u);break;default:xt("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function ns(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function vn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const rY={DEG2RAD:bp,RAD2DEG:Bv,generateUUID:eo,clamp:tn,euclideanModulo:j5,mapLinear:Kwe,inverseLerp:Ywe,lerp:Ux,damp:Jwe,pingpong:Zwe,smoothstep:Qwe,smootherstep:eMe,randInt:tMe,randFloat:nMe,randFloatSpread:rMe,seededRandom:iMe,degToRad:aMe,radToDeg:sMe,isPowerOfTwo:oMe,ceilPowerOfTwo:lMe,floorPowerOfTwo:cMe,setQuaternionFromProperEuler:uMe,normalize:vn,denormalize:ns};class Ve{constructor(e=0,n=0){Ve.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.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 n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+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,n){return this.x=tn(this.x,e.x,n.x),this.y=tn(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=tn(this.x,e,n),this.y=tn(this.y,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(tn(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(tn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),a=this.x-e.x,s=this.y-e.y;return this.x=a*r-s*i+e.x,this.y=a*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class gi{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,a,s,o){let c=r[i+0],u=r[i+1],h=r[i+2],p=r[i+3],v=a[s+0],y=a[s+1],b=a[s+2],w=a[s+3];if(o<=0){e[n+0]=c,e[n+1]=u,e[n+2]=h,e[n+3]=p;return}if(o>=1){e[n+0]=v,e[n+1]=y,e[n+2]=b,e[n+3]=w;return}if(p!==w||c!==v||u!==y||h!==b){let _=c*v+u*y+h*b+p*w;_<0&&(v=-v,y=-y,b=-b,w=-w,_=-_);let S=1-o;if(_<.9995){const E=Math.acos(_),T=Math.sin(E);S=Math.sin(S*E)/T,o=Math.sin(o*E)/T,c=c*S+v*o,u=u*S+y*o,h=h*S+b*o,p=p*S+w*o}else{c=c*S+v*o,u=u*S+y*o,h=h*S+b*o,p=p*S+w*o;const E=1/Math.sqrt(c*c+u*u+h*h+p*p);c*=E,u*=E,h*=E,p*=E}}e[n]=c,e[n+1]=u,e[n+2]=h,e[n+3]=p}static multiplyQuaternionsFlat(e,n,r,i,a,s){const o=r[i],c=r[i+1],u=r[i+2],h=r[i+3],p=a[s],v=a[s+1],y=a[s+2],b=a[s+3];return e[n]=o*b+h*p+c*y-u*v,e[n+1]=c*b+h*v+u*p-o*y,e[n+2]=u*b+h*y+o*v-c*p,e[n+3]=h*b-o*p-c*v-u*y,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,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,n=!0){const r=e._x,i=e._y,a=e._z,s=e._order,o=Math.cos,c=Math.sin,u=o(r/2),h=o(i/2),p=o(a/2),v=c(r/2),y=c(i/2),b=c(a/2);switch(s){case"XYZ":this._x=v*h*p+u*y*b,this._y=u*y*p-v*h*b,this._z=u*h*b+v*y*p,this._w=u*h*p-v*y*b;break;case"YXZ":this._x=v*h*p+u*y*b,this._y=u*y*p-v*h*b,this._z=u*h*b-v*y*p,this._w=u*h*p+v*y*b;break;case"ZXY":this._x=v*h*p-u*y*b,this._y=u*y*p+v*h*b,this._z=u*h*b+v*y*p,this._w=u*h*p-v*y*b;break;case"ZYX":this._x=v*h*p-u*y*b,this._y=u*y*p+v*h*b,this._z=u*h*b-v*y*p,this._w=u*h*p+v*y*b;break;case"YZX":this._x=v*h*p+u*y*b,this._y=u*y*p+v*h*b,this._z=u*h*b-v*y*p,this._w=u*h*p-v*y*b;break;case"XZY":this._x=v*h*p-u*y*b,this._y=u*y*p-v*h*b,this._z=u*h*b+v*y*p,this._w=u*h*p+v*y*b;break;default:xt("Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/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 n=e.elements,r=n[0],i=n[4],a=n[8],s=n[1],o=n[5],c=n[9],u=n[2],h=n[6],p=n[10],v=r+o+p;if(v>0){const y=.5/Math.sqrt(v+1);this._w=.25/y,this._x=(h-c)*y,this._y=(a-u)*y,this._z=(s-i)*y}else if(r>o&&r>p){const y=2*Math.sqrt(1+r-o-p);this._w=(h-c)/y,this._x=.25*y,this._y=(i+s)/y,this._z=(a+u)/y}else if(o>p){const y=2*Math.sqrt(1+o-r-p);this._w=(a-u)/y,this._x=(i+s)/y,this._y=.25*y,this._z=(c+h)/y}else{const y=2*Math.sqrt(1+p-r-o);this._w=(s-i)/y,this._x=(a+u)/y,this._y=(c+h)/y,this._z=.25*y}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return r<1e-8?(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*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(tn(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/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,n){const r=e._x,i=e._y,a=e._z,s=e._w,o=n._x,c=n._y,u=n._z,h=n._w;return this._x=r*h+s*o+i*u-a*c,this._y=i*h+s*c+a*o-r*u,this._z=a*h+s*u+r*c-i*o,this._w=s*h-r*o-i*c-a*u,this._onChangeCallback(),this}slerp(e,n){if(n<=0)return this;if(n>=1)return this.copy(e);let r=e._x,i=e._y,a=e._z,s=e._w,o=this.dot(e);o<0&&(r=-r,i=-i,a=-a,s=-s,o=-o);let c=1-n;if(o<.9995){const u=Math.acos(o),h=Math.sin(u);c=Math.sin(c*u)/h,n=Math.sin(n*u)/h,this._x=this._x*c+r*n,this._y=this._y*c+i*n,this._z=this._z*c+a*n,this._w=this._w*c+s*n,this._onChangeCallback()}else this._x=this._x*c+r*n,this._y=this._y*c+i*n,this._z=this._z*c+a*n,this._w=this._w*c+s*n,this.normalize();return this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),a=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),a*Math.sin(n),a*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ne{constructor(e=0,n=0,r=0){ne.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.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,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(sG.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(sG.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*n+a[3]*r+a[6]*i,this.y=a[1]*n+a[4]*r+a[7]*i,this.z=a[2]*n+a[5]*r+a[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,a=e.elements,s=1/(a[3]*n+a[7]*r+a[11]*i+a[15]);return this.x=(a[0]*n+a[4]*r+a[8]*i+a[12])*s,this.y=(a[1]*n+a[5]*r+a[9]*i+a[13])*s,this.z=(a[2]*n+a[6]*r+a[10]*i+a[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,a=e.x,s=e.y,o=e.z,c=e.w,u=2*(s*i-o*r),h=2*(o*n-a*i),p=2*(a*r-s*n);return this.x=n+c*u+s*p-o*h,this.y=r+c*h+o*u-a*p,this.z=i+c*p+a*h-s*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i,this.y=a[1]*n+a[5]*r+a[9]*i,this.z=a[2]*n+a[6]*r+a[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,n){return this.x=tn(this.x,e.x,n.x),this.y=tn(this.y,e.y,n.y),this.z=tn(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=tn(this.x,e,n),this.y=tn(this.y,e,n),this.z=tn(this.z,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(tn(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,a=e.z,s=n.x,o=n.y,c=n.z;return this.x=i*c-a*o,this.y=a*s-r*c,this.z=r*o-i*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return V3.copy(this).projectOnVector(e),this.sub(V3)}reflect(e){return this.sub(V3.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(tn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+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,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const V3=new ne,sG=new gi;class dn{constructor(e,n,r,i,a,s,o,c,u){dn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,a,s,o,c,u)}set(e,n,r,i,a,s,o,c,u){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=n,h[4]=a,h[5]=c,h[6]=r,h[7]=s,h[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,a=this.elements,s=r[0],o=r[3],c=r[6],u=r[1],h=r[4],p=r[7],v=r[2],y=r[5],b=r[8],w=i[0],_=i[3],S=i[6],E=i[1],T=i[4],P=i[7],R=i[2],D=i[5],I=i[8];return a[0]=s*w+o*E+c*R,a[3]=s*_+o*T+c*D,a[6]=s*S+o*P+c*I,a[1]=u*w+h*E+p*R,a[4]=u*_+h*T+p*D,a[7]=u*S+h*P+p*I,a[2]=v*w+y*E+b*R,a[5]=v*_+y*T+b*D,a[8]=v*S+y*P+b*I,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],c=e[6],u=e[7],h=e[8];return n*s*h-n*o*u-r*a*h+r*o*c+i*a*u-i*s*c}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],c=e[6],u=e[7],h=e[8],p=h*s-o*u,v=o*c-h*a,y=u*a-s*c,b=n*p+r*v+i*y;if(b===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/b;return e[0]=p*w,e[1]=(i*u-h*r)*w,e[2]=(o*r-i*s)*w,e[3]=v*w,e[4]=(h*n-i*c)*w,e[5]=(i*a-o*n)*w,e[6]=y*w,e[7]=(r*c-u*n)*w,e[8]=(s*n-r*a)*w,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,a,s,o){const c=Math.cos(a),u=Math.sin(a);return this.set(r*c,r*u,-r*(c*s+u*o)+s+e,-i*u,i*c,-i*(-u*s+c*o)+o+n,0,0,1),this}scale(e,n){return this.premultiply(W3.makeScale(e,n)),this}rotate(e){return this.premultiply(W3.makeRotation(-e)),this}translate(e,n){return this.premultiply(W3.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const W3=new dn,oG=new dn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),lG=new dn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function fMe(){const t={enabled:!0,workingColorSpace:Od,spaces:{},convert:function(i,a,s){return this.enabled===!1||a===s||!a||!s||(this.spaces[a].transfer===ir&&(i.r=Qu(i.r),i.g=Qu(i.g),i.b=Qu(i.b)),this.spaces[a].primaries!==this.spaces[s].primaries&&(i.applyMatrix3(this.spaces[a].toXYZ),i.applyMatrix3(this.spaces[s].fromXYZ)),this.spaces[s].transfer===ir&&(i.r=Zg(i.r),i.g=Zg(i.g),i.b=Zg(i.b))),i},workingToColorSpace:function(i,a){return this.convert(i,this.workingColorSpace,a)},colorSpaceToWorking:function(i,a){return this.convert(i,a,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===zu?Db:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,a=this.workingColorSpace){return i.fromArray(this.spaces[a].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,a,s){return i.copy(this.spaces[a].toXYZ).multiply(this.spaces[s].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,a){return Iv("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(i,a)},toWorkingColorSpace:function(i,a){return Iv("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(i,a)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[Od]:{primaries:e,whitePoint:r,transfer:Db,toXYZ:oG,fromXYZ:lG,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Pa},outputColorSpaceConfig:{drawingBufferColorSpace:Pa}},[Pa]:{primaries:e,whitePoint:r,transfer:ir,toXYZ:oG,fromXYZ:lG,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Pa}}}),t}const Fn=fMe();function Qu(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Zg(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let sg;class iY{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{sg===void 0&&(sg=Ib("canvas")),sg.width=e.width,sg.height=e.height;const i=sg.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=sg}return r.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Ib("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),a=i.data;for(let s=0;s<a.length;s++)a[s]=Qu(a[s]/255)*255;return r.putImageData(i,0,0),n}else if(e.data){const n=e.data.slice(0);for(let r=0;r<n.length;r++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[r]=Math.floor(Qu(n[r]/255)*255):n[r]=Qu(n[r]);return{data:n,width:e.width,height:e.height}}else return xt("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let dMe=0;class Ad{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:dMe++}),this.uuid=eo(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):typeof VideoFrame<"u"&&n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let a;if(Array.isArray(i)){a=[];for(let s=0,o=i.length;s<o;s++)i[s].isDataTexture?a.push(q3(i[s].image)):a.push(q3(i[s]))}else a=q3(i);r.url=a}return n||(e.images[this.uuid]=r),r}}function q3(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?iY.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(xt("Texture: Unable to serialize Texture."),{})}let hMe=0;const $3=new ne;class Gr extends Yc{constructor(e=Gr.DEFAULT_IMAGE,n=Gr.DEFAULT_MAPPING,r=ss,i=ss,a=vr,s=zo,o=Ba,c=ts,u=Gr.DEFAULT_ANISOTROPY,h=zu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:hMe++}),this.uuid=eo(),this.name="",this.source=new Ad(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=s,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=c,this.offset=new Ve(0,0),this.repeat=new Ve(1,1),this.center=new Ve(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new dn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize($3).x}get height(){return this.source.getSize($3).y}get depth(){return this.source.getSize($3).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const r=e[n];if(r===void 0){xt(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){xt(`Texture.setValues(): property '${n}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==HE)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Rd:e.x=e.x-Math.floor(e.x);break;case ss:e.x=e.x<0?0:1;break;case Cv: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 Rd:e.y=e.y-Math.floor(e.y);break;case ss:e.y=e.y<0?0:1;break;case Cv:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Gr.DEFAULT_IMAGE=null;Gr.DEFAULT_MAPPING=HE;Gr.DEFAULT_ANISOTROPY=1;class mr{constructor(e=0,n=0,r=0,i=1){mr.prototype.isVector4=!0,this.x=e,this.y=n,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,n,r,i){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.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 n=this.x,r=this.y,i=this.z,a=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*a,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*a,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*a,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,a;const c=e.elements,u=c[0],h=c[4],p=c[8],v=c[1],y=c[5],b=c[9],w=c[2],_=c[6],S=c[10];if(Math.abs(h-v)<.01&&Math.abs(p-w)<.01&&Math.abs(b-_)<.01){if(Math.abs(h+v)<.1&&Math.abs(p+w)<.1&&Math.abs(b+_)<.1&&Math.abs(u+y+S-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const T=(u+1)/2,P=(y+1)/2,R=(S+1)/2,D=(h+v)/4,I=(p+w)/4,k=(b+_)/4;return T>P&&T>R?T<.01?(r=0,i=.707106781,a=.707106781):(r=Math.sqrt(T),i=D/r,a=I/r):P>R?P<.01?(r=.707106781,i=0,a=.707106781):(i=Math.sqrt(P),r=D/i,a=k/i):R<.01?(r=.707106781,i=.707106781,a=0):(a=Math.sqrt(R),r=I/a,i=k/a),this.set(r,i,a,n),this}let E=Math.sqrt((_-b)*(_-b)+(p-w)*(p-w)+(v-h)*(v-h));return Math.abs(E)<.001&&(E=1),this.x=(_-b)/E,this.y=(p-w)/E,this.z=(v-h)/E,this.w=Math.acos((u+y+S-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=tn(this.x,e.x,n.x),this.y=tn(this.y,e.y,n.y),this.z=tn(this.z,e.z,n.z),this.w=tn(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=tn(this.x,e,n),this.y=tn(this.y,e,n),this.z=tn(this.z,e,n),this.w=tn(this.w,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(tn(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 z5 extends Yc{constructor(e=1,n=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:vr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},r),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=r.depth,this.scissor=new mr(0,0,e,n),this.scissorTest=!1,this.viewport=new mr(0,0,e,n);const i={width:e,height:n,depth:r.depth},a=new Gr(i);this.textures=[];const s=r.count;for(let o=0;o<s;o++)this.textures[o]=a.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(r),this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.resolveDepthBuffer=r.resolveDepthBuffer,this.resolveStencilBuffer=r.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=r.depthTexture,this.samples=r.samples,this.multiview=r.multiview}_setTextureOptions(e={}){const n={minFilter:vr,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let r=0;r<this.textures.length;r++)this.textures[r].setValues(n)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,n,r=1){if(this.width!==e||this.height!==n||this.depth!==r){this.width=e,this.height=n,this.depth=r;for(let i=0,a=this.textures.length;i<a;i++)this.textures[i].image.width=e,this.textures[i].image.height=n,this.textures[i].image.depth=r,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,r=e.textures.length;n<r;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const i=Object.assign({},e.textures[n].image);this.textures[n].source=new Ad(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class to extends z5{constructor(e=1,n=1,r={}){super(e,n,r),this.isWebGLRenderTarget=!0}}class eT extends Gr{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=si,this.minFilter=si,this.wrapR=ss,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class pMe extends to{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new eT(null,e,n,r),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class tT extends Gr{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=si,this.minFilter=si,this.wrapR=ss,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class mMe extends to{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new tT(null,e,n,r),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class Oi{constructor(e=new ne(1/0,1/0,1/0),n=new ne(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,r=e.length;n<r;n+=3)this.expandByPoint(wl.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,r=e.count;n<r;n++)this.expandByPoint(wl.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;n<r;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const r=wl.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}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,n=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(r!==void 0){const a=r.getAttribute("position");if(n===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let s=0,o=a.count;s<o;s++)e.isMesh===!0?e.getVertexPosition(s,wl):wl.fromBufferAttribute(a,s),wl.applyMatrix4(e.matrixWorld),this.expandByPoint(wl);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),RS.copy(e.boundingBox)):(r.boundingBox===null&&r.computeBoundingBox(),RS.copy(r.boundingBox)),RS.applyMatrix4(e.matrixWorld),this.union(RS)}const i=e.children;for(let a=0,s=i.length;a<s;a++)this.expandByObject(i[a],n);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,n){return n.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,wl),wl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ex),OS.subVectors(this.max,ex),og.subVectors(e.a,ex),lg.subVectors(e.b,ex),cg.subVectors(e.c,ex),id.subVectors(lg,og),ad.subVectors(cg,lg),Ih.subVectors(og,cg);let n=[0,-id.z,id.y,0,-ad.z,ad.y,0,-Ih.z,Ih.y,id.z,0,-id.x,ad.z,0,-ad.x,Ih.z,0,-Ih.x,-id.y,id.x,0,-ad.y,ad.x,0,-Ih.y,Ih.x,0];return!X3(n,og,lg,cg,OS)||(n=[1,0,0,0,1,0,0,0,1],!X3(n,og,lg,cg,OS))?!1:(PS.crossVectors(id,ad),n=[PS.x,PS.y,PS.z],X3(n,og,lg,cg,OS))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,wl).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(wl).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:(Nu[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nu[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nu[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nu[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nu[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nu[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nu[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nu[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nu),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Nu=[new ne,new ne,new ne,new ne,new ne,new ne,new ne,new ne],wl=new ne,RS=new Oi,og=new ne,lg=new ne,cg=new ne,id=new ne,ad=new ne,Ih=new ne,ex=new ne,OS=new ne,PS=new ne,Bh=new ne;function X3(t,e,n,r,i){for(let a=0,s=t.length-3;a<=s;a+=3){Bh.fromArray(t,a);const o=i.x*Math.abs(Bh.x)+i.y*Math.abs(Bh.y)+i.z*Math.abs(Bh.z),c=e.dot(Bh),u=n.dot(Bh),h=r.dot(Bh);if(Math.max(-Math.max(c,u,h),Math.min(c,u,h))>o)return!1}return!0}const gMe=new Oi,tx=new ne,K3=new ne;class Zi{constructor(e=new ne,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):gMe.setFromPoints(e).getCenter(r);let i=0;for(let a=0,s=e.length;a<s;a++)i=Math.max(i,r.distanceToSquared(e[a]));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 n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const r=this.center.distanceToSquared(e);return n.copy(e),r>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}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;tx.subVectors(e,this.center);const n=tx.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(tx,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?this.radius=Math.max(this.radius,e.radius):(K3.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(tx.copy(e.center).add(K3)),this.expandByPoint(tx.copy(e.center).sub(K3))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Iu=new ne,Y3=new ne,DS=new ne,sd=new ne,J3=new ne,NS=new ne,Z3=new ne;class Hp{constructor(e=new ne,n=new ne(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Iu)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Iu.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Iu.copy(this.origin).addScaledVector(this.direction,n),Iu.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){Y3.copy(e).add(n).multiplyScalar(.5),DS.copy(n).sub(e).normalize(),sd.copy(this.origin).sub(Y3);const a=e.distanceTo(n)*.5,s=-this.direction.dot(DS),o=sd.dot(this.direction),c=-sd.dot(DS),u=sd.lengthSq(),h=Math.abs(1-s*s);let p,v,y,b;if(h>0)if(p=s*c-o,v=s*o-c,b=a*h,p>=0)if(v>=-b)if(v<=b){const w=1/h;p*=w,v*=w,y=p*(p+s*v+2*o)+v*(s*p+v+2*c)+u}else v=a,p=Math.max(0,-(s*v+o)),y=-p*p+v*(v+2*c)+u;else v=-a,p=Math.max(0,-(s*v+o)),y=-p*p+v*(v+2*c)+u;else v<=-b?(p=Math.max(0,-(-s*a+o)),v=p>0?-a:Math.min(Math.max(-a,-c),a),y=-p*p+v*(v+2*c)+u):v<=b?(p=0,v=Math.min(Math.max(-a,-c),a),y=v*(v+2*c)+u):(p=Math.max(0,-(s*a+o)),v=p>0?a:Math.min(Math.max(-a,-c),a),y=-p*p+v*(v+2*c)+u);else v=s>0?-a:a,p=Math.max(0,-(s*v+o)),y=-p*p+v*(v+2*c)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,p),i&&i.copy(Y3).addScaledVector(DS,v),y}intersectSphere(e,n){Iu.subVectors(e.center,this.origin);const r=Iu.dot(this.direction),i=Iu.dot(Iu)-r*r,a=e.radius*e.radius;if(i>a)return null;const s=Math.sqrt(a-i),o=r-s,c=r+s;return c<0?null:o<0?this.at(c,n):this.at(o,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,a,s,o,c;const u=1/this.direction.x,h=1/this.direction.y,p=1/this.direction.z,v=this.origin;return u>=0?(r=(e.min.x-v.x)*u,i=(e.max.x-v.x)*u):(r=(e.max.x-v.x)*u,i=(e.min.x-v.x)*u),h>=0?(a=(e.min.y-v.y)*h,s=(e.max.y-v.y)*h):(a=(e.max.y-v.y)*h,s=(e.min.y-v.y)*h),r>s||a>i||((a>r||isNaN(r))&&(r=a),(s<i||isNaN(i))&&(i=s),p>=0?(o=(e.min.z-v.z)*p,c=(e.max.z-v.z)*p):(o=(e.max.z-v.z)*p,c=(e.min.z-v.z)*p),r>c||o>i)||((o>r||r!==r)&&(r=o),(c<i||i!==i)&&(i=c),i<0)?null:this.at(r>=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Iu)!==null}intersectTriangle(e,n,r,i,a){J3.subVectors(n,e),NS.subVectors(r,e),Z3.crossVectors(J3,NS);let s=this.direction.dot(Z3),o;if(s>0){if(i)return null;o=1}else if(s<0)o=-1,s=-s;else return null;sd.subVectors(this.origin,e);const c=o*this.direction.dot(NS.crossVectors(sd,NS));if(c<0)return null;const u=o*this.direction.dot(J3.cross(sd));if(u<0||c+u>s)return null;const h=-o*sd.dot(Z3);return h<0?null:this.at(h/s,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class qt{constructor(e,n,r,i,a,s,o,c,u,h,p,v,y,b,w,_){qt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,a,s,o,c,u,h,p,v,y,b,w,_)}set(e,n,r,i,a,s,o,c,u,h,p,v,y,b,w,_){const S=this.elements;return S[0]=e,S[4]=n,S[8]=r,S[12]=i,S[1]=a,S[5]=s,S[9]=o,S[13]=c,S[2]=u,S[6]=h,S[10]=p,S[14]=v,S[3]=y,S[7]=b,S[11]=w,S[15]=_,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new qt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),r.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this)}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,r=e.elements,i=1/ug.setFromMatrixColumn(e,0).length(),a=1/ug.setFromMatrixColumn(e,1).length(),s=1/ug.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*a,n[5]=r[5]*a,n[6]=r[6]*a,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,a=e.z,s=Math.cos(r),o=Math.sin(r),c=Math.cos(i),u=Math.sin(i),h=Math.cos(a),p=Math.sin(a);if(e.order==="XYZ"){const v=s*h,y=s*p,b=o*h,w=o*p;n[0]=c*h,n[4]=-c*p,n[8]=u,n[1]=y+b*u,n[5]=v-w*u,n[9]=-o*c,n[2]=w-v*u,n[6]=b+y*u,n[10]=s*c}else if(e.order==="YXZ"){const v=c*h,y=c*p,b=u*h,w=u*p;n[0]=v+w*o,n[4]=b*o-y,n[8]=s*u,n[1]=s*p,n[5]=s*h,n[9]=-o,n[2]=y*o-b,n[6]=w+v*o,n[10]=s*c}else if(e.order==="ZXY"){const v=c*h,y=c*p,b=u*h,w=u*p;n[0]=v-w*o,n[4]=-s*p,n[8]=b+y*o,n[1]=y+b*o,n[5]=s*h,n[9]=w-v*o,n[2]=-s*u,n[6]=o,n[10]=s*c}else if(e.order==="ZYX"){const v=s*h,y=s*p,b=o*h,w=o*p;n[0]=c*h,n[4]=b*u-y,n[8]=v*u+w,n[1]=c*p,n[5]=w*u+v,n[9]=y*u-b,n[2]=-u,n[6]=o*c,n[10]=s*c}else if(e.order==="YZX"){const v=s*c,y=s*u,b=o*c,w=o*u;n[0]=c*h,n[4]=w-v*p,n[8]=b*p+y,n[1]=p,n[5]=s*h,n[9]=-o*h,n[2]=-u*h,n[6]=y*p+b,n[10]=v-w*p}else if(e.order==="XZY"){const v=s*c,y=s*u,b=o*c,w=o*u;n[0]=c*h,n[4]=-p,n[8]=u*h,n[1]=v*p+w,n[5]=s*h,n[9]=y*p-b,n[2]=b*p-y,n[6]=o*h,n[10]=w*p+v}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(vMe,e,yMe)}lookAt(e,n,r){const i=this.elements;return Ws.subVectors(e,n),Ws.lengthSq()===0&&(Ws.z=1),Ws.normalize(),od.crossVectors(r,Ws),od.lengthSq()===0&&(Math.abs(r.z)===1?Ws.x+=1e-4:Ws.z+=1e-4,Ws.normalize(),od.crossVectors(r,Ws)),od.normalize(),IS.crossVectors(Ws,od),i[0]=od.x,i[4]=IS.x,i[8]=Ws.x,i[1]=od.y,i[5]=IS.y,i[9]=Ws.y,i[2]=od.z,i[6]=IS.z,i[10]=Ws.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,a=this.elements,s=r[0],o=r[4],c=r[8],u=r[12],h=r[1],p=r[5],v=r[9],y=r[13],b=r[2],w=r[6],_=r[10],S=r[14],E=r[3],T=r[7],P=r[11],R=r[15],D=i[0],I=i[4],k=i[8],B=i[12],U=i[1],z=i[5],q=i[9],W=i[13],ee=i[2],Q=i[6],V=i[10],$=i[14],Y=i[3],ie=i[7],de=i[11],X=i[15];return a[0]=s*D+o*U+c*ee+u*Y,a[4]=s*I+o*z+c*Q+u*ie,a[8]=s*k+o*q+c*V+u*de,a[12]=s*B+o*W+c*$+u*X,a[1]=h*D+p*U+v*ee+y*Y,a[5]=h*I+p*z+v*Q+y*ie,a[9]=h*k+p*q+v*V+y*de,a[13]=h*B+p*W+v*$+y*X,a[2]=b*D+w*U+_*ee+S*Y,a[6]=b*I+w*z+_*Q+S*ie,a[10]=b*k+w*q+_*V+S*de,a[14]=b*B+w*W+_*$+S*X,a[3]=E*D+T*U+P*ee+R*Y,a[7]=E*I+T*z+P*Q+R*ie,a[11]=E*k+T*q+P*V+R*de,a[15]=E*B+T*W+P*$+R*X,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],a=e[12],s=e[1],o=e[5],c=e[9],u=e[13],h=e[2],p=e[6],v=e[10],y=e[14],b=e[3],w=e[7],_=e[11],S=e[15],E=c*y-u*v,T=o*y-u*p,P=o*v-c*p,R=s*y-u*h,D=s*v-c*h,I=s*p-o*h;return n*(w*E-_*T+S*P)-r*(b*E-_*R+S*D)+i*(b*T-w*R+S*I)-a*(b*P-w*D+_*I)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,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]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],c=e[6],u=e[7],h=e[8],p=e[9],v=e[10],y=e[11],b=e[12],w=e[13],_=e[14],S=e[15],E=p*_*u-w*v*u+w*c*y-o*_*y-p*c*S+o*v*S,T=b*v*u-h*_*u-b*c*y+s*_*y+h*c*S-s*v*S,P=h*w*u-b*p*u+b*o*y-s*w*y-h*o*S+s*p*S,R=b*p*c-h*w*c-b*o*v+s*w*v+h*o*_-s*p*_,D=n*E+r*T+i*P+a*R;if(D===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/D;return e[0]=E*I,e[1]=(w*v*a-p*_*a-w*i*y+r*_*y+p*i*S-r*v*S)*I,e[2]=(o*_*a-w*c*a+w*i*u-r*_*u-o*i*S+r*c*S)*I,e[3]=(p*c*a-o*v*a-p*i*u+r*v*u+o*i*y-r*c*y)*I,e[4]=T*I,e[5]=(h*_*a-b*v*a+b*i*y-n*_*y-h*i*S+n*v*S)*I,e[6]=(b*c*a-s*_*a-b*i*u+n*_*u+s*i*S-n*c*S)*I,e[7]=(s*v*a-h*c*a+h*i*u-n*v*u-s*i*y+n*c*y)*I,e[8]=P*I,e[9]=(b*p*a-h*w*a-b*r*y+n*w*y+h*r*S-n*p*S)*I,e[10]=(s*w*a-b*o*a+b*r*u-n*w*u-s*r*S+n*o*S)*I,e[11]=(h*o*a-s*p*a-h*r*u+n*p*u+s*r*y-n*o*y)*I,e[12]=R*I,e[13]=(h*w*i-b*p*i+b*r*v-n*w*v-h*r*_+n*p*_)*I,e[14]=(b*o*i-s*w*i-b*r*c+n*w*c+s*r*_-n*o*_)*I,e[15]=(s*p*i-h*o*i+h*r*c-n*p*c-s*r*v+n*o*v)*I,this}scale(e){const n=this.elements,r=e.x,i=e.y,a=e.z;return n[0]*=r,n[4]*=i,n[8]*=a,n[1]*=r,n[5]*=i,n[9]*=a,n[2]*=r,n[6]*=i,n[10]*=a,n[3]*=r,n[7]*=i,n[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,n=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(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),a=1-r,s=e.x,o=e.y,c=e.z,u=a*s,h=a*o;return this.set(u*s+r,u*o-i*c,u*c+i*o,0,u*o+i*c,h*o+r,h*c-i*s,0,u*c-i*o,h*c+i*s,a*c*c+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,a,s){return this.set(1,r,a,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,a=n._x,s=n._y,o=n._z,c=n._w,u=a+a,h=s+s,p=o+o,v=a*u,y=a*h,b=a*p,w=s*h,_=s*p,S=o*p,E=c*u,T=c*h,P=c*p,R=r.x,D=r.y,I=r.z;return i[0]=(1-(w+S))*R,i[1]=(y+P)*R,i[2]=(b-T)*R,i[3]=0,i[4]=(y-P)*D,i[5]=(1-(v+S))*D,i[6]=(_+E)*D,i[7]=0,i[8]=(b+T)*I,i[9]=(_-E)*I,i[10]=(1-(v+w))*I,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;if(e.x=i[12],e.y=i[13],e.z=i[14],this.determinant()===0)return r.set(1,1,1),n.identity(),this;let a=ug.set(i[0],i[1],i[2]).length();const s=ug.set(i[4],i[5],i[6]).length(),o=ug.set(i[8],i[9],i[10]).length();this.determinant()<0&&(a=-a),Ml.copy(this);const u=1/a,h=1/s,p=1/o;return Ml.elements[0]*=u,Ml.elements[1]*=u,Ml.elements[2]*=u,Ml.elements[4]*=h,Ml.elements[5]*=h,Ml.elements[6]*=h,Ml.elements[8]*=p,Ml.elements[9]*=p,Ml.elements[10]*=p,n.setFromRotationMatrix(Ml),r.x=a,r.y=s,r.z=o,this}makePerspective(e,n,r,i,a,s,o=Zs,c=!1){const u=this.elements,h=2*a/(n-e),p=2*a/(r-i),v=(n+e)/(n-e),y=(r+i)/(r-i);let b,w;if(c)b=a/(s-a),w=s*a/(s-a);else if(o===Zs)b=-(s+a)/(s-a),w=-2*s*a/(s-a);else if(o===Nv)b=-s/(s-a),w=-s*a/(s-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return u[0]=h,u[4]=0,u[8]=v,u[12]=0,u[1]=0,u[5]=p,u[9]=y,u[13]=0,u[2]=0,u[6]=0,u[10]=b,u[14]=w,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,n,r,i,a,s,o=Zs,c=!1){const u=this.elements,h=2/(n-e),p=2/(r-i),v=-(n+e)/(n-e),y=-(r+i)/(r-i);let b,w;if(c)b=1/(s-a),w=s/(s-a);else if(o===Zs)b=-2/(s-a),w=-(s+a)/(s-a);else if(o===Nv)b=-1/(s-a),w=-a/(s-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return u[0]=h,u[4]=0,u[8]=0,u[12]=v,u[1]=0,u[5]=p,u[9]=0,u[13]=y,u[2]=0,u[6]=0,u[10]=b,u[14]=w,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const ug=new ne,Ml=new qt,vMe=new ne(0,0,0),yMe=new ne(1,1,1),od=new ne,IS=new ne,Ws=new ne,cG=new qt,uG=new gi;class ro{constructor(e=0,n=0,r=0,i=ro.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,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,n,r,i=this._order){return this._x=e,this._y=n,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,n=this._order,r=!0){const i=e.elements,a=i[0],s=i[4],o=i[8],c=i[1],u=i[5],h=i[9],p=i[2],v=i[6],y=i[10];switch(n){case"XYZ":this._y=Math.asin(tn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,y),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(v,u),this._z=0);break;case"YXZ":this._x=Math.asin(-tn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,y),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-p,a),this._z=0);break;case"ZXY":this._x=Math.asin(tn(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(-p,y),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-tn(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(v,y),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(tn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-p,a)):(this._x=0,this._y=Math.atan2(o,y));break;case"XZY":this._z=Math.asin(-tn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(v,u),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-h,y),this._y=0);break;default:xt("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return cG.makeRotationFromQuaternion(e),this.setFromRotationMatrix(cG,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return uG.setFromEuler(this),this.setFromQuaternion(uG,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=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+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}}ro.DEFAULT_ORDER="XYZ";class Lv{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 xMe=0;const fG=new ne,fg=new gi,Bu=new qt,BS=new ne,nx=new ne,bMe=new ne,_Me=new gi,dG=new ne(1,0,0),hG=new ne(0,1,0),pG=new ne(0,0,1),mG={type:"added"},SMe={type:"removed"},dg={type:"childadded",child:null},Q3={type:"childremoved",child:null};class zn extends Yc{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:xMe++}),this.uuid=eo(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=zn.DEFAULT_UP.clone();const e=new ne,n=new ro,r=new gi,i=new ne(1,1,1);function a(){r.setFromEuler(n,!1)}function s(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new qt},normalMatrix:{value:new dn}}),this.matrix=new qt,this.matrixWorld=new qt,this.matrixAutoUpdate=zn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=zn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Lv,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return fg.setFromAxisAngle(e,n),this.quaternion.multiply(fg),this}rotateOnWorldAxis(e,n){return fg.setFromAxisAngle(e,n),this.quaternion.premultiply(fg),this}rotateX(e){return this.rotateOnAxis(dG,e)}rotateY(e){return this.rotateOnAxis(hG,e)}rotateZ(e){return this.rotateOnAxis(pG,e)}translateOnAxis(e,n){return fG.copy(e).applyQuaternion(this.quaternion),this.position.add(fG.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(dG,e)}translateY(e){return this.translateOnAxis(hG,e)}translateZ(e){return this.translateOnAxis(pG,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Bu.copy(this.matrixWorld).invert())}lookAt(e,n,r){e.isVector3?BS.copy(e):BS.set(e,n,r);const i=this.parent;this.updateWorldMatrix(!0,!1),nx.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Bu.lookAt(nx,BS,this.up):Bu.lookAt(BS,nx,this.up),this.quaternion.setFromRotationMatrix(Bu),i&&(Bu.extractRotation(i.matrixWorld),fg.setFromRotationMatrix(Bu),this.quaternion.premultiply(fg.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(zt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(mG),dg.child=e,this.dispatchEvent(dg),dg.child=null):zt("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 n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(SMe),Q3.child=e,this.dispatchEvent(Q3),Q3.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Bu.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Bu.multiply(e.parent.matrixWorld)),e.applyMatrix4(Bu),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(mG),dg.child=e,this.dispatchEvent(dg),dg.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let r=0,i=this.children.length;r<i;r++){const s=this.children[r].getObjectByProperty(e,n);if(s!==void 0)return s}}getObjectsByProperty(e,n,r=[]){this[e]===n&&r.push(this);const i=this.children;for(let a=0,s=i.length;a<s;a++)i[a].getObjectsByProperty(e,n,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(nx,e,bMe),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(nx,_Me,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].updateMatrixWorld(e)}updateWorldMatrix(e,n){const r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){const i=this.children;for(let a=0,s=i.length;a<s;a++)i[a].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",r={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function a(o,c){return o[c.uuid]===void 0&&(o[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=a(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const c=o.shapes;if(Array.isArray(c))for(let u=0,h=c.length;u<h;u++){const p=c[u];a(e.shapes,p)}else a(e.shapes,c)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let c=0,u=this.material.length;c<u;c++)o.push(a(e.materials,this.material[c]));i.material=o}else i.material=a(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const c=this.animations[o];i.animations.push(a(e.animations,c))}}if(n){const o=s(e.geometries),c=s(e.materials),u=s(e.textures),h=s(e.images),p=s(e.shapes),v=s(e.skeletons),y=s(e.animations),b=s(e.nodes);o.length>0&&(r.geometries=o),c.length>0&&(r.materials=c),u.length>0&&(r.textures=u),h.length>0&&(r.images=h),p.length>0&&(r.shapes=p),v.length>0&&(r.skeletons=v),y.length>0&&(r.animations=y),b.length>0&&(r.nodes=b)}return r.object=i,r;function s(o){const c=[];for(const u in o){const h=o[u];delete h.metadata,c.push(h)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}zn.DEFAULT_UP=new ne(0,1,0);zn.DEFAULT_MATRIX_AUTO_UPDATE=!0;zn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const El=new ne,Lu=new ne,eD=new ne,ku=new ne,hg=new ne,pg=new ne,gG=new ne,tD=new ne,nD=new ne,rD=new ne,iD=new mr,aD=new mr,sD=new mr;class Ns{constructor(e=new ne,n=new ne,r=new ne){this.a=e,this.b=n,this.c=r}static getNormal(e,n,r,i){i.subVectors(r,n),El.subVectors(e,n),i.cross(El);const a=i.lengthSq();return a>0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}static getBarycoord(e,n,r,i,a){El.subVectors(i,n),Lu.subVectors(r,n),eD.subVectors(e,n);const s=El.dot(El),o=El.dot(Lu),c=El.dot(eD),u=Lu.dot(Lu),h=Lu.dot(eD),p=s*u-o*o;if(p===0)return a.set(0,0,0),null;const v=1/p,y=(u*c-o*h)*v,b=(s*h-o*c)*v;return a.set(1-y-b,b,y)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,ku)===null?!1:ku.x>=0&&ku.y>=0&&ku.x+ku.y<=1}static getInterpolation(e,n,r,i,a,s,o,c){return this.getBarycoord(e,n,r,i,ku)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(a,ku.x),c.addScaledVector(s,ku.y),c.addScaledVector(o,ku.z),c)}static getInterpolatedAttribute(e,n,r,i,a,s){return iD.setScalar(0),aD.setScalar(0),sD.setScalar(0),iD.fromBufferAttribute(e,n),aD.fromBufferAttribute(e,r),sD.fromBufferAttribute(e,i),s.setScalar(0),s.addScaledVector(iD,a.x),s.addScaledVector(aD,a.y),s.addScaledVector(sD,a.z),s}static isFrontFacing(e,n,r,i){return El.subVectors(r,n),Lu.subVectors(e,n),El.cross(Lu).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),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 El.subVectors(this.c,this.b),Lu.subVectors(this.a,this.b),El.cross(Lu).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ns.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ns.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,a){return Ns.getInterpolation(e,this.a,this.b,this.c,n,r,i,a)}containsPoint(e){return Ns.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ns.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,a=this.c;let s,o;hg.subVectors(i,r),pg.subVectors(a,r),tD.subVectors(e,r);const c=hg.dot(tD),u=pg.dot(tD);if(c<=0&&u<=0)return n.copy(r);nD.subVectors(e,i);const h=hg.dot(nD),p=pg.dot(nD);if(h>=0&&p<=h)return n.copy(i);const v=c*p-h*u;if(v<=0&&c>=0&&h<=0)return s=c/(c-h),n.copy(r).addScaledVector(hg,s);rD.subVectors(e,a);const y=hg.dot(rD),b=pg.dot(rD);if(b>=0&&y<=b)return n.copy(a);const w=y*u-c*b;if(w<=0&&u>=0&&b<=0)return o=u/(u-b),n.copy(r).addScaledVector(pg,o);const _=h*b-y*p;if(_<=0&&p-h>=0&&y-b>=0)return gG.subVectors(a,i),o=(p-h)/(p-h+(y-b)),n.copy(i).addScaledVector(gG,o);const S=1/(_+w+v);return s=w*S,o=v*S,n.copy(r).addScaledVector(hg,s).addScaledVector(pg,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const aY={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},ld={h:0,s:0,l:0},LS={h:0,s:0,l:0};function oD(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class bt{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Pa){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Fn.colorSpaceToWorking(this,n),this}setRGB(e,n,r,i=Fn.workingColorSpace){return this.r=e,this.g=n,this.b=r,Fn.colorSpaceToWorking(this,i),this}setHSL(e,n,r,i=Fn.workingColorSpace){if(e=j5(e,1),n=tn(n,0,1),r=tn(r,0,1),n===0)this.r=this.g=this.b=r;else{const a=r<=.5?r*(1+n):r+n-r*n,s=2*r-a;this.r=oD(s,a,e+1/3),this.g=oD(s,a,e),this.b=oD(s,a,e-1/3)}return Fn.colorSpaceToWorking(this,i),this}setStyle(e,n=Pa){function r(a){a!==void 0&&parseFloat(a)<1&&xt("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,n);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,n);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,n);break;default:xt("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=i[1],s=a.length;if(s===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(a,16),n);xt("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Pa){const r=aY[e.toLowerCase()];return r!==void 0?this.setHex(r,n):xt("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=Qu(e.r),this.g=Qu(e.g),this.b=Qu(e.b),this}copyLinearToSRGB(e){return this.r=Zg(e.r),this.g=Zg(e.g),this.b=Zg(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Pa){return Fn.workingToColorSpace(Ca.copy(this),e),Math.round(tn(Ca.r*255,0,255))*65536+Math.round(tn(Ca.g*255,0,255))*256+Math.round(tn(Ca.b*255,0,255))}getHexString(e=Pa){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Fn.workingColorSpace){Fn.workingToColorSpace(Ca.copy(this),n);const r=Ca.r,i=Ca.g,a=Ca.b,s=Math.max(r,i,a),o=Math.min(r,i,a);let c,u;const h=(o+s)/2;if(o===s)c=0,u=0;else{const p=s-o;switch(u=h<=.5?p/(s+o):p/(2-s-o),s){case r:c=(i-a)/p+(i<a?6:0);break;case i:c=(a-r)/p+2;break;case a:c=(r-i)/p+4;break}c/=6}return e.h=c,e.s=u,e.l=h,e}getRGB(e,n=Fn.workingColorSpace){return Fn.workingToColorSpace(Ca.copy(this),n),e.r=Ca.r,e.g=Ca.g,e.b=Ca.b,e}getStyle(e=Pa){Fn.workingToColorSpace(Ca.copy(this),e);const n=Ca.r,r=Ca.g,i=Ca.b;return e!==Pa?`color(${e} ${n.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(r*255)},${Math.round(i*255)})`}offsetHSL(e,n,r){return this.getHSL(ld),this.setHSL(ld.h+e,ld.s+n,ld.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.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,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,r){return this.r=e.r+(n.r-e.r)*r,this.g=e.g+(n.g-e.g)*r,this.b=e.b+(n.b-e.b)*r,this}lerpHSL(e,n){this.getHSL(ld),e.getHSL(LS);const r=Ux(ld.h,LS.h,n),i=Ux(ld.s,LS.s,n),a=Ux(ld.l,LS.l,n);return this.setHSL(r,i,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,r=this.g,i=this.b,a=e.elements;return this.r=a[0]*n+a[3]*r+a[6]*i,this.g=a[1]*n+a[4]*r+a[7]*i,this.b=a[2]*n+a[5]*r+a[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Ca=new bt;bt.NAMES=aY;let AMe=0;class zi extends Yc{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:AMe++}),this.uuid=eo(),this.name="",this.type="Material",this.blending=xp,this.side=Vc,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=nM,this.blendDst=rM,this.blendEquation=vd,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new bt(0,0,0),this.blendAlpha=0,this.depthFunc=Tp,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=rB,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Qh,this.stencilZFail=Qh,this.stencilZPass=Qh,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){xt(`Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){xt(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.7,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!==void 0&&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.sheenColorMap&&this.sheenColorMap.isTexture&&(r.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(r.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(r.dispersion=this.dispersion),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.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.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.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),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&&this.attenuationDistance!==1/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!==xp&&(r.blending=this.blending),this.side!==Vc&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==nM&&(r.blendSrc=this.blendSrc),this.blendDst!==rM&&(r.blendDst=this.blendDst),this.blendEquation!==vd&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==Tp&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==rB&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Qh&&(r.stencilFail=this.stencilFail),this.stencilZFail!==Qh&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==Qh&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),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.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.allowOverride===!1&&(r.allowOverride=!1),this.wireframe===!0&&(r.wireframe=!0),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=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(a){const s=[];for(const o in a){const c=a[o];delete c.metadata,s.push(c)}return s}if(n){const a=i(e.textures),s=i(e.images);a.length>0&&(r.textures=a),s.length>0&&(r.images=s)}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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let a=0;a!==i;++a)r[a]=n[a].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.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Qs extends zi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new bt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.combine=o1,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Gu=wMe();function wMe(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),r=new Uint32Array(512),i=new Uint32Array(512);for(let c=0;c<256;++c){const u=c-127;u<-27?(r[c]=0,r[c|256]=32768,i[c]=24,i[c|256]=24):u<-14?(r[c]=1024>>-u-14,r[c|256]=1024>>-u-14|32768,i[c]=-u-1,i[c|256]=-u-1):u<=15?(r[c]=u+15<<10,r[c|256]=u+15<<10|32768,i[c]=13,i[c|256]=13):u<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 a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let c=1;c<1024;++c){let u=c<<13,h=0;for(;(u&8388608)===0;)u<<=1,h-=8388608;u&=-8388609,h+=947912704,a[c]=u|h}for(let c=1024;c<2048;++c)a[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)s[c]=c<<23;s[31]=1199570944,s[32]=2147483648;for(let c=33;c<63;++c)s[c]=2147483648+(c-32<<23);s[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(o[c]=1024);return{floatView:e,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:s,offsetTable:o}}function Ds(t){Math.abs(t)>65504&&xt("DataUtils.toHalfFloat(): Value out of range."),t=tn(t,-65504,65504),Gu.floatView[0]=t;const e=Gu.uint32View[0],n=e>>23&511;return Gu.baseTable[n]+((e&8388607)>>Gu.shiftTable[n])}function yx(t){const e=t>>10;return Gu.uint32View[0]=Gu.mantissaTable[Gu.offsetTable[e]+(t&1023)]+Gu.exponentTable[e],Gu.floatView[0]}class MMe{static toHalfFloat(e){return Ds(e)}static fromHalfFloat(e){return yx(e)}}const Ei=new ne,kS=new Ve;let EMe=0;class qn{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:EMe++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=Nb,this.updateRanges=[],this.gpuType=os,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,a=this.itemSize;i<a;i++)this.array[e+i]=n.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,r=this.count;n<r;n++)kS.fromBufferAttribute(this,n),kS.applyMatrix3(e),this.setXY(n,kS.x,kS.y);else if(this.itemSize===3)for(let n=0,r=this.count;n<r;n++)Ei.fromBufferAttribute(this,n),Ei.applyMatrix3(e),this.setXYZ(n,Ei.x,Ei.y,Ei.z);return this}applyMatrix4(e){for(let n=0,r=this.count;n<r;n++)Ei.fromBufferAttribute(this,n),Ei.applyMatrix4(e),this.setXYZ(n,Ei.x,Ei.y,Ei.z);return this}applyNormalMatrix(e){for(let n=0,r=this.count;n<r;n++)Ei.fromBufferAttribute(this,n),Ei.applyNormalMatrix(e),this.setXYZ(n,Ei.x,Ei.y,Ei.z);return this}transformDirection(e){for(let n=0,r=this.count;n<r;n++)Ei.fromBufferAttribute(this,n),Ei.transformDirection(e),this.setXYZ(n,Ei.x,Ei.y,Ei.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let r=this.array[e*this.itemSize+n];return this.normalized&&(r=ns(r,this.array)),r}setComponent(e,n,r){return this.normalized&&(r=vn(r,this.array)),this.array[e*this.itemSize+n]=r,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=ns(n,this.array)),n}setX(e,n){return this.normalized&&(n=vn(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=ns(n,this.array)),n}setY(e,n){return this.normalized&&(n=vn(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=ns(n,this.array)),n}setZ(e,n){return this.normalized&&(n=vn(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=ns(n,this.array)),n}setW(e,n){return this.normalized&&(n=vn(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,r){return e*=this.itemSize,this.normalized&&(n=vn(n,this.array),r=vn(r,this.array)),this.array[e+0]=n,this.array[e+1]=r,this}setXYZ(e,n,r,i){return e*=this.itemSize,this.normalized&&(n=vn(n,this.array),r=vn(r,this.array),i=vn(i,this.array)),this.array[e+0]=n,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,n,r,i,a){return e*=this.itemSize,this.normalized&&(n=vn(n,this.array),r=vn(r,this.array),i=vn(i,this.array),a=vn(a,this.array)),this.array[e+0]=n,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Nb&&(e.usage=this.usage),e}}class TMe extends qn{constructor(e,n,r){super(new Int8Array(e),n,r)}}class CMe extends qn{constructor(e,n,r){super(new Uint8Array(e),n,r)}}class RMe extends qn{constructor(e,n,r){super(new Uint8ClampedArray(e),n,r)}}class OMe extends qn{constructor(e,n,r){super(new Int16Array(e),n,r)}}class G5 extends qn{constructor(e,n,r){super(new Uint16Array(e),n,r)}}class PMe extends qn{constructor(e,n,r){super(new Int32Array(e),n,r)}}class H5 extends qn{constructor(e,n,r){super(new Uint32Array(e),n,r)}}class DMe extends qn{constructor(e,n,r){super(new Uint16Array(e),n,r),this.isFloat16BufferAttribute=!0}getX(e){let n=yx(this.array[e*this.itemSize]);return this.normalized&&(n=ns(n,this.array)),n}setX(e,n){return this.normalized&&(n=vn(n,this.array)),this.array[e*this.itemSize]=Ds(n),this}getY(e){let n=yx(this.array[e*this.itemSize+1]);return this.normalized&&(n=ns(n,this.array)),n}setY(e,n){return this.normalized&&(n=vn(n,this.array)),this.array[e*this.itemSize+1]=Ds(n),this}getZ(e){let n=yx(this.array[e*this.itemSize+2]);return this.normalized&&(n=ns(n,this.array)),n}setZ(e,n){return this.normalized&&(n=vn(n,this.array)),this.array[e*this.itemSize+2]=Ds(n),this}getW(e){let n=yx(this.array[e*this.itemSize+3]);return this.normalized&&(n=ns(n,this.array)),n}setW(e,n){return this.normalized&&(n=vn(n,this.array)),this.array[e*this.itemSize+3]=Ds(n),this}setXY(e,n,r){return e*=this.itemSize,this.normalized&&(n=vn(n,this.array),r=vn(r,this.array)),this.array[e+0]=Ds(n),this.array[e+1]=Ds(r),this}setXYZ(e,n,r,i){return e*=this.itemSize,this.normalized&&(n=vn(n,this.array),r=vn(r,this.array),i=vn(i,this.array)),this.array[e+0]=Ds(n),this.array[e+1]=Ds(r),this.array[e+2]=Ds(i),this}setXYZW(e,n,r,i,a){return e*=this.itemSize,this.normalized&&(n=vn(n,this.array),r=vn(r,this.array),i=vn(i,this.array),a=vn(a,this.array)),this.array[e+0]=Ds(n),this.array[e+1]=Ds(r),this.array[e+2]=Ds(i),this.array[e+3]=Ds(a),this}}class Pt extends qn{constructor(e,n,r){super(new Float32Array(e),n,r)}}let NMe=0;const Bo=new qt,lD=new zn,mg=new ne,qs=new Oi,rx=new Oi,Yi=new ne;class an extends Yc{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:NMe++}),this.uuid=eo(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(eY(e)?H5:G5)(e,1):this.index=e,this}setIndirect(e,n=0){return this.indirect=e,this.indirectOffset=n,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,r=0){this.groups.push({start:e,count:n,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const r=this.attributes.normal;if(r!==void 0){const a=new dn().getNormalMatrix(e);r.applyNormalMatrix(a),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 Bo.makeRotationFromQuaternion(e),this.applyMatrix4(Bo),this}rotateX(e){return Bo.makeRotationX(e),this.applyMatrix4(Bo),this}rotateY(e){return Bo.makeRotationY(e),this.applyMatrix4(Bo),this}rotateZ(e){return Bo.makeRotationZ(e),this.applyMatrix4(Bo),this}translate(e,n,r){return Bo.makeTranslation(e,n,r),this.applyMatrix4(Bo),this}scale(e,n,r){return Bo.makeScale(e,n,r),this.applyMatrix4(Bo),this}lookAt(e){return lD.lookAt(e),lD.updateMatrix(),this.applyMatrix4(lD.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(mg).negate(),this.translate(mg.x,mg.y,mg.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const r=[];for(let i=0,a=e.length;i<a;i++){const s=e[i];r.push(s.x,s.y,s.z||0)}this.setAttribute("position",new Pt(r,3))}else{const r=Math.min(e.length,n.count);for(let i=0;i<r;i++){const a=e[i];n.setXYZ(i,a.x,a.y,a.z||0)}e.length>n.count&&xt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Oi);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){zt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ne(-1/0,-1/0,-1/0),new ne(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r<i;r++){const a=n[r];qs.setFromBufferAttribute(a),this.morphTargetsRelative?(Yi.addVectors(this.boundingBox.min,qs.min),this.boundingBox.expandByPoint(Yi),Yi.addVectors(this.boundingBox.max,qs.max),this.boundingBox.expandByPoint(Yi)):(this.boundingBox.expandByPoint(qs.min),this.boundingBox.expandByPoint(qs.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&zt('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 Zi);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){zt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new ne,1/0);return}if(e){const r=this.boundingSphere.center;if(qs.setFromBufferAttribute(e),n)for(let a=0,s=n.length;a<s;a++){const o=n[a];rx.setFromBufferAttribute(o),this.morphTargetsRelative?(Yi.addVectors(qs.min,rx.min),qs.expandByPoint(Yi),Yi.addVectors(qs.max,rx.max),qs.expandByPoint(Yi)):(qs.expandByPoint(rx.min),qs.expandByPoint(rx.max))}qs.getCenter(r);let i=0;for(let a=0,s=e.count;a<s;a++)Yi.fromBufferAttribute(e,a),i=Math.max(i,r.distanceToSquared(Yi));if(n)for(let a=0,s=n.length;a<s;a++){const o=n[a],c=this.morphTargetsRelative;for(let u=0,h=o.count;u<h;u++)Yi.fromBufferAttribute(o,u),c&&(mg.fromBufferAttribute(e,u),Yi.add(mg)),i=Math.max(i,r.distanceToSquared(Yi))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&zt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){zt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=n.position,i=n.normal,a=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new qn(new Float32Array(4*r.count),4));const s=this.getAttribute("tangent"),o=[],c=[];for(let k=0;k<r.count;k++)o[k]=new ne,c[k]=new ne;const u=new ne,h=new ne,p=new ne,v=new Ve,y=new Ve,b=new Ve,w=new ne,_=new ne;function S(k,B,U){u.fromBufferAttribute(r,k),h.fromBufferAttribute(r,B),p.fromBufferAttribute(r,U),v.fromBufferAttribute(a,k),y.fromBufferAttribute(a,B),b.fromBufferAttribute(a,U),h.sub(u),p.sub(u),y.sub(v),b.sub(v);const z=1/(y.x*b.y-b.x*y.y);isFinite(z)&&(w.copy(h).multiplyScalar(b.y).addScaledVector(p,-y.y).multiplyScalar(z),_.copy(p).multiplyScalar(y.x).addScaledVector(h,-b.x).multiplyScalar(z),o[k].add(w),o[B].add(w),o[U].add(w),c[k].add(_),c[B].add(_),c[U].add(_))}let E=this.groups;E.length===0&&(E=[{start:0,count:e.count}]);for(let k=0,B=E.length;k<B;++k){const U=E[k],z=U.start,q=U.count;for(let W=z,ee=z+q;W<ee;W+=3)S(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const T=new ne,P=new ne,R=new ne,D=new ne;function I(k){R.fromBufferAttribute(i,k),D.copy(R);const B=o[k];T.copy(B),T.sub(R.multiplyScalar(R.dot(B))).normalize(),P.crossVectors(D,B);const z=P.dot(c[k])<0?-1:1;s.setXYZW(k,T.x,T.y,T.z,z)}for(let k=0,B=E.length;k<B;++k){const U=E[k],z=U.start,q=U.count;for(let W=z,ee=z+q;W<ee;W+=3)I(e.getX(W+0)),I(e.getX(W+1)),I(e.getX(W+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new qn(new Float32Array(n.count*3),3),this.setAttribute("normal",r);else for(let v=0,y=r.count;v<y;v++)r.setXYZ(v,0,0,0);const i=new ne,a=new ne,s=new ne,o=new ne,c=new ne,u=new ne,h=new ne,p=new ne;if(e)for(let v=0,y=e.count;v<y;v+=3){const b=e.getX(v+0),w=e.getX(v+1),_=e.getX(v+2);i.fromBufferAttribute(n,b),a.fromBufferAttribute(n,w),s.fromBufferAttribute(n,_),h.subVectors(s,a),p.subVectors(i,a),h.cross(p),o.fromBufferAttribute(r,b),c.fromBufferAttribute(r,w),u.fromBufferAttribute(r,_),o.add(h),c.add(h),u.add(h),r.setXYZ(b,o.x,o.y,o.z),r.setXYZ(w,c.x,c.y,c.z),r.setXYZ(_,u.x,u.y,u.z)}else for(let v=0,y=n.count;v<y;v+=3)i.fromBufferAttribute(n,v+0),a.fromBufferAttribute(n,v+1),s.fromBufferAttribute(n,v+2),h.subVectors(s,a),p.subVectors(i,a),h.cross(p),r.setXYZ(v+0,h.x,h.y,h.z),r.setXYZ(v+1,h.x,h.y,h.z),r.setXYZ(v+2,h.x,h.y,h.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,r=e.count;n<r;n++)Yi.fromBufferAttribute(e,n),Yi.normalize(),e.setXYZ(n,Yi.x,Yi.y,Yi.z)}toNonIndexed(){function e(o,c){const u=o.array,h=o.itemSize,p=o.normalized,v=new u.constructor(c.length*h);let y=0,b=0;for(let w=0,_=c.length;w<_;w++){o.isInterleavedBufferAttribute?y=c[w]*o.data.stride+o.offset:y=c[w]*h;for(let S=0;S<h;S++)v[b++]=u[y++]}return new qn(v,h,p)}if(this.index===null)return xt("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new an,r=this.index.array,i=this.attributes;for(const o in i){const c=i[o],u=e(c,r);n.setAttribute(o,u)}const a=this.morphAttributes;for(const o in a){const c=[],u=a[o];for(let h=0,p=u.length;h<p;h++){const v=u[h],y=e(v,r);c.push(y)}n.morphAttributes[o]=c}n.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let o=0,c=s.length;o<c;o++){const u=s[o];n.addGroup(u.start,u.count,u.materialIndex)}return n}toJSON(){const e={metadata:{version:4.7,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 u in c)c[u]!==void 0&&(e[u]=c[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const c in r){const u=r[c];e.data.attributes[c]=u.toJSON(e.data)}const i={};let a=!1;for(const c in this.morphAttributes){const u=this.morphAttributes[c],h=[];for(let p=0,v=u.length;p<v;p++){const y=u[p];h.push(y.toJSON(e.data))}h.length>0&&(i[c]=h,a=!0)}a&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const u in i){const h=i[u];this.setAttribute(u,h.clone(n))}const a=e.morphAttributes;for(const u in a){const h=[],p=a[u];for(let v=0,y=p.length;v<y;v++)h.push(p[v].clone(n));this.morphAttributes[u]=h}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let u=0,h=s.length;u<h;u++){const p=s[u];this.addGroup(p.start,p.count,p.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.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,this}dispose(){this.dispatchEvent({type:"dispose"})}}const vG=new qt,Lh=new Hp,FS=new Zi,yG=new ne,US=new ne,jS=new ne,zS=new ne,cD=new ne,GS=new ne,xG=new ne,HS=new ne;class vi extends zn{constructor(e=new an,n=new Qs){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;a<s;a++){const o=i[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}getVertexPosition(e,n){const r=this.geometry,i=r.attributes.position,a=r.morphAttributes.position,s=r.morphTargetsRelative;n.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(a&&o){GS.set(0,0,0);for(let c=0,u=a.length;c<u;c++){const h=o[c],p=a[c];h!==0&&(cD.fromBufferAttribute(p,e),s?GS.addScaledVector(cD,h):GS.addScaledVector(cD.sub(n),h))}n.add(GS)}return n}raycast(e,n){const r=this.geometry,i=this.material,a=this.matrixWorld;i!==void 0&&(r.boundingSphere===null&&r.computeBoundingSphere(),FS.copy(r.boundingSphere),FS.applyMatrix4(a),Lh.copy(e.ray).recast(e.near),!(FS.containsPoint(Lh.origin)===!1&&(Lh.intersectSphere(FS,yG)===null||Lh.origin.distanceToSquared(yG)>(e.far-e.near)**2))&&(vG.copy(a).invert(),Lh.copy(e.ray).applyMatrix4(vG),!(r.boundingBox!==null&&Lh.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Lh)))}_computeIntersections(e,n,r){let i;const a=this.geometry,s=this.material,o=a.index,c=a.attributes.position,u=a.attributes.uv,h=a.attributes.uv1,p=a.attributes.normal,v=a.groups,y=a.drawRange;if(o!==null)if(Array.isArray(s))for(let b=0,w=v.length;b<w;b++){const _=v[b],S=s[_.materialIndex],E=Math.max(_.start,y.start),T=Math.min(o.count,Math.min(_.start+_.count,y.start+y.count));for(let P=E,R=T;P<R;P+=3){const D=o.getX(P),I=o.getX(P+1),k=o.getX(P+2);i=VS(this,S,e,r,u,h,p,D,I,k),i&&(i.faceIndex=Math.floor(P/3),i.face.materialIndex=_.materialIndex,n.push(i))}}else{const b=Math.max(0,y.start),w=Math.min(o.count,y.start+y.count);for(let _=b,S=w;_<S;_+=3){const E=o.getX(_),T=o.getX(_+1),P=o.getX(_+2);i=VS(this,s,e,r,u,h,p,E,T,P),i&&(i.faceIndex=Math.floor(_/3),n.push(i))}}else if(c!==void 0)if(Array.isArray(s))for(let b=0,w=v.length;b<w;b++){const _=v[b],S=s[_.materialIndex],E=Math.max(_.start,y.start),T=Math.min(c.count,Math.min(_.start+_.count,y.start+y.count));for(let P=E,R=T;P<R;P+=3){const D=P,I=P+1,k=P+2;i=VS(this,S,e,r,u,h,p,D,I,k),i&&(i.faceIndex=Math.floor(P/3),i.face.materialIndex=_.materialIndex,n.push(i))}}else{const b=Math.max(0,y.start),w=Math.min(c.count,y.start+y.count);for(let _=b,S=w;_<S;_+=3){const E=_,T=_+1,P=_+2;i=VS(this,s,e,r,u,h,p,E,T,P),i&&(i.faceIndex=Math.floor(_/3),n.push(i))}}}}function IMe(t,e,n,r,i,a,s,o){let c;if(e.side===ls?c=r.intersectTriangle(s,a,i,!0,o):c=r.intersectTriangle(i,a,s,e.side===Vc,o),c===null)return null;HS.copy(o),HS.applyMatrix4(t.matrixWorld);const u=n.ray.origin.distanceTo(HS);return u<n.near||u>n.far?null:{distance:u,point:HS.clone(),object:t}}function VS(t,e,n,r,i,a,s,o,c,u){t.getVertexPosition(o,US),t.getVertexPosition(c,jS),t.getVertexPosition(u,zS);const h=IMe(t,e,n,r,US,jS,zS,xG);if(h){const p=new ne;Ns.getBarycoord(xG,US,jS,zS,p),i&&(h.uv=Ns.getInterpolatedAttribute(i,o,c,u,p,new Ve)),a&&(h.uv1=Ns.getInterpolatedAttribute(a,o,c,u,p,new Ve)),s&&(h.normal=Ns.getInterpolatedAttribute(s,o,c,u,p,new ne),h.normal.dot(r.direction)>0&&h.normal.multiplyScalar(-1));const v={a:o,b:c,c:u,normal:new ne,materialIndex:0};Ns.getNormal(US,jS,zS,v.normal),h.face=v,h.barycoord=p}return h}class Vp extends an{constructor(e=1,n=1,r=1,i=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:s};const o=this;i=Math.floor(i),a=Math.floor(a),s=Math.floor(s);const c=[],u=[],h=[],p=[];let v=0,y=0;b("z","y","x",-1,-1,r,n,e,s,a,0),b("z","y","x",1,-1,r,n,-e,s,a,1),b("x","z","y",1,1,e,r,n,i,s,2),b("x","z","y",1,-1,e,r,-n,i,s,3),b("x","y","z",1,-1,e,n,r,i,a,4),b("x","y","z",-1,-1,e,n,-r,i,a,5),this.setIndex(c),this.setAttribute("position",new Pt(u,3)),this.setAttribute("normal",new Pt(h,3)),this.setAttribute("uv",new Pt(p,2));function b(w,_,S,E,T,P,R,D,I,k,B){const U=P/I,z=R/k,q=P/2,W=R/2,ee=D/2,Q=I+1,V=k+1;let $=0,Y=0;const ie=new ne;for(let de=0;de<V;de++){const X=de*z-W;for(let ae=0;ae<Q;ae++){const ue=ae*U-q;ie[w]=ue*E,ie[_]=X*T,ie[S]=ee,u.push(ie.x,ie.y,ie.z),ie[w]=0,ie[_]=0,ie[S]=D>0?1:-1,h.push(ie.x,ie.y,ie.z),p.push(ae/I),p.push(1-de/k),$+=1}}for(let de=0;de<k;de++)for(let X=0;X<I;X++){const ae=v+X+Q*de,ue=v+X+Q*(de+1),Se=v+(X+1)+Q*(de+1),$e=v+(X+1)+Q*de;c.push(ae,ue,$e),c.push(ue,Se,$e),Y+=6}o.addGroup(y,Y,B),y+=Y,v+=$}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Vp(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function kv(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(xt("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][r]=null):e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function Qa(t){const e={};for(let n=0;n<t.length;n++){const r=kv(t[n]);for(const i in r)e[i]=r[i]}return e}function BMe(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function sY(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Fn.workingColorSpace}const oY={clone:kv,merge:Qa};var LMe=`void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,kMe=`void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class Yo extends zi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=LMe,this.fragmentShader=kMe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=kv(e.uniforms),this.uniformsGroups=BMe(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const s=this.uniforms[i].value;s&&s.isTexture?n.uniforms[i]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?n.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?n.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?n.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?n.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?n.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?n.uniforms[i]={type:"m4",value:s.toArray()}:n.uniforms[i]={value:s}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class nT extends zn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qt,this.projectionMatrix=new qt,this.projectionMatrixInverse=new qt,this.coordinateSystem=Zs,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const cd=new ne,bG=new Ve,_G=new Ve;class jr extends nT{constructor(e=50,n=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=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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 n=.5*this.getFilmHeight()/e;this.fov=Bv*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(bp*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Bv*2*Math.atan(Math.tan(bp*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){cd.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(cd.x,cd.y).multiplyScalar(-e/cd.z),cd.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(cd.x,cd.y).multiplyScalar(-e/cd.z)}getViewSize(e,n){return this.getViewBounds(e,bG,_G),n.subVectors(_G,bG)}setViewOffset(e,n,r,i,a,s){this.aspect=e/n,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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(bp*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,a=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const c=s.fullWidth,u=s.fullHeight;a+=s.offsetX*i/c,n-=s.offsetY*r/u,i*=s.width/c,r*=s.height/u}const o=this.filmOffset;o!==0&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+i,n,n-r,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const gg=-90,vg=1;class lY extends zn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new jr(gg,vg,e,n);i.layers=this.layers,this.add(i);const a=new jr(gg,vg,e,n);a.layers=this.layers,this.add(a);const s=new jr(gg,vg,e,n);s.layers=this.layers,this.add(s);const o=new jr(gg,vg,e,n);o.layers=this.layers,this.add(o);const c=new jr(gg,vg,e,n);c.layers=this.layers,this.add(c);const u=new jr(gg,vg,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,a,s,o,c]=n;for(const u of n)this.remove(u);if(e===Zs)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===Nv)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of n)this.add(u),u.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,s,o,c,u,h]=this.children,p=e.getRenderTarget(),v=e.getActiveCubeFace(),y=e.getActiveMipmapLevel(),b=e.xr.enabled;e.xr.enabled=!1;const w=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,a),e.setRenderTarget(r,1,i),e.render(n,s),e.setRenderTarget(r,2,i),e.render(n,o),e.setRenderTarget(r,3,i),e.render(n,c),e.setRenderTarget(r,4,i),e.render(n,u),r.texture.generateMipmaps=w,e.setRenderTarget(r,5,i),e.render(n,h),e.setRenderTarget(p,v,y),e.xr.enabled=b,r.texture.needsPMREMUpdate=!0}}class c1 extends Gr{constructor(e=[],n=Wc,r,i,a,s,o,c,u,h){super(e,n,r,i,a,s,o,c,u,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class V5 extends to{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new c1(i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.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 Vp(5,5,5),a=new Yo({name:"CubemapFromEquirect",uniforms:kv(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:ls,blending:Fc});a.uniforms.tEquirect.value=n;const s=new vi(i,a),o=n.minFilter;return n.minFilter===zo&&(n.minFilter=vr),new lY(1,10,this).update(e,s),n.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,n=!0,r=!0,i=!0){const a=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(n,r,i);e.setRenderTarget(a)}}let $u=class extends zn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const FMe={type:"move"};class UA{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new $u,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 $u,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ne,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ne),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new $u,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ne,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ne),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,a=null,s=null;const o=this._targetRay,c=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){s=!0;for(const w of e.hand.values()){const _=n.getJointPose(w,r),S=this._getHandJoint(u,w);_!==null&&(S.matrix.fromArray(_.transform.matrix),S.matrix.decompose(S.position,S.rotation,S.scale),S.matrixWorldNeedsUpdate=!0,S.jointRadius=_.radius),S.visible=_!==null}const h=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],v=h.position.distanceTo(p.position),y=.02,b=.005;u.inputState.pinching&&v>y+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&v<=y-b&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(a=n.getPose(e.gripSpace,r),a!==null&&(c.matrix.fromArray(a.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,a.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(a.linearVelocity)):c.hasLinearVelocity=!1,a.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(a.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&a!==null&&(i=a),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(FMe)))}return o!==null&&(o.visible=i!==null),c!==null&&(c.visible=a!==null),u!==null&&(u.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new $u;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class rT{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new bt(e),this.density=n}clone(){return new rT(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class iT{constructor(e,n=1,r=1e3){this.isFog=!0,this.name="",this.color=new bt(e),this.near=n,this.far=r}clone(){return new iT(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class W5 extends zn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ro,this.environmentIntensity=1,this.environmentRotation=new ro,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class u1{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=Nb,this.updateRanges=[],this.version=0,this.uuid=eo()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,a=this.stride;i<a;i++)this.array[e+i]=n.array[r+i];return this}set(e,n=0){return this.array.set(e,n),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=eo()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const n=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(n,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=eo()),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 Za=new ne;class Dd{constructor(e,n,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=n,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let n=0,r=this.data.count;n<r;n++)Za.fromBufferAttribute(this,n),Za.applyMatrix4(e),this.setXYZ(n,Za.x,Za.y,Za.z);return this}applyNormalMatrix(e){for(let n=0,r=this.count;n<r;n++)Za.fromBufferAttribute(this,n),Za.applyNormalMatrix(e),this.setXYZ(n,Za.x,Za.y,Za.z);return this}transformDirection(e){for(let n=0,r=this.count;n<r;n++)Za.fromBufferAttribute(this,n),Za.transformDirection(e),this.setXYZ(n,Za.x,Za.y,Za.z);return this}getComponent(e,n){let r=this.array[e*this.data.stride+this.offset+n];return this.normalized&&(r=ns(r,this.array)),r}setComponent(e,n,r){return this.normalized&&(r=vn(r,this.array)),this.data.array[e*this.data.stride+this.offset+n]=r,this}setX(e,n){return this.normalized&&(n=vn(n,this.array)),this.data.array[e*this.data.stride+this.offset]=n,this}setY(e,n){return this.normalized&&(n=vn(n,this.array)),this.data.array[e*this.data.stride+this.offset+1]=n,this}setZ(e,n){return this.normalized&&(n=vn(n,this.array)),this.data.array[e*this.data.stride+this.offset+2]=n,this}setW(e,n){return this.normalized&&(n=vn(n,this.array)),this.data.array[e*this.data.stride+this.offset+3]=n,this}getX(e){let n=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(n=ns(n,this.array)),n}getY(e){let n=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(n=ns(n,this.array)),n}getZ(e){let n=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(n=ns(n,this.array)),n}getW(e){let n=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(n=ns(n,this.array)),n}setXY(e,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(n=vn(n,this.array),r=vn(r,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=r,this}setXYZ(e,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(n=vn(n,this.array),r=vn(r,this.array),i=vn(i,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=r,this.data.array[e+2]=i,this}setXYZW(e,n,r,i,a){return e=e*this.data.stride+this.offset,this.normalized&&(n=vn(n,this.array),r=vn(r,this.array),i=vn(i,this.array),a=vn(a,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=r,this.data.array[e+2]=i,this.data.array[e+3]=a,this}clone(e){if(e===void 0){Bb("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)n.push(this.data.array[i+a])}return new qn(new this.array.constructor(n),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 Dd(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){Bb("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)n.push(this.data.array[i+a])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:n,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 q5 extends zi{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new bt(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 yg;const ix=new ne,xg=new ne,bg=new ne,_g=new Ve,ax=new Ve,cY=new qt,WS=new ne,sx=new ne,qS=new ne,SG=new Ve,uD=new Ve,AG=new Ve;class uY extends zn{constructor(e=new q5){if(super(),this.isSprite=!0,this.type="Sprite",yg===void 0){yg=new an;const n=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),r=new u1(n,5);yg.setIndex([0,1,2,0,2,3]),yg.setAttribute("position",new Dd(r,3,0,!1)),yg.setAttribute("uv",new Dd(r,2,3,!1))}this.geometry=yg,this.material=e,this.center=new Ve(.5,.5),this.count=1}raycast(e,n){e.camera===null&&zt('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),xg.setFromMatrixScale(this.matrixWorld),cY.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),bg.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&xg.multiplyScalar(-bg.z);const r=this.material.rotation;let i,a;r!==0&&(a=Math.cos(r),i=Math.sin(r));const s=this.center;$S(WS.set(-.5,-.5,0),bg,s,xg,i,a),$S(sx.set(.5,-.5,0),bg,s,xg,i,a),$S(qS.set(.5,.5,0),bg,s,xg,i,a),SG.set(0,0),uD.set(1,0),AG.set(1,1);let o=e.ray.intersectTriangle(WS,sx,qS,!1,ix);if(o===null&&($S(sx.set(-.5,.5,0),bg,s,xg,i,a),uD.set(0,1),o=e.ray.intersectTriangle(WS,qS,sx,!1,ix),o===null))return;const c=e.ray.origin.distanceTo(ix);c<e.near||c>e.far||n.push({distance:c,point:ix.clone(),uv:Ns.getInterpolation(ix,WS,sx,qS,SG,uD,AG,new Ve),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function $S(t,e,n,r,i,a){_g.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(ax.x=a*_g.x-i*_g.y,ax.y=i*_g.x+a*_g.y):ax.copy(_g),t.copy(e),t.x+=ax.x,t.y+=ax.y,t.applyMatrix4(cY)}const XS=new ne,wG=new ne;class fY extends zn{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const n=e.levels;for(let r=0,i=n.length;r<i;r++){const a=n[r];this.addLevel(a.object.clone(),a.distance,a.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,n=0,r=0){n=Math.abs(n);const i=this.levels;let a;for(a=0;a<i.length&&!(n<i[a].distance);a++);return i.splice(a,0,{distance:n,hysteresis:r,object:e}),this.add(e),this}removeLevel(e){const n=this.levels;for(let r=0;r<n.length;r++)if(n[r].distance===e){const i=n.splice(r,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const n=this.levels;if(n.length>0){let r,i;for(r=1,i=n.length;r<i;r++){let a=n[r].distance;if(n[r].object.visible&&(a-=a*n[r].hysteresis),e<a)break}return n[r-1].object}return null}raycast(e,n){if(this.levels.length>0){XS.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(XS);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){XS.setFromMatrixPosition(e.matrixWorld),wG.setFromMatrixPosition(this.matrixWorld);const r=XS.distanceTo(wG)/e.zoom;n[0].object.visible=!0;let i,a;for(i=1,a=n.length;i<a;i++){let s=n[i].distance;if(n[i].object.visible&&(s-=s*n[i].hysteresis),r>=s)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<a;i++)n[i].object.visible=!1}}toJSON(e){const n=super.toJSON(e);this.autoUpdate===!1&&(n.object.autoUpdate=!1),n.object.levels=[];const r=this.levels;for(let i=0,a=r.length;i<a;i++){const s=r[i];n.object.levels.push({object:s.object.uuid,distance:s.distance,hysteresis:s.hysteresis})}return n}}const MG=new ne,EG=new mr,TG=new mr,UMe=new ne,CG=new qt,KS=new ne,fD=new Zi,RG=new qt,dD=new Hp;class $5 extends vi{constructor(e,n){super(e,n),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=nB,this.bindMatrix=new qt,this.bindMatrixInverse=new qt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Oi),this.boundingBox.makeEmpty();const n=e.getAttribute("position");for(let r=0;r<n.count;r++)this.getVertexPosition(r,KS),this.boundingBox.expandByPoint(KS)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Zi),this.boundingSphere.makeEmpty();const n=e.getAttribute("position");for(let r=0;r<n.count;r++)this.getVertexPosition(r,KS),this.boundingSphere.expandByPoint(KS)}copy(e,n){return super.copy(e,n),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,n){const r=this.material,i=this.matrixWorld;r!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),fD.copy(this.boundingSphere),fD.applyMatrix4(i),e.ray.intersectsSphere(fD)!==!1&&(RG.copy(i).invert(),dD.copy(e.ray).applyMatrix4(RG),!(this.boundingBox!==null&&dD.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,n,dD)))}getVertexPosition(e,n){return super.getVertexPosition(e,n),this.applyBoneTransform(e,n),n}bind(e,n){this.skeleton=e,n===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),n=this.matrixWorld),this.bindMatrix.copy(n),this.bindMatrixInverse.copy(n).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new mr,n=this.geometry.attributes.skinWeight;for(let r=0,i=n.count;r<i;r++){e.fromBufferAttribute(n,r);const a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),n.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===nB?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===zK?this.bindMatrixInverse.copy(this.bindMatrix).invert():xt("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,n){const r=this.skeleton,i=this.geometry;EG.fromBufferAttribute(i.attributes.skinIndex,e),TG.fromBufferAttribute(i.attributes.skinWeight,e),MG.copy(n).applyMatrix4(this.bindMatrix),n.set(0,0,0);for(let a=0;a<4;a++){const s=TG.getComponent(a);if(s!==0){const o=EG.getComponent(a);CG.multiplyMatrices(r.bones[o].matrixWorld,r.boneInverses[o]),n.addScaledVector(UMe.copy(MG).applyMatrix4(CG),s)}}return n.applyMatrix4(this.bindMatrixInverse)}}class aT extends zn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Fl extends Gr{constructor(e=null,n=1,r=1,i,a,s,o,c,u=si,h=si,p,v){super(null,s,o,c,u,h,i,a,p,v),this.isDataTexture=!0,this.image={data:e,width:n,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const OG=new qt,jMe=new qt;class f1{constructor(e=[],n=[]){this.uuid=eo(),this.bones=e.slice(0),this.boneInverses=n,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,n=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),n.length===0)this.calculateInverses();else if(e.length!==n.length){xt("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 qt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,n=this.bones.length;e<n;e++){const r=new qt;this.bones[e]&&r.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let e=0,n=this.bones.length;e<n;e++){const r=this.bones[e];r&&r.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,n=this.bones.length;e<n;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,n=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let a=0,s=e.length;a<s;a++){const o=e[a]?e[a].matrixWorld:jMe;OG.multiplyMatrices(o,n[a]),OG.toArray(r,a*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new f1(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4);n.set(this.boneMatrices);const r=new Fl(n,e,e,Ba,os);return r.needsUpdate=!0,this.boneMatrices=n,this.boneTexture=r,this}getBoneByName(e){for(let n=0,r=this.bones.length;n<r;n++){const i=this.bones[n];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,n){this.uuid=e.uuid;for(let r=0,i=e.bones.length;r<i;r++){const a=e.bones[r];let s=n[a];s===void 0&&(xt("Skeleton: No bone found with UUID:",a),s=new aT),this.bones.push(s),this.boneInverses.push(new qt().fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const n=this.bones,r=this.boneInverses;for(let i=0,a=n.length;i<a;i++){const s=n[i];e.bones.push(s.uuid);const o=r[i];e.boneInverses.push(o.toArray())}return e}}class Rp extends qn{constructor(e,n,r,i=1){super(e,n,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 Sg=new qt,PG=new qt,YS=[],DG=new Oi,zMe=new qt,ox=new vi,lx=new Zi;class X5 extends vi{constructor(e,n,r){super(e,n),this.isInstancedMesh=!0,this.instanceMatrix=new Rp(new Float32Array(r*16),16),this.instanceColor=null,this.morphTexture=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<r;i++)this.setMatrixAt(i,zMe)}computeBoundingBox(){const e=this.geometry,n=this.count;this.boundingBox===null&&(this.boundingBox=new Oi),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<n;r++)this.getMatrixAt(r,Sg),DG.copy(e.boundingBox).applyMatrix4(Sg),this.boundingBox.union(DG)}computeBoundingSphere(){const e=this.geometry,n=this.count;this.boundingSphere===null&&(this.boundingSphere=new Zi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<n;r++)this.getMatrixAt(r,Sg),lx.copy(e.boundingSphere).applyMatrix4(Sg),this.boundingSphere.union(lx)}copy(e,n){return super.copy(e,n),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,n){n.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,n){n.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,n){const r=n.morphTargetInfluences,i=this.morphTexture.source.data.data,a=r.length+1,s=e*a+1;for(let o=0;o<r.length;o++)r[o]=i[s+o]}raycast(e,n){const r=this.matrixWorld,i=this.count;if(ox.geometry=this.geometry,ox.material=this.material,ox.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),lx.copy(this.boundingSphere),lx.applyMatrix4(r),e.ray.intersectsSphere(lx)!==!1))for(let a=0;a<i;a++){this.getMatrixAt(a,Sg),PG.multiplyMatrices(r,Sg),ox.matrixWorld=PG,ox.raycast(e,YS);for(let s=0,o=YS.length;s<o;s++){const c=YS[s];c.instanceId=a,c.object=this,n.push(c)}YS.length=0}}setColorAt(e,n){this.instanceColor===null&&(this.instanceColor=new Rp(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),n.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,n){n.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,n){const r=n.morphTargetInfluences,i=r.length+1;this.morphTexture===null&&(this.morphTexture=new Fl(new Float32Array(i*this.count),i,this.count,XE,os));const a=this.morphTexture.source.data.data;let s=0;for(let u=0;u<r.length;u++)s+=r[u];const o=this.geometry.morphTargetsRelative?1:1-s,c=i*e;a[c]=o,a.set(r,c+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const hD=new ne,GMe=new ne,HMe=new dn;class ju{constructor(e=new ne(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=hD.subVectors(r,n).cross(GMe.subVectors(e,n)).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,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const r=e.delta(hD),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/i;return a<0||a>1?null:n.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>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,n){const r=n||HMe.getNormalMatrix(e),i=this.coplanarPoint(hD).applyMatrix4(e),a=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const kh=new Zi,VMe=new Ve(.5,.5),JS=new ne;class ly{constructor(e=new ju,n=new ju,r=new ju,i=new ju,a=new ju,s=new ju){this.planes=[e,n,r,i,a,s]}set(e,n,r,i,a,s){const o=this.planes;return o[0].copy(e),o[1].copy(n),o[2].copy(r),o[3].copy(i),o[4].copy(a),o[5].copy(s),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=Zs,r=!1){const i=this.planes,a=e.elements,s=a[0],o=a[1],c=a[2],u=a[3],h=a[4],p=a[5],v=a[6],y=a[7],b=a[8],w=a[9],_=a[10],S=a[11],E=a[12],T=a[13],P=a[14],R=a[15];if(i[0].setComponents(u-s,y-h,S-b,R-E).normalize(),i[1].setComponents(u+s,y+h,S+b,R+E).normalize(),i[2].setComponents(u+o,y+p,S+w,R+T).normalize(),i[3].setComponents(u-o,y-p,S-w,R-T).normalize(),r)i[4].setComponents(c,v,_,P).normalize(),i[5].setComponents(u-c,y-v,S-_,R-P).normalize();else if(i[4].setComponents(u-c,y-v,S-_,R-P).normalize(),n===Zs)i[5].setComponents(u+c,y+v,S+_,R+P).normalize();else if(n===Nv)i[5].setComponents(c,v,_,P).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),kh.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),kh.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(kh)}intersectsSprite(e){kh.center.set(0,0,0);const n=VMe.distanceTo(e.center);return kh.radius=.7071067811865476+n,kh.applyMatrix4(e.matrixWorld),this.intersectsSphere(kh)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let a=0;a<6;a++)if(n[a].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const n=this.planes;for(let r=0;r<6;r++){const i=n[r];if(JS.x=i.normal.x>0?e.max.x:e.min.x,JS.y=i.normal.y>0?e.max.y:e.min.y,JS.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(JS)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const wc=new qt,Mc=new ly;class sT{constructor(){this.coordinateSystem=Zs}intersectsObject(e,n){if(!n.isArrayCamera||n.cameras.length===0)return!1;for(let r=0;r<n.cameras.length;r++){const i=n.cameras[r];if(wc.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Mc.setFromProjectionMatrix(wc,i.coordinateSystem,i.reversedDepth),Mc.intersectsObject(e))return!0}return!1}intersectsSprite(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let r=0;r<n.cameras.length;r++){const i=n.cameras[r];if(wc.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Mc.setFromProjectionMatrix(wc,i.coordinateSystem,i.reversedDepth),Mc.intersectsSprite(e))return!0}return!1}intersectsSphere(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let r=0;r<n.cameras.length;r++){const i=n.cameras[r];if(wc.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Mc.setFromProjectionMatrix(wc,i.coordinateSystem,i.reversedDepth),Mc.intersectsSphere(e))return!0}return!1}intersectsBox(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let r=0;r<n.cameras.length;r++){const i=n.cameras[r];if(wc.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Mc.setFromProjectionMatrix(wc,i.coordinateSystem,i.reversedDepth),Mc.intersectsBox(e))return!0}return!1}containsPoint(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let r=0;r<n.cameras.length;r++){const i=n.cameras[r];if(wc.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Mc.setFromProjectionMatrix(wc,i.coordinateSystem,i.reversedDepth),Mc.containsPoint(e))return!0}return!1}clone(){return new sT}}function pD(t,e){return t-e}function WMe(t,e){return t.z-e.z}function qMe(t,e){return e.z-t.z}class $Me{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,n,r,i){const a=this.pool,s=this.list;this.index>=a.length&&a.push({start:-1,count:-1,z:-1,index:-1});const o=a[this.index];s.push(o),this.index++,o.start=e,o.count=n,o.z=r,o.index=i}reset(){this.list.length=0,this.index=0}}const Ps=new qt,XMe=new bt(1,1,1),NG=new ly,KMe=new sT,ZS=new Oi,Fh=new Zi,cx=new ne,IG=new ne,YMe=new ne,mD=new $Me,Ra=new vi,QS=[];function JMe(t,e,n=0){const r=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const i=t.count;for(let a=0;a<i;a++)for(let s=0;s<r;s++)e.setComponent(a+n,s,t.getComponent(a,s))}else e.array.set(t.array,n*r);e.needsUpdate=!0}function Uh(t,e){if(t.constructor!==e.constructor){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++)e[r]=t[r]}else{const n=Math.min(t.length,e.length);e.set(new t.constructor(t.buffer,0,n))}}class dY extends vi{constructor(e,n,r=n*2,i){super(new an,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=n,this._maxIndexCount=r,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4),r=new Fl(n,e,e,Ba,os);this._matricesTexture=r}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const n=new Uint32Array(e*e),r=new Fl(n,e,e,l1,Ko);this._indirectTexture=r}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const n=new Float32Array(e*e*4).fill(1),r=new Fl(n,e,e,Ba,os);r.colorSpace=Fn.workingColorSpace,this._colorsTexture=r}_initializeGeometry(e){const n=this.geometry,r=this._maxVertexCount,i=this._maxIndexCount;if(this._geometryInitialized===!1){for(const a in e.attributes){const s=e.getAttribute(a),{array:o,itemSize:c,normalized:u}=s,h=new o.constructor(r*c),p=new qn(h,c,u);n.setAttribute(a,p)}if(e.getIndex()!==null){const a=r>65535?new Uint32Array(i):new Uint16Array(i);n.setIndex(new qn(a,1))}this._geometryInitialized=!0}}_validateGeometry(e){const n=this.geometry;if(!!e.getIndex()!=!!n.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const r in n.attributes){if(!e.hasAttribute(r))throw new Error(`THREE.BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),a=n.getAttribute(r);if(i.itemSize!==a.itemSize||i.normalized!==a.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const n=this._instanceInfo;if(e<0||e>=n.length||n[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const n=this._geometryInfo;if(e<0||e>=n.length||n[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Oi);const e=this.boundingBox,n=this._instanceInfo;e.makeEmpty();for(let r=0,i=n.length;r<i;r++){if(n[r].active===!1)continue;const a=n[r].geometryIndex;this.getMatrixAt(r,Ps),this.getBoundingBoxAt(a,ZS).applyMatrix4(Ps),e.union(ZS)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Zi);const e=this.boundingSphere,n=this._instanceInfo;e.makeEmpty();for(let r=0,i=n.length;r<i;r++){if(n[r].active===!1)continue;const a=n[r].geometryIndex;this.getMatrixAt(r,Ps),this.getBoundingSphereAt(a,Fh).applyMatrix4(Ps),e.union(Fh)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const r={visible:!0,active:!0,geometryIndex:e};let i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(pD),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=r):(i=this._instanceInfo.length,this._instanceInfo.push(r));const a=this._matricesTexture;Ps.identity().toArray(a.image.data,i*16),a.needsUpdate=!0;const s=this._colorsTexture;return s&&(XMe.toArray(s.image.data,i*4),s.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(e,n=-1,r=-1){this._initializeGeometry(e),this._validateGeometry(e);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=n===-1?e.getAttribute("position").count:n;const s=e.getIndex();if(s!==null&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=r===-1?s.count:r),i.indexStart!==-1&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let c;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(pD),c=this._availableGeometryIds.shift(),a[c]=i):(c=this._geometryCount,this._geometryCount++,a.push(i)),this.setGeometryAt(c,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,c}setGeometryAt(e,n){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(n);const r=this.geometry,i=r.getIndex()!==null,a=r.getIndex(),s=n.getIndex(),o=this._geometryInfo[e];if(i&&s.count>o.reservedIndexCount||n.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const c=o.vertexStart,u=o.reservedVertexCount;o.vertexCount=n.getAttribute("position").count;for(const h in r.attributes){const p=n.getAttribute(h),v=r.getAttribute(h);JMe(p,v,c);const y=p.itemSize;for(let b=p.count,w=u;b<w;b++){const _=c+b;for(let S=0;S<y;S++)v.setComponent(_,S,0)}v.needsUpdate=!0,v.addUpdateRange(c*y,u*y)}if(i){const h=o.indexStart,p=o.reservedIndexCount;o.indexCount=n.getIndex().count;for(let v=0;v<s.count;v++)a.setX(h+v,c+s.getX(v));for(let v=s.count,y=p;v<y;v++)a.setX(h+v,c);a.needsUpdate=!0,a.addUpdateRange(h,o.reservedIndexCount)}return o.start=i?o.indexStart:o.vertexStart,o.count=i?o.indexCount:o.vertexCount,o.boundingBox=null,n.boundingBox!==null&&(o.boundingBox=n.boundingBox.clone()),o.boundingSphere=null,n.boundingSphere!==null&&(o.boundingSphere=n.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const n=this._geometryInfo;if(e>=n.length||n[e].active===!1)return this;const r=this._instanceInfo;for(let i=0,a=r.length;i<a;i++)r[i].active&&r[i].geometryIndex===e&&this.deleteInstance(i);return n[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,n=0;const r=this._geometryInfo,i=r.map((s,o)=>o).sort((s,o)=>r[s].vertexStart-r[o].vertexStart),a=this.geometry;for(let s=0,o=r.length;s<o;s++){const c=i[s],u=r[c];if(u.active!==!1){if(a.index!==null){if(u.indexStart!==n){const{indexStart:h,vertexStart:p,reservedIndexCount:v}=u,y=a.index,b=y.array,w=e-p;for(let _=h;_<h+v;_++)b[_]=b[_]+w;y.array.copyWithin(n,h,h+v),y.addUpdateRange(n,v),y.needsUpdate=!0,u.indexStart=n}n+=u.reservedIndexCount}if(u.vertexStart!==e){const{vertexStart:h,reservedVertexCount:p}=u,v=a.attributes;for(const y in v){const b=v[y],{array:w,itemSize:_}=b;w.copyWithin(e*_,h*_,(h+p)*_),b.addUpdateRange(e*_,p*_),b.needsUpdate=!0}u.vertexStart=e}e+=u.reservedVertexCount,u.start=a.index?u.indexStart:u.vertexStart,this._nextIndexStart=a.index?u.indexStart+u.reservedIndexCount:0,this._nextVertexStart=u.vertexStart+u.reservedVertexCount}}return this._visibilityChanged=!0,this}getBoundingBoxAt(e,n){if(e>=this._geometryCount)return null;const r=this.geometry,i=this._geometryInfo[e];if(i.boundingBox===null){const a=new Oi,s=r.index,o=r.attributes.position;for(let c=i.start,u=i.start+i.count;c<u;c++){let h=c;s&&(h=s.getX(h)),a.expandByPoint(cx.fromBufferAttribute(o,h))}i.boundingBox=a}return n.copy(i.boundingBox),n}getBoundingSphereAt(e,n){if(e>=this._geometryCount)return null;const r=this.geometry,i=this._geometryInfo[e];if(i.boundingSphere===null){const a=new Zi;this.getBoundingBoxAt(e,ZS),ZS.getCenter(a.center);const s=r.index,o=r.attributes.position;let c=0;for(let u=i.start,h=i.start+i.count;u<h;u++){let p=u;s&&(p=s.getX(p)),cx.fromBufferAttribute(o,p),c=Math.max(c,a.center.distanceToSquared(cx))}a.radius=Math.sqrt(c),i.boundingSphere=a}return n.copy(i.boundingSphere),n}setMatrixAt(e,n){this.validateInstanceId(e);const r=this._matricesTexture,i=this._matricesTexture.image.data;return n.toArray(i,e*16),r.needsUpdate=!0,this}getMatrixAt(e,n){return this.validateInstanceId(e),n.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,n){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),n.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,n){return this.validateInstanceId(e),n.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,n){return this.validateInstanceId(e),this._instanceInfo[e].visible===n?this:(this._instanceInfo[e].visible=n,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,n){return this.validateInstanceId(e),this.validateGeometryId(n),this._instanceInfo[e].geometryIndex=n,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,n={}){this.validateGeometryId(e);const r=this._geometryInfo[e];return n.vertexStart=r.vertexStart,n.vertexCount=r.vertexCount,n.reservedVertexCount=r.reservedVertexCount,n.indexStart=r.indexStart,n.indexCount=r.indexCount,n.reservedIndexCount=r.reservedIndexCount,n.start=r.start,n.count=r.count,n}setInstanceCount(e){const n=this._availableInstanceIds,r=this._instanceInfo;for(n.sort(pD);n[n.length-1]===r.length-1;)r.pop(),n.pop();if(e<r.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const i=new Int32Array(e),a=new Int32Array(e);Uh(this._multiDrawCounts,i),Uh(this._multiDrawStarts,a),this._multiDrawCounts=i,this._multiDrawStarts=a,this._maxInstanceCount=e;const s=this._indirectTexture,o=this._matricesTexture,c=this._colorsTexture;s.dispose(),this._initIndirectTexture(),Uh(s.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),Uh(o.image.data,this._matricesTexture.image.data),c&&(c.dispose(),this._initColorsTexture(),Uh(c.image.data,this._colorsTexture.image.data))}setGeometrySize(e,n){const r=[...this._geometryInfo].filter(o=>o.active);if(Math.max(...r.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${n}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...r.map(c=>c.indexStart+c.reservedIndexCount))>n)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${n}. Cannot shrink further.`);const a=this.geometry;a.dispose(),this._maxVertexCount=e,this._maxIndexCount=n,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new an,this._initializeGeometry(a));const s=this.geometry;a.index&&Uh(a.index.array,s.index.array);for(const o in a.attributes)Uh(a.attributes[o].array,s.attributes[o].array)}raycast(e,n){const r=this._instanceInfo,i=this._geometryInfo,a=this.matrixWorld,s=this.geometry;Ra.material=this.material,Ra.geometry.index=s.index,Ra.geometry.attributes=s.attributes,Ra.geometry.boundingBox===null&&(Ra.geometry.boundingBox=new Oi),Ra.geometry.boundingSphere===null&&(Ra.geometry.boundingSphere=new Zi);for(let o=0,c=r.length;o<c;o++){if(!r[o].visible||!r[o].active)continue;const u=r[o].geometryIndex,h=i[u];Ra.geometry.setDrawRange(h.start,h.count),this.getMatrixAt(o,Ra.matrixWorld).premultiply(a),this.getBoundingBoxAt(u,Ra.geometry.boundingBox),this.getBoundingSphereAt(u,Ra.geometry.boundingSphere),Ra.raycast(e,QS);for(let p=0,v=QS.length;p<v;p++){const y=QS[p];y.object=this,y.batchId=o,n.push(y)}QS.length=0}Ra.material=null,Ra.geometry.index=null,Ra.geometry.attributes={},Ra.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(n=>({...n,boundingBox:n.boundingBox!==null?n.boundingBox.clone():null,boundingSphere:n.boundingSphere!==null?n.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(n=>({...n})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,n,r,i,a){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=i.getIndex(),o=s===null?1:s.array.BYTES_PER_ELEMENT,c=this._instanceInfo,u=this._multiDrawStarts,h=this._multiDrawCounts,p=this._geometryInfo,v=this.perObjectFrustumCulled,y=this._indirectTexture,b=y.image.data,w=r.isArrayCamera?KMe:NG;v&&!r.isArrayCamera&&(Ps.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),NG.setFromProjectionMatrix(Ps,r.coordinateSystem,r.reversedDepth));let _=0;if(this.sortObjects){Ps.copy(this.matrixWorld).invert(),cx.setFromMatrixPosition(r.matrixWorld).applyMatrix4(Ps),IG.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(Ps);for(let T=0,P=c.length;T<P;T++)if(c[T].visible&&c[T].active){const R=c[T].geometryIndex;this.getMatrixAt(T,Ps),this.getBoundingSphereAt(R,Fh).applyMatrix4(Ps);let D=!1;if(v&&(D=!w.intersectsSphere(Fh,r)),!D){const I=p[R],k=YMe.subVectors(Fh.center,cx).dot(IG);mD.push(I.start,I.count,k,T)}}const S=mD.list,E=this.customSort;E===null?S.sort(a.transparent?qMe:WMe):E.call(this,S,r);for(let T=0,P=S.length;T<P;T++){const R=S[T];u[_]=R.start*o,h[_]=R.count,b[_]=R.index,_++}mD.reset()}else for(let S=0,E=c.length;S<E;S++)if(c[S].visible&&c[S].active){const T=c[S].geometryIndex;let P=!1;if(v&&(this.getMatrixAt(S,Ps),this.getBoundingSphereAt(T,Fh).applyMatrix4(Ps),P=!w.intersectsSphere(Fh,r)),!P){const R=p[T];u[_]=R.start*o,h[_]=R.count,b[_]=S,_++}}y.needsUpdate=!0,this._multiDrawCount=_,this._visibilityChanged=!1}onBeforeShadow(e,n,r,i,a,s){this.onBeforeRender(e,null,i,a,s)}}class La extends zi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new bt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const VM=new ne,WM=new ne,BG=new qt,ux=new Hp,eA=new Zi,gD=new ne,LG=new ne;class of extends zn{constructor(e=new an,n=new La){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,a=n.count;i<a;i++)VM.fromBufferAttribute(n,i-1),WM.fromBufferAttribute(n,i),r[i]=r[i-1],r[i]+=VM.distanceTo(WM);e.setAttribute("lineDistance",new Pt(r,1))}else xt("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,n){const r=this.geometry,i=this.matrixWorld,a=e.params.Line.threshold,s=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),eA.copy(r.boundingSphere),eA.applyMatrix4(i),eA.radius+=a,e.ray.intersectsSphere(eA)===!1)return;BG.copy(i).invert(),ux.copy(e.ray).applyMatrix4(BG);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,u=this.isLineSegments?2:1,h=r.index,v=r.attributes.position;if(h!==null){const y=Math.max(0,s.start),b=Math.min(h.count,s.start+s.count);for(let w=y,_=b-1;w<_;w+=u){const S=h.getX(w),E=h.getX(w+1),T=tA(this,e,ux,c,S,E,w);T&&n.push(T)}if(this.isLineLoop){const w=h.getX(b-1),_=h.getX(y),S=tA(this,e,ux,c,w,_,b-1);S&&n.push(S)}}else{const y=Math.max(0,s.start),b=Math.min(v.count,s.start+s.count);for(let w=y,_=b-1;w<_;w+=u){const S=tA(this,e,ux,c,w,w+1,w);S&&n.push(S)}if(this.isLineLoop){const w=tA(this,e,ux,c,b-1,y,b-1);w&&n.push(w)}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;a<s;a++){const o=i[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}}function tA(t,e,n,r,i,a,s){const o=t.geometry.attributes.position;if(VM.fromBufferAttribute(o,i),WM.fromBufferAttribute(o,a),n.distanceSqToSegment(VM,WM,gD,LG)>r)return;gD.applyMatrix4(t.matrixWorld);const u=e.ray.origin.distanceTo(gD);if(!(u<e.near||u>e.far))return{distance:u,point:LG.clone().applyMatrix4(t.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:t}}const kG=new ne,FG=new ne;class Hl extends of{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,a=n.count;i<a;i+=2)kG.fromBufferAttribute(n,i),FG.fromBufferAttribute(n,i+1),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+kG.distanceTo(FG);e.setAttribute("lineDistance",new Pt(r,1))}else xt("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class K5 extends of{constructor(e,n){super(e,n),this.isLineLoop=!0,this.type="LineLoop"}}class oT extends zi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new bt(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 UG=new qt,aB=new Hp,nA=new Zi,rA=new ne;class Y5 extends zn{constructor(e=new an,n=new oT){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,n){const r=this.geometry,i=this.matrixWorld,a=e.params.Points.threshold,s=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),nA.copy(r.boundingSphere),nA.applyMatrix4(i),nA.radius+=a,e.ray.intersectsSphere(nA)===!1)return;UG.copy(i).invert(),aB.copy(e.ray).applyMatrix4(UG);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,u=r.index,p=r.attributes.position;if(u!==null){const v=Math.max(0,s.start),y=Math.min(u.count,s.start+s.count);for(let b=v,w=y;b<w;b++){const _=u.getX(b);rA.fromBufferAttribute(p,_),jG(rA,_,c,i,e,n,this)}}else{const v=Math.max(0,s.start),y=Math.min(p.count,s.start+s.count);for(let b=v,w=y;b<w;b++)rA.fromBufferAttribute(p,b),jG(rA,b,c,i,e,n,this)}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;a<s;a++){const o=i[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}}function jG(t,e,n,r,i,a,s){const o=aB.distanceSqToPoint(t);if(o<n){const c=new ne;aB.closestPointToPoint(t,c),c.applyMatrix4(r);const u=i.ray.origin.distanceTo(c);if(u<i.near||u>i.far)return;a.push({distance:u,distanceToRay:Math.sqrt(o),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class hY extends Gr{constructor(e,n,r,i,a=vr,s=vr,o,c,u){super(e,n,r,i,a,s,o,c,u),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const h=this;function p(){h.needsUpdate=!0,h._requestVideoFrameCallbackId=e.requestVideoFrameCallback(p)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(p))}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)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class ZMe extends hY{constructor(e,n,r,i,a,s,o,c){super({},e,n,r,i,a,s,o,c),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class QMe extends Gr{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=si,this.minFilter=si,this.generateMipmaps=!1,this.needsUpdate=!0}}class lT extends Gr{constructor(e,n,r,i,a,s,o,c,u,h,p,v){super(null,s,o,c,u,h,i,a,p,v),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class eEe extends lT{constructor(e,n,r,i,a,s){super(e,n,r,a,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=ss,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class tEe extends lT{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,Wc),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class nEe extends Gr{constructor(e,n,r,i,a,s,o,c,u){super(e,n,r,i,a,s,o,c,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Fv extends Gr{constructor(e,n,r=Ko,i,a,s,o=si,c=si,u,h=$c,p=1){if(h!==$c&&h!==Sd)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const v={width:e,height:n,depth:p};super(v,i,a,s,o,c,h,r,u),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Ad(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class pY extends Fv{constructor(e,n=Ko,r=Wc,i,a,s=si,o=si,c,u=$c){const h={width:e,height:e,depth:1},p=[h,h,h,h,h,h];super(e,e,n,r,i,a,s,o,c,u),this.image=p,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class J5 extends Gr{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class cT extends an{constructor(e=1,n=1,r=4,i=8,a=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:n,capSegments:r,radialSegments:i,heightSegments:a},n=Math.max(0,n),r=Math.max(1,Math.floor(r)),i=Math.max(3,Math.floor(i)),a=Math.max(1,Math.floor(a));const s=[],o=[],c=[],u=[],h=n/2,p=Math.PI/2*e,v=n,y=2*p+v,b=r*2+a,w=i+1,_=new ne,S=new ne;for(let E=0;E<=b;E++){let T=0,P=0,R=0,D=0;if(E<=r){const B=E/r,U=B*Math.PI/2;P=-h-e*Math.cos(U),R=e*Math.sin(U),D=-e*Math.cos(U),T=B*p}else if(E<=r+a){const B=(E-r)/a;P=-h+B*n,R=e,D=0,T=p+B*v}else{const B=(E-r-a)/r,U=B*Math.PI/2;P=h+e*Math.sin(U),R=e*Math.cos(U),D=e*Math.sin(U),T=p+v+B*p}const I=Math.max(0,Math.min(1,T/y));let k=0;E===0?k=.5/i:E===b&&(k=-.5/i);for(let B=0;B<=i;B++){const U=B/i,z=U*Math.PI*2,q=Math.sin(z),W=Math.cos(z);S.x=-R*W,S.y=P,S.z=R*q,o.push(S.x,S.y,S.z),_.set(-R*W,D,R*q),_.normalize(),c.push(_.x,_.y,_.z),u.push(U+k,I)}if(E>0){const B=(E-1)*w;for(let U=0;U<i;U++){const z=B+U,q=B+U+1,W=E*w+U,ee=E*w+U+1;s.push(z,q,W),s.push(q,ee,W)}}}this.setIndex(s),this.setAttribute("position",new Pt(o,3)),this.setAttribute("normal",new Pt(c,3)),this.setAttribute("uv",new Pt(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new cT(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class uT extends an{constructor(e=1,n=32,r=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:n,thetaStart:r,thetaLength:i},n=Math.max(3,n);const a=[],s=[],o=[],c=[],u=new ne,h=new Ve;s.push(0,0,0),o.push(0,0,1),c.push(.5,.5);for(let p=0,v=3;p<=n;p++,v+=3){const y=r+p/n*i;u.x=e*Math.cos(y),u.y=e*Math.sin(y),s.push(u.x,u.y,u.z),o.push(0,0,1),h.x=(s[v]/e+1)/2,h.y=(s[v+1]/e+1)/2,c.push(h.x,h.y)}for(let p=1;p<=n;p++)a.push(p,p+1,0);this.setIndex(a),this.setAttribute("position",new Pt(s,3)),this.setAttribute("normal",new Pt(o,3)),this.setAttribute("uv",new Pt(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new uT(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class d1 extends an{constructor(e=1,n=1,r=1,i=32,a=1,s=!1,o=0,c=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:r,radialSegments:i,heightSegments:a,openEnded:s,thetaStart:o,thetaLength:c};const u=this;i=Math.floor(i),a=Math.floor(a);const h=[],p=[],v=[],y=[];let b=0;const w=[],_=r/2;let S=0;E(),s===!1&&(e>0&&T(!0),n>0&&T(!1)),this.setIndex(h),this.setAttribute("position",new Pt(p,3)),this.setAttribute("normal",new Pt(v,3)),this.setAttribute("uv",new Pt(y,2));function E(){const P=new ne,R=new ne;let D=0;const I=(n-e)/r;for(let k=0;k<=a;k++){const B=[],U=k/a,z=U*(n-e)+e;for(let q=0;q<=i;q++){const W=q/i,ee=W*c+o,Q=Math.sin(ee),V=Math.cos(ee);R.x=z*Q,R.y=-U*r+_,R.z=z*V,p.push(R.x,R.y,R.z),P.set(Q,I,V).normalize(),v.push(P.x,P.y,P.z),y.push(W,1-U),B.push(b++)}w.push(B)}for(let k=0;k<i;k++)for(let B=0;B<a;B++){const U=w[B][k],z=w[B+1][k],q=w[B+1][k+1],W=w[B][k+1];(e>0||B!==0)&&(h.push(U,z,W),D+=3),(n>0||B!==a-1)&&(h.push(z,q,W),D+=3)}u.addGroup(S,D,0),S+=D}function T(P){const R=b,D=new Ve,I=new ne;let k=0;const B=P===!0?e:n,U=P===!0?1:-1;for(let q=1;q<=i;q++)p.push(0,_*U,0),v.push(0,U,0),y.push(.5,.5),b++;const z=b;for(let q=0;q<=i;q++){const ee=q/i*c+o,Q=Math.cos(ee),V=Math.sin(ee);I.x=B*V,I.y=_*U,I.z=B*Q,p.push(I.x,I.y,I.z),v.push(0,U,0),D.x=Q*.5+.5,D.y=V*.5*U+.5,y.push(D.x,D.y),b++}for(let q=0;q<i;q++){const W=R+q,ee=z+q;P===!0?h.push(ee,ee+1,W):h.push(ee+1,ee,W),k+=3}u.addGroup(S,k,P===!0?1:2),S+=k}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new d1(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class h1 extends d1{constructor(e=1,n=1,r=32,i=1,a=!1,s=0,o=Math.PI*2){super(0,e,n,r,i,a,s,o),this.type="ConeGeometry",this.parameters={radius:e,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:s,thetaLength:o}}static fromJSON(e){return new h1(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Gd extends an{constructor(e=[],n=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:n,radius:r,detail:i};const a=[],s=[];o(i),u(r),h(),this.setAttribute("position",new Pt(a,3)),this.setAttribute("normal",new Pt(a.slice(),3)),this.setAttribute("uv",new Pt(s,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function o(E){const T=new ne,P=new ne,R=new ne;for(let D=0;D<n.length;D+=3)y(n[D+0],T),y(n[D+1],P),y(n[D+2],R),c(T,P,R,E)}function c(E,T,P,R){const D=R+1,I=[];for(let k=0;k<=D;k++){I[k]=[];const B=E.clone().lerp(P,k/D),U=T.clone().lerp(P,k/D),z=D-k;for(let q=0;q<=z;q++)q===0&&k===D?I[k][q]=B:I[k][q]=B.clone().lerp(U,q/z)}for(let k=0;k<D;k++)for(let B=0;B<2*(D-k)-1;B++){const U=Math.floor(B/2);B%2===0?(v(I[k][U+1]),v(I[k+1][U]),v(I[k][U])):(v(I[k][U+1]),v(I[k+1][U+1]),v(I[k+1][U]))}}function u(E){const T=new ne;for(let P=0;P<a.length;P+=3)T.x=a[P+0],T.y=a[P+1],T.z=a[P+2],T.normalize().multiplyScalar(E),a[P+0]=T.x,a[P+1]=T.y,a[P+2]=T.z}function h(){const E=new ne;for(let T=0;T<a.length;T+=3){E.x=a[T+0],E.y=a[T+1],E.z=a[T+2];const P=_(E)/2/Math.PI+.5,R=S(E)/Math.PI+.5;s.push(P,1-R)}b(),p()}function p(){for(let E=0;E<s.length;E+=6){const T=s[E+0],P=s[E+2],R=s[E+4],D=Math.max(T,P,R),I=Math.min(T,P,R);D>.9&&I<.1&&(T<.2&&(s[E+0]+=1),P<.2&&(s[E+2]+=1),R<.2&&(s[E+4]+=1))}}function v(E){a.push(E.x,E.y,E.z)}function y(E,T){const P=E*3;T.x=e[P+0],T.y=e[P+1],T.z=e[P+2]}function b(){const E=new ne,T=new ne,P=new ne,R=new ne,D=new Ve,I=new Ve,k=new Ve;for(let B=0,U=0;B<a.length;B+=9,U+=6){E.set(a[B+0],a[B+1],a[B+2]),T.set(a[B+3],a[B+4],a[B+5]),P.set(a[B+6],a[B+7],a[B+8]),D.set(s[U+0],s[U+1]),I.set(s[U+2],s[U+3]),k.set(s[U+4],s[U+5]),R.copy(E).add(T).add(P).divideScalar(3);const z=_(R);w(D,U+0,E,z),w(I,U+2,T,z),w(k,U+4,P,z)}}function w(E,T,P,R){R<0&&E.x===1&&(s[T]=E.x-1),P.x===0&&P.z===0&&(s[T]=R/2/Math.PI+.5)}function _(E){return Math.atan2(E.z,-E.x)}function S(E){return Math.atan2(-E.y,Math.sqrt(E.x*E.x+E.z*E.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Gd(e.vertices,e.indices,e.radius,e.detail)}}class fT extends Gd{constructor(e=1,n=0){const r=(1+Math.sqrt(5))/2,i=1/r,a=[-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],s=[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(a,s,e,n),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new fT(e.radius,e.detail)}}const iA=new ne,aA=new ne,vD=new ne,sA=new Ns;class mY extends an{constructor(e=null,n=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:n},e!==null){const i=Math.pow(10,4),a=Math.cos(bp*n),s=e.getIndex(),o=e.getAttribute("position"),c=s?s.count:o.count,u=[0,0,0],h=["a","b","c"],p=new Array(3),v={},y=[];for(let b=0;b<c;b+=3){s?(u[0]=s.getX(b),u[1]=s.getX(b+1),u[2]=s.getX(b+2)):(u[0]=b,u[1]=b+1,u[2]=b+2);const{a:w,b:_,c:S}=sA;if(w.fromBufferAttribute(o,u[0]),_.fromBufferAttribute(o,u[1]),S.fromBufferAttribute(o,u[2]),sA.getNormal(vD),p[0]=`${Math.round(w.x*i)},${Math.round(w.y*i)},${Math.round(w.z*i)}`,p[1]=`${Math.round(_.x*i)},${Math.round(_.y*i)},${Math.round(_.z*i)}`,p[2]=`${Math.round(S.x*i)},${Math.round(S.y*i)},${Math.round(S.z*i)}`,!(p[0]===p[1]||p[1]===p[2]||p[2]===p[0]))for(let E=0;E<3;E++){const T=(E+1)%3,P=p[E],R=p[T],D=sA[h[E]],I=sA[h[T]],k=`${P}_${R}`,B=`${R}_${P}`;B in v&&v[B]?(vD.dot(v[B].normal)<=a&&(y.push(D.x,D.y,D.z),y.push(I.x,I.y,I.z)),v[B]=null):k in v||(v[k]={index0:u[E],index1:u[T],normal:vD.clone()})}}for(const b in v)if(v[b]){const{index0:w,index1:_}=v[b];iA.fromBufferAttribute(o,w),aA.fromBufferAttribute(o,_),y.push(iA.x,iA.y,iA.z),y.push(aA.x,aA.y,aA.z)}this.setAttribute("position",new Pt(y,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Vl{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){xt("Curve: .getPoint() not implemented.")}getPointAt(e,n){const r=this.getUtoTmapping(e);return this.getPoint(r,n)}getPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return n}getSpacedPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n}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 n=[];let r,i=this.getPoint(0),a=0;n.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),a+=r.distanceTo(i),n.push(a),i=r;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n=null){const r=this.getLengths();let i=0;const a=r.length;let s;n?s=n:s=e*r[a-1];let o=0,c=a-1,u;for(;o<=c;)if(i=Math.floor(o+(c-o)/2),u=r[i]-s,u<0)o=i+1;else if(u>0)c=i-1;else{c=i;break}if(i=c,r[i]===s)return i/(a-1);const h=r[i],v=r[i+1]-h,y=(s-h)/v;return(i+y)/(a-1)}getTangent(e,n){let i=e-1e-4,a=e+1e-4;i<0&&(i=0),a>1&&(a=1);const s=this.getPoint(i),o=this.getPoint(a),c=n||(s.isVector2?new Ve:new ne);return c.copy(o).sub(s).normalize(),c}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n=!1){const r=new ne,i=[],a=[],s=[],o=new ne,c=new qt;for(let y=0;y<=e;y++){const b=y/e;i[y]=this.getTangentAt(b,new ne)}a[0]=new ne,s[0]=new ne;let u=Number.MAX_VALUE;const h=Math.abs(i[0].x),p=Math.abs(i[0].y),v=Math.abs(i[0].z);h<=u&&(u=h,r.set(1,0,0)),p<=u&&(u=p,r.set(0,1,0)),v<=u&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),a[0].crossVectors(i[0],o),s[0].crossVectors(i[0],a[0]);for(let y=1;y<=e;y++){if(a[y]=a[y-1].clone(),s[y]=s[y-1].clone(),o.crossVectors(i[y-1],i[y]),o.length()>Number.EPSILON){o.normalize();const b=Math.acos(tn(i[y-1].dot(i[y]),-1,1));a[y].applyMatrix4(c.makeRotationAxis(o,b))}s[y].crossVectors(i[y],a[y])}if(n===!0){let y=Math.acos(tn(a[0].dot(a[e]),-1,1));y/=e,i[0].dot(o.crossVectors(a[0],a[e]))>0&&(y=-y);for(let b=1;b<=e;b++)a[b].applyMatrix4(c.makeRotationAxis(i[b],y*b)),s[b].crossVectors(i[b],a[b])}return{tangents:i,normals:a,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class dT extends Vl{constructor(e=0,n=0,r=1,i=1,a=0,s=Math.PI*2,o=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=r,this.yRadius=i,this.aStartAngle=a,this.aEndAngle=s,this.aClockwise=o,this.aRotation=c}getPoint(e,n=new Ve){const r=n,i=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const s=Math.abs(a)<Number.EPSILON;for(;a<0;)a+=i;for(;a>i;)a-=i;a<Number.EPSILON&&(s?a=0:a=i),this.aClockwise===!0&&!s&&(a===i?a=-i:a=a-i);const o=this.aStartAngle+e*a;let c=this.aX+this.xRadius*Math.cos(o),u=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const h=Math.cos(this.aRotation),p=Math.sin(this.aRotation),v=c-this.aX,y=u-this.aY;c=v*h-y*p+this.aX,u=v*p+y*h+this.aY}return r.set(c,u)}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 gY extends dT{constructor(e,n,r,i,a,s){super(e,n,r,r,i,a,s),this.isArcCurve=!0,this.type="ArcCurve"}}function Z5(){let t=0,e=0,n=0,r=0;function i(a,s,o,c){t=a,e=o,n=-3*a+3*s-2*o-c,r=2*a-2*s+o+c}return{initCatmullRom:function(a,s,o,c,u){i(s,o,u*(o-a),u*(c-s))},initNonuniformCatmullRom:function(a,s,o,c,u,h,p){let v=(s-a)/u-(o-a)/(u+h)+(o-s)/h,y=(o-s)/h-(c-s)/(h+p)+(c-o)/p;v*=h,y*=h,i(s,o,v,y)},calc:function(a){const s=a*a,o=s*a;return t+e*a+n*s+r*o}}}const oA=new ne,yD=new Z5,xD=new Z5,bD=new Z5;class vY extends Vl{constructor(e=[],n=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=n,this.curveType=r,this.tension=i}getPoint(e,n=new ne){const r=n,i=this.points,a=i.length,s=(a-(this.closed?0:1))*e;let o=Math.floor(s),c=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:c===0&&o===a-1&&(o=a-2,c=1);let u,h;this.closed||o>0?u=i[(o-1)%a]:(oA.subVectors(i[0],i[1]).add(i[0]),u=oA);const p=i[o%a],v=i[(o+1)%a];if(this.closed||o+2<a?h=i[(o+2)%a]:(oA.subVectors(i[a-1],i[a-2]).add(i[a-1]),h=oA),this.curveType==="centripetal"||this.curveType==="chordal"){const y=this.curveType==="chordal"?.5:.25;let b=Math.pow(u.distanceToSquared(p),y),w=Math.pow(p.distanceToSquared(v),y),_=Math.pow(v.distanceToSquared(h),y);w<1e-4&&(w=1),b<1e-4&&(b=w),_<1e-4&&(_=w),yD.initNonuniformCatmullRom(u.x,p.x,v.x,h.x,b,w,_),xD.initNonuniformCatmullRom(u.y,p.y,v.y,h.y,b,w,_),bD.initNonuniformCatmullRom(u.z,p.z,v.z,h.z,b,w,_)}else this.curveType==="catmullrom"&&(yD.initCatmullRom(u.x,p.x,v.x,h.x,this.tension),xD.initCatmullRom(u.y,p.y,v.y,h.y,this.tension),bD.initCatmullRom(u.z,p.z,v.z,h.z,this.tension));return r.set(yD.calc(c),xD.calc(c),bD.calc(c)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n<r;n++){const i=e.points[n];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 n=0,r=this.points.length;n<r;n++){const i=this.points[n];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 n=0,r=e.points.length;n<r;n++){const i=e.points[n];this.points.push(new ne().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function zG(t,e,n,r,i){const a=(r-e)*.5,s=(i-n)*.5,o=t*t,c=t*o;return(2*n-2*r+a+s)*c+(-3*n+3*r-2*a-s)*o+a*t+n}function rEe(t,e){const n=1-t;return n*n*e}function iEe(t,e){return 2*(1-t)*t*e}function aEe(t,e){return t*t*e}function jx(t,e,n,r){return rEe(t,e)+iEe(t,n)+aEe(t,r)}function sEe(t,e){const n=1-t;return n*n*n*e}function oEe(t,e){const n=1-t;return 3*n*n*t*e}function lEe(t,e){return 3*(1-t)*t*t*e}function cEe(t,e){return t*t*t*e}function zx(t,e,n,r,i){return sEe(t,e)+oEe(t,n)+lEe(t,r)+cEe(t,i)}class Q5 extends Vl{constructor(e=new Ve,n=new Ve,r=new Ve,i=new Ve){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=n,this.v2=r,this.v3=i}getPoint(e,n=new Ve){const r=n,i=this.v0,a=this.v1,s=this.v2,o=this.v3;return r.set(zx(e,i.x,a.x,s.x,o.x),zx(e,i.y,a.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.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 yY extends Vl{constructor(e=new ne,n=new ne,r=new ne,i=new ne){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=n,this.v2=r,this.v3=i}getPoint(e,n=new ne){const r=n,i=this.v0,a=this.v1,s=this.v2,o=this.v3;return r.set(zx(e,i.x,a.x,s.x,o.x),zx(e,i.y,a.y,s.y,o.y),zx(e,i.z,a.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.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 ek extends Vl{constructor(e=new Ve,n=new Ve){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=n}getPoint(e,n=new Ve){const r=n;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new Ve){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}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 xY extends Vl{constructor(e=new ne,n=new ne){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=n}getPoint(e,n=new ne){const r=n;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new ne){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}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 tk extends Vl{constructor(e=new Ve,n=new Ve,r=new Ve){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=n,this.v2=r}getPoint(e,n=new Ve){const r=n,i=this.v0,a=this.v1,s=this.v2;return r.set(jx(e,i.x,a.x,s.x),jx(e,i.y,a.y,s.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 nk extends Vl{constructor(e=new ne,n=new ne,r=new ne){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=n,this.v2=r}getPoint(e,n=new ne){const r=n,i=this.v0,a=this.v1,s=this.v2;return r.set(jx(e,i.x,a.x,s.x),jx(e,i.y,a.y,s.y),jx(e,i.z,a.z,s.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 rk extends Vl{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,n=new Ve){const r=n,i=this.points,a=(i.length-1)*e,s=Math.floor(a),o=a-s,c=i[s===0?s:s-1],u=i[s],h=i[s>i.length-2?i.length-1:s+1],p=i[s>i.length-3?i.length-1:s+2];return r.set(zG(o,c.x,u.x,h.x,p.x),zG(o,c.y,u.y,h.y,p.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n<r;n++){const i=e.points[n];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let n=0,r=this.points.length;n<r;n++){const i=this.points[n];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let n=0,r=e.points.length;n<r;n++){const i=e.points[n];this.points.push(new Ve().fromArray(i))}return this}}var qM=Object.freeze({__proto__:null,ArcCurve:gY,CatmullRomCurve3:vY,CubicBezierCurve:Q5,CubicBezierCurve3:yY,EllipseCurve:dT,LineCurve:ek,LineCurve3:xY,QuadraticBezierCurve:tk,QuadraticBezierCurve3:nk,SplineCurve:rk});class bY extends Vl{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),n=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(n)){const r=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new qM[r](n,e))}return this}getPoint(e,n){const r=e*this.getLength(),i=this.getCurveLengths();let a=0;for(;a<i.length;){if(i[a]>=r){const s=i[a]-r,o=this.curves[a],c=o.getLength(),u=c===0?0:1-s/c;return o.getPointAt(u,n)}a++}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 n=0;for(let r=0,i=this.curves.length;r<i;r++)n+=this.curves[r].getLength(),e.push(n);return this.cacheLengths=e,e}getSpacedPoints(e=40){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return this.autoClose&&n.push(n[0]),n}getPoints(e=12){const n=[];let r;for(let i=0,a=this.curves;i<a.length;i++){const s=a[i],o=s.isEllipseCurve?e*2:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,c=s.getPoints(o);for(let u=0;u<c.length;u++){const h=c[u];r&&r.equals(h)||(n.push(h),r=h)}}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,r=e.curves.length;n<r;n++){const i=e.curves[n];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let n=0,r=this.curves.length;n<r;n++){const i=this.curves[n];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let n=0,r=e.curves.length;n<r;n++){const i=e.curves[n];this.curves.push(new qM[i.type]().fromJSON(i))}return this}}class $M extends bY{constructor(e){super(),this.type="Path",this.currentPoint=new Ve,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let n=1,r=e.length;n<r;n++)this.lineTo(e[n].x,e[n].y);return this}moveTo(e,n){return this.currentPoint.set(e,n),this}lineTo(e,n){const r=new ek(this.currentPoint.clone(),new Ve(e,n));return this.curves.push(r),this.currentPoint.set(e,n),this}quadraticCurveTo(e,n,r,i){const a=new tk(this.currentPoint.clone(),new Ve(e,n),new Ve(r,i));return this.curves.push(a),this.currentPoint.set(r,i),this}bezierCurveTo(e,n,r,i,a,s){const o=new Q5(this.currentPoint.clone(),new Ve(e,n),new Ve(r,i),new Ve(a,s));return this.curves.push(o),this.currentPoint.set(a,s),this}splineThru(e){const n=[this.currentPoint.clone()].concat(e),r=new rk(n);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,n,r,i,a,s){const o=this.currentPoint.x,c=this.currentPoint.y;return this.absarc(e+o,n+c,r,i,a,s),this}absarc(e,n,r,i,a,s){return this.absellipse(e,n,r,r,i,a,s),this}ellipse(e,n,r,i,a,s,o,c){const u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+u,n+h,r,i,a,s,o,c),this}absellipse(e,n,r,i,a,s,o,c){const u=new dT(e,n,r,i,a,s,o,c);if(this.curves.length>0){const p=u.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(u);const h=u.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class _p extends $M{constructor(e){super(e),this.uuid=eo(),this.type="Shape",this.holes=[]}getPointsHoles(e){const n=[];for(let r=0,i=this.holes.length;r<i;r++)n[r]=this.holes[r].getPoints(e);return n}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let n=0,r=e.holes.length;n<r;n++){const i=e.holes[n];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let n=0,r=this.holes.length;n<r;n++){const i=this.holes[n];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let n=0,r=e.holes.length;n<r;n++){const i=e.holes[n];this.holes.push(new $M().fromJSON(i))}return this}}function uEe(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let a=_Y(t,0,i,n,!0);const s=[];if(!a||a.next===a.prev)return s;let o,c,u;if(r&&(a=mEe(t,e,a,n)),t.length>80*n){o=t[0],c=t[1];let h=o,p=c;for(let v=n;v<i;v+=n){const y=t[v],b=t[v+1];y<o&&(o=y),b<c&&(c=b),y>h&&(h=y),b>p&&(p=b)}u=Math.max(h-o,p-c),u=u!==0?32767/u:0}return Lb(a,s,n,o,c,u,0),s}function _Y(t,e,n,r,i){let a;if(i===EEe(t,e,n,r)>0)for(let s=e;s<n;s+=r)a=GG(s/r|0,t[s],t[s+1],a);else for(let s=n-r;s>=e;s-=r)a=GG(s/r|0,t[s],t[s+1],a);return a&&Uv(a,a.next)&&(Fb(a),a=a.next),a}function Op(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(Uv(n,n.next)||Yr(n.prev,n,n.next)===0)){if(Fb(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function Lb(t,e,n,r,i,a,s){if(!t)return;!s&&a&&bEe(t,r,i,a);let o=t;for(;t.prev!==t.next;){const c=t.prev,u=t.next;if(a?dEe(t,r,i,a):fEe(t)){e.push(c.i,t.i,u.i),Fb(t),t=u.next,o=u.next;continue}if(t=u,t===o){s?s===1?(t=hEe(Op(t),e),Lb(t,e,n,r,i,a,2)):s===2&&pEe(t,e,n,r,i,a):Lb(Op(t),e,n,r,i,a,1);break}}}function fEe(t){const e=t.prev,n=t,r=t.next;if(Yr(e,n,r)>=0)return!1;const i=e.x,a=n.x,s=r.x,o=e.y,c=n.y,u=r.y,h=Math.min(i,a,s),p=Math.min(o,c,u),v=Math.max(i,a,s),y=Math.max(o,c,u);let b=r.next;for(;b!==e;){if(b.x>=h&&b.x<=v&&b.y>=p&&b.y<=y&&xx(i,o,a,c,s,u,b.x,b.y)&&Yr(b.prev,b,b.next)>=0)return!1;b=b.next}return!0}function dEe(t,e,n,r){const i=t.prev,a=t,s=t.next;if(Yr(i,a,s)>=0)return!1;const o=i.x,c=a.x,u=s.x,h=i.y,p=a.y,v=s.y,y=Math.min(o,c,u),b=Math.min(h,p,v),w=Math.max(o,c,u),_=Math.max(h,p,v),S=sB(y,b,e,n,r),E=sB(w,_,e,n,r);let T=t.prevZ,P=t.nextZ;for(;T&&T.z>=S&&P&&P.z<=E;){if(T.x>=y&&T.x<=w&&T.y>=b&&T.y<=_&&T!==i&&T!==s&&xx(o,h,c,p,u,v,T.x,T.y)&&Yr(T.prev,T,T.next)>=0||(T=T.prevZ,P.x>=y&&P.x<=w&&P.y>=b&&P.y<=_&&P!==i&&P!==s&&xx(o,h,c,p,u,v,P.x,P.y)&&Yr(P.prev,P,P.next)>=0))return!1;P=P.nextZ}for(;T&&T.z>=S;){if(T.x>=y&&T.x<=w&&T.y>=b&&T.y<=_&&T!==i&&T!==s&&xx(o,h,c,p,u,v,T.x,T.y)&&Yr(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;P&&P.z<=E;){if(P.x>=y&&P.x<=w&&P.y>=b&&P.y<=_&&P!==i&&P!==s&&xx(o,h,c,p,u,v,P.x,P.y)&&Yr(P.prev,P,P.next)>=0)return!1;P=P.nextZ}return!0}function hEe(t,e){let n=t;do{const r=n.prev,i=n.next.next;!Uv(r,i)&&AY(r,n,n.next,i)&&kb(r,i)&&kb(i,r)&&(e.push(r.i,n.i,i.i),Fb(n),Fb(n.next),n=t=i),n=n.next}while(n!==t);return Op(n)}function pEe(t,e,n,r,i,a){let s=t;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&AEe(s,o)){let c=wY(s,o);s=Op(s,s.next),c=Op(c,c.next),Lb(s,e,n,r,i,a,0),Lb(c,e,n,r,i,a,0);return}o=o.next}s=s.next}while(s!==t)}function mEe(t,e,n,r){const i=[];for(let a=0,s=e.length;a<s;a++){const o=e[a]*r,c=a<s-1?e[a+1]*r:t.length,u=_Y(t,o,c,r,!1);u===u.next&&(u.steiner=!0),i.push(SEe(u))}i.sort(gEe);for(let a=0;a<i.length;a++)n=vEe(i[a],n);return n}function gEe(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const r=(t.next.y-t.y)/(t.next.x-t.x),i=(e.next.y-e.y)/(e.next.x-e.x);n=r-i}return n}function vEe(t,e){const n=yEe(t,e);if(!n)return e;const r=wY(n,t);return Op(r,r.next),Op(n,n.next)}function yEe(t,e){let n=e;const r=t.x,i=t.y;let a=-1/0,s;if(Uv(t,n))return n;do{if(Uv(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const p=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(p<=r&&p>a&&(a=p,s=n.x<n.next.x?n:n.next,p===r))return s}n=n.next}while(n!==e);if(!s)return null;const o=s,c=s.x,u=s.y;let h=1/0;n=s;do{if(r>=n.x&&n.x>=c&&r!==n.x&&SY(i<u?r:a,i,c,u,i<u?a:r,i,n.x,n.y)){const p=Math.abs(i-n.y)/(r-n.x);kb(n,t)&&(p<h||p===h&&(n.x>s.x||n.x===s.x&&xEe(s,n)))&&(s=n,h=p)}n=n.next}while(n!==o);return s}function xEe(t,e){return Yr(t.prev,t,e.prev)<0&&Yr(e.next,t,t.next)<0}function bEe(t,e,n,r){let i=t;do i.z===0&&(i.z=sB(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,_Ee(i)}function _Ee(t){let e,n=1;do{let r=t,i;t=null;let a=null;for(e=0;r;){e++;let s=r,o=0;for(let u=0;u<n&&(o++,s=s.nextZ,!!s);u++);let c=n;for(;o>0||c>0&&s;)o!==0&&(c===0||!s||r.z<=s.z)?(i=r,r=r.nextZ,o--):(i=s,s=s.nextZ,c--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=s}a.nextZ=null,n*=2}while(e>1);return t}function sB(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function SEe(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function SY(t,e,n,r,i,a,s,o){return(i-s)*(e-o)>=(t-s)*(a-o)&&(t-s)*(r-o)>=(n-s)*(e-o)&&(n-s)*(a-o)>=(i-s)*(r-o)}function xx(t,e,n,r,i,a,s,o){return!(t===s&&e===o)&&SY(t,e,n,r,i,a,s,o)}function AEe(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!wEe(t,e)&&(kb(t,e)&&kb(e,t)&&MEe(t,e)&&(Yr(t.prev,t,e.prev)||Yr(t,e.prev,e))||Uv(t,e)&&Yr(t.prev,t,t.next)>0&&Yr(e.prev,e,e.next)>0)}function Yr(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Uv(t,e){return t.x===e.x&&t.y===e.y}function AY(t,e,n,r){const i=cA(Yr(t,e,n)),a=cA(Yr(t,e,r)),s=cA(Yr(n,r,t)),o=cA(Yr(n,r,e));return!!(i!==a&&s!==o||i===0&&lA(t,n,e)||a===0&&lA(t,r,e)||s===0&&lA(n,t,r)||o===0&&lA(n,e,r))}function lA(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function cA(t){return t>0?1:t<0?-1:0}function wEe(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&AY(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function kb(t,e){return Yr(t.prev,t,t.next)<0?Yr(t,e,t.next)>=0&&Yr(t,t.prev,e)>=0:Yr(t,e,t.prev)<0||Yr(t,t.next,e)<0}function MEe(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}function wY(t,e){const n=oB(t.i,t.x,t.y),r=oB(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function GG(t,e,n,r){const i=oB(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Fb(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function oB(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function EEe(t,e,n,r){let i=0;for(let a=e,s=n-r;a<n;a+=r)i+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return i}class TEe{static triangulate(e,n,r=2){return uEe(e,n,r)}}class Bl{static area(e){const n=e.length;let r=0;for(let i=n-1,a=0;a<n;i=a++)r+=e[i].x*e[a].y-e[a].x*e[i].y;return r*.5}static isClockWise(e){return Bl.area(e)<0}static triangulateShape(e,n){const r=[],i=[],a=[];HG(e),VG(r,e);let s=e.length;n.forEach(HG);for(let c=0;c<n.length;c++)i.push(s),s+=n[c].length,VG(r,n[c]);const o=TEe.triangulate(r,i);for(let c=0;c<o.length;c+=3)a.push(o.slice(c,c+3));return a}}function HG(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function VG(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class hT extends an{constructor(e=new _p([new Ve(.5,.5),new Ve(-.5,.5),new Ve(-.5,-.5),new Ve(.5,-.5)]),n={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:n},e=Array.isArray(e)?e:[e];const r=this,i=[],a=[];for(let o=0,c=e.length;o<c;o++){const u=e[o];s(u)}this.setAttribute("position",new Pt(i,3)),this.setAttribute("uv",new Pt(a,2)),this.computeVertexNormals();function s(o){const c=[],u=n.curveSegments!==void 0?n.curveSegments:12,h=n.steps!==void 0?n.steps:1,p=n.depth!==void 0?n.depth:1;let v=n.bevelEnabled!==void 0?n.bevelEnabled:!0,y=n.bevelThickness!==void 0?n.bevelThickness:.2,b=n.bevelSize!==void 0?n.bevelSize:y-.1,w=n.bevelOffset!==void 0?n.bevelOffset:0,_=n.bevelSegments!==void 0?n.bevelSegments:3;const S=n.extrudePath,E=n.UVGenerator!==void 0?n.UVGenerator:CEe;let T,P=!1,R,D,I,k;if(S){T=S.getSpacedPoints(h),P=!0,v=!1;const we=S.isCatmullRomCurve3?S.closed:!1;R=S.computeFrenetFrames(h,we),D=new ne,I=new ne,k=new ne}v||(_=0,y=0,b=0,w=0);const B=o.extractPoints(u);let U=B.shape;const z=B.holes;if(!Bl.isClockWise(U)){U=U.reverse();for(let we=0,Ue=z.length;we<Ue;we++){const Be=z[we];Bl.isClockWise(Be)&&(z[we]=Be.reverse())}}function W(we){const Be=10000000000000001e-36;let Ye=we[0];for(let re=1;re<=we.length;re++){const At=re%we.length,ft=we[At],Et=ft.x-Ye.x,Ze=ft.y-Ye.y,te=Et*Et+Ze*Ze,H=Math.max(Math.abs(ft.x),Math.abs(ft.y),Math.abs(Ye.x),Math.abs(Ye.y)),he=Be*H*H;if(te<=he){we.splice(At,1),re--;continue}Ye=ft}}W(U),z.forEach(W);const ee=z.length,Q=U;for(let we=0;we<ee;we++){const Ue=z[we];U=U.concat(Ue)}function V(we,Ue,Be){return Ue||zt("ExtrudeGeometry: vec does not exist"),we.clone().addScaledVector(Ue,Be)}const $=U.length;function Y(we,Ue,Be){let Ye,re,At;const ft=we.x-Ue.x,Et=we.y-Ue.y,Ze=Be.x-we.x,te=Be.y-we.y,H=ft*ft+Et*Et,he=ft*te-Et*Ze;if(Math.abs(he)>Number.EPSILON){const Ne=Math.sqrt(H),je=Math.sqrt(Ze*Ze+te*te),Ie=Ue.x-Et/Ne,_t=Ue.y+ft/Ne,lt=Be.x-te/je,Tt=Be.y+Ze/je,Gt=((lt-Ie)*te-(Tt-_t)*Ze)/(ft*te-Et*Ze);Ye=Ie+ft*Gt-we.x,re=_t+Et*Gt-we.y;const Qe=Ye*Ye+re*re;if(Qe<=2)return new Ve(Ye,re);At=Math.sqrt(Qe/2)}else{let Ne=!1;ft>Number.EPSILON?Ze>Number.EPSILON&&(Ne=!0):ft<-Number.EPSILON?Ze<-Number.EPSILON&&(Ne=!0):Math.sign(Et)===Math.sign(te)&&(Ne=!0),Ne?(Ye=-Et,re=ft,At=Math.sqrt(H)):(Ye=ft,re=Et,At=Math.sqrt(H/2))}return new Ve(Ye/At,re/At)}const ie=[];for(let we=0,Ue=Q.length,Be=Ue-1,Ye=we+1;we<Ue;we++,Be++,Ye++)Be===Ue&&(Be=0),Ye===Ue&&(Ye=0),ie[we]=Y(Q[we],Q[Be],Q[Ye]);const de=[];let X,ae=ie.concat();for(let we=0,Ue=ee;we<Ue;we++){const Be=z[we];X=[];for(let Ye=0,re=Be.length,At=re-1,ft=Ye+1;Ye<re;Ye++,At++,ft++)At===re&&(At=0),ft===re&&(ft=0),X[Ye]=Y(Be[Ye],Be[At],Be[ft]);de.push(X),ae=ae.concat(X)}let ue;if(_===0)ue=Bl.triangulateShape(Q,z);else{const we=[],Ue=[];for(let Be=0;Be<_;Be++){const Ye=Be/_,re=y*Math.cos(Ye*Math.PI/2),At=b*Math.sin(Ye*Math.PI/2)+w;for(let ft=0,Et=Q.length;ft<Et;ft++){const Ze=V(Q[ft],ie[ft],At);_e(Ze.x,Ze.y,-re),Ye===0&&we.push(Ze)}for(let ft=0,Et=ee;ft<Et;ft++){const Ze=z[ft];X=de[ft];const te=[];for(let H=0,he=Ze.length;H<he;H++){const Ne=V(Ze[H],X[H],At);_e(Ne.x,Ne.y,-re),Ye===0&&te.push(Ne)}Ye===0&&Ue.push(te)}}ue=Bl.triangulateShape(we,Ue)}const Se=ue.length,$e=b+w;for(let we=0;we<$;we++){const Ue=v?V(U[we],ae[we],$e):U[we];P?(I.copy(R.normals[0]).multiplyScalar(Ue.x),D.copy(R.binormals[0]).multiplyScalar(Ue.y),k.copy(T[0]).add(I).add(D),_e(k.x,k.y,k.z)):_e(Ue.x,Ue.y,0)}for(let we=1;we<=h;we++)for(let Ue=0;Ue<$;Ue++){const Be=v?V(U[Ue],ae[Ue],$e):U[Ue];P?(I.copy(R.normals[we]).multiplyScalar(Be.x),D.copy(R.binormals[we]).multiplyScalar(Be.y),k.copy(T[we]).add(I).add(D),_e(k.x,k.y,k.z)):_e(Be.x,Be.y,p/h*we)}for(let we=_-1;we>=0;we--){const Ue=we/_,Be=y*Math.cos(Ue*Math.PI/2),Ye=b*Math.sin(Ue*Math.PI/2)+w;for(let re=0,At=Q.length;re<At;re++){const ft=V(Q[re],ie[re],Ye);_e(ft.x,ft.y,p+Be)}for(let re=0,At=z.length;re<At;re++){const ft=z[re];X=de[re];for(let Et=0,Ze=ft.length;Et<Ze;Et++){const te=V(ft[Et],X[Et],Ye);P?_e(te.x,te.y+T[h-1].y,T[h-1].x+Be):_e(te.x,te.y,p+Be)}}}me(),ve();function me(){const we=i.length/3;if(v){let Ue=0,Be=$*Ue;for(let Ye=0;Ye<Se;Ye++){const re=ue[Ye];Fe(re[2]+Be,re[1]+Be,re[0]+Be)}Ue=h+_*2,Be=$*Ue;for(let Ye=0;Ye<Se;Ye++){const re=ue[Ye];Fe(re[0]+Be,re[1]+Be,re[2]+Be)}}else{for(let Ue=0;Ue<Se;Ue++){const Be=ue[Ue];Fe(Be[2],Be[1],Be[0])}for(let Ue=0;Ue<Se;Ue++){const Be=ue[Ue];Fe(Be[0]+$*h,Be[1]+$*h,Be[2]+$*h)}}r.addGroup(we,i.length/3-we,0)}function ve(){const we=i.length/3;let Ue=0;We(Q,Ue),Ue+=Q.length;for(let Be=0,Ye=z.length;Be<Ye;Be++){const re=z[Be];We(re,Ue),Ue+=re.length}r.addGroup(we,i.length/3-we,1)}function We(we,Ue){let Be=we.length;for(;--Be>=0;){const Ye=Be;let re=Be-1;re<0&&(re=we.length-1);for(let At=0,ft=h+_*2;At<ft;At++){const Et=$*At,Ze=$*(At+1),te=Ue+Ye+Et,H=Ue+re+Et,he=Ue+re+Ze,Ne=Ue+Ye+Ze;Xe(te,H,he,Ne)}}}function _e(we,Ue,Be){c.push(we),c.push(Ue),c.push(Be)}function Fe(we,Ue,Be){Re(we),Re(Ue),Re(Be);const Ye=i.length/3,re=E.generateTopUV(r,i,Ye-3,Ye-2,Ye-1);ot(re[0]),ot(re[1]),ot(re[2])}function Xe(we,Ue,Be,Ye){Re(we),Re(Ue),Re(Ye),Re(Ue),Re(Be),Re(Ye);const re=i.length/3,At=E.generateSideWallUV(r,i,re-6,re-3,re-2,re-1);ot(At[0]),ot(At[1]),ot(At[3]),ot(At[1]),ot(At[2]),ot(At[3])}function Re(we){i.push(c[we*3+0]),i.push(c[we*3+1]),i.push(c[we*3+2])}function ot(we){a.push(we.x),a.push(we.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes,r=this.parameters.options;return REe(n,r,e)}static fromJSON(e,n){const r=[];for(let a=0,s=e.shapes.length;a<s;a++){const o=n[e.shapes[a]];r.push(o)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new qM[i.type]().fromJSON(i)),new hT(r,e.options)}}const CEe={generateTopUV:function(t,e,n,r,i){const a=e[n*3],s=e[n*3+1],o=e[r*3],c=e[r*3+1],u=e[i*3],h=e[i*3+1];return[new Ve(a,s),new Ve(o,c),new Ve(u,h)]},generateSideWallUV:function(t,e,n,r,i,a){const s=e[n*3],o=e[n*3+1],c=e[n*3+2],u=e[r*3],h=e[r*3+1],p=e[r*3+2],v=e[i*3],y=e[i*3+1],b=e[i*3+2],w=e[a*3],_=e[a*3+1],S=e[a*3+2];return Math.abs(o-h)<Math.abs(s-u)?[new Ve(s,1-c),new Ve(u,1-p),new Ve(v,1-b),new Ve(w,1-S)]:[new Ve(o,1-c),new Ve(h,1-p),new Ve(y,1-b),new Ve(_,1-S)]}};function REe(t,e,n){if(n.shapes=[],Array.isArray(t))for(let r=0,i=t.length;r<i;r++){const a=t[r];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return n.options=Object.assign({},e),e.extrudePath!==void 0&&(n.options.extrudePath=e.extrudePath.toJSON()),n}class pT extends Gd{constructor(e=1,n=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],a=[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,a,e,n),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new pT(e.radius,e.detail)}}class mT extends an{constructor(e=[new Ve(0,-.5),new Ve(.5,0),new Ve(0,.5)],n=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:r,phiLength:i},n=Math.floor(n),i=tn(i,0,Math.PI*2);const a=[],s=[],o=[],c=[],u=[],h=1/n,p=new ne,v=new Ve,y=new ne,b=new ne,w=new ne;let _=0,S=0;for(let E=0;E<=e.length-1;E++)switch(E){case 0:_=e[E+1].x-e[E].x,S=e[E+1].y-e[E].y,y.x=S*1,y.y=-_,y.z=S*0,w.copy(y),y.normalize(),c.push(y.x,y.y,y.z);break;case e.length-1:c.push(w.x,w.y,w.z);break;default:_=e[E+1].x-e[E].x,S=e[E+1].y-e[E].y,y.x=S*1,y.y=-_,y.z=S*0,b.copy(y),y.x+=w.x,y.y+=w.y,y.z+=w.z,y.normalize(),c.push(y.x,y.y,y.z),w.copy(b)}for(let E=0;E<=n;E++){const T=r+E*h*i,P=Math.sin(T),R=Math.cos(T);for(let D=0;D<=e.length-1;D++){p.x=e[D].x*P,p.y=e[D].y,p.z=e[D].x*R,s.push(p.x,p.y,p.z),v.x=E/n,v.y=D/(e.length-1),o.push(v.x,v.y);const I=c[3*D+0]*P,k=c[3*D+1],B=c[3*D+0]*R;u.push(I,k,B)}}for(let E=0;E<n;E++)for(let T=0;T<e.length-1;T++){const P=T+E*e.length,R=P,D=P+e.length,I=P+e.length+1,k=P+1;a.push(R,D,k),a.push(I,k,D)}this.setIndex(a),this.setAttribute("position",new Pt(s,3)),this.setAttribute("uv",new Pt(o,2)),this.setAttribute("normal",new Pt(u,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new mT(e.points,e.segments,e.phiStart,e.phiLength)}}class p1 extends Gd{constructor(e=1,n=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,n),this.type="OctahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new p1(e.radius,e.detail)}}class cy extends an{constructor(e=1,n=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:r,heightSegments:i};const a=e/2,s=n/2,o=Math.floor(r),c=Math.floor(i),u=o+1,h=c+1,p=e/o,v=n/c,y=[],b=[],w=[],_=[];for(let S=0;S<h;S++){const E=S*v-s;for(let T=0;T<u;T++){const P=T*p-a;b.push(P,-E,0),w.push(0,0,1),_.push(T/o),_.push(1-S/c)}}for(let S=0;S<c;S++)for(let E=0;E<o;E++){const T=E+u*S,P=E+u*(S+1),R=E+1+u*(S+1),D=E+1+u*S;y.push(T,P,D),y.push(P,R,D)}this.setIndex(y),this.setAttribute("position",new Pt(b,3)),this.setAttribute("normal",new Pt(w,3)),this.setAttribute("uv",new Pt(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new cy(e.width,e.height,e.widthSegments,e.heightSegments)}}class gT extends an{constructor(e=.5,n=1,r=32,i=1,a=0,s=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:n,thetaSegments:r,phiSegments:i,thetaStart:a,thetaLength:s},r=Math.max(3,r),i=Math.max(1,i);const o=[],c=[],u=[],h=[];let p=e;const v=(n-e)/i,y=new ne,b=new Ve;for(let w=0;w<=i;w++){for(let _=0;_<=r;_++){const S=a+_/r*s;y.x=p*Math.cos(S),y.y=p*Math.sin(S),c.push(y.x,y.y,y.z),u.push(0,0,1),b.x=(y.x/n+1)/2,b.y=(y.y/n+1)/2,h.push(b.x,b.y)}p+=v}for(let w=0;w<i;w++){const _=w*(r+1);for(let S=0;S<r;S++){const E=S+_,T=E,P=E+r+1,R=E+r+2,D=E+1;o.push(T,P,D),o.push(P,R,D)}}this.setIndex(o),this.setAttribute("position",new Pt(c,3)),this.setAttribute("normal",new Pt(u,3)),this.setAttribute("uv",new Pt(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new gT(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class vT extends an{constructor(e=new _p([new Ve(0,.5),new Ve(-.5,-.5),new Ve(.5,-.5)]),n=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:n};const r=[],i=[],a=[],s=[];let o=0,c=0;if(Array.isArray(e)===!1)u(e);else for(let h=0;h<e.length;h++)u(e[h]),this.addGroup(o,c,h),o+=c,c=0;this.setIndex(r),this.setAttribute("position",new Pt(i,3)),this.setAttribute("normal",new Pt(a,3)),this.setAttribute("uv",new Pt(s,2));function u(h){const p=i.length/3,v=h.extractPoints(n);let y=v.shape;const b=v.holes;Bl.isClockWise(y)===!1&&(y=y.reverse());for(let _=0,S=b.length;_<S;_++){const E=b[_];Bl.isClockWise(E)===!0&&(b[_]=E.reverse())}const w=Bl.triangulateShape(y,b);for(let _=0,S=b.length;_<S;_++){const E=b[_];y=y.concat(E)}for(let _=0,S=y.length;_<S;_++){const E=y[_];i.push(E.x,E.y,0),a.push(0,0,1),s.push(E.x,E.y)}for(let _=0,S=w.length;_<S;_++){const E=w[_],T=E[0]+p,P=E[1]+p,R=E[2]+p;r.push(T,P,R),c+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes;return OEe(n,e)}static fromJSON(e,n){const r=[];for(let i=0,a=e.shapes.length;i<a;i++){const s=n[e.shapes[i]];r.push(s)}return new vT(r,e.curveSegments)}}function OEe(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,r=t.length;n<r;n++){const i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}class m1 extends an{constructor(e=1,n=32,r=16,i=0,a=Math.PI*2,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:n,heightSegments:r,phiStart:i,phiLength:a,thetaStart:s,thetaLength:o},n=Math.max(3,Math.floor(n)),r=Math.max(2,Math.floor(r));const c=Math.min(s+o,Math.PI);let u=0;const h=[],p=new ne,v=new ne,y=[],b=[],w=[],_=[];for(let S=0;S<=r;S++){const E=[],T=S/r;let P=0;S===0&&s===0?P=.5/n:S===r&&c===Math.PI&&(P=-.5/n);for(let R=0;R<=n;R++){const D=R/n;p.x=-e*Math.cos(i+D*a)*Math.sin(s+T*o),p.y=e*Math.cos(s+T*o),p.z=e*Math.sin(i+D*a)*Math.sin(s+T*o),b.push(p.x,p.y,p.z),v.copy(p).normalize(),w.push(v.x,v.y,v.z),_.push(D+P,1-T),E.push(u++)}h.push(E)}for(let S=0;S<r;S++)for(let E=0;E<n;E++){const T=h[S][E+1],P=h[S][E],R=h[S+1][E],D=h[S+1][E+1];(S!==0||s>0)&&y.push(T,P,D),(S!==r-1||c<Math.PI)&&y.push(P,R,D)}this.setIndex(y),this.setAttribute("position",new Pt(b,3)),this.setAttribute("normal",new Pt(w,3)),this.setAttribute("uv",new Pt(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new m1(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class yT extends Gd{constructor(e=1,n=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,n),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new yT(e.radius,e.detail)}}class xT extends an{constructor(e=1,n=.4,r=12,i=48,a=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:n,radialSegments:r,tubularSegments:i,arc:a},r=Math.floor(r),i=Math.floor(i);const s=[],o=[],c=[],u=[],h=new ne,p=new ne,v=new ne;for(let y=0;y<=r;y++)for(let b=0;b<=i;b++){const w=b/i*a,_=y/r*Math.PI*2;p.x=(e+n*Math.cos(_))*Math.cos(w),p.y=(e+n*Math.cos(_))*Math.sin(w),p.z=n*Math.sin(_),o.push(p.x,p.y,p.z),h.x=e*Math.cos(w),h.y=e*Math.sin(w),v.subVectors(p,h).normalize(),c.push(v.x,v.y,v.z),u.push(b/i),u.push(y/r)}for(let y=1;y<=r;y++)for(let b=1;b<=i;b++){const w=(i+1)*y+b-1,_=(i+1)*(y-1)+b-1,S=(i+1)*(y-1)+b,E=(i+1)*y+b;s.push(w,_,E),s.push(_,S,E)}this.setIndex(s),this.setAttribute("position",new Pt(o,3)),this.setAttribute("normal",new Pt(c,3)),this.setAttribute("uv",new Pt(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xT(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class bT extends an{constructor(e=1,n=.4,r=64,i=8,a=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:n,tubularSegments:r,radialSegments:i,p:a,q:s},r=Math.floor(r),i=Math.floor(i);const o=[],c=[],u=[],h=[],p=new ne,v=new ne,y=new ne,b=new ne,w=new ne,_=new ne,S=new ne;for(let T=0;T<=r;++T){const P=T/r*a*Math.PI*2;E(P,a,s,e,y),E(P+.01,a,s,e,b),_.subVectors(b,y),S.addVectors(b,y),w.crossVectors(_,S),S.crossVectors(w,_),w.normalize(),S.normalize();for(let R=0;R<=i;++R){const D=R/i*Math.PI*2,I=-n*Math.cos(D),k=n*Math.sin(D);p.x=y.x+(I*S.x+k*w.x),p.y=y.y+(I*S.y+k*w.y),p.z=y.z+(I*S.z+k*w.z),c.push(p.x,p.y,p.z),v.subVectors(p,y).normalize(),u.push(v.x,v.y,v.z),h.push(T/r),h.push(R/i)}}for(let T=1;T<=r;T++)for(let P=1;P<=i;P++){const R=(i+1)*(T-1)+(P-1),D=(i+1)*T+(P-1),I=(i+1)*T+P,k=(i+1)*(T-1)+P;o.push(R,D,k),o.push(D,I,k)}this.setIndex(o),this.setAttribute("position",new Pt(c,3)),this.setAttribute("normal",new Pt(u,3)),this.setAttribute("uv",new Pt(h,2));function E(T,P,R,D,I){const k=Math.cos(T),B=Math.sin(T),U=R/P*T,z=Math.cos(U);I.x=D*(2+z)*.5*k,I.y=D*(2+z)*B*.5,I.z=D*Math.sin(U)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new bT(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class _T extends an{constructor(e=new nk(new ne(-1,-1,0),new ne(-1,1,0),new ne(1,1,0)),n=64,r=1,i=8,a=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:n,radius:r,radialSegments:i,closed:a};const s=e.computeFrenetFrames(n,a);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new ne,c=new ne,u=new Ve;let h=new ne;const p=[],v=[],y=[],b=[];w(),this.setIndex(b),this.setAttribute("position",new Pt(p,3)),this.setAttribute("normal",new Pt(v,3)),this.setAttribute("uv",new Pt(y,2));function w(){for(let T=0;T<n;T++)_(T);_(a===!1?n:0),E(),S()}function _(T){h=e.getPointAt(T/n,h);const P=s.normals[T],R=s.binormals[T];for(let D=0;D<=i;D++){const I=D/i*Math.PI*2,k=Math.sin(I),B=-Math.cos(I);c.x=B*P.x+k*R.x,c.y=B*P.y+k*R.y,c.z=B*P.z+k*R.z,c.normalize(),v.push(c.x,c.y,c.z),o.x=h.x+r*c.x,o.y=h.y+r*c.y,o.z=h.z+r*c.z,p.push(o.x,o.y,o.z)}}function S(){for(let T=1;T<=n;T++)for(let P=1;P<=i;P++){const R=(i+1)*(T-1)+(P-1),D=(i+1)*T+(P-1),I=(i+1)*T+P,k=(i+1)*(T-1)+P;b.push(R,D,k),b.push(D,I,k)}}function E(){for(let T=0;T<=n;T++)for(let P=0;P<=i;P++)u.x=T/n,u.y=P/i,y.push(u.x,u.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new _T(new qM[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class MY extends an{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const n=[],r=new Set,i=new ne,a=new ne;if(e.index!==null){const s=e.attributes.position,o=e.index;let c=e.groups;c.length===0&&(c=[{start:0,count:o.count,materialIndex:0}]);for(let u=0,h=c.length;u<h;++u){const p=c[u],v=p.start,y=p.count;for(let b=v,w=v+y;b<w;b+=3)for(let _=0;_<3;_++){const S=o.getX(b+_),E=o.getX(b+(_+1)%3);i.fromBufferAttribute(s,S),a.fromBufferAttribute(s,E),WG(i,a,r)===!0&&(n.push(i.x,i.y,i.z),n.push(a.x,a.y,a.z))}}}else{const s=e.attributes.position;for(let o=0,c=s.count/3;o<c;o++)for(let u=0;u<3;u++){const h=3*o+u,p=3*o+(u+1)%3;i.fromBufferAttribute(s,h),a.fromBufferAttribute(s,p),WG(i,a,r)===!0&&(n.push(i.x,i.y,i.z),n.push(a.x,a.y,a.z))}}this.setAttribute("position",new Pt(n,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function WG(t,e,n){const r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return n.has(r)===!0||n.has(i)===!0?!1:(n.add(r),n.add(i),!0)}var qG=Object.freeze({__proto__:null,BoxGeometry:Vp,CapsuleGeometry:cT,CircleGeometry:uT,ConeGeometry:h1,CylinderGeometry:d1,DodecahedronGeometry:fT,EdgesGeometry:mY,ExtrudeGeometry:hT,IcosahedronGeometry:pT,LatheGeometry:mT,OctahedronGeometry:p1,PlaneGeometry:cy,PolyhedronGeometry:Gd,RingGeometry:gT,ShapeGeometry:vT,SphereGeometry:m1,TetrahedronGeometry:yT,TorusGeometry:xT,TorusKnotGeometry:bT,TubeGeometry:_T,WireframeGeometry:MY});class EY extends zi{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new bt(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 ik extends Yo{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class g1 extends zi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new bt(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 bt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=zd,this.normalScale=new Ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Zo extends g1{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ve(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return tn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(n){this.ior=(1+.4*n)/(1-.4*n)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new bt(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 bt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new bt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class TY extends zi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new bt(16777215),this.specular=new bt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=zd,this.normalScale=new Ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.combine=o1,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class CY extends zi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new bt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=zd,this.normalScale=new Ve(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 RY extends zi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=zd,this.normalScale=new Ve(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 OY extends zi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new bt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=zd,this.normalScale=new Ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.combine=o1,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ak extends zi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=qK,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 sk extends zi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class PY extends zi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new bt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=zd,this.normalScale=new Ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class DY extends La{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 hp(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function NY(t){function e(i,a){return t[i]-t[a]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function lB(t,e,n){const r=t.length,i=new t.constructor(r);for(let a=0,s=0;s!==r;++a){const o=n[a]*e;for(let c=0;c!==e;++c)i[s++]=t[o+c]}return i}function ok(t,e,n,r){let i=1,a=t[0];for(;a!==void 0&&a[r]===void 0;)a=t[i++];if(a===void 0)return;let s=a[r];if(s!==void 0)if(Array.isArray(s))do s=a[r],s!==void 0&&(e.push(a.time),n.push(...s)),a=t[i++];while(a!==void 0);else if(s.toArray!==void 0)do s=a[r],s!==void 0&&(e.push(a.time),s.toArray(n,n.length)),a=t[i++];while(a!==void 0);else do s=a[r],s!==void 0&&(e.push(a.time),n.push(s)),a=t[i++];while(a!==void 0)}function PEe(t,e,n,r,i=30){const a=t.clone();a.name=e;const s=[];for(let c=0;c<a.tracks.length;++c){const u=a.tracks[c],h=u.getValueSize(),p=[],v=[];for(let y=0;y<u.times.length;++y){const b=u.times[y]*i;if(!(b<n||b>=r)){p.push(u.times[y]);for(let w=0;w<h;++w)v.push(u.values[y*h+w])}}p.length!==0&&(u.times=hp(p,u.times.constructor),u.values=hp(v,u.values.constructor),s.push(u))}a.tracks=s;let o=1/0;for(let c=0;c<a.tracks.length;++c)o>a.tracks[c].times[0]&&(o=a.tracks[c].times[0]);for(let c=0;c<a.tracks.length;++c)a.tracks[c].shift(-1*o);return a.resetDuration(),a}function DEe(t,e=0,n=t,r=30){r<=0&&(r=30);const i=n.tracks.length,a=e/r;for(let s=0;s<i;++s){const o=n.tracks[s],c=o.ValueTypeName;if(c==="bool"||c==="string")continue;const u=t.tracks.find(function(S){return S.name===o.name&&S.ValueTypeName===c});if(u===void 0)continue;let h=0;const p=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=p/3);let v=0;const y=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(v=y/3);const b=o.times.length-1;let w;if(a<=o.times[0]){const S=h,E=p-h;w=o.values.slice(S,E)}else if(a>=o.times[b]){const S=b*p+h,E=S+p-h;w=o.values.slice(S,E)}else{const S=o.createInterpolant(),E=h,T=p-h;S.evaluate(a),w=S.resultBuffer.slice(E,T)}c==="quaternion"&&new gi().fromArray(w).normalize().conjugate().toArray(w);const _=u.times.length;for(let S=0;S<_;++S){const E=S*y+v;if(c==="quaternion")gi.multiplyQuaternionsFlat(u.values,E,w,0,u.values,E);else{const T=y-v*2;for(let P=0;P<T;++P)u.values[E+P]-=w[P]}}}return t.blendMode=F5,t}class NEe{static convertArray(e,n){return hp(e,n)}static isTypedArray(e){return tY(e)}static getKeyframeOrder(e){return NY(e)}static sortedArray(e,n,r){return lB(e,n,r)}static flattenJSON(e,n,r,i){ok(e,n,r,i)}static subclip(e,n,r,i,a=30){return PEe(e,n,r,i,a)}static makeClipAdditive(e,n=0,r=e,i=30){return DEe(e,n,r,i)}}class uy{constructor(e,n,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let r=this._cachedIndex,i=n[r],a=n[r-1];e:{t:{let s;n:{r:if(!(e<i)){for(let o=r+2;;){if(i===void 0){if(e<a)break r;return r=n.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===o)break;if(a=i,i=n[++r],e<i)break t}s=n.length;break n}if(!(e>=a)){const o=n[1];e<o&&(r=2,a=o);for(let c=r-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===c)break;if(i=a,a=n[--r-1],e>=a)break t}s=r,r=0;break n}break e}for(;r<s;){const o=r+s>>>1;e<n[o]?s=o:r=o+1}if(i=n[r],a=n[r-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return r=n.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,a,i)}return this.interpolate_(r,a,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const n=this.resultBuffer,r=this.sampleValues,i=this.valueSize,a=e*i;for(let s=0;s!==i;++s)n[s]=r[a+s];return n}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class IY extends uy{constructor(e,n,r,i){super(e,n,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:fp,endingEnd:fp}}intervalChanged_(e,n,r){const i=this.parameterPositions;let a=e-2,s=e+1,o=i[a],c=i[s];if(o===void 0)switch(this.getSettings_().endingStart){case dp:a=e,o=2*n-r;break;case Pb:a=i.length-2,o=n+i[a]-i[a+1];break;default:a=e,o=r}if(c===void 0)switch(this.getSettings_().endingEnd){case dp:s=e,c=2*r-n;break;case Pb:s=1,c=r+i[1]-i[0];break;default:s=e-1,c=n}const u=(r-n)*.5,h=this.valueSize;this._weightPrev=u/(n-o),this._weightNext=u/(c-r),this._offsetPrev=a*h,this._offsetNext=s*h}interpolate_(e,n,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,c=e*o,u=c-o,h=this._offsetPrev,p=this._offsetNext,v=this._weightPrev,y=this._weightNext,b=(r-n)/(i-n),w=b*b,_=w*b,S=-v*_+2*v*w-v*b,E=(1+v)*_+(-1.5-2*v)*w+(-.5+v)*b+1,T=(-1-y)*_+(1.5+y)*w+.5*b,P=y*_-y*w;for(let R=0;R!==o;++R)a[R]=S*s[h+R]+E*s[u+R]+T*s[c+R]+P*s[p+R];return a}}class lk extends uy{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,c=e*o,u=c-o,h=(r-n)/(i-n),p=1-h;for(let v=0;v!==o;++v)a[v]=s[u+v]*p+s[c+v]*h;return a}}class BY extends uy{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Qo{constructor(e,n,r,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(n===void 0||n.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=hp(n,this.TimeBufferType),this.values=hp(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const n=e.constructor;let r;if(n.toJSON!==this.toJSON)r=n.toJSON(e);else{r={name:e.name,times:hp(e.times,Array),values:hp(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new BY(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new lk(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new IY(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let n;switch(e){case Pv:n=this.InterpolantFactoryMethodDiscrete;break;case Dv:n=this.InterpolantFactoryMethodLinear;break;case FA:n=this.InterpolantFactoryMethodSmooth;break}if(n===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 xt("KeyframeTrack:",r),this}return this.createInterpolant=n,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Pv;case this.InterpolantFactoryMethodLinear:return Dv;case this.InterpolantFactoryMethodSmooth:return FA}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const n=this.times;for(let r=0,i=n.length;r!==i;++r)n[r]+=e}return this}scale(e){if(e!==1){const n=this.times;for(let r=0,i=n.length;r!==i;++r)n[r]*=e}return this}trim(e,n){const r=this.times,i=r.length;let a=0,s=i-1;for(;a!==i&&r[a]<e;)++a;for(;s!==-1&&r[s]>n;)--s;if(++s,a!==0||s!==i){a>=s&&(s=Math.max(s,1),a=s-1);const o=this.getValueSize();this.times=r.slice(a,s),this.values=this.values.slice(a*o,s*o)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(zt("KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,a=r.length;a===0&&(zt("KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let o=0;o!==a;o++){const c=r[o];if(typeof c=="number"&&isNaN(c)){zt("KeyframeTrack: Time is not a valid number.",this,o,c),e=!1;break}if(s!==null&&s>c){zt("KeyframeTrack: Out of order keys.",this,o,c,s),e=!1;break}s=c}if(i!==void 0&&tY(i))for(let o=0,c=i.length;o!==c;++o){const u=i[o];if(isNaN(u)){zt("KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===FA,a=e.length-1;let s=1;for(let o=1;o<a;++o){let c=!1;const u=e[o],h=e[o+1];if(u!==h&&(o!==1||u!==e[0]))if(i)c=!0;else{const p=o*r,v=p-r,y=p+r;for(let b=0;b!==r;++b){const w=n[p+b];if(w!==n[v+b]||w!==n[y+b]){c=!0;break}}}if(c){if(o!==s){e[s]=e[o];const p=o*r,v=s*r;for(let y=0;y!==r;++y)n[v+y]=n[p+y]}++s}}if(a>0){e[s]=e[a];for(let o=a*r,c=s*r,u=0;u!==r;++u)n[c+u]=n[o+u];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=n.slice(0,s*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}Qo.prototype.ValueTypeName="";Qo.prototype.TimeBufferType=Float32Array;Qo.prototype.ValueBufferType=Float32Array;Qo.prototype.DefaultInterpolation=Dv;class Wp extends Qo{constructor(e,n,r){super(e,n,r)}}Wp.prototype.ValueTypeName="bool";Wp.prototype.ValueBufferType=Array;Wp.prototype.DefaultInterpolation=Pv;Wp.prototype.InterpolantFactoryMethodLinear=void 0;Wp.prototype.InterpolantFactoryMethodSmooth=void 0;class ck extends Qo{constructor(e,n,r,i){super(e,n,r,i)}}ck.prototype.ValueTypeName="color";class Pp extends Qo{constructor(e,n,r,i){super(e,n,r,i)}}Pp.prototype.ValueTypeName="number";class LY extends uy{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,c=(r-n)/(i-n);let u=e*o;for(let h=u+o;u!==h;u+=4)gi.slerpFlat(a,0,s,u-o,s,u,c);return a}}class Dp extends Qo{constructor(e,n,r,i){super(e,n,r,i)}InterpolantFactoryMethodLinear(e){return new LY(this.times,this.values,this.getValueSize(),e)}}Dp.prototype.ValueTypeName="quaternion";Dp.prototype.InterpolantFactoryMethodSmooth=void 0;class qp extends Qo{constructor(e,n,r){super(e,n,r)}}qp.prototype.ValueTypeName="string";qp.prototype.ValueBufferType=Array;qp.prototype.DefaultInterpolation=Pv;qp.prototype.InterpolantFactoryMethodLinear=void 0;qp.prototype.InterpolantFactoryMethodSmooth=void 0;class Np extends Qo{constructor(e,n,r,i){super(e,n,r,i)}}Np.prototype.ValueTypeName="vector";class jv{constructor(e="",n=-1,r=[],i=JE){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=eo(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let s=0,o=r.length;s!==o;++s)n.push(BEe(r[s]).scale(i));const a=new this(e.name,e.duration,n,e.blendMode);return a.uuid=e.uuid,a.userData=JSON.parse(e.userData||"{}"),a}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let a=0,s=r.length;a!==s;++a)n.push(Qo.toJSON(r[a]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const a=n.length,s=[];for(let o=0;o<a;o++){let c=[],u=[];c.push((o+a-1)%a,o,(o+1)%a),u.push(0,1,0);const h=NY(c);c=lB(c,1,h),u=lB(u,1,h),!i&&c[0]===0&&(c.push(a),u.push(u[0])),s.push(new Pp(".morphTargetInfluences["+n[o].name+"]",c,u).scale(1/r))}return new this(e,-1,s)}static findByName(e,n){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===n)return r[i];return null}static CreateClipsFromMorphTargetSequences(e,n,r){const i={},a=/^([\w-]*?)([\d]+)$/;for(let o=0,c=e.length;o<c;o++){const u=e[o],h=u.name.match(a);if(h&&h.length>1){const p=h[1];let v=i[p];v||(i[p]=v=[]),v.push(u)}}const s=[];for(const o in i)s.push(this.CreateFromMorphTargetSequence(o,i[o],n,r));return s}static parseAnimation(e,n){if(xt("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return zt("AnimationClip: No animation in JSONLoader data."),null;const r=function(p,v,y,b,w){if(y.length!==0){const _=[],S=[];ok(y,_,S,b),_.length!==0&&w.push(new p(v,_,S))}},i=[],a=e.name||"default",s=e.fps||30,o=e.blendMode;let c=e.length||-1;const u=e.hierarchy||[];for(let p=0;p<u.length;p++){const v=u[p].keys;if(!(!v||v.length===0))if(v[0].morphTargets){const y={};let b;for(b=0;b<v.length;b++)if(v[b].morphTargets)for(let w=0;w<v[b].morphTargets.length;w++)y[v[b].morphTargets[w]]=-1;for(const w in y){const _=[],S=[];for(let E=0;E!==v[b].morphTargets.length;++E){const T=v[b];_.push(T.time),S.push(T.morphTarget===w?1:0)}i.push(new Pp(".morphTargetInfluence["+w+"]",_,S))}c=y.length*s}else{const y=".bones["+n[p].name+"]";r(Np,y+".position",v,"pos",i),r(Dp,y+".quaternion",v,"rot",i),r(Np,y+".scale",v,"scl",i)}}return i.length===0?null:new this(a,c,i,o)}resetDuration(){const e=this.tracks;let n=0;for(let r=0,i=e.length;r!==i;++r){const a=this.tracks[r];n=Math.max(n,a.times[a.times.length-1])}return this.duration=n,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 n=0;n<this.tracks.length;n++)e=e&&this.tracks[n].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let r=0;r<this.tracks.length;r++)e.push(this.tracks[r].clone());const n=new this.constructor(this.name,this.duration,e,this.blendMode);return n.userData=JSON.parse(JSON.stringify(this.userData)),n}toJSON(){return this.constructor.toJSON(this)}}function IEe(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Pp;case"vector":case"vector2":case"vector3":case"vector4":return Np;case"color":return ck;case"quaternion":return Dp;case"bool":case"boolean":return Wp;case"string":return qp}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function BEe(t){if(t.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=IEe(t.type);if(t.times===void 0){const n=[],r=[];ok(t.keys,n,r,"value"),t.times=n,t.values=r}return e.parse!==void 0?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const Dc={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class uk{constructor(e,n,r){const i=this;let a=!1,s=0,o=0,c;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=r,this._abortController=null,this.itemStart=function(h){o++,a===!1&&i.onStart!==void 0&&i.onStart(h,s,o),a=!0},this.itemEnd=function(h){s++,i.onProgress!==void 0&&i.onProgress(h,s,o),s===o&&(a=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,p){return u.push(h,p),this},this.removeHandler=function(h){const p=u.indexOf(h);return p!==-1&&u.splice(p,2),this},this.getHandler=function(h){for(let p=0,v=u.length;p<v;p+=2){const y=u[p],b=u[p+1];if(y.global&&(y.lastIndex=0),y.test(h))return b}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const kY=new uk;class ka{constructor(e){this.manager=e!==void 0?e:kY,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){const r=this;return new Promise(function(i,a){r.load(e,i,n,a)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}ka.DEFAULT_MATERIAL_NAME="__DEFAULT";const Fu={};class LEe extends Error{constructor(e,n){super(e),this.response=n}}class io extends ka{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=Dc.get(`file:${e}`);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{n&&n(a),this.manager.itemEnd(e)},0),a;if(Fu[e]!==void 0){Fu[e].push({onLoad:n,onProgress:r,onError:i});return}Fu[e]=[],Fu[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,c=this.responseType;fetch(s).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&xt("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const h=Fu[e],p=u.body.getReader(),v=u.headers.get("X-File-Size")||u.headers.get("Content-Length"),y=v?parseInt(v):0,b=y!==0;let w=0;const _=new ReadableStream({start(S){E();function E(){p.read().then(({done:T,value:P})=>{if(T)S.close();else{w+=P.byteLength;const R=new ProgressEvent("progress",{lengthComputable:b,loaded:w,total:y});for(let D=0,I=h.length;D<I;D++){const k=h[D];k.onProgress&&k.onProgress(R)}S.enqueue(P),E()}},T=>{S.error(T)})}}});return new Response(_)}else throw new LEe(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(c){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return u.json();default:if(o==="")return u.text();{const p=/charset="?([^;"\s]*)"?/i.exec(o),v=p&&p[1]?p[1].toLowerCase():void 0,y=new TextDecoder(v);return u.arrayBuffer().then(b=>y.decode(b))}}}).then(u=>{Dc.add(`file:${e}`,u);const h=Fu[e];delete Fu[e];for(let p=0,v=h.length;p<v;p++){const y=h[p];y.onLoad&&y.onLoad(u)}}).catch(u=>{const h=Fu[e];if(h===void 0)throw this.manager.itemError(e),u;delete Fu[e];for(let p=0,v=h.length;p<v;p++){const y=h[p];y.onError&&y.onError(u)}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}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class kEe extends ka{constructor(e){super(e)}load(e,n,r,i){const a=this,s=new io(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(c){i?i(c):zt(c),a.manager.itemError(e)}},r,i)}parse(e){const n=[];for(let r=0;r<e.length;r++){const i=jv.parse(e[r]);n.push(i)}return n}}class FEe extends ka{constructor(e){super(e)}load(e,n,r,i){const a=this,s=[],o=new lT,c=new io(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(a.withCredentials);let u=0;function h(p){c.load(e[p],function(v){const y=a.parse(v,!0);s[p]={width:y.width,height:y.height,format:y.format,mipmaps:y.mipmaps},u+=1,u===6&&(y.mipmapCount===1&&(o.minFilter=vr),o.image=s,o.format=y.format,o.needsUpdate=!0,n&&n(o))},r,i)}if(Array.isArray(e))for(let p=0,v=e.length;p<v;++p)h(p);else c.load(e,function(p){const v=a.parse(p,!0);if(v.isCubemap){const y=v.mipmaps.length/v.mipmapCount;for(let b=0;b<y;b++){s[b]={mipmaps:[]};for(let w=0;w<v.mipmapCount;w++)s[b].mipmaps.push(v.mipmaps[b*v.mipmapCount+w]),s[b].format=v.format,s[b].width=v.width,s[b].height=v.height}o.image=s}else o.image.width=v.width,o.image.height=v.height,o.mipmaps=v.mipmaps;v.mipmapCount===1&&(o.minFilter=vr),o.format=v.format,o.needsUpdate=!0,n&&n(o)},r,i);return o}}const Ag=new WeakMap;class Ub extends ka{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=Dc.get(`image:${e}`);if(s!==void 0){if(s.complete===!0)a.manager.itemStart(e),setTimeout(function(){n&&n(s),a.manager.itemEnd(e)},0);else{let p=Ag.get(s);p===void 0&&(p=[],Ag.set(s,p)),p.push({onLoad:n,onError:i})}return s}const o=Ib("img");function c(){h(),n&&n(this);const p=Ag.get(this)||[];for(let v=0;v<p.length;v++){const y=p[v];y.onLoad&&y.onLoad(this)}Ag.delete(this),a.manager.itemEnd(e)}function u(p){h(),i&&i(p),Dc.remove(`image:${e}`);const v=Ag.get(this)||[];for(let y=0;y<v.length;y++){const b=v[y];b.onError&&b.onError(p)}Ag.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function h(){o.removeEventListener("load",c,!1),o.removeEventListener("error",u,!1)}return o.addEventListener("load",c,!1),o.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),Dc.add(`image:${e}`,o),a.manager.itemStart(e),o.src=e,o}}class UEe extends ka{constructor(e){super(e)}load(e,n,r,i){const a=new c1;a.colorSpace=Pa;const s=new Ub(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function c(u){s.load(e[u],function(h){a.images[u]=h,o++,o===6&&(a.needsUpdate=!0,n&&n(a))},void 0,i)}for(let u=0;u<e.length;++u)c(u);return a}}class jEe extends ka{constructor(e){super(e)}load(e,n,r,i){const a=this,s=new Fl,o=new io(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(a.withCredentials),o.load(e,function(c){let u;try{u=a.parse(c)}catch(h){if(i!==void 0)i(h);else{h(h);return}}u.image!==void 0?s.image=u.image:u.data!==void 0&&(s.image.width=u.width,s.image.height=u.height,s.image.data=u.data),s.wrapS=u.wrapS!==void 0?u.wrapS:ss,s.wrapT=u.wrapT!==void 0?u.wrapT:ss,s.magFilter=u.magFilter!==void 0?u.magFilter:vr,s.minFilter=u.minFilter!==void 0?u.minFilter:vr,s.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0&&(s.colorSpace=u.colorSpace),u.flipY!==void 0&&(s.flipY=u.flipY),u.format!==void 0&&(s.format=u.format),u.type!==void 0&&(s.type=u.type),u.mipmaps!==void 0&&(s.mipmaps=u.mipmaps,s.minFilter=zo),u.mipmapCount===1&&(s.minFilter=vr),u.generateMipmaps!==void 0&&(s.generateMipmaps=u.generateMipmaps),s.needsUpdate=!0,n&&n(s,u)},r,i),s}}class FY extends ka{constructor(e){super(e)}load(e,n,r,i){const a=new Gr,s=new Ub(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(o){a.image=o,a.needsUpdate=!0,n!==void 0&&n(a)},r,i),a}}class Hd extends zn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new bt(e),this.intensity=n}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}class UY extends Hd{constructor(e,n,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(zn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new bt(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}toJSON(e){const n=super.toJSON(e);return n.object.groundColor=this.groundColor.getHex(),n}}const _D=new qt,$G=new ne,XG=new ne;class fk{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ve(512,512),this.mapType=ts,this.map=null,this.mapPass=null,this.matrix=new qt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ly,this._frameExtents=new Ve(1,1),this._viewportCount=1,this._viewports=[new mr(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,r=this.matrix;$G.setFromMatrixPosition(e.matrixWorld),n.position.copy($G),XG.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(XG),n.updateMatrixWorld(),_D.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_D,n.coordinateSystem,n.reversedDepth),n.reversedDepth?r.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(_D)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class zEe extends fk{constructor(){super(new jr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,r=Bv*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,a=e.distance||n.far;(r!==n.fov||i!==n.aspect||a!==n.far)&&(n.fov=r,n.aspect=i,n.far=a,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class dk extends Hd{constructor(e,n,r=0,i=Math.PI/3,a=0,s=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(zn.DEFAULT_UP),this.updateMatrix(),this.target=new zn,this.distance=r,this.angle=i,this.penumbra=a,this.decay=s,this.map=null,this.shadow=new zEe}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.distance=this.distance,n.object.angle=this.angle,n.object.decay=this.decay,n.object.penumbra=this.penumbra,n.object.target=this.target.uuid,this.map&&this.map.isTexture&&(n.object.map=this.map.toJSON(e).uuid),n.object.shadow=this.shadow.toJSON(),n}}class GEe extends fk{constructor(){super(new jr(90,1,.5,500)),this.isPointLightShadow=!0}}class hk extends Hd{constructor(e,n,r=0,i=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new GEe}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.distance=this.distance,n.object.decay=this.decay,n.object.shadow=this.shadow.toJSON(),n}}class qo extends nT{constructor(e=-1,n=1,r=1,i=-1,a=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=a,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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,n,r,i,a,s){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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let a=r-e,s=r+e,o=i+n,c=i-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,s=a+u*this.view.width,o-=h*this.view.offsetY,c=o-h*this.view.height}this.projectionMatrix.makeOrthographic(a,s,o,c,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class HEe extends fk{constructor(){super(new qo(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class pk extends Hd{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(zn.DEFAULT_UP),this.updateMatrix(),this.target=new zn,this.shadow=new HEe}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}class jY extends Hd{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class zY extends Hd{constructor(e,n,r=10,i=10){super(e,n),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 n=super.toJSON(e);return n.object.width=this.width,n.object.height=this.height,n}}class mk{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new ne)}set(e){for(let n=0;n<9;n++)this.coefficients[n].copy(e[n]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,n){const r=e.x,i=e.y,a=e.z,s=this.coefficients;return n.copy(s[0]).multiplyScalar(.282095),n.addScaledVector(s[1],.488603*i),n.addScaledVector(s[2],.488603*a),n.addScaledVector(s[3],.488603*r),n.addScaledVector(s[4],1.092548*(r*i)),n.addScaledVector(s[5],1.092548*(i*a)),n.addScaledVector(s[6],.315392*(3*a*a-1)),n.addScaledVector(s[7],1.092548*(r*a)),n.addScaledVector(s[8],.546274*(r*r-i*i)),n}getIrradianceAt(e,n){const r=e.x,i=e.y,a=e.z,s=this.coefficients;return n.copy(s[0]).multiplyScalar(.886227),n.addScaledVector(s[1],2*.511664*i),n.addScaledVector(s[2],2*.511664*a),n.addScaledVector(s[3],2*.511664*r),n.addScaledVector(s[4],2*.429043*r*i),n.addScaledVector(s[5],2*.429043*i*a),n.addScaledVector(s[6],.743125*a*a-.247708),n.addScaledVector(s[7],2*.429043*r*a),n.addScaledVector(s[8],.429043*(r*r-i*i)),n}add(e){for(let n=0;n<9;n++)this.coefficients[n].add(e.coefficients[n]);return this}addScaledSH(e,n){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],n);return this}scale(e){for(let n=0;n<9;n++)this.coefficients[n].multiplyScalar(e);return this}lerp(e,n){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],n);return this}equals(e){for(let n=0;n<9;n++)if(!this.coefficients[n].equals(e.coefficients[n]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,n=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].fromArray(e,n+i*3);return this}toArray(e=[],n=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].toArray(e,n+i*3);return e}static getBasisAt(e,n){const r=e.x,i=e.y,a=e.z;n[0]=.282095,n[1]=.488603*i,n[2]=.488603*a,n[3]=.488603*r,n[4]=1.092548*r*i,n[5]=1.092548*i*a,n[6]=.315392*(3*a*a-1),n[7]=1.092548*r*a,n[8]=.546274*(r*r-i*i)}}class GY extends Hd{constructor(e=new mk,n=1){super(void 0,n),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){const n=super.toJSON(e);return n.object.sh=this.sh.toArray(),n}}class ST extends ka{constructor(e){super(e),this.textures={}}load(e,n,r,i){const a=this,s=new io(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(c){i?i(c):zt(c),a.manager.itemError(e)}},r,i)}parse(e){const n=this.textures;function r(a){return n[a]===void 0&&xt("MaterialLoader: Undefined texture",a),n[a]}const i=this.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 bt().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(i.dispersion=e.dispersion),e.iridescence!==void 0&&(i.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(i.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(i.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(i.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(i.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(i.depthFunc=e.depthFunc),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(i.blendSrc=e.blendSrc),e.blendDst!==void 0&&(i.blendDst=e.blendDst),e.blendEquation!==void 0&&(i.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(i.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(i.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(i.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&i.blendColor!==void 0&&i.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(i.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==void 0&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(i.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(i.allowOverride=e.allowOverride),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 a in e.uniforms){const s=e.uniforms[a];switch(i.uniforms[a]={},s.type){case"t":i.uniforms[a].value=r(s.value);break;case"c":i.uniforms[a].value=new bt().setHex(s.value);break;case"v2":i.uniforms[a].value=new Ve().fromArray(s.value);break;case"v3":i.uniforms[a].value=new ne().fromArray(s.value);break;case"v4":i.uniforms[a].value=new mr().fromArray(s.value);break;case"m3":i.uniforms[a].value=new dn().fromArray(s.value);break;case"m4":i.uniforms[a].value=new qt().fromArray(s.value);break;default:i.uniforms[a].value=s.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 a in e.extensions)i.extensions[a]=e.extensions[a];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=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 a=e.normalScale;Array.isArray(a)===!1&&(a=[a,a]),i.normalScale=new Ve().fromArray(a)}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.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=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 Ve().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.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),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}createMaterialFromType(e){return ST.createMaterialFromType(e)}static createMaterialFromType(e){const n={ShadowMaterial:EY,SpriteMaterial:q5,RawShaderMaterial:ik,ShaderMaterial:Yo,PointsMaterial:oT,MeshPhysicalMaterial:Zo,MeshStandardMaterial:g1,MeshPhongMaterial:TY,MeshToonMaterial:CY,MeshNormalMaterial:RY,MeshLambertMaterial:OY,MeshDepthMaterial:ak,MeshDistanceMaterial:sk,MeshBasicMaterial:Qs,MeshMatcapMaterial:PY,LineDashedMaterial:DY,LineBasicMaterial:La,Material:zi};return new n[e]}}class Ed{static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}class HY extends an{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class VY extends ka{constructor(e){super(e)}load(e,n,r,i){const a=this,s=new io(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(c){i?i(c):zt(c),a.manager.itemError(e)}},r,i)}parse(e){const n={},r={};function i(y,b){if(n[b]!==void 0)return n[b];const _=y.interleavedBuffers[b],S=a(y,_.buffer),E=Hg(_.type,S),T=new u1(E,_.stride);return T.uuid=_.uuid,n[b]=T,T}function a(y,b){if(r[b]!==void 0)return r[b];const _=y.arrayBuffers[b],S=new Uint32Array(_).buffer;return r[b]=S,S}const s=e.isInstancedBufferGeometry?new HY:new an,o=e.data.index;if(o!==void 0){const y=Hg(o.type,o.array);s.setIndex(new qn(y,1))}const c=e.data.attributes;for(const y in c){const b=c[y];let w;if(b.isInterleavedBufferAttribute){const _=i(e.data,b.data);w=new Dd(_,b.itemSize,b.offset,b.normalized)}else{const _=Hg(b.type,b.array),S=b.isInstancedBufferAttribute?Rp:qn;w=new S(_,b.itemSize,b.normalized)}b.name!==void 0&&(w.name=b.name),b.usage!==void 0&&w.setUsage(b.usage),s.setAttribute(y,w)}const u=e.data.morphAttributes;if(u)for(const y in u){const b=u[y],w=[];for(let _=0,S=b.length;_<S;_++){const E=b[_];let T;if(E.isInterleavedBufferAttribute){const P=i(e.data,E.data);T=new Dd(P,E.itemSize,E.offset,E.normalized)}else{const P=Hg(E.type,E.array);T=new qn(P,E.itemSize,E.normalized)}E.name!==void 0&&(T.name=E.name),w.push(T)}s.morphAttributes[y]=w}e.data.morphTargetsRelative&&(s.morphTargetsRelative=!0);const p=e.data.groups||e.data.drawcalls||e.data.offsets;if(p!==void 0)for(let y=0,b=p.length;y!==b;++y){const w=p[y];s.addGroup(w.start,w.count,w.materialIndex)}const v=e.data.boundingSphere;return v!==void 0&&(s.boundingSphere=new Zi().fromJSON(v)),e.name&&(s.name=e.name),e.userData&&(s.userData=e.userData),s}}class VEe extends ka{constructor(e){super(e)}load(e,n,r,i){const a=this,s=this.path===""?Ed.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const o=new io(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(c){let u=null;try{u=JSON.parse(c)}catch(p){i!==void 0&&i(p),p("ObjectLoader: Can't parse "+e+".",p.message);return}const h=u.metadata;if(h===void 0||h.type===void 0||h.type.toLowerCase()==="geometry"){i!==void 0&&i(new Error("THREE.ObjectLoader: Can't load "+e)),zt("ObjectLoader: Can't load "+e);return}a.parse(u,n)},r,i)}async loadAsync(e,n){const r=this,i=this.path===""?Ed.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const a=new io(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials);const s=await a.loadAsync(e,n),o=JSON.parse(s),c=o.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(o)}parse(e,n){const r=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),a=this.parseGeometries(e.geometries,i),s=this.parseImages(e.images,function(){n!==void 0&&n(u)}),o=this.parseTextures(e.textures,s),c=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,a,c,o,r),h=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,h),this.bindLightTargets(u),n!==void 0){let p=!1;for(const v in s)if(s[v].data instanceof HTMLImageElement){p=!0;break}p===!1&&n(u)}return u}async parseAsync(e){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),a=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,a),o=this.parseMaterials(e.materials,s),c=this.parseObject(e.object,i,o,s,n),u=this.parseSkeletons(e.skeletons,c);return this.bindSkeletons(c,u),this.bindLightTargets(c),c}parseShapes(e){const n={};if(e!==void 0)for(let r=0,i=e.length;r<i;r++){const a=new _p().fromJSON(e[r]);n[a.uuid]=a}return n}parseSkeletons(e,n){const r={},i={};if(n.traverse(function(a){a.isBone&&(i[a.uuid]=a)}),e!==void 0)for(let a=0,s=e.length;a<s;a++){const o=new f1().fromJSON(e[a],i);r[o.uuid]=o}return r}parseGeometries(e,n){const r={};if(e!==void 0){const i=new VY;for(let a=0,s=e.length;a<s;a++){let o;const c=e[a];switch(c.type){case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(c);break;default:c.type in qG?o=qG[c.type].fromJSON(c,n):xt(`ObjectLoader: Unsupported geometry type "${c.type}"`)}o.uuid=c.uuid,c.name!==void 0&&(o.name=c.name),c.userData!==void 0&&(o.userData=c.userData),r[c.uuid]=o}}return r}parseMaterials(e,n){const r={},i={};if(e!==void 0){const a=new ST;a.setTextures(n);for(let s=0,o=e.length;s<o;s++){const c=e[s];r[c.uuid]===void 0&&(r[c.uuid]=a.parse(c)),i[c.uuid]=r[c.uuid]}}return i}parseAnimations(e){const n={};if(e!==void 0)for(let r=0;r<e.length;r++){const i=e[r],a=jv.parse(i);n[a.uuid]=a}return n}parseImages(e,n){const r=this,i={};let a;function s(c){return r.manager.itemStart(c),a.load(c,function(){r.manager.itemEnd(c)},void 0,function(){r.manager.itemError(c),r.manager.itemEnd(c)})}function o(c){if(typeof c=="string"){const u=c,h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u)?u:r.resourcePath+u;return s(h)}else return c.data?{data:Hg(c.type,c.data),width:c.width,height:c.height}:null}if(e!==void 0&&e.length>0){const c=new uk(n);a=new Ub(c),a.setCrossOrigin(this.crossOrigin);for(let u=0,h=e.length;u<h;u++){const p=e[u],v=p.url;if(Array.isArray(v)){const y=[];for(let b=0,w=v.length;b<w;b++){const _=v[b],S=o(_);S!==null&&(S instanceof HTMLImageElement?y.push(S):y.push(new Fl(S.data,S.width,S.height)))}i[p.uuid]=new Ad(y)}else{const y=o(p.url);i[p.uuid]=new Ad(y)}}}return i}async parseImagesAsync(e){const n=this,r={};let i;async function a(s){if(typeof s=="string"){const o=s,c=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(o)?o:n.resourcePath+o;return await i.loadAsync(c)}else return s.data?{data:Hg(s.type,s.data),width:s.width,height:s.height}:null}if(e!==void 0&&e.length>0){i=new Ub(this.manager),i.setCrossOrigin(this.crossOrigin);for(let s=0,o=e.length;s<o;s++){const c=e[s],u=c.url;if(Array.isArray(u)){const h=[];for(let p=0,v=u.length;p<v;p++){const y=u[p],b=await a(y);b!==null&&(b instanceof HTMLImageElement?h.push(b):h.push(new Fl(b.data,b.width,b.height)))}r[c.uuid]=new Ad(h)}else{const h=await a(c.url);r[c.uuid]=new Ad(h)}}}return r}parseTextures(e,n){function r(a,s){return typeof a=="number"?a:(xt("ObjectLoader.parseTexture: Constant should be in numeric form.",a),s[a])}const i={};if(e!==void 0)for(let a=0,s=e.length;a<s;a++){const o=e[a];o.image===void 0&&xt('ObjectLoader: No "image" specified for',o.uuid),n[o.image]===void 0&&xt("ObjectLoader: Undefined image",o.image);const c=n[o.image],u=c.data;let h;Array.isArray(u)?(h=new c1,u.length===6&&(h.needsUpdate=!0)):(u&&u.data?h=new Fl:h=new Gr,u&&(h.needsUpdate=!0)),h.source=c,h.uuid=o.uuid,o.name!==void 0&&(h.name=o.name),o.mapping!==void 0&&(h.mapping=r(o.mapping,WEe)),o.channel!==void 0&&(h.channel=o.channel),o.offset!==void 0&&h.offset.fromArray(o.offset),o.repeat!==void 0&&h.repeat.fromArray(o.repeat),o.center!==void 0&&h.center.fromArray(o.center),o.rotation!==void 0&&(h.rotation=o.rotation),o.wrap!==void 0&&(h.wrapS=r(o.wrap[0],KG),h.wrapT=r(o.wrap[1],KG)),o.format!==void 0&&(h.format=o.format),o.internalFormat!==void 0&&(h.internalFormat=o.internalFormat),o.type!==void 0&&(h.type=o.type),o.colorSpace!==void 0&&(h.colorSpace=o.colorSpace),o.minFilter!==void 0&&(h.minFilter=r(o.minFilter,YG)),o.magFilter!==void 0&&(h.magFilter=r(o.magFilter,YG)),o.anisotropy!==void 0&&(h.anisotropy=o.anisotropy),o.flipY!==void 0&&(h.flipY=o.flipY),o.generateMipmaps!==void 0&&(h.generateMipmaps=o.generateMipmaps),o.premultiplyAlpha!==void 0&&(h.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(h.unpackAlignment=o.unpackAlignment),o.compareFunction!==void 0&&(h.compareFunction=o.compareFunction),o.userData!==void 0&&(h.userData=o.userData),i[o.uuid]=h}return i}parseObject(e,n,r,i,a){let s;function o(v){return n[v]===void 0&&xt("ObjectLoader: Undefined geometry",v),n[v]}function c(v){if(v!==void 0){if(Array.isArray(v)){const y=[];for(let b=0,w=v.length;b<w;b++){const _=v[b];r[_]===void 0&&xt("ObjectLoader: Undefined material",_),y.push(r[_])}return y}return r[v]===void 0&&xt("ObjectLoader: Undefined material",v),r[v]}}function u(v){return i[v]===void 0&&xt("ObjectLoader: Undefined texture",v),i[v]}let h,p;switch(e.type){case"Scene":s=new W5,e.background!==void 0&&(Number.isInteger(e.background)?s.background=new bt(e.background):s.background=u(e.background)),e.environment!==void 0&&(s.environment=u(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?s.fog=new iT(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(s.fog=new rT(e.fog.color,e.fog.density)),e.fog.name!==""&&(s.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(s.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(s.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&s.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(s.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&s.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":s=new jr(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(s.focus=e.focus),e.zoom!==void 0&&(s.zoom=e.zoom),e.filmGauge!==void 0&&(s.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(s.filmOffset=e.filmOffset),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new qo(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(s.zoom=e.zoom),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new jY(e.color,e.intensity);break;case"DirectionalLight":s=new pk(e.color,e.intensity),s.target=e.target||"";break;case"PointLight":s=new hk(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new zY(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new dk(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),s.target=e.target||"";break;case"HemisphereLight":s=new UY(e.color,e.groundColor,e.intensity);break;case"LightProbe":const v=new mk().fromArray(e.sh);s=new GY(v,e.intensity);break;case"SkinnedMesh":h=o(e.geometry),p=c(e.material),s=new $5(h,p),e.bindMode!==void 0&&(s.bindMode=e.bindMode),e.bindMatrix!==void 0&&s.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(s.skeleton=e.skeleton);break;case"Mesh":h=o(e.geometry),p=c(e.material),s=new vi(h,p);break;case"InstancedMesh":h=o(e.geometry),p=c(e.material);const y=e.count,b=e.instanceMatrix,w=e.instanceColor;s=new X5(h,p,y),s.instanceMatrix=new Rp(new Float32Array(b.array),16),w!==void 0&&(s.instanceColor=new Rp(new Float32Array(w.array),w.itemSize));break;case"BatchedMesh":h=o(e.geometry),p=c(e.material),s=new dY(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,p),s.geometry=h,s.perObjectFrustumCulled=e.perObjectFrustumCulled,s.sortObjects=e.sortObjects,s._drawRanges=e.drawRanges,s._reservedRanges=e.reservedRanges,s._geometryInfo=e.geometryInfo.map(_=>{let S=null,E=null;return _.boundingBox!==void 0&&(S=new Oi().fromJSON(_.boundingBox)),_.boundingSphere!==void 0&&(E=new Zi().fromJSON(_.boundingSphere)),{..._,boundingBox:S,boundingSphere:E}}),s._instanceInfo=e.instanceInfo,s._availableInstanceIds=e._availableInstanceIds,s._availableGeometryIds=e._availableGeometryIds,s._nextIndexStart=e.nextIndexStart,s._nextVertexStart=e.nextVertexStart,s._geometryCount=e.geometryCount,s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._matricesTexture=u(e.matricesTexture.uuid),s._indirectTexture=u(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(s._colorsTexture=u(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(s.boundingSphere=new Zi().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(s.boundingBox=new Oi().fromJSON(e.boundingBox));break;case"LOD":s=new fY;break;case"Line":s=new of(o(e.geometry),c(e.material));break;case"LineLoop":s=new K5(o(e.geometry),c(e.material));break;case"LineSegments":s=new Hl(o(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new Y5(o(e.geometry),c(e.material));break;case"Sprite":s=new uY(c(e.material));break;case"Group":s=new $u;break;case"Bone":s=new aT;break;default:s=new zn}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.up!==void 0&&s.up.fromArray(e.up),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(s.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const v=e.children;for(let y=0;y<v.length;y++)s.add(this.parseObject(v[y],n,r,i,a))}if(e.animations!==void 0){const v=e.animations;for(let y=0;y<v.length;y++){const b=v[y];s.animations.push(a[b])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(s.autoUpdate=e.autoUpdate);const v=e.levels;for(let y=0;y<v.length;y++){const b=v[y],w=s.getObjectByProperty("uuid",b.object);w!==void 0&&s.addLevel(w,b.distance,b.hysteresis)}}return s}bindSkeletons(e,n){Object.keys(n).length!==0&&e.traverse(function(r){if(r.isSkinnedMesh===!0&&r.skeleton!==void 0){const i=n[r.skeleton];i===void 0?xt("ObjectLoader: No skeleton found with UUID:",r.skeleton):r.bind(i,r.bindMatrix)}})}bindLightTargets(e){e.traverse(function(n){if(n.isDirectionalLight||n.isSpotLight){const r=n.target,i=e.getObjectByProperty("uuid",r);i!==void 0?n.target=i:n.target=new zn}})}}const WEe={UVMapping:HE,CubeReflectionMapping:Wc,CubeRefractionMapping:Cd,EquirectangularReflectionMapping:Rb,EquirectangularRefractionMapping:Ob,CubeUVReflectionMapping:oy},KG={RepeatWrapping:Rd,ClampToEdgeWrapping:ss,MirroredRepeatWrapping:Cv},YG={NearestFilter:si,NearestMipmapNearestFilter:VE,NearestMipmapLinearFilter:up,LinearFilter:vr,LinearMipmapNearestFilter:Jg,LinearMipmapLinearFilter:zo},SD=new WeakMap;class WY extends ka{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&xt("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&xt("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=Dc.get(`image-bitmap:${e}`);if(s!==void 0){if(a.manager.itemStart(e),s.then){s.then(u=>{if(SD.has(s)===!0)i&&i(SD.get(s)),a.manager.itemError(e),a.manager.itemEnd(e);else return n&&n(u),a.manager.itemEnd(e),u});return}return setTimeout(function(){n&&n(s),a.manager.itemEnd(e)},0),s}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,o.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const c=fetch(e,o).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(u){return Dc.add(`image-bitmap:${e}`,u),n&&n(u),a.manager.itemEnd(e),u}).catch(function(u){i&&i(u),SD.set(c,u),Dc.remove(`image-bitmap:${e}`),a.manager.itemError(e),a.manager.itemEnd(e)});Dc.add(`image-bitmap:${e}`,c),a.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let uA;class gk{static getContext(){return uA===void 0&&(uA=new(window.AudioContext||window.webkitAudioContext)),uA}static setContext(e){uA=e}}class qEe extends ka{constructor(e){super(e)}load(e,n,r,i){const a=this,s=new io(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(c){try{const u=c.slice(0);gk.getContext().decodeAudioData(u,function(p){n(p)}).catch(o)}catch(u){o(u)}},r,i);function o(c){i?i(c):zt(c),a.manager.itemError(e)}}}const JG=new qt,ZG=new qt,jh=new qt;class $Ee{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new jr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new jr,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 n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,jh.copy(e.projectionMatrix);const i=n.eyeSep/2,a=i*n.near/n.focus,s=n.near*Math.tan(bp*n.fov*.5)/n.zoom;let o,c;ZG.elements[12]=-i,JG.elements[12]=i,o=-s*n.aspect+a,c=s*n.aspect+a,jh.elements[0]=2*n.near/(c-o),jh.elements[8]=(c+o)/(c-o),this.cameraL.projectionMatrix.copy(jh),o=-s*n.aspect-a,c=s*n.aspect-a,jh.elements[0]=2*n.near/(c-o),jh.elements[8]=(c+o)/(c-o),this.cameraR.projectionMatrix.copy(jh)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(ZG),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(JG)}}class qY extends jr{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class vk{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),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 n=performance.now();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}const zh=new ne,AD=new gi,XEe=new ne,Gh=new ne,Hh=new ne;class KEe extends zn{constructor(){super(),this.type="AudioListener",this.context=gk.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new vk}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 n=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(zh,AD,XEe),Gh.set(0,0,-1).applyQuaternion(AD),Hh.set(0,1,0).applyQuaternion(AD),n.positionX){const r=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(zh.x,r),n.positionY.linearRampToValueAtTime(zh.y,r),n.positionZ.linearRampToValueAtTime(zh.z,r),n.forwardX.linearRampToValueAtTime(Gh.x,r),n.forwardY.linearRampToValueAtTime(Gh.y,r),n.forwardZ.linearRampToValueAtTime(Gh.z,r),n.upX.linearRampToValueAtTime(Hh.x,r),n.upY.linearRampToValueAtTime(Hh.y,r),n.upZ.linearRampToValueAtTime(Hh.z,r)}else n.setPosition(zh.x,zh.y,zh.z),n.setOrientation(Gh.x,Gh.y,Gh.z,Hh.x,Hh.y,Hh.z)}}class $Y extends zn{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){xt("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){xt("Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){xt("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){xt("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){xt("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,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(xt("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){xt("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}copy(e,n){return super.copy(e,n),e.sourceType!=="buffer"?(xt("Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const Vh=new ne,QG=new gi,YEe=new ne,Wh=new ne;class JEe extends $Y{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}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,n,r){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=n,this.panner.coneOuterGain=r,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Vh,QG,YEe),Wh.set(0,0,1).applyQuaternion(QG);const n=this.panner;if(n.positionX){const r=this.context.currentTime+this.listener.timeDelta;n.positionX.linearRampToValueAtTime(Vh.x,r),n.positionY.linearRampToValueAtTime(Vh.y,r),n.positionZ.linearRampToValueAtTime(Vh.z,r),n.orientationX.linearRampToValueAtTime(Wh.x,r),n.orientationY.linearRampToValueAtTime(Wh.y,r),n.orientationZ.linearRampToValueAtTime(Wh.z,r)}else n.setPosition(Vh.x,Vh.y,Vh.z),n.setOrientation(Wh.x,Wh.y,Wh.z)}}class ZEe{constructor(e,n=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=n,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 n=this.getFrequencyData();for(let r=0;r<n.length;r++)e+=n[r];return e/n.length}}class XY{constructor(e,n,r){this.binding=e,this.valueSize=r;let i,a,s;switch(n){case"quaternion":i=this._slerp,a=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(r*6),this._workIndex=5;break;case"string":case"bool":i=this._select,a=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(r*5);break;default:i=this._lerp,a=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(r*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=a,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,n){const r=this.buffer,i=this.valueSize,a=e*i+i;let s=this.cumulativeWeight;if(s===0){for(let o=0;o!==i;++o)r[a+o]=r[o];s=n}else{s+=n;const o=n/s;this._mixBufferRegion(r,a,0,o,i)}this.cumulativeWeight=s}accumulateAdditive(e){const n=this.buffer,r=this.valueSize,i=r*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(n,i,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){const n=this.valueSize,r=this.buffer,i=e*n+n,a=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){const c=n*this._origIndex;this._mixBufferRegion(r,i,c,1-a,n)}s>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*n,1,n);for(let c=n,u=n+n;c!==u;++c)if(r[c]!==r[c+n]){o.setValue(r,i);break}}saveOriginalState(){const e=this.binding,n=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(n,i);for(let a=r,s=i;a!==s;++a)n[a]=n[i+a%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,n=e+this.valueSize;for(let r=e;r<n;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,n=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[n+r]=this.buffer[e+r]}_select(e,n,r,i,a){if(i>=.5)for(let s=0;s!==a;++s)e[n+s]=e[r+s]}_slerp(e,n,r,i){gi.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,a){const s=this._workIndex*a;gi.multiplyQuaternionsFlat(e,s,e,n,e,r),gi.slerpFlat(e,n,e,n,e,s,i)}_lerp(e,n,r,i,a){const s=1-i;for(let o=0;o!==a;++o){const c=n+o;e[c]=e[c]*s+e[r+o]*i}}_lerpAdditive(e,n,r,i,a){for(let s=0;s!==a;++s){const o=n+s;e[o]=e[o]+e[r+s]*i}}}const yk="\\[\\]\\.:\\/",QEe=new RegExp("["+yk+"]","g"),xk="[^"+yk+"]",eTe="[^"+yk.replace("\\.","")+"]",tTe=/((?:WC+[\/:])*)/.source.replace("WC",xk),nTe=/(WCOD+)?/.source.replace("WCOD",eTe),rTe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xk),iTe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xk),aTe=new RegExp("^"+tTe+nTe+rTe+iTe+"$"),sTe=["material","materials","bones","map"];class oTe{constructor(e,n,r){const i=r||Hn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,a=r.length;i!==a;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class Hn{constructor(e,n,r){this.path=n,this.parsedPath=r||Hn.parseTrackName(n),this.node=Hn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new Hn.Composite(e,n,r):new Hn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(QEe,"")}static parseTrackName(e){const n=aTe.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const a=r.nodeName.substring(i+1);sTe.indexOf(a)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=a)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(a){for(let s=0;s<a.length;s++){const o=a[s];if(o.name===n||o.uuid===n)return o;const c=r(o.children);if(c)return c}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,n){e[n]=this.targetObject[this.propertyName]}_getValue_array(e,n){const r=this.resolvedProperty;for(let i=0,a=r.length;i!==a;++i)e[n++]=r[i]}_getValue_arrayElement(e,n){e[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,n){this.resolvedProperty.toArray(e,n)}_setValue_direct(e,n){this.targetObject[this.propertyName]=e[n]}_setValue_direct_setNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,n){const r=this.resolvedProperty;for(let i=0,a=r.length;i!==a;++i)r[i]=e[n++]}_setValue_array_setNeedsUpdate(e,n){const r=this.resolvedProperty;for(let i=0,a=r.length;i!==a;++i)r[i]=e[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,n){const r=this.resolvedProperty;for(let i=0,a=r.length;i!==a;++i)r[i]=e[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,n){this.resolvedProperty[this.propertyIndex]=e[n]}_setValue_arrayElement_setNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,n){this.resolvedProperty.fromArray(e,n)}_setValue_fromArray_setNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,n){this.bind(),this.getValue(e,n)}_setValue_unbound(e,n){this.bind(),this.setValue(e,n)}bind(){let e=this.node;const n=this.parsedPath,r=n.objectName,i=n.propertyName;let a=n.propertyIndex;if(e||(e=Hn.findNode(this.rootNode,n.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){xt("PropertyBinding: No target node found for track: "+this.path+".");return}if(r){let u=n.objectIndex;switch(r){case"materials":if(!e.material){zt("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){zt("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){zt("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let h=0;h<e.length;h++)if(e[h].name===u){u=h;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){zt("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){zt("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){zt("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}if(u!==void 0){if(e[u]===void 0){zt("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const s=e[i];if(s===void 0){const u=n.nodeName;zt("PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(a!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){zt("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){zt("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[a]!==void 0&&(a=e.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=a}else s.fromArray!==void 0&&s.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Hn.Composite=oTe;Hn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Hn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Hn.prototype.GetterByBindingType=[Hn.prototype._getValue_direct,Hn.prototype._getValue_array,Hn.prototype._getValue_arrayElement,Hn.prototype._getValue_toArray];Hn.prototype.SetterByBindingTypeAndVersioning=[[Hn.prototype._setValue_direct,Hn.prototype._setValue_direct_setNeedsUpdate,Hn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Hn.prototype._setValue_array,Hn.prototype._setValue_array_setNeedsUpdate,Hn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Hn.prototype._setValue_arrayElement,Hn.prototype._setValue_arrayElement_setNeedsUpdate,Hn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Hn.prototype._setValue_fromArray,Hn.prototype._setValue_fromArray_setNeedsUpdate,Hn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class lTe{constructor(){this.isAnimationObjectGroup=!0,this.uuid=eo(),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 n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}add(){const e=this._objects,n=this._indicesByUUID,r=this._paths,i=this._parsedPaths,a=this._bindings,s=a.length;let o,c=e.length,u=this.nCachedObjects_;for(let h=0,p=arguments.length;h!==p;++h){const v=arguments[h],y=v.uuid;let b=n[y];if(b===void 0){b=c++,n[y]=b,e.push(v);for(let w=0,_=s;w!==_;++w)a[w].push(new Hn(v,r[w],i[w]))}else if(b<u){o=e[b];const w=--u,_=e[w];n[_.uuid]=b,e[b]=_,n[y]=w,e[w]=v;for(let S=0,E=s;S!==E;++S){const T=a[S],P=T[w];let R=T[b];T[b]=P,R===void 0&&(R=new Hn(v,r[S],i[S])),T[w]=R}}else e[b]!==o&&zt("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}remove(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let a=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){const c=arguments[s],u=c.uuid,h=n[u];if(h!==void 0&&h>=a){const p=a++,v=e[p];n[v.uuid]=h,e[h]=v,n[u]=p,e[p]=c;for(let y=0,b=i;y!==b;++y){const w=r[y],_=w[p],S=w[h];w[h]=_,w[p]=S}}}this.nCachedObjects_=a}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let a=this.nCachedObjects_,s=e.length;for(let o=0,c=arguments.length;o!==c;++o){const u=arguments[o],h=u.uuid,p=n[h];if(p!==void 0)if(delete n[h],p<a){const v=--a,y=e[v],b=--s,w=e[b];n[y.uuid]=p,e[p]=y,n[w.uuid]=v,e[v]=w,e.pop();for(let _=0,S=i;_!==S;++_){const E=r[_],T=E[v],P=E[b];E[p]=T,E[v]=P,E.pop()}}else{const v=--s,y=e[v];v>0&&(n[y.uuid]=p),e[p]=y,e.pop();for(let b=0,w=i;b!==w;++b){const _=r[b];_[p]=_[v],_.pop()}}}this.nCachedObjects_=a}subscribe_(e,n){const r=this._bindingsIndicesByPath;let i=r[e];const a=this._bindings;if(i!==void 0)return a[i];const s=this._paths,o=this._parsedPaths,c=this._objects,u=c.length,h=this.nCachedObjects_,p=new Array(u);i=a.length,r[e]=i,s.push(e),o.push(n),a.push(p);for(let v=h,y=c.length;v!==y;++v){const b=c[v];p[v]=new Hn(b,e,n)}return p}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,a=this._parsedPaths,s=this._bindings,o=s.length-1,c=s[o],u=e[o];n[u]=r,s[r]=c,s.pop(),a[r]=a[o],a.pop(),i[r]=i[o],i.pop()}}}class KY{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const a=n.tracks,s=a.length,o=new Array(s),c={endingStart:fp,endingEnd:fp};for(let u=0;u!==s;++u){const h=a[u].createInterpolant(null);o[u]=h,h.settings=c}this._interpolantSettings=c,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=HK,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,n){return this.loop=e,this.repetitions=n,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,n,r=!1){if(e.fadeOut(n),this.fadeIn(n),r===!0){const i=this._clip.duration,a=e._clip.duration,s=a/i,o=i/a;e.warp(1,s,n),this.warp(o,1,n)}return this}crossFadeTo(e,n,r=!1){return e.crossFadeFrom(this,n,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,n,r){const i=this._mixer,a=i.time,s=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const c=o.parameterPositions,u=o.sampleValues;return c[0]=a,c[1]=a+r,u[0]=e/s,u[1]=n/s,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,n,r,i){if(!this.enabled){this._updateWeight(e);return}const a=this._startTime;if(a!==null){const c=(e-a)*r;c<0||r===0?n=0:(this._startTime=null,n=r*c)}n*=this._updateTimeScale(e);const s=this._updateTime(n),o=this._updateWeight(e);if(o>0){const c=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case F5:for(let h=0,p=c.length;h!==p;++h)c[h].evaluate(s),u[h].accumulateAdditive(o);break;case JE:default:for(let h=0,p=c.length;h!==p;++h)c[h].evaluate(s),u[h].accumulate(i,o)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,r=this.loop;let i=this.time+e,a=this._loopCount;const s=r===VK;if(e===0)return a===-1?i:s&&(a&1)===1?n-i:i;if(r===GK){a===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=n)i=n;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(a===-1&&(e>=0?(a=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),i>=n||i<0){const o=Math.floor(i/n);i-=n*o,a+=Math.abs(o);const c=this.repetitions-a;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?n:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const u=e<0;this._setEndings(u,!u,s)}else this._setEndings(!1,!1,s);this._loopCount=a,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=i;if(s&&(a&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=dp,i.endingEnd=dp):(e?i.endingStart=this.zeroSlopeAtStart?dp:fp:i.endingStart=Pb,n?i.endingEnd=this.zeroSlopeAtEnd?dp:fp:i.endingEnd=Pb)}_scheduleFading(e,n,r){const i=this._mixer,a=i.time;let s=this._weightInterpolant;s===null&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,c=s.sampleValues;return o[0]=a,c[0]=n,o[1]=a+e,c[1]=r,this}}const cTe=new Float32Array(1);class uTe extends Yc{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const r=e._localRoot||this._root,i=e._clip.tracks,a=i.length,s=e._propertyBindings,o=e._interpolants,c=r.uuid,u=this._bindingsByRootAndName;let h=u[c];h===void 0&&(h={},u[c]=h);for(let p=0;p!==a;++p){const v=i[p],y=v.name;let b=h[y];if(b!==void 0)++b.referenceCount,s[p]=b;else{if(b=s[p],b!==void 0){b._cacheIndex===null&&(++b.referenceCount,this._addInactiveBinding(b,c,y));continue}const w=n&&n._propertyBindings[p].binding.parsedPath;b=new XY(Hn.create(r,y,w),v.ValueTypeName,v.getValueSize()),++b.referenceCount,this._addInactiveBinding(b,c,y),s[p]=b}o[p].resultBuffer=b.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,a=this._actionsByClip[i];this._bindAction(e,a&&a.knownActions[0]),this._addInactiveAction(e,i,r)}const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const a=n[r];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const a=n[r];--a.useCount===0&&(a.restoreOriginalState(),this._takeBackBinding(a))}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 n=e._cacheIndex;return n!==null&&n<this._nActiveActions}_addInactiveAction(e,n,r){const i=this._actions,a=this._actionsByClip;let s=a[n];if(s===void 0)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[n]=s;else{const o=s.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=i.length,i.push(e),s.actionByRoot[r]=e}_removeInactiveAction(e){const n=this._actions,r=n[n.length-1],i=e._cacheIndex;r._cacheIndex=i,n[i]=r,n.pop(),e._cacheIndex=null;const a=e._clip.uuid,s=this._actionsByClip,o=s[a],c=o.knownActions,u=c[c.length-1],h=e._byClipCacheIndex;u._byClipCacheIndex=h,c[h]=u,c.pop(),e._byClipCacheIndex=null;const p=o.actionByRoot,v=(e._localRoot||this._root).uuid;delete p[v],c.length===0&&delete s[a],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const a=n[r];--a.referenceCount===0&&this._removeInactiveBinding(a)}}_lendAction(e){const n=this._actions,r=e._cacheIndex,i=this._nActiveActions++,a=n[i];e._cacheIndex=i,n[i]=e,a._cacheIndex=r,n[r]=a}_takeBackAction(e){const n=this._actions,r=e._cacheIndex,i=--this._nActiveActions,a=n[i];e._cacheIndex=i,n[i]=e,a._cacheIndex=r,n[r]=a}_addInactiveBinding(e,n,r){const i=this._bindingsByRootAndName,a=this._bindings;let s=i[n];s===void 0&&(s={},i[n]=s),s[r]=e,e._cacheIndex=a.length,a.push(e)}_removeInactiveBinding(e){const n=this._bindings,r=e.binding,i=r.rootNode.uuid,a=r.path,s=this._bindingsByRootAndName,o=s[i],c=n[n.length-1],u=e._cacheIndex;c._cacheIndex=u,n[u]=c,n.pop(),delete o[a],Object.keys(o).length===0&&delete s[i]}_lendBinding(e){const n=this._bindings,r=e._cacheIndex,i=this._nActiveBindings++,a=n[i];e._cacheIndex=i,n[i]=e,a._cacheIndex=r,n[r]=a}_takeBackBinding(e){const n=this._bindings,r=e._cacheIndex,i=--this._nActiveBindings,a=n[i];e._cacheIndex=i,n[i]=e,a._cacheIndex=r,n[r]=a}_lendControlInterpolant(){const e=this._controlInterpolants,n=this._nActiveControlInterpolants++;let r=e[n];return r===void 0&&(r=new lk(new Float32Array(2),new Float32Array(2),1,cTe),r.__cacheIndex=n,e[n]=r),r}_takeBackControlInterpolant(e){const n=this._controlInterpolants,r=e.__cacheIndex,i=--this._nActiveControlInterpolants,a=n[i];e.__cacheIndex=i,n[i]=e,a.__cacheIndex=r,n[r]=a}clipAction(e,n,r){const i=n||this._root,a=i.uuid;let s=typeof e=="string"?jv.findByName(i,e):e;const o=s!==null?s.uuid:e,c=this._actionsByClip[o];let u=null;if(r===void 0&&(s!==null?r=s.blendMode:r=JE),c!==void 0){const p=c.actionByRoot[a];if(p!==void 0&&p.blendMode===r)return p;u=c.knownActions[0],s===null&&(s=u._clip)}if(s===null)return null;const h=new KY(this,s,n,r);return this._bindAction(h,u),this._addInactiveAction(h,o,a),h}existingAction(e,n){const r=n||this._root,i=r.uuid,a=typeof e=="string"?jv.findByName(r,e):e,s=a?a.uuid:e,o=this._actionsByClip[s];return o!==void 0&&o.actionByRoot[i]||null}stopAllAction(){const e=this._actions,n=this._nActiveActions;for(let r=n-1;r>=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const n=this._actions,r=this._nActiveActions,i=this.time+=e,a=Math.sign(e),s=this._accuIndex^=1;for(let u=0;u!==r;++u)n[u]._update(i,e,a,s);const o=this._bindings,c=this._nActiveBindings;for(let u=0;u!==c;++u)o[u].apply(s);return this}setTime(e){this.time=0;for(let n=0;n<this._actions.length;n++)this._actions[n].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const n=this._actions,r=e.uuid,i=this._actionsByClip,a=i[r];if(a!==void 0){const s=a.knownActions;for(let o=0,c=s.length;o!==c;++o){const u=s[o];this._deactivateAction(u);const h=u._cacheIndex,p=n[n.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,p._cacheIndex=h,n[h]=p,n.pop(),this._removeInactiveBindingsForAction(u)}delete i[r]}}uncacheRoot(e){const n=e.uuid,r=this._actionsByClip;for(const s in r){const o=r[s].actionByRoot,c=o[n];c!==void 0&&(this._deactivateAction(c),this._removeInactiveAction(c))}const i=this._bindingsByRootAndName,a=i[n];if(a!==void 0)for(const s in a){const o=a[s];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,n){const r=this.existingAction(e,n);r!==null&&(this._deactivateAction(r),this._removeInactiveAction(r))}}class fTe extends z5{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isRenderTarget3D=!0,this.depth=r,this.texture=new tT(null,e,n,r),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class bk{constructor(e){this.value=e}clone(){return new bk(this.value.clone===void 0?this.value:this.value.clone())}}let dTe=0;class hTe extends Yc{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:dTe++}),this.name="",this.usage=Nb,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const n=this.uniforms.indexOf(e);return n!==-1&&this.uniforms.splice(n,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const n=e.uniforms;this.uniforms.length=0;for(let r=0,i=n.length;r<i;r++){const a=Array.isArray(n[r])?n[r]:[n[r]];for(let s=0;s<a.length;s++)this.uniforms.push(a[s].clone())}return this}clone(){return new this.constructor().copy(this)}}class pTe extends u1{constructor(e,n,r=1){super(e,n),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const n=super.clone(e);return n.meshPerAttribute=this.meshPerAttribute,n}toJSON(e){const n=super.toJSON(e);return n.isInstancedInterleavedBuffer=!0,n.meshPerAttribute=this.meshPerAttribute,n}}class mTe{constructor(e,n,r,i,a,s=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=n,this.itemSize=r,this.elementSize=i,this.count=a,this.normalized=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,n){return this.type=e,this.elementSize=n,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const eH=new qt;class YY{constructor(e,n,r=0,i=1/0){this.ray=new Hp(e,n),this.near=r,this.far=i,this.camera=null,this.layers=new Lv,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,n){this.ray.set(e,n)}setFromCamera(e,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):zt("Raycaster: Unsupported camera type: "+n.type)}setFromXRController(e){return eH.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(eH),this}intersectObject(e,n=!0,r=[]){return cB(e,this,r,n),r.sort(tH),r}intersectObjects(e,n=!0,r=[]){for(let i=0,a=e.length;i<a;i++)cB(e[i],this,r,n);return r.sort(tH),r}}function tH(t,e){return t.distance-e.distance}function cB(t,e,n,r){let i=!0;if(t.layers.test(e.layers)&&t.raycast(e,n)===!1&&(i=!1),i===!0&&r===!0){const a=t.children;for(let s=0,o=a.length;s<o;s++)cB(a[s],e,n,!0)}}class gTe{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=vTe.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function vTe(){this._document.hidden===!1&&this.reset()}class uB{constructor(e=1,n=0,r=0){this.radius=e,this.phi=n,this.theta=r}set(e,n,r){return this.radius=e,this.phi=n,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=tn(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,r){return this.radius=Math.sqrt(e*e+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(tn(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class yTe{constructor(e=1,n=0,r=0){this.radius=e,this.theta=n,this.y=r}set(e,n,r){return this.radius=e,this.theta=n,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,n,r){return this.radius=Math.sqrt(e*e+r*r),this.theta=Math.atan2(e,r),this.y=n,this}clone(){return new this.constructor().copy(this)}}class _k{constructor(e,n,r,i){_k.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,n,r,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,n=0){for(let r=0;r<4;r++)this.elements[r]=e[r+n];return this}set(e,n,r,i){const a=this.elements;return a[0]=e,a[2]=n,a[1]=r,a[3]=i,this}}const nH=new Ve;class xTe{constructor(e=new Ve(1/0,1/0),n=new Ve(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;n<r;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const r=nH.copy(n).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,n){return n.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,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,nH).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const rH=new ne,fA=new ne,wg=new ne,Mg=new ne,wD=new ne,bTe=new ne,_Te=new ne;class STe{constructor(e=new ne,n=new ne){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),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,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){rH.subVectors(e,this.start),fA.subVectors(this.end,this.start);const r=fA.dot(fA);let a=fA.dot(rH)/r;return n&&(a=tn(a,0,1)),a}closestPointToPoint(e,n,r){const i=this.closestPointToPointParameter(e,n);return this.delta(r).multiplyScalar(i).add(this.start)}distanceSqToLine3(e,n=bTe,r=_Te){const i=10000000000000001e-32;let a,s;const o=this.start,c=e.start,u=this.end,h=e.end;wg.subVectors(u,o),Mg.subVectors(h,c),wD.subVectors(o,c);const p=wg.dot(wg),v=Mg.dot(Mg),y=Mg.dot(wD);if(p<=i&&v<=i)return n.copy(o),r.copy(c),n.sub(r),n.dot(n);if(p<=i)a=0,s=y/v,s=tn(s,0,1);else{const b=wg.dot(wD);if(v<=i)s=0,a=tn(-b/p,0,1);else{const w=wg.dot(Mg),_=p*v-w*w;_!==0?a=tn((w*y-b*v)/_,0,1):a=0,s=(w*a+y)/v,s<0?(s=0,a=tn(-b/p,0,1)):s>1&&(s=1,a=tn((w-b)/p,0,1))}}return n.copy(o).add(wg.multiplyScalar(a)),r.copy(c).add(Mg.multiplyScalar(s)),n.sub(r),n.dot(n)}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 iH=new ne;class ATe extends zn{constructor(e,n){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new an,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 s=0,o=1,c=32;s<c;s++,o++){const u=s/c*Math.PI*2,h=o/c*Math.PI*2;i.push(Math.cos(u),Math.sin(u),1,Math.cos(h),Math.sin(h),1)}r.setAttribute("position",new Pt(i,3));const a=new La({fog:!1,toneMapped:!1});this.cone=new Hl(r,a),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,n=e*Math.tan(this.light.angle);this.cone.scale.set(n,n,e),iH.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(iH),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const ud=new ne,dA=new qt,MD=new qt;class wTe extends Hl{constructor(e){const n=JY(e),r=new an,i=[],a=[];for(let u=0;u<n.length;u++){const h=n[u];h.parent&&h.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),a.push(0,0,0),a.push(0,0,0))}r.setAttribute("position",new Pt(i,3)),r.setAttribute("color",new Pt(a,3));const s=new La({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(r,s),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=n,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const o=new bt(255),c=new bt(65280);this.setColors(o,c)}updateMatrixWorld(e){const n=this.bones,r=this.geometry,i=r.getAttribute("position");MD.copy(this.root.matrixWorld).invert();for(let a=0,s=0;a<n.length;a++){const o=n[a];o.parent&&o.parent.isBone&&(dA.multiplyMatrices(MD,o.matrixWorld),ud.setFromMatrixPosition(dA),i.setXYZ(s,ud.x,ud.y,ud.z),dA.multiplyMatrices(MD,o.parent.matrixWorld),ud.setFromMatrixPosition(dA),i.setXYZ(s+1,ud.x,ud.y,ud.z),s+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,n){const i=this.geometry.getAttribute("color");for(let a=0;a<i.count;a+=2)i.setXYZ(a,e.r,e.g,e.b),i.setXYZ(a+1,n.r,n.g,n.b);return i.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function JY(t){const e=[];t.isBone===!0&&e.push(t);for(let n=0;n<t.children.length;n++)e.push(...JY(t.children[n]));return e}class MTe extends vi{constructor(e,n,r){const i=new m1(n,4,2),a=new Qs({wireframe:!0,fog:!1,toneMapped:!1});super(i,a),this.light=e,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.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const ETe=new ne,aH=new bt,sH=new bt;class TTe extends zn{constructor(e,n,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="HemisphereLightHelper";const i=new p1(n);i.rotateY(Math.PI*.5),this.material=new Qs({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const a=i.getAttribute("position"),s=new Float32Array(a.count*3);i.setAttribute("color",new qn(s,3)),this.add(new vi(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 n=e.geometry.getAttribute("color");aH.copy(this.light.color),sH.copy(this.light.groundColor);for(let r=0,i=n.count;r<i;r++){const a=r<i/2?aH:sH;n.setXYZ(r,a.r,a.g,a.b)}n.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(ETe.setFromMatrixPosition(this.light.matrixWorld).negate())}}class CTe extends Hl{constructor(e=10,n=10,r=4473924,i=8947848){r=new bt(r),i=new bt(i);const a=n/2,s=e/n,o=e/2,c=[],u=[];for(let v=0,y=0,b=-o;v<=n;v++,b+=s){c.push(-o,0,b,o,0,b),c.push(b,0,-o,b,0,o);const w=v===a?r:i;w.toArray(u,y),y+=3,w.toArray(u,y),y+=3,w.toArray(u,y),y+=3,w.toArray(u,y),y+=3}const h=new an;h.setAttribute("position",new Pt(c,3)),h.setAttribute("color",new Pt(u,3));const p=new La({vertexColors:!0,toneMapped:!1});super(h,p),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class RTe extends Hl{constructor(e=10,n=16,r=8,i=64,a=4473924,s=8947848){a=new bt(a),s=new bt(s);const o=[],c=[];if(n>1)for(let p=0;p<n;p++){const v=p/n*(Math.PI*2),y=Math.sin(v)*e,b=Math.cos(v)*e;o.push(0,0,0),o.push(y,0,b);const w=p&1?a:s;c.push(w.r,w.g,w.b),c.push(w.r,w.g,w.b)}for(let p=0;p<r;p++){const v=p&1?a:s,y=e-e/r*p;for(let b=0;b<i;b++){let w=b/i*(Math.PI*2),_=Math.sin(w)*y,S=Math.cos(w)*y;o.push(_,0,S),c.push(v.r,v.g,v.b),w=(b+1)/i*(Math.PI*2),_=Math.sin(w)*y,S=Math.cos(w)*y,o.push(_,0,S),c.push(v.r,v.g,v.b)}}const u=new an;u.setAttribute("position",new Pt(o,3)),u.setAttribute("color",new Pt(c,3));const h=new La({vertexColors:!0,toneMapped:!1});super(u,h),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const oH=new ne,hA=new ne,lH=new ne;class OTe extends zn{constructor(e,n,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="DirectionalLightHelper",n===void 0&&(n=1);let i=new an;i.setAttribute("position",new Pt([-n,n,0,n,n,0,n,-n,0,-n,-n,0,-n,n,0],3));const a=new La({fog:!1,toneMapped:!1});this.lightPlane=new of(i,a),this.add(this.lightPlane),i=new an,i.setAttribute("position",new Pt([0,0,0,0,0,1],3)),this.targetLine=new of(i,a),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),oH.setFromMatrixPosition(this.light.matrixWorld),hA.setFromMatrixPosition(this.light.target.matrixWorld),lH.subVectors(hA,oH),this.lightPlane.lookAt(hA),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(hA),this.targetLine.scale.z=lH.length()}}const pA=new ne,ri=new nT;class PTe extends Hl{constructor(e){const n=new an,r=new La({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],a=[],s={};o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4");function o(b,w){c(b),c(w)}function c(b){i.push(0,0,0),a.push(0,0,0),s[b]===void 0&&(s[b]=[]),s[b].push(i.length/3-1)}n.setAttribute("position",new Pt(i,3)),n.setAttribute("color",new Pt(a,3)),super(n,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const u=new bt(16755200),h=new bt(16711680),p=new bt(43775),v=new bt(16777215),y=new bt(3355443);this.setColors(u,h,p,v,y)}setColors(e,n,r,i,a){const o=this.geometry.getAttribute("color");return o.setXYZ(0,e.r,e.g,e.b),o.setXYZ(1,e.r,e.g,e.b),o.setXYZ(2,e.r,e.g,e.b),o.setXYZ(3,e.r,e.g,e.b),o.setXYZ(4,e.r,e.g,e.b),o.setXYZ(5,e.r,e.g,e.b),o.setXYZ(6,e.r,e.g,e.b),o.setXYZ(7,e.r,e.g,e.b),o.setXYZ(8,e.r,e.g,e.b),o.setXYZ(9,e.r,e.g,e.b),o.setXYZ(10,e.r,e.g,e.b),o.setXYZ(11,e.r,e.g,e.b),o.setXYZ(12,e.r,e.g,e.b),o.setXYZ(13,e.r,e.g,e.b),o.setXYZ(14,e.r,e.g,e.b),o.setXYZ(15,e.r,e.g,e.b),o.setXYZ(16,e.r,e.g,e.b),o.setXYZ(17,e.r,e.g,e.b),o.setXYZ(18,e.r,e.g,e.b),o.setXYZ(19,e.r,e.g,e.b),o.setXYZ(20,e.r,e.g,e.b),o.setXYZ(21,e.r,e.g,e.b),o.setXYZ(22,e.r,e.g,e.b),o.setXYZ(23,e.r,e.g,e.b),o.setXYZ(24,n.r,n.g,n.b),o.setXYZ(25,n.r,n.g,n.b),o.setXYZ(26,n.r,n.g,n.b),o.setXYZ(27,n.r,n.g,n.b),o.setXYZ(28,n.r,n.g,n.b),o.setXYZ(29,n.r,n.g,n.b),o.setXYZ(30,n.r,n.g,n.b),o.setXYZ(31,n.r,n.g,n.b),o.setXYZ(32,r.r,r.g,r.b),o.setXYZ(33,r.r,r.g,r.b),o.setXYZ(34,r.r,r.g,r.b),o.setXYZ(35,r.r,r.g,r.b),o.setXYZ(36,r.r,r.g,r.b),o.setXYZ(37,r.r,r.g,r.b),o.setXYZ(38,i.r,i.g,i.b),o.setXYZ(39,i.r,i.g,i.b),o.setXYZ(40,a.r,a.g,a.b),o.setXYZ(41,a.r,a.g,a.b),o.setXYZ(42,a.r,a.g,a.b),o.setXYZ(43,a.r,a.g,a.b),o.setXYZ(44,a.r,a.g,a.b),o.setXYZ(45,a.r,a.g,a.b),o.setXYZ(46,a.r,a.g,a.b),o.setXYZ(47,a.r,a.g,a.b),o.setXYZ(48,a.r,a.g,a.b),o.setXYZ(49,a.r,a.g,a.b),o.needsUpdate=!0,this}update(){const e=this.geometry,n=this.pointMap,r=1,i=1;let a,s;if(ri.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)a=1,s=0;else if(this.camera.coordinateSystem===Zs)a=-1,s=1;else if(this.camera.coordinateSystem===Nv)a=0,s=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);mi("c",n,e,ri,0,0,a),mi("t",n,e,ri,0,0,s),mi("n1",n,e,ri,-r,-i,a),mi("n2",n,e,ri,r,-i,a),mi("n3",n,e,ri,-r,i,a),mi("n4",n,e,ri,r,i,a),mi("f1",n,e,ri,-r,-i,s),mi("f2",n,e,ri,r,-i,s),mi("f3",n,e,ri,-r,i,s),mi("f4",n,e,ri,r,i,s),mi("u1",n,e,ri,r*.7,i*1.1,a),mi("u2",n,e,ri,-r*.7,i*1.1,a),mi("u3",n,e,ri,0,i*2,a),mi("cf1",n,e,ri,-r,0,s),mi("cf2",n,e,ri,r,0,s),mi("cf3",n,e,ri,0,-i,s),mi("cf4",n,e,ri,0,i,s),mi("cn1",n,e,ri,-r,0,a),mi("cn2",n,e,ri,r,0,a),mi("cn3",n,e,ri,0,-i,a),mi("cn4",n,e,ri,0,i,a),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function mi(t,e,n,r,i,a,s){pA.set(i,a,s).unproject(r);const o=e[t];if(o!==void 0){const c=n.getAttribute("position");for(let u=0,h=o.length;u<h;u++)c.setXYZ(o[u],pA.x,pA.y,pA.z)}}const mA=new Oi;class DTe extends Hl{constructor(e,n=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(24),a=new an;a.setIndex(new qn(r,1)),a.setAttribute("position",new qn(i,3)),super(a,new La({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&mA.setFromObject(this.object),mA.isEmpty())return;const e=mA.min,n=mA.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class NTe extends Hl{constructor(e,n=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],a=new an;a.setIndex(new qn(r,1)),a.setAttribute("position",new Pt(i,3)),super(a,new La({color:n,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const n=this.box;n.isEmpty()||(n.getCenter(this.position),n.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class ITe extends of{constructor(e,n=1,r=16776960){const i=r,a=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],s=new an;s.setAttribute("position",new Pt(a,3)),s.computeBoundingSphere(),super(s,new La({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=n;const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],c=new an;c.setAttribute("position",new Pt(o,3)),c.computeBoundingSphere(),this.add(new vi(c,new Qs({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 cH=new ne;let gA,ED;class BTe extends zn{constructor(e=new ne(0,0,1),n=new ne(0,0,0),r=1,i=16776960,a=r*.2,s=a*.2){super(),this.type="ArrowHelper",gA===void 0&&(gA=new an,gA.setAttribute("position",new Pt([0,0,0,0,1,0],3)),ED=new h1(.5,1,5,1),ED.translate(0,-.5,0)),this.position.copy(n),this.line=new of(gA,new La({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new vi(ED,new Qs({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(r,a,s)}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{cH.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(cH,n)}}setLength(e,n=e*.2,r=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(r,n,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 LTe extends Hl{constructor(e=1){const n=[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 an;i.setAttribute("position",new Pt(n,3)),i.setAttribute("color",new Pt(r,3));const a=new La({vertexColors:!0,toneMapped:!1});super(i,a),this.type="AxesHelper"}setColors(e,n,r){const i=new bt,a=this.geometry.attributes.color.array;return i.set(e),i.toArray(a,0),i.toArray(a,3),i.set(n),i.toArray(a,6),i.toArray(a,9),i.set(r),i.toArray(a,12),i.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class kTe{constructor(){this.type="ShapePath",this.color=new bt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new $M,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,r,i){return this.currentPath.quadraticCurveTo(e,n,r,i),this}bezierCurveTo(e,n,r,i,a,s){return this.currentPath.bezierCurveTo(e,n,r,i,a,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(S){const E=[];for(let T=0,P=S.length;T<P;T++){const R=S[T],D=new _p;D.curves=R.curves,E.push(D)}return E}function r(S,E){const T=E.length;let P=!1;for(let R=T-1,D=0;D<T;R=D++){let I=E[R],k=E[D],B=k.x-I.x,U=k.y-I.y;if(Math.abs(U)>Number.EPSILON){if(U<0&&(I=E[D],B=-B,k=E[R],U=-U),S.y<I.y||S.y>k.y)continue;if(S.y===I.y){if(S.x===I.x)return!0}else{const z=U*(S.x-I.x)-B*(S.y-I.y);if(z===0)return!0;if(z<0)continue;P=!P}}else{if(S.y!==I.y)continue;if(k.x<=S.x&&S.x<=I.x||I.x<=S.x&&S.x<=k.x)return!0}}return P}const i=Bl.isClockWise,a=this.subPaths;if(a.length===0)return[];let s,o,c;const u=[];if(a.length===1)return o=a[0],c=new _p,c.curves=o.curves,u.push(c),u;let h=!i(a[0].getPoints());h=e?!h:h;const p=[],v=[];let y=[],b=0,w;v[b]=void 0,y[b]=[];for(let S=0,E=a.length;S<E;S++)o=a[S],w=o.getPoints(),s=i(w),s=e?!s:s,s?(!h&&v[b]&&b++,v[b]={s:new _p,p:w},v[b].s.curves=o.curves,h&&b++,y[b]=[]):y[b].push({h:o,p:w[0]});if(!v[0])return n(a);if(v.length>1){let S=!1,E=0;for(let T=0,P=v.length;T<P;T++)p[T]=[];for(let T=0,P=v.length;T<P;T++){const R=y[T];for(let D=0;D<R.length;D++){const I=R[D];let k=!0;for(let B=0;B<v.length;B++)r(I.p,v[B].p)&&(T!==B&&E++,k?(k=!1,p[B].push(I)):S=!0);k&&p[T].push(I)}}E>0&&S===!1&&(y=p)}let _;for(let S=0,E=v.length;S<E;S++){c=v[S].s,u.push(c),_=y[S];for(let T=0,P=_.length;T<P;T++)c.holes.push(_[T].h)}return u}}class FTe extends Yc{constructor(e,n=null){super(),this.object=e,this.domElement=n,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){xt("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function UTe(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}function jTe(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}function zTe(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}function fB(t,e,n,r){const i=GTe(r);switch(n){case L5:return t*e;case XE:return t*e/i.components*i.byteLength;case l1:return t*e/i.components*i.byteLength;case Cp:return t*e*2/i.components*i.byteLength;case KE:return t*e*2/i.components*i.byteLength;case k5:return t*e*3/i.components*i.byteLength;case Ba:return t*e*4/i.components*i.byteLength;case YE:return t*e*4/i.components*i.byteLength;case Bx:case Lx:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case kx:case Fx:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case dM:case pM:return Math.max(t,16)*Math.max(e,8)/4;case fM:case hM:return Math.max(t,8)*Math.max(e,8)/2;case mM:case gM:case yM:case xM:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case vM:case bM:case _M:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case SM:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case AM:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case wM:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case MM:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case EM:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case TM:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case CM:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case RM:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case OM:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case PM:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case DM:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case NM:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case IM:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case BM:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case LM:case kM:case FM:return Math.ceil(t/4)*Math.ceil(e/4)*16;case UM:case jM:return Math.ceil(t/4)*Math.ceil(e/4)*8;case zM:case GM:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function GTe(t){switch(t){case ts:case D5:return{byteLength:1,components:1};case Rv:case N5:case qc:return{byteLength:2,components:1};case qE:case $E:return{byteLength:2,components:4};case Ko:case WE:case os:return{byteLength:4,components:1};case I5:case B5:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}class HTe{static contain(e,n){return UTe(e,n)}static cover(e,n){return jTe(e,n)}static fill(e){return zTe(e)}static getByteLength(e,n,r,i){return fB(e,n,r,i)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:s1}}));typeof window<"u"&&(window.__THREE__?xt("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=s1);function ZY(){let t=null,e=!1,n=null,r=null;function i(a,s){n(a,s),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(a){n=a},setContext:function(a){t=a}}}function VTe(t){const e=new WeakMap;function n(o,c){const u=o.array,h=o.usage,p=u.byteLength,v=t.createBuffer();t.bindBuffer(c,v),t.bufferData(c,u,h),o.onUploadCallback();let y;if(u instanceof Float32Array)y=t.FLOAT;else if(typeof Float16Array<"u"&&u instanceof Float16Array)y=t.HALF_FLOAT;else if(u instanceof Uint16Array)o.isFloat16BufferAttribute?y=t.HALF_FLOAT:y=t.UNSIGNED_SHORT;else if(u instanceof Int16Array)y=t.SHORT;else if(u instanceof Uint32Array)y=t.UNSIGNED_INT;else if(u instanceof Int32Array)y=t.INT;else if(u instanceof Int8Array)y=t.BYTE;else if(u instanceof Uint8Array)y=t.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)y=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:v,type:y,bytesPerElement:u.BYTES_PER_ELEMENT,version:o.version,size:p}}function r(o,c,u){const h=c.array,p=c.updateRanges;if(t.bindBuffer(u,o),p.length===0)t.bufferSubData(u,0,h);else{p.sort((y,b)=>y.start-b.start);let v=0;for(let y=1;y<p.length;y++){const b=p[v],w=p[y];w.start<=b.start+b.count+1?b.count=Math.max(b.count,w.start+w.count-b.start):(++v,p[v]=w)}p.length=v+1;for(let y=0,b=p.length;y<b;y++){const w=p[y];t.bufferSubData(u,w.start*h.BYTES_PER_ELEMENT,h,w.start,w.count)}c.clearUpdateRanges()}c.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function a(o){o.isInterleavedBufferAttribute&&(o=o.data);const c=e.get(o);c&&(t.deleteBuffer(c.buffer),e.delete(o))}function s(o,c){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=e.get(o);(!h||h.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const u=e.get(o);if(u===void 0)e.set(o,n(o,c));else if(u.version<o.version){if(u.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");r(u.buffer,o,c),u.version=o.version}}return{get:i,remove:a,update:s}}var WTe=`#ifdef USE_ALPHAHASH
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,qTe=`#ifdef USE_ALPHAHASH
const float ALPHA_HASH_SCALE = 0.05;
float hash2D( vec2 value ) {
return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
}
float hash3D( vec3 value ) {
return hash2D( vec2( hash2D( value.xy ), value.z ) );
}
float getAlphaHashThreshold( vec3 position ) {
float maxDeriv = max(
length( dFdx( position.xyz ) ),
length( dFdy( position.xyz ) )
);
float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
vec2 pixScales = vec2(
exp2( floor( log2( pixScale ) ) ),
exp2( ceil( log2( pixScale ) ) )
);
vec2 alpha = vec2(
hash3D( floor( pixScales.x * position.xyz ) ),
hash3D( floor( pixScales.y * position.xyz ) )
);
float lerpFactor = fract( log2( pixScale ) );
float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
float a = min( lerpFactor, 1.0 - lerpFactor );
vec3 cases = vec3(
x * x / ( 2.0 * a * ( 1.0 - a ) ),
( x - 0.5 * a ) / ( 1.0 - a ),
1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
);
float threshold = ( x < ( 1.0 - a ) )
? ( ( x < a ) ? cases.x : cases.y )
: cases.z;
return clamp( threshold , 1.0e-6, 1.0 );
}
#endif`,$Te=`#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,XTe=`#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,KTe=`#ifdef USE_ALPHATEST
#ifdef ALPHA_TO_COVERAGE
diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
if ( diffuseColor.a == 0.0 ) discard;
#else
if ( diffuseColor.a < alphaTest ) discard;
#endif
#endif`,YTe=`#ifdef USE_ALPHATEST
uniform float alphaTest;
#endif`,JTe=`#ifdef USE_AOMAP
float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
reflectedLight.indirectDiffuse *= ambientOcclusion;
#if defined( USE_CLEARCOAT )
clearcoatSpecularIndirect *= ambientOcclusion;
#endif
#if defined( USE_SHEEN )
sheenSpecularIndirect *= ambientOcclusion;
#endif
#if defined( USE_ENVMAP ) && defined( STANDARD )
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
#endif
#endif`,ZTe=`#ifdef USE_AOMAP
uniform sampler2D aoMap;
uniform float aoMapIntensity;
#endif`,QTe=`#ifdef USE_BATCHING
#if ! defined( GL_ANGLE_multi_draw )
#define gl_DrawID _gl_DrawID
uniform int _gl_DrawID;
#endif
uniform highp sampler2D batchingTexture;
uniform highp usampler2D batchingIdTexture;
mat4 getBatchingMatrix( const in float i ) {
int size = textureSize( batchingTexture, 0 ).x;
int j = int( i ) * 4;
int x = j % size;
int y = j / size;
vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
return mat4( v1, v2, v3, v4 );
}
float getIndirectIndex( const in int i ) {
int size = textureSize( batchingIdTexture, 0 ).x;
int x = i % size;
int y = i / size;
return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
}
#endif
#ifdef USE_BATCHING_COLOR
uniform sampler2D batchingColorTexture;
vec3 getBatchingColor( const in float i ) {
int size = textureSize( batchingColorTexture, 0 ).x;
int j = int( i );
int x = j % size;
int y = j / size;
return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
}
#endif`,eCe=`#ifdef USE_BATCHING
mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
#endif`,tCe=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
vPosition = vec3( position );
#endif`,nCe=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
vec3 objectTangent = vec3( tangent.xyz );
#endif`,rCe=`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 );
} // validated`,iCe=`#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 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`,aCe=`#ifdef USE_BUMPMAP
uniform sampler2D bumpMap;
uniform float bumpScale;
vec2 dHdxy_fwd() {
vec2 dSTdx = dFdx( vBumpMapUv );
vec2 dSTdy = dFdy( vBumpMapUv );
float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
return vec2( dBx, dBy );
}
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
vec3 vSigmaY = normalize( 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`,sCe=`#if NUM_CLIPPING_PLANES > 0
vec4 plane;
#ifdef ALPHA_TO_COVERAGE
float distanceToPlane, distanceGradient;
float clipOpacity = 1.0;
#pragma unroll_loop_start
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
distanceGradient = fwidth( distanceToPlane ) / 2.0;
clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
if ( clipOpacity == 0.0 ) discard;
}
#pragma unroll_loop_end
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
float unionClipOpacity = 1.0;
#pragma unroll_loop_start
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
distanceGradient = fwidth( distanceToPlane ) / 2.0;
unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
}
#pragma unroll_loop_end
clipOpacity *= 1.0 - unionClipOpacity;
#endif
diffuseColor.a *= clipOpacity;
if ( diffuseColor.a == 0.0 ) discard;
#else
#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
#endif`,oCe=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,lCe=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`,cCe=`#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
#endif`,uCe=`#if defined( USE_COLOR_ALPHA )
diffuseColor *= vColor;
#elif defined( USE_COLOR )
diffuseColor.rgb *= vColor;
#endif`,fCe=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR )
varying vec3 vColor;
#endif`,dCe=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
varying vec3 vColor;
#endif`,hCe=`#if defined( USE_COLOR_ALPHA )
vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
vColor.xyz *= instanceColor.xyz;
#endif
#ifdef USE_BATCHING_COLOR
vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
vColor.xyz *= batchingColor.xyz;
#endif`,pCe=`#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;
};
#ifdef USE_ALPHAHASH
varying vec3 vPosition;
#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 );
}
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 );
}
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 );
} // validated`,mCe=`#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 );
highp 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_m0 - 2.0
#define cubeUV_r1 0.8
#define cubeUV_m1 - 1.0
#define cubeUV_r4 0.4
#define cubeUV_m4 2.0
#define cubeUV_r5 0.305
#define cubeUV_m5 3.0
#define cubeUV_r6 0.21
#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`,gCe=`vec3 transformedNormal = objectNormal;
#ifdef USE_TANGENT
vec3 transformedTangent = objectTangent;
#endif
#ifdef USE_BATCHING
mat3 bm = mat3( batchingMatrix );
transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
transformedNormal = bm * transformedNormal;
#ifdef USE_TANGENT
transformedTangent = bm * transformedTangent;
#endif
#endif
#ifdef USE_INSTANCING
mat3 im = mat3( instanceMatrix );
transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
transformedNormal = im * transformedNormal;
#ifdef USE_TANGENT
transformedTangent = im * transformedTangent;
#endif
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
#ifdef FLIP_SIDED
transformedTangent = - transformedTangent;
#endif
#endif`,vCe=`#ifdef USE_DISPLACEMENTMAP
uniform sampler2D displacementMap;
uniform float displacementScale;
uniform float displacementBias;
#endif`,yCe=`#ifdef USE_DISPLACEMENTMAP
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,xCe=`#ifdef USE_EMISSIVEMAP
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
emissiveColor = sRGBTransferEOTF( emissiveColor );
#endif
totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,bCe=`#ifdef USE_EMISSIVEMAP
uniform sampler2D emissiveMap;
#endif`,_Ce="gl_FragColor = linearToOutputTexel( gl_FragColor );",SCe=`vec4 LinearTransferOETF( in vec4 value ) {
return value;
}
vec4 sRGBTransferEOTF( in vec4 value ) {
return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
}
vec4 sRGBTransferOETF( 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 );
}`,ACe=`#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, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
#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`,wCe=`#ifdef USE_ENVMAP
uniform float envMapIntensity;
uniform float flipEnvMap;
uniform mat3 envMapRotation;
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
#endif`,MCe=`#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`,ECe=`#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`,TCe=`#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`,CCe=`#ifdef USE_FOG
vFogDepth = - mvPosition.z;
#endif`,RCe=`#ifdef USE_FOG
varying float vFogDepth;
#endif`,OCe=`#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`,PCe=`#ifdef USE_FOG
uniform vec3 fogColor;
varying float vFogDepth;
#ifdef FOG_EXP2
uniform float fogDensity;
#else
uniform float fogNear;
uniform float fogFar;
#endif
#endif`,DCe=`#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
}`,NCe=`#ifdef USE_LIGHTMAP
uniform sampler2D lightMap;
uniform float lightMapIntensity;
#endif`,ICe=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,BCe=`varying vec3 vViewPosition;
struct LambertMaterial {
vec3 diffuseColor;
float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_Lambert
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,LCe=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
#if defined( USE_LIGHT_PROBES )
uniform vec3 lightProbe[ 9 ];
#endif
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 ) {
float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
if ( cutoffDistance > 0.0 ) {
distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
}
return distanceFalloff;
}
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, 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 vec3 geometryPosition, out IncidentLight light ) {
vec3 lVector = pointLight.position - geometryPosition;
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 vec3 geometryPosition, out IncidentLight light ) {
vec3 lVector = spotLight.position - geometryPosition;
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`,kCe=`#ifdef USE_ENVMAP
vec3 getIBLIrradiance( const in vec3 normal ) {
#ifdef ENVMAP_TYPE_CUBE_UV
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * 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 ) {
#ifdef ENVMAP_TYPE_CUBE_UV
vec3 reflectVec = reflect( - viewDir, normal );
reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
return envMapColor.rgb * envMapIntensity;
#else
return vec3( 0.0 );
#endif
}
#ifdef USE_ANISOTROPY
vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
#ifdef ENVMAP_TYPE_CUBE_UV
vec3 bentNormal = cross( bitangent, viewDir );
bentNormal = normalize( cross( bentNormal, bitangent ) );
bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
return getIBLRadiance( viewDir, bentNormal, roughness );
#else
return vec3( 0.0 );
#endif
}
#endif
#endif`,FCe=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,UCe=`varying vec3 vViewPosition;
struct ToonMaterial {
vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_Toon
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,jCe=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,zCe=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
vec3 diffuseColor;
vec3 specularColor;
float specularShininess;
float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_BlinnPhong
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,GCe=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
material.metalness = metalnessFactor;
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
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 USE_SPECULAR
float specularIntensityFactor = specularIntensity;
vec3 specularColorFactor = specularColor;
#ifdef USE_SPECULAR_COLORMAP
specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
#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 = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;
material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
#else
material.specularColor = vec3( 0.04 );
material.specularColorBlended = mix( material.specularColor, 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, vClearcoatMapUv ).x;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).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_DISPERSION
material.dispersion = dispersion;
#endif
#ifdef USE_IRIDESCENCE
material.iridescence = iridescence;
material.iridescenceIOR = iridescenceIOR;
#ifdef USE_IRIDESCENCEMAP
material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
#else
material.iridescenceThickness = iridescenceThicknessMaximum;
#endif
#endif
#ifdef USE_SHEEN
material.sheenColor = sheenColor;
#ifdef USE_SHEEN_COLORMAP
material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
#endif
material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );
#ifdef USE_SHEEN_ROUGHNESSMAP
material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
#endif
#endif
#ifdef USE_ANISOTROPY
#ifdef USE_ANISOTROPYMAP
mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
#else
vec2 anisotropyV = anisotropyVector;
#endif
material.anisotropy = length( anisotropyV );
if( material.anisotropy == 0.0 ) {
anisotropyV = vec2( 1.0, 0.0 );
} else {
anisotropyV /= material.anisotropy;
material.anisotropy = saturate( material.anisotropy );
}
material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
#endif`,HCe=`uniform sampler2D dfgLUT;
struct PhysicalMaterial {
vec3 diffuseColor;
vec3 diffuseContribution;
vec3 specularColor;
vec3 specularColorBlended;
float roughness;
float metalness;
float specularF90;
float dispersion;
#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;
vec3 iridescenceFresnelDielectric;
vec3 iridescenceFresnelMetallic;
#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
#ifdef USE_ANISOTROPY
float anisotropy;
float alphaT;
vec3 anisotropyT;
vec3 anisotropyB;
#endif
};
vec3 clearcoatSpecularDirect = vec3( 0.0 );
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
vec3 sheenSpecularDirect = vec3( 0.0 );
vec3 sheenSpecularIndirect = vec3(0.0 );
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 );
}
#ifdef USE_ANISOTROPY
float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
float v = 0.5 / ( gv + gl );
return v;
}
float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
float a2 = alphaT * alphaB;
highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
highp float v2 = dot( v, v );
float w2 = a2 / v2;
return RECIPROCAL_PI * a2 * pow2 ( w2 );
}
#endif
#ifdef USE_CLEARCOAT
vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
vec3 f0 = material.clearcoatF0;
float f90 = material.clearcoatF90;
float roughness = material.clearcoatRoughness;
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 );
}
#endif
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
vec3 f0 = material.specularColorBlended;
float f90 = material.specularF90;
float roughness = material.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 );
#ifdef USE_IRIDESCENCE
F = mix( F, material.iridescenceFresnel, material.iridescence );
#endif
#ifdef USE_ANISOTROPY
float dotTL = dot( material.anisotropyT, lightDir );
float dotTV = dot( material.anisotropyT, viewDir );
float dotTH = dot( material.anisotropyT, halfDir );
float dotBL = dot( material.anisotropyB, lightDir );
float dotBV = dot( material.anisotropyB, viewDir );
float dotBH = dot( material.anisotropyB, halfDir );
float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
#else
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
float D = D_GGX( alpha, dotNH );
#endif
return F * ( V * D );
}
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 * transpose( 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 );
}
#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
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 rInv = 1.0 / ( roughness + 0.1 );
float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;
float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;
float DG = exp( a * dotNV + b );
return saturate( DG );
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
float dotNV = saturate( dot( normal, viewDir ) );
vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
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
float dotNV = saturate( dot( normal, viewDir ) );
vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
#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;
}
vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;
vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;
vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;
vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;
float Ess_V = dfgV.x + dfgV.y;
float Ess_L = dfgL.x + dfgL.y;
float Ems_V = 1.0 - Ess_V;
float Ems_L = 1.0 - Ess_L;
vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;
vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );
float compensationFactor = Ems_V * Ems_L;
vec3 multiScatter = Fms * compensationFactor;
return singleScatter + multiScatter;
}
#if NUM_RECT_AREA_LIGHTS > 0
void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
vec3 normal = geometryNormal;
vec3 viewDir = geometryViewDir;
vec3 position = geometryPosition;
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.specularColorBlended * t2.x + ( vec3( 1.0 ) - material.specularColorBlended ) * t2.y );
reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
#ifdef USE_CLEARCOAT
float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
vec3 ccIrradiance = dotNLcc * directLight.color;
clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
#endif
#ifdef USE_SHEEN
sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );
float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );
irradiance *= sheenEnergyComp;
#endif
reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );
#ifdef USE_SHEEN
float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
diffuse *= sheenEnergyComp;
#endif
reflectedLight.indirectDiffuse += diffuse;
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
#ifdef USE_CLEARCOAT
clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
#endif
#ifdef USE_SHEEN
sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;
#endif
vec3 singleScatteringDielectric = vec3( 0.0 );
vec3 multiScatteringDielectric = vec3( 0.0 );
vec3 singleScatteringMetallic = vec3( 0.0 );
vec3 multiScatteringMetallic = vec3( 0.0 );
#ifdef USE_IRIDESCENCE
computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
#else
computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
#endif
vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );
vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );
vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;
vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
vec3 indirectSpecular = radiance * singleScattering;
indirectSpecular += multiScattering * cosineWeightedIrradiance;
vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;
#ifdef USE_SHEEN
float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
indirectSpecular *= sheenEnergyComp;
indirectDiffuse *= sheenEnergyComp;
#endif
reflectedLight.indirectSpecular += indirectSpecular;
reflectedLight.indirectDiffuse += indirectDiffuse;
}
#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 );
}`,VCe=`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
vec3 geometryClearcoatNormal = vec3( 0.0 );
#ifdef USE_CLEARCOAT
geometryClearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
float dotNVi = saturate( dot( normal, geometryViewDir ) );
if ( material.iridescenceThickness == 0.0 ) {
material.iridescence = 0.0;
} else {
material.iridescence = saturate( material.iridescence );
}
if ( material.iridescence > 0.0 ) {
material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );
material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );
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, geometryPosition, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
pointLightShadow = pointLightShadows[ i ];
directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
#endif
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, 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 *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
directionalLightShadow = directionalLightShadows[ i ];
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
vec3 iblIrradiance = vec3( 0.0 );
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
#if defined( USE_LIGHT_PROBES )
irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
#endif
#if ( NUM_HEMI_LIGHTS > 0 )
#pragma unroll_loop_start
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
}
#pragma unroll_loop_end
#endif
#endif
#if defined( RE_IndirectSpecular )
vec3 radiance = vec3( 0.0 );
vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,WCe=`#if defined( RE_IndirectDiffuse )
#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
irradiance += lightMapIrradiance;
#endif
#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
iblIrradiance += getIBLIrradiance( geometryNormal );
#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
#ifdef USE_ANISOTROPY
radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
#else
radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
#endif
#ifdef USE_CLEARCOAT
clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
#endif
#endif`,qCe=`#if defined( RE_IndirectDiffuse )
RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif`,$Ce=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,XCe=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
uniform float logDepthBufFC;
varying float vFragDepth;
varying float vIsPerspective;
#endif`,KCe=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
varying float vFragDepth;
varying float vIsPerspective;
#endif`,YCe=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
vFragDepth = 1.0 + gl_Position.w;
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#endif`,JCe=`#ifdef USE_MAP
vec4 sampledDiffuseColor = texture2D( map, vMapUv );
#ifdef DECODE_VIDEO_TEXTURE
sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
#endif
diffuseColor *= sampledDiffuseColor;
#endif`,ZCe=`#ifdef USE_MAP
uniform sampler2D map;
#endif`,QCe=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
#if defined( USE_POINTS_UV )
vec2 uv = vUv;
#else
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
#endif
#endif
#ifdef USE_MAP
diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,eRe=`#if defined( USE_POINTS_UV )
varying vec2 vUv;
#else
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
uniform mat3 uvTransform;
#endif
#endif
#ifdef USE_MAP
uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,tRe=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
metalnessFactor *= texelMetalness.b;
#endif`,nRe=`#ifdef USE_METALNESSMAP
uniform sampler2D metalnessMap;
#endif`,rRe=`#ifdef USE_INSTANCING_MORPH
float morphTargetInfluences[ MORPHTARGETS_COUNT ];
float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
}
#endif`,iRe=`#if defined( USE_MORPHCOLORS )
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`,aRe=`#ifdef USE_MORPHNORMALS
objectNormal *= morphTargetBaseInfluence;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
}
#endif`,sRe=`#ifdef USE_MORPHTARGETS
#ifndef USE_INSTANCING_MORPH
uniform float morphTargetBaseInfluence;
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
#endif
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 );
}
#endif`,oRe=`#ifdef USE_MORPHTARGETS
transformed *= morphTargetBaseInfluence;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
}
#endif`,lRe=`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 *= faceDirection;
#endif
#endif
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
#ifdef USE_TANGENT
mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
#else
mat3 tbn = getTangentFrame( - vViewPosition, normal,
#if defined( USE_NORMALMAP )
vNormalMapUv
#elif defined( USE_CLEARCOAT_NORMALMAP )
vClearcoatNormalMapUv
#else
vUv
#endif
);
#endif
#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
tbn[0] *= faceDirection;
tbn[1] *= faceDirection;
#endif
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
#ifdef USE_TANGENT
mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
#else
mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
#endif
#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
tbn2[0] *= faceDirection;
tbn2[1] *= faceDirection;
#endif
#endif
vec3 nonPerturbedNormal = normal;`,cRe=`#ifdef USE_NORMALMAP_OBJECTSPACE
normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
#ifdef FLIP_SIDED
normal = - normal;
#endif
#ifdef DOUBLE_SIDED
normal = normal * faceDirection;
#endif
normal = normalize( normalMatrix * normal );
#elif defined( USE_NORMALMAP_TANGENTSPACE )
vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
mapN.xy *= normalScale;
normal = normalize( tbn * mapN );
#elif defined( USE_BUMPMAP )
normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,uRe=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,fRe=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,dRe=`#ifndef FLAT_SHADED
vNormal = normalize( transformedNormal );
#ifdef USE_TANGENT
vTangent = normalize( transformedTangent );
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
#endif
#endif`,hRe=`#ifdef USE_NORMALMAP
uniform sampler2D normalMap;
uniform vec2 normalScale;
#endif
#ifdef USE_NORMALMAP_OBJECTSPACE
uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
vec3 q0 = dFdx( eye_pos.xyz );
vec3 q1 = dFdy( eye_pos.xyz );
vec2 st0 = dFdx( uv.st );
vec2 st1 = dFdy( uv.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 : inversesqrt( det );
return mat3( T * scale, B * scale, N );
}
#endif`,pRe=`#ifdef USE_CLEARCOAT
vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,mRe=`#ifdef USE_CLEARCOAT_NORMALMAP
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
clearcoatMapN.xy *= clearcoatNormalScale;
clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,gRe=`#ifdef USE_CLEARCOATMAP
uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
uniform sampler2D clearcoatNormalMap;
uniform vec2 clearcoatNormalScale;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
uniform sampler2D clearcoatRoughnessMap;
#endif`,vRe=`#ifdef USE_IRIDESCENCEMAP
uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
uniform sampler2D iridescenceThicknessMap;
#endif`,yRe=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,xRe=`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 float ShiftRight8 = 1. / 256.;
const float Inv255 = 1. / 255.;
const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
vec4 packDepthToRGBA( const in float v ) {
if( v <= 0.0 )
return vec4( 0., 0., 0., 0. );
if( v >= 1.0 )
return vec4( 1., 1., 1., 1. );
float vuf;
float af = modf( v * PackFactors.a, vuf );
float bf = modf( vuf * ShiftRight8, vuf );
float gf = modf( vuf * ShiftRight8, vuf );
return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
}
vec3 packDepthToRGB( const in float v ) {
if( v <= 0.0 )
return vec3( 0., 0., 0. );
if( v >= 1.0 )
return vec3( 1., 1., 1. );
float vuf;
float bf = modf( v * PackFactors.b, vuf );
float gf = modf( vuf * ShiftRight8, vuf );
return vec3( vuf * Inv255, gf * PackUpscale, bf );
}
vec2 packDepthToRG( const in float v ) {
if( v <= 0.0 )
return vec2( 0., 0. );
if( v >= 1.0 )
return vec2( 1., 1. );
float vuf;
float gf = modf( v * 256., vuf );
return vec2( vuf * Inv255, gf );
}
float unpackRGBAToDepth( const in vec4 v ) {
return dot( v, UnpackFactors4 );
}
float unpackRGBToDepth( const in vec3 v ) {
return dot( v, UnpackFactors3 );
}
float unpackRGToDepth( const in vec2 v ) {
return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
}
vec4 pack2HalfToRGBA( const in 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( const in 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 depth, const in float near, const in float far ) {
return depth * ( 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 depth, const in float near, const in float far ) {
return ( near * far ) / ( ( far - near ) * depth - far );
}`,bRe=`#ifdef PREMULTIPLIED_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif`,_Re=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
mvPosition = batchingMatrix * mvPosition;
#endif
#ifdef USE_INSTANCING
mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,SRe=`#ifdef DITHERING
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,ARe=`#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`,wRe=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
roughnessFactor *= texelRoughness.g;
#endif`,MRe=`#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
#endif`,ERe=`#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
#if defined( SHADOWMAP_TYPE_PCF )
uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
#else
uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
#endif
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
struct DirectionalLightShadow {
float shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
#if defined( SHADOWMAP_TYPE_PCF )
uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
#else
uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
struct SpotLightShadow {
float shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
#if defined( SHADOWMAP_TYPE_PCF )
uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
#elif defined( SHADOWMAP_TYPE_BASIC )
uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
#endif
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
struct PointLightShadow {
float shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
#if defined( SHADOWMAP_TYPE_PCF )
float interleavedGradientNoise( vec2 position ) {
return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );
}
vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {
const float goldenAngle = 2.399963229728653;
float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
float theta = float( sampleIndex ) * goldenAngle + phi;
return vec2( cos( theta ), sin( theta ) ) * r;
}
#endif
#if defined( SHADOWMAP_TYPE_PCF )
float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
float shadow = 1.0;
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z += shadowBias;
bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
if ( frustumTest ) {
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
float radius = shadowRadius * texelSize.x;
float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718;
shadow = (
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )
) * 0.2;
}
return mix( 1.0, shadow, shadowIntensity );
}
#elif defined( SHADOWMAP_TYPE_VSM )
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
float shadow = 1.0;
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z += shadowBias;
bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
if ( frustumTest ) {
vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;
float mean = distribution.x;
float variance = distribution.y * distribution.y;
#ifdef USE_REVERSED_DEPTH_BUFFER
float hard_shadow = step( mean, shadowCoord.z );
#else
float hard_shadow = step( shadowCoord.z, mean );
#endif
if ( hard_shadow == 1.0 ) {
shadow = 1.0;
} else {
variance = max( variance, 0.0000001 );
float d = shadowCoord.z - mean;
float p_max = variance / ( variance + d * d );
p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );
shadow = max( hard_shadow, p_max );
}
}
return mix( 1.0, shadow, shadowIntensity );
}
#else
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
float shadow = 1.0;
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z += shadowBias;
bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
if ( frustumTest ) {
float depth = texture2D( shadowMap, shadowCoord.xy ).r;
#ifdef USE_REVERSED_DEPTH_BUFFER
shadow = step( depth, shadowCoord.z );
#else
shadow = step( shadowCoord.z, depth );
#endif
}
return mix( 1.0, shadow, shadowIntensity );
}
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
#if defined( SHADOWMAP_TYPE_PCF )
float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
float shadow = 1.0;
vec3 lightToPosition = shadowCoord.xyz;
vec3 bd3D = normalize( lightToPosition );
vec3 absVec = abs( lightToPosition );
float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
dp += shadowBias;
float texelSize = shadowRadius / shadowMapSize.x;
vec3 absDir = abs( bd3D );
vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );
tangent = normalize( cross( bd3D, tangent ) );
vec3 bitangent = cross( bd3D, tangent );
float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718;
shadow = (
texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 0, 5, phi ).x + bitangent * vogelDiskSample( 0, 5, phi ).y ) * texelSize, dp ) ) +
texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 1, 5, phi ).x + bitangent * vogelDiskSample( 1, 5, phi ).y ) * texelSize, dp ) ) +
texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 2, 5, phi ).x + bitangent * vogelDiskSample( 2, 5, phi ).y ) * texelSize, dp ) ) +
texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 3, 5, phi ).x + bitangent * vogelDiskSample( 3, 5, phi ).y ) * texelSize, dp ) ) +
texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 4, 5, phi ).x + bitangent * vogelDiskSample( 4, 5, phi ).y ) * texelSize, dp ) )
) * 0.2;
}
return mix( 1.0, shadow, shadowIntensity );
}
#elif defined( SHADOWMAP_TYPE_BASIC )
float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
float shadow = 1.0;
vec3 lightToPosition = shadowCoord.xyz;
vec3 bd3D = normalize( lightToPosition );
vec3 absVec = abs( lightToPosition );
float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
dp += shadowBias;
float depth = textureCube( shadowMap, bd3D ).r;
#ifdef USE_REVERSED_DEPTH_BUFFER
shadow = step( depth, dp );
#else
shadow = step( dp, depth );
#endif
}
return mix( 1.0, shadow, shadowIntensity );
}
#endif
#endif
#endif`,TRe=`#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 shadowIntensity;
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 shadowIntensity;
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 shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
#endif`,CRe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
vec4 shadowWorldPosition;
#endif
#if defined( USE_SHADOWMAP )
#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_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
#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`,RRe=`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.shadowIntensity, 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.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
}
#pragma unroll_loop_end
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
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.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
}
#pragma unroll_loop_end
#endif
#endif
return shadow;
}`,ORe=`#ifdef USE_SKINNING
mat4 boneMatX = getBoneMatrix( skinIndex.x );
mat4 boneMatY = getBoneMatrix( skinIndex.y );
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,PRe=`#ifdef USE_SKINNING
uniform mat4 bindMatrix;
uniform mat4 bindMatrixInverse;
uniform highp sampler2D boneTexture;
mat4 getBoneMatrix( const in float i ) {
int size = textureSize( boneTexture, 0 ).x;
int j = int( i ) * 4;
int x = j % size;
int y = j / size;
vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
return mat4( v1, v2, v3, v4 );
}
#endif`,DRe=`#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`,NRe=`#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`,IRe=`float specularStrength;
#ifdef USE_SPECULARMAP
vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
specularStrength = texelSpecular.r;
#else
specularStrength = 1.0;
#endif`,BRe=`#ifdef USE_SPECULARMAP
uniform sampler2D specularMap;
#endif`,LRe=`#if defined( TONE_MAPPING )
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,kRe=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
return saturate( toneMappingExposure * color );
}
vec3 ReinhardToneMapping( vec3 color ) {
color *= toneMappingExposure;
return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 CineonToneMapping( 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 );
}
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
vec3( 1.6605, - 0.1246, - 0.0182 ),
vec3( - 0.5876, 1.1329, - 0.1006 ),
vec3( - 0.0728, - 0.0083, 1.1187 )
);
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
vec3( 0.6274, 0.0691, 0.0164 ),
vec3( 0.3293, 0.9195, 0.0880 ),
vec3( 0.0433, 0.0113, 0.8956 )
);
vec3 agxDefaultContrastApprox( vec3 x ) {
vec3 x2 = x * x;
vec3 x4 = x2 * x2;
return + 15.5 * x4 * x2
- 40.14 * x4 * x
+ 31.96 * x4
- 6.868 * x2 * x
+ 0.4298 * x2
+ 0.1191 * x
- 0.00232;
}
vec3 AgXToneMapping( vec3 color ) {
const mat3 AgXInsetMatrix = mat3(
vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
);
const mat3 AgXOutsetMatrix = mat3(
vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
);
const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;
color *= toneMappingExposure;
color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
color = AgXInsetMatrix * color;
color = max( color, 1e-10 ); color = log2( color );
color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
color = clamp( color, 0.0, 1.0 );
color = agxDefaultContrastApprox( color );
color = AgXOutsetMatrix * color;
color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
color = clamp( color, 0.0, 1.0 );
return color;
}
vec3 NeutralToneMapping( vec3 color ) {
const float StartCompression = 0.8 - 0.04;
const float Desaturation = 0.15;
color *= toneMappingExposure;
float x = min( color.r, min( color.g, color.b ) );
float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
color -= offset;
float peak = max( color.r, max( color.g, color.b ) );
if ( peak < StartCompression ) return color;
float d = 1. - StartCompression;
float newPeak = 1. - d * d / ( peak + d - StartCompression );
color *= newPeak / peak;
float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
return mix( color, vec3( newPeak ), g );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,FRe=`#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, vTransmissionMapUv ).r;
#endif
#ifdef USE_THICKNESSMAP
material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
#endif
vec3 pos = vWorldPosition;
vec3 v = normalize( cameraPosition - pos );
vec3 n = inverseTransformDirection( normal, viewMatrix );
vec4 transmitted = getIBLVolumeRefraction(
n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,
pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
material.attenuationColor, material.attenuationDistance );
material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,URe=`#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;
float w0( float a ) {
return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
}
float w1( float a ) {
return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );
}
float w2( float a ){
return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
}
float w3( float a ) {
return ( 1.0 / 6.0 ) * ( a * a * a );
}
float g0( float a ) {
return w0( a ) + w1( a );
}
float g1( float a ) {
return w2( a ) + w3( a );
}
float h0( float a ) {
return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
}
float h1( float a ) {
return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
}
vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
uv = uv * texelSize.zw + 0.5;
vec2 iuv = floor( uv );
vec2 fuv = fract( uv );
float g0x = g0( fuv.x );
float g1x = g1( fuv.x );
float h0x = h0( fuv.x );
float h1x = h1( fuv.x );
float h0y = h0( fuv.y );
float h1y = h1( fuv.y );
vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
}
vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
vec2 fLodSizeInv = 1.0 / fLodSize;
vec2 cLodSizeInv = 1.0 / cLodSize;
vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
return mix( fSample, cSample, fract( lod ) );
}
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 lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
}
vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
if ( isinf( attenuationDistance ) ) {
return vec3( 1.0 );
} else {
vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;
}
}
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 dispersion, const in float ior, const in float thickness,
const in vec3 attenuationColor, const in float attenuationDistance ) {
vec4 transmittedLight;
vec3 transmittance;
#ifdef USE_DISPERSION
float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
for ( int i = 0; i < 3; i ++ ) {
vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], 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 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
transmittedLight[ i ] = transmissionSample[ i ];
transmittedLight.a += transmissionSample.a;
transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
}
transmittedLight.a /= 3.0;
#else
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;
transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
#endif
vec3 attenuatedColor = transmittance * transmittedLight.rgb;
vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
}
#endif`,jRe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
varying vec2 vUv;
#endif
#ifdef USE_MAP
varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
varying vec2 vNormalMapUv;
#endif
#ifdef USE_EMISSIVEMAP
varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_SPECULARMAP
varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
uniform mat3 transmissionMapTransform;
varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
uniform mat3 thicknessMapTransform;
varying vec2 vThicknessMapUv;
#endif`,zRe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
varying vec2 vUv;
#endif
#ifdef USE_MAP
uniform mat3 mapTransform;
varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
uniform mat3 alphaMapTransform;
varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
uniform mat3 lightMapTransform;
varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
uniform mat3 aoMapTransform;
varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
uniform mat3 bumpMapTransform;
varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
uniform mat3 normalMapTransform;
varying vec2 vNormalMapUv;
#endif
#ifdef USE_DISPLACEMENTMAP
uniform mat3 displacementMapTransform;
varying vec2 vDisplacementMapUv;
#endif
#ifdef USE_EMISSIVEMAP
uniform mat3 emissiveMapTransform;
varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
uniform mat3 metalnessMapTransform;
varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
uniform mat3 roughnessMapTransform;
varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
uniform mat3 anisotropyMapTransform;
varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
uniform mat3 clearcoatMapTransform;
varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
uniform mat3 clearcoatNormalMapTransform;
varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
uniform mat3 clearcoatRoughnessMapTransform;
varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
uniform mat3 sheenColorMapTransform;
varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
uniform mat3 sheenRoughnessMapTransform;
varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
uniform mat3 iridescenceMapTransform;
varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
uniform mat3 iridescenceThicknessMapTransform;
varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SPECULARMAP
uniform mat3 specularMapTransform;
varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
uniform mat3 specularColorMapTransform;
varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
uniform mat3 specularIntensityMapTransform;
varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
uniform mat3 transmissionMapTransform;
varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
uniform mat3 thicknessMapTransform;
varying vec2 vThicknessMapUv;
#endif`,GRe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
vUv = vec3( uv, 1 ).xy;
#endif
#ifdef USE_MAP
vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ALPHAMAP
vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_LIGHTMAP
vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_AOMAP
vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_BUMPMAP
vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_NORMALMAP
vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_DISPLACEMENTMAP
vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_EMISSIVEMAP
vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_METALNESSMAP
vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ROUGHNESSMAP
vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ANISOTROPYMAP
vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOATMAP
vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCEMAP
vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_COLORMAP
vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULARMAP
vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_COLORMAP
vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_TRANSMISSIONMAP
vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_THICKNESSMAP
vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
#endif`,HRe=`#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_BATCHING
worldPosition = batchingMatrix * worldPosition;
#endif
#ifdef USE_INSTANCING
worldPosition = instanceMatrix * worldPosition;
#endif
worldPosition = modelMatrix * worldPosition;
#endif`;const VRe=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,WRe=`uniform sampler2D t2D;
uniform float backgroundIntensity;
varying vec2 vUv;
void main() {
vec4 texColor = texture2D( t2D, vUv );
#ifdef DECODE_VIDEO_TEXTURE
texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
#endif
texColor.rgb *= backgroundIntensity;
gl_FragColor = texColor;
#include <tonemapping_fragment>
#include <colorspace_fragment>
}`,qRe=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,$Re=`#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#elif defined( ENVMAP_TYPE_CUBE_UV )
uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform float backgroundBlurriness;
uniform float backgroundIntensity;
uniform mat3 backgroundRotation;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
#ifdef ENVMAP_TYPE_CUBE
vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
#elif defined( ENVMAP_TYPE_CUBE_UV )
vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
#else
vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
#endif
texColor.rgb *= backgroundIntensity;
gl_FragColor = texColor;
#include <tonemapping_fragment>
#include <colorspace_fragment>
}`,XRe=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,KRe=`uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
gl_FragColor = texColor;
gl_FragColor.a *= opacity;
#include <tonemapping_fragment>
#include <colorspace_fragment>
}`,YRe=`#include <common>
#include <batching_pars_vertex>
#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 <batching_vertex>
#include <skinbase_vertex>
#include <morphinstance_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;
}`,JRe=`#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 <alphahash_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
vec4 diffuseColor = vec4( 1.0 );
#include <clipping_planes_fragment>
#if DEPTH_PACKING == 3200
diffuseColor.a = opacity;
#endif
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <logdepthbuf_fragment>
#ifdef USE_REVERSED_DEPTH_BUFFER
float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
#else
float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
#endif
#if DEPTH_PACKING == 3200
gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
#elif DEPTH_PACKING == 3201
gl_FragColor = packDepthToRGBA( fragCoordZ );
#elif DEPTH_PACKING == 3202
gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
#elif DEPTH_PACKING == 3203
gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
#endif
}`,ZRe=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <batching_pars_vertex>
#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 <batching_vertex>
#include <skinbase_vertex>
#include <morphinstance_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;
}`,QRe=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
vec4 diffuseColor = vec4( 1.0 );
#include <clipping_planes_fragment>
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
float dist = length( vWorldPosition - referencePosition );
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
dist = saturate( dist );
gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
}`,eOe=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}`,tOe=`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 <colorspace_fragment>
}`,nOe=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <uv_pars_vertex>
#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 <uv_vertex>
#include <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,rOe=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
if ( mod( vLineDistance, totalSize ) > dashSize ) {
discard;
}
vec3 outgoingLight = vec3( 0.0 );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
outgoingLight = diffuseColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,iOe=`#include <common>
#include <batching_pars_vertex>
#include <uv_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 <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_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>
}`,aOe=`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 <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_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() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_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, vLightMapUv );
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 <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,sOe=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_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 <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_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>
}`,oOe=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#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 <alphahash_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() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
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 <alphahash_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 <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,lOe=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#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 <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_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;
}`,cOe=`#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 <alphahash_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() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_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 <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,uOe=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
varying vec3 vViewPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#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 <batching_vertex>
#include <beginnormal_vertex>
#include <morphinstance_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( USE_NORMALMAP_TANGENTSPACE )
vViewPosition = - mvPosition.xyz;
#endif
}`,fOe=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
varying vec3 vViewPosition;
#endif
#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() {
vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );
#ifdef OPAQUE
gl_FragColor.a = 1.0;
#endif
}`,dOe=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_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 <color_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphinstance_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>
}`,hOe=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#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 <alphahash_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() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
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 <alphahash_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 <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,pOe=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
varying vec3 vWorldPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_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 <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_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
}`,mOe=`#define STANDARD
#ifdef PHYSICAL
#define IOR
#define USE_SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
uniform float ior;
#endif
#ifdef USE_SPECULAR
uniform float specularIntensity;
uniform vec3 specularColor;
#ifdef USE_SPECULAR_COLORMAP
uniform sampler2D specularColorMap;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
uniform sampler2D specularIntensityMap;
#endif
#endif
#ifdef USE_CLEARCOAT
uniform float clearcoat;
uniform float clearcoatRoughness;
#endif
#ifdef USE_DISPERSION
uniform float dispersion;
#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_SHEEN_COLORMAP
uniform sampler2D sheenColorMap;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
uniform sampler2D sheenRoughnessMap;
#endif
#endif
#ifdef USE_ANISOTROPY
uniform vec2 anisotropyVector;
#ifdef USE_ANISOTROPYMAP
uniform sampler2D anisotropyMap;
#endif
#endif
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 <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#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() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
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 <alphahash_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
outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;
#endif
#ifdef USE_CLEARCOAT
float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
#endif
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,gOe=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_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 <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_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>
}`,vOe=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#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 <alphahash_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() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
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 <alphahash_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 <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,yOe=`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>
#ifdef USE_POINTS_UV
varying vec2 vUv;
uniform mat3 uvTransform;
#endif
void main() {
#ifdef USE_POINTS_UV
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
#endif
#include <color_vertex>
#include <morphinstance_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>
}`,xOe=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
#include <logdepthbuf_fragment>
#include <map_particle_fragment>
#include <color_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
outgoingLight = diffuseColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,bOe=`#include <common>
#include <batching_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphinstance_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 <logdepthbuf_vertex>
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,_Oe=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <logdepthbuf_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
#include <logdepthbuf_fragment>
gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
}`,SOe=`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[ 3 ];
vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
#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>
}`,AOe=`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 <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
outgoingLight = diffuseColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
}`,bn={alphahash_fragment:WTe,alphahash_pars_fragment:qTe,alphamap_fragment:$Te,alphamap_pars_fragment:XTe,alphatest_fragment:KTe,alphatest_pars_fragment:YTe,aomap_fragment:JTe,aomap_pars_fragment:ZTe,batching_pars_vertex:QTe,batching_vertex:eCe,begin_vertex:tCe,beginnormal_vertex:nCe,bsdfs:rCe,iridescence_fragment:iCe,bumpmap_pars_fragment:aCe,clipping_planes_fragment:sCe,clipping_planes_pars_fragment:oCe,clipping_planes_pars_vertex:lCe,clipping_planes_vertex:cCe,color_fragment:uCe,color_pars_fragment:fCe,color_pars_vertex:dCe,color_vertex:hCe,common:pCe,cube_uv_reflection_fragment:mCe,defaultnormal_vertex:gCe,displacementmap_pars_vertex:vCe,displacementmap_vertex:yCe,emissivemap_fragment:xCe,emissivemap_pars_fragment:bCe,colorspace_fragment:_Ce,colorspace_pars_fragment:SCe,envmap_fragment:ACe,envmap_common_pars_fragment:wCe,envmap_pars_fragment:MCe,envmap_pars_vertex:ECe,envmap_physical_pars_fragment:kCe,envmap_vertex:TCe,fog_vertex:CCe,fog_pars_vertex:RCe,fog_fragment:OCe,fog_pars_fragment:PCe,gradientmap_pars_fragment:DCe,lightmap_pars_fragment:NCe,lights_lambert_fragment:ICe,lights_lambert_pars_fragment:BCe,lights_pars_begin:LCe,lights_toon_fragment:FCe,lights_toon_pars_fragment:UCe,lights_phong_fragment:jCe,lights_phong_pars_fragment:zCe,lights_physical_fragment:GCe,lights_physical_pars_fragment:HCe,lights_fragment_begin:VCe,lights_fragment_maps:WCe,lights_fragment_end:qCe,logdepthbuf_fragment:$Ce,logdepthbuf_pars_fragment:XCe,logdepthbuf_pars_vertex:KCe,logdepthbuf_vertex:YCe,map_fragment:JCe,map_pars_fragment:ZCe,map_particle_fragment:QCe,map_particle_pars_fragment:eRe,metalnessmap_fragment:tRe,metalnessmap_pars_fragment:nRe,morphinstance_vertex:rRe,morphcolor_vertex:iRe,morphnormal_vertex:aRe,morphtarget_pars_vertex:sRe,morphtarget_vertex:oRe,normal_fragment_begin:lRe,normal_fragment_maps:cRe,normal_pars_fragment:uRe,normal_pars_vertex:fRe,normal_vertex:dRe,normalmap_pars_fragment:hRe,clearcoat_normal_fragment_begin:pRe,clearcoat_normal_fragment_maps:mRe,clearcoat_pars_fragment:gRe,iridescence_pars_fragment:vRe,opaque_fragment:yRe,packing:xRe,premultiplied_alpha_fragment:bRe,project_vertex:_Re,dithering_fragment:SRe,dithering_pars_fragment:ARe,roughnessmap_fragment:wRe,roughnessmap_pars_fragment:MRe,shadowmap_pars_fragment:ERe,shadowmap_pars_vertex:TRe,shadowmap_vertex:CRe,shadowmask_pars_fragment:RRe,skinbase_vertex:ORe,skinning_pars_vertex:PRe,skinning_vertex:DRe,skinnormal_vertex:NRe,specularmap_fragment:IRe,specularmap_pars_fragment:BRe,tonemapping_fragment:LRe,tonemapping_pars_fragment:kRe,transmission_fragment:FRe,transmission_pars_fragment:URe,uv_pars_fragment:jRe,uv_pars_vertex:zRe,uv_vertex:GRe,worldpos_vertex:HRe,background_vert:VRe,background_frag:WRe,backgroundCube_vert:qRe,backgroundCube_frag:$Re,cube_vert:XRe,cube_frag:KRe,depth_vert:YRe,depth_frag:JRe,distance_vert:ZRe,distance_frag:QRe,equirect_vert:eOe,equirect_frag:tOe,linedashed_vert:nOe,linedashed_frag:rOe,meshbasic_vert:iOe,meshbasic_frag:aOe,meshlambert_vert:sOe,meshlambert_frag:oOe,meshmatcap_vert:lOe,meshmatcap_frag:cOe,meshnormal_vert:uOe,meshnormal_frag:fOe,meshphong_vert:dOe,meshphong_frag:hOe,meshphysical_vert:pOe,meshphysical_frag:mOe,meshtoon_vert:gOe,meshtoon_frag:vOe,points_vert:yOe,points_frag:xOe,shadow_vert:bOe,shadow_frag:_Oe,sprite_vert:SOe,sprite_frag:AOe},St={common:{diffuse:{value:new bt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new dn},alphaMap:{value:null},alphaMapTransform:{value:new dn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new dn}},envmap:{envMap:{value:null},envMapRotation:{value:new dn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new dn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new dn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new dn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new dn},normalScale:{value:new Ve(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new dn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new dn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new dn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new dn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new bt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new bt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new dn},alphaTest:{value:0},uvTransform:{value:new dn}},sprite:{diffuse:{value:new bt(16777215)},opacity:{value:1},center:{value:new Ve(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new dn},alphaMap:{value:null},alphaMapTransform:{value:new dn},alphaTest:{value:0}}},Dl={basic:{uniforms:Qa([St.common,St.specularmap,St.envmap,St.aomap,St.lightmap,St.fog]),vertexShader:bn.meshbasic_vert,fragmentShader:bn.meshbasic_frag},lambert:{uniforms:Qa([St.common,St.specularmap,St.envmap,St.aomap,St.lightmap,St.emissivemap,St.bumpmap,St.normalmap,St.displacementmap,St.fog,St.lights,{emissive:{value:new bt(0)}}]),vertexShader:bn.meshlambert_vert,fragmentShader:bn.meshlambert_frag},phong:{uniforms:Qa([St.common,St.specularmap,St.envmap,St.aomap,St.lightmap,St.emissivemap,St.bumpmap,St.normalmap,St.displacementmap,St.fog,St.lights,{emissive:{value:new bt(0)},specular:{value:new bt(1118481)},shininess:{value:30}}]),vertexShader:bn.meshphong_vert,fragmentShader:bn.meshphong_frag},standard:{uniforms:Qa([St.common,St.envmap,St.aomap,St.lightmap,St.emissivemap,St.bumpmap,St.normalmap,St.displacementmap,St.roughnessmap,St.metalnessmap,St.fog,St.lights,{emissive:{value:new bt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:bn.meshphysical_vert,fragmentShader:bn.meshphysical_frag},toon:{uniforms:Qa([St.common,St.aomap,St.lightmap,St.emissivemap,St.bumpmap,St.normalmap,St.displacementmap,St.gradientmap,St.fog,St.lights,{emissive:{value:new bt(0)}}]),vertexShader:bn.meshtoon_vert,fragmentShader:bn.meshtoon_frag},matcap:{uniforms:Qa([St.common,St.bumpmap,St.normalmap,St.displacementmap,St.fog,{matcap:{value:null}}]),vertexShader:bn.meshmatcap_vert,fragmentShader:bn.meshmatcap_frag},points:{uniforms:Qa([St.points,St.fog]),vertexShader:bn.points_vert,fragmentShader:bn.points_frag},dashed:{uniforms:Qa([St.common,St.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:bn.linedashed_vert,fragmentShader:bn.linedashed_frag},depth:{uniforms:Qa([St.common,St.displacementmap]),vertexShader:bn.depth_vert,fragmentShader:bn.depth_frag},normal:{uniforms:Qa([St.common,St.bumpmap,St.normalmap,St.displacementmap,{opacity:{value:1}}]),vertexShader:bn.meshnormal_vert,fragmentShader:bn.meshnormal_frag},sprite:{uniforms:Qa([St.sprite,St.fog]),vertexShader:bn.sprite_vert,fragmentShader:bn.sprite_frag},background:{uniforms:{uvTransform:{value:new dn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:bn.background_vert,fragmentShader:bn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new dn}},vertexShader:bn.backgroundCube_vert,fragmentShader:bn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:bn.cube_vert,fragmentShader:bn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:bn.equirect_vert,fragmentShader:bn.equirect_frag},distance:{uniforms:Qa([St.common,St.displacementmap,{referencePosition:{value:new ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:bn.distance_vert,fragmentShader:bn.distance_frag},shadow:{uniforms:Qa([St.lights,St.fog,{color:{value:new bt(0)},opacity:{value:1}}]),vertexShader:bn.shadow_vert,fragmentShader:bn.shadow_frag}};Dl.physical={uniforms:Qa([Dl.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new dn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new dn},clearcoatNormalScale:{value:new Ve(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new dn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new dn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new dn},sheen:{value:0},sheenColor:{value:new bt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new dn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new dn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new dn},transmissionSamplerSize:{value:new Ve},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new dn},attenuationDistance:{value:0},attenuationColor:{value:new bt(0)},specularColor:{value:new bt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new dn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new dn},anisotropyVector:{value:new Ve},anisotropyMap:{value:null},anisotropyMapTransform:{value:new dn}}]),vertexShader:bn.meshphysical_vert,fragmentShader:bn.meshphysical_frag};const vA={r:0,b:0,g:0},qh=new ro,wOe=new qt;function MOe(t,e,n,r,i,a,s){const o=new bt(0);let c=a===!0?0:1,u,h,p=null,v=0,y=null;function b(T){let P=T.isScene===!0?T.background:null;return P&&P.isTexture&&(P=(T.backgroundBlurriness>0?n:e).get(P)),P}function w(T){let P=!1;const R=b(T);R===null?S(o,c):R&&R.isColor&&(S(R,1),P=!0);const D=t.xr.getEnvironmentBlendMode();D==="additive"?r.buffers.color.setClear(0,0,0,1,s):D==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(t.autoClear||P)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function _(T,P){const R=b(P);R&&(R.isCubeTexture||R.mapping===oy)?(h===void 0&&(h=new vi(new Vp(1,1,1),new Yo({name:"BackgroundCubeMaterial",uniforms:kv(Dl.backgroundCube.uniforms),vertexShader:Dl.backgroundCube.vertexShader,fragmentShader:Dl.backgroundCube.fragmentShader,side:ls,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(D,I,k){this.matrixWorld.copyPosition(k.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),qh.copy(P.backgroundRotation),qh.x*=-1,qh.y*=-1,qh.z*=-1,R.isCubeTexture&&R.isRenderTargetTexture===!1&&(qh.y*=-1,qh.z*=-1),h.material.uniforms.envMap.value=R,h.material.uniforms.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=P.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=P.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(wOe.makeRotationFromEuler(qh)),h.material.toneMapped=Fn.getTransfer(R.colorSpace)!==ir,(p!==R||v!==R.version||y!==t.toneMapping)&&(h.material.needsUpdate=!0,p=R,v=R.version,y=t.toneMapping),h.layers.enableAll(),T.unshift(h,h.geometry,h.material,0,0,null)):R&&R.isTexture&&(u===void 0&&(u=new vi(new cy(2,2),new Yo({name:"BackgroundMaterial",uniforms:kv(Dl.background.uniforms),vertexShader:Dl.background.vertexShader,fragmentShader:Dl.background.fragmentShader,side:Vc,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=R,u.material.uniforms.backgroundIntensity.value=P.backgroundIntensity,u.material.toneMapped=Fn.getTransfer(R.colorSpace)!==ir,R.matrixAutoUpdate===!0&&R.updateMatrix(),u.material.uniforms.uvTransform.value.copy(R.matrix),(p!==R||v!==R.version||y!==t.toneMapping)&&(u.material.needsUpdate=!0,p=R,v=R.version,y=t.toneMapping),u.layers.enableAll(),T.unshift(u,u.geometry,u.material,0,0,null))}function S(T,P){T.getRGB(vA,sY(t)),r.buffers.color.setClear(vA.r,vA.g,vA.b,P,s)}function E(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0)}return{getClearColor:function(){return o},setClearColor:function(T,P=1){o.set(T),c=P,S(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(T){c=T,S(o,c)},render:w,addToRenderList:_,dispose:E}}function EOe(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=v(null);let a=i,s=!1;function o(U,z,q,W,ee){let Q=!1;const V=p(W,q,z);a!==V&&(a=V,u(a.object)),Q=y(U,W,q,ee),Q&&b(U,W,q,ee),ee!==null&&e.update(ee,t.ELEMENT_ARRAY_BUFFER),(Q||s)&&(s=!1,P(U,z,q,W),ee!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(ee).buffer))}function c(){return t.createVertexArray()}function u(U){return t.bindVertexArray(U)}function h(U){return t.deleteVertexArray(U)}function p(U,z,q){const W=q.wireframe===!0;let ee=r[U.id];ee===void 0&&(ee={},r[U.id]=ee);let Q=ee[z.id];Q===void 0&&(Q={},ee[z.id]=Q);let V=Q[W];return V===void 0&&(V=v(c()),Q[W]=V),V}function v(U){const z=[],q=[],W=[];for(let ee=0;ee<n;ee++)z[ee]=0,q[ee]=0,W[ee]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:z,enabledAttributes:q,attributeDivisors:W,object:U,attributes:{},index:null}}function y(U,z,q,W){const ee=a.attributes,Q=z.attributes;let V=0;const $=q.getAttributes();for(const Y in $)if($[Y].location>=0){const de=ee[Y];let X=Q[Y];if(X===void 0&&(Y==="instanceMatrix"&&U.instanceMatrix&&(X=U.instanceMatrix),Y==="instanceColor"&&U.instanceColor&&(X=U.instanceColor)),de===void 0||de.attribute!==X||X&&de.data!==X.data)return!0;V++}return a.attributesNum!==V||a.index!==W}function b(U,z,q,W){const ee={},Q=z.attributes;let V=0;const $=q.getAttributes();for(const Y in $)if($[Y].location>=0){let de=Q[Y];de===void 0&&(Y==="instanceMatrix"&&U.instanceMatrix&&(de=U.instanceMatrix),Y==="instanceColor"&&U.instanceColor&&(de=U.instanceColor));const X={};X.attribute=de,de&&de.data&&(X.data=de.data),ee[Y]=X,V++}a.attributes=ee,a.attributesNum=V,a.index=W}function w(){const U=a.newAttributes;for(let z=0,q=U.length;z<q;z++)U[z]=0}function _(U){S(U,0)}function S(U,z){const q=a.newAttributes,W=a.enabledAttributes,ee=a.attributeDivisors;q[U]=1,W[U]===0&&(t.enableVertexAttribArray(U),W[U]=1),ee[U]!==z&&(t.vertexAttribDivisor(U,z),ee[U]=z)}function E(){const U=a.newAttributes,z=a.enabledAttributes;for(let q=0,W=z.length;q<W;q++)z[q]!==U[q]&&(t.disableVertexAttribArray(q),z[q]=0)}function T(U,z,q,W,ee,Q,V){V===!0?t.vertexAttribIPointer(U,z,q,ee,Q):t.vertexAttribPointer(U,z,q,W,ee,Q)}function P(U,z,q,W){w();const ee=W.attributes,Q=q.getAttributes(),V=z.defaultAttributeValues;for(const $ in Q){const Y=Q[$];if(Y.location>=0){let ie=ee[$];if(ie===void 0&&($==="instanceMatrix"&&U.instanceMatrix&&(ie=U.instanceMatrix),$==="instanceColor"&&U.instanceColor&&(ie=U.instanceColor)),ie!==void 0){const de=ie.normalized,X=ie.itemSize,ae=e.get(ie);if(ae===void 0)continue;const ue=ae.buffer,Se=ae.type,$e=ae.bytesPerElement,me=Se===t.INT||Se===t.UNSIGNED_INT||ie.gpuType===WE;if(ie.isInterleavedBufferAttribute){const ve=ie.data,We=ve.stride,_e=ie.offset;if(ve.isInstancedInterleavedBuffer){for(let Fe=0;Fe<Y.locationSize;Fe++)S(Y.location+Fe,ve.meshPerAttribute);U.isInstancedMesh!==!0&&W._maxInstanceCount===void 0&&(W._maxInstanceCount=ve.meshPerAttribute*ve.count)}else for(let Fe=0;Fe<Y.locationSize;Fe++)_(Y.location+Fe);t.bindBuffer(t.ARRAY_BUFFER,ue);for(let Fe=0;Fe<Y.locationSize;Fe++)T(Y.location+Fe,X/Y.locationSize,Se,de,We*$e,(_e+X/Y.locationSize*Fe)*$e,me)}else{if(ie.isInstancedBufferAttribute){for(let ve=0;ve<Y.locationSize;ve++)S(Y.location+ve,ie.meshPerAttribute);U.isInstancedMesh!==!0&&W._maxInstanceCount===void 0&&(W._maxInstanceCount=ie.meshPerAttribute*ie.count)}else for(let ve=0;ve<Y.locationSize;ve++)_(Y.location+ve);t.bindBuffer(t.ARRAY_BUFFER,ue);for(let ve=0;ve<Y.locationSize;ve++)T(Y.location+ve,X/Y.locationSize,Se,de,X*$e,X/Y.locationSize*ve*$e,me)}}else if(V!==void 0){const de=V[$];if(de!==void 0)switch(de.length){case 2:t.vertexAttrib2fv(Y.location,de);break;case 3:t.vertexAttrib3fv(Y.location,de);break;case 4:t.vertexAttrib4fv(Y.location,de);break;default:t.vertexAttrib1fv(Y.location,de)}}}}E()}function R(){k();for(const U in r){const z=r[U];for(const q in z){const W=z[q];for(const ee in W)h(W[ee].object),delete W[ee];delete z[q]}delete r[U]}}function D(U){if(r[U.id]===void 0)return;const z=r[U.id];for(const q in z){const W=z[q];for(const ee in W)h(W[ee].object),delete W[ee];delete z[q]}delete r[U.id]}function I(U){for(const z in r){const q=r[z];if(q[U.id]===void 0)continue;const W=q[U.id];for(const ee in W)h(W[ee].object),delete W[ee];delete q[U.id]}}function k(){B(),s=!0,a!==i&&(a=i,u(a.object))}function B(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:k,resetDefaultState:B,dispose:R,releaseStatesOfGeometry:D,releaseStatesOfProgram:I,initAttributes:w,enableAttribute:_,disableUnusedAttributes:E}}function TOe(t,e,n){let r;function i(u){r=u}function a(u,h){t.drawArrays(r,u,h),n.update(h,r,1)}function s(u,h,p){p!==0&&(t.drawArraysInstanced(r,u,h,p),n.update(h,r,p))}function o(u,h,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,u,0,h,0,p);let y=0;for(let b=0;b<p;b++)y+=h[b];n.update(y,r,1)}function c(u,h,p,v){if(p===0)return;const y=e.get("WEBGL_multi_draw");if(y===null)for(let b=0;b<u.length;b++)s(u[b],h[b],v[b]);else{y.multiDrawArraysInstancedWEBGL(r,u,0,h,0,v,0,p);let b=0;for(let w=0;w<p;w++)b+=h[w]*v[w];n.update(b,r,1)}}this.setMode=i,this.render=a,this.renderInstances=s,this.renderMultiDraw=o,this.renderMultiDrawInstances=c}function COe(t,e,n,r){let i;function a(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const I=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(I.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(I){return!(I!==Ba&&r.convert(I)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(I){const k=I===qc&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(I!==ts&&r.convert(I)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&I!==os&&!k)}function c(I){if(I==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";I="mediump"}return I==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=n.precision!==void 0?n.precision:"highp";const h=c(u);h!==u&&(xt("WebGLRenderer:",u,"not supported, using",h,"instead."),u=h);const p=n.logarithmicDepthBuffer===!0,v=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),y=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),b=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),w=t.getParameter(t.MAX_TEXTURE_SIZE),_=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),S=t.getParameter(t.MAX_VERTEX_ATTRIBS),E=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),T=t.getParameter(t.MAX_VARYING_VECTORS),P=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),R=t.getParameter(t.MAX_SAMPLES),D=t.getParameter(t.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:s,textureTypeReadable:o,precision:u,logarithmicDepthBuffer:p,reversedDepthBuffer:v,maxTextures:y,maxVertexTextures:b,maxTextureSize:w,maxCubemapSize:_,maxAttributes:S,maxVertexUniforms:E,maxVaryings:T,maxFragmentUniforms:P,maxSamples:R,samples:D}}function ROe(t){const e=this;let n=null,r=0,i=!1,a=!1;const s=new ju,o=new dn,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(p,v){const y=p.length!==0||v||r!==0||i;return i=v,r=p.length,y},this.beginShadows=function(){a=!0,h(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(p,v){n=h(p,v,0)},this.setState=function(p,v,y){const b=p.clippingPlanes,w=p.clipIntersection,_=p.clipShadows,S=t.get(p);if(!i||b===null||b.length===0||a&&!_)a?h(null):u();else{const E=a?0:r,T=E*4;let P=S.clippingState||null;c.value=P,P=h(b,v,T,y);for(let R=0;R!==T;++R)P[R]=n[R];S.clippingState=P,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=E}};function u(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function h(p,v,y,b){const w=p!==null?p.length:0;let _=null;if(w!==0){if(_=c.value,b!==!0||_===null){const S=y+w*4,E=v.matrixWorldInverse;o.getNormalMatrix(E),(_===null||_.length<S)&&(_=new Float32Array(S));for(let T=0,P=y;T!==w;++T,P+=4)s.copy(p[T]).applyMatrix4(E,o),s.normal.toArray(_,P),_[P+3]=s.constant}c.value=_,c.needsUpdate=!0}return e.numPlanes=w,e.numIntersection=0,_}}function OOe(t){let e=new WeakMap;function n(s,o){return o===Rb?s.mapping=Wc:o===Ob&&(s.mapping=Cd),s}function r(s){if(s&&s.isTexture){const o=s.mapping;if(o===Rb||o===Ob)if(e.has(s)){const c=e.get(s).texture;return n(c,s.mapping)}else{const c=s.image;if(c&&c.height>0){const u=new V5(c.height);return u.fromEquirectangularTexture(t,s),e.set(s,u),s.addEventListener("dispose",i),n(u.texture,s.mapping)}else return null}}return s}function i(s){const o=s.target;o.removeEventListener("dispose",i);const c=e.get(o);c!==void 0&&(e.delete(o),c.dispose())}function a(){e=new WeakMap}return{get:r,dispose:a}}const wd=4,uH=[.125,.215,.35,.446,.526,.582],ep=20,POe=256,fx=new qo,fH=new bt;let TD=null,CD=0,RD=0,OD=!1;const DOe=new ne;class dB{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,n=0,r=.1,i=100,a={}){const{size:s=256,position:o=DOe}=a;TD=this._renderer.getRenderTarget(),CD=this._renderer.getActiveCubeFace(),RD=this._renderer.getActiveMipmapLevel(),OD=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(s);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,r,i,c,o),n>0&&this._blur(c,0,0,n),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=pH(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=hH(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(TD,CD,RD),this._renderer.xr.enabled=OD,e.scissorTest=!1,Eg(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===Wc||e.mapping===Cd?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),TD=this._renderer.getRenderTarget(),CD=this._renderer.getActiveCubeFace(),RD=this._renderer.getActiveMipmapLevel(),OD=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const r=n||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,r={magFilter:vr,minFilter:vr,generateMipmaps:!1,type:qc,format:Ba,colorSpace:Od,depthBuffer:!1},i=dH(e,n,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=dH(e,n,r);const{_lodMax:a}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=NOe(a)),this._blurMaterial=BOe(a,e,n),this._ggxMaterial=IOe(a,e,n)}return i}_compileMaterial(e){const n=new vi(new an,e);this._renderer.compile(n,fx)}_sceneToCubeUV(e,n,r,i,a){const c=new jr(90,1,n,r),u=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],p=this._renderer,v=p.autoClear,y=p.toneMapping;p.getClearColor(fH),p.toneMapping=Wo,p.autoClear=!1,p.state.buffers.depth.getReversed()&&(p.setRenderTarget(i),p.clearDepth(),p.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new vi(new Vp,new Qs({name:"PMREM.Background",side:ls,depthWrite:!1,depthTest:!1})));const w=this._backgroundBox,_=w.material;let S=!1;const E=e.background;E?E.isColor&&(_.color.copy(E),e.background=null,S=!0):(_.color.copy(fH),S=!0);for(let T=0;T<6;T++){const P=T%3;P===0?(c.up.set(0,u[T],0),c.position.set(a.x,a.y,a.z),c.lookAt(a.x+h[T],a.y,a.z)):P===1?(c.up.set(0,0,u[T]),c.position.set(a.x,a.y,a.z),c.lookAt(a.x,a.y+h[T],a.z)):(c.up.set(0,u[T],0),c.position.set(a.x,a.y,a.z),c.lookAt(a.x,a.y,a.z+h[T]));const R=this._cubeSize;Eg(i,P*R,T>2?R:0,R,R),p.setRenderTarget(i),S&&p.render(w,c),p.render(e,c)}p.toneMapping=y,p.autoClear=v,e.background=E}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Wc||e.mapping===Cd;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=pH()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=hH());const a=i?this._cubemapMaterial:this._equirectMaterial,s=this._lodMeshes[0];s.material=a;const o=a.uniforms;o.envMap.value=e;const c=this._cubeSize;Eg(n,0,0,3*c,2*c),r.setRenderTarget(n),r.render(s,fx)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodMeshes.length;for(let a=1;a<i;a++)this._applyGGXFilter(e,a-1,a);n.autoClear=r}_applyGGXFilter(e,n,r){const i=this._renderer,a=this._pingPongRenderTarget,s=this._ggxMaterial,o=this._lodMeshes[r];o.material=s;const c=s.uniforms,u=r/(this._lodMeshes.length-1),h=n/(this._lodMeshes.length-1),p=Math.sqrt(u*u-h*h),v=0+u*1.25,y=p*v,{_lodMax:b}=this,w=this._sizeLods[r],_=3*w*(r>b-wd?r-b+wd:0),S=4*(this._cubeSize-w);c.envMap.value=e.texture,c.roughness.value=y,c.mipInt.value=b-n,Eg(a,_,S,3*w,2*w),i.setRenderTarget(a),i.render(o,fx),c.envMap.value=a.texture,c.roughness.value=0,c.mipInt.value=b-r,Eg(e,_,S,3*w,2*w),i.setRenderTarget(e),i.render(o,fx)}_blur(e,n,r,i,a){const s=this._pingPongRenderTarget;this._halfBlur(e,s,n,r,i,"latitudinal",a),this._halfBlur(s,e,r,r,i,"longitudinal",a)}_halfBlur(e,n,r,i,a,s,o){const c=this._renderer,u=this._blurMaterial;s!=="latitudinal"&&s!=="longitudinal"&&zt("blur direction must be either latitudinal or longitudinal!");const h=3,p=this._lodMeshes[i];p.material=u;const v=u.uniforms,y=this._sizeLods[r]-1,b=isFinite(a)?Math.PI/(2*y):2*Math.PI/(2*ep-1),w=a/b,_=isFinite(a)?1+Math.floor(h*w):ep;_>ep&&xt(`sigmaRadians, ${a}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${ep}`);const S=[];let E=0;for(let I=0;I<ep;++I){const k=I/w,B=Math.exp(-k*k/2);S.push(B),I===0?E+=B:I<_&&(E+=2*B)}for(let I=0;I<S.length;I++)S[I]=S[I]/E;v.envMap.value=e.texture,v.samples.value=_,v.weights.value=S,v.latitudinal.value=s==="latitudinal",o&&(v.poleAxis.value=o);const{_lodMax:T}=this;v.dTheta.value=b,v.mipInt.value=T-r;const P=this._sizeLods[i],R=3*P*(i>T-wd?i-T+wd:0),D=4*(this._cubeSize-P);Eg(n,R,D,3*P,2*P),c.setRenderTarget(n),c.render(p,fx)}}function NOe(t){const e=[],n=[],r=[];let i=t;const a=t-wd+1+uH.length;for(let s=0;s<a;s++){const o=Math.pow(2,i);e.push(o);let c=1/o;s>t-wd?c=uH[s-t+wd-1]:s===0&&(c=0),n.push(c);const u=1/(o-2),h=-u,p=1+u,v=[h,h,p,h,p,p,h,h,p,p,h,p],y=6,b=6,w=3,_=2,S=1,E=new Float32Array(w*b*y),T=new Float32Array(_*b*y),P=new Float32Array(S*b*y);for(let D=0;D<y;D++){const I=D%3*2/3-1,k=D>2?0:-1,B=[I,k,0,I+2/3,k,0,I+2/3,k+1,0,I,k,0,I+2/3,k+1,0,I,k+1,0];E.set(B,w*b*D),T.set(v,_*b*D);const U=[D,D,D,D,D,D];P.set(U,S*b*D)}const R=new an;R.setAttribute("position",new qn(E,w)),R.setAttribute("uv",new qn(T,_)),R.setAttribute("faceIndex",new qn(P,S)),r.push(new vi(R,null)),i>wd&&i--}return{lodMeshes:r,sizeLods:e,sigmas:n}}function dH(t,e,n){const r=new to(t,e,n);return r.texture.mapping=oy,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Eg(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function IOe(t,e,n){return new Yo({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:POe,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:AT(),fragmentShader:`
precision highp float;
precision highp int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
uniform float roughness;
uniform float mipInt;
#define ENVMAP_TYPE_CUBE_UV
#include <cube_uv_reflection_fragment>
#define PI 3.14159265359
// Van der Corput radical inverse
float radicalInverse_VdC(uint bits) {
bits = (bits << 16u) | (bits >> 16u);
bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
return float(bits) * 2.3283064365386963e-10; // / 0x100000000
}
// Hammersley sequence
vec2 hammersley(uint i, uint N) {
return vec2(float(i) / float(N), radicalInverse_VdC(i));
}
// GGX VNDF importance sampling (Eric Heitz 2018)
// "Sampling the GGX Distribution of Visible Normals"
// https://jcgt.org/published/0007/04/01/
vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
float alpha = roughness * roughness;
// Section 3.2: Transform view direction to hemisphere configuration
vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z));
// Section 4.1: Orthonormal basis
float lensq = Vh.x * Vh.x + Vh.y * Vh.y;
vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0);
vec3 T2 = cross(Vh, T1);
// Section 4.2: Parameterization of projected area
float r = sqrt(Xi.x);
float phi = 2.0 * PI * Xi.y;
float t1 = r * cos(phi);
float t2 = r * sin(phi);
float s = 0.5 * (1.0 + Vh.z);
t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
// Section 4.3: Reprojection onto hemisphere
vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh;
// Section 3.4: Transform back to ellipsoid configuration
return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
}
void main() {
vec3 N = normalize(vOutputDirection);
vec3 V = N; // Assume view direction equals normal for pre-filtering
vec3 prefilteredColor = vec3(0.0);
float totalWeight = 0.0;
// For very low roughness, just sample the environment directly
if (roughness < 0.001) {
gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
return;
}
// Tangent space basis for VNDF sampling
vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
vec3 tangent = normalize(cross(up, N));
vec3 bitangent = cross(N, tangent);
for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
// Transform H back to world space
vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
vec3 L = normalize(2.0 * dot(V, H) * H - V);
float NdotL = max(dot(N, L), 0.0);
if(NdotL > 0.0) {
// Sample environment at fixed mip level
// VNDF importance sampling handles the distribution filtering
vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
// Weight by NdotL for the split-sum approximation
// VNDF PDF naturally accounts for the visible microfacet distribution
prefilteredColor += sampleColor * NdotL;
totalWeight += NdotL;
}
}
if (totalWeight > 0.0) {
prefilteredColor = prefilteredColor / totalWeight;
}
gl_FragColor = vec4(prefilteredColor, 1.0);
}
`,blending:Fc,depthTest:!1,depthWrite:!1})}function BOe(t,e,n){const r=new Float32Array(ep),i=new ne(0,1,0);return new Yo({name:"SphericalGaussianBlur",defines:{n:ep,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:AT(),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:Fc,depthTest:!1,depthWrite:!1})}function hH(){return new Yo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:AT(),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:Fc,depthTest:!1,depthWrite:!1})}function pH(){return new Yo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:AT(),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:Fc,depthTest:!1,depthWrite:!1})}function AT(){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 LOe(t){let e=new WeakMap,n=null;function r(o){if(o&&o.isTexture){const c=o.mapping,u=c===Rb||c===Ob,h=c===Wc||c===Cd;if(u||h){let p=e.get(o);const v=p!==void 0?p.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==v)return n===null&&(n=new dB(t)),p=u?n.fromEquirectangular(o,p):n.fromCubemap(o,p),p.texture.pmremVersion=o.pmremVersion,e.set(o,p),p.texture;if(p!==void 0)return p.texture;{const y=o.image;return u&&y&&y.height>0||h&&y&&i(y)?(n===null&&(n=new dB(t)),p=u?n.fromEquirectangular(o):n.fromCubemap(o),p.texture.pmremVersion=o.pmremVersion,e.set(o,p),o.addEventListener("dispose",a),p.texture):null}}}return o}function i(o){let c=0;const u=6;for(let h=0;h<u;h++)o[h]!==void 0&&c++;return c===u}function a(o){const c=o.target;c.removeEventListener("dispose",a);const u=e.get(c);u!==void 0&&(e.delete(c),u.dispose())}function s(){e=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:r,dispose:s}}function kOe(t){const e={};function n(r){if(e[r]!==void 0)return e[r];const i=t.getExtension(r);return e[r]=i,i}return{has:function(r){return n(r)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(r){const i=n(r);return i===null&&Iv("WebGLRenderer: "+r+" extension not supported."),i}}}function FOe(t,e,n,r){const i={},a=new WeakMap;function s(p){const v=p.target;v.index!==null&&e.remove(v.index);for(const b in v.attributes)e.remove(v.attributes[b]);v.removeEventListener("dispose",s),delete i[v.id];const y=a.get(v);y&&(e.remove(y),a.delete(v)),r.releaseStatesOfGeometry(v),v.isInstancedBufferGeometry===!0&&delete v._maxInstanceCount,n.memory.geometries--}function o(p,v){return i[v.id]===!0||(v.addEventListener("dispose",s),i[v.id]=!0,n.memory.geometries++),v}function c(p){const v=p.attributes;for(const y in v)e.update(v[y],t.ARRAY_BUFFER)}function u(p){const v=[],y=p.index,b=p.attributes.position;let w=0;if(y!==null){const E=y.array;w=y.version;for(let T=0,P=E.length;T<P;T+=3){const R=E[T+0],D=E[T+1],I=E[T+2];v.push(R,D,D,I,I,R)}}else if(b!==void 0){const E=b.array;w=b.version;for(let T=0,P=E.length/3-1;T<P;T+=3){const R=T+0,D=T+1,I=T+2;v.push(R,D,D,I,I,R)}}else return;const _=new(eY(v)?H5:G5)(v,1);_.version=w;const S=a.get(p);S&&e.remove(S),a.set(p,_)}function h(p){const v=a.get(p);if(v){const y=p.index;y!==null&&v.version<y.version&&u(p)}else u(p);return a.get(p)}return{get:o,update:c,getWireframeAttribute:h}}function UOe(t,e,n){let r;function i(v){r=v}let a,s;function o(v){a=v.type,s=v.bytesPerElement}function c(v,y){t.drawElements(r,y,a,v*s),n.update(y,r,1)}function u(v,y,b){b!==0&&(t.drawElementsInstanced(r,y,a,v*s,b),n.update(y,r,b))}function h(v,y,b){if(b===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,y,0,a,v,0,b);let _=0;for(let S=0;S<b;S++)_+=y[S];n.update(_,r,1)}function p(v,y,b,w){if(b===0)return;const _=e.get("WEBGL_multi_draw");if(_===null)for(let S=0;S<v.length;S++)u(v[S]/s,y[S],w[S]);else{_.multiDrawElementsInstancedWEBGL(r,y,0,a,v,0,w,0,b);let S=0;for(let E=0;E<b;E++)S+=y[E]*w[E];n.update(S,r,1)}}this.setMode=i,this.setIndex=o,this.render=c,this.renderInstances=u,this.renderMultiDraw=h,this.renderMultiDrawInstances=p}function jOe(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(a,s,o){switch(n.calls++,s){case t.TRIANGLES:n.triangles+=o*(a/3);break;case t.LINES:n.lines+=o*(a/2);break;case t.LINE_STRIP:n.lines+=o*(a-1);break;case t.LINE_LOOP:n.lines+=o*a;break;case t.POINTS:n.points+=o*a;break;default:zt("WebGLInfo: Unknown draw mode:",s);break}}function i(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:i,update:r}}function zOe(t,e,n){const r=new WeakMap,i=new mr;function a(s,o,c){const u=s.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,p=h!==void 0?h.length:0;let v=r.get(o);if(v===void 0||v.count!==p){let B=function(){I.dispose(),r.delete(o),o.removeEventListener("dispose",B)};v!==void 0&&v.texture.dispose();const y=o.morphAttributes.position!==void 0,b=o.morphAttributes.normal!==void 0,w=o.morphAttributes.color!==void 0,_=o.morphAttributes.position||[],S=o.morphAttributes.normal||[],E=o.morphAttributes.color||[];let T=0;y===!0&&(T=1),b===!0&&(T=2),w===!0&&(T=3);let P=o.attributes.position.count*T,R=1;P>e.maxTextureSize&&(R=Math.ceil(P/e.maxTextureSize),P=e.maxTextureSize);const D=new Float32Array(P*R*4*p),I=new eT(D,P,R,p);I.type=os,I.needsUpdate=!0;const k=T*4;for(let U=0;U<p;U++){const z=_[U],q=S[U],W=E[U],ee=P*R*4*U;for(let Q=0;Q<z.count;Q++){const V=Q*k;y===!0&&(i.fromBufferAttribute(z,Q),D[ee+V+0]=i.x,D[ee+V+1]=i.y,D[ee+V+2]=i.z,D[ee+V+3]=0),b===!0&&(i.fromBufferAttribute(q,Q),D[ee+V+4]=i.x,D[ee+V+5]=i.y,D[ee+V+6]=i.z,D[ee+V+7]=0),w===!0&&(i.fromBufferAttribute(W,Q),D[ee+V+8]=i.x,D[ee+V+9]=i.y,D[ee+V+10]=i.z,D[ee+V+11]=W.itemSize===4?i.w:1)}}v={count:p,texture:I,size:new Ve(P,R)},r.set(o,v),o.addEventListener("dispose",B)}if(s.isInstancedMesh===!0&&s.morphTexture!==null)c.getUniforms().setValue(t,"morphTexture",s.morphTexture,n);else{let y=0;for(let w=0;w<u.length;w++)y+=u[w];const b=o.morphTargetsRelative?1:1-y;c.getUniforms().setValue(t,"morphTargetBaseInfluence",b),c.getUniforms().setValue(t,"morphTargetInfluences",u)}c.getUniforms().setValue(t,"morphTargetsTexture",v.texture,n),c.getUniforms().setValue(t,"morphTargetsTextureSize",v.size)}return{update:a}}function GOe(t,e,n,r){let i=new WeakMap;function a(c){const u=r.render.frame,h=c.geometry,p=e.get(c,h);if(i.get(p)!==u&&(e.update(p),i.set(p,u)),c.isInstancedMesh&&(c.hasEventListener("dispose",o)===!1&&c.addEventListener("dispose",o),i.get(c)!==u&&(n.update(c.instanceMatrix,t.ARRAY_BUFFER),c.instanceColor!==null&&n.update(c.instanceColor,t.ARRAY_BUFFER),i.set(c,u))),c.isSkinnedMesh){const v=c.skeleton;i.get(v)!==u&&(v.update(),i.set(v,u))}return p}function s(){i=new WeakMap}function o(c){const u=c.target;u.removeEventListener("dispose",o),n.remove(u.instanceMatrix),u.instanceColor!==null&&n.remove(u.instanceColor)}return{update:a,dispose:s}}const HOe={[E5]:"LINEAR_TONE_MAPPING",[T5]:"REINHARD_TONE_MAPPING",[C5]:"CINEON_TONE_MAPPING",[GE]:"ACES_FILMIC_TONE_MAPPING",[O5]:"AGX_TONE_MAPPING",[P5]:"NEUTRAL_TONE_MAPPING",[R5]:"CUSTOM_TONE_MAPPING"};function VOe(t,e,n,r,i){const a=new to(e,n,{type:t,depthBuffer:r,stencilBuffer:i}),s=new to(e,n,{type:qc,depthBuffer:!1,stencilBuffer:!1}),o=new an;o.setAttribute("position",new Pt([-1,3,0,-1,-1,0,3,-1,0],3)),o.setAttribute("uv",new Pt([0,2,0,0,2,0],2));const c=new ik({uniforms:{tDiffuse:{value:null}},vertexShader:`
precision highp float;
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
attribute vec3 position;
attribute vec2 uv;
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,fragmentShader:`
precision highp float;
uniform sampler2D tDiffuse;
varying vec2 vUv;
#include <tonemapping_pars_fragment>
#include <colorspace_pars_fragment>
void main() {
gl_FragColor = texture2D( tDiffuse, vUv );
#ifdef LINEAR_TONE_MAPPING
gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
#elif defined( REINHARD_TONE_MAPPING )
gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
#elif defined( CINEON_TONE_MAPPING )
gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
#elif defined( ACES_FILMIC_TONE_MAPPING )
gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
#elif defined( AGX_TONE_MAPPING )
gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
#elif defined( NEUTRAL_TONE_MAPPING )
gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
#elif defined( CUSTOM_TONE_MAPPING )
gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
#endif
#ifdef SRGB_TRANSFER
gl_FragColor = sRGBTransferOETF( gl_FragColor );
#endif
}`,depthTest:!1,depthWrite:!1}),u=new vi(o,c),h=new qo(-1,1,1,-1,0,1);let p=null,v=null,y=!1,b,w=null,_=[],S=!1;this.setSize=function(E,T){a.setSize(E,T),s.setSize(E,T);for(let P=0;P<_.length;P++){const R=_[P];R.setSize&&R.setSize(E,T)}},this.setEffects=function(E){_=E,S=_.length>0&&_[0].isRenderPass===!0;const T=a.width,P=a.height;for(let R=0;R<_.length;R++){const D=_[R];D.setSize&&D.setSize(T,P)}},this.begin=function(E,T){if(y||E.toneMapping===Wo&&_.length===0)return!1;if(w=T,T!==null){const P=T.width,R=T.height;(a.width!==P||a.height!==R)&&this.setSize(P,R)}return S===!1&&E.setRenderTarget(a),b=E.toneMapping,E.toneMapping=Wo,!0},this.hasRenderPass=function(){return S},this.end=function(E,T){E.toneMapping=b,y=!0;let P=a,R=s;for(let D=0;D<_.length;D++){const I=_[D];if(I.enabled!==!1&&(I.render(E,R,P,T),I.needsSwap!==!1)){const k=P;P=R,R=k}}if(p!==E.outputColorSpace||v!==E.toneMapping){p=E.outputColorSpace,v=E.toneMapping,c.defines={},Fn.getTransfer(p)===ir&&(c.defines.SRGB_TRANSFER="");const D=HOe[v];D&&(c.defines[D]=""),c.needsUpdate=!0}c.uniforms.tDiffuse.value=P.texture,E.setRenderTarget(w),E.render(u,h),w=null,y=!1},this.isCompositing=function(){return y},this.dispose=function(){a.dispose(),s.dispose(),o.dispose(),c.dispose()}}const QY=new Gr,hB=new Fv(1,1),eJ=new eT,tJ=new tT,nJ=new c1,mH=[],gH=[],vH=new Float32Array(16),yH=new Float32Array(9),xH=new Float32Array(4);function fy(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let a=mH[i];if(a===void 0&&(a=new Float32Array(i),mH[i]=a),e!==0){r.toArray(a,0);for(let s=1,o=0;s!==e;++s)o+=n,t[s].toArray(a,o)}return a}function Gi(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Hi(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n]}function wT(t,e){let n=gH[e];n===void 0&&(n=new Int32Array(e),gH[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function WOe(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function qOe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Gi(n,e))return;t.uniform2fv(this.addr,e),Hi(n,e)}}function $Oe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(e.r!==void 0)(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b)&&(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Gi(n,e))return;t.uniform3fv(this.addr,e),Hi(n,e)}}function XOe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Gi(n,e))return;t.uniform4fv(this.addr,e),Hi(n,e)}}function KOe(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(Gi(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Hi(n,e)}else{if(Gi(n,r))return;xH.set(r),t.uniformMatrix2fv(this.addr,!1,xH),Hi(n,r)}}function YOe(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(Gi(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Hi(n,e)}else{if(Gi(n,r))return;yH.set(r),t.uniformMatrix3fv(this.addr,!1,yH),Hi(n,r)}}function JOe(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(Gi(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Hi(n,e)}else{if(Gi(n,r))return;vH.set(r),t.uniformMatrix4fv(this.addr,!1,vH),Hi(n,r)}}function ZOe(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function QOe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Gi(n,e))return;t.uniform2iv(this.addr,e),Hi(n,e)}}function ePe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Gi(n,e))return;t.uniform3iv(this.addr,e),Hi(n,e)}}function tPe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Gi(n,e))return;t.uniform4iv(this.addr,e),Hi(n,e)}}function nPe(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function rPe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Gi(n,e))return;t.uniform2uiv(this.addr,e),Hi(n,e)}}function iPe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Gi(n,e))return;t.uniform3uiv(this.addr,e),Hi(n,e)}}function aPe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Gi(n,e))return;t.uniform4uiv(this.addr,e),Hi(n,e)}}function sPe(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i);let a;this.type===t.SAMPLER_2D_SHADOW?(hB.compareFunction=n.isReversedDepthBuffer()?QE:ZE,a=hB):a=QY,n.setTexture2D(e||a,i)}function oPe(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||tJ,i)}function lPe(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||nJ,i)}function cPe(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||eJ,i)}function uPe(t){switch(t){case 5126:return WOe;case 35664:return qOe;case 35665:return $Oe;case 35666:return XOe;case 35674:return KOe;case 35675:return YOe;case 35676:return JOe;case 5124:case 35670:return ZOe;case 35667:case 35671:return QOe;case 35668:case 35672:return ePe;case 35669:case 35673:return tPe;case 5125:return nPe;case 36294:return rPe;case 36295:return iPe;case 36296:return aPe;case 35678:case 36198:case 36298:case 36306:case 35682:return sPe;case 35679:case 36299:case 36307:return oPe;case 35680:case 36300:case 36308:case 36293:return lPe;case 36289:case 36303:case 36311:case 36292:return cPe}}function fPe(t,e){t.uniform1fv(this.addr,e)}function dPe(t,e){const n=fy(e,this.size,2);t.uniform2fv(this.addr,n)}function hPe(t,e){const n=fy(e,this.size,3);t.uniform3fv(this.addr,n)}function pPe(t,e){const n=fy(e,this.size,4);t.uniform4fv(this.addr,n)}function mPe(t,e){const n=fy(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function gPe(t,e){const n=fy(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function vPe(t,e){const n=fy(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function yPe(t,e){t.uniform1iv(this.addr,e)}function xPe(t,e){t.uniform2iv(this.addr,e)}function bPe(t,e){t.uniform3iv(this.addr,e)}function _Pe(t,e){t.uniform4iv(this.addr,e)}function SPe(t,e){t.uniform1uiv(this.addr,e)}function APe(t,e){t.uniform2uiv(this.addr,e)}function wPe(t,e){t.uniform3uiv(this.addr,e)}function MPe(t,e){t.uniform4uiv(this.addr,e)}function EPe(t,e,n){const r=this.cache,i=e.length,a=wT(n,i);Gi(r,a)||(t.uniform1iv(this.addr,a),Hi(r,a));let s;this.type===t.SAMPLER_2D_SHADOW?s=hB:s=QY;for(let o=0;o!==i;++o)n.setTexture2D(e[o]||s,a[o])}function TPe(t,e,n){const r=this.cache,i=e.length,a=wT(n,i);Gi(r,a)||(t.uniform1iv(this.addr,a),Hi(r,a));for(let s=0;s!==i;++s)n.setTexture3D(e[s]||tJ,a[s])}function CPe(t,e,n){const r=this.cache,i=e.length,a=wT(n,i);Gi(r,a)||(t.uniform1iv(this.addr,a),Hi(r,a));for(let s=0;s!==i;++s)n.setTextureCube(e[s]||nJ,a[s])}function RPe(t,e,n){const r=this.cache,i=e.length,a=wT(n,i);Gi(r,a)||(t.uniform1iv(this.addr,a),Hi(r,a));for(let s=0;s!==i;++s)n.setTexture2DArray(e[s]||eJ,a[s])}function OPe(t){switch(t){case 5126:return fPe;case 35664:return dPe;case 35665:return hPe;case 35666:return pPe;case 35674:return mPe;case 35675:return gPe;case 35676:return vPe;case 5124:case 35670:return yPe;case 35667:case 35671:return xPe;case 35668:case 35672:return bPe;case 35669:case 35673:return _Pe;case 5125:return SPe;case 36294:return APe;case 36295:return wPe;case 36296:return MPe;case 35678:case 36198:case 36298:case 36306:case 35682:return EPe;case 35679:case 36299:case 36307:return TPe;case 35680:case 36300:case 36308:case 36293:return CPe;case 36289:case 36303:case 36311:case 36292:return RPe}}class PPe{constructor(e,n,r){this.id=e,this.addr=r,this.cache=[],this.type=n.type,this.setValue=uPe(n.type)}}class DPe{constructor(e,n,r){this.id=e,this.addr=r,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=OPe(n.type)}}class NPe{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,n,r){const i=this.seq;for(let a=0,s=i.length;a!==s;++a){const o=i[a];o.setValue(e,n[o.id],r)}}}const PD=/(\w+)(\])?(\[|\.)?/g;function bH(t,e){t.seq.push(e),t.map[e.id]=e}function IPe(t,e,n){const r=t.name,i=r.length;for(PD.lastIndex=0;;){const a=PD.exec(r),s=PD.lastIndex;let o=a[1];const c=a[2]==="]",u=a[3];if(c&&(o=o|0),u===void 0||u==="["&&s+2===i){bH(n,u===void 0?new PPe(o,t,e):new DPe(o,t,e));break}else{let p=n.map[o];p===void 0&&(p=new NPe(o),bH(n,p)),n=p}}}class jA{constructor(e,n){this.seq=[],this.map={};const r=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){const o=e.getActiveUniform(n,s),c=e.getUniformLocation(n,o.name);IPe(o,c,this)}const i=[],a=[];for(const s of this.seq)s.type===e.SAMPLER_2D_SHADOW||s.type===e.SAMPLER_CUBE_SHADOW||s.type===e.SAMPLER_2D_ARRAY_SHADOW?i.push(s):a.push(s);i.length>0&&(this.seq=i.concat(a))}setValue(e,n,r,i){const a=this.map[n];a!==void 0&&a.setValue(e,r,i)}setOptional(e,n,r){const i=n[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,n,r,i){for(let a=0,s=n.length;a!==s;++a){const o=n[a],c=r[o.id];c.needsUpdate!==!1&&o.setValue(e,c.value,i)}}static seqWithValue(e,n){const r=[];for(let i=0,a=e.length;i!==a;++i){const s=e[i];s.id in n&&r.push(s)}return r}}function _H(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}const BPe=37297;let LPe=0;function kPe(t,e){const n=t.split(`
`),r=[],i=Math.max(e-6,0),a=Math.min(e+6,n.length);for(let s=i;s<a;s++){const o=s+1;r.push(`${o===e?">":" "} ${o}: ${n[s]}`)}return r.join(`
`)}const SH=new dn;function FPe(t){Fn._getMatrix(SH,Fn.workingColorSpace,t);const e=`mat3( ${SH.elements.map(n=>n.toFixed(4))} )`;switch(Fn.getTransfer(t)){case Db:return[e,"LinearTransferOETF"];case ir:return[e,"sRGBTransferOETF"];default:return xt("WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function AH(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),a=(t.getShaderInfoLog(e)||"").trim();if(r&&a==="")return"";const s=/ERROR: 0:(\d+)/.exec(a);if(s){const o=parseInt(s[1]);return n.toUpperCase()+`
`+a+`
`+kPe(t.getShaderSource(e),o)}else return a}function UPe(t,e){const n=FPe(e);return[`vec4 ${t}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(`
`)}const jPe={[E5]:"Linear",[T5]:"Reinhard",[C5]:"Cineon",[GE]:"ACESFilmic",[O5]:"AgX",[P5]:"Neutral",[R5]:"Custom"};function zPe(t,e){const n=jPe[e];return n===void 0?(xt("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+t+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const yA=new ne;function GPe(){Fn.getLuminanceCoefficients(yA);const t=yA.x.toFixed(4),e=yA.y.toFixed(4),n=yA.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(`
`)}function HPe(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(bx).join(`
`)}function VPe(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(`
`)}function WPe(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const a=t.getActiveAttrib(e,i),s=a.name;let o=1;a.type===t.FLOAT_MAT2&&(o=2),a.type===t.FLOAT_MAT3&&(o=3),a.type===t.FLOAT_MAT4&&(o=4),n[s]={type:a.type,location:t.getAttribLocation(e,s),locationSize:o}}return n}function bx(t){return t!==""}function wH(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.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,n).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 MH(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const qPe=/^[ \t]*#include +<([\w\d./]+)>/gm;function pB(t){return t.replace(qPe,XPe)}const $Pe=new Map;function XPe(t,e){let n=bn[e];if(n===void 0){const r=$Pe.get(e);if(r!==void 0)n=bn[r],xt('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return pB(n)}const KPe=/#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 EH(t){return t.replace(KPe,YPe)}function YPe(t,e,n,r){let i="";for(let a=parseInt(e);a<parseInt(n);a++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function TH(t){let e=`precision ${t.precision} float;
precision ${t.precision} int;
precision ${t.precision} sampler2D;
precision ${t.precision} samplerCube;
precision ${t.precision} sampler3D;
precision ${t.precision} sampler2DArray;
precision ${t.precision} sampler2DShadow;
precision ${t.precision} samplerCubeShadow;
precision ${t.precision} sampler2DArrayShadow;
precision ${t.precision} isampler2D;
precision ${t.precision} isampler3D;
precision ${t.precision} isamplerCube;
precision ${t.precision} isampler2DArray;
precision ${t.precision} usampler2D;
precision ${t.precision} usampler3D;
precision ${t.precision} usamplerCube;
precision ${t.precision} usampler2DArray;
`;return t.precision==="highp"?e+=`
#define HIGH_PRECISION`:t.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}const JPe={[Yg]:"SHADOWMAP_TYPE_PCF",[cp]:"SHADOWMAP_TYPE_VSM"};function ZPe(t){return JPe[t.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const QPe={[Wc]:"ENVMAP_TYPE_CUBE",[Cd]:"ENVMAP_TYPE_CUBE",[oy]:"ENVMAP_TYPE_CUBE_UV"};function e3e(t){return t.envMap===!1?"ENVMAP_TYPE_CUBE":QPe[t.envMapMode]||"ENVMAP_TYPE_CUBE"}const t3e={[Cd]:"ENVMAP_MODE_REFRACTION"};function n3e(t){return t.envMap===!1?"ENVMAP_MODE_REFLECTION":t3e[t.envMapMode]||"ENVMAP_MODE_REFLECTION"}const r3e={[o1]:"ENVMAP_BLENDING_MULTIPLY",[UK]:"ENVMAP_BLENDING_MIX",[jK]:"ENVMAP_BLENDING_ADD"};function i3e(t){return t.envMap===!1?"ENVMAP_BLENDING_NONE":r3e[t.combine]||"ENVMAP_BLENDING_NONE"}function a3e(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}function s3e(t,e,n,r){const i=t.getContext(),a=n.defines;let s=n.vertexShader,o=n.fragmentShader;const c=ZPe(n),u=e3e(n),h=n3e(n),p=i3e(n),v=a3e(n),y=HPe(n),b=VPe(a),w=i.createProgram();let _,S,E=n.glslVersion?"#version "+n.glslVersion+`
`:"";n.isRawShaderMaterial?(_=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(bx).join(`
`),_.length>0&&(_+=`
`),S=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(bx).join(`
`),S.length>0&&(S+=`
`)):(_=[TH(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
`].filter(bx).join(`
`),S=[TH(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.envMap?"#define "+p:"",v?"#define CUBEUV_TEXEL_WIDTH "+v.texelWidth:"",v?"#define CUBEUV_TEXEL_HEIGHT "+v.texelHeight:"",v?"#define CUBEUV_MAX_MIP "+v.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Wo?"#define TONE_MAPPING":"",n.toneMapping!==Wo?bn.tonemapping_pars_fragment:"",n.toneMapping!==Wo?zPe("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",bn.colorspace_pars_fragment,UPe("linearToOutputTexel",n.outputColorSpace),GPe(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
`].filter(bx).join(`
`)),s=pB(s),s=wH(s,n),s=MH(s,n),o=pB(o),o=wH(o,n),o=MH(o,n),s=EH(s),o=EH(o),n.isRawShaderMaterial!==!0&&(E=`#version 300 es
`,_=[y,"#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+_,S=["#define varying in",n.glslVersion===iB?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===iB?"":"#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(`
`)+`
`+S);const T=E+_+s,P=E+S+o,R=_H(i,i.VERTEX_SHADER,T),D=_H(i,i.FRAGMENT_SHADER,P);i.attachShader(w,R),i.attachShader(w,D),n.index0AttributeName!==void 0?i.bindAttribLocation(w,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(w,0,"position"),i.linkProgram(w);function I(z){if(t.debug.checkShaderErrors){const q=i.getProgramInfoLog(w)||"",W=i.getShaderInfoLog(R)||"",ee=i.getShaderInfoLog(D)||"",Q=q.trim(),V=W.trim(),$=ee.trim();let Y=!0,ie=!0;if(i.getProgramParameter(w,i.LINK_STATUS)===!1)if(Y=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,w,R,D);else{const de=AH(i,R,"vertex"),X=AH(i,D,"fragment");zt("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(w,i.VALIDATE_STATUS)+`
Material Name: `+z.name+`
Material Type: `+z.type+`
Program Info Log: `+Q+`
`+de+`
`+X)}else Q!==""?xt("WebGLProgram: Program Info Log:",Q):(V===""||$==="")&&(ie=!1);ie&&(z.diagnostics={runnable:Y,programLog:Q,vertexShader:{log:V,prefix:_},fragmentShader:{log:$,prefix:S}})}i.deleteShader(R),i.deleteShader(D),k=new jA(i,w),B=WPe(i,w)}let k;this.getUniforms=function(){return k===void 0&&I(this),k};let B;this.getAttributes=function(){return B===void 0&&I(this),B};let U=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return U===!1&&(U=i.getProgramParameter(w,BPe)),U},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(w),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=LPe++,this.cacheKey=e,this.usedTimes=1,this.program=w,this.vertexShader=R,this.fragmentShader=D,this}let o3e=0;class l3e{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),a=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(a)===!1&&(s.add(a),a.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)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 n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new c3e(e),n.set(e,r)),r}}class c3e{constructor(e){this.id=o3e++,this.code=e,this.usedTimes=0}}function u3e(t,e,n,r,i,a,s){const o=new Lv,c=new l3e,u=new Set,h=[],p=new Map,v=i.logarithmicDepthBuffer;let y=i.precision;const b={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function w(B){return u.add(B),B===0?"uv":`uv${B}`}function _(B,U,z,q,W){const ee=q.fog,Q=W.geometry,V=B.isMeshStandardMaterial?q.environment:null,$=(B.isMeshStandardMaterial?n:e).get(B.envMap||V),Y=$&&$.mapping===oy?$.image.height:null,ie=b[B.type];B.precision!==null&&(y=i.getMaxPrecision(B.precision),y!==B.precision&&xt("WebGLProgram.getParameters:",B.precision,"not supported, using",y,"instead."));const de=Q.morphAttributes.position||Q.morphAttributes.normal||Q.morphAttributes.color,X=de!==void 0?de.length:0;let ae=0;Q.morphAttributes.position!==void 0&&(ae=1),Q.morphAttributes.normal!==void 0&&(ae=2),Q.morphAttributes.color!==void 0&&(ae=3);let ue,Se,$e,me;if(ie){const hn=Dl[ie];ue=hn.vertexShader,Se=hn.fragmentShader}else ue=B.vertexShader,Se=B.fragmentShader,c.update(B),$e=c.getVertexShaderID(B),me=c.getFragmentShaderID(B);const ve=t.getRenderTarget(),We=t.state.buffers.depth.getReversed(),_e=W.isInstancedMesh===!0,Fe=W.isBatchedMesh===!0,Xe=!!B.map,Re=!!B.matcap,ot=!!$,we=!!B.aoMap,Ue=!!B.lightMap,Be=!!B.bumpMap,Ye=!!B.normalMap,re=!!B.displacementMap,At=!!B.emissiveMap,ft=!!B.metalnessMap,Et=!!B.roughnessMap,Ze=B.anisotropy>0,te=B.clearcoat>0,H=B.dispersion>0,he=B.iridescence>0,Ne=B.sheen>0,je=B.transmission>0,Ie=Ze&&!!B.anisotropyMap,_t=te&&!!B.clearcoatMap,lt=te&&!!B.clearcoatNormalMap,Tt=te&&!!B.clearcoatRoughnessMap,Gt=he&&!!B.iridescenceMap,Qe=he&&!!B.iridescenceThicknessMap,st=Ne&&!!B.sheenColorMap,vt=Ne&&!!B.sheenRoughnessMap,se=!!B.specularMap,Ae=!!B.specularColorMap,dt=!!B.specularIntensityMap,oe=je&&!!B.transmissionMap,it=je&&!!B.thicknessMap,et=!!B.gradientMap,pt=!!B.alphaMap,tt=B.alphaTest>0,He=!!B.alphaHash,at=!!B.extensions;let jt=Wo;B.toneMapped&&(ve===null||ve.isXRRenderTarget===!0)&&(jt=t.toneMapping);const un={shaderID:ie,shaderType:B.type,shaderName:B.name,vertexShader:ue,fragmentShader:Se,defines:B.defines,customVertexShaderID:$e,customFragmentShaderID:me,isRawShaderMaterial:B.isRawShaderMaterial===!0,glslVersion:B.glslVersion,precision:y,batching:Fe,batchingColor:Fe&&W._colorsTexture!==null,instancing:_e,instancingColor:_e&&W.instanceColor!==null,instancingMorph:_e&&W.morphTexture!==null,outputColorSpace:ve===null?t.outputColorSpace:ve.isXRRenderTarget===!0?ve.texture.colorSpace:Od,alphaToCoverage:!!B.alphaToCoverage,map:Xe,matcap:Re,envMap:ot,envMapMode:ot&&$.mapping,envMapCubeUVHeight:Y,aoMap:we,lightMap:Ue,bumpMap:Be,normalMap:Ye,displacementMap:re,emissiveMap:At,normalMapObjectSpace:Ye&&B.normalMapType===$K,normalMapTangentSpace:Ye&&B.normalMapType===zd,metalnessMap:ft,roughnessMap:Et,anisotropy:Ze,anisotropyMap:Ie,clearcoat:te,clearcoatMap:_t,clearcoatNormalMap:lt,clearcoatRoughnessMap:Tt,dispersion:H,iridescence:he,iridescenceMap:Gt,iridescenceThicknessMap:Qe,sheen:Ne,sheenColorMap:st,sheenRoughnessMap:vt,specularMap:se,specularColorMap:Ae,specularIntensityMap:dt,transmission:je,transmissionMap:oe,thicknessMap:it,gradientMap:et,opaque:B.transparent===!1&&B.blending===xp&&B.alphaToCoverage===!1,alphaMap:pt,alphaTest:tt,alphaHash:He,combine:B.combine,mapUv:Xe&&w(B.map.channel),aoMapUv:we&&w(B.aoMap.channel),lightMapUv:Ue&&w(B.lightMap.channel),bumpMapUv:Be&&w(B.bumpMap.channel),normalMapUv:Ye&&w(B.normalMap.channel),displacementMapUv:re&&w(B.displacementMap.channel),emissiveMapUv:At&&w(B.emissiveMap.channel),metalnessMapUv:ft&&w(B.metalnessMap.channel),roughnessMapUv:Et&&w(B.roughnessMap.channel),anisotropyMapUv:Ie&&w(B.anisotropyMap.channel),clearcoatMapUv:_t&&w(B.clearcoatMap.channel),clearcoatNormalMapUv:lt&&w(B.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Tt&&w(B.clearcoatRoughnessMap.channel),iridescenceMapUv:Gt&&w(B.iridescenceMap.channel),iridescenceThicknessMapUv:Qe&&w(B.iridescenceThicknessMap.channel),sheenColorMapUv:st&&w(B.sheenColorMap.channel),sheenRoughnessMapUv:vt&&w(B.sheenRoughnessMap.channel),specularMapUv:se&&w(B.specularMap.channel),specularColorMapUv:Ae&&w(B.specularColorMap.channel),specularIntensityMapUv:dt&&w(B.specularIntensityMap.channel),transmissionMapUv:oe&&w(B.transmissionMap.channel),thicknessMapUv:it&&w(B.thicknessMap.channel),alphaMapUv:pt&&w(B.alphaMap.channel),vertexTangents:!!Q.attributes.tangent&&(Ye||Ze),vertexColors:B.vertexColors,vertexAlphas:B.vertexColors===!0&&!!Q.attributes.color&&Q.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!Q.attributes.uv&&(Xe||pt),fog:!!ee,useFog:B.fog===!0,fogExp2:!!ee&&ee.isFogExp2,flatShading:B.flatShading===!0&&B.wireframe===!1,sizeAttenuation:B.sizeAttenuation===!0,logarithmicDepthBuffer:v,reversedDepthBuffer:We,skinning:W.isSkinnedMesh===!0,morphTargets:Q.morphAttributes.position!==void 0,morphNormals:Q.morphAttributes.normal!==void 0,morphColors:Q.morphAttributes.color!==void 0,morphTargetsCount:X,morphTextureStride:ae,numDirLights:U.directional.length,numPointLights:U.point.length,numSpotLights:U.spot.length,numSpotLightMaps:U.spotLightMap.length,numRectAreaLights:U.rectArea.length,numHemiLights:U.hemi.length,numDirLightShadows:U.directionalShadowMap.length,numPointLightShadows:U.pointShadowMap.length,numSpotLightShadows:U.spotShadowMap.length,numSpotLightShadowsWithMaps:U.numSpotLightShadowsWithMaps,numLightProbes:U.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:B.dithering,shadowMapEnabled:t.shadowMap.enabled&&z.length>0,shadowMapType:t.shadowMap.type,toneMapping:jt,decodeVideoTexture:Xe&&B.map.isVideoTexture===!0&&Fn.getTransfer(B.map.colorSpace)===ir,decodeVideoTextureEmissive:At&&B.emissiveMap.isVideoTexture===!0&&Fn.getTransfer(B.emissiveMap.colorSpace)===ir,premultipliedAlpha:B.premultipliedAlpha,doubleSided:B.side===Fo,flipSided:B.side===ls,useDepthPacking:B.depthPacking>=0,depthPacking:B.depthPacking||0,index0AttributeName:B.index0AttributeName,extensionClipCullDistance:at&&B.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(at&&B.extensions.multiDraw===!0||Fe)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:B.customProgramCacheKey()};return un.vertexUv1s=u.has(1),un.vertexUv2s=u.has(2),un.vertexUv3s=u.has(3),u.clear(),un}function S(B){const U=[];if(B.shaderID?U.push(B.shaderID):(U.push(B.customVertexShaderID),U.push(B.customFragmentShaderID)),B.defines!==void 0)for(const z in B.defines)U.push(z),U.push(B.defines[z]);return B.isRawShaderMaterial===!1&&(E(U,B),T(U,B),U.push(t.outputColorSpace)),U.push(B.customProgramCacheKey),U.join()}function E(B,U){B.push(U.precision),B.push(U.outputColorSpace),B.push(U.envMapMode),B.push(U.envMapCubeUVHeight),B.push(U.mapUv),B.push(U.alphaMapUv),B.push(U.lightMapUv),B.push(U.aoMapUv),B.push(U.bumpMapUv),B.push(U.normalMapUv),B.push(U.displacementMapUv),B.push(U.emissiveMapUv),B.push(U.metalnessMapUv),B.push(U.roughnessMapUv),B.push(U.anisotropyMapUv),B.push(U.clearcoatMapUv),B.push(U.clearcoatNormalMapUv),B.push(U.clearcoatRoughnessMapUv),B.push(U.iridescenceMapUv),B.push(U.iridescenceThicknessMapUv),B.push(U.sheenColorMapUv),B.push(U.sheenRoughnessMapUv),B.push(U.specularMapUv),B.push(U.specularColorMapUv),B.push(U.specularIntensityMapUv),B.push(U.transmissionMapUv),B.push(U.thicknessMapUv),B.push(U.combine),B.push(U.fogExp2),B.push(U.sizeAttenuation),B.push(U.morphTargetsCount),B.push(U.morphAttributeCount),B.push(U.numDirLights),B.push(U.numPointLights),B.push(U.numSpotLights),B.push(U.numSpotLightMaps),B.push(U.numHemiLights),B.push(U.numRectAreaLights),B.push(U.numDirLightShadows),B.push(U.numPointLightShadows),B.push(U.numSpotLightShadows),B.push(U.numSpotLightShadowsWithMaps),B.push(U.numLightProbes),B.push(U.shadowMapType),B.push(U.toneMapping),B.push(U.numClippingPlanes),B.push(U.numClipIntersection),B.push(U.depthPacking)}function T(B,U){o.disableAll(),U.instancing&&o.enable(0),U.instancingColor&&o.enable(1),U.instancingMorph&&o.enable(2),U.matcap&&o.enable(3),U.envMap&&o.enable(4),U.normalMapObjectSpace&&o.enable(5),U.normalMapTangentSpace&&o.enable(6),U.clearcoat&&o.enable(7),U.iridescence&&o.enable(8),U.alphaTest&&o.enable(9),U.vertexColors&&o.enable(10),U.vertexAlphas&&o.enable(11),U.vertexUv1s&&o.enable(12),U.vertexUv2s&&o.enable(13),U.vertexUv3s&&o.enable(14),U.vertexTangents&&o.enable(15),U.anisotropy&&o.enable(16),U.alphaHash&&o.enable(17),U.batching&&o.enable(18),U.dispersion&&o.enable(19),U.batchingColor&&o.enable(20),U.gradientMap&&o.enable(21),B.push(o.mask),o.disableAll(),U.fog&&o.enable(0),U.useFog&&o.enable(1),U.flatShading&&o.enable(2),U.logarithmicDepthBuffer&&o.enable(3),U.reversedDepthBuffer&&o.enable(4),U.skinning&&o.enable(5),U.morphTargets&&o.enable(6),U.morphNormals&&o.enable(7),U.morphColors&&o.enable(8),U.premultipliedAlpha&&o.enable(9),U.shadowMapEnabled&&o.enable(10),U.doubleSided&&o.enable(11),U.flipSided&&o.enable(12),U.useDepthPacking&&o.enable(13),U.dithering&&o.enable(14),U.transmission&&o.enable(15),U.sheen&&o.enable(16),U.opaque&&o.enable(17),U.pointsUvs&&o.enable(18),U.decodeVideoTexture&&o.enable(19),U.decodeVideoTextureEmissive&&o.enable(20),U.alphaToCoverage&&o.enable(21),B.push(o.mask)}function P(B){const U=b[B.type];let z;if(U){const q=Dl[U];z=oY.clone(q.uniforms)}else z=B.uniforms;return z}function R(B,U){let z=p.get(U);return z!==void 0?++z.usedTimes:(z=new s3e(t,U,B,a),h.push(z),p.set(U,z)),z}function D(B){if(--B.usedTimes===0){const U=h.indexOf(B);h[U]=h[h.length-1],h.pop(),p.delete(B.cacheKey),B.destroy()}}function I(B){c.remove(B)}function k(){c.dispose()}return{getParameters:_,getProgramCacheKey:S,getUniforms:P,acquireProgram:R,releaseProgram:D,releaseShaderCache:I,programs:h,dispose:k}}function f3e(){let t=new WeakMap;function e(s){return t.has(s)}function n(s){let o=t.get(s);return o===void 0&&(o={},t.set(s,o)),o}function r(s){t.delete(s)}function i(s,o,c){t.get(s)[o]=c}function a(){t=new WeakMap}return{has:e,get:n,remove:r,update:i,dispose:a}}function d3e(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function CH(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function RH(){const t=[];let e=0;const n=[],r=[],i=[];function a(){e=0,n.length=0,r.length=0,i.length=0}function s(p,v,y,b,w,_){let S=t[e];return S===void 0?(S={id:p.id,object:p,geometry:v,material:y,groupOrder:b,renderOrder:p.renderOrder,z:w,group:_},t[e]=S):(S.id=p.id,S.object=p,S.geometry=v,S.material=y,S.groupOrder=b,S.renderOrder=p.renderOrder,S.z=w,S.group=_),e++,S}function o(p,v,y,b,w,_){const S=s(p,v,y,b,w,_);y.transmission>0?r.push(S):y.transparent===!0?i.push(S):n.push(S)}function c(p,v,y,b,w,_){const S=s(p,v,y,b,w,_);y.transmission>0?r.unshift(S):y.transparent===!0?i.unshift(S):n.unshift(S)}function u(p,v){n.length>1&&n.sort(p||d3e),r.length>1&&r.sort(v||CH),i.length>1&&i.sort(v||CH)}function h(){for(let p=e,v=t.length;p<v;p++){const y=t[p];if(y.id===null)break;y.id=null,y.object=null,y.geometry=null,y.material=null,y.group=null}}return{opaque:n,transmissive:r,transparent:i,init:a,push:o,unshift:c,finish:h,sort:u}}function h3e(){let t=new WeakMap;function e(r,i){const a=t.get(r);let s;return a===void 0?(s=new RH,t.set(r,[s])):i>=a.length?(s=new RH,a.push(s)):s=a[i],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function p3e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ne,color:new bt};break;case"SpotLight":n={position:new ne,direction:new ne,color:new bt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ne,color:new bt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ne,skyColor:new bt,groundColor:new bt};break;case"RectAreaLight":n={color:new bt,position:new ne,halfWidth:new ne,halfHeight:new ne};break}return t[e.id]=n,n}}}function m3e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ve};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ve};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ve,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let g3e=0;function v3e(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function y3e(t){const e=new p3e,n=m3e(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)r.probe.push(new ne);const i=new ne,a=new qt,s=new qt;function o(u){let h=0,p=0,v=0;for(let B=0;B<9;B++)r.probe[B].set(0,0,0);let y=0,b=0,w=0,_=0,S=0,E=0,T=0,P=0,R=0,D=0,I=0;u.sort(v3e);for(let B=0,U=u.length;B<U;B++){const z=u[B],q=z.color,W=z.intensity,ee=z.distance;let Q=null;if(z.shadow&&z.shadow.map&&(z.shadow.map.texture.format===Cp?Q=z.shadow.map.texture:Q=z.shadow.map.depthTexture||z.shadow.map.texture),z.isAmbientLight)h+=q.r*W,p+=q.g*W,v+=q.b*W;else if(z.isLightProbe){for(let V=0;V<9;V++)r.probe[V].addScaledVector(z.sh.coefficients[V],W);I++}else if(z.isDirectionalLight){const V=e.get(z);if(V.color.copy(z.color).multiplyScalar(z.intensity),z.castShadow){const $=z.shadow,Y=n.get(z);Y.shadowIntensity=$.intensity,Y.shadowBias=$.bias,Y.shadowNormalBias=$.normalBias,Y.shadowRadius=$.radius,Y.shadowMapSize=$.mapSize,r.directionalShadow[y]=Y,r.directionalShadowMap[y]=Q,r.directionalShadowMatrix[y]=z.shadow.matrix,E++}r.directional[y]=V,y++}else if(z.isSpotLight){const V=e.get(z);V.position.setFromMatrixPosition(z.matrixWorld),V.color.copy(q).multiplyScalar(W),V.distance=ee,V.coneCos=Math.cos(z.angle),V.penumbraCos=Math.cos(z.angle*(1-z.penumbra)),V.decay=z.decay,r.spot[w]=V;const $=z.shadow;if(z.map&&(r.spotLightMap[R]=z.map,R++,$.updateMatrices(z),z.castShadow&&D++),r.spotLightMatrix[w]=$.matrix,z.castShadow){const Y=n.get(z);Y.shadowIntensity=$.intensity,Y.shadowBias=$.bias,Y.shadowNormalBias=$.normalBias,Y.shadowRadius=$.radius,Y.shadowMapSize=$.mapSize,r.spotShadow[w]=Y,r.spotShadowMap[w]=Q,P++}w++}else if(z.isRectAreaLight){const V=e.get(z);V.color.copy(q).multiplyScalar(W),V.halfWidth.set(z.width*.5,0,0),V.halfHeight.set(0,z.height*.5,0),r.rectArea[_]=V,_++}else if(z.isPointLight){const V=e.get(z);if(V.color.copy(z.color).multiplyScalar(z.intensity),V.distance=z.distance,V.decay=z.decay,z.castShadow){const $=z.shadow,Y=n.get(z);Y.shadowIntensity=$.intensity,Y.shadowBias=$.bias,Y.shadowNormalBias=$.normalBias,Y.shadowRadius=$.radius,Y.shadowMapSize=$.mapSize,Y.shadowCameraNear=$.camera.near,Y.shadowCameraFar=$.camera.far,r.pointShadow[b]=Y,r.pointShadowMap[b]=Q,r.pointShadowMatrix[b]=z.shadow.matrix,T++}r.point[b]=V,b++}else if(z.isHemisphereLight){const V=e.get(z);V.skyColor.copy(z.color).multiplyScalar(W),V.groundColor.copy(z.groundColor).multiplyScalar(W),r.hemi[S]=V,S++}}_>0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=St.LTC_FLOAT_1,r.rectAreaLTC2=St.LTC_FLOAT_2):(r.rectAreaLTC1=St.LTC_HALF_1,r.rectAreaLTC2=St.LTC_HALF_2)),r.ambient[0]=h,r.ambient[1]=p,r.ambient[2]=v;const k=r.hash;(k.directionalLength!==y||k.pointLength!==b||k.spotLength!==w||k.rectAreaLength!==_||k.hemiLength!==S||k.numDirectionalShadows!==E||k.numPointShadows!==T||k.numSpotShadows!==P||k.numSpotMaps!==R||k.numLightProbes!==I)&&(r.directional.length=y,r.spot.length=w,r.rectArea.length=_,r.point.length=b,r.hemi.length=S,r.directionalShadow.length=E,r.directionalShadowMap.length=E,r.pointShadow.length=T,r.pointShadowMap.length=T,r.spotShadow.length=P,r.spotShadowMap.length=P,r.directionalShadowMatrix.length=E,r.pointShadowMatrix.length=T,r.spotLightMatrix.length=P+R-D,r.spotLightMap.length=R,r.numSpotLightShadowsWithMaps=D,r.numLightProbes=I,k.directionalLength=y,k.pointLength=b,k.spotLength=w,k.rectAreaLength=_,k.hemiLength=S,k.numDirectionalShadows=E,k.numPointShadows=T,k.numSpotShadows=P,k.numSpotMaps=R,k.numLightProbes=I,r.version=g3e++)}function c(u,h){let p=0,v=0,y=0,b=0,w=0;const _=h.matrixWorldInverse;for(let S=0,E=u.length;S<E;S++){const T=u[S];if(T.isDirectionalLight){const P=r.directional[p];P.direction.setFromMatrixPosition(T.matrixWorld),i.setFromMatrixPosition(T.target.matrixWorld),P.direction.sub(i),P.direction.transformDirection(_),p++}else if(T.isSpotLight){const P=r.spot[y];P.position.setFromMatrixPosition(T.matrixWorld),P.position.applyMatrix4(_),P.direction.setFromMatrixPosition(T.matrixWorld),i.setFromMatrixPosition(T.target.matrixWorld),P.direction.sub(i),P.direction.transformDirection(_),y++}else if(T.isRectAreaLight){const P=r.rectArea[b];P.position.setFromMatrixPosition(T.matrixWorld),P.position.applyMatrix4(_),s.identity(),a.copy(T.matrixWorld),a.premultiply(_),s.extractRotation(a),P.halfWidth.set(T.width*.5,0,0),P.halfHeight.set(0,T.height*.5,0),P.halfWidth.applyMatrix4(s),P.halfHeight.applyMatrix4(s),b++}else if(T.isPointLight){const P=r.point[v];P.position.setFromMatrixPosition(T.matrixWorld),P.position.applyMatrix4(_),v++}else if(T.isHemisphereLight){const P=r.hemi[w];P.direction.setFromMatrixPosition(T.matrixWorld),P.direction.transformDirection(_),w++}}}return{setup:o,setupView:c,state:r}}function OH(t){const e=new y3e(t),n=[],r=[];function i(h){u.camera=h,n.length=0,r.length=0}function a(h){n.push(h)}function s(h){r.push(h)}function o(){e.setup(n)}function c(h){e.setupView(n,h)}const u={lightsArray:n,shadowsArray:r,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:u,setupLights:o,setupLightsView:c,pushLight:a,pushShadow:s}}function x3e(t){let e=new WeakMap;function n(i,a=0){const s=e.get(i);let o;return s===void 0?(o=new OH(t),e.set(i,[o])):a>=s.length?(o=new OH(t),s.push(o)):o=s[a],o}function r(){e=new WeakMap}return{get:n,dispose:r}}const b3e=`void main() {
gl_Position = vec4( position, 1.0 );
}`,_3e=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
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 = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;
mean += distribution.x;
squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
#else
float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;
mean += depth;
squared_mean += depth * depth;
#endif
}
mean = mean / samples;
squared_mean = squared_mean / samples;
float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
}`,S3e=[new ne(1,0,0),new ne(-1,0,0),new ne(0,1,0),new ne(0,-1,0),new ne(0,0,1),new ne(0,0,-1)],A3e=[new ne(0,-1,0),new ne(0,-1,0),new ne(0,0,1),new ne(0,0,-1),new ne(0,-1,0),new ne(0,-1,0)],PH=new qt,dx=new ne,DD=new ne;function w3e(t,e,n){let r=new ly;const i=new Ve,a=new Ve,s=new mr,o=new ak,c=new sk,u={},h=n.maxTextureSize,p={[Vc]:ls,[ls]:Vc,[Fo]:Fo},v=new Yo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ve},radius:{value:4}},vertexShader:b3e,fragmentShader:_3e}),y=v.clone();y.defines.HORIZONTAL_PASS=1;const b=new an;b.setAttribute("position",new qn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new vi(b,v),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Yg;let S=this.type;this.render=function(D,I,k){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||D.length===0)return;D.type===Ix&&(xt("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),D.type=Yg);const B=t.getRenderTarget(),U=t.getActiveCubeFace(),z=t.getActiveMipmapLevel(),q=t.state;q.setBlending(Fc),q.buffers.depth.getReversed()===!0?q.buffers.color.setClear(0,0,0,0):q.buffers.color.setClear(1,1,1,1),q.buffers.depth.setTest(!0),q.setScissorTest(!1);const W=S!==this.type;W&&I.traverse(function(ee){ee.material&&(Array.isArray(ee.material)?ee.material.forEach(Q=>Q.needsUpdate=!0):ee.material.needsUpdate=!0)});for(let ee=0,Q=D.length;ee<Q;ee++){const V=D[ee],$=V.shadow;if($===void 0){xt("WebGLShadowMap:",V,"has no shadow.");continue}if($.autoUpdate===!1&&$.needsUpdate===!1)continue;i.copy($.mapSize);const Y=$.getFrameExtents();if(i.multiply(Y),a.copy($.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(a.x=Math.floor(h/Y.x),i.x=a.x*Y.x,$.mapSize.x=a.x),i.y>h&&(a.y=Math.floor(h/Y.y),i.y=a.y*Y.y,$.mapSize.y=a.y)),$.map===null||W===!0){if($.map!==null&&($.map.depthTexture!==null&&($.map.depthTexture.dispose(),$.map.depthTexture=null),$.map.dispose()),this.type===cp){if(V.isPointLight){xt("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}$.map=new to(i.x,i.y,{format:Cp,type:qc,minFilter:vr,magFilter:vr,generateMipmaps:!1}),$.map.texture.name=V.name+".shadowMap",$.map.depthTexture=new Fv(i.x,i.y,os),$.map.depthTexture.name=V.name+".shadowMapDepth",$.map.depthTexture.format=$c,$.map.depthTexture.compareFunction=null,$.map.depthTexture.minFilter=si,$.map.depthTexture.magFilter=si}else{V.isPointLight?($.map=new V5(i.x),$.map.depthTexture=new pY(i.x,Ko)):($.map=new to(i.x,i.y),$.map.depthTexture=new Fv(i.x,i.y,Ko)),$.map.depthTexture.name=V.name+".shadowMap",$.map.depthTexture.format=$c;const de=t.state.buffers.depth.getReversed();this.type===Yg?($.map.depthTexture.compareFunction=de?QE:ZE,$.map.depthTexture.minFilter=vr,$.map.depthTexture.magFilter=vr):($.map.depthTexture.compareFunction=null,$.map.depthTexture.minFilter=si,$.map.depthTexture.magFilter=si)}$.camera.updateProjectionMatrix()}const ie=$.map.isWebGLCubeRenderTarget?6:1;for(let de=0;de<ie;de++){if($.map.isWebGLCubeRenderTarget)t.setRenderTarget($.map,de),t.clear();else{de===0&&(t.setRenderTarget($.map),t.clear());const X=$.getViewport(de);s.set(a.x*X.x,a.y*X.y,a.x*X.z,a.y*X.w),q.viewport(s)}if(V.isPointLight){const X=$.camera,ae=$.matrix,ue=V.distance||X.far;ue!==X.far&&(X.far=ue,X.updateProjectionMatrix()),dx.setFromMatrixPosition(V.matrixWorld),X.position.copy(dx),DD.copy(X.position),DD.add(S3e[de]),X.up.copy(A3e[de]),X.lookAt(DD),X.updateMatrixWorld(),ae.makeTranslation(-dx.x,-dx.y,-dx.z),PH.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),$._frustum.setFromProjectionMatrix(PH,X.coordinateSystem,X.reversedDepth)}else $.updateMatrices(V);r=$.getFrustum(),P(I,k,$.camera,V,this.type)}$.isPointLightShadow!==!0&&this.type===cp&&E($,k),$.needsUpdate=!1}S=this.type,_.needsUpdate=!1,t.setRenderTarget(B,U,z)};function E(D,I){const k=e.update(w);v.defines.VSM_SAMPLES!==D.blurSamples&&(v.defines.VSM_SAMPLES=D.blurSamples,y.defines.VSM_SAMPLES=D.blurSamples,v.needsUpdate=!0,y.needsUpdate=!0),D.mapPass===null&&(D.mapPass=new to(i.x,i.y,{format:Cp,type:qc})),v.uniforms.shadow_pass.value=D.map.depthTexture,v.uniforms.resolution.value=D.mapSize,v.uniforms.radius.value=D.radius,t.setRenderTarget(D.mapPass),t.clear(),t.renderBufferDirect(I,null,k,v,w,null),y.uniforms.shadow_pass.value=D.mapPass.texture,y.uniforms.resolution.value=D.mapSize,y.uniforms.radius.value=D.radius,t.setRenderTarget(D.map),t.clear(),t.renderBufferDirect(I,null,k,y,w,null)}function T(D,I,k,B){let U=null;const z=k.isPointLight===!0?D.customDistanceMaterial:D.customDepthMaterial;if(z!==void 0)U=z;else if(U=k.isPointLight===!0?c:o,t.localClippingEnabled&&I.clipShadows===!0&&Array.isArray(I.clippingPlanes)&&I.clippingPlanes.length!==0||I.displacementMap&&I.displacementScale!==0||I.alphaMap&&I.alphaTest>0||I.map&&I.alphaTest>0||I.alphaToCoverage===!0){const q=U.uuid,W=I.uuid;let ee=u[q];ee===void 0&&(ee={},u[q]=ee);let Q=ee[W];Q===void 0&&(Q=U.clone(),ee[W]=Q,I.addEventListener("dispose",R)),U=Q}if(U.visible=I.visible,U.wireframe=I.wireframe,B===cp?U.side=I.shadowSide!==null?I.shadowSide:I.side:U.side=I.shadowSide!==null?I.shadowSide:p[I.side],U.alphaMap=I.alphaMap,U.alphaTest=I.alphaToCoverage===!0?.5:I.alphaTest,U.map=I.map,U.clipShadows=I.clipShadows,U.clippingPlanes=I.clippingPlanes,U.clipIntersection=I.clipIntersection,U.displacementMap=I.displacementMap,U.displacementScale=I.displacementScale,U.displacementBias=I.displacementBias,U.wireframeLinewidth=I.wireframeLinewidth,U.linewidth=I.linewidth,k.isPointLight===!0&&U.isMeshDistanceMaterial===!0){const q=t.properties.get(U);q.light=k}return U}function P(D,I,k,B,U){if(D.visible===!1)return;if(D.layers.test(I.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&U===cp)&&(!D.frustumCulled||r.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,D.matrixWorld);const W=e.update(D),ee=D.material;if(Array.isArray(ee)){const Q=W.groups;for(let V=0,$=Q.length;V<$;V++){const Y=Q[V],ie=ee[Y.materialIndex];if(ie&&ie.visible){const de=T(D,ie,B,U);D.onBeforeShadow(t,D,I,k,W,de,Y),t.renderBufferDirect(k,null,W,de,D,Y),D.onAfterShadow(t,D,I,k,W,de,Y)}}}else if(ee.visible){const Q=T(D,ee,B,U);D.onBeforeShadow(t,D,I,k,W,Q,null),t.renderBufferDirect(k,null,W,Q,D,null),D.onAfterShadow(t,D,I,k,W,Q,null)}}const q=D.children;for(let W=0,ee=q.length;W<ee;W++)P(q[W],I,k,B,U)}function R(D){D.target.removeEventListener("dispose",R);for(const k in u){const B=u[k],U=D.target.uuid;U in B&&(B[U].dispose(),delete B[U])}}}const M3e={[iM]:aM,[sM]:cM,[oM]:uM,[Tp]:lM,[aM]:iM,[cM]:sM,[uM]:oM,[lM]:Tp};function E3e(t,e){function n(){let oe=!1;const it=new mr;let et=null;const pt=new mr(0,0,0,0);return{setMask:function(tt){et!==tt&&!oe&&(t.colorMask(tt,tt,tt,tt),et=tt)},setLocked:function(tt){oe=tt},setClear:function(tt,He,at,jt,un){un===!0&&(tt*=jt,He*=jt,at*=jt),it.set(tt,He,at,jt),pt.equals(it)===!1&&(t.clearColor(tt,He,at,jt),pt.copy(it))},reset:function(){oe=!1,et=null,pt.set(-1,0,0,0)}}}function r(){let oe=!1,it=!1,et=null,pt=null,tt=null;return{setReversed:function(He){if(it!==He){const at=e.get("EXT_clip_control");He?at.clipControlEXT(at.LOWER_LEFT_EXT,at.ZERO_TO_ONE_EXT):at.clipControlEXT(at.LOWER_LEFT_EXT,at.NEGATIVE_ONE_TO_ONE_EXT),it=He;const jt=tt;tt=null,this.setClear(jt)}},getReversed:function(){return it},setTest:function(He){He?ve(t.DEPTH_TEST):We(t.DEPTH_TEST)},setMask:function(He){et!==He&&!oe&&(t.depthMask(He),et=He)},setFunc:function(He){if(it&&(He=M3e[He]),pt!==He){switch(He){case iM:t.depthFunc(t.NEVER);break;case aM:t.depthFunc(t.ALWAYS);break;case sM:t.depthFunc(t.LESS);break;case Tp:t.depthFunc(t.LEQUAL);break;case oM:t.depthFunc(t.EQUAL);break;case lM:t.depthFunc(t.GEQUAL);break;case cM:t.depthFunc(t.GREATER);break;case uM:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}pt=He}},setLocked:function(He){oe=He},setClear:function(He){tt!==He&&(it&&(He=1-He),t.clearDepth(He),tt=He)},reset:function(){oe=!1,et=null,pt=null,tt=null,it=!1}}}function i(){let oe=!1,it=null,et=null,pt=null,tt=null,He=null,at=null,jt=null,un=null;return{setTest:function(hn){oe||(hn?ve(t.STENCIL_TEST):We(t.STENCIL_TEST))},setMask:function(hn){it!==hn&&!oe&&(t.stencilMask(hn),it=hn)},setFunc:function(hn,Mr,oi){(et!==hn||pt!==Mr||tt!==oi)&&(t.stencilFunc(hn,Mr,oi),et=hn,pt=Mr,tt=oi)},setOp:function(hn,Mr,oi){(He!==hn||at!==Mr||jt!==oi)&&(t.stencilOp(hn,Mr,oi),He=hn,at=Mr,jt=oi)},setLocked:function(hn){oe=hn},setClear:function(hn){un!==hn&&(t.clearStencil(hn),un=hn)},reset:function(){oe=!1,it=null,et=null,pt=null,tt=null,He=null,at=null,jt=null,un=null}}}const a=new n,s=new r,o=new i,c=new WeakMap,u=new WeakMap;let h={},p={},v=new WeakMap,y=[],b=null,w=!1,_=null,S=null,E=null,T=null,P=null,R=null,D=null,I=new bt(0,0,0),k=0,B=!1,U=null,z=null,q=null,W=null,ee=null;const Q=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let V=!1,$=0;const Y=t.getParameter(t.VERSION);Y.indexOf("WebGL")!==-1?($=parseFloat(/^WebGL (\d)/.exec(Y)[1]),V=$>=1):Y.indexOf("OpenGL ES")!==-1&&($=parseFloat(/^OpenGL ES (\d)/.exec(Y)[1]),V=$>=2);let ie=null,de={};const X=t.getParameter(t.SCISSOR_BOX),ae=t.getParameter(t.VIEWPORT),ue=new mr().fromArray(X),Se=new mr().fromArray(ae);function $e(oe,it,et,pt){const tt=new Uint8Array(4),He=t.createTexture();t.bindTexture(oe,He),t.texParameteri(oe,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(oe,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let at=0;at<et;at++)oe===t.TEXTURE_3D||oe===t.TEXTURE_2D_ARRAY?t.texImage3D(it,0,t.RGBA,1,1,pt,0,t.RGBA,t.UNSIGNED_BYTE,tt):t.texImage2D(it+at,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,tt);return He}const me={};me[t.TEXTURE_2D]=$e(t.TEXTURE_2D,t.TEXTURE_2D,1),me[t.TEXTURE_CUBE_MAP]=$e(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),me[t.TEXTURE_2D_ARRAY]=$e(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),me[t.TEXTURE_3D]=$e(t.TEXTURE_3D,t.TEXTURE_3D,1,1),a.setClear(0,0,0,1),s.setClear(1),o.setClear(0),ve(t.DEPTH_TEST),s.setFunc(Tp),Be(!1),Ye(ZI),ve(t.CULL_FACE),we(Fc);function ve(oe){h[oe]!==!0&&(t.enable(oe),h[oe]=!0)}function We(oe){h[oe]!==!1&&(t.disable(oe),h[oe]=!1)}function _e(oe,it){return p[oe]!==it?(t.bindFramebuffer(oe,it),p[oe]=it,oe===t.DRAW_FRAMEBUFFER&&(p[t.FRAMEBUFFER]=it),oe===t.FRAMEBUFFER&&(p[t.DRAW_FRAMEBUFFER]=it),!0):!1}function Fe(oe,it){let et=y,pt=!1;if(oe){et=v.get(it),et===void 0&&(et=[],v.set(it,et));const tt=oe.textures;if(et.length!==tt.length||et[0]!==t.COLOR_ATTACHMENT0){for(let He=0,at=tt.length;He<at;He++)et[He]=t.COLOR_ATTACHMENT0+He;et.length=tt.length,pt=!0}}else et[0]!==t.BACK&&(et[0]=t.BACK,pt=!0);pt&&t.drawBuffers(et)}function Xe(oe){return b!==oe?(t.useProgram(oe),b=oe,!0):!1}const Re={[vd]:t.FUNC_ADD,[SK]:t.FUNC_SUBTRACT,[AK]:t.FUNC_REVERSE_SUBTRACT};Re[wK]=t.MIN,Re[MK]=t.MAX;const ot={[EK]:t.ZERO,[TK]:t.ONE,[CK]:t.SRC_COLOR,[nM]:t.SRC_ALPHA,[IK]:t.SRC_ALPHA_SATURATE,[DK]:t.DST_COLOR,[OK]:t.DST_ALPHA,[RK]:t.ONE_MINUS_SRC_COLOR,[rM]:t.ONE_MINUS_SRC_ALPHA,[NK]:t.ONE_MINUS_DST_COLOR,[PK]:t.ONE_MINUS_DST_ALPHA,[BK]:t.CONSTANT_COLOR,[LK]:t.ONE_MINUS_CONSTANT_COLOR,[kK]:t.CONSTANT_ALPHA,[FK]:t.ONE_MINUS_CONSTANT_ALPHA};function we(oe,it,et,pt,tt,He,at,jt,un,hn){if(oe===Fc){w===!0&&(We(t.BLEND),w=!1);return}if(w===!1&&(ve(t.BLEND),w=!0),oe!==_K){if(oe!==_||hn!==B){if((S!==vd||P!==vd)&&(t.blendEquation(t.FUNC_ADD),S=vd,P=vd),hn)switch(oe){case xp:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case QI:t.blendFunc(t.ONE,t.ONE);break;case eB:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case tB:t.blendFuncSeparate(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE);break;default:zt("WebGLState: Invalid blending: ",oe);break}else switch(oe){case xp:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case QI:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE,t.ONE,t.ONE);break;case eB:zt("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case tB:zt("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:zt("WebGLState: Invalid blending: ",oe);break}E=null,T=null,R=null,D=null,I.set(0,0,0),k=0,_=oe,B=hn}return}tt=tt||it,He=He||et,at=at||pt,(it!==S||tt!==P)&&(t.blendEquationSeparate(Re[it],Re[tt]),S=it,P=tt),(et!==E||pt!==T||He!==R||at!==D)&&(t.blendFuncSeparate(ot[et],ot[pt],ot[He],ot[at]),E=et,T=pt,R=He,D=at),(jt.equals(I)===!1||un!==k)&&(t.blendColor(jt.r,jt.g,jt.b,un),I.copy(jt),k=un),_=oe,B=!1}function Ue(oe,it){oe.side===Fo?We(t.CULL_FACE):ve(t.CULL_FACE);let et=oe.side===ls;it&&(et=!et),Be(et),oe.blending===xp&&oe.transparent===!1?we(Fc):we(oe.blending,oe.blendEquation,oe.blendSrc,oe.blendDst,oe.blendEquationAlpha,oe.blendSrcAlpha,oe.blendDstAlpha,oe.blendColor,oe.blendAlpha,oe.premultipliedAlpha),s.setFunc(oe.depthFunc),s.setTest(oe.depthTest),s.setMask(oe.depthWrite),a.setMask(oe.colorWrite);const pt=oe.stencilWrite;o.setTest(pt),pt&&(o.setMask(oe.stencilWriteMask),o.setFunc(oe.stencilFunc,oe.stencilRef,oe.stencilFuncMask),o.setOp(oe.stencilFail,oe.stencilZFail,oe.stencilZPass)),At(oe.polygonOffset,oe.polygonOffsetFactor,oe.polygonOffsetUnits),oe.alphaToCoverage===!0?ve(t.SAMPLE_ALPHA_TO_COVERAGE):We(t.SAMPLE_ALPHA_TO_COVERAGE)}function Be(oe){U!==oe&&(oe?t.frontFace(t.CW):t.frontFace(t.CCW),U=oe)}function Ye(oe){oe!==yK?(ve(t.CULL_FACE),oe!==z&&(oe===ZI?t.cullFace(t.BACK):oe===xK?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):We(t.CULL_FACE),z=oe}function re(oe){oe!==q&&(V&&t.lineWidth(oe),q=oe)}function At(oe,it,et){oe?(ve(t.POLYGON_OFFSET_FILL),(W!==it||ee!==et)&&(t.polygonOffset(it,et),W=it,ee=et)):We(t.POLYGON_OFFSET_FILL)}function ft(oe){oe?ve(t.SCISSOR_TEST):We(t.SCISSOR_TEST)}function Et(oe){oe===void 0&&(oe=t.TEXTURE0+Q-1),ie!==oe&&(t.activeTexture(oe),ie=oe)}function Ze(oe,it,et){et===void 0&&(ie===null?et=t.TEXTURE0+Q-1:et=ie);let pt=de[et];pt===void 0&&(pt={type:void 0,texture:void 0},de[et]=pt),(pt.type!==oe||pt.texture!==it)&&(ie!==et&&(t.activeTexture(et),ie=et),t.bindTexture(oe,it||me[oe]),pt.type=oe,pt.texture=it)}function te(){const oe=de[ie];oe!==void 0&&oe.type!==void 0&&(t.bindTexture(oe.type,null),oe.type=void 0,oe.texture=void 0)}function H(){try{t.compressedTexImage2D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function he(){try{t.compressedTexImage3D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function Ne(){try{t.texSubImage2D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function je(){try{t.texSubImage3D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function Ie(){try{t.compressedTexSubImage2D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function _t(){try{t.compressedTexSubImage3D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function lt(){try{t.texStorage2D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function Tt(){try{t.texStorage3D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function Gt(){try{t.texImage2D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function Qe(){try{t.texImage3D(...arguments)}catch(oe){zt("WebGLState:",oe)}}function st(oe){ue.equals(oe)===!1&&(t.scissor(oe.x,oe.y,oe.z,oe.w),ue.copy(oe))}function vt(oe){Se.equals(oe)===!1&&(t.viewport(oe.x,oe.y,oe.z,oe.w),Se.copy(oe))}function se(oe,it){let et=u.get(it);et===void 0&&(et=new WeakMap,u.set(it,et));let pt=et.get(oe);pt===void 0&&(pt=t.getUniformBlockIndex(it,oe.name),et.set(oe,pt))}function Ae(oe,it){const pt=u.get(it).get(oe);c.get(it)!==pt&&(t.uniformBlockBinding(it,pt,oe.__bindingPointIndex),c.set(it,pt))}function dt(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),s.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),h={},ie=null,de={},p={},v=new WeakMap,y=[],b=null,w=!1,_=null,S=null,E=null,T=null,P=null,R=null,D=null,I=new bt(0,0,0),k=0,B=!1,U=null,z=null,q=null,W=null,ee=null,ue.set(0,0,t.canvas.width,t.canvas.height),Se.set(0,0,t.canvas.width,t.canvas.height),a.reset(),s.reset(),o.reset()}return{buffers:{color:a,depth:s,stencil:o},enable:ve,disable:We,bindFramebuffer:_e,drawBuffers:Fe,useProgram:Xe,setBlending:we,setMaterial:Ue,setFlipSided:Be,setCullFace:Ye,setLineWidth:re,setPolygonOffset:At,setScissorTest:ft,activeTexture:Et,bindTexture:Ze,unbindTexture:te,compressedTexImage2D:H,compressedTexImage3D:he,texImage2D:Gt,texImage3D:Qe,updateUBOMapping:se,uniformBlockBinding:Ae,texStorage2D:lt,texStorage3D:Tt,texSubImage2D:Ne,texSubImage3D:je,compressedTexSubImage2D:Ie,compressedTexSubImage3D:_t,scissor:st,viewport:vt,reset:dt}}function T3e(t,e,n,r,i,a,s){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ve,h=new WeakMap;let p;const v=new WeakMap;let y=!1;try{y=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(te,H){return y?new OffscreenCanvas(te,H):Ib("canvas")}function w(te,H,he){let Ne=1;const je=Ze(te);if((je.width>he||je.height>he)&&(Ne=he/Math.max(je.width,je.height)),Ne<1)if(typeof HTMLImageElement<"u"&&te instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&te instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&te instanceof ImageBitmap||typeof VideoFrame<"u"&&te instanceof VideoFrame){const Ie=Math.floor(Ne*je.width),_t=Math.floor(Ne*je.height);p===void 0&&(p=b(Ie,_t));const lt=H?b(Ie,_t):p;return lt.width=Ie,lt.height=_t,lt.getContext("2d").drawImage(te,0,0,Ie,_t),xt("WebGLRenderer: Texture has been resized from ("+je.width+"x"+je.height+") to ("+Ie+"x"+_t+")."),lt}else return"data"in te&&xt("WebGLRenderer: Image in DataTexture is too big ("+je.width+"x"+je.height+")."),te;return te}function _(te){return te.generateMipmaps}function S(te){t.generateMipmap(te)}function E(te){return te.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:te.isWebGL3DRenderTarget?t.TEXTURE_3D:te.isWebGLArrayRenderTarget||te.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function T(te,H,he,Ne,je=!1){if(te!==null){if(t[te]!==void 0)return t[te];xt("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+te+"'")}let Ie=H;if(H===t.RED&&(he===t.FLOAT&&(Ie=t.R32F),he===t.HALF_FLOAT&&(Ie=t.R16F),he===t.UNSIGNED_BYTE&&(Ie=t.R8)),H===t.RED_INTEGER&&(he===t.UNSIGNED_BYTE&&(Ie=t.R8UI),he===t.UNSIGNED_SHORT&&(Ie=t.R16UI),he===t.UNSIGNED_INT&&(Ie=t.R32UI),he===t.BYTE&&(Ie=t.R8I),he===t.SHORT&&(Ie=t.R16I),he===t.INT&&(Ie=t.R32I)),H===t.RG&&(he===t.FLOAT&&(Ie=t.RG32F),he===t.HALF_FLOAT&&(Ie=t.RG16F),he===t.UNSIGNED_BYTE&&(Ie=t.RG8)),H===t.RG_INTEGER&&(he===t.UNSIGNED_BYTE&&(Ie=t.RG8UI),he===t.UNSIGNED_SHORT&&(Ie=t.RG16UI),he===t.UNSIGNED_INT&&(Ie=t.RG32UI),he===t.BYTE&&(Ie=t.RG8I),he===t.SHORT&&(Ie=t.RG16I),he===t.INT&&(Ie=t.RG32I)),H===t.RGB_INTEGER&&(he===t.UNSIGNED_BYTE&&(Ie=t.RGB8UI),he===t.UNSIGNED_SHORT&&(Ie=t.RGB16UI),he===t.UNSIGNED_INT&&(Ie=t.RGB32UI),he===t.BYTE&&(Ie=t.RGB8I),he===t.SHORT&&(Ie=t.RGB16I),he===t.INT&&(Ie=t.RGB32I)),H===t.RGBA_INTEGER&&(he===t.UNSIGNED_BYTE&&(Ie=t.RGBA8UI),he===t.UNSIGNED_SHORT&&(Ie=t.RGBA16UI),he===t.UNSIGNED_INT&&(Ie=t.RGBA32UI),he===t.BYTE&&(Ie=t.RGBA8I),he===t.SHORT&&(Ie=t.RGBA16I),he===t.INT&&(Ie=t.RGBA32I)),H===t.RGB&&(he===t.UNSIGNED_INT_5_9_9_9_REV&&(Ie=t.RGB9_E5),he===t.UNSIGNED_INT_10F_11F_11F_REV&&(Ie=t.R11F_G11F_B10F)),H===t.RGBA){const _t=je?Db:Fn.getTransfer(Ne);he===t.FLOAT&&(Ie=t.RGBA32F),he===t.HALF_FLOAT&&(Ie=t.RGBA16F),he===t.UNSIGNED_BYTE&&(Ie=_t===ir?t.SRGB8_ALPHA8:t.RGBA8),he===t.UNSIGNED_SHORT_4_4_4_4&&(Ie=t.RGBA4),he===t.UNSIGNED_SHORT_5_5_5_1&&(Ie=t.RGB5_A1)}return(Ie===t.R16F||Ie===t.R32F||Ie===t.RG16F||Ie===t.RG32F||Ie===t.RGBA16F||Ie===t.RGBA32F)&&e.get("EXT_color_buffer_float"),Ie}function P(te,H){let he;return te?H===null||H===Ko||H===Ov?he=t.DEPTH24_STENCIL8:H===os?he=t.DEPTH32F_STENCIL8:H===Rv&&(he=t.DEPTH24_STENCIL8,xt("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):H===null||H===Ko||H===Ov?he=t.DEPTH_COMPONENT24:H===os?he=t.DEPTH_COMPONENT32F:H===Rv&&(he=t.DEPTH_COMPONENT16),he}function R(te,H){return _(te)===!0||te.isFramebufferTexture&&te.minFilter!==si&&te.minFilter!==vr?Math.log2(Math.max(H.width,H.height))+1:te.mipmaps!==void 0&&te.mipmaps.length>0?te.mipmaps.length:te.isCompressedTexture&&Array.isArray(te.image)?H.mipmaps.length:1}function D(te){const H=te.target;H.removeEventListener("dispose",D),k(H),H.isVideoTexture&&h.delete(H)}function I(te){const H=te.target;H.removeEventListener("dispose",I),U(H)}function k(te){const H=r.get(te);if(H.__webglInit===void 0)return;const he=te.source,Ne=v.get(he);if(Ne){const je=Ne[H.__cacheKey];je.usedTimes--,je.usedTimes===0&&B(te),Object.keys(Ne).length===0&&v.delete(he)}r.remove(te)}function B(te){const H=r.get(te);t.deleteTexture(H.__webglTexture);const he=te.source,Ne=v.get(he);delete Ne[H.__cacheKey],s.memory.textures--}function U(te){const H=r.get(te);if(te.depthTexture&&(te.depthTexture.dispose(),r.remove(te.depthTexture)),te.isWebGLCubeRenderTarget)for(let Ne=0;Ne<6;Ne++){if(Array.isArray(H.__webglFramebuffer[Ne]))for(let je=0;je<H.__webglFramebuffer[Ne].length;je++)t.deleteFramebuffer(H.__webglFramebuffer[Ne][je]);else t.deleteFramebuffer(H.__webglFramebuffer[Ne]);H.__webglDepthbuffer&&t.deleteRenderbuffer(H.__webglDepthbuffer[Ne])}else{if(Array.isArray(H.__webglFramebuffer))for(let Ne=0;Ne<H.__webglFramebuffer.length;Ne++)t.deleteFramebuffer(H.__webglFramebuffer[Ne]);else t.deleteFramebuffer(H.__webglFramebuffer);if(H.__webglDepthbuffer&&t.deleteRenderbuffer(H.__webglDepthbuffer),H.__webglMultisampledFramebuffer&&t.deleteFramebuffer(H.__webglMultisampledFramebuffer),H.__webglColorRenderbuffer)for(let Ne=0;Ne<H.__webglColorRenderbuffer.length;Ne++)H.__webglColorRenderbuffer[Ne]&&t.deleteRenderbuffer(H.__webglColorRenderbuffer[Ne]);H.__webglDepthRenderbuffer&&t.deleteRenderbuffer(H.__webglDepthRenderbuffer)}const he=te.textures;for(let Ne=0,je=he.length;Ne<je;Ne++){const Ie=r.get(he[Ne]);Ie.__webglTexture&&(t.deleteTexture(Ie.__webglTexture),s.memory.textures--),r.remove(he[Ne])}r.remove(te)}let z=0;function q(){z=0}function W(){const te=z;return te>=i.maxTextures&&xt("WebGLTextures: Trying to use "+te+" texture units while this GPU supports only "+i.maxTextures),z+=1,te}function ee(te){const H=[];return H.push(te.wrapS),H.push(te.wrapT),H.push(te.wrapR||0),H.push(te.magFilter),H.push(te.minFilter),H.push(te.anisotropy),H.push(te.internalFormat),H.push(te.format),H.push(te.type),H.push(te.generateMipmaps),H.push(te.premultiplyAlpha),H.push(te.flipY),H.push(te.unpackAlignment),H.push(te.colorSpace),H.join()}function Q(te,H){const he=r.get(te);if(te.isVideoTexture&&ft(te),te.isRenderTargetTexture===!1&&te.isExternalTexture!==!0&&te.version>0&&he.__version!==te.version){const Ne=te.image;if(Ne===null)xt("WebGLRenderer: Texture marked for update but no image data found.");else if(Ne.complete===!1)xt("WebGLRenderer: Texture marked for update but image is incomplete");else{me(he,te,H);return}}else te.isExternalTexture&&(he.__webglTexture=te.sourceTexture?te.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,he.__webglTexture,t.TEXTURE0+H)}function V(te,H){const he=r.get(te);if(te.isRenderTargetTexture===!1&&te.version>0&&he.__version!==te.version){me(he,te,H);return}else te.isExternalTexture&&(he.__webglTexture=te.sourceTexture?te.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,he.__webglTexture,t.TEXTURE0+H)}function $(te,H){const he=r.get(te);if(te.isRenderTargetTexture===!1&&te.version>0&&he.__version!==te.version){me(he,te,H);return}n.bindTexture(t.TEXTURE_3D,he.__webglTexture,t.TEXTURE0+H)}function Y(te,H){const he=r.get(te);if(te.isCubeDepthTexture!==!0&&te.version>0&&he.__version!==te.version){ve(he,te,H);return}n.bindTexture(t.TEXTURE_CUBE_MAP,he.__webglTexture,t.TEXTURE0+H)}const ie={[Rd]:t.REPEAT,[ss]:t.CLAMP_TO_EDGE,[Cv]:t.MIRRORED_REPEAT},de={[si]:t.NEAREST,[VE]:t.NEAREST_MIPMAP_NEAREST,[up]:t.NEAREST_MIPMAP_LINEAR,[vr]:t.LINEAR,[Jg]:t.LINEAR_MIPMAP_NEAREST,[zo]:t.LINEAR_MIPMAP_LINEAR},X={[XK]:t.NEVER,[QK]:t.ALWAYS,[KK]:t.LESS,[ZE]:t.LEQUAL,[YK]:t.EQUAL,[QE]:t.GEQUAL,[JK]:t.GREATER,[ZK]:t.NOTEQUAL};function ae(te,H){if(H.type===os&&e.has("OES_texture_float_linear")===!1&&(H.magFilter===vr||H.magFilter===Jg||H.magFilter===up||H.magFilter===zo||H.minFilter===vr||H.minFilter===Jg||H.minFilter===up||H.minFilter===zo)&&xt("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(te,t.TEXTURE_WRAP_S,ie[H.wrapS]),t.texParameteri(te,t.TEXTURE_WRAP_T,ie[H.wrapT]),(te===t.TEXTURE_3D||te===t.TEXTURE_2D_ARRAY)&&t.texParameteri(te,t.TEXTURE_WRAP_R,ie[H.wrapR]),t.texParameteri(te,t.TEXTURE_MAG_FILTER,de[H.magFilter]),t.texParameteri(te,t.TEXTURE_MIN_FILTER,de[H.minFilter]),H.compareFunction&&(t.texParameteri(te,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(te,t.TEXTURE_COMPARE_FUNC,X[H.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(H.magFilter===si||H.minFilter!==up&&H.minFilter!==zo||H.type===os&&e.has("OES_texture_float_linear")===!1)return;if(H.anisotropy>1||r.get(H).__currentAnisotropy){const he=e.get("EXT_texture_filter_anisotropic");t.texParameterf(te,he.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(H.anisotropy,i.getMaxAnisotropy())),r.get(H).__currentAnisotropy=H.anisotropy}}}function ue(te,H){let he=!1;te.__webglInit===void 0&&(te.__webglInit=!0,H.addEventListener("dispose",D));const Ne=H.source;let je=v.get(Ne);je===void 0&&(je={},v.set(Ne,je));const Ie=ee(H);if(Ie!==te.__cacheKey){je[Ie]===void 0&&(je[Ie]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,he=!0),je[Ie].usedTimes++;const _t=je[te.__cacheKey];_t!==void 0&&(je[te.__cacheKey].usedTimes--,_t.usedTimes===0&&B(H)),te.__cacheKey=Ie,te.__webglTexture=je[Ie].texture}return he}function Se(te,H,he){return Math.floor(Math.floor(te/he)/H)}function $e(te,H,he,Ne){const Ie=te.updateRanges;if(Ie.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,H.width,H.height,he,Ne,H.data);else{Ie.sort((Qe,st)=>Qe.start-st.start);let _t=0;for(let Qe=1;Qe<Ie.length;Qe++){const st=Ie[_t],vt=Ie[Qe],se=st.start+st.count,Ae=Se(vt.start,H.width,4),dt=Se(st.start,H.width,4);vt.start<=se+1&&Ae===dt&&Se(vt.start+vt.count-1,H.width,4)===Ae?st.count=Math.max(st.count,vt.start+vt.count-st.start):(++_t,Ie[_t]=vt)}Ie.length=_t+1;const lt=t.getParameter(t.UNPACK_ROW_LENGTH),Tt=t.getParameter(t.UNPACK_SKIP_PIXELS),Gt=t.getParameter(t.UNPACK_SKIP_ROWS);t.pixelStorei(t.UNPACK_ROW_LENGTH,H.width);for(let Qe=0,st=Ie.length;Qe<st;Qe++){const vt=Ie[Qe],se=Math.floor(vt.start/4),Ae=Math.ceil(vt.count/4),dt=se%H.width,oe=Math.floor(se/H.width),it=Ae,et=1;t.pixelStorei(t.UNPACK_SKIP_PIXELS,dt),t.pixelStorei(t.UNPACK_SKIP_ROWS,oe),n.texSubImage2D(t.TEXTURE_2D,0,dt,oe,it,et,he,Ne,H.data)}te.clearUpdateRanges(),t.pixelStorei(t.UNPACK_ROW_LENGTH,lt),t.pixelStorei(t.UNPACK_SKIP_PIXELS,Tt),t.pixelStorei(t.UNPACK_SKIP_ROWS,Gt)}}function me(te,H,he){let Ne=t.TEXTURE_2D;(H.isDataArrayTexture||H.isCompressedArrayTexture)&&(Ne=t.TEXTURE_2D_ARRAY),H.isData3DTexture&&(Ne=t.TEXTURE_3D);const je=ue(te,H),Ie=H.source;n.bindTexture(Ne,te.__webglTexture,t.TEXTURE0+he);const _t=r.get(Ie);if(Ie.version!==_t.__version||je===!0){n.activeTexture(t.TEXTURE0+he);const lt=Fn.getPrimaries(Fn.workingColorSpace),Tt=H.colorSpace===zu?null:Fn.getPrimaries(H.colorSpace),Gt=H.colorSpace===zu||lt===Tt?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,H.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,H.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Gt);let Qe=w(H.image,!1,i.maxTextureSize);Qe=Et(H,Qe);const st=a.convert(H.format,H.colorSpace),vt=a.convert(H.type);let se=T(H.internalFormat,st,vt,H.colorSpace,H.isVideoTexture);ae(Ne,H);let Ae;const dt=H.mipmaps,oe=H.isVideoTexture!==!0,it=_t.__version===void 0||je===!0,et=Ie.dataReady,pt=R(H,Qe);if(H.isDepthTexture)se=P(H.format===Sd,H.type),it&&(oe?n.texStorage2D(t.TEXTURE_2D,1,se,Qe.width,Qe.height):n.texImage2D(t.TEXTURE_2D,0,se,Qe.width,Qe.height,0,st,vt,null));else if(H.isDataTexture)if(dt.length>0){oe&&it&&n.texStorage2D(t.TEXTURE_2D,pt,se,dt[0].width,dt[0].height);for(let tt=0,He=dt.length;tt<He;tt++)Ae=dt[tt],oe?et&&n.texSubImage2D(t.TEXTURE_2D,tt,0,0,Ae.width,Ae.height,st,vt,Ae.data):n.texImage2D(t.TEXTURE_2D,tt,se,Ae.width,Ae.height,0,st,vt,Ae.data);H.generateMipmaps=!1}else oe?(it&&n.texStorage2D(t.TEXTURE_2D,pt,se,Qe.width,Qe.height),et&&$e(H,Qe,st,vt)):n.texImage2D(t.TEXTURE_2D,0,se,Qe.width,Qe.height,0,st,vt,Qe.data);else if(H.isCompressedTexture)if(H.isCompressedArrayTexture){oe&&it&&n.texStorage3D(t.TEXTURE_2D_ARRAY,pt,se,dt[0].width,dt[0].height,Qe.depth);for(let tt=0,He=dt.length;tt<He;tt++)if(Ae=dt[tt],H.format!==Ba)if(st!==null)if(oe){if(et)if(H.layerUpdates.size>0){const at=fB(Ae.width,Ae.height,H.format,H.type);for(const jt of H.layerUpdates){const un=Ae.data.subarray(jt*at/Ae.data.BYTES_PER_ELEMENT,(jt+1)*at/Ae.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,tt,0,0,jt,Ae.width,Ae.height,1,st,un)}H.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,tt,0,0,0,Ae.width,Ae.height,Qe.depth,st,Ae.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,tt,se,Ae.width,Ae.height,Qe.depth,0,Ae.data,0,0);else xt("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else oe?et&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,tt,0,0,0,Ae.width,Ae.height,Qe.depth,st,vt,Ae.data):n.texImage3D(t.TEXTURE_2D_ARRAY,tt,se,Ae.width,Ae.height,Qe.depth,0,st,vt,Ae.data)}else{oe&&it&&n.texStorage2D(t.TEXTURE_2D,pt,se,dt[0].width,dt[0].height);for(let tt=0,He=dt.length;tt<He;tt++)Ae=dt[tt],H.format!==Ba?st!==null?oe?et&&n.compressedTexSubImage2D(t.TEXTURE_2D,tt,0,0,Ae.width,Ae.height,st,Ae.data):n.compressedTexImage2D(t.TEXTURE_2D,tt,se,Ae.width,Ae.height,0,Ae.data):xt("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):oe?et&&n.texSubImage2D(t.TEXTURE_2D,tt,0,0,Ae.width,Ae.height,st,vt,Ae.data):n.texImage2D(t.TEXTURE_2D,tt,se,Ae.width,Ae.height,0,st,vt,Ae.data)}else if(H.isDataArrayTexture)if(oe){if(it&&n.texStorage3D(t.TEXTURE_2D_ARRAY,pt,se,Qe.width,Qe.height,Qe.depth),et)if(H.layerUpdates.size>0){const tt=fB(Qe.width,Qe.height,H.format,H.type);for(const He of H.layerUpdates){const at=Qe.data.subarray(He*tt/Qe.data.BYTES_PER_ELEMENT,(He+1)*tt/Qe.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,He,Qe.width,Qe.height,1,st,vt,at)}H.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Qe.width,Qe.height,Qe.depth,st,vt,Qe.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,se,Qe.width,Qe.height,Qe.depth,0,st,vt,Qe.data);else if(H.isData3DTexture)oe?(it&&n.texStorage3D(t.TEXTURE_3D,pt,se,Qe.width,Qe.height,Qe.depth),et&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Qe.width,Qe.height,Qe.depth,st,vt,Qe.data)):n.texImage3D(t.TEXTURE_3D,0,se,Qe.width,Qe.height,Qe.depth,0,st,vt,Qe.data);else if(H.isFramebufferTexture){if(it)if(oe)n.texStorage2D(t.TEXTURE_2D,pt,se,Qe.width,Qe.height);else{let tt=Qe.width,He=Qe.height;for(let at=0;at<pt;at++)n.texImage2D(t.TEXTURE_2D,at,se,tt,He,0,st,vt,null),tt>>=1,He>>=1}}else if(dt.length>0){if(oe&&it){const tt=Ze(dt[0]);n.texStorage2D(t.TEXTURE_2D,pt,se,tt.width,tt.height)}for(let tt=0,He=dt.length;tt<He;tt++)Ae=dt[tt],oe?et&&n.texSubImage2D(t.TEXTURE_2D,tt,0,0,st,vt,Ae):n.texImage2D(t.TEXTURE_2D,tt,se,st,vt,Ae);H.generateMipmaps=!1}else if(oe){if(it){const tt=Ze(Qe);n.texStorage2D(t.TEXTURE_2D,pt,se,tt.width,tt.height)}et&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,st,vt,Qe)}else n.texImage2D(t.TEXTURE_2D,0,se,st,vt,Qe);_(H)&&S(Ne),_t.__version=Ie.version,H.onUpdate&&H.onUpdate(H)}te.__version=H.version}function ve(te,H,he){if(H.image.length!==6)return;const Ne=ue(te,H),je=H.source;n.bindTexture(t.TEXTURE_CUBE_MAP,te.__webglTexture,t.TEXTURE0+he);const Ie=r.get(je);if(je.version!==Ie.__version||Ne===!0){n.activeTexture(t.TEXTURE0+he);const _t=Fn.getPrimaries(Fn.workingColorSpace),lt=H.colorSpace===zu?null:Fn.getPrimaries(H.colorSpace),Tt=H.colorSpace===zu||_t===lt?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,H.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,H.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Tt);const Gt=H.isCompressedTexture||H.image[0].isCompressedTexture,Qe=H.image[0]&&H.image[0].isDataTexture,st=[];for(let He=0;He<6;He++)!Gt&&!Qe?st[He]=w(H.image[He],!0,i.maxCubemapSize):st[He]=Qe?H.image[He].image:H.image[He],st[He]=Et(H,st[He]);const vt=st[0],se=a.convert(H.format,H.colorSpace),Ae=a.convert(H.type),dt=T(H.internalFormat,se,Ae,H.colorSpace),oe=H.isVideoTexture!==!0,it=Ie.__version===void 0||Ne===!0,et=je.dataReady;let pt=R(H,vt);ae(t.TEXTURE_CUBE_MAP,H);let tt;if(Gt){oe&&it&&n.texStorage2D(t.TEXTURE_CUBE_MAP,pt,dt,vt.width,vt.height);for(let He=0;He<6;He++){tt=st[He].mipmaps;for(let at=0;at<tt.length;at++){const jt=tt[at];H.format!==Ba?se!==null?oe?et&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,at,0,0,jt.width,jt.height,se,jt.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,at,dt,jt.width,jt.height,0,jt.data):xt("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):oe?et&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,at,0,0,jt.width,jt.height,se,Ae,jt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,at,dt,jt.width,jt.height,0,se,Ae,jt.data)}}}else{if(tt=H.mipmaps,oe&&it){tt.length>0&&pt++;const He=Ze(st[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,pt,dt,He.width,He.height)}for(let He=0;He<6;He++)if(Qe){oe?et&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,0,0,0,st[He].width,st[He].height,se,Ae,st[He].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,0,dt,st[He].width,st[He].height,0,se,Ae,st[He].data);for(let at=0;at<tt.length;at++){const un=tt[at].image[He].image;oe?et&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,at+1,0,0,un.width,un.height,se,Ae,un.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,at+1,dt,un.width,un.height,0,se,Ae,un.data)}}else{oe?et&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,0,0,0,se,Ae,st[He]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,0,dt,se,Ae,st[He]);for(let at=0;at<tt.length;at++){const jt=tt[at];oe?et&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,at+1,0,0,se,Ae,jt.image[He]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,at+1,dt,se,Ae,jt.image[He])}}}_(H)&&S(t.TEXTURE_CUBE_MAP),Ie.__version=je.version,H.onUpdate&&H.onUpdate(H)}te.__version=H.version}function We(te,H,he,Ne,je,Ie){const _t=a.convert(he.format,he.colorSpace),lt=a.convert(he.type),Tt=T(he.internalFormat,_t,lt,he.colorSpace),Gt=r.get(H),Qe=r.get(he);if(Qe.__renderTarget=H,!Gt.__hasExternalTextures){const st=Math.max(1,H.width>>Ie),vt=Math.max(1,H.height>>Ie);je===t.TEXTURE_3D||je===t.TEXTURE_2D_ARRAY?n.texImage3D(je,Ie,Tt,st,vt,H.depth,0,_t,lt,null):n.texImage2D(je,Ie,Tt,st,vt,0,_t,lt,null)}n.bindFramebuffer(t.FRAMEBUFFER,te),At(H)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,Ne,je,Qe.__webglTexture,0,re(H)):(je===t.TEXTURE_2D||je>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&je<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,Ne,je,Qe.__webglTexture,Ie),n.bindFramebuffer(t.FRAMEBUFFER,null)}function _e(te,H,he){if(t.bindRenderbuffer(t.RENDERBUFFER,te),H.depthBuffer){const Ne=H.depthTexture,je=Ne&&Ne.isDepthTexture?Ne.type:null,Ie=P(H.stencilBuffer,je),_t=H.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;At(H)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,re(H),Ie,H.width,H.height):he?t.renderbufferStorageMultisample(t.RENDERBUFFER,re(H),Ie,H.width,H.height):t.renderbufferStorage(t.RENDERBUFFER,Ie,H.width,H.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,_t,t.RENDERBUFFER,te)}else{const Ne=H.textures;for(let je=0;je<Ne.length;je++){const Ie=Ne[je],_t=a.convert(Ie.format,Ie.colorSpace),lt=a.convert(Ie.type),Tt=T(Ie.internalFormat,_t,lt,Ie.colorSpace);At(H)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,re(H),Tt,H.width,H.height):he?t.renderbufferStorageMultisample(t.RENDERBUFFER,re(H),Tt,H.width,H.height):t.renderbufferStorage(t.RENDERBUFFER,Tt,H.width,H.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function Fe(te,H,he){const Ne=H.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(t.FRAMEBUFFER,te),!(H.depthTexture&&H.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const je=r.get(H.depthTexture);if(je.__renderTarget=H,(!je.__webglTexture||H.depthTexture.image.width!==H.width||H.depthTexture.image.height!==H.height)&&(H.depthTexture.image.width=H.width,H.depthTexture.image.height=H.height,H.depthTexture.needsUpdate=!0),Ne){if(je.__webglInit===void 0&&(je.__webglInit=!0,H.depthTexture.addEventListener("dispose",D)),je.__webglTexture===void 0){je.__webglTexture=t.createTexture(),n.bindTexture(t.TEXTURE_CUBE_MAP,je.__webglTexture),ae(t.TEXTURE_CUBE_MAP,H.depthTexture);const Gt=a.convert(H.depthTexture.format),Qe=a.convert(H.depthTexture.type);let st;H.depthTexture.format===$c?st=t.DEPTH_COMPONENT24:H.depthTexture.format===Sd&&(st=t.DEPTH24_STENCIL8);for(let vt=0;vt<6;vt++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+vt,0,st,H.width,H.height,0,Gt,Qe,null)}}else Q(H.depthTexture,0);const Ie=je.__webglTexture,_t=re(H),lt=Ne?t.TEXTURE_CUBE_MAP_POSITIVE_X+he:t.TEXTURE_2D,Tt=H.depthTexture.format===Sd?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(H.depthTexture.format===$c)At(H)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,Tt,lt,Ie,0,_t):t.framebufferTexture2D(t.FRAMEBUFFER,Tt,lt,Ie,0);else if(H.depthTexture.format===Sd)At(H)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,Tt,lt,Ie,0,_t):t.framebufferTexture2D(t.FRAMEBUFFER,Tt,lt,Ie,0);else throw new Error("Unknown depthTexture format")}function Xe(te){const H=r.get(te),he=te.isWebGLCubeRenderTarget===!0;if(H.__boundDepthTexture!==te.depthTexture){const Ne=te.depthTexture;if(H.__depthDisposeCallback&&H.__depthDisposeCallback(),Ne){const je=()=>{delete H.__boundDepthTexture,delete H.__depthDisposeCallback,Ne.removeEventListener("dispose",je)};Ne.addEventListener("dispose",je),H.__depthDisposeCallback=je}H.__boundDepthTexture=Ne}if(te.depthTexture&&!H.__autoAllocateDepthBuffer)if(he)for(let Ne=0;Ne<6;Ne++)Fe(H.__webglFramebuffer[Ne],te,Ne);else{const Ne=te.texture.mipmaps;Ne&&Ne.length>0?Fe(H.__webglFramebuffer[0],te,0):Fe(H.__webglFramebuffer,te,0)}else if(he){H.__webglDepthbuffer=[];for(let Ne=0;Ne<6;Ne++)if(n.bindFramebuffer(t.FRAMEBUFFER,H.__webglFramebuffer[Ne]),H.__webglDepthbuffer[Ne]===void 0)H.__webglDepthbuffer[Ne]=t.createRenderbuffer(),_e(H.__webglDepthbuffer[Ne],te,!1);else{const je=te.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ie=H.__webglDepthbuffer[Ne];t.bindRenderbuffer(t.RENDERBUFFER,Ie),t.framebufferRenderbuffer(t.FRAMEBUFFER,je,t.RENDERBUFFER,Ie)}}else{const Ne=te.texture.mipmaps;if(Ne&&Ne.length>0?n.bindFramebuffer(t.FRAMEBUFFER,H.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,H.__webglFramebuffer),H.__webglDepthbuffer===void 0)H.__webglDepthbuffer=t.createRenderbuffer(),_e(H.__webglDepthbuffer,te,!1);else{const je=te.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ie=H.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,Ie),t.framebufferRenderbuffer(t.FRAMEBUFFER,je,t.RENDERBUFFER,Ie)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function Re(te,H,he){const Ne=r.get(te);H!==void 0&&We(Ne.__webglFramebuffer,te,te.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),he!==void 0&&Xe(te)}function ot(te){const H=te.texture,he=r.get(te),Ne=r.get(H);te.addEventListener("dispose",I);const je=te.textures,Ie=te.isWebGLCubeRenderTarget===!0,_t=je.length>1;if(_t||(Ne.__webglTexture===void 0&&(Ne.__webglTexture=t.createTexture()),Ne.__version=H.version,s.memory.textures++),Ie){he.__webglFramebuffer=[];for(let lt=0;lt<6;lt++)if(H.mipmaps&&H.mipmaps.length>0){he.__webglFramebuffer[lt]=[];for(let Tt=0;Tt<H.mipmaps.length;Tt++)he.__webglFramebuffer[lt][Tt]=t.createFramebuffer()}else he.__webglFramebuffer[lt]=t.createFramebuffer()}else{if(H.mipmaps&&H.mipmaps.length>0){he.__webglFramebuffer=[];for(let lt=0;lt<H.mipmaps.length;lt++)he.__webglFramebuffer[lt]=t.createFramebuffer()}else he.__webglFramebuffer=t.createFramebuffer();if(_t)for(let lt=0,Tt=je.length;lt<Tt;lt++){const Gt=r.get(je[lt]);Gt.__webglTexture===void 0&&(Gt.__webglTexture=t.createTexture(),s.memory.textures++)}if(te.samples>0&&At(te)===!1){he.__webglMultisampledFramebuffer=t.createFramebuffer(),he.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,he.__webglMultisampledFramebuffer);for(let lt=0;lt<je.length;lt++){const Tt=je[lt];he.__webglColorRenderbuffer[lt]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,he.__webglColorRenderbuffer[lt]);const Gt=a.convert(Tt.format,Tt.colorSpace),Qe=a.convert(Tt.type),st=T(Tt.internalFormat,Gt,Qe,Tt.colorSpace,te.isXRRenderTarget===!0),vt=re(te);t.renderbufferStorageMultisample(t.RENDERBUFFER,vt,st,te.width,te.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+lt,t.RENDERBUFFER,he.__webglColorRenderbuffer[lt])}t.bindRenderbuffer(t.RENDERBUFFER,null),te.depthBuffer&&(he.__webglDepthRenderbuffer=t.createRenderbuffer(),_e(he.__webglDepthRenderbuffer,te,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(Ie){n.bindTexture(t.TEXTURE_CUBE_MAP,Ne.__webglTexture),ae(t.TEXTURE_CUBE_MAP,H);for(let lt=0;lt<6;lt++)if(H.mipmaps&&H.mipmaps.length>0)for(let Tt=0;Tt<H.mipmaps.length;Tt++)We(he.__webglFramebuffer[lt][Tt],te,H,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+lt,Tt);else We(he.__webglFramebuffer[lt],te,H,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0);_(H)&&S(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(_t){for(let lt=0,Tt=je.length;lt<Tt;lt++){const Gt=je[lt],Qe=r.get(Gt);let st=t.TEXTURE_2D;(te.isWebGL3DRenderTarget||te.isWebGLArrayRenderTarget)&&(st=te.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(st,Qe.__webglTexture),ae(st,Gt),We(he.__webglFramebuffer,te,Gt,t.COLOR_ATTACHMENT0+lt,st,0),_(Gt)&&S(st)}n.unbindTexture()}else{let lt=t.TEXTURE_2D;if((te.isWebGL3DRenderTarget||te.isWebGLArrayRenderTarget)&&(lt=te.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(lt,Ne.__webglTexture),ae(lt,H),H.mipmaps&&H.mipmaps.length>0)for(let Tt=0;Tt<H.mipmaps.length;Tt++)We(he.__webglFramebuffer[Tt],te,H,t.COLOR_ATTACHMENT0,lt,Tt);else We(he.__webglFramebuffer,te,H,t.COLOR_ATTACHMENT0,lt,0);_(H)&&S(lt),n.unbindTexture()}te.depthBuffer&&Xe(te)}function we(te){const H=te.textures;for(let he=0,Ne=H.length;he<Ne;he++){const je=H[he];if(_(je)){const Ie=E(te),_t=r.get(je).__webglTexture;n.bindTexture(Ie,_t),S(Ie),n.unbindTexture()}}}const Ue=[],Be=[];function Ye(te){if(te.samples>0){if(At(te)===!1){const H=te.textures,he=te.width,Ne=te.height;let je=t.COLOR_BUFFER_BIT;const Ie=te.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,_t=r.get(te),lt=H.length>1;if(lt)for(let Gt=0;Gt<H.length;Gt++)n.bindFramebuffer(t.FRAMEBUFFER,_t.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Gt,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,_t.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Gt,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,_t.__webglMultisampledFramebuffer);const Tt=te.texture.mipmaps;Tt&&Tt.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,_t.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,_t.__webglFramebuffer);for(let Gt=0;Gt<H.length;Gt++){if(te.resolveDepthBuffer&&(te.depthBuffer&&(je|=t.DEPTH_BUFFER_BIT),te.stencilBuffer&&te.resolveStencilBuffer&&(je|=t.STENCIL_BUFFER_BIT)),lt){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,_t.__webglColorRenderbuffer[Gt]);const Qe=r.get(H[Gt]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Qe,0)}t.blitFramebuffer(0,0,he,Ne,0,0,he,Ne,je,t.NEAREST),c===!0&&(Ue.length=0,Be.length=0,Ue.push(t.COLOR_ATTACHMENT0+Gt),te.depthBuffer&&te.resolveDepthBuffer===!1&&(Ue.push(Ie),Be.push(Ie),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,Be)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,Ue))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),lt)for(let Gt=0;Gt<H.length;Gt++){n.bindFramebuffer(t.FRAMEBUFFER,_t.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Gt,t.RENDERBUFFER,_t.__webglColorRenderbuffer[Gt]);const Qe=r.get(H[Gt]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,_t.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Gt,t.TEXTURE_2D,Qe,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,_t.__webglMultisampledFramebuffer)}else if(te.depthBuffer&&te.resolveDepthBuffer===!1&&c){const H=te.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[H])}}}function re(te){return Math.min(i.maxSamples,te.samples)}function At(te){const H=r.get(te);return te.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&H.__useRenderToTexture!==!1}function ft(te){const H=s.render.frame;h.get(te)!==H&&(h.set(te,H),te.update())}function Et(te,H){const he=te.colorSpace,Ne=te.format,je=te.type;return te.isCompressedTexture===!0||te.isVideoTexture===!0||he!==Od&&he!==zu&&(Fn.getTransfer(he)===ir?(Ne!==Ba||je!==ts)&&xt("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):zt("WebGLTextures: Unsupported texture color space:",he)),H}function Ze(te){return typeof HTMLImageElement<"u"&&te instanceof HTMLImageElement?(u.width=te.naturalWidth||te.width,u.height=te.naturalHeight||te.height):typeof VideoFrame<"u"&&te instanceof VideoFrame?(u.width=te.displayWidth,u.height=te.displayHeight):(u.width=te.width,u.height=te.height),u}this.allocateTextureUnit=W,this.resetTextureUnits=q,this.setTexture2D=Q,this.setTexture2DArray=V,this.setTexture3D=$,this.setTextureCube=Y,this.rebindTextures=Re,this.setupRenderTarget=ot,this.updateRenderTargetMipmap=we,this.updateMultisampleRenderTarget=Ye,this.setupDepthRenderbuffer=Xe,this.setupFrameBufferTexture=We,this.useMultisampledRTT=At,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function rJ(t,e){function n(r,i=zu){let a;const s=Fn.getTransfer(i);if(r===ts)return t.UNSIGNED_BYTE;if(r===qE)return t.UNSIGNED_SHORT_4_4_4_4;if(r===$E)return t.UNSIGNED_SHORT_5_5_5_1;if(r===I5)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===B5)return t.UNSIGNED_INT_10F_11F_11F_REV;if(r===D5)return t.BYTE;if(r===N5)return t.SHORT;if(r===Rv)return t.UNSIGNED_SHORT;if(r===WE)return t.INT;if(r===Ko)return t.UNSIGNED_INT;if(r===os)return t.FLOAT;if(r===qc)return t.HALF_FLOAT;if(r===L5)return t.ALPHA;if(r===k5)return t.RGB;if(r===Ba)return t.RGBA;if(r===$c)return t.DEPTH_COMPONENT;if(r===Sd)return t.DEPTH_STENCIL;if(r===XE)return t.RED;if(r===l1)return t.RED_INTEGER;if(r===Cp)return t.RG;if(r===KE)return t.RG_INTEGER;if(r===YE)return t.RGBA_INTEGER;if(r===Bx||r===Lx||r===kx||r===Fx)if(s===ir)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Bx)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Lx)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===kx)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Fx)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Bx)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Lx)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===kx)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Fx)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===fM||r===dM||r===hM||r===pM)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===fM)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===dM)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===hM)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===pM)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===mM||r===gM||r===vM||r===yM||r===xM||r===bM||r===_M)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===mM||r===gM)return s===ir?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===vM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC;if(r===yM)return a.COMPRESSED_R11_EAC;if(r===xM)return a.COMPRESSED_SIGNED_R11_EAC;if(r===bM)return a.COMPRESSED_RG11_EAC;if(r===_M)return a.COMPRESSED_SIGNED_RG11_EAC}else return null;if(r===SM||r===AM||r===wM||r===MM||r===EM||r===TM||r===CM||r===RM||r===OM||r===PM||r===DM||r===NM||r===IM||r===BM)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===SM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===AM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===wM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===MM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===EM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===TM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===CM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===RM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===OM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===PM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===DM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===NM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===IM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===BM)return s===ir?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===LM||r===kM||r===FM)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===LM)return s===ir?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===kM)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===FM)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===UM||r===jM||r===zM||r===GM)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===UM)return a.COMPRESSED_RED_RGTC1_EXT;if(r===jM)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===zM)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===GM)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Ov?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}const C3e=`
void main() {
gl_Position = vec4( position, 1.0 );
}`,R3e=`
uniform sampler2DArray depthColor;
uniform float depthWidth;
uniform float depthHeight;
void main() {
vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
if ( coord.x >= 1.0 ) {
gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
} else {
gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
}
}`;class O3e{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const r=new J5(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new Yo({vertexShader:C3e,fragmentShader:R3e,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new vi(new cy(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class P3e extends Yc{constructor(e,n){super();const r=this;let i=null,a=1,s=null,o="local-floor",c=1,u=null,h=null,p=null,v=null,y=null,b=null;const w=typeof XRWebGLBinding<"u",_=new O3e,S={},E=n.getContextAttributes();let T=null,P=null;const R=[],D=[],I=new Ve;let k=null;const B=new jr;B.viewport=new mr;const U=new jr;U.viewport=new mr;const z=[B,U],q=new qY;let W=null,ee=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(me){let ve=R[me];return ve===void 0&&(ve=new UA,R[me]=ve),ve.getTargetRaySpace()},this.getControllerGrip=function(me){let ve=R[me];return ve===void 0&&(ve=new UA,R[me]=ve),ve.getGripSpace()},this.getHand=function(me){let ve=R[me];return ve===void 0&&(ve=new UA,R[me]=ve),ve.getHandSpace()};function Q(me){const ve=D.indexOf(me.inputSource);if(ve===-1)return;const We=R[ve];We!==void 0&&(We.update(me.inputSource,me.frame,u||s),We.dispatchEvent({type:me.type,data:me.inputSource}))}function V(){i.removeEventListener("select",Q),i.removeEventListener("selectstart",Q),i.removeEventListener("selectend",Q),i.removeEventListener("squeeze",Q),i.removeEventListener("squeezestart",Q),i.removeEventListener("squeezeend",Q),i.removeEventListener("end",V),i.removeEventListener("inputsourceschange",$);for(let me=0;me<R.length;me++){const ve=D[me];ve!==null&&(D[me]=null,R[me].disconnect(ve))}W=null,ee=null,_.reset();for(const me in S)delete S[me];e.setRenderTarget(T),y=null,v=null,p=null,i=null,P=null,$e.stop(),r.isPresenting=!1,e.setPixelRatio(k),e.setSize(I.width,I.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(me){a=me,r.isPresenting===!0&&xt("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(me){o=me,r.isPresenting===!0&&xt("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||s},this.setReferenceSpace=function(me){u=me},this.getBaseLayer=function(){return v!==null?v:y},this.getBinding=function(){return p===null&&w&&(p=new XRWebGLBinding(i,n)),p},this.getFrame=function(){return b},this.getSession=function(){return i},this.setSession=async function(me){if(i=me,i!==null){if(T=e.getRenderTarget(),i.addEventListener("select",Q),i.addEventListener("selectstart",Q),i.addEventListener("selectend",Q),i.addEventListener("squeeze",Q),i.addEventListener("squeezestart",Q),i.addEventListener("squeezeend",Q),i.addEventListener("end",V),i.addEventListener("inputsourceschange",$),E.xrCompatible!==!0&&await n.makeXRCompatible(),k=e.getPixelRatio(),e.getSize(I),w&&"createProjectionLayer"in XRWebGLBinding.prototype){let We=null,_e=null,Fe=null;E.depth&&(Fe=E.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,We=E.stencil?Sd:$c,_e=E.stencil?Ov:Ko);const Xe={colorFormat:n.RGBA8,depthFormat:Fe,scaleFactor:a};p=this.getBinding(),v=p.createProjectionLayer(Xe),i.updateRenderState({layers:[v]}),e.setPixelRatio(1),e.setSize(v.textureWidth,v.textureHeight,!1),P=new to(v.textureWidth,v.textureHeight,{format:Ba,type:ts,depthTexture:new Fv(v.textureWidth,v.textureHeight,_e,void 0,void 0,void 0,void 0,void 0,void 0,We),stencilBuffer:E.stencil,colorSpace:e.outputColorSpace,samples:E.antialias?4:0,resolveDepthBuffer:v.ignoreDepthValues===!1,resolveStencilBuffer:v.ignoreDepthValues===!1})}else{const We={antialias:E.antialias,alpha:!0,depth:E.depth,stencil:E.stencil,framebufferScaleFactor:a};y=new XRWebGLLayer(i,n,We),i.updateRenderState({baseLayer:y}),e.setPixelRatio(1),e.setSize(y.framebufferWidth,y.framebufferHeight,!1),P=new to(y.framebufferWidth,y.framebufferHeight,{format:Ba,type:ts,colorSpace:e.outputColorSpace,stencilBuffer:E.stencil,resolveDepthBuffer:y.ignoreDepthValues===!1,resolveStencilBuffer:y.ignoreDepthValues===!1})}P.isXRRenderTarget=!0,this.setFoveation(c),u=null,s=await i.requestReferenceSpace(o),$e.setContext(i),$e.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function $(me){for(let ve=0;ve<me.removed.length;ve++){const We=me.removed[ve],_e=D.indexOf(We);_e>=0&&(D[_e]=null,R[_e].disconnect(We))}for(let ve=0;ve<me.added.length;ve++){const We=me.added[ve];let _e=D.indexOf(We);if(_e===-1){for(let Xe=0;Xe<R.length;Xe++)if(Xe>=D.length){D.push(We),_e=Xe;break}else if(D[Xe]===null){D[Xe]=We,_e=Xe;break}if(_e===-1)break}const Fe=R[_e];Fe&&Fe.connect(We)}}const Y=new ne,ie=new ne;function de(me,ve,We){Y.setFromMatrixPosition(ve.matrixWorld),ie.setFromMatrixPosition(We.matrixWorld);const _e=Y.distanceTo(ie),Fe=ve.projectionMatrix.elements,Xe=We.projectionMatrix.elements,Re=Fe[14]/(Fe[10]-1),ot=Fe[14]/(Fe[10]+1),we=(Fe[9]+1)/Fe[5],Ue=(Fe[9]-1)/Fe[5],Be=(Fe[8]-1)/Fe[0],Ye=(Xe[8]+1)/Xe[0],re=Re*Be,At=Re*Ye,ft=_e/(-Be+Ye),Et=ft*-Be;if(ve.matrixWorld.decompose(me.position,me.quaternion,me.scale),me.translateX(Et),me.translateZ(ft),me.matrixWorld.compose(me.position,me.quaternion,me.scale),me.matrixWorldInverse.copy(me.matrixWorld).invert(),Fe[10]===-1)me.projectionMatrix.copy(ve.projectionMatrix),me.projectionMatrixInverse.copy(ve.projectionMatrixInverse);else{const Ze=Re+ft,te=ot+ft,H=re-Et,he=At+(_e-Et),Ne=we*ot/te*Ze,je=Ue*ot/te*Ze;me.projectionMatrix.makePerspective(H,he,Ne,je,Ze,te),me.projectionMatrixInverse.copy(me.projectionMatrix).invert()}}function X(me,ve){ve===null?me.matrixWorld.copy(me.matrix):me.matrixWorld.multiplyMatrices(ve.matrixWorld,me.matrix),me.matrixWorldInverse.copy(me.matrixWorld).invert()}this.updateCamera=function(me){if(i===null)return;let ve=me.near,We=me.far;_.texture!==null&&(_.depthNear>0&&(ve=_.depthNear),_.depthFar>0&&(We=_.depthFar)),q.near=U.near=B.near=ve,q.far=U.far=B.far=We,(W!==q.near||ee!==q.far)&&(i.updateRenderState({depthNear:q.near,depthFar:q.far}),W=q.near,ee=q.far),q.layers.mask=me.layers.mask|6,B.layers.mask=q.layers.mask&3,U.layers.mask=q.layers.mask&5;const _e=me.parent,Fe=q.cameras;X(q,_e);for(let Xe=0;Xe<Fe.length;Xe++)X(Fe[Xe],_e);Fe.length===2?de(q,B,U):q.projectionMatrix.copy(B.projectionMatrix),ae(me,q,_e)};function ae(me,ve,We){We===null?me.matrix.copy(ve.matrixWorld):(me.matrix.copy(We.matrixWorld),me.matrix.invert(),me.matrix.multiply(ve.matrixWorld)),me.matrix.decompose(me.position,me.quaternion,me.scale),me.updateMatrixWorld(!0),me.projectionMatrix.copy(ve.projectionMatrix),me.projectionMatrixInverse.copy(ve.projectionMatrixInverse),me.isPerspectiveCamera&&(me.fov=Bv*2*Math.atan(1/me.projectionMatrix.elements[5]),me.zoom=1)}this.getCamera=function(){return q},this.getFoveation=function(){if(!(v===null&&y===null))return c},this.setFoveation=function(me){c=me,v!==null&&(v.fixedFoveation=me),y!==null&&y.fixedFoveation!==void 0&&(y.fixedFoveation=me)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(q)},this.getCameraTexture=function(me){return S[me]};let ue=null;function Se(me,ve){if(h=ve.getViewerPose(u||s),b=ve,h!==null){const We=h.views;y!==null&&(e.setRenderTargetFramebuffer(P,y.framebuffer),e.setRenderTarget(P));let _e=!1;We.length!==q.cameras.length&&(q.cameras.length=0,_e=!0);for(let ot=0;ot<We.length;ot++){const we=We[ot];let Ue=null;if(y!==null)Ue=y.getViewport(we);else{const Ye=p.getViewSubImage(v,we);Ue=Ye.viewport,ot===0&&(e.setRenderTargetTextures(P,Ye.colorTexture,Ye.depthStencilTexture),e.setRenderTarget(P))}let Be=z[ot];Be===void 0&&(Be=new jr,Be.layers.enable(ot),Be.viewport=new mr,z[ot]=Be),Be.matrix.fromArray(we.transform.matrix),Be.matrix.decompose(Be.position,Be.quaternion,Be.scale),Be.projectionMatrix.fromArray(we.projectionMatrix),Be.projectionMatrixInverse.copy(Be.projectionMatrix).invert(),Be.viewport.set(Ue.x,Ue.y,Ue.width,Ue.height),ot===0&&(q.matrix.copy(Be.matrix),q.matrix.decompose(q.position,q.quaternion,q.scale)),_e===!0&&q.cameras.push(Be)}const Fe=i.enabledFeatures;if(Fe&&Fe.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&w){p=r.getBinding();const ot=p.getDepthInformation(We[0]);ot&&ot.isValid&&ot.texture&&_.init(ot,i.renderState)}if(Fe&&Fe.includes("camera-access")&&w){e.state.unbindTexture(),p=r.getBinding();for(let ot=0;ot<We.length;ot++){const we=We[ot].camera;if(we){let Ue=S[we];Ue||(Ue=new J5,S[we]=Ue);const Be=p.getCameraImage(we);Ue.sourceTexture=Be}}}}for(let We=0;We<R.length;We++){const _e=D[We],Fe=R[We];_e!==null&&Fe!==void 0&&Fe.update(_e,ve,u||s)}ue&&ue(me,ve),ve.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:ve}),b=null}const $e=new ZY;$e.setAnimationLoop(Se),this.setAnimationLoop=function(me){ue=me},this.dispose=function(){}}}const $h=new ro,D3e=new qt;function N3e(t,e){function n(_,S){_.matrixAutoUpdate===!0&&_.updateMatrix(),S.value.copy(_.matrix)}function r(_,S){S.color.getRGB(_.fogColor.value,sY(t)),S.isFog?(_.fogNear.value=S.near,_.fogFar.value=S.far):S.isFogExp2&&(_.fogDensity.value=S.density)}function i(_,S,E,T,P){S.isMeshBasicMaterial||S.isMeshLambertMaterial?a(_,S):S.isMeshToonMaterial?(a(_,S),p(_,S)):S.isMeshPhongMaterial?(a(_,S),h(_,S)):S.isMeshStandardMaterial?(a(_,S),v(_,S),S.isMeshPhysicalMaterial&&y(_,S,P)):S.isMeshMatcapMaterial?(a(_,S),b(_,S)):S.isMeshDepthMaterial?a(_,S):S.isMeshDistanceMaterial?(a(_,S),w(_,S)):S.isMeshNormalMaterial?a(_,S):S.isLineBasicMaterial?(s(_,S),S.isLineDashedMaterial&&o(_,S)):S.isPointsMaterial?c(_,S,E,T):S.isSpriteMaterial?u(_,S):S.isShadowMaterial?(_.color.value.copy(S.color),_.opacity.value=S.opacity):S.isShaderMaterial&&(S.uniformsNeedUpdate=!1)}function a(_,S){_.opacity.value=S.opacity,S.color&&_.diffuse.value.copy(S.color),S.emissive&&_.emissive.value.copy(S.emissive).multiplyScalar(S.emissiveIntensity),S.map&&(_.map.value=S.map,n(S.map,_.mapTransform)),S.alphaMap&&(_.alphaMap.value=S.alphaMap,n(S.alphaMap,_.alphaMapTransform)),S.bumpMap&&(_.bumpMap.value=S.bumpMap,n(S.bumpMap,_.bumpMapTransform),_.bumpScale.value=S.bumpScale,S.side===ls&&(_.bumpScale.value*=-1)),S.normalMap&&(_.normalMap.value=S.normalMap,n(S.normalMap,_.normalMapTransform),_.normalScale.value.copy(S.normalScale),S.side===ls&&_.normalScale.value.negate()),S.displacementMap&&(_.displacementMap.value=S.displacementMap,n(S.displacementMap,_.displacementMapTransform),_.displacementScale.value=S.displacementScale,_.displacementBias.value=S.displacementBias),S.emissiveMap&&(_.emissiveMap.value=S.emissiveMap,n(S.emissiveMap,_.emissiveMapTransform)),S.specularMap&&(_.specularMap.value=S.specularMap,n(S.specularMap,_.specularMapTransform)),S.alphaTest>0&&(_.alphaTest.value=S.alphaTest);const E=e.get(S),T=E.envMap,P=E.envMapRotation;T&&(_.envMap.value=T,$h.copy(P),$h.x*=-1,$h.y*=-1,$h.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&($h.y*=-1,$h.z*=-1),_.envMapRotation.value.setFromMatrix4(D3e.makeRotationFromEuler($h)),_.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=S.reflectivity,_.ior.value=S.ior,_.refractionRatio.value=S.refractionRatio),S.lightMap&&(_.lightMap.value=S.lightMap,_.lightMapIntensity.value=S.lightMapIntensity,n(S.lightMap,_.lightMapTransform)),S.aoMap&&(_.aoMap.value=S.aoMap,_.aoMapIntensity.value=S.aoMapIntensity,n(S.aoMap,_.aoMapTransform))}function s(_,S){_.diffuse.value.copy(S.color),_.opacity.value=S.opacity,S.map&&(_.map.value=S.map,n(S.map,_.mapTransform))}function o(_,S){_.dashSize.value=S.dashSize,_.totalSize.value=S.dashSize+S.gapSize,_.scale.value=S.scale}function c(_,S,E,T){_.diffuse.value.copy(S.color),_.opacity.value=S.opacity,_.size.value=S.size*E,_.scale.value=T*.5,S.map&&(_.map.value=S.map,n(S.map,_.uvTransform)),S.alphaMap&&(_.alphaMap.value=S.alphaMap,n(S.alphaMap,_.alphaMapTransform)),S.alphaTest>0&&(_.alphaTest.value=S.alphaTest)}function u(_,S){_.diffuse.value.copy(S.color),_.opacity.value=S.opacity,_.rotation.value=S.rotation,S.map&&(_.map.value=S.map,n(S.map,_.mapTransform)),S.alphaMap&&(_.alphaMap.value=S.alphaMap,n(S.alphaMap,_.alphaMapTransform)),S.alphaTest>0&&(_.alphaTest.value=S.alphaTest)}function h(_,S){_.specular.value.copy(S.specular),_.shininess.value=Math.max(S.shininess,1e-4)}function p(_,S){S.gradientMap&&(_.gradientMap.value=S.gradientMap)}function v(_,S){_.metalness.value=S.metalness,S.metalnessMap&&(_.metalnessMap.value=S.metalnessMap,n(S.metalnessMap,_.metalnessMapTransform)),_.roughness.value=S.roughness,S.roughnessMap&&(_.roughnessMap.value=S.roughnessMap,n(S.roughnessMap,_.roughnessMapTransform)),S.envMap&&(_.envMapIntensity.value=S.envMapIntensity)}function y(_,S,E){_.ior.value=S.ior,S.sheen>0&&(_.sheenColor.value.copy(S.sheenColor).multiplyScalar(S.sheen),_.sheenRoughness.value=S.sheenRoughness,S.sheenColorMap&&(_.sheenColorMap.value=S.sheenColorMap,n(S.sheenColorMap,_.sheenColorMapTransform)),S.sheenRoughnessMap&&(_.sheenRoughnessMap.value=S.sheenRoughnessMap,n(S.sheenRoughnessMap,_.sheenRoughnessMapTransform))),S.clearcoat>0&&(_.clearcoat.value=S.clearcoat,_.clearcoatRoughness.value=S.clearcoatRoughness,S.clearcoatMap&&(_.clearcoatMap.value=S.clearcoatMap,n(S.clearcoatMap,_.clearcoatMapTransform)),S.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=S.clearcoatRoughnessMap,n(S.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),S.clearcoatNormalMap&&(_.clearcoatNormalMap.value=S.clearcoatNormalMap,n(S.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(S.clearcoatNormalScale),S.side===ls&&_.clearcoatNormalScale.value.negate())),S.dispersion>0&&(_.dispersion.value=S.dispersion),S.iridescence>0&&(_.iridescence.value=S.iridescence,_.iridescenceIOR.value=S.iridescenceIOR,_.iridescenceThicknessMinimum.value=S.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=S.iridescenceThicknessRange[1],S.iridescenceMap&&(_.iridescenceMap.value=S.iridescenceMap,n(S.iridescenceMap,_.iridescenceMapTransform)),S.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=S.iridescenceThicknessMap,n(S.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),S.transmission>0&&(_.transmission.value=S.transmission,_.transmissionSamplerMap.value=E.texture,_.transmissionSamplerSize.value.set(E.width,E.height),S.transmissionMap&&(_.transmissionMap.value=S.transmissionMap,n(S.transmissionMap,_.transmissionMapTransform)),_.thickness.value=S.thickness,S.thicknessMap&&(_.thicknessMap.value=S.thicknessMap,n(S.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=S.attenuationDistance,_.attenuationColor.value.copy(S.attenuationColor)),S.anisotropy>0&&(_.anisotropyVector.value.set(S.anisotropy*Math.cos(S.anisotropyRotation),S.anisotropy*Math.sin(S.anisotropyRotation)),S.anisotropyMap&&(_.anisotropyMap.value=S.anisotropyMap,n(S.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=S.specularIntensity,_.specularColor.value.copy(S.specularColor),S.specularColorMap&&(_.specularColorMap.value=S.specularColorMap,n(S.specularColorMap,_.specularColorMapTransform)),S.specularIntensityMap&&(_.specularIntensityMap.value=S.specularIntensityMap,n(S.specularIntensityMap,_.specularIntensityMapTransform))}function b(_,S){S.matcap&&(_.matcap.value=S.matcap)}function w(_,S){const E=e.get(S).light;_.referencePosition.value.setFromMatrixPosition(E.matrixWorld),_.nearDistance.value=E.shadow.camera.near,_.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function I3e(t,e,n,r){let i={},a={},s=[];const o=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function c(E,T){const P=T.program;r.uniformBlockBinding(E,P)}function u(E,T){let P=i[E.id];P===void 0&&(b(E),P=h(E),i[E.id]=P,E.addEventListener("dispose",_));const R=T.program;r.updateUBOMapping(E,R);const D=e.render.frame;a[E.id]!==D&&(v(E),a[E.id]=D)}function h(E){const T=p();E.__bindingPointIndex=T;const P=t.createBuffer(),R=E.__size,D=E.usage;return t.bindBuffer(t.UNIFORM_BUFFER,P),t.bufferData(t.UNIFORM_BUFFER,R,D),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,T,P),P}function p(){for(let E=0;E<o;E++)if(s.indexOf(E)===-1)return s.push(E),E;return zt("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function v(E){const T=i[E.id],P=E.uniforms,R=E.__cache;t.bindBuffer(t.UNIFORM_BUFFER,T);for(let D=0,I=P.length;D<I;D++){const k=Array.isArray(P[D])?P[D]:[P[D]];for(let B=0,U=k.length;B<U;B++){const z=k[B];if(y(z,D,B,R)===!0){const q=z.__offset,W=Array.isArray(z.value)?z.value:[z.value];let ee=0;for(let Q=0;Q<W.length;Q++){const V=W[Q],$=w(V);typeof V=="number"||typeof V=="boolean"?(z.__data[0]=V,t.bufferSubData(t.UNIFORM_BUFFER,q+ee,z.__data)):V.isMatrix3?(z.__data[0]=V.elements[0],z.__data[1]=V.elements[1],z.__data[2]=V.elements[2],z.__data[3]=0,z.__data[4]=V.elements[3],z.__data[5]=V.elements[4],z.__data[6]=V.elements[5],z.__data[7]=0,z.__data[8]=V.elements[6],z.__data[9]=V.elements[7],z.__data[10]=V.elements[8],z.__data[11]=0):(V.toArray(z.__data,ee),ee+=$.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,q,z.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function y(E,T,P,R){const D=E.value,I=T+"_"+P;if(R[I]===void 0)return typeof D=="number"||typeof D=="boolean"?R[I]=D:R[I]=D.clone(),!0;{const k=R[I];if(typeof D=="number"||typeof D=="boolean"){if(k!==D)return R[I]=D,!0}else if(k.equals(D)===!1)return k.copy(D),!0}return!1}function b(E){const T=E.uniforms;let P=0;const R=16;for(let I=0,k=T.length;I<k;I++){const B=Array.isArray(T[I])?T[I]:[T[I]];for(let U=0,z=B.length;U<z;U++){const q=B[U],W=Array.isArray(q.value)?q.value:[q.value];for(let ee=0,Q=W.length;ee<Q;ee++){const V=W[ee],$=w(V),Y=P%R,ie=Y%$.boundary,de=Y+ie;P+=ie,de!==0&&R-de<$.storage&&(P+=R-de),q.__data=new Float32Array($.storage/Float32Array.BYTES_PER_ELEMENT),q.__offset=P,P+=$.storage}}}const D=P%R;return D>0&&(P+=R-D),E.__size=P,E.__cache={},this}function w(E){const T={boundary:0,storage:0};return typeof E=="number"||typeof E=="boolean"?(T.boundary=4,T.storage=4):E.isVector2?(T.boundary=8,T.storage=8):E.isVector3||E.isColor?(T.boundary=16,T.storage=12):E.isVector4?(T.boundary=16,T.storage=16):E.isMatrix3?(T.boundary=48,T.storage=48):E.isMatrix4?(T.boundary=64,T.storage=64):E.isTexture?xt("WebGLRenderer: Texture samplers can not be part of an uniforms group."):xt("WebGLRenderer: Unsupported uniform value type.",E),T}function _(E){const T=E.target;T.removeEventListener("dispose",_);const P=s.indexOf(T.__bindingPointIndex);s.splice(P,1),t.deleteBuffer(i[T.id]),delete i[T.id],delete a[T.id]}function S(){for(const E in i)t.deleteBuffer(i[E]);s=[],i={},a={}}return{bind:c,update:u,dispose:S}}const B3e=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Ec=null;function L3e(){return Ec===null&&(Ec=new Fl(B3e,16,16,Cp,qc),Ec.name="DFG_LUT",Ec.minFilter=vr,Ec.magFilter=vr,Ec.wrapS=ss,Ec.wrapT=ss,Ec.generateMipmaps=!1,Ec.needsUpdate=!0),Ec}class iJ{constructor(e={}){const{canvas:n=nY(),context:r=null,depth:i=!0,stencil:a=!1,alpha:s=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:u=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:p=!1,reversedDepthBuffer:v=!1,outputBufferType:y=ts}=e;this.isWebGLRenderer=!0;let b;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");b=r.getContextAttributes().alpha}else b=s;const w=y,_=new Set([YE,KE,l1]),S=new Set([ts,Ko,Rv,Ov,qE,$E]),E=new Uint32Array(4),T=new Int32Array(4);let P=null,R=null;const D=[],I=[];let k=null;this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Wo,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const B=this;let U=!1;this._outputColorSpace=Pa;let z=0,q=0,W=null,ee=-1,Q=null;const V=new mr,$=new mr;let Y=null;const ie=new bt(0);let de=0,X=n.width,ae=n.height,ue=1,Se=null,$e=null;const me=new mr(0,0,X,ae),ve=new mr(0,0,X,ae);let We=!1;const _e=new ly;let Fe=!1,Xe=!1;const Re=new qt,ot=new ne,we=new mr,Ue={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Be=!1;function Ye(){return W===null?ue:1}let re=r;function At(J,ge){return n.getContext(J,ge)}try{const J={alpha:!0,depth:i,stencil:a,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:u,powerPreference:h,failIfMajorPerformanceCaveat:p};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${s1}`),n.addEventListener("webglcontextlost",jt,!1),n.addEventListener("webglcontextrestored",un,!1),n.addEventListener("webglcontextcreationerror",hn,!1),re===null){const ge="webgl2";if(re=At(ge,J),re===null)throw At(ge)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(J){throw zt("WebGLRenderer: "+J.message),J}let ft,Et,Ze,te,H,he,Ne,je,Ie,_t,lt,Tt,Gt,Qe,st,vt,se,Ae,dt,oe,it,et,pt,tt;function He(){ft=new kOe(re),ft.init(),et=new rJ(re,ft),Et=new COe(re,ft,e,et),Ze=new E3e(re,ft),Et.reversedDepthBuffer&&v&&Ze.buffers.depth.setReversed(!0),te=new jOe(re),H=new f3e,he=new T3e(re,ft,Ze,H,Et,et,te),Ne=new OOe(B),je=new LOe(B),Ie=new VTe(re),pt=new EOe(re,Ie),_t=new FOe(re,Ie,te,pt),lt=new GOe(re,_t,Ie,te),dt=new zOe(re,Et,he),vt=new ROe(H),Tt=new u3e(B,Ne,je,ft,Et,pt,vt),Gt=new N3e(B,H),Qe=new h3e,st=new x3e(ft),Ae=new MOe(B,Ne,je,Ze,lt,b,c),se=new w3e(B,lt,Et),tt=new I3e(re,te,Et,Ze),oe=new TOe(re,ft,te),it=new UOe(re,ft,te),te.programs=Tt.programs,B.capabilities=Et,B.extensions=ft,B.properties=H,B.renderLists=Qe,B.shadowMap=se,B.state=Ze,B.info=te}He(),w!==ts&&(k=new VOe(w,n.width,n.height,i,a));const at=new P3e(B,re);this.xr=at,this.getContext=function(){return re},this.getContextAttributes=function(){return re.getContextAttributes()},this.forceContextLoss=function(){const J=ft.get("WEBGL_lose_context");J&&J.loseContext()},this.forceContextRestore=function(){const J=ft.get("WEBGL_lose_context");J&&J.restoreContext()},this.getPixelRatio=function(){return ue},this.setPixelRatio=function(J){J!==void 0&&(ue=J,this.setSize(X,ae,!1))},this.getSize=function(J){return J.set(X,ae)},this.setSize=function(J,ge,Pe=!0){if(at.isPresenting){xt("WebGLRenderer: Can't change size while VR device is presenting.");return}X=J,ae=ge,n.width=Math.floor(J*ue),n.height=Math.floor(ge*ue),Pe===!0&&(n.style.width=J+"px",n.style.height=ge+"px"),k!==null&&k.setSize(n.width,n.height),this.setViewport(0,0,J,ge)},this.getDrawingBufferSize=function(J){return J.set(X*ue,ae*ue).floor()},this.setDrawingBufferSize=function(J,ge,Pe){X=J,ae=ge,ue=Pe,n.width=Math.floor(J*Pe),n.height=Math.floor(ge*Pe),this.setViewport(0,0,J,ge)},this.setEffects=function(J){if(w===ts){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(J){for(let ge=0;ge<J.length;ge++)if(J[ge].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}k.setEffects(J||[])},this.getCurrentViewport=function(J){return J.copy(V)},this.getViewport=function(J){return J.copy(me)},this.setViewport=function(J,ge,Pe,Te){J.isVector4?me.set(J.x,J.y,J.z,J.w):me.set(J,ge,Pe,Te),Ze.viewport(V.copy(me).multiplyScalar(ue).round())},this.getScissor=function(J){return J.copy(ve)},this.setScissor=function(J,ge,Pe,Te){J.isVector4?ve.set(J.x,J.y,J.z,J.w):ve.set(J,ge,Pe,Te),Ze.scissor($.copy(ve).multiplyScalar(ue).round())},this.getScissorTest=function(){return We},this.setScissorTest=function(J){Ze.setScissorTest(We=J)},this.setOpaqueSort=function(J){Se=J},this.setTransparentSort=function(J){$e=J},this.getClearColor=function(J){return J.copy(Ae.getClearColor())},this.setClearColor=function(){Ae.setClearColor(...arguments)},this.getClearAlpha=function(){return Ae.getClearAlpha()},this.setClearAlpha=function(){Ae.setClearAlpha(...arguments)},this.clear=function(J=!0,ge=!0,Pe=!0){let Te=0;if(J){let xe=!1;if(W!==null){const ct=W.texture.format;xe=_.has(ct)}if(xe){const ct=W.texture.type,wt=S.has(ct),rt=Ae.getClearColor(),Ct=Ae.getClearAlpha(),Rt=rt.r,Ht=rt.g,Dt=rt.b;wt?(E[0]=Rt,E[1]=Ht,E[2]=Dt,E[3]=Ct,re.clearBufferuiv(re.COLOR,0,E)):(T[0]=Rt,T[1]=Ht,T[2]=Dt,T[3]=Ct,re.clearBufferiv(re.COLOR,0,T))}else Te|=re.COLOR_BUFFER_BIT}ge&&(Te|=re.DEPTH_BUFFER_BIT),Pe&&(Te|=re.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),re.clear(Te)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",jt,!1),n.removeEventListener("webglcontextrestored",un,!1),n.removeEventListener("webglcontextcreationerror",hn,!1),Ae.dispose(),Qe.dispose(),st.dispose(),H.dispose(),Ne.dispose(),je.dispose(),lt.dispose(),pt.dispose(),tt.dispose(),Tt.dispose(),at.dispose(),at.removeEventListener("sessionstart",el),at.removeEventListener("sessionend",Qc),Wi.stop()};function jt(J){J.preventDefault(),Bb("WebGLRenderer: Context Lost."),U=!0}function un(){Bb("WebGLRenderer: Context Restored."),U=!1;const J=te.autoReset,ge=se.enabled,Pe=se.autoUpdate,Te=se.needsUpdate,xe=se.type;He(),te.autoReset=J,se.enabled=ge,se.autoUpdate=Pe,se.needsUpdate=Te,se.type=xe}function hn(J){zt("WebGLRenderer: A WebGL context could not be created. Reason: ",J.statusMessage)}function Mr(J){const ge=J.target;ge.removeEventListener("dispose",Mr),oi(ge)}function oi(J){Wl(J),H.remove(J)}function Wl(J){const ge=H.get(J).programs;ge!==void 0&&(ge.forEach(function(Pe){Tt.releaseProgram(Pe)}),J.isShaderMaterial&&Tt.releaseShaderCache(J))}this.renderBufferDirect=function(J,ge,Pe,Te,xe,ct){ge===null&&(ge=Ue);const wt=xe.isMesh&&xe.matrixWorld.determinant()<0,rt=Fs(J,ge,Pe,Te,xe);Ze.setMaterial(Te,wt);let Ct=Pe.index,Rt=1;if(Te.wireframe===!0){if(Ct=_t.getWireframeAttribute(Pe),Ct===void 0)return;Rt=2}const Ht=Pe.drawRange,Dt=Pe.attributes.position;let Xt=Ht.start*Rt,Un=(Ht.start+Ht.count)*Rt;ct!==null&&(Xt=Math.max(Xt,ct.start*Rt),Un=Math.min(Un,(ct.start+ct.count)*Rt)),Ct!==null?(Xt=Math.max(Xt,0),Un=Math.min(Un,Ct.count)):Dt!=null&&(Xt=Math.max(Xt,0),Un=Math.min(Un,Dt.count));const sr=Un-Xt;if(sr<0||sr===1/0)return;pt.setup(xe,Te,rt,Pe,Ct);let Qn,rn=oe;if(Ct!==null&&(Qn=Ie.get(Ct),rn=it,rn.setIndex(Qn)),xe.isMesh)Te.wireframe===!0?(Ze.setLineWidth(Te.wireframeLinewidth*Ye()),rn.setMode(re.LINES)):rn.setMode(re.TRIANGLES);else if(xe.isLine){let gt=Te.linewidth;gt===void 0&&(gt=1),Ze.setLineWidth(gt*Ye()),xe.isLineSegments?rn.setMode(re.LINES):xe.isLineLoop?rn.setMode(re.LINE_LOOP):rn.setMode(re.LINE_STRIP)}else xe.isPoints?rn.setMode(re.POINTS):xe.isSprite&&rn.setMode(re.TRIANGLES);if(xe.isBatchedMesh)if(xe._multiDrawInstances!==null)Iv("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),rn.renderMultiDrawInstances(xe._multiDrawStarts,xe._multiDrawCounts,xe._multiDrawCount,xe._multiDrawInstances);else if(ft.get("WEBGL_multi_draw"))rn.renderMultiDraw(xe._multiDrawStarts,xe._multiDrawCounts,xe._multiDrawCount);else{const gt=xe._multiDrawStarts,Bn=xe._multiDrawCounts,Jt=xe._multiDrawCount,Jr=Ct?Ie.get(Ct).bytesPerElement:1,Us=H.get(Te).currentProgram.getUniforms();for(let hr=0;hr<Jt;hr++)Us.setValue(re,"_gl_DrawID",hr),rn.render(gt[hr]/Jr,Bn[hr])}else if(xe.isInstancedMesh)rn.renderInstances(Xt,sr,xe.count);else if(Pe.isInstancedBufferGeometry){const gt=Pe._maxInstanceCount!==void 0?Pe._maxInstanceCount:1/0,Bn=Math.min(Pe.instanceCount,gt);rn.renderInstances(Xt,sr,Bn)}else rn.render(Xt,sr)};function ql(J,ge,Pe){J.transparent===!0&&J.side===Fo&&J.forceSinglePass===!1?(J.side=ls,J.needsUpdate=!0,za(J,ge,Pe),J.side=Vc,J.needsUpdate=!0,za(J,ge,Pe),J.side=Fo):za(J,ge,Pe)}this.compile=function(J,ge,Pe=null){Pe===null&&(Pe=J),R=st.get(Pe),R.init(ge),I.push(R),Pe.traverseVisible(function(xe){xe.isLight&&xe.layers.test(ge.layers)&&(R.pushLight(xe),xe.castShadow&&R.pushShadow(xe))}),J!==Pe&&J.traverseVisible(function(xe){xe.isLight&&xe.layers.test(ge.layers)&&(R.pushLight(xe),xe.castShadow&&R.pushShadow(xe))}),R.setupLights();const Te=new Set;return J.traverse(function(xe){if(!(xe.isMesh||xe.isPoints||xe.isLine||xe.isSprite))return;const ct=xe.material;if(ct)if(Array.isArray(ct))for(let wt=0;wt<ct.length;wt++){const rt=ct[wt];ql(rt,Pe,xe),Te.add(rt)}else ql(ct,Pe,xe),Te.add(ct)}),R=I.pop(),Te},this.compileAsync=function(J,ge,Pe=null){const Te=this.compile(J,ge,Pe);return new Promise(xe=>{function ct(){if(Te.forEach(function(wt){H.get(wt).currentProgram.isReady()&&Te.delete(wt)}),Te.size===0){xe(J);return}setTimeout(ct,10)}ft.get("KHR_parallel_shader_compile")!==null?ct():setTimeout(ct,10)})};let Zc=null;function $l(J){Zc&&Zc(J)}function el(){Wi.stop()}function Qc(){Wi.start()}const Wi=new ZY;Wi.setAnimationLoop($l),typeof self<"u"&&Wi.setContext(self),this.setAnimationLoop=function(J){Zc=J,at.setAnimationLoop(J),J===null?Wi.stop():Wi.start()},at.addEventListener("sessionstart",el),at.addEventListener("sessionend",Qc),this.render=function(J,ge){if(ge!==void 0&&ge.isCamera!==!0){zt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;const Pe=at.enabled===!0&&at.isPresenting===!0,Te=k!==null&&(W===null||Pe)&&k.begin(B,W);if(J.matrixWorldAutoUpdate===!0&&J.updateMatrixWorld(),ge.parent===null&&ge.matrixWorldAutoUpdate===!0&&ge.updateMatrixWorld(),at.enabled===!0&&at.isPresenting===!0&&(k===null||k.isCompositing()===!1)&&(at.cameraAutoUpdate===!0&&at.updateCamera(ge),ge=at.getCamera()),J.isScene===!0&&J.onBeforeRender(B,J,ge,W),R=st.get(J,I.length),R.init(ge),I.push(R),Re.multiplyMatrices(ge.projectionMatrix,ge.matrixWorldInverse),_e.setFromProjectionMatrix(Re,Zs,ge.reversedDepth),Xe=this.localClippingEnabled,Fe=vt.init(this.clippingPlanes,Xe),P=Qe.get(J,D.length),P.init(),D.push(P),at.enabled===!0&&at.isPresenting===!0){const wt=B.xr.getDepthSensingMesh();wt!==null&&Fa(wt,ge,-1/0,B.sortObjects)}Fa(J,ge,0,B.sortObjects),P.finish(),B.sortObjects===!0&&P.sort(Se,$e),Be=at.enabled===!1||at.isPresenting===!1||at.hasDepthSensing()===!1,Be&&Ae.addToRenderList(P,J),this.info.render.frame++,Fe===!0&&vt.beginShadows();const xe=R.state.shadowsArray;if(se.render(xe,J,ge),Fe===!0&&vt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Te&&k.hasRenderPass())===!1){const wt=P.opaque,rt=P.transmissive;if(R.setupLights(),ge.isArrayCamera){const Ct=ge.cameras;if(rt.length>0)for(let Rt=0,Ht=Ct.length;Rt<Ht;Rt++){const Dt=Ct[Rt];li(wt,rt,J,Dt)}Be&&Ae.render(J);for(let Rt=0,Ht=Ct.length;Rt<Ht;Rt++){const Dt=Ct[Rt];Er(P,J,Dt,Dt.viewport)}}else rt.length>0&&li(wt,rt,J,ge),Be&&Ae.render(J),Er(P,J,ge)}W!==null&&q===0&&(he.updateMultisampleRenderTarget(W),he.updateRenderTargetMipmap(W)),Te&&k.end(B),J.isScene===!0&&J.onAfterRender(B,J,ge),pt.resetDefaultState(),ee=-1,Q=null,I.pop(),I.length>0?(R=I[I.length-1],Fe===!0&&vt.setGlobalState(B.clippingPlanes,R.state.camera)):R=null,D.pop(),D.length>0?P=D[D.length-1]:P=null};function Fa(J,ge,Pe,Te){if(J.visible===!1)return;if(J.layers.test(ge.layers)){if(J.isGroup)Pe=J.renderOrder;else if(J.isLOD)J.autoUpdate===!0&&J.update(ge);else if(J.isLight)R.pushLight(J),J.castShadow&&R.pushShadow(J);else if(J.isSprite){if(!J.frustumCulled||_e.intersectsSprite(J)){Te&&we.setFromMatrixPosition(J.matrixWorld).applyMatrix4(Re);const wt=lt.update(J),rt=J.material;rt.visible&&P.push(J,wt,rt,Pe,we.z,null)}}else if((J.isMesh||J.isLine||J.isPoints)&&(!J.frustumCulled||_e.intersectsObject(J))){const wt=lt.update(J),rt=J.material;if(Te&&(J.boundingSphere!==void 0?(J.boundingSphere===null&&J.computeBoundingSphere(),we.copy(J.boundingSphere.center)):(wt.boundingSphere===null&&wt.computeBoundingSphere(),we.copy(wt.boundingSphere.center)),we.applyMatrix4(J.matrixWorld).applyMatrix4(Re)),Array.isArray(rt)){const Ct=wt.groups;for(let Rt=0,Ht=Ct.length;Rt<Ht;Rt++){const Dt=Ct[Rt],Xt=rt[Dt.materialIndex];Xt&&Xt.visible&&P.push(J,wt,Xt,Pe,we.z,Dt)}}else rt.visible&&P.push(J,wt,rt,Pe,we.z,null)}}const ct=J.children;for(let wt=0,rt=ct.length;wt<rt;wt++)Fa(ct[wt],ge,Pe,Te)}function Er(J,ge,Pe,Te){const{opaque:xe,transmissive:ct,transparent:wt}=J;R.setupLightsView(Pe),Fe===!0&&vt.setGlobalState(B.clippingPlanes,Pe),Te&&Ze.viewport(V.copy(Te)),xe.length>0&&Ua(xe,ge,Pe),ct.length>0&&Ua(ct,ge,Pe),wt.length>0&&Ua(wt,ge,Pe),Ze.buffers.depth.setTest(!0),Ze.buffers.depth.setMask(!0),Ze.buffers.color.setMask(!0),Ze.setPolygonOffset(!1)}function li(J,ge,Pe,Te){if((Pe.isScene===!0?Pe.overrideMaterial:null)!==null)return;if(R.state.transmissionRenderTarget[Te.id]===void 0){const Xt=ft.has("EXT_color_buffer_half_float")||ft.has("EXT_color_buffer_float");R.state.transmissionRenderTarget[Te.id]=new to(1,1,{generateMipmaps:!0,type:Xt?qc:ts,minFilter:zo,samples:Et.samples,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Fn.workingColorSpace})}const ct=R.state.transmissionRenderTarget[Te.id],wt=Te.viewport||V;ct.setSize(wt.z*B.transmissionResolutionScale,wt.w*B.transmissionResolutionScale);const rt=B.getRenderTarget(),Ct=B.getActiveCubeFace(),Rt=B.getActiveMipmapLevel();B.setRenderTarget(ct),B.getClearColor(ie),de=B.getClearAlpha(),de<1&&B.setClearColor(16777215,.5),B.clear(),Be&&Ae.render(Pe);const Ht=B.toneMapping;B.toneMapping=Wo;const Dt=Te.viewport;if(Te.viewport!==void 0&&(Te.viewport=void 0),R.setupLightsView(Te),Fe===!0&&vt.setGlobalState(B.clippingPlanes,Te),Ua(J,Pe,Te),he.updateMultisampleRenderTarget(ct),he.updateRenderTargetMipmap(ct),ft.has("WEBGL_multisampled_render_to_texture")===!1){let Xt=!1;for(let Un=0,sr=ge.length;Un<sr;Un++){const Qn=ge[Un],{object:rn,geometry:gt,material:Bn,group:Jt}=Qn;if(Bn.side===Fo&&rn.layers.test(Te.layers)){const Jr=Bn.side;Bn.side=ls,Bn.needsUpdate=!0,ja(rn,Pe,Te,gt,Bn,Jt),Bn.side=Jr,Bn.needsUpdate=!0,Xt=!0}}Xt===!0&&(he.updateMultisampleRenderTarget(ct),he.updateRenderTargetMipmap(ct))}B.setRenderTarget(rt,Ct,Rt),B.setClearColor(ie,de),Dt!==void 0&&(Te.viewport=Dt),B.toneMapping=Ht}function Ua(J,ge,Pe){const Te=ge.isScene===!0?ge.overrideMaterial:null;for(let xe=0,ct=J.length;xe<ct;xe++){const wt=J[xe],{object:rt,geometry:Ct,group:Rt}=wt;let Ht=wt.material;Ht.allowOverride===!0&&Te!==null&&(Ht=Te),rt.layers.test(Pe.layers)&&ja(rt,ge,Pe,Ct,Ht,Rt)}}function ja(J,ge,Pe,Te,xe,ct){J.onBeforeRender(B,ge,Pe,Te,xe,ct),J.modelViewMatrix.multiplyMatrices(Pe.matrixWorldInverse,J.matrixWorld),J.normalMatrix.getNormalMatrix(J.modelViewMatrix),xe.onBeforeRender(B,ge,Pe,Te,J,ct),xe.transparent===!0&&xe.side===Fo&&xe.forceSinglePass===!1?(xe.side=ls,xe.needsUpdate=!0,B.renderBufferDirect(Pe,ge,Te,xe,J,ct),xe.side=Vc,xe.needsUpdate=!0,B.renderBufferDirect(Pe,ge,Te,xe,J,ct),xe.side=Fo):B.renderBufferDirect(Pe,ge,Te,xe,J,ct),J.onAfterRender(B,ge,Pe,Te,xe,ct)}function za(J,ge,Pe){ge.isScene!==!0&&(ge=Ue);const Te=H.get(J),xe=R.state.lights,ct=R.state.shadowsArray,wt=xe.state.version,rt=Tt.getParameters(J,xe.state,ct,ge,Pe),Ct=Tt.getProgramCacheKey(rt);let Rt=Te.programs;Te.environment=J.isMeshStandardMaterial?ge.environment:null,Te.fog=ge.fog,Te.envMap=(J.isMeshStandardMaterial?je:Ne).get(J.envMap||Te.environment),Te.envMapRotation=Te.environment!==null&&J.envMap===null?ge.environmentRotation:J.envMapRotation,Rt===void 0&&(J.addEventListener("dispose",Mr),Rt=new Map,Te.programs=Rt);let Ht=Rt.get(Ct);if(Ht!==void 0){if(Te.currentProgram===Ht&&Te.lightsStateVersion===wt)return eu(J,rt),Ht}else rt.uniforms=Tt.getUniforms(J),J.onBeforeCompile(rt,B),Ht=Tt.acquireProgram(rt,Ct),Rt.set(Ct,Ht),Te.uniforms=rt.uniforms;const Dt=Te.uniforms;return(!J.isShaderMaterial&&!J.isRawShaderMaterial||J.clipping===!0)&&(Dt.clippingPlanes=vt.uniform),eu(J,rt),Te.needsLights=nl(J),Te.lightsStateVersion=wt,Te.needsLights&&(Dt.ambientLightColor.value=xe.state.ambient,Dt.lightProbe.value=xe.state.probe,Dt.directionalLights.value=xe.state.directional,Dt.directionalLightShadows.value=xe.state.directionalShadow,Dt.spotLights.value=xe.state.spot,Dt.spotLightShadows.value=xe.state.spotShadow,Dt.rectAreaLights.value=xe.state.rectArea,Dt.ltc_1.value=xe.state.rectAreaLTC1,Dt.ltc_2.value=xe.state.rectAreaLTC2,Dt.pointLights.value=xe.state.point,Dt.pointLightShadows.value=xe.state.pointShadow,Dt.hemisphereLights.value=xe.state.hemi,Dt.directionalShadowMap.value=xe.state.directionalShadowMap,Dt.directionalShadowMatrix.value=xe.state.directionalShadowMatrix,Dt.spotShadowMap.value=xe.state.spotShadowMap,Dt.spotLightMatrix.value=xe.state.spotLightMatrix,Dt.spotLightMap.value=xe.state.spotLightMap,Dt.pointShadowMap.value=xe.state.pointShadowMap,Dt.pointShadowMatrix.value=xe.state.pointShadowMatrix),Te.currentProgram=Ht,Te.uniformsList=null,Ht}function Xl(J){if(J.uniformsList===null){const ge=J.currentProgram.getUniforms();J.uniformsList=jA.seqWithValue(ge.seq,J.uniforms)}return J.uniformsList}function eu(J,ge){const Pe=H.get(J);Pe.outputColorSpace=ge.outputColorSpace,Pe.batching=ge.batching,Pe.batchingColor=ge.batchingColor,Pe.instancing=ge.instancing,Pe.instancingColor=ge.instancingColor,Pe.instancingMorph=ge.instancingMorph,Pe.skinning=ge.skinning,Pe.morphTargets=ge.morphTargets,Pe.morphNormals=ge.morphNormals,Pe.morphColors=ge.morphColors,Pe.morphTargetsCount=ge.morphTargetsCount,Pe.numClippingPlanes=ge.numClippingPlanes,Pe.numIntersection=ge.numClipIntersection,Pe.vertexAlphas=ge.vertexAlphas,Pe.vertexTangents=ge.vertexTangents,Pe.toneMapping=ge.toneMapping}function Fs(J,ge,Pe,Te,xe){ge.isScene!==!0&&(ge=Ue),he.resetTextureUnits();const ct=ge.fog,wt=Te.isMeshStandardMaterial?ge.environment:null,rt=W===null?B.outputColorSpace:W.isXRRenderTarget===!0?W.texture.colorSpace:Od,Ct=(Te.isMeshStandardMaterial?je:Ne).get(Te.envMap||wt),Rt=Te.vertexColors===!0&&!!Pe.attributes.color&&Pe.attributes.color.itemSize===4,Ht=!!Pe.attributes.tangent&&(!!Te.normalMap||Te.anisotropy>0),Dt=!!Pe.morphAttributes.position,Xt=!!Pe.morphAttributes.normal,Un=!!Pe.morphAttributes.color;let sr=Wo;Te.toneMapped&&(W===null||W.isXRRenderTarget===!0)&&(sr=B.toneMapping);const Qn=Pe.morphAttributes.position||Pe.morphAttributes.normal||Pe.morphAttributes.color,rn=Qn!==void 0?Qn.length:0,gt=H.get(Te),Bn=R.state.lights;if(Fe===!0&&(Xe===!0||J!==Q)){const yi=J===Q&&Te.id===ee;vt.setState(Te,J,yi)}let Jt=!1;Te.version===gt.__version?(gt.needsLights&&gt.lightsStateVersion!==Bn.state.version||gt.outputColorSpace!==rt||xe.isBatchedMesh&&gt.batching===!1||!xe.isBatchedMesh&&gt.batching===!0||xe.isBatchedMesh&&gt.batchingColor===!0&&xe.colorTexture===null||xe.isBatchedMesh&&gt.batchingColor===!1&&xe.colorTexture!==null||xe.isInstancedMesh&&gt.instancing===!1||!xe.isInstancedMesh&&gt.instancing===!0||xe.isSkinnedMesh&&gt.skinning===!1||!xe.isSkinnedMesh&&gt.skinning===!0||xe.isInstancedMesh&&gt.instancingColor===!0&&xe.instanceColor===null||xe.isInstancedMesh&&gt.instancingColor===!1&&xe.instanceColor!==null||xe.isInstancedMesh&&gt.instancingMorph===!0&&xe.morphTexture===null||xe.isInstancedMesh&&gt.instancingMorph===!1&&xe.morphTexture!==null||gt.envMap!==Ct||Te.fog===!0&&gt.fog!==ct||gt.numClippingPlanes!==void 0&&(gt.numClippingPlanes!==vt.numPlanes||gt.numIntersection!==vt.numIntersection)||gt.vertexAlphas!==Rt||gt.vertexTangents!==Ht||gt.morphTargets!==Dt||gt.morphNormals!==Xt||gt.morphColors!==Un||gt.toneMapping!==sr||gt.morphTargetsCount!==rn)&&(Jt=!0):(Jt=!0,gt.__version=Te.version);let Jr=gt.currentProgram;Jt===!0&&(Jr=za(Te,ge,xe));let Us=!1,hr=!1,ea=!1;const Wn=Jr.getUniforms(),ci=gt.uniforms;if(Ze.useProgram(Jr.program)&&(Us=!0,hr=!0,ea=!0),Te.id!==ee&&(ee=Te.id,hr=!0),Us||Q!==J){Ze.buffers.depth.getReversed()&&J.reversedDepth!==!0&&(J._reversedDepth=!0,J.updateProjectionMatrix()),Wn.setValue(re,"projectionMatrix",J.projectionMatrix),Wn.setValue(re,"viewMatrix",J.matrixWorldInverse);const xi=Wn.map.cameraPosition;xi!==void 0&&xi.setValue(re,ot.setFromMatrixPosition(J.matrixWorld)),Et.logarithmicDepthBuffer&&Wn.setValue(re,"logDepthBufFC",2/(Math.log(J.far+1)/Math.LN2)),(Te.isMeshPhongMaterial||Te.isMeshToonMaterial||Te.isMeshLambertMaterial||Te.isMeshBasicMaterial||Te.isMeshStandardMaterial||Te.isShaderMaterial)&&Wn.setValue(re,"isOrthographic",J.isOrthographicCamera===!0),Q!==J&&(Q=J,hr=!0,ea=!0)}if(gt.needsLights&&(Bn.state.directionalShadowMap.length>0&&Wn.setValue(re,"directionalShadowMap",Bn.state.directionalShadowMap,he),Bn.state.spotShadowMap.length>0&&Wn.setValue(re,"spotShadowMap",Bn.state.spotShadowMap,he),Bn.state.pointShadowMap.length>0&&Wn.setValue(re,"pointShadowMap",Bn.state.pointShadowMap,he)),xe.isSkinnedMesh){Wn.setOptional(re,xe,"bindMatrix"),Wn.setOptional(re,xe,"bindMatrixInverse");const yi=xe.skeleton;yi&&(yi.boneTexture===null&&yi.computeBoneTexture(),Wn.setValue(re,"boneTexture",yi.boneTexture,he))}xe.isBatchedMesh&&(Wn.setOptional(re,xe,"batchingTexture"),Wn.setValue(re,"batchingTexture",xe._matricesTexture,he),Wn.setOptional(re,xe,"batchingIdTexture"),Wn.setValue(re,"batchingIdTexture",xe._indirectTexture,he),Wn.setOptional(re,xe,"batchingColorTexture"),xe._colorsTexture!==null&&Wn.setValue(re,"batchingColorTexture",xe._colorsTexture,he));const Zr=Pe.morphAttributes;if((Zr.position!==void 0||Zr.normal!==void 0||Zr.color!==void 0)&&dt.update(xe,Pe,Jr),(hr||gt.receiveShadow!==xe.receiveShadow)&&(gt.receiveShadow=xe.receiveShadow,Wn.setValue(re,"receiveShadow",xe.receiveShadow)),Te.isMeshGouraudMaterial&&Te.envMap!==null&&(ci.envMap.value=Ct,ci.flipEnvMap.value=Ct.isCubeTexture&&Ct.isRenderTargetTexture===!1?-1:1),Te.isMeshStandardMaterial&&Te.envMap===null&&ge.environment!==null&&(ci.envMapIntensity.value=ge.environmentIntensity),ci.dfgLUT!==void 0&&(ci.dfgLUT.value=L3e()),hr&&(Wn.setValue(re,"toneMappingExposure",B.toneMappingExposure),gt.needsLights&&tl(ci,ea),ct&&Te.fog===!0&&Gt.refreshFogUniforms(ci,ct),Gt.refreshMaterialUniforms(ci,Te,ue,ae,R.state.transmissionRenderTarget[J.id]),jA.upload(re,Xl(gt),ci,he)),Te.isShaderMaterial&&Te.uniformsNeedUpdate===!0&&(jA.upload(re,Xl(gt),ci,he),Te.uniformsNeedUpdate=!1),Te.isSpriteMaterial&&Wn.setValue(re,"center",xe.center),Wn.setValue(re,"modelViewMatrix",xe.modelViewMatrix),Wn.setValue(re,"normalMatrix",xe.normalMatrix),Wn.setValue(re,"modelMatrix",xe.matrixWorld),Te.isShaderMaterial||Te.isRawShaderMaterial){const yi=Te.uniformsGroups;for(let xi=0,tu=yi.length;xi<tu;xi++){const ds=yi[xi];tt.update(ds,Jr),tt.bind(ds,Jr)}}return Jr}function tl(J,ge){J.ambientLightColor.needsUpdate=ge,J.lightProbe.needsUpdate=ge,J.directionalLights.needsUpdate=ge,J.directionalLightShadows.needsUpdate=ge,J.pointLights.needsUpdate=ge,J.pointLightShadows.needsUpdate=ge,J.spotLights.needsUpdate=ge,J.spotLightShadows.needsUpdate=ge,J.rectAreaLights.needsUpdate=ge,J.hemisphereLights.needsUpdate=ge}function nl(J){return J.isMeshLambertMaterial||J.isMeshToonMaterial||J.isMeshPhongMaterial||J.isMeshStandardMaterial||J.isShadowMaterial||J.isShaderMaterial&&J.lights===!0}this.getActiveCubeFace=function(){return z},this.getActiveMipmapLevel=function(){return q},this.getRenderTarget=function(){return W},this.setRenderTargetTextures=function(J,ge,Pe){const Te=H.get(J);Te.__autoAllocateDepthBuffer=J.resolveDepthBuffer===!1,Te.__autoAllocateDepthBuffer===!1&&(Te.__useRenderToTexture=!1),H.get(J.texture).__webglTexture=ge,H.get(J.depthTexture).__webglTexture=Te.__autoAllocateDepthBuffer?void 0:Pe,Te.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(J,ge){const Pe=H.get(J);Pe.__webglFramebuffer=ge,Pe.__useDefaultFramebuffer=ge===void 0};const rl=re.createFramebuffer();this.setRenderTarget=function(J,ge=0,Pe=0){W=J,z=ge,q=Pe;let Te=null,xe=!1,ct=!1;if(J){const rt=H.get(J);if(rt.__useDefaultFramebuffer!==void 0){Ze.bindFramebuffer(re.FRAMEBUFFER,rt.__webglFramebuffer),V.copy(J.viewport),$.copy(J.scissor),Y=J.scissorTest,Ze.viewport(V),Ze.scissor($),Ze.setScissorTest(Y),ee=-1;return}else if(rt.__webglFramebuffer===void 0)he.setupRenderTarget(J);else if(rt.__hasExternalTextures)he.rebindTextures(J,H.get(J.texture).__webglTexture,H.get(J.depthTexture).__webglTexture);else if(J.depthBuffer){const Ht=J.depthTexture;if(rt.__boundDepthTexture!==Ht){if(Ht!==null&&H.has(Ht)&&(J.width!==Ht.image.width||J.height!==Ht.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");he.setupDepthRenderbuffer(J)}}const Ct=J.texture;(Ct.isData3DTexture||Ct.isDataArrayTexture||Ct.isCompressedArrayTexture)&&(ct=!0);const Rt=H.get(J).__webglFramebuffer;J.isWebGLCubeRenderTarget?(Array.isArray(Rt[ge])?Te=Rt[ge][Pe]:Te=Rt[ge],xe=!0):J.samples>0&&he.useMultisampledRTT(J)===!1?Te=H.get(J).__webglMultisampledFramebuffer:Array.isArray(Rt)?Te=Rt[Pe]:Te=Rt,V.copy(J.viewport),$.copy(J.scissor),Y=J.scissorTest}else V.copy(me).multiplyScalar(ue).floor(),$.copy(ve).multiplyScalar(ue).floor(),Y=We;if(Pe!==0&&(Te=rl),Ze.bindFramebuffer(re.FRAMEBUFFER,Te)&&Ze.drawBuffers(J,Te),Ze.viewport(V),Ze.scissor($),Ze.setScissorTest(Y),xe){const rt=H.get(J.texture);re.framebufferTexture2D(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_CUBE_MAP_POSITIVE_X+ge,rt.__webglTexture,Pe)}else if(ct){const rt=ge;for(let Ct=0;Ct<J.textures.length;Ct++){const Rt=H.get(J.textures[Ct]);re.framebufferTextureLayer(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0+Ct,Rt.__webglTexture,Pe,rt)}}else if(J!==null&&Pe!==0){const rt=H.get(J.texture);re.framebufferTexture2D(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_2D,rt.__webglTexture,Pe)}ee=-1},this.readRenderTargetPixels=function(J,ge,Pe,Te,xe,ct,wt,rt=0){if(!(J&&J.isWebGLRenderTarget)){zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ct=H.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&&wt!==void 0&&(Ct=Ct[wt]),Ct){Ze.bindFramebuffer(re.FRAMEBUFFER,Ct);try{const Rt=J.textures[rt],Ht=Rt.format,Dt=Rt.type;if(!Et.textureFormatReadable(Ht)){zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Et.textureTypeReadable(Dt)){zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ge>=0&&ge<=J.width-Te&&Pe>=0&&Pe<=J.height-xe&&(J.textures.length>1&&re.readBuffer(re.COLOR_ATTACHMENT0+rt),re.readPixels(ge,Pe,Te,xe,et.convert(Ht),et.convert(Dt),ct))}finally{const Rt=W!==null?H.get(W).__webglFramebuffer:null;Ze.bindFramebuffer(re.FRAMEBUFFER,Rt)}}},this.readRenderTargetPixelsAsync=async function(J,ge,Pe,Te,xe,ct,wt,rt=0){if(!(J&&J.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ct=H.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&&wt!==void 0&&(Ct=Ct[wt]),Ct)if(ge>=0&&ge<=J.width-Te&&Pe>=0&&Pe<=J.height-xe){Ze.bindFramebuffer(re.FRAMEBUFFER,Ct);const Rt=J.textures[rt],Ht=Rt.format,Dt=Rt.type;if(!Et.textureFormatReadable(Ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Et.textureTypeReadable(Dt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Xt=re.createBuffer();re.bindBuffer(re.PIXEL_PACK_BUFFER,Xt),re.bufferData(re.PIXEL_PACK_BUFFER,ct.byteLength,re.STREAM_READ),J.textures.length>1&&re.readBuffer(re.COLOR_ATTACHMENT0+rt),re.readPixels(ge,Pe,Te,xe,et.convert(Ht),et.convert(Dt),0);const Un=W!==null?H.get(W).__webglFramebuffer:null;Ze.bindFramebuffer(re.FRAMEBUFFER,Un);const sr=re.fenceSync(re.SYNC_GPU_COMMANDS_COMPLETE,0);return re.flush(),await Xwe(re,sr,4),re.bindBuffer(re.PIXEL_PACK_BUFFER,Xt),re.getBufferSubData(re.PIXEL_PACK_BUFFER,0,ct),re.deleteBuffer(Xt),re.deleteSync(sr),ct}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(J,ge=null,Pe=0){const Te=Math.pow(2,-Pe),xe=Math.floor(J.image.width*Te),ct=Math.floor(J.image.height*Te),wt=ge!==null?ge.x:0,rt=ge!==null?ge.y:0;he.setTexture2D(J,0),re.copyTexSubImage2D(re.TEXTURE_2D,Pe,0,0,wt,rt,xe,ct),Ze.unbindTexture()};const Kl=re.createFramebuffer(),so=re.createFramebuffer();this.copyTextureToTexture=function(J,ge,Pe=null,Te=null,xe=0,ct=null){ct===null&&(xe!==0?(Iv("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ct=xe,xe=0):ct=0);let wt,rt,Ct,Rt,Ht,Dt,Xt,Un,sr;const Qn=J.isCompressedTexture?J.mipmaps[ct]:J.image;if(Pe!==null)wt=Pe.max.x-Pe.min.x,rt=Pe.max.y-Pe.min.y,Ct=Pe.isBox3?Pe.max.z-Pe.min.z:1,Rt=Pe.min.x,Ht=Pe.min.y,Dt=Pe.isBox3?Pe.min.z:0;else{const Zr=Math.pow(2,-xe);wt=Math.floor(Qn.width*Zr),rt=Math.floor(Qn.height*Zr),J.isDataArrayTexture?Ct=Qn.depth:J.isData3DTexture?Ct=Math.floor(Qn.depth*Zr):Ct=1,Rt=0,Ht=0,Dt=0}Te!==null?(Xt=Te.x,Un=Te.y,sr=Te.z):(Xt=0,Un=0,sr=0);const rn=et.convert(ge.format),gt=et.convert(ge.type);let Bn;ge.isData3DTexture?(he.setTexture3D(ge,0),Bn=re.TEXTURE_3D):ge.isDataArrayTexture||ge.isCompressedArrayTexture?(he.setTexture2DArray(ge,0),Bn=re.TEXTURE_2D_ARRAY):(he.setTexture2D(ge,0),Bn=re.TEXTURE_2D),re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,ge.flipY),re.pixelStorei(re.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ge.premultiplyAlpha),re.pixelStorei(re.UNPACK_ALIGNMENT,ge.unpackAlignment);const Jt=re.getParameter(re.UNPACK_ROW_LENGTH),Jr=re.getParameter(re.UNPACK_IMAGE_HEIGHT),Us=re.getParameter(re.UNPACK_SKIP_PIXELS),hr=re.getParameter(re.UNPACK_SKIP_ROWS),ea=re.getParameter(re.UNPACK_SKIP_IMAGES);re.pixelStorei(re.UNPACK_ROW_LENGTH,Qn.width),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,Qn.height),re.pixelStorei(re.UNPACK_SKIP_PIXELS,Rt),re.pixelStorei(re.UNPACK_SKIP_ROWS,Ht),re.pixelStorei(re.UNPACK_SKIP_IMAGES,Dt);const Wn=J.isDataArrayTexture||J.isData3DTexture,ci=ge.isDataArrayTexture||ge.isData3DTexture;if(J.isDepthTexture){const Zr=H.get(J),yi=H.get(ge),xi=H.get(Zr.__renderTarget),tu=H.get(yi.__renderTarget);Ze.bindFramebuffer(re.READ_FRAMEBUFFER,xi.__webglFramebuffer),Ze.bindFramebuffer(re.DRAW_FRAMEBUFFER,tu.__webglFramebuffer);for(let ds=0;ds<Ct;ds++)Wn&&(re.framebufferTextureLayer(re.READ_FRAMEBUFFER,re.COLOR_ATTACHMENT0,H.get(J).__webglTexture,xe,Dt+ds),re.framebufferTextureLayer(re.DRAW_FRAMEBUFFER,re.COLOR_ATTACHMENT0,H.get(ge).__webglTexture,ct,sr+ds)),re.blitFramebuffer(Rt,Ht,wt,rt,Xt,Un,wt,rt,re.DEPTH_BUFFER_BIT,re.NEAREST);Ze.bindFramebuffer(re.READ_FRAMEBUFFER,null),Ze.bindFramebuffer(re.DRAW_FRAMEBUFFER,null)}else if(xe!==0||J.isRenderTargetTexture||H.has(J)){const Zr=H.get(J),yi=H.get(ge);Ze.bindFramebuffer(re.READ_FRAMEBUFFER,Kl),Ze.bindFramebuffer(re.DRAW_FRAMEBUFFER,so);for(let xi=0;xi<Ct;xi++)Wn?re.framebufferTextureLayer(re.READ_FRAMEBUFFER,re.COLOR_ATTACHMENT0,Zr.__webglTexture,xe,Dt+xi):re.framebufferTexture2D(re.READ_FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_2D,Zr.__webglTexture,xe),ci?re.framebufferTextureLayer(re.DRAW_FRAMEBUFFER,re.COLOR_ATTACHMENT0,yi.__webglTexture,ct,sr+xi):re.framebufferTexture2D(re.DRAW_FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_2D,yi.__webglTexture,ct),xe!==0?re.blitFramebuffer(Rt,Ht,wt,rt,Xt,Un,wt,rt,re.COLOR_BUFFER_BIT,re.NEAREST):ci?re.copyTexSubImage3D(Bn,ct,Xt,Un,sr+xi,Rt,Ht,wt,rt):re.copyTexSubImage2D(Bn,ct,Xt,Un,Rt,Ht,wt,rt);Ze.bindFramebuffer(re.READ_FRAMEBUFFER,null),Ze.bindFramebuffer(re.DRAW_FRAMEBUFFER,null)}else ci?J.isDataTexture||J.isData3DTexture?re.texSubImage3D(Bn,ct,Xt,Un,sr,wt,rt,Ct,rn,gt,Qn.data):ge.isCompressedArrayTexture?re.compressedTexSubImage3D(Bn,ct,Xt,Un,sr,wt,rt,Ct,rn,Qn.data):re.texSubImage3D(Bn,ct,Xt,Un,sr,wt,rt,Ct,rn,gt,Qn):J.isDataTexture?re.texSubImage2D(re.TEXTURE_2D,ct,Xt,Un,wt,rt,rn,gt,Qn.data):J.isCompressedTexture?re.compressedTexSubImage2D(re.TEXTURE_2D,ct,Xt,Un,Qn.width,Qn.height,rn,Qn.data):re.texSubImage2D(re.TEXTURE_2D,ct,Xt,Un,wt,rt,rn,gt,Qn);re.pixelStorei(re.UNPACK_ROW_LENGTH,Jt),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,Jr),re.pixelStorei(re.UNPACK_SKIP_PIXELS,Us),re.pixelStorei(re.UNPACK_SKIP_ROWS,hr),re.pixelStorei(re.UNPACK_SKIP_IMAGES,ea),ct===0&&ge.generateMipmaps&&re.generateMipmap(Bn),Ze.unbindTexture()},this.initRenderTarget=function(J){H.get(J).__webglFramebuffer===void 0&&he.setupRenderTarget(J)},this.initTexture=function(J){J.isCubeTexture?he.setTextureCube(J,0):J.isData3DTexture?he.setTexture3D(J,0):J.isDataArrayTexture||J.isCompressedArrayTexture?he.setTexture2DArray(J,0):he.setTexture2D(J,0),Ze.unbindTexture()},this.resetState=function(){z=0,q=0,W=null,Ze.reset(),pt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Zs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=Fn._getDrawingBufferColorSpace(e),n.unpackColorSpace=Fn._getUnpackColorSpace()}}const k3e=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:GE,AddEquation:vd,AddOperation:jK,AdditiveAnimationBlendMode:F5,AdditiveBlending:QI,AgXToneMapping:O5,AlphaFormat:L5,AlwaysCompare:QK,AlwaysDepth:aM,AlwaysStencilFunc:rB,AmbientLight:jY,AnimationAction:KY,AnimationClip:jv,AnimationLoader:kEe,AnimationMixer:uTe,AnimationObjectGroup:lTe,AnimationUtils:NEe,ArcCurve:gY,ArrayCamera:qY,ArrowHelper:BTe,AttachedBindMode:nB,Audio:$Y,AudioAnalyser:ZEe,AudioContext:gk,AudioListener:KEe,AudioLoader:qEe,AxesHelper:LTe,BackSide:ls,BasicDepthPacking:qK,BasicShadowMap:bK,BatchedMesh:dY,Bone:aT,BooleanKeyframeTrack:Wp,Box2:xTe,Box3:Oi,Box3Helper:NTe,BoxGeometry:Vp,BoxHelper:DTe,BufferAttribute:qn,BufferGeometry:an,BufferGeometryLoader:VY,ByteType:D5,Cache:Dc,Camera:nT,CameraHelper:PTe,CanvasTexture:nEe,CapsuleGeometry:cT,CatmullRomCurve3:vY,CineonToneMapping:C5,CircleGeometry:uT,ClampToEdgeWrapping:ss,Clock:vk,Color:bt,ColorKeyframeTrack:ck,ColorManagement:Fn,CompressedArrayTexture:eEe,CompressedCubeTexture:tEe,CompressedTexture:lT,CompressedTextureLoader:FEe,ConeGeometry:h1,ConstantAlphaFactor:kK,ConstantColorFactor:BK,Controls:FTe,CubeCamera:lY,CubeDepthTexture:pY,CubeReflectionMapping:Wc,CubeRefractionMapping:Cd,CubeTexture:c1,CubeTextureLoader:UEe,CubeUVReflectionMapping:oy,CubicBezierCurve:Q5,CubicBezierCurve3:yY,CubicInterpolant:IY,CullFaceBack:ZI,CullFaceFront:xK,CullFaceFrontBack:owe,CullFaceNone:yK,Curve:Vl,CurvePath:bY,CustomBlending:_K,CustomToneMapping:R5,CylinderGeometry:d1,Cylindrical:yTe,Data3DTexture:tT,DataArrayTexture:eT,DataTexture:Fl,DataTextureLoader:jEe,DataUtils:MMe,DecrementStencilOp:Swe,DecrementWrapStencilOp:wwe,DefaultLoadingManager:kY,DepthFormat:$c,DepthStencilFormat:Sd,DepthTexture:Fv,DetachedBindMode:zK,DirectionalLight:pk,DirectionalLightHelper:OTe,DiscreteInterpolant:BY,DodecahedronGeometry:fT,DoubleSide:Fo,DstAlphaFactor:OK,DstColorFactor:DK,DynamicCopyUsage:Uwe,DynamicDrawUsage:Nwe,DynamicReadUsage:Lwe,EdgesGeometry:mY,EllipseCurve:dT,EqualCompare:YK,EqualDepth:oM,EqualStencilFunc:Cwe,EquirectangularReflectionMapping:Rb,EquirectangularRefractionMapping:Ob,Euler:ro,EventDispatcher:Yc,ExternalTexture:J5,ExtrudeGeometry:hT,FileLoader:io,Float16BufferAttribute:DMe,Float32BufferAttribute:Pt,FloatType:os,Fog:iT,FogExp2:rT,FramebufferTexture:QMe,FrontSide:Vc,Frustum:ly,FrustumArray:sT,GLBufferAttribute:mTe,GLSL1:zwe,GLSL3:iB,GreaterCompare:JK,GreaterDepth:cM,GreaterEqualCompare:QE,GreaterEqualDepth:lM,GreaterEqualStencilFunc:Dwe,GreaterStencilFunc:Owe,GridHelper:CTe,Group:$u,HalfFloatType:qc,HemisphereLight:UY,HemisphereLightHelper:TTe,IcosahedronGeometry:pT,ImageBitmapLoader:WY,ImageLoader:Ub,ImageUtils:iY,IncrementStencilOp:_we,IncrementWrapStencilOp:Awe,InstancedBufferAttribute:Rp,InstancedBufferGeometry:HY,InstancedInterleavedBuffer:pTe,InstancedMesh:X5,Int16BufferAttribute:OMe,Int32BufferAttribute:PMe,Int8BufferAttribute:TMe,IntType:WE,InterleavedBuffer:u1,InterleavedBufferAttribute:Dd,Interpolant:uy,InterpolateDiscrete:Pv,InterpolateLinear:Dv,InterpolateSmooth:FA,InterpolationSamplingMode:Vwe,InterpolationSamplingType:Hwe,InvertStencilOp:Mwe,KeepStencilOp:Qh,KeyframeTrack:Qo,LOD:fY,LatheGeometry:mT,Layers:Lv,LessCompare:KK,LessDepth:sM,LessEqualCompare:ZE,LessEqualDepth:Tp,LessEqualStencilFunc:Rwe,LessStencilFunc:Twe,Light:Hd,LightProbe:GY,Line:of,Line3:STe,LineBasicMaterial:La,LineCurve:ek,LineCurve3:xY,LineDashedMaterial:DY,LineLoop:K5,LineSegments:Hl,LinearFilter:vr,LinearInterpolant:lk,LinearMipMapLinearFilter:fwe,LinearMipMapNearestFilter:uwe,LinearMipmapLinearFilter:zo,LinearMipmapNearestFilter:Jg,LinearSRGBColorSpace:Od,LinearToneMapping:E5,LinearTransfer:Db,Loader:ka,LoaderUtils:Ed,LoadingManager:uk,LoopOnce:GK,LoopPingPong:VK,LoopRepeat:HK,MOUSE:Cc,Material:zi,MaterialLoader:ST,MathUtils:rY,Matrix2:_k,Matrix3:dn,Matrix4:qt,MaxEquation:MK,Mesh:vi,MeshBasicMaterial:Qs,MeshDepthMaterial:ak,MeshDistanceMaterial:sk,MeshLambertMaterial:OY,MeshMatcapMaterial:PY,MeshNormalMaterial:RY,MeshPhongMaterial:TY,MeshPhysicalMaterial:Zo,MeshStandardMaterial:g1,MeshToonMaterial:CY,MinEquation:wK,MirroredRepeatWrapping:Cv,MixOperation:UK,MultiplyBlending:tB,MultiplyOperation:o1,NearestFilter:si,NearestMipMapLinearFilter:cwe,NearestMipMapNearestFilter:lwe,NearestMipmapLinearFilter:up,NearestMipmapNearestFilter:VE,NeutralToneMapping:P5,NeverCompare:XK,NeverDepth:iM,NeverStencilFunc:Ewe,NoBlending:Fc,NoColorSpace:zu,NoNormalPacking:gwe,NoToneMapping:Wo,NormalAnimationBlendMode:JE,NormalBlending:xp,NormalGAPacking:ywe,NormalRGPacking:vwe,NotEqualCompare:ZK,NotEqualDepth:uM,NotEqualStencilFunc:Pwe,NumberKeyframeTrack:Pp,Object3D:zn,ObjectLoader:VEe,ObjectSpaceNormalMap:$K,OctahedronGeometry:p1,OneFactor:TK,OneMinusConstantAlphaFactor:FK,OneMinusConstantColorFactor:LK,OneMinusDstAlphaFactor:PK,OneMinusDstColorFactor:NK,OneMinusSrcAlphaFactor:rM,OneMinusSrcColorFactor:RK,OrthographicCamera:qo,PCFShadowMap:Yg,PCFSoftShadowMap:Ix,PMREMGenerator:dB,Path:$M,PerspectiveCamera:jr,Plane:ju,PlaneGeometry:cy,PlaneHelper:ITe,PointLight:hk,PointLightHelper:MTe,Points:Y5,PointsMaterial:oT,PolarGridHelper:RTe,PolyhedronGeometry:Gd,PositionalAudio:JEe,PropertyBinding:Hn,PropertyMixer:XY,QuadraticBezierCurve:tk,QuadraticBezierCurve3:nk,Quaternion:gi,QuaternionKeyframeTrack:Dp,QuaternionLinearInterpolant:LY,R11_EAC_Format:yM,RED_GREEN_RGTC2_Format:zM,RED_RGTC1_Format:UM,REVISION:s1,RG11_EAC_Format:bM,RGBADepthPacking:hwe,RGBAFormat:Ba,RGBAIntegerFormat:YE,RGBA_ASTC_10x10_Format:NM,RGBA_ASTC_10x5_Format:OM,RGBA_ASTC_10x6_Format:PM,RGBA_ASTC_10x8_Format:DM,RGBA_ASTC_12x10_Format:IM,RGBA_ASTC_12x12_Format:BM,RGBA_ASTC_4x4_Format:SM,RGBA_ASTC_5x4_Format:AM,RGBA_ASTC_5x5_Format:wM,RGBA_ASTC_6x5_Format:MM,RGBA_ASTC_6x6_Format:EM,RGBA_ASTC_8x5_Format:TM,RGBA_ASTC_8x6_Format:CM,RGBA_ASTC_8x8_Format:RM,RGBA_BPTC_Format:LM,RGBA_ETC2_EAC_Format:vM,RGBA_PVRTC_2BPPV1_Format:pM,RGBA_PVRTC_4BPPV1_Format:hM,RGBA_S3TC_DXT1_Format:Lx,RGBA_S3TC_DXT3_Format:kx,RGBA_S3TC_DXT5_Format:Fx,RGBDepthPacking:pwe,RGBFormat:k5,RGBIntegerFormat:dwe,RGB_BPTC_SIGNED_Format:kM,RGB_BPTC_UNSIGNED_Format:FM,RGB_ETC1_Format:mM,RGB_ETC2_Format:gM,RGB_PVRTC_2BPPV1_Format:dM,RGB_PVRTC_4BPPV1_Format:fM,RGB_S3TC_DXT1_Format:Bx,RGDepthPacking:mwe,RGFormat:Cp,RGIntegerFormat:KE,RawShaderMaterial:ik,Ray:Hp,Raycaster:YY,RectAreaLight:zY,RedFormat:XE,RedIntegerFormat:l1,ReinhardToneMapping:T5,RenderTarget:z5,RenderTarget3D:fTe,RepeatWrapping:Rd,ReplaceStencilOp:bwe,ReverseSubtractEquation:AK,RingGeometry:gT,SIGNED_R11_EAC_Format:xM,SIGNED_RED_GREEN_RGTC2_Format:GM,SIGNED_RED_RGTC1_Format:jM,SIGNED_RG11_EAC_Format:_M,SRGBColorSpace:Pa,SRGBTransfer:ir,Scene:W5,ShaderChunk:bn,ShaderLib:Dl,ShaderMaterial:Yo,ShadowMaterial:EY,Shape:_p,ShapeGeometry:vT,ShapePath:kTe,ShapeUtils:Bl,ShortType:N5,Skeleton:f1,SkeletonHelper:wTe,SkinnedMesh:$5,Source:Ad,Sphere:Zi,SphereGeometry:m1,Spherical:uB,SphericalHarmonics3:mk,SplineCurve:rk,SpotLight:dk,SpotLightHelper:ATe,Sprite:uY,SpriteMaterial:q5,SrcAlphaFactor:nM,SrcAlphaSaturateFactor:IK,SrcColorFactor:CK,StaticCopyUsage:Fwe,StaticDrawUsage:Nb,StaticReadUsage:Bwe,StereoCamera:$Ee,StreamCopyUsage:jwe,StreamDrawUsage:Iwe,StreamReadUsage:kwe,StringKeyframeTrack:qp,SubtractEquation:SK,SubtractiveBlending:eB,TOUCH:Zh,TangentSpaceNormalMap:zd,TetrahedronGeometry:yT,Texture:Gr,TextureLoader:FY,TextureUtils:HTe,Timer:gTe,TimestampQuery:Gwe,TorusGeometry:xT,TorusKnotGeometry:bT,Triangle:Ns,TriangleFanDrawMode:HM,TriangleStripDrawMode:U5,TrianglesDrawMode:WK,TubeGeometry:_T,UVMapping:HE,Uint16BufferAttribute:G5,Uint32BufferAttribute:H5,Uint8BufferAttribute:CMe,Uint8ClampedBufferAttribute:RMe,Uniform:bk,UniformsGroup:hTe,UniformsLib:St,UniformsUtils:oY,UnsignedByteType:ts,UnsignedInt101111Type:B5,UnsignedInt248Type:Ov,UnsignedInt5999Type:I5,UnsignedIntType:Ko,UnsignedShort4444Type:qE,UnsignedShort5551Type:$E,UnsignedShortType:Rv,VSMShadowMap:cp,Vector2:Ve,Vector3:ne,Vector4:mr,VectorKeyframeTrack:Np,VideoFrameTexture:ZMe,VideoTexture:hY,WebGL3DRenderTarget:mMe,WebGLArrayRenderTarget:pMe,WebGLCoordinateSystem:Zs,WebGLCubeRenderTarget:V5,WebGLRenderTarget:to,WebGLRenderer:iJ,WebGLUtils:rJ,WebGPUCoordinateSystem:Nv,WebXRController:UA,WireframeGeometry:MY,WrapAroundEnding:Pb,ZeroCurvatureEnding:fp,ZeroFactor:EK,ZeroSlopeEnding:dp,ZeroStencilOp:xwe,createCanvasElement:nY,error:zt,getConsoleFunction:$we,log:Bb,setConsoleFunction:qwe,warn:xt,warnOnce:Iv},Symbol.toStringTag,{value:"Module"}));var ND={exports:{}},ID={};var DH;function F3e(){if(DH)return ID;DH=1;var t=qb(),e=fK();function n(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,a=t.useRef,s=t.useEffect,o=t.useMemo,c=t.useDebugValue;return ID.useSyncExternalStoreWithSelector=function(u,h,p,v,y){var b=a(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=o(function(){function S(D){if(!E){if(E=!0,T=D,D=v(D),y!==void 0&&w.hasValue){var I=w.value;if(y(I,D))return P=I}return P=D}if(I=P,r(T,D))return I;var k=v(D);return y!==void 0&&y(I,k)?(T=D,I):(T=D,P=k)}var E=!1,T,P,R=p===void 0?null:p;return[function(){return S(h())},R===null?void 0:function(){return S(R())}]},[h,p,v,y]);var _=i(u,b[0],b[1]);return s(function(){w.hasValue=!0,w.value=_},[_]),c(_),_},ID}var NH;function U3e(){return NH||(NH=1,ND.exports=F3e()),ND.exports}var j3e=U3e();const z3e=ar(j3e),{useSyncExternalStoreWithSelector:G3e}=z3e,H3e=t=>t;function V3e(t,e=H3e,n){const r=G3e(t.subscribe,t.getState,t.getInitialState,e,n);return fe.useDebugValue(r),r}const IH=(t,e)=>{const n=yW(t),r=(i,a=e)=>V3e(n,i,a);return Object.assign(r,n),r},W3e=((t,e)=>t?IH(t,e):IH),q3e=t=>typeof t=="object"&&typeof t.then=="function",pp=[];function aJ(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e)return!1;const r=t.length;if(e.length!==r)return!1;for(let i=0;i<r;i++)if(!n(t[i],e[i]))return!1;return!0}function sJ(t,e=null,n=!1,r={}){e===null&&(e=[t]);for(const a of pp)if(aJ(e,a.keys,a.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(a,"error"))throw a.error;if(Object.prototype.hasOwnProperty.call(a,"response"))return r.lifespan&&r.lifespan>0&&(a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(a.remove,r.lifespan)),a.response;if(!n)throw a.promise}const i={keys:e,equal:r.equal,remove:()=>{const a=pp.indexOf(i);a!==-1&&pp.splice(a,1)},promise:(q3e(t)?t:t(...e)).then(a=>{i.response=a,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(a=>i.error=a)};if(pp.push(i),!n)throw i.promise}const $3e=(t,e,n)=>sJ(t,e,!1,n),X3e=(t,e,n)=>{sJ(t,e,!0,n)},K3e=t=>{if(t===void 0||t.length===0)pp.splice(0,pp.length);else{const e=pp.find(n=>aJ(t,n.keys,n.equal));e&&e.remove()}};var mB=RV();const Y3e=ar(mB);function Sk(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=e?t.return:t.child;for(;r;){const i=Sk(r,e,n);if(i)return i;r=e?null:r.sibling}}function oJ(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const Ak=oJ(j.createContext(null));class lJ extends j.Component{render(){return j.createElement(Ak.Provider,{value:this._reactInternals},this.props.children)}}function cJ(){const t=j.useContext(Ak);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=j.useId();return j.useMemo(()=>{for(const n of[t,t?.alternate]){if(!n)continue;const r=Sk(n,!1,i=>{let a=i.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(r)return r}},[t,e])}const J3e=Symbol.for("react.context"),Z3e=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===J3e;function Q3e(){const t=cJ(),[e]=j.useState(()=>new Map);e.clear();let n=t;for(;n;){const r=n.type;Z3e(r)&&r!==Ak&&!e.has(r)&&e.set(r,j.use(oJ(r))),n=n.return}return e}function eDe(){const t=Q3e();return j.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>j.createElement(e,null,j.createElement(n.Provider,{...r,value:t.get(n)})),e=>j.createElement(lJ,{...e})),[t])}function uJ(t){let e=t.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const fJ=t=>t&&t.isOrthographicCamera,tDe=t=>t&&t.hasOwnProperty("current"),nDe=t=>t!=null&&(typeof t=="string"||typeof t=="number"||t.isColor),v1=((t,e)=>typeof window<"u"&&(((t=window.document)==null?void 0:t.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?j.useLayoutEffect:j.useEffect;function dJ(t){const e=j.useRef(t);return v1(()=>{e.current=t},[t]),e}function rDe(){const t=cJ(),e=eDe();return j.useMemo(()=>({children:n})=>{const i=!!Sk(t,!0,a=>a.type===j.StrictMode)?j.StrictMode:j.Fragment;return M.jsx(i,{children:M.jsx(e,{children:n})})},[t,e])}function iDe({set:t}){return v1(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}const aDe=(t=>(t=class extends j.Component{constructor(...n){super(...n),this.state={error:!1}}componentDidCatch(n){this.props.set(n)}render(){return this.state.error?null:this.props.children}},t.getDerivedStateFromError=()=>({error:!0}),t))();function hJ(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}function Tg(t){var e;return(e=t.__r3f)==null?void 0:e.root.getState()}const Ur={obj:t=>t===Object(t)&&!Ur.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,nul:t=>t===null,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:r="reference",strict:i=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(Ur.str(t)||Ur.num(t)||Ur.boo(t))return t===e;const a=Ur.obj(t);if(a&&r==="reference")return t===e;const s=Ur.arr(t);if(s&&n==="reference")return t===e;if((s||a)&&t===e)return!0;let o;for(o in t)if(!(o in e))return!1;if(a&&n==="shallow"&&r==="shallow"){for(o in i?e:t)if(!Ur.equ(t[o],e[o],{strict:i,objects:"reference"}))return!1}else for(o in i?e:t)if(t[o]!==e[o])return!1;if(Ur.und(o)){if(s&&t.length===0&&e.length===0||a&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function sDe(t){const e={nodes:{},materials:{},meshes:{}};return t&&t.traverse(n=>{n.name&&(e.nodes[n.name]=n),n.material&&!e.materials[n.material.name]&&(e.materials[n.material.name]=n.material),n.isMesh&&!e.meshes[n.name]&&(e.meshes[n.name]=n)}),e}function oDe(t){t.type!=="Scene"&&(t.dispose==null||t.dispose());for(const e in t){const n=t[e];n?.type!=="Scene"&&(n==null||n.dispose==null||n.dispose())}}const pJ=["children","key","ref"];function lDe(t){const e={};for(const n in t)pJ.includes(n)||(e[n]=t[n]);return e}function XM(t,e,n,r){const i=t;let a=i?.__r3f;return a||(a={root:e,type:n,parent:null,children:[],props:lDe(r),object:i,eventCount:0,handlers:{},isHidden:!1},i&&(i.__r3f=a)),a}function jb(t,e){if(!e.includes("-"))return{root:t,key:e,target:t[e]};if(e in t)return{root:t,key:e,target:t[e]};let n=t;const r=e.split("-");for(const i of r){if(typeof n!="object"||n===null){if(n!==void 0){const a=r.slice(r.indexOf(i)).join("-");return{root:n,key:a,target:void 0}}return{root:t,key:e,target:void 0}}e=i,t=n,n=n[e]}return{root:t,key:e,target:n}}const BH=/-\d+$/;function KM(t,e){if(Ur.str(e.props.attach)){if(BH.test(e.props.attach)){const i=e.props.attach.replace(BH,""),{root:a,key:s}=jb(t.object,i);Array.isArray(a[s])||(a[s]=[])}const{root:n,key:r}=jb(t.object,e.props.attach);e.previousAttach=n[r],n[r]=e.object}else Ur.fun(e.props.attach)&&(e.previousAttach=e.props.attach(t.object,e.object))}function YM(t,e){if(Ur.str(e.props.attach)){const{root:n,key:r}=jb(t.object,e.props.attach),i=e.previousAttach;i===void 0?delete n[r]:n[r]=i}else e.previousAttach==null||e.previousAttach(t.object,e.object);delete e.previousAttach}const gB=[...pJ,"args","dispose","attach","object","onUpdate","dispose"],LH=new Map;function cDe(t){let e=LH.get(t.constructor);try{e||(e=new t.constructor,LH.set(t.constructor,e))}catch{}return e}function uDe(t,e){const n={};for(const r in e)if(!gB.includes(r)&&!Ur.equ(e[r],t.props[r])){n[r]=e[r];for(const i in e)i.startsWith(`${r}-`)&&(n[i]=e[i])}for(const r in t.props){if(gB.includes(r)||e.hasOwnProperty(r))continue;const{root:i,key:a}=jb(t.object,r);if(i.constructor&&i.constructor.length===0){const s=cDe(i);Ur.und(s)||(n[a]=s[a])}else n[a]=0}return n}const fDe=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],dDe=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function yd(t,e){var n;const r=t.__r3f,i=r&&uJ(r).getState(),a=r?.eventCount;for(const o in e){let c=e[o];if(gB.includes(o))continue;if(r&&dDe.test(o)){typeof c=="function"?r.handlers[o]=c:delete r.handlers[o],r.eventCount=Object.keys(r.handlers).length;continue}if(c===void 0)continue;let{root:u,key:h,target:p}=jb(t,o);if(p===void 0&&(typeof u!="object"||u===null))throw Error(`R3F: Cannot set "${o}". Ensure it is an object before setting "${h}".`);if(p instanceof Lv&&c instanceof Lv)p.mask=c.mask;else if(p instanceof bt&&nDe(c))p.set(c);else if(p!==null&&typeof p=="object"&&typeof p.set=="function"&&typeof p.copy=="function"&&c!=null&&c.constructor&&p.constructor===c.constructor)p.copy(c);else if(p!==null&&typeof p=="object"&&typeof p.set=="function"&&Array.isArray(c))typeof p.fromArray=="function"?p.fromArray(c):p.set(...c);else if(p!==null&&typeof p=="object"&&typeof p.set=="function"&&typeof c=="number")typeof p.setScalar=="function"?p.setScalar(c):p.set(c);else{var s;u[h]=c,i&&!i.linear&&fDe.includes(h)&&(s=u[h])!=null&&s.isTexture&&u[h].format===Ba&&u[h].type===ts&&(u[h].colorSpace=Pa)}}if(r!=null&&r.parent&&i!=null&&i.internal&&(n=r.object)!=null&&n.isObject3D&&a!==r.eventCount){const o=r.object,c=i.internal.interaction.indexOf(o);c>-1&&i.internal.interaction.splice(c,1),r.eventCount&&o.raycast!==null&&i.internal.interaction.push(o)}return r&&r.props.attach===void 0&&(r.object.isBufferGeometry?r.props.attach="geometry":r.object.isMaterial&&(r.props.attach="material")),r&&dy(r),t}function dy(t){var e;if(!t.parent)return;t.props.onUpdate==null||t.props.onUpdate(t.object);const n=(e=t.root)==null||e.getState==null?void 0:e.getState();n&&n.internal.frames===0&&n.invalidate()}function hDe(t,e){t.manual||(fJ(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix())}const es=t=>t?.isObject3D;function xA(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function mJ(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function pDe(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(r=>r!==e),n.initialHits=n.initialHits.filter(r=>r!==e),n.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&n.hovered.delete(i)}),n.capturedMap.forEach((r,i)=>{mJ(n.capturedMap,e,r,i)})}function mDe(t){function e(c){const{internal:u}=t.getState(),h=c.offsetX-u.initialClick[0],p=c.offsetY-u.initialClick[1];return Math.round(Math.sqrt(h*h+p*p))}function n(c){return c.filter(u=>["Move","Over","Enter","Out","Leave"].some(h=>{var p;return(p=u.__r3f)==null?void 0:p.handlers["onPointer"+h]}))}function r(c,u){const h=t.getState(),p=new Set,v=[],y=u?u(h.internal.interaction):h.internal.interaction;for(let S=0;S<y.length;S++){const E=Tg(y[S]);E&&(E.raycaster.camera=void 0)}h.previousRoot||h.events.compute==null||h.events.compute(c,h);function b(S){const E=Tg(S);if(!E||!E.events.enabled||E.raycaster.camera===null)return[];if(E.raycaster.camera===void 0){var T;E.events.compute==null||E.events.compute(c,E,(T=E.previousRoot)==null?void 0:T.getState()),E.raycaster.camera===void 0&&(E.raycaster.camera=null)}return E.raycaster.camera?E.raycaster.intersectObject(S,!0):[]}let w=y.flatMap(b).sort((S,E)=>{const T=Tg(S.object),P=Tg(E.object);return!T||!P?S.distance-E.distance:P.events.priority-T.events.priority||S.distance-E.distance}).filter(S=>{const E=xA(S);return p.has(E)?!1:(p.add(E),!0)});h.events.filter&&(w=h.events.filter(w,h));for(const S of w){let E=S.object;for(;E;){var _;(_=E.__r3f)!=null&&_.eventCount&&v.push({...S,eventObject:E}),E=E.parent}}if("pointerId"in c&&h.internal.capturedMap.has(c.pointerId))for(let S of h.internal.capturedMap.get(c.pointerId).values())p.has(xA(S.intersection))||v.push(S.intersection);return v}function i(c,u,h,p){if(c.length){const v={stopped:!1};for(const y of c){let b=Tg(y.object);if(b||y.object.traverseAncestors(w=>{const _=Tg(w);if(_)return b=_,!1}),b){const{raycaster:w,pointer:_,camera:S,internal:E}=b,T=new ne(_.x,_.y,0).unproject(S),P=B=>{var U,z;return(U=(z=E.capturedMap.get(B))==null?void 0:z.has(y.eventObject))!=null?U:!1},R=B=>{const U={intersection:y,target:u.target};E.capturedMap.has(B)?E.capturedMap.get(B).set(y.eventObject,U):E.capturedMap.set(B,new Map([[y.eventObject,U]])),u.target.setPointerCapture(B)},D=B=>{const U=E.capturedMap.get(B);U&&mJ(E.capturedMap,y.eventObject,U,B)};let I={};for(let B in u){let U=u[B];typeof U!="function"&&(I[B]=U)}let k={...y,...I,pointer:_,intersections:c,stopped:v.stopped,delta:h,unprojectedPoint:T,ray:w.ray,camera:S,stopPropagation(){const B="pointerId"in u&&E.capturedMap.get(u.pointerId);if((!B||B.has(y.eventObject))&&(k.stopped=v.stopped=!0,E.hovered.size&&Array.from(E.hovered.values()).find(U=>U.eventObject===y.eventObject))){const U=c.slice(0,c.indexOf(y));a([...U,y])}},target:{hasPointerCapture:P,setPointerCapture:R,releasePointerCapture:D},currentTarget:{hasPointerCapture:P,setPointerCapture:R,releasePointerCapture:D},nativeEvent:u};if(p(k),v.stopped===!0)break}}}return c}function a(c){const{internal:u}=t.getState();for(const h of u.hovered.values())if(!c.length||!c.find(p=>p.object===h.object&&p.index===h.index&&p.instanceId===h.instanceId)){const v=h.eventObject.__r3f;if(u.hovered.delete(xA(h)),v!=null&&v.eventCount){const y=v.handlers,b={...h,intersections:c};y.onPointerOut==null||y.onPointerOut(b),y.onPointerLeave==null||y.onPointerLeave(b)}}}function s(c,u){for(let h=0;h<u.length;h++){const p=u[h].__r3f;p==null||p.handlers.onPointerMissed==null||p.handlers.onPointerMissed(c)}}function o(c){switch(c){case"onPointerLeave":case"onPointerCancel":return()=>a([]);case"onLostPointerCapture":return u=>{const{internal:h}=t.getState();"pointerId"in u&&h.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(u.pointerId)&&(h.capturedMap.delete(u.pointerId),a([]))})}}return function(h){const{onPointerMissed:p,internal:v}=t.getState();v.lastEvent.current=h;const y=c==="onPointerMove",b=c==="onClick"||c==="onContextMenu"||c==="onDoubleClick",_=r(h,y?n:void 0),S=b?e(h):0;c==="onPointerDown"&&(v.initialClick=[h.offsetX,h.offsetY],v.initialHits=_.map(T=>T.eventObject)),b&&!_.length&&S<=2&&(s(h,v.interaction),p&&p(h)),y&&a(_);function E(T){const P=T.eventObject,R=P.__r3f;if(!(R!=null&&R.eventCount))return;const D=R.handlers;if(y){if(D.onPointerOver||D.onPointerEnter||D.onPointerOut||D.onPointerLeave){const I=xA(T),k=v.hovered.get(I);k?k.stopped&&T.stopPropagation():(v.hovered.set(I,T),D.onPointerOver==null||D.onPointerOver(T),D.onPointerEnter==null||D.onPointerEnter(T))}D.onPointerMove==null||D.onPointerMove(T)}else{const I=D[c];I?(!b||v.initialHits.includes(P))&&(s(h,v.interaction.filter(k=>!v.initialHits.includes(k))),I(T)):b&&v.initialHits.includes(P)&&s(h,v.interaction.filter(k=>!v.initialHits.includes(k)))}}i(_,h,S,E)}}return{handlePointer:o}}const kH=t=>!!(t!=null&&t.render),gJ=j.createContext(null),gDe=(t,e)=>{const n=W3e((o,c)=>{const u=new ne,h=new ne,p=new ne;function v(S=c().camera,E=h,T=c().size){const{width:P,height:R,top:D,left:I}=T,k=P/R;E.isVector3?p.copy(E):p.set(...E);const B=S.getWorldPosition(u).distanceTo(p);if(fJ(S))return{width:P/S.zoom,height:R/S.zoom,top:D,left:I,factor:1,distance:B,aspect:k};{const U=S.fov*Math.PI/180,z=2*Math.tan(U/2)*B,q=z*(P/R);return{width:q,height:z,top:D,left:I,factor:P/q,distance:B,aspect:k}}}let y;const b=S=>o(E=>({performance:{...E.performance,current:S}})),w=new Ve;return{set:o,get:c,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(S=1)=>t(c(),S),advance:(S,E)=>e(S,E,c()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new vk,pointer:w,mouse:w,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const S=c();y&&clearTimeout(y),S.performance.current!==S.performance.min&&b(S.performance.min),y=setTimeout(()=>b(c().performance.max),S.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:v},setEvents:S=>o(E=>({...E,events:{...E.events,...S}})),setSize:(S,E,T=0,P=0)=>{const R=c().camera,D={width:S,height:E,top:T,left:P};o(I=>({size:D,viewport:{...I.viewport,...v(R,h,D)}}))},setDpr:S=>o(E=>{const T=hJ(S);return{viewport:{...E.viewport,dpr:T,initialDpr:E.viewport.initialDpr||T}}}),setFrameloop:(S="always")=>{const E=c().clock;E.stop(),E.elapsedTime=0,S!=="never"&&(E.start(),E.elapsedTime=0),o(()=>({frameloop:S}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:j.createRef(),active:!1,frames:0,priority:0,subscribe:(S,E,T)=>{const P=c().internal;return P.priority=P.priority+(E>0?1:0),P.subscribers.push({ref:S,priority:E,store:T}),P.subscribers=P.subscribers.sort((R,D)=>R.priority-D.priority),()=>{const R=c().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(E>0?1:0),R.subscribers=R.subscribers.filter(D=>D.ref!==S))}}}}}),r=n.getState();let i=r.size,a=r.viewport.dpr,s=r.camera;return n.subscribe(()=>{const{camera:o,size:c,viewport:u,gl:h,set:p}=n.getState();if(c.width!==i.width||c.height!==i.height||u.dpr!==a){i=c,a=u.dpr,hDe(o,c),u.dpr>0&&h.setPixelRatio(u.dpr);const v=typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(c.width,c.height,v)}o!==s&&(s=o,p(v=>({viewport:{...v.viewport,...v.viewport.getCurrentViewport(o)}})))}),n.subscribe(o=>t(o)),n};function vJ(){const t=j.useContext(gJ);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function Cl(t=n=>n,e){return vJ()(t,e)}function wk(t,e=0){const n=vJ(),r=n.getState().internal.subscribe,i=dJ(t);return v1(()=>r(i,e,n),[e,r,n]),null}const FH=new WeakMap,vDe=t=>{var e;return typeof t=="function"&&(t==null||(e=t.prototype)==null?void 0:e.constructor)===t};function yJ(t,e){return function(n,...r){let i;return vDe(n)?(i=FH.get(n),i||(i=new n,FH.set(n,i))):i=n,t&&t(i),Promise.all(r.map(a=>new Promise((s,o)=>i.load(a,c=>{es(c?.scene)&&Object.assign(c,sDe(c.scene)),s(c)},e,c=>o(new Error(`Could not load ${a}: ${c?.message}`))))))}}function y1(t,e,n,r){const i=Array.isArray(e)?e:[e],a=$3e(yJ(n,r),[t,...i],{equal:Ur.equ});return Array.isArray(e)?a:a[0]}y1.preload=function(t,e,n){const r=Array.isArray(e)?e:[e];return X3e(yJ(n),[t,...r])};y1.clear=function(t,e){const n=Array.isArray(e)?e:[e];return K3e([t,...n])};const yDe=1,xDe=8,bDe=32,_De=2;var SDe={version:"9.5.0"};function ADe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var UH={exports:{}},jH={exports:{}},zH;function wDe(){return zH||(zH=1,(function(t){t.exports=function(e){function n(d,m,A,C){return new jy(d,m,A,C)}function r(){}function i(d){var m="https://react.dev/errors/"+d;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var A=2;A<arguments.length;A++)m+="&args[]="+encodeURIComponent(arguments[A])}return"Minified React error #"+d+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(d){var m=d,A=d;if(d.alternate)for(;m.return;)m=m.return;else{d=m;do m=d,(m.flags&4098)!==0&&(A=m.return),d=m.return;while(d)}return m.tag===3?A:null}function s(d){if(a(d)!==d)throw Error(i(188))}function o(d){var m=d.alternate;if(!m){if(m=a(d),m===null)throw Error(i(188));return m!==d?null:d}for(var A=d,C=m;;){var L=A.return;if(L===null)break;var F=L.alternate;if(F===null){if(C=L.return,C!==null){A=C;continue}break}if(L.child===F.child){for(F=L.child;F;){if(F===A)return s(L),d;if(F===C)return s(L),m;F=F.sibling}throw Error(i(188))}if(A.return!==C.return)A=L,C=F;else{for(var K=!1,ce=L.child;ce;){if(ce===A){K=!0,A=L,C=F;break}if(ce===C){K=!0,C=L,A=F;break}ce=ce.sibling}if(!K){for(ce=F.child;ce;){if(ce===A){K=!0,A=F,C=L;break}if(ce===C){K=!0,C=F,A=L;break}ce=ce.sibling}if(!K)throw Error(i(189))}}if(A.alternate!==C)throw Error(i(190))}if(A.tag!==3)throw Error(i(188));return A.stateNode.current===A?d:m}function c(d){var m=d.tag;if(m===5||m===26||m===27||m===6)return d;for(d=d.child;d!==null;){if(m=c(d),m!==null)return m;d=d.sibling}return null}function u(d){var m=d.tag;if(m===5||m===26||m===27||m===6)return d;for(d=d.child;d!==null;){if(d.tag!==4&&(m=u(d),m!==null))return m;d=d.sibling}return null}function h(d){return d===null||typeof d!="object"?null:(d=dl&&d[dl]||d["@@iterator"],typeof d=="function"?d:null)}function p(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===lc?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case hu:return"Fragment";case mu:return"Profiler";case pu:return"StrictMode";case Am:return"Suspense";case fl:return"SuspenseList";case dh:return"Activity"}if(typeof d=="object")switch(d.$$typeof){case du:return"Portal";case xs:return d.displayName||"Context";case fh:return(d._context.displayName||"Context")+".Consumer";case If:var m=d.render;return d=d.displayName,d||(d=m.displayName||m.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case wm:return m=d.displayName||null,m!==null?m:p(d.type)||"Memo";case ia:m=d._payload,d=d._init;try{return p(d(m))}catch{}}return null}function v(d){return{current:d}}function y(d){0>bu||(d.current=km[bu],km[bu]=null,bu--)}function b(d,m){bu++,km[bu]=d.current,d.current=m}function w(d){return d>>>=0,d===0?32:31-(Fm(d)/G_|0)|0}function _(d){var m=d&42;if(m!==0)return m;switch(d&-d){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return d&261888;case 262144:case 524288:case 1048576:case 2097152:return d&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return d&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return d}}function S(d,m,A){var C=d.pendingLanes;if(C===0)return 0;var L=0,F=d.suspendedLanes,K=d.pingedLanes;d=d.warmLanes;var ce=C&134217727;return ce!==0?(C=ce&~F,C!==0?L=_(C):(K&=ce,K!==0?L=_(K):A||(A=ce&~d,A!==0&&(L=_(A))))):(ce=C&~F,ce!==0?L=_(ce):K!==0?L=_(K):A||(A=C&~d,A!==0&&(L=_(A)))),L===0?0:m!==0&&m!==L&&(m&F)===0&&(F=L&-L,A=m&-m,F>=A||F===32&&(A&4194048)!==0)?m:L}function E(d,m){return(d.pendingLanes&~(d.suspendedLanes&~d.pingedLanes)&m)===0}function T(d,m){switch(d){case 1:case 2:case 4:case 8:case 64:return m+250;case 16:case 32: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 m+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function P(){var d=zf;return zf<<=1,(zf&62914560)===0&&(zf=4194304),d}function R(d){for(var m=[],A=0;31>A;A++)m.push(d);return m}function D(d,m){d.pendingLanes|=m,m!==268435456&&(d.suspendedLanes=0,d.pingedLanes=0,d.warmLanes=0)}function I(d,m,A,C,L,F){var K=d.pendingLanes;d.pendingLanes=A,d.suspendedLanes=0,d.pingedLanes=0,d.warmLanes=0,d.expiredLanes&=A,d.entangledLanes&=A,d.errorRecoveryDisabledLanes&=A,d.shellSuspendCounter=0;var ce=d.entanglements,Le=d.expirationTimes,Je=d.hiddenUpdates;for(A=K&~A;0<A;){var ht=31-_a(A),nt=1<<ht;ce[ht]=0,Le[ht]=-1;var Mt=Je[ht];if(Mt!==null)for(Je[ht]=null,ht=0;ht<Mt.length;ht++){var sn=Mt[ht];sn!==null&&(sn.lane&=-536870913)}A&=~nt}C!==0&&k(d,C,0),F!==0&&L===0&&d.tag!==0&&(d.suspendedLanes|=F&~(K&~m))}function k(d,m,A){d.pendingLanes|=m,d.suspendedLanes&=~m;var C=31-_a(m);d.entangledLanes|=m,d.entanglements[C]=d.entanglements[C]|1073741824|A&261930}function B(d,m){var A=d.entangledLanes|=m;for(d=d.entanglements;A;){var C=31-_a(A),L=1<<C;L&m|d[C]&m&&(d[C]|=m),A&=~L}}function U(d,m){var A=m&-m;return A=(A&42)!==0?1:z(A),(A&(d.suspendedLanes|m))!==0?0:A}function z(d){switch(d){case 2:d=1;break;case 8:d=4;break;case 32:d=16;break;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:d=128;break;case 268435456:d=134217728;break;default:d=0}return d}function q(d){return d&=-d,2<d?8<d?(d&134217727)!==0?32:268435456:8:2}function W(d){if(typeof M0=="function"&&W_(d),Sa&&typeof Sa.setStrictMode=="function")try{Sa.setStrictMode(Su,d)}catch{}}function ee(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function Q(d){if(Vm===void 0)try{throw Error()}catch(A){var m=A.stack.trim().match(/\n( *(at )?)/);Vm=m&&m[1]||"",So=-1<A.stack.indexOf(`
at`)?" (<anonymous>)":-1<A.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Vm+d+So}function V(d,m){if(!d||_h)return"";_h=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var C={DetermineComponentFrameRoot:function(){try{if(m){var nt=function(){throw Error()};if(Object.defineProperty(nt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(nt,[])}catch(sn){var Mt=sn}Reflect.construct(d,[],nt)}else{try{nt.call()}catch(sn){Mt=sn}d.call(nt.prototype)}}else{try{throw Error()}catch(sn){Mt=sn}(nt=d())&&typeof nt.catch=="function"&&nt.catch(function(){})}}catch(sn){if(sn&&Mt&&typeof sn.stack=="string")return[sn.stack,Mt.stack]}return[null,null]}};C.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var L=Object.getOwnPropertyDescriptor(C.DetermineComponentFrameRoot,"name");L&&L.configurable&&Object.defineProperty(C.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var F=C.DetermineComponentFrameRoot(),K=F[0],ce=F[1];if(K&&ce){var Le=K.split(`
`),Je=ce.split(`
`);for(L=C=0;C<Le.length&&!Le[C].includes("DetermineComponentFrameRoot");)C++;for(;L<Je.length&&!Je[L].includes("DetermineComponentFrameRoot");)L++;if(C===Le.length||L===Je.length)for(C=Le.length-1,L=Je.length-1;1<=C&&0<=L&&Le[C]!==Je[L];)L--;for(;1<=C&&0<=L;C--,L--)if(Le[C]!==Je[L]){if(C!==1||L!==1)do if(C--,L--,0>L||Le[C]!==Je[L]){var ht=`
`+Le[C].replace(" at new "," at ");return d.displayName&&ht.includes("<anonymous>")&&(ht=ht.replace("<anonymous>",d.displayName)),ht}while(1<=C&&0<=L);break}}}finally{_h=!1,Error.prepareStackTrace=A}return(A=d?d.displayName||d.name:"")?Q(A):""}function $(d,m){switch(d.tag){case 26:case 27:case 5:return Q(d.type);case 16:return Q("Lazy");case 13:return d.child!==m&&m!==null?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return V(d.type,!1);case 11:return V(d.type.render,!1);case 1:return V(d.type,!0);case 31:return Q("Activity");default:return""}}function Y(d){try{var m="",A=null;do m+=$(d,A),A=d,d=d.return;while(d);return m}catch(C){return`
Error generating stack: `+C.message+`
`+C.stack}}function ie(d,m){if(typeof d=="object"&&d!==null){var A=E0.get(d);return A!==void 0?A:(m={value:d,source:m,stack:Y(m)},E0.set(d,m),m)}return{value:d,source:m,stack:Y(m)}}function de(d,m){ml[Ao++]=Sh,ml[Ao++]=tr,tr=d,Sh=m}function X(d,m,A){Ss[$a++]=Di,Ss[$a++]=zs,Ss[$a++]=As,As=d;var C=Di;d=zs;var L=32-_a(C)-1;C&=~(1<<L),A+=1;var F=32-_a(m)+L;if(30<F){var K=L-L%5;F=(C&(1<<K)-1).toString(32),C>>=K,L-=K,Di=1<<32-_a(m)+L|A<<L|C,zs=F+d}else Di=1<<F|A<<L|C,zs=d}function ae(d){d.return!==null&&(de(d,1),X(d,1,0))}function ue(d){for(;d===tr;)tr=ml[--Ao],ml[Ao]=null,Sh=ml[--Ao],ml[Ao]=null;for(;d===As;)As=Ss[--$a],Ss[$a]=null,zs=Ss[--$a],Ss[$a]=null,Di=Ss[--$a],Ss[$a]=null}function Se(d,m){Ss[$a++]=Di,Ss[$a++]=zs,Ss[$a++]=As,Di=m.id,zs=m.overflow,As=d}function $e(d,m){b(Ni,m),b(gl,d),b(Ai,null),d=i_(m),y(Ai),b(Ai,d)}function me(){y(Ai),y(gl),y(Ni)}function ve(d){d.memoizedState!==null&&b(Ah,d);var m=Ai.current,A=kf(m,d.type);m!==A&&(b(gl,d),b(Ai,A))}function We(d){gl.current===d&&(y(Ai),y(gl)),Ah.current===d&&(y(Ah),Hr?yu._currentValue=vu:yu._currentValue2=vu)}function _e(d){var m=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ue(ie(m,d)),Wm}function Fe(d,m){if(!xr)throw Error(i(175));O_(d.stateNode,d.type,d.memoizedProps,m,d)||_e(d,!0)}function Xe(d){for(di=d.return;di;)switch(di.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:di=di.return}}function Re(d){if(!xr||d!==di)return!1;if(!Mn)return Xe(d),Mn=!0,!1;var m=d.tag;if(fi?m!==3&&m!==27&&(m!==5||jf(d.type)&&!aa(d.type,d.memoizedProps))&&br&&_e(d):m!==3&&(m!==5||jf(d.type)&&!aa(d.type,d.memoizedProps))&&br&&_e(d),Xe(d),m===13){if(!xr)throw Error(i(316));if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));br=p0(d)}else if(m===31){if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));br=D_(d)}else br=fi&&m===27?S_(d.type,br):di?__(d.stateNode):null;return!0}function ot(){xr&&(br=di=null,Mn=!1)}function we(){var d=wo;return d!==null&&(Ma===null?Ma=d:Ma.push.apply(Ma,d),wo=null),d}function Ue(d){wo===null?wo=[d]:wo.push(d)}function Be(d,m,A){Hr?(b(ws,m._currentValue),m._currentValue=A):(b(ws,m._currentValue2),m._currentValue2=A)}function Ye(d){var m=ws.current;Hr?d._currentValue=m:d._currentValue2=m,y(ws)}function re(d,m,A){for(;d!==null;){var C=d.alternate;if((d.childLanes&m)!==m?(d.childLanes|=m,C!==null&&(C.childLanes|=m)):C!==null&&(C.childLanes&m)!==m&&(C.childLanes|=m),d===A)break;d=d.return}}function At(d,m,A,C){var L=d.child;for(L!==null&&(L.return=d);L!==null;){var F=L.dependencies;if(F!==null){var K=L.child;F=F.firstContext;e:for(;F!==null;){var ce=F;F=L;for(var Le=0;Le<m.length;Le++)if(ce.context===m[Le]){F.lanes|=A,ce=F.alternate,ce!==null&&(ce.lanes|=A),re(F.return,A,d),C||(K=null);break e}F=ce.next}}else if(L.tag===18){if(K=L.return,K===null)throw Error(i(341));K.lanes|=A,F=K.alternate,F!==null&&(F.lanes|=A),re(K,A,d),K=null}else K=L.child;if(K!==null)K.return=L;else for(K=L;K!==null;){if(K===d){K=null;break}if(L=K.sibling,L!==null){L.return=K.return,K=L;break}K=K.return}L=K}}function ft(d,m,A,C){d=null;for(var L=m,F=!1;L!==null;){if(!F){if((L.flags&524288)!==0)F=!0;else if((L.flags&262144)!==0)break}if(L.tag===10){var K=L.alternate;if(K===null)throw Error(i(387));if(K=K.memoizedProps,K!==null){var ce=L.type;Wr(L.pendingProps.value,K.value)||(d!==null?d.push(ce):d=[ce])}}else if(L===Ah.current){if(K=L.alternate,K===null)throw Error(i(387));K.memoizedState.memoizedState!==L.memoizedState.memoizedState&&(d!==null?d.push(yu):d=[yu])}L=L.return}d!==null&&At(m,d,A,C),m.flags|=262144}function Et(d){for(d=d.firstContext;d!==null;){var m=d.context;if(!Wr(Hr?m._currentValue:m._currentValue2,d.memoizedValue))return!0;d=d.next}return!1}function Ze(d){cr=d,Gs=null,d=d.dependencies,d!==null&&(d.firstContext=null)}function te(d){return he(cr,d)}function H(d,m){return cr===null&&Ze(d),he(d,m)}function he(d,m){var A=Hr?m._currentValue:m._currentValue2;if(m={context:m,memoizedValue:A,next:null},Gs===null){if(d===null)throw Error(i(308));Gs=m,d.dependencies={lanes:0,firstContext:m},d.flags|=524288}else Gs=Gs.next=m;return A}function Ne(){return{controller:new q_,data:new Map,refCount:0}}function je(d){d.refCount--,d.refCount===0&&wi(WT,function(){d.controller.abort()})}function Ie(){}function _t(d){d!==Yn&&d.next===null&&(Yn===null?wh=Yn=d:Yn=Yn.next=d),Ms=!0,Xi||(Xi=!0,se())}function lt(d,m){if(!qm&&Ms){qm=!0;do for(var A=!1,C=wh;C!==null;){if(d!==0){var L=C.pendingLanes;if(L===0)var F=0;else{var K=C.suspendedLanes,ce=C.pingedLanes;F=(1<<31-_a(42|d)+1)-1,F&=L&~(K&~ce),F=F&201326741?F&201326741|1:F?F|2:0}F!==0&&(A=!0,vt(C,F))}else F=En,F=S(C,C===gn?F:0,C.cancelPendingCommit!==null||C.timeoutHandle!==ba),(F&3)===0||E(C,F)||(A=!0,vt(C,F));C=C.next}while(A);qm=!1}}function Tt(){Gt()}function Gt(){Ms=Xi=!1;var d=0;hc!==0&&gu()&&(d=hc);for(var m=$i(),A=null,C=wh;C!==null;){var L=C.next,F=Qe(C,m);F===0?(C.next=null,A===null?wh=L:A.next=L,L===null&&(Yn=A)):(A=C,(d!==0||(F&3)!==0)&&(Ms=!0)),C=L}ni!==0&&ni!==5||lt(d),hc!==0&&(hc=0)}function Qe(d,m){for(var A=d.suspendedLanes,C=d.pingedLanes,L=d.expirationTimes,F=d.pendingLanes&-62914561;0<F;){var K=31-_a(F),ce=1<<K,Le=L[K];Le===-1?((ce&A)===0||(ce&C)!==0)&&(L[K]=T(ce,m)):Le<=m&&(d.expiredLanes|=ce),F&=~ce}if(m=gn,A=En,A=S(d,d===m?A:0,d.cancelPendingCommit!==null||d.timeoutHandle!==ba),C=d.callbackNode,A===0||d===m&&(Zn===2||Zn===9)||d.cancelPendingCommit!==null)return C!==null&&C!==null&&jm(C),d.callbackNode=null,d.callbackPriority=0;if((A&3)===0||E(d,A)){if(m=A&-A,m===d.callbackPriority)return m;switch(C!==null&&jm(C),q(A)){case 2:case 8:A=V_;break;case 32:A=bh;break;case 268435456:A=Gm;break;default:A=bh}return C=st.bind(null,d),A=xh(A,C),d.callbackPriority=m,d.callbackNode=A,m}return C!==null&&C!==null&&jm(C),d.callbackPriority=2,d.callbackNode=null,2}function st(d,m){if(ni!==0&&ni!==5)return d.callbackNode=null,d.callbackPriority=0,null;var A=d.callbackNode;if(xo()&&d.callbackNode!==A)return null;var C=En;return C=S(d,d===gn?C:0,d.cancelPendingCommit!==null||d.timeoutHandle!==ba),C===0?null:(js(d,C,m),Qe(d,$i()),d.callbackNode!=null&&d.callbackNode===A?st.bind(null,d):null)}function vt(d,m){if(xo())return null;js(d,m,!0)}function se(){Zy?Qy(function(){(Sn&6)!==0?xh(zm,Tt):Gt()}):xh(zm,Tt)}function Ae(){if(hc===0){var d=vl;d===0&&(d=Um,Um<<=1,(Um&261888)===0&&(Um=256)),hc=d}return hc}function dt(d,m){if(Gf===null){var A=Gf=[];T0=0,vl=Ae(),hi={status:"pending",value:void 0,then:function(C){A.push(C)}}}return T0++,m.then(oe,oe),m}function oe(){if(--T0===0&&Gf!==null){hi!==null&&(hi.status="fulfilled");var d=Gf;Gf=null,vl=0,hi=null;for(var m=0;m<d.length;m++)(0,d[m])()}}function it(d,m){var A=[],C={status:"pending",value:null,reason:null,then:function(L){A.push(L)}};return d.then(function(){C.status="fulfilled",C.value=m;for(var L=0;L<A.length;L++)(0,A[L])(m)},function(L){for(C.status="rejected",C.reason=L,L=0;L<A.length;L++)(0,A[L])(void 0)}),C}function et(){var d=pc.current;return d!==null?d:gn.pooledCache}function pt(d,m){m===null?b(pc,pc.current):b(pc,m.pool)}function tt(){var d=et();return d===null?null:{parent:Hr?_r._currentValue:_r._currentValue2,pool:d}}function He(d,m){if(Wr(d,m))return!0;if(typeof d!="object"||d===null||typeof m!="object"||m===null)return!1;var A=Object.keys(d),C=Object.keys(m);if(A.length!==C.length)return!1;for(C=0;C<A.length;C++){var L=A[C];if(!VT.call(m,L)||!Wr(d[L],m[L]))return!1}return!0}function at(d){return d=d.status,d==="fulfilled"||d==="rejected"}function jt(d,m,A){switch(A=d[A],A===void 0?d.push(m):A!==m&&(m.then(Ie,Ie),m=A),m.status){case"fulfilled":return m.value;case"rejected":throw d=m.reason,Mr(d),d;default:if(typeof m.status=="string")m.then(Ie,Ie);else{if(d=gn,d!==null&&100<d.shellSuspendCounter)throw Error(i(482));d=m,d.status="pending",d.then(function(C){if(m.status==="pending"){var L=m;L.status="fulfilled",L.value=C}},function(C){if(m.status==="pending"){var L=m;L.status="rejected",L.reason=C}})}switch(m.status){case"fulfilled":return m.value;case"rejected":throw d=m.reason,Mr(d),d}throw oa=m,pi}}function un(d){try{var m=d._init;return m(d._payload)}catch(A){throw A!==null&&typeof A=="object"&&typeof A.then=="function"?(oa=A,pi):A}}function hn(){if(oa===null)throw Error(i(459));var d=oa;return oa=null,d}function Mr(d){if(d===pi||d===Ts)throw Error(i(483))}function oi(d){var m=Au;return Au+=1,mc===null&&(mc=[]),jt(mc,d,m)}function Wl(d,m){m=m.props.ref,d.ref=m!==void 0?m:null}function ql(d,m){throw m.$$typeof===fu?Error(i(525)):(d=Object.prototype.toString.call(m),Error(i(31,d==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":d)))}function Zc(d){function m(Ce,be){if(d){var De=Ce.deletions;De===null?(Ce.deletions=[be],Ce.flags|=16):De.push(be)}}function A(Ce,be){if(!d)return null;for(;be!==null;)m(Ce,be),be=be.sibling;return null}function C(Ce){for(var be=new Map;Ce!==null;)Ce.key!==null?be.set(Ce.key,Ce):be.set(Ce.index,Ce),Ce=Ce.sibling;return be}function L(Ce,be){return Ce=Wa(Ce,be),Ce.index=0,Ce.sibling=null,Ce}function F(Ce,be,De){return Ce.index=De,d?(De=Ce.alternate,De!==null?(De=De.index,De<be?(Ce.flags|=67108866,be):De):(Ce.flags|=67108866,be)):(Ce.flags|=1048576,be)}function K(Ce){return d&&Ce.alternate===null&&(Ce.flags|=67108866),Ce}function ce(Ce,be,De,ut){return be===null||be.tag!==6?(be=zy(De,Ce.mode,ut),be.return=Ce,be):(be=L(be,De),be.return=Ce,be)}function Le(Ce,be,De,ut){var $t=De.type;return $t===hu?ht(Ce,be,De.props.children,ut,De.key):be!==null&&(be.elementType===$t||typeof $t=="object"&&$t!==null&&$t.$$typeof===ia&&un($t)===be.type)?(be=L(be,De.props),Wl(be,De),be.return=Ce,be):(be=ul(De.type,De.key,De.props,null,Ce.mode,ut),Wl(be,De),be.return=Ce,be)}function Je(Ce,be,De,ut){return be===null||be.tag!==4||be.stateNode.containerInfo!==De.containerInfo||be.stateNode.implementation!==De.implementation?(be=Hy(De,Ce.mode,ut),be.return=Ce,be):(be=L(be,De.children||[]),be.return=Ce,be)}function ht(Ce,be,De,ut,$t){return be===null||be.tag!==7?(be=ys(De,Ce.mode,ut,$t),be.return=Ce,be):(be=L(be,De),be.return=Ce,be)}function nt(Ce,be,De){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return be=zy(""+be,Ce.mode,De),be.return=Ce,be;if(typeof be=="object"&&be!==null){switch(be.$$typeof){case bo:return De=ul(be.type,be.key,be.props,null,Ce.mode,De),Wl(De,be),De.return=Ce,De;case du:return be=Hy(be,Ce.mode,De),be.return=Ce,be;case ia:return be=un(be),nt(Ce,be,De)}if(cc(be)||h(be))return be=ys(be,Ce.mode,De,null),be.return=Ce,be;if(typeof be.then=="function")return nt(Ce,oi(be),De);if(be.$$typeof===xs)return nt(Ce,H(Ce,be),De);ql(Ce,be)}return null}function Mt(Ce,be,De,ut){var $t=be!==null?be.key:null;if(typeof De=="string"&&De!==""||typeof De=="number"||typeof De=="bigint")return $t!==null?null:ce(Ce,be,""+De,ut);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case bo:return De.key===$t?Le(Ce,be,De,ut):null;case du:return De.key===$t?Je(Ce,be,De,ut):null;case ia:return De=un(De),Mt(Ce,be,De,ut)}if(cc(De)||h(De))return $t!==null?null:ht(Ce,be,De,ut,null);if(typeof De.then=="function")return Mt(Ce,be,oi(De),ut);if(De.$$typeof===xs)return Mt(Ce,be,H(Ce,De),ut);ql(Ce,De)}return null}function sn(Ce,be,De,ut,$t){if(typeof ut=="string"&&ut!==""||typeof ut=="number"||typeof ut=="bigint")return Ce=Ce.get(De)||null,ce(be,Ce,""+ut,$t);if(typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case bo:return Ce=Ce.get(ut.key===null?De:ut.key)||null,Le(be,Ce,ut,$t);case du:return Ce=Ce.get(ut.key===null?De:ut.key)||null,Je(be,Ce,ut,$t);case ia:return ut=un(ut),sn(Ce,be,De,ut,$t)}if(cc(ut)||h(ut))return Ce=Ce.get(De)||null,ht(be,Ce,ut,$t,null);if(typeof ut.then=="function")return sn(Ce,be,De,oi(ut),$t);if(ut.$$typeof===xs)return sn(Ce,be,De,H(be,ut),$t);ql(be,ut)}return null}function Xr(Ce,be,De,ut){for(var $t=null,Nr=null,Kt=be,Ln=be=0,Mi=null;Kt!==null&&Ln<De.length;Ln++){Kt.index>Ln?(Mi=Kt,Kt=null):Mi=Kt.sibling;var Gn=Mt(Ce,Kt,De[Ln],ut);if(Gn===null){Kt===null&&(Kt=Mi);break}d&&Kt&&Gn.alternate===null&&m(Ce,Kt),be=F(Gn,be,Ln),Nr===null?$t=Gn:Nr.sibling=Gn,Nr=Gn,Kt=Mi}if(Ln===De.length)return A(Ce,Kt),Mn&&de(Ce,Ln),$t;if(Kt===null){for(;Ln<De.length;Ln++)Kt=nt(Ce,De[Ln],ut),Kt!==null&&(be=F(Kt,be,Ln),Nr===null?$t=Kt:Nr.sibling=Kt,Nr=Kt);return Mn&&de(Ce,Ln),$t}for(Kt=C(Kt);Ln<De.length;Ln++)Mi=sn(Kt,Ce,Ln,De[Ln],ut),Mi!==null&&(d&&Mi.alternate!==null&&Kt.delete(Mi.key===null?Ln:Mi.key),be=F(Mi,be,Ln),Nr===null?$t=Mi:Nr.sibling=Mi,Nr=Mi);return d&&Kt.forEach(function(Os){return m(Ce,Os)}),Mn&&de(Ce,Ln),$t}function Yf(Ce,be,De,ut){if(De==null)throw Error(i(151));for(var $t=null,Nr=null,Kt=be,Ln=be=0,Mi=null,Gn=De.next();Kt!==null&&!Gn.done;Ln++,Gn=De.next()){Kt.index>Ln?(Mi=Kt,Kt=null):Mi=Kt.sibling;var Os=Mt(Ce,Kt,Gn.value,ut);if(Os===null){Kt===null&&(Kt=Mi);break}d&&Kt&&Os.alternate===null&&m(Ce,Kt),be=F(Os,be,Ln),Nr===null?$t=Os:Nr.sibling=Os,Nr=Os,Kt=Mi}if(Gn.done)return A(Ce,Kt),Mn&&de(Ce,Ln),$t;if(Kt===null){for(;!Gn.done;Ln++,Gn=De.next())Gn=nt(Ce,Gn.value,ut),Gn!==null&&(be=F(Gn,be,Ln),Nr===null?$t=Gn:Nr.sibling=Gn,Nr=Gn);return Mn&&de(Ce,Ln),$t}for(Kt=C(Kt);!Gn.done;Ln++,Gn=De.next())Gn=sn(Kt,Ce,Ln,Gn.value,ut),Gn!==null&&(d&&Gn.alternate!==null&&Kt.delete(Gn.key===null?Ln:Gn.key),be=F(Gn,be,Ln),Nr===null?$t=Gn:Nr.sibling=Gn,Nr=Gn);return d&&Kt.forEach(function(qT){return m(Ce,qT)}),Mn&&de(Ce,Ln),$t}function Ac(Ce,be,De,ut){if(typeof De=="object"&&De!==null&&De.type===hu&&De.key===null&&(De=De.props.children),typeof De=="object"&&De!==null){switch(De.$$typeof){case bo:e:{for(var $t=De.key;be!==null;){if(be.key===$t){if($t=De.type,$t===hu){if(be.tag===7){A(Ce,be.sibling),ut=L(be,De.props.children),ut.return=Ce,Ce=ut;break e}}else if(be.elementType===$t||typeof $t=="object"&&$t!==null&&$t.$$typeof===ia&&un($t)===be.type){A(Ce,be.sibling),ut=L(be,De.props),Wl(ut,De),ut.return=Ce,Ce=ut;break e}A(Ce,be);break}else m(Ce,be);be=be.sibling}De.type===hu?(ut=ys(De.props.children,Ce.mode,ut,De.key),ut.return=Ce,Ce=ut):(ut=ul(De.type,De.key,De.props,null,Ce.mode,ut),Wl(ut,De),ut.return=Ce,Ce=ut)}return K(Ce);case du:e:{for($t=De.key;be!==null;){if(be.key===$t)if(be.tag===4&&be.stateNode.containerInfo===De.containerInfo&&be.stateNode.implementation===De.implementation){A(Ce,be.sibling),ut=L(be,De.children||[]),ut.return=Ce,Ce=ut;break e}else{A(Ce,be);break}else m(Ce,be);be=be.sibling}ut=Hy(De,Ce.mode,ut),ut.return=Ce,Ce=ut}return K(Ce);case ia:return De=un(De),Ac(Ce,be,De,ut)}if(cc(De))return Xr(Ce,be,De,ut);if(h(De)){if($t=h(De),typeof $t!="function")throw Error(i(150));return De=$t.call(De),Yf(Ce,be,De,ut)}if(typeof De.then=="function")return Ac(Ce,be,oi(De),ut);if(De.$$typeof===xs)return Ac(Ce,be,H(Ce,De),ut);ql(Ce,De)}return typeof De=="string"&&De!==""||typeof De=="number"||typeof De=="bigint"?(De=""+De,be!==null&&be.tag===6?(A(Ce,be.sibling),ut=L(be,De),ut.return=Ce,Ce=ut):(A(Ce,be),ut=zy(De,Ce.mode,ut),ut.return=Ce,Ce=ut),K(Ce)):A(Ce,be)}return function(Ce,be,De,ut){try{Au=0;var $t=Ac(Ce,be,De,ut);return mc=null,$t}catch(Kt){if(Kt===pi||Kt===Ts)throw Kt;var Nr=n(29,Kt,null,Ce.mode);return Nr.lanes=ut,Nr.return=Ce,Nr}}}function $l(){for(var d=Eo,m=wu=Eo=0;m<d;){var A=Bi[m];Bi[m++]=null;var C=Bi[m];Bi[m++]=null;var L=Bi[m];Bi[m++]=null;var F=Bi[m];if(Bi[m++]=null,C!==null&&L!==null){var K=C.pending;K===null?L.next=L:(L.next=K.next,K.next=L),C.pending=L}F!==0&&Fa(A,L,F)}}function el(d,m,A,C){Bi[Eo++]=d,Bi[Eo++]=m,Bi[Eo++]=A,Bi[Eo++]=C,wu|=C,d.lanes|=C,d=d.alternate,d!==null&&(d.lanes|=C)}function Qc(d,m,A,C){return el(d,m,A,C),Er(d)}function Wi(d,m){return el(d,null,null,m),Er(d)}function Fa(d,m,A){d.lanes|=A;var C=d.alternate;C!==null&&(C.lanes|=A);for(var L=!1,F=d.return;F!==null;)F.childLanes|=A,C=F.alternate,C!==null&&(C.childLanes|=A),F.tag===22&&(d=F.stateNode,d===null||d._visibility&1||(L=!0)),d=F,F=F.return;return d.tag===3?(F=d.stateNode,L&&m!==null&&(L=31-_a(A),d=F.hiddenUpdates,C=d[L],C===null?d[L]=[m]:C.push(m),m.lane=A|536870912),F):null}function Er(d){if(50<jn)throw jn=0,Oh=null,Error(i(185));for(var m=d.return;m!==null;)d=m,m=d.return;return d.tag===3?d.stateNode:null}function li(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(d,m){d=d.updateQueue,m.updateQueue===d&&(m.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,callbacks:null})}function ja(d){return{lane:d,tag:0,payload:null,callback:null,next:null}}function za(d,m,A){var C=d.updateQueue;if(C===null)return null;if(C=C.shared,(Sn&2)!==0){var L=C.pending;return L===null?m.next=m:(m.next=L.next,L.next=m),C.pending=m,m=Er(d),Fa(d,null,A),m}return el(d,C,m,A),Er(d)}function Xl(d,m,A){if(m=m.updateQueue,m!==null&&(m=m.shared,(A&4194048)!==0)){var C=m.lanes;C&=d.pendingLanes,A|=C,m.lanes=A,B(d,A)}}function eu(d,m){var A=d.updateQueue,C=d.alternate;if(C!==null&&(C=C.updateQueue,A===C)){var L=null,F=null;if(A=A.firstBaseUpdate,A!==null){do{var K={lane:A.lane,tag:A.tag,payload:A.payload,callback:null,next:null};F===null?L=F=K:F=F.next=K,A=A.next}while(A!==null);F===null?L=F=m:F=F.next=m}else L=F=m;A={baseState:C.baseState,firstBaseUpdate:L,lastBaseUpdate:F,shared:C.shared,callbacks:C.callbacks},d.updateQueue=A;return}d=A.lastBaseUpdate,d===null?A.firstBaseUpdate=m:d.next=m,A.lastBaseUpdate=m}function Fs(){if(Xm){var d=hi;if(d!==null)throw d}}function tl(d,m,A,C){Xm=!1;var L=d.updateQueue;Xa=!1;var F=L.firstBaseUpdate,K=L.lastBaseUpdate,ce=L.shared.pending;if(ce!==null){L.shared.pending=null;var Le=ce,Je=Le.next;Le.next=null,K===null?F=Je:K.next=Je,K=Le;var ht=d.alternate;ht!==null&&(ht=ht.updateQueue,ce=ht.lastBaseUpdate,ce!==K&&(ce===null?ht.firstBaseUpdate=Je:ce.next=Je,ht.lastBaseUpdate=Le))}if(F!==null){var nt=L.baseState;K=0,ht=Je=Le=null,ce=F;do{var Mt=ce.lane&-536870913,sn=Mt!==ce.lane;if(sn?(En&Mt)===Mt:(C&Mt)===Mt){Mt!==0&&Mt===vl&&(Xm=!0),ht!==null&&(ht=ht.next={lane:0,tag:ce.tag,payload:ce.payload,callback:null,next:null});e:{var Xr=d,Yf=ce;Mt=m;var Ac=A;switch(Yf.tag){case 1:if(Xr=Yf.payload,typeof Xr=="function"){nt=Xr.call(Ac,nt,Mt);break e}nt=Xr;break e;case 3:Xr.flags=Xr.flags&-65537|128;case 0:if(Xr=Yf.payload,Mt=typeof Xr=="function"?Xr.call(Ac,nt,Mt):Xr,Mt==null)break e;nt=Sm({},nt,Mt);break e;case 2:Xa=!0}}Mt=ce.callback,Mt!==null&&(d.flags|=64,sn&&(d.flags|=8192),sn=L.callbacks,sn===null?L.callbacks=[Mt]:sn.push(Mt))}else sn={lane:Mt,tag:ce.tag,payload:ce.payload,callback:ce.callback,next:null},ht===null?(Je=ht=sn,Le=nt):ht=ht.next=sn,K|=Mt;if(ce=ce.next,ce===null){if(ce=L.shared.pending,ce===null)break;sn=ce,ce=sn.next,sn.next=null,L.lastBaseUpdate=sn,L.shared.pending=null}}while(!0);ht===null&&(Le=nt),L.baseState=Le,L.firstBaseUpdate=Je,L.lastBaseUpdate=ht,F===null&&(L.shared.lanes=0),xl|=K,d.lanes=K,d.memoizedState=nt}}function nl(d,m){if(typeof d!="function")throw Error(i(191,d));d.call(m)}function rl(d,m){var A=d.callbacks;if(A!==null)for(d.callbacks=null,d=0;d<A.length;d++)nl(A[d],m)}function Kl(d,m){d=Co,b(gc,d),b(Mu,m),Co=d|m.baseLanes}function so(){b(gc,Co),b(Mu,Mu.current)}function J(){Co=gc.current,y(Mu),y(gc)}function ge(d){var m=d.alternate;b(Lr,Lr.current&1),b(Aa,d),wa===null&&(m===null||Mu.current!==null||m.memoizedState!==null)&&(wa=d)}function Pe(d){b(Lr,Lr.current),b(Aa,d),wa===null&&(wa=d)}function Te(d){d.tag===22?(b(Lr,Lr.current),b(Aa,d),wa===null&&(wa=d)):xe()}function xe(){b(Lr,Lr.current),b(Aa,Aa.current)}function ct(d){y(Aa),wa===d&&(wa=null),y(Lr)}function wt(d){for(var m=d;m!==null;){if(m.tag===13){var A=m.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||fc(A)||Om(A)))return m}else if(m.tag===19&&(m.memoizedProps.revealOrder==="forwards"||m.memoizedProps.revealOrder==="backwards"||m.memoizedProps.revealOrder==="unstable_legacy-backwards"||m.memoizedProps.revealOrder==="together")){if((m.flags&128)!==0)return m}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}function rt(){throw Error(i(321))}function Ct(d,m){if(m===null)return!1;for(var A=0;A<m.length&&A<d.length;A++)if(!Wr(d[A],m[A]))return!1;return!0}function Rt(d,m,A,C,L,F){return yl=F,ln=m,m.memoizedState=null,m.updateQueue=null,m.lanes=0,Vt.H=d===null||d.memoizedState===null?Or:To,Pn=!1,F=A(C,L),Pn=!1,fn&&(F=Dt(m,A,C,L)),Ht(d),F}function Ht(d){Vt.H=Ka;var m=Ut!==null&&Ut.next!==null;if(yl=0,nn=Ut=ln=null,mn=!1,Cs=0,Hs=null,m)throw Error(i(300));d===null||pr||(d=d.dependencies,d!==null&&Et(d)&&(pr=!0))}function Dt(d,m,A,C){ln=d;var L=0;do{if(fn&&(Hs=null),Cs=0,fn=!1,25<=L)throw Error(i(301));if(L+=1,nn=Ut=null,d.updateQueue!=null){var F=d.updateQueue;F.lastEffect=null,F.events=null,F.stores=null,F.memoCache!=null&&(F.memoCache.index=0)}Vt.H=vc,F=m(A,C)}while(fn);return F}function Xt(){var d=Vt.H,m=d.useState()[0];return m=typeof m.then=="function"?Jt(m):m,d=d.useState()[0],(Ut!==null?Ut.memoizedState:null)!==d&&(ln.flags|=1024),m}function Un(){var d=Ki!==0;return Ki=0,d}function sr(d,m,A){m.updateQueue=d.updateQueue,m.flags&=-2053,d.lanes&=~A}function Qn(d){if(mn){for(d=d.memoizedState;d!==null;){var m=d.queue;m!==null&&(m.pending=null),d=d.next}mn=!1}yl=0,nn=Ut=ln=null,fn=!1,Cs=Ki=0,Hs=null}function rn(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?ln.memoizedState=nn=d:nn=nn.next=d,nn}function gt(){if(Ut===null){var d=ln.alternate;d=d!==null?d.memoizedState:null}else d=Ut.next;var m=nn===null?ln.memoizedState:nn.next;if(m!==null)nn=m,Ut=d;else{if(d===null)throw ln.alternate===null?Error(i(467)):Error(i(310));Ut=d,d={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},nn===null?ln.memoizedState=nn=d:nn=nn.next=d}return nn}function Bn(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jt(d){var m=Cs;return Cs+=1,Hs===null&&(Hs=[]),d=jt(Hs,d,m),m=ln,(nn===null?m.memoizedState:nn.next)===null&&(m=m.alternate,Vt.H=m===null||m.memoizedState===null?Or:To),d}function Jr(d){if(d!==null&&typeof d=="object"){if(typeof d.then=="function")return Jt(d);if(d.$$typeof===xs)return te(d)}throw Error(i(438,String(d)))}function Us(d){var m=null,A=ln.updateQueue;if(A!==null&&(m=A.memoCache),m==null){var C=ln.alternate;C!==null&&(C=C.updateQueue,C!==null&&(C=C.memoCache,C!=null&&(m={data:C.data.map(function(L){return L.slice()}),index:0})))}if(m==null&&(m={data:[],index:0}),A===null&&(A=Bn(),ln.updateQueue=A),A.memoCache=m,A=m.data[m.index],A===void 0)for(A=m.data[m.index]=Array(d),C=0;C<d;C++)A[C]=Wy;return m.index++,A}function hr(d,m){return typeof m=="function"?m(d):m}function ea(d){var m=gt();return Wn(m,Ut,d)}function Wn(d,m,A){var C=d.queue;if(C===null)throw Error(i(311));C.lastRenderedReducer=A;var L=d.baseQueue,F=C.pending;if(F!==null){if(L!==null){var K=L.next;L.next=F.next,F.next=K}m.baseQueue=L=F,C.pending=null}if(F=d.baseState,L===null)d.memoizedState=F;else{m=L.next;var ce=K=null,Le=null,Je=m,ht=!1;do{var nt=Je.lane&-536870913;if(nt!==Je.lane?(En&nt)===nt:(yl&nt)===nt){var Mt=Je.revertLane;if(Mt===0)Le!==null&&(Le=Le.next={lane:0,revertLane:0,gesture:null,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null}),nt===vl&&(ht=!0);else if((yl&Mt)===Mt){Je=Je.next,Mt===vl&&(ht=!0);continue}else nt={lane:0,revertLane:Je.revertLane,gesture:null,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null},Le===null?(ce=Le=nt,K=F):Le=Le.next=nt,ln.lanes|=Mt,xl|=Mt;nt=Je.action,Pn&&A(F,nt),F=Je.hasEagerState?Je.eagerState:A(F,nt)}else Mt={lane:nt,revertLane:Je.revertLane,gesture:Je.gesture,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null},Le===null?(ce=Le=Mt,K=F):Le=Le.next=Mt,ln.lanes|=nt,xl|=nt;Je=Je.next}while(Je!==null&&Je!==m);if(Le===null?K=F:Le.next=ce,!Wr(F,d.memoizedState)&&(pr=!0,ht&&(A=hi,A!==null)))throw A;d.memoizedState=F,d.baseState=K,d.baseQueue=Le,C.lastRenderedState=F}return L===null&&(C.lanes=0),[d.memoizedState,C.dispatch]}function ci(d){var m=gt(),A=m.queue;if(A===null)throw Error(i(311));A.lastRenderedReducer=d;var C=A.dispatch,L=A.pending,F=m.memoizedState;if(L!==null){A.pending=null;var K=L=L.next;do F=d(F,K.action),K=K.next;while(K!==L);Wr(F,m.memoizedState)||(pr=!0),m.memoizedState=F,m.baseQueue===null&&(m.baseState=F),A.lastRenderedState=F}return[F,C]}function Zr(d,m,A){var C=ln,L=gt(),F=Mn;if(F){if(A===void 0)throw Error(i(407));A=A()}else A=m();var K=!Wr((Ut||L).memoizedState,A);if(K&&(L.memoizedState=A,pr=!0),L=L.queue,gf(tu.bind(null,C,L,d),[d]),L.getSnapshot!==m||K||nn!==null&&nn.memoizedState.tag&1){if(C.flags|=2048,Ga(9,{destroy:void 0},xi.bind(null,C,L,A,m),null),gn===null)throw Error(i(349));F||(yl&127)!==0||yi(C,m,A)}return A}function yi(d,m,A){d.flags|=16384,d={getSnapshot:m,value:A},m=ln.updateQueue,m===null?(m=Bn(),ln.updateQueue=m,m.stores=[d]):(A=m.stores,A===null?m.stores=[d]:A.push(d))}function xi(d,m,A,C){m.value=A,m.getSnapshot=C,ds(m)&&E1(d)}function tu(d,m,A){return A(function(){ds(m)&&E1(d)})}function ds(d){var m=d.getSnapshot;d=d.value;try{var A=m();return!Wr(d,A)}catch{return!0}}function E1(d){var m=Wi(d,2);m!==null&&Cr(m,d,2)}function gy(d){var m=rn();if(typeof d=="function"){var A=d;if(d=A(),Pn){W(!0);try{A()}finally{W(!1)}}}return m.memoizedState=m.baseState=d,m.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:d},m}function qd(d,m,A,C){return d.baseState=A,Wn(d,Ut,typeof C=="function"?C:hr)}function il(d,m,A,C,L){if(nm(d))throw Error(i(485));if(d=m.action,d!==null){var F={payload:L,action:d,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(K){F.listeners.push(K)}};Vt.T!==null?A(!0):F.isTransition=!1,C(F),A=m.pending,A===null?(F.next=m.pending=F,Kp(m,F)):(F.next=A.next,m.pending=A.next=F)}}function Kp(d,m){var A=m.action,C=m.payload,L=d.state;if(m.isTransition){var F=Vt.T,K={};Vt.T=K;try{var ce=A(L,C),Le=Vt.S;Le!==null&&Le(K,ce),Yp(d,m,ce)}catch(Je){Yl(d,m,Je)}finally{F!==null&&K.types!==null&&(F.types=K.types),Vt.T=F}}else try{F=A(L,C),Yp(d,m,F)}catch(Je){Yl(d,m,Je)}}function Yp(d,m,A){A!==null&&typeof A=="object"&&typeof A.then=="function"?A.then(function(C){nu(d,m,C)},function(C){return Yl(d,m,C)}):nu(d,m,A)}function nu(d,m,A){m.status="fulfilled",m.value=A,vy(m),d.state=A,m=d.pending,m!==null&&(A=m.next,A===m?d.pending=null:(A=A.next,m.next=A,Kp(d,A)))}function Yl(d,m,A){var C=d.pending;if(d.pending=null,C!==null){C=C.next;do m.status="rejected",m.reason=A,vy(m),m=m.next;while(m!==C)}d.action=null}function vy(d){d=d.listeners;for(var m=0;m<d.length;m++)(0,d[m])()}function Jp(d,m){return m}function yy(d,m){if(Mn){var A=gn.formState;if(A!==null){e:{var C=ln;if(Mn){if(br){var L=b_(br,sa);if(L){br=__(L),C=u0(L);break e}}_e(C)}C=!1}C&&(m=A[0])}}A=rn(),A.memoizedState=A.baseState=m,C={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jp,lastRenderedState:m},A.queue=C,A=D1.bind(null,ln,C),C.dispatch=A,C=gy(!1);var F=tm.bind(null,ln,!1,C.queue);return C=rn(),L={state:m,dispatch:null,action:d,pending:null},C.queue=L,A=il.bind(null,ln,L,F,A),L.dispatch=A,C.memoizedState=d,[m,A,!1]}function pf(d){var m=gt();return oo(m,Ut,d)}function oo(d,m,A){if(m=Wn(d,m,Jp)[0],d=ea(hr)[0],typeof m=="object"&&m!==null&&typeof m.then=="function")try{var C=Jt(m)}catch(K){throw K===pi?Ts:K}else C=m;m=gt();var L=m.queue,F=L.dispatch;return A!==m.memoizedState&&(ln.flags|=2048,Ga(9,{destroy:void 0},xy.bind(null,L,A),null)),[C,F,d]}function xy(d,m){d.action=m}function mf(d){var m=gt(),A=Ut;if(A!==null)return oo(m,A,d);gt(),m=m.memoizedState,A=gt();var C=A.queue.dispatch;return A.memoizedState=d,[m,C,!1]}function Ga(d,m,A,C){return d={tag:d,create:A,deps:C,inst:m,next:null},m=ln.updateQueue,m===null&&(m=Bn(),ln.updateQueue=m),A=m.lastEffect,A===null?m.lastEffect=d.next=d:(C=A.next,A.next=d,d.next=C,m.lastEffect=d),d}function Zp(){return gt().memoizedState}function ru(d,m,A,C){var L=rn();ln.flags|=d,L.memoizedState=Ga(1|m,{destroy:void 0},A,C===void 0?null:C)}function $d(d,m,A,C){var L=gt();C=C===void 0?null:C;var F=L.memoizedState.inst;Ut!==null&&C!==null&&Ct(C,Ut.memoizedState.deps)?L.memoizedState=Ga(m,F,A,C):(ln.flags|=d,L.memoizedState=Ga(1|m,F,A,C))}function Xd(d,m){ru(8390656,8,d,m)}function gf(d,m){$d(2048,8,d,m)}function T1(d){ln.flags|=4;var m=ln.updateQueue;if(m===null)m=Bn(),ln.updateQueue=m,m.events=[d];else{var A=m.events;A===null?m.events=[d]:A.push(d)}}function ta(d){var m=gt().memoizedState;return T1({ref:m,nextImpl:d}),function(){if((Sn&2)!==0)throw Error(i(440));return m.impl.apply(void 0,arguments)}}function Jl(d,m){return $d(4,2,d,m)}function Kd(d,m){return $d(4,4,d,m)}function vf(d,m){if(typeof m=="function"){d=d();var A=m(d);return function(){typeof A=="function"?A():m(null)}}if(m!=null)return d=d(),m.current=d,function(){m.current=null}}function C1(d,m,A){A=A!=null?A.concat([d]):null,$d(4,4,vf.bind(null,m,d),A)}function Yd(){}function Qp(d,m){var A=gt();m=m===void 0?null:m;var C=A.memoizedState;return m!==null&&Ct(m,C[1])?C[0]:(A.memoizedState=[d,m],d)}function yf(d,m){var A=gt();m=m===void 0?null:m;var C=A.memoizedState;if(m!==null&&Ct(m,C[1]))return C[0];if(C=d(),Pn){W(!0);try{d()}finally{W(!1)}}return A.memoizedState=[C,m],C}function xf(d,m,A){return A===void 0||(yl&1073741824)!==0&&(En&261930)===0?d.memoizedState=m:(d.memoizedState=A,d=ol(),ln.lanes|=d,xl|=d,A)}function by(d,m,A,C){return Wr(A,m)?A:Mu.current!==null?(d=xf(d,A,C),Wr(d,m)||(pr=!0),d):(yl&42)===0||(yl&1073741824)!==0&&(En&261930)===0?(pr=!0,d.memoizedState=A):(d=ol(),ln.lanes|=d,xl|=d,m)}function R1(d,m,A,C,L){var F=bs();wn(F!==0&&8>F?F:8);var K=Vt.T,ce={};Vt.T=ce,tm(d,!1,m,A);try{var Le=L(),Je=Vt.S;if(Je!==null&&Je(ce,Le),Le!==null&&typeof Le=="object"&&typeof Le.then=="function"){var ht=it(Le,C);Jd(d,m,ht,yr(d))}else Jd(d,m,C,yr(d))}catch(nt){Jd(d,m,{then:function(){},status:"rejected",reason:nt},yr())}finally{wn(F),K!==null&&ce.types!==null&&(K.types=ce.types),Vt.T=K}}function O1(d){var m=d.memoizedState;if(m!==null)return m;m={memoizedState:vu,baseState:vu,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:vu},next:null};var A={};return m.next={memoizedState:A,baseState:A,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:A},next:null},d.memoizedState=m,d=d.alternate,d!==null&&(d.memoizedState=m),m}function _y(){return te(yu)}function em(){return gt().memoizedState}function P1(){return gt().memoizedState}function IT(d){for(var m=d.return;m!==null;){switch(m.tag){case 24:case 3:var A=yr();d=ja(A);var C=za(m,d,A);C!==null&&(Cr(C,m,A),Xl(C,m,A)),m={cache:Ne()},d.payload=m;return}m=m.return}}function BT(d,m,A){var C=yr();A={lane:C,revertLane:0,gesture:null,action:A,hasEagerState:!1,eagerState:null,next:null},nm(d)?N1(m,A):(A=Qc(d,m,A,C),A!==null&&(Cr(A,d,C),I1(A,m,C)))}function D1(d,m,A){var C=yr();Jd(d,m,A,C)}function Jd(d,m,A,C){var L={lane:C,revertLane:0,gesture:null,action:A,hasEagerState:!1,eagerState:null,next:null};if(nm(d))N1(m,L);else{var F=d.alternate;if(d.lanes===0&&(F===null||F.lanes===0)&&(F=m.lastRenderedReducer,F!==null))try{var K=m.lastRenderedState,ce=F(K,A);if(L.hasEagerState=!0,L.eagerState=ce,Wr(ce,K))return el(d,m,L,0),gn===null&&$l(),!1}catch{}if(A=Qc(d,m,L,C),A!==null)return Cr(A,d,C),I1(A,m,C),!0}return!1}function tm(d,m,A,C){if(C={lane:2,revertLane:Ae(),gesture:null,action:C,hasEagerState:!1,eagerState:null,next:null},nm(d)){if(m)throw Error(i(479))}else m=Qc(d,A,C,2),m!==null&&Cr(m,d,2)}function nm(d){var m=d.alternate;return d===ln||m!==null&&m===ln}function N1(d,m){fn=mn=!0;var A=d.pending;A===null?m.next=m:(m.next=A.next,A.next=m),d.pending=m}function I1(d,m,A){if((A&4194048)!==0){var C=m.lanes;C&=d.pendingLanes,A|=C,m.lanes=A,B(d,A)}}function Sy(d,m,A,C){m=d.memoizedState,A=A(C,m),A=A==null?m:Sm({},m,A),d.memoizedState=A,d.lanes===0&&(d.updateQueue.baseState=A)}function rm(d,m,A,C,L,F,K){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(C,F,K):m.prototype&&m.prototype.isPureReactComponent?!He(A,C)||!He(L,F):!0}function B1(d,m,A,C){d=m.state,typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps(A,C),typeof m.UNSAFE_componentWillReceiveProps=="function"&&m.UNSAFE_componentWillReceiveProps(A,C),m.state!==d&&Mh.enqueueReplaceState(m,m.state,null)}function iu(d,m){var A=m;if("ref"in m){A={};for(var C in m)C!=="ref"&&(A[C]=m[C])}if(d=d.defaultProps){A===m&&(A=Sm({},A));for(var L in d)A[L]===void 0&&(A[L]=d[L])}return A}function im(d,m){try{var A=d.onUncaughtError;A(m.value,{componentStack:m.stack})}catch(C){setTimeout(function(){throw C})}}function Ay(d,m,A){try{var C=d.onCaughtError;C(A.value,{componentStack:A.stack,errorBoundary:m.tag===1?m.stateNode:null})}catch(L){setTimeout(function(){throw L})}}function wy(d,m,A){return A=ja(A),A.tag=3,A.payload={element:null},A.callback=function(){im(d,m)},A}function L1(d){return d=ja(d),d.tag=3,d}function k1(d,m,A,C){var L=A.type.getDerivedStateFromError;if(typeof L=="function"){var F=C.value;d.payload=function(){return L(F)},d.callback=function(){Ay(m,A,C)}}var K=A.stateNode;K!==null&&typeof K.componentDidCatch=="function"&&(d.callback=function(){Ay(m,A,C),typeof L!="function"&&(bl===null?bl=new Set([this]):bl.add(this));var ce=C.stack;this.componentDidCatch(C.value,{componentStack:ce!==null?ce:""})})}function LT(d,m,A,C,L){if(A.flags|=32768,C!==null&&typeof C=="object"&&typeof C.then=="function"){if(m=A.alternate,m!==null&&ft(m,A,L,!0),A=Aa.current,A!==null){switch(A.tag){case 31:case 13:return wa===null?Of():A.alternate===null&&Dr===0&&(Dr=3),A.flags&=-257,A.flags|=65536,A.lanes=L,C===Mo?A.flags|=16384:(m=A.updateQueue,m===null?A.updateQueue=new Set([C]):m.add(C),Nf(d,C,L)),!1;case 22:return A.flags|=65536,C===Mo?A.flags|=16384:(m=A.updateQueue,m===null?(m={transitions:null,markerInstances:null,retryQueue:new Set([C])},A.updateQueue=m):(A=m.retryQueue,A===null?m.retryQueue=new Set([C]):A.add(C)),Nf(d,C,L)),!1}throw Error(i(435,A.tag))}return Nf(d,C,L),Of(),!1}if(Mn)return m=Aa.current,m!==null?((m.flags&65536)===0&&(m.flags|=256),m.flags|=65536,m.lanes=L,C!==Wm&&(d=Error(i(422),{cause:C}),Ue(ie(d,A)))):(C!==Wm&&(m=Error(i(423),{cause:C}),Ue(ie(m,A))),d=d.current.alternate,d.flags|=65536,L&=-L,d.lanes|=L,C=ie(C,A),L=wy(d.stateNode,C,L),eu(d,L),Dr!==4&&(Dr=2)),!1;var F=Error(i(520),{cause:C});if(F=ie(F,A),Th===null?Th=[F]:Th.push(F),Dr!==4&&(Dr=2),m===null)return!0;C=ie(C,A),A=m;do{switch(A.tag){case 3:return A.flags|=65536,d=L&-L,A.lanes|=d,d=wy(A.stateNode,C,d),eu(A,d),!1;case 1:if(m=A.type,F=A.stateNode,(A.flags&128)===0&&(typeof m.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(bl===null||!bl.has(F))))return A.flags|=65536,L&=-L,A.lanes|=L,L=L1(L),k1(L,d,A,C),eu(A,L),!1}A=A.return}while(A!==null);return!1}function Pi(d,m,A,C){m.child=d===null?C0(m,null,A,C):Ii(m,d.child,A,C)}function F1(d,m,A,C,L){A=A.render;var F=m.ref;if("ref"in C){var K={};for(var ce in C)ce!=="ref"&&(K[ce]=C[ce])}else K=C;return Ze(m),C=Rt(d,m,A,K,F,L),ce=Un(),d!==null&&!pr?(sr(d,m,L),lo(d,m,L)):(Mn&&ce&&ae(m),m.flags|=1,Pi(d,m,C,L),m.child)}function U1(d,m,A,C,L){if(d===null){var F=A.type;return typeof F=="function"&&!cu(F)&&F.defaultProps===void 0&&A.compare===null?(m.tag=15,m.type=F,j1(d,m,F,C,L)):(d=ul(A.type,null,C,m,m.mode,L),d.ref=m.ref,d.return=m,m.child=d)}if(F=d.child,!Qd(d,L)){var K=F.memoizedProps;if(A=A.compare,A=A!==null?A:He,A(K,C)&&d.ref===m.ref)return lo(d,m,L)}return m.flags|=1,d=Wa(F,C),d.ref=m.ref,d.return=m,m.child=d}function j1(d,m,A,C,L){if(d!==null){var F=d.memoizedProps;if(He(F,C)&&d.ref===m.ref)if(pr=!1,m.pendingProps=C=F,Qd(d,L))(d.flags&131072)!==0&&(pr=!0);else return m.lanes=d.lanes,lo(d,m,L)}return sm(d,m,A,C,L)}function z1(d,m,A,C){var L=C.children,F=d!==null?d.memoizedState:null;if(d===null&&m.stateNode===null&&(m.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),C.mode==="hidden"){if((m.flags&128)!==0){if(F=F!==null?F.baseLanes|A:A,d!==null){for(C=m.child=d.child,L=0;C!==null;)L=L|C.lanes|C.childLanes,C=C.sibling;C=L&~F}else C=0,m.child=null;return bf(d,m,F,A,C)}if((A&536870912)!==0)m.memoizedState={baseLanes:0,cachePool:null},d!==null&&pt(m,F!==null?F.cachePool:null),F!==null?Kl(m,F):so(),Te(m);else return C=m.lanes=536870912,bf(d,m,F!==null?F.baseLanes|A:A,A,C)}else F!==null?(pt(m,F.cachePool),Kl(m,F),xe(),m.memoizedState=null):(d!==null&&pt(m,null),so(),xe());return Pi(d,m,L,A),m.child}function au(d,m){return d!==null&&d.tag===22||m.stateNode!==null||(m.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.sibling}function bf(d,m,A,C,L){var F=et();return F=F===null?null:{parent:Hr?_r._currentValue:_r._currentValue2,pool:F},m.memoizedState={baseLanes:A,cachePool:F},d!==null&&pt(m,null),so(),Te(m),d!==null&&ft(d,m,C,!0),m.childLanes=L,null}function am(d,m){return m=Zl({mode:m.mode,children:m.children},d.mode),m.ref=d.ref,d.child=m,m.return=d,m}function My(d,m,A){return Ii(m,d.child,null,A),d=am(m,m.pendingProps),d.flags|=2,ct(m),m.memoizedState=null,d}function G1(d,m,A){var C=m.pendingProps,L=(m.flags&128)!==0;if(m.flags&=-129,d===null){if(Mn){if(C.mode==="hidden")return d=am(m,C),m.lanes=536870912,au(null,d);if(Pe(m),(d=br)?(d=d0(d,sa),d!==null&&(m.memoizedState={dehydrated:d,treeContext:As!==null?{id:Di,overflow:zs}:null,retryLane:536870912,hydrationErrors:null},A=Gy(d),A.return=m,m.child=A,di=m,br=null)):d=null,d===null)throw _e(m);return m.lanes=536870912,null}return am(m,C)}var F=d.memoizedState;if(F!==null){var K=F.dehydrated;if(Pe(m),L)if(m.flags&256)m.flags&=-257,m=My(d,m,A);else if(m.memoizedState!==null)m.child=d.child,m.flags|=128,m=null;else throw Error(i(558));else if(pr||ft(d,m,A,!1),L=(A&d.childLanes)!==0,pr||L){if(C=gn,C!==null&&(K=U(C,A),K!==0&&K!==F.retryLane))throw F.retryLane=K,Wi(d,K),Cr(C,d,K),la;Of(),m=My(d,m,A)}else d=F.treeContext,xr&&(br=M_(K),di=m,Mn=!0,wo=null,sa=!1,d!==null&&Se(m,d)),m=am(m,C),m.flags|=4096;return m}return d=Wa(d.child,{mode:C.mode,children:C.children}),d.ref=m.ref,m.child=d,d.return=m,d}function Zd(d,m){var A=m.ref;if(A===null)d!==null&&d.ref!==null&&(m.flags|=4194816);else{if(typeof A!="function"&&typeof A!="object")throw Error(i(284));(d===null||d.ref!==A)&&(m.flags|=4194816)}}function sm(d,m,A,C,L){return Ze(m),A=Rt(d,m,A,C,void 0,L),C=Un(),d!==null&&!pr?(sr(d,m,L),lo(d,m,L)):(Mn&&C&&ae(m),m.flags|=1,Pi(d,m,A,L),m.child)}function Ey(d,m,A,C,L,F){return Ze(m),m.updateQueue=null,A=Dt(m,C,A,L),Ht(d),C=Un(),d!==null&&!pr?(sr(d,m,F),lo(d,m,F)):(Mn&&C&&ae(m),m.flags|=1,Pi(d,m,A,F),m.child)}function su(d,m,A,C,L){if(Ze(m),m.stateNode===null){var F=_o,K=A.contextType;typeof K=="object"&&K!==null&&(F=te(K)),F=new A(C,F),m.memoizedState=F.state!==null&&F.state!==void 0?F.state:null,F.updater=Mh,m.stateNode=F,F._reactInternals=m,F=m.stateNode,F.props=C,F.state=m.memoizedState,F.refs={},li(m),K=A.contextType,F.context=typeof K=="object"&&K!==null?te(K):_o,F.state=m.memoizedState,K=A.getDerivedStateFromProps,typeof K=="function"&&(Sy(m,A,K,C),F.state=m.memoizedState),typeof A.getDerivedStateFromProps=="function"||typeof F.getSnapshotBeforeUpdate=="function"||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(K=F.state,typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount(),K!==F.state&&Mh.enqueueReplaceState(F,F.state,null),tl(m,C,F,L),Fs(),F.state=m.memoizedState),typeof F.componentDidMount=="function"&&(m.flags|=4194308),C=!0}else if(d===null){F=m.stateNode;var ce=m.memoizedProps,Le=iu(A,ce);F.props=Le;var Je=F.context,ht=A.contextType;K=_o,typeof ht=="object"&&ht!==null&&(K=te(ht));var nt=A.getDerivedStateFromProps;ht=typeof nt=="function"||typeof F.getSnapshotBeforeUpdate=="function",ce=m.pendingProps!==ce,ht||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(ce||Je!==K)&&B1(m,F,C,K),Xa=!1;var Mt=m.memoizedState;F.state=Mt,tl(m,C,F,L),Fs(),Je=m.memoizedState,ce||Mt!==Je||Xa?(typeof nt=="function"&&(Sy(m,A,nt,C),Je=m.memoizedState),(Le=Xa||rm(m,A,Le,C,Mt,Je,K))?(ht||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(m.flags|=4194308)):(typeof F.componentDidMount=="function"&&(m.flags|=4194308),m.memoizedProps=C,m.memoizedState=Je),F.props=C,F.state=Je,F.context=K,C=Le):(typeof F.componentDidMount=="function"&&(m.flags|=4194308),C=!1)}else{F=m.stateNode,Ua(d,m),K=m.memoizedProps,ht=iu(A,K),F.props=ht,nt=m.pendingProps,Mt=F.context,Je=A.contextType,Le=_o,typeof Je=="object"&&Je!==null&&(Le=te(Je)),ce=A.getDerivedStateFromProps,(Je=typeof ce=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(K!==nt||Mt!==Le)&&B1(m,F,C,Le),Xa=!1,Mt=m.memoizedState,F.state=Mt,tl(m,C,F,L),Fs();var sn=m.memoizedState;K!==nt||Mt!==sn||Xa||d!==null&&d.dependencies!==null&&Et(d.dependencies)?(typeof ce=="function"&&(Sy(m,A,ce,C),sn=m.memoizedState),(ht=Xa||rm(m,A,ht,C,Mt,sn,Le)||d!==null&&d.dependencies!==null&&Et(d.dependencies))?(Je||typeof F.UNSAFE_componentWillUpdate!="function"&&typeof F.componentWillUpdate!="function"||(typeof F.componentWillUpdate=="function"&&F.componentWillUpdate(C,sn,Le),typeof F.UNSAFE_componentWillUpdate=="function"&&F.UNSAFE_componentWillUpdate(C,sn,Le)),typeof F.componentDidUpdate=="function"&&(m.flags|=4),typeof F.getSnapshotBeforeUpdate=="function"&&(m.flags|=1024)):(typeof F.componentDidUpdate!="function"||K===d.memoizedProps&&Mt===d.memoizedState||(m.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||K===d.memoizedProps&&Mt===d.memoizedState||(m.flags|=1024),m.memoizedProps=C,m.memoizedState=sn),F.props=C,F.state=sn,F.context=Le,C=ht):(typeof F.componentDidUpdate!="function"||K===d.memoizedProps&&Mt===d.memoizedState||(m.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||K===d.memoizedProps&&Mt===d.memoizedState||(m.flags|=1024),C=!1)}return F=C,Zd(d,m),C=(m.flags&128)!==0,F||C?(F=m.stateNode,A=C&&typeof A.getDerivedStateFromError!="function"?null:F.render(),m.flags|=1,d!==null&&C?(m.child=Ii(m,d.child,null,L),m.child=Ii(m,null,A,L)):Pi(d,m,A,L),m.memoizedState=F.state,d=m.child):d=lo(d,m,L),d}function H1(d,m,A,C){return ot(),m.flags|=256,Pi(d,m,A,C),m.child}function Ty(d){return{baseLanes:d,cachePool:tt()}}function Cy(d,m,A){return d=d!==null?d.childLanes&~A:0,m&&(d|=ca),d}function Ry(d,m,A){var C=m.pendingProps,L=!1,F=(m.flags&128)!==0,K;if((K=F)||(K=d!==null&&d.memoizedState===null?!1:(Lr.current&2)!==0),K&&(L=!0,m.flags&=-129),K=(m.flags&32)!==0,m.flags&=-33,d===null){if(Mn){if(L?ge(m):xe(),(d=br)?(d=R_(d,sa),d!==null&&(m.memoizedState={dehydrated:d,treeContext:As!==null?{id:Di,overflow:zs}:null,retryLane:536870912,hydrationErrors:null},A=Gy(d),A.return=m,m.child=A,di=m,br=null)):d=null,d===null)throw _e(m);return Om(d)?m.lanes=32:m.lanes=536870912,null}var ce=C.children;return C=C.fallback,L?(xe(),L=m.mode,ce=Zl({mode:"hidden",children:ce},L),C=ys(C,L,A,null),ce.return=m,C.return=m,ce.sibling=C,m.child=ce,C=m.child,C.memoizedState=Ty(A),C.childLanes=Cy(d,K,A),m.memoizedState=Eu,au(null,C)):(ge(m),om(m,ce))}var Le=d.memoizedState;if(Le!==null&&(ce=Le.dehydrated,ce!==null)){if(F)m.flags&256?(ge(m),m.flags&=-257,m=ou(d,m,A)):m.memoizedState!==null?(xe(),m.child=d.child,m.flags|=128,m=null):(xe(),ce=C.fallback,L=m.mode,C=Zl({mode:"visible",children:C.children},L),ce=ys(ce,L,A,null),ce.flags|=2,C.return=m,ce.return=m,C.sibling=ce,m.child=C,Ii(m,d.child,null,A),C=m.child,C.memoizedState=Ty(A),C.childLanes=Cy(d,K,A),m.memoizedState=Eu,m=au(null,C));else if(ge(m),Om(ce))K=Pm(ce).digest,C=Error(i(419)),C.stack="",C.digest=K,Ue({value:C,source:null,stack:null}),m=ou(d,m,A);else if(pr||ft(d,m,A,!1),K=(A&d.childLanes)!==0,pr||K){if(K=gn,K!==null&&(C=U(K,A),C!==0&&C!==Le.retryLane))throw Le.retryLane=C,Wi(d,C),Cr(K,d,C),la;fc(ce)||Of(),m=ou(d,m,A)}else fc(ce)?(m.flags|=192,m.child=d.child,m=null):(d=Le.treeContext,xr&&(br=E_(ce),di=m,Mn=!0,wo=null,sa=!1,d!==null&&Se(m,d)),m=om(m,C.children),m.flags|=4096);return m}return L?(xe(),ce=C.fallback,L=m.mode,Le=d.child,F=Le.sibling,C=Wa(Le,{mode:"hidden",children:C.children}),C.subtreeFlags=Le.subtreeFlags&65011712,F!==null?ce=Wa(F,ce):(ce=ys(ce,L,A,null),ce.flags|=2),ce.return=m,C.return=m,C.sibling=ce,m.child=C,au(null,C),C=m.child,ce=d.child.memoizedState,ce===null?ce=Ty(A):(L=ce.cachePool,L!==null?(Le=Hr?_r._currentValue:_r._currentValue2,L=L.parent!==Le?{parent:Le,pool:Le}:L):L=tt(),ce={baseLanes:ce.baseLanes|A,cachePool:L}),C.memoizedState=ce,C.childLanes=Cy(d,K,A),m.memoizedState=Eu,au(d.child,C)):(ge(m),A=d.child,d=A.sibling,A=Wa(A,{mode:"visible",children:C.children}),A.return=m,A.sibling=null,d!==null&&(K=m.deletions,K===null?(m.deletions=[d],m.flags|=16):K.push(d)),m.child=A,m.memoizedState=null,A)}function om(d,m){return m=Zl({mode:"visible",children:m},d.mode),m.return=d,d.child=m}function Zl(d,m){return d=n(22,d,null,m),d.lanes=0,d}function ou(d,m,A){return Ii(m,d.child,null,A),d=om(m,m.pendingProps.children),d.flags|=2,m.memoizedState=null,d}function V1(d,m,A){d.lanes|=m;var C=d.alternate;C!==null&&(C.lanes|=m),re(d.return,m,A)}function _f(d,m,A,C,L,F){var K=d.memoizedState;K===null?d.memoizedState={isBackwards:m,rendering:null,renderingStartTime:0,last:C,tail:A,tailMode:L,treeForkCount:F}:(K.isBackwards=m,K.rendering=null,K.renderingStartTime=0,K.last=C,K.tail=A,K.tailMode=L,K.treeForkCount=F)}function Oy(d,m,A){var C=m.pendingProps,L=C.revealOrder,F=C.tail;C=C.children;var K=Lr.current,ce=(K&2)!==0;if(ce?(K=K&1|2,m.flags|=128):K&=1,b(Lr,K),Pi(d,m,C,A),C=Mn?Sh:0,!ce&&d!==null&&(d.flags&128)!==0)e:for(d=m.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&V1(d,A,m);else if(d.tag===19)V1(d,A,m);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===m)break e;for(;d.sibling===null;){if(d.return===null||d.return===m)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}switch(L){case"forwards":for(A=m.child,L=null;A!==null;)d=A.alternate,d!==null&&wt(d)===null&&(L=A),A=A.sibling;A=L,A===null?(L=m.child,m.child=null):(L=A.sibling,A.sibling=null),_f(m,!1,L,A,F,C);break;case"backwards":case"unstable_legacy-backwards":for(A=null,L=m.child,m.child=null;L!==null;){if(d=L.alternate,d!==null&&wt(d)===null){m.child=L;break}d=L.sibling,L.sibling=A,A=L,L=d}_f(m,!0,A,null,F,C);break;case"together":_f(m,!1,null,null,void 0,C);break;default:m.memoizedState=null}return m.child}function lo(d,m,A){if(d!==null&&(m.dependencies=d.dependencies),xl|=m.lanes,(A&m.childLanes)===0)if(d!==null){if(ft(d,m,A,!1),(A&m.childLanes)===0)return null}else return null;if(d!==null&&m.child!==d.child)throw Error(i(153));if(m.child!==null){for(d=m.child,A=Wa(d,d.pendingProps),m.child=A,A.return=m;d.sibling!==null;)d=d.sibling,A=A.sibling=Wa(d,d.pendingProps),A.return=m;A.sibling=null}return m.child}function Qd(d,m){return(d.lanes&m)!==0?!0:(d=d.dependencies,!!(d!==null&&Et(d)))}function Py(d,m,A){switch(m.tag){case 3:$e(m,m.stateNode.containerInfo),Be(m,_r,d.memoizedState.cache),ot();break;case 27:case 5:ve(m);break;case 4:$e(m,m.stateNode.containerInfo);break;case 10:Be(m,m.type,m.memoizedProps.value);break;case 31:if(m.memoizedState!==null)return m.flags|=128,Pe(m),null;break;case 13:var C=m.memoizedState;if(C!==null)return C.dehydrated!==null?(ge(m),m.flags|=128,null):(A&m.child.childLanes)!==0?Ry(d,m,A):(ge(m),d=lo(d,m,A),d!==null?d.sibling:null);ge(m);break;case 19:var L=(d.flags&128)!==0;if(C=(A&m.childLanes)!==0,C||(ft(d,m,A,!1),C=(A&m.childLanes)!==0),L){if(C)return Oy(d,m,A);m.flags|=128}if(L=m.memoizedState,L!==null&&(L.rendering=null,L.tail=null,L.lastEffect=null),b(Lr,Lr.current),C)break;return null;case 22:return m.lanes=0,z1(d,m,A,m.pendingProps);case 24:Be(m,_r,d.memoizedState.cache)}return lo(d,m,A)}function Dy(d,m,A){if(d!==null)if(d.memoizedProps!==m.pendingProps)pr=!0;else{if(!Qd(d,A)&&(m.flags&128)===0)return pr=!1,Py(d,m,A);pr=(d.flags&131072)!==0}else pr=!1,Mn&&(m.flags&1048576)!==0&&X(m,Sh,m.index);switch(m.lanes=0,m.tag){case 16:e:{var C=m.pendingProps;if(d=un(m.elementType),m.type=d,typeof d=="function")cu(d)?(C=iu(d,C),m.tag=1,m=su(null,m,d,C,A)):(m.tag=0,m=sm(null,m,d,C,A));else{if(d!=null){var L=d.$$typeof;if(L===If){m.tag=11,m=F1(null,m,d,C,A);break e}else if(L===wm){m.tag=14,m=U1(null,m,d,C,A);break e}}throw m=p(d)||d,Error(i(306,m,""))}}return m;case 0:return sm(d,m,m.type,m.pendingProps,A);case 1:return C=m.type,L=iu(C,m.pendingProps),su(d,m,C,L,A);case 3:e:{if($e(m,m.stateNode.containerInfo),d===null)throw Error(i(387));var F=m.pendingProps;L=m.memoizedState,C=L.element,Ua(d,m),tl(m,F,null,A);var K=m.memoizedState;if(F=K.cache,Be(m,_r,F),F!==L.cache&&At(m,[_r],A,!0),Fs(),F=K.element,xr&&L.isDehydrated)if(L={element:F,isDehydrated:!1,cache:K.cache},m.updateQueue.baseState=L,m.memoizedState=L,m.flags&256){m=H1(d,m,F,A);break e}else if(F!==C){C=ie(Error(i(424)),m),Ue(C),m=H1(d,m,F,A);break e}else for(xr&&(br=w_(m.stateNode.containerInfo),di=m,Mn=!0,wo=null,sa=!0),A=C0(m,null,F,A),m.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if(ot(),F===C){m=lo(d,m,A);break e}Pi(d,m,F,A)}m=m.child}return m;case 26:if(_s)return Zd(d,m),d===null?(A=v0(m.type,null,m.pendingProps,null))?m.memoizedState=A:Mn||(m.stateNode=Bm(m.type,m.pendingProps,Ni.current,m)):m.memoizedState=v0(m.type,d.memoizedProps,m.pendingProps,d.memoizedState),null;case 27:if(fi)return ve(m),d===null&&fi&&Mn&&(C=m.stateNode=Lm(m.type,m.pendingProps,Ni.current,Ai.current,!1),di=m,sa=!0,br=f0(m.type,C,br)),Pi(d,m,m.pendingProps.children,A),Zd(d,m),d===null&&(m.flags|=4194304),m.child;case 5:return d===null&&Mn&&(F_(m.type,m.pendingProps,Ai.current),(L=C=br)&&(C=T_(C,m.type,m.pendingProps,sa),C!==null?(m.stateNode=C,di=m,br=A_(C),sa=!1,L=!0):L=!1),L||_e(m)),ve(m),L=m.type,F=m.pendingProps,K=d!==null?d.memoizedProps:null,C=F.children,aa(L,F)?C=null:K!==null&&aa(L,K)&&(m.flags|=32),m.memoizedState!==null&&(L=Rt(d,m,Xt,null,null,A),Hr?yu._currentValue=L:yu._currentValue2=L),Zd(d,m),Pi(d,m,C,A),m.child;case 6:return d===null&&Mn&&(g0(m.pendingProps,Ai.current),(d=A=br)&&(A=C_(A,m.pendingProps,sa),A!==null?(m.stateNode=A,di=m,br=null,d=!0):d=!1),d||_e(m)),null;case 13:return Ry(d,m,A);case 4:return $e(m,m.stateNode.containerInfo),C=m.pendingProps,d===null?m.child=Ii(m,null,C,A):Pi(d,m,C,A),m.child;case 11:return F1(d,m,m.type,m.pendingProps,A);case 7:return Pi(d,m,m.pendingProps,A),m.child;case 8:return Pi(d,m,m.pendingProps.children,A),m.child;case 12:return Pi(d,m,m.pendingProps.children,A),m.child;case 10:return C=m.pendingProps,Be(m,m.type,C.value),Pi(d,m,C.children,A),m.child;case 9:return L=m.type._context,C=m.pendingProps.children,Ze(m),L=te(L),C=C(L),m.flags|=1,Pi(d,m,C,A),m.child;case 14:return U1(d,m,m.type,m.pendingProps,A);case 15:return j1(d,m,m.type,m.pendingProps,A);case 19:return Oy(d,m,A);case 31:return G1(d,m,A);case 22:return z1(d,m,A,m.pendingProps);case 24:return Ze(m),C=te(_r),d===null?(L=et(),L===null&&(L=gn,F=Ne(),L.pooledCache=F,F.refCount++,F!==null&&(L.pooledCacheLanes|=A),L=F),m.memoizedState={parent:C,cache:L},li(m),Be(m,_r,L)):((d.lanes&A)!==0&&(Ua(d,m),tl(m,null,null,A),Fs()),L=d.memoizedState,F=m.memoizedState,L.parent!==C?(L={parent:C,cache:C},m.memoizedState=L,m.lanes===0&&(m.memoizedState=m.updateQueue.baseState=L),Be(m,_r,C)):(C=F.cache,Be(m,_r,C),C!==L.cache&&At(m,[_r],A,!0))),Pi(d,m,m.pendingProps.children,A),m.child;case 29:throw m.pendingProps}throw Error(i(156,m.tag))}function hs(d){d.flags|=4}function eh(d){qa&&(d.flags|=8)}function W1(d,m){if(d!==null&&d.child===m.child)return!1;if((m.flags&16)!==0)return!0;for(d=m.child;d!==null;){if((d.flags&8218)!==0||(d.subtreeFlags&8218)!==0)return!0;d=d.sibling}return!1}function Ny(d,m,A,C){if(On)for(A=m.child;A!==null;){if(A.tag===5||A.tag===6)ph(d,A.stateNode);else if(!(A.tag===4||fi&&A.tag===27)&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===m)break;for(;A.sibling===null;){if(A.return===null||A.return===m)return;A=A.return}A.sibling.return=A.return,A=A.sibling}else if(qa)for(var L=m.child;L!==null;){if(L.tag===5){var F=L.stateNode;A&&C&&(F=x_(F,L.type,L.memoizedProps)),ph(d,F)}else if(L.tag===6)F=L.stateNode,A&&C&&(F=c0(F,L.memoizedProps)),ph(d,F);else if(L.tag!==4){if(L.tag===22&&L.memoizedState!==null)F=L.child,F!==null&&(F.return=L),Ny(d,L,!0,!0);else if(L.child!==null){L.child.return=L,L=L.child;continue}}if(L===m)break;for(;L.sibling===null;){if(L.return===null||L.return===m)return;L=L.return}L.sibling.return=L.return,L=L.sibling}}function q1(d,m,A,C){var L=!1;if(qa)for(var F=m.child;F!==null;){if(F.tag===5){var K=F.stateNode;A&&C&&(K=x_(K,F.type,F.memoizedProps)),o0(d,K)}else if(F.tag===6)K=F.stateNode,A&&C&&(K=c0(K,F.memoizedProps)),o0(d,K);else if(F.tag!==4){if(F.tag===22&&F.memoizedState!==null)L=F.child,L!==null&&(L.return=F),q1(d,F,!0,!0),L=!0;else if(F.child!==null){F.child.return=F,F=F.child;continue}}if(F===m)break;for(;F.sibling===null;){if(F.return===null||F.return===m)return L;F=F.return}F.sibling.return=F.return,F=F.sibling}return L}function $1(d,m){if(qa&&W1(d,m)){d=m.stateNode;var A=d.containerInfo,C=s0();q1(C,m,!1,!1),d.pendingChildren=C,hs(m),y_(A,C)}}function Iy(d,m,A,C){if(On)d.memoizedProps!==C&&hs(m);else if(qa){var L=d.stateNode,F=d.memoizedProps;if((d=W1(d,m))||F!==C){var K=Ai.current;F=v_(L,A,F,C,!d,null),F===L?m.stateNode=L:(eh(m),xa(F,A,C,K)&&hs(m),m.stateNode=F,d&&Ny(F,m,!1,!1))}else m.stateNode=L}}function na(d,m,A,C,L){if((d.mode&32)!==0&&(A===null?mh(m,C):Uf(m,A,C))){if(d.flags|=16777216,(L&335544128)===L||Ky(m,C))if(Rr(d.stateNode,m,C))d.flags|=8192;else if(Rn())d.flags|=8192;else throw oa=Mo,$m}else d.flags&=-16777217}function Sf(d,m){if(_0(m)){if(d.flags|=16777216,!S0(m))if(Rn())d.flags|=8192;else throw oa=Mo,$m}else d.flags&=-16777217}function th(d,m){m!==null&&(d.flags|=4),d.flags&16384&&(m=d.tag!==22?P():536870912,d.lanes|=m,Xf|=m)}function Af(d,m){if(!Mn)switch(d.tailMode){case"hidden":m=d.tail;for(var A=null;m!==null;)m.alternate!==null&&(A=m),m=m.sibling;A===null?d.tail=null:A.sibling=null;break;case"collapsed":A=d.tail;for(var C=null;A!==null;)A.alternate!==null&&(C=A),A=A.sibling;C===null?m||d.tail===null?d.tail=null:d.tail.sibling=null:C.sibling=null}}function or(d){var m=d.alternate!==null&&d.alternate.child===d.child,A=0,C=0;if(m)for(var L=d.child;L!==null;)A|=L.lanes|L.childLanes,C|=L.subtreeFlags&65011712,C|=L.flags&65011712,L.return=d,L=L.sibling;else for(L=d.child;L!==null;)A|=L.lanes|L.childLanes,C|=L.subtreeFlags,C|=L.flags,L.return=d,L=L.sibling;return d.subtreeFlags|=C,d.childLanes=A,m}function X1(d,m,A){var C=m.pendingProps;switch(ue(m),m.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return or(m),null;case 1:return or(m),null;case 3:return A=m.stateNode,C=null,d!==null&&(C=d.memoizedState.cache),m.memoizedState.cache!==C&&(m.flags|=2048),Ye(_r),me(),A.pendingContext&&(A.context=A.pendingContext,A.pendingContext=null),(d===null||d.child===null)&&(Re(m)?hs(m):d===null||d.memoizedState.isDehydrated&&(m.flags&256)===0||(m.flags|=1024,we())),$1(d,m),or(m),null;case 26:if(_s){var L=m.type,F=m.memoizedState;return d===null?(hs(m),F!==null?(or(m),Sf(m,F)):(or(m),na(m,L,null,C,A))):F?F!==d.memoizedState?(hs(m),or(m),Sf(m,F)):(or(m),m.flags&=-16777217):(F=d.memoizedProps,On?F!==C&&hs(m):Iy(d,m,L,C),or(m),na(m,L,F,C,A)),null}case 27:if(fi){if(We(m),A=Ni.current,L=m.type,d!==null&&m.stateNode!=null)On?d.memoizedProps!==C&&hs(m):Iy(d,m,L,C);else{if(!C){if(m.stateNode===null)throw Error(i(166));return or(m),null}d=Ai.current,Re(m)?Fe(m,d):(d=Lm(L,C,A,d,!0),m.stateNode=d,hs(m))}return or(m),null}case 5:if(We(m),L=m.type,d!==null&&m.stateNode!=null)Iy(d,m,L,C);else{if(!C){if(m.stateNode===null)throw Error(i(166));return or(m),null}if(F=Ai.current,Re(m))Fe(m,F),B_(m.stateNode,L,C,F)&&(m.flags|=64);else{var K=$y(L,C,Ni.current,F,m);eh(m),Ny(K,m,!1,!1),m.stateNode=K,xa(K,L,C,F)&&hs(m)}}return or(m),na(m,m.type,d===null?null:d.memoizedProps,m.pendingProps,A),null;case 6:if(d&&m.stateNode!=null)A=d.memoizedProps,On?A!==C&&hs(m):qa&&(A!==C?(d=Ni.current,A=Ai.current,eh(m),m.stateNode=hl(C,d,A,m)):m.stateNode=d.stateNode);else{if(typeof C!="string"&&m.stateNode===null)throw Error(i(166));if(d=Ni.current,A=Ai.current,Re(m)){if(!xr)throw Error(i(176));if(d=m.stateNode,A=m.memoizedProps,C=null,L=di,L!==null)switch(L.tag){case 27:case 5:C=L.memoizedProps}zT(d,A,m,C)||_e(m,!0)}else eh(m),m.stateNode=hl(C,d,A,m)}return or(m),null;case 31:if(A=m.memoizedState,d===null||d.memoizedState!==null){if(C=Re(m),A!==null){if(d===null){if(!C)throw Error(i(318));if(!xr)throw Error(i(556));if(d=m.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(557));h0(d,m)}else ot(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;or(m),d=!1}else A=we(),d!==null&&d.memoizedState!==null&&(d.memoizedState.hydrationErrors=A),d=!0;if(!d)return m.flags&256?(ct(m),m):(ct(m),null);if((m.flags&128)!==0)throw Error(i(558))}return or(m),null;case 13:if(C=m.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if(L=Re(m),C!==null&&C.dehydrated!==null){if(d===null){if(!L)throw Error(i(318));if(!xr)throw Error(i(344));if(L=m.memoizedState,L=L!==null?L.dehydrated:null,!L)throw Error(i(317));P_(L,m)}else ot(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;or(m),L=!1}else L=we(),d!==null&&d.memoizedState!==null&&(d.memoizedState.hydrationErrors=L),L=!0;if(!L)return m.flags&256?(ct(m),m):(ct(m),null)}return ct(m),(m.flags&128)!==0?(m.lanes=A,m):(A=C!==null,d=d!==null&&d.memoizedState!==null,A&&(C=m.child,L=null,C.alternate!==null&&C.alternate.memoizedState!==null&&C.alternate.memoizedState.cachePool!==null&&(L=C.alternate.memoizedState.cachePool.pool),F=null,C.memoizedState!==null&&C.memoizedState.cachePool!==null&&(F=C.memoizedState.cachePool.pool),F!==L&&(C.flags|=2048)),A!==d&&A&&(m.child.flags|=8192),th(m,m.updateQueue),or(m),null);case 4:return me(),$1(d,m),d===null&&er(m.stateNode.containerInfo),or(m),null;case 10:return Ye(m.type),or(m),null;case 19:if(y(Lr),C=m.memoizedState,C===null)return or(m),null;if(L=(m.flags&128)!==0,F=C.rendering,F===null)if(L)Af(C,!1);else{if(Dr!==0||d!==null&&(d.flags&128)!==0)for(d=m.child;d!==null;){if(F=wt(d),F!==null){for(m.flags|=128,Af(C,!1),d=F.updateQueue,m.updateQueue=d,th(m,d),m.subtreeFlags=0,d=A,A=m.child;A!==null;)xm(A,d),A=A.sibling;return b(Lr,Lr.current&1|2),Mn&&de(m,C.treeForkCount),m.child}d=d.sibling}C.tail!==null&&$i()>Sc&&(m.flags|=128,L=!0,Af(C,!1),m.lanes=4194304)}else{if(!L)if(d=wt(F),d!==null){if(m.flags|=128,L=!0,d=d.updateQueue,m.updateQueue=d,th(m,d),Af(C,!0),C.tail===null&&C.tailMode==="hidden"&&!F.alternate&&!Mn)return or(m),null}else 2*$i()-C.renderingStartTime>Sc&&A!==536870912&&(m.flags|=128,L=!0,Af(C,!1),m.lanes=4194304);C.isBackwards?(F.sibling=m.child,m.child=F):(d=C.last,d!==null?d.sibling=F:m.child=F,C.last=F)}return C.tail!==null?(d=C.tail,C.rendering=d,C.tail=d.sibling,C.renderingStartTime=$i(),d.sibling=null,A=Lr.current,b(Lr,L?A&1|2:A&1),Mn&&de(m,C.treeForkCount),d):(or(m),null);case 22:case 23:return ct(m),J(),C=m.memoizedState!==null,d!==null?d.memoizedState!==null!==C&&(m.flags|=8192):C&&(m.flags|=8192),C?(A&536870912)!==0&&(m.flags&128)===0&&(or(m),m.subtreeFlags&6&&(m.flags|=8192)):or(m),A=m.updateQueue,A!==null&&th(m,A.retryQueue),A=null,d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(A=d.memoizedState.cachePool.pool),C=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(C=m.memoizedState.cachePool.pool),C!==A&&(m.flags|=2048),d!==null&&y(pc),null;case 24:return A=null,d!==null&&(A=d.memoizedState.cache),m.memoizedState.cache!==A&&(m.flags|=2048),Ye(_r),or(m),null;case 25:return null;case 30:return null}throw Error(i(156,m.tag))}function By(d,m){switch(ue(m),m.tag){case 1:return d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 3:return Ye(_r),me(),d=m.flags,(d&65536)!==0&&(d&128)===0?(m.flags=d&-65537|128,m):null;case 26:case 27:case 5:return We(m),null;case 31:if(m.memoizedState!==null){if(ct(m),m.alternate===null)throw Error(i(340));ot()}return d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 13:if(ct(m),d=m.memoizedState,d!==null&&d.dehydrated!==null){if(m.alternate===null)throw Error(i(340));ot()}return d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 19:return y(Lr),null;case 4:return me(),null;case 10:return Ye(m.type),null;case 22:case 23:return ct(m),J(),d!==null&&y(pc),d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 24:return Ye(_r),null;case 25:return null;default:return null}}function K1(d,m){switch(ue(m),m.tag){case 3:Ye(_r),me();break;case 26:case 27:case 5:We(m);break;case 4:me();break;case 31:m.memoizedState!==null&&ct(m);break;case 13:ct(m);break;case 19:y(Lr);break;case 10:Ye(m.type);break;case 22:case 23:ct(m),J(),d!==null&&y(pc);break;case 24:Ye(_r)}}function co(d,m){try{var A=m.updateQueue,C=A!==null?A.lastEffect:null;if(C!==null){var L=C.next;A=L;do{if((A.tag&d)===d){C=void 0;var F=A.create,K=A.inst;C=F(),K.destroy=C}A=A.next}while(A!==L)}}catch(ce){Qt(m,m.return,ce)}}function uo(d,m,A){try{var C=m.updateQueue,L=C!==null?C.lastEffect:null;if(L!==null){var F=L.next;C=F;do{if((C.tag&d)===d){var K=C.inst,ce=K.destroy;if(ce!==void 0){K.destroy=void 0,L=m;var Le=A,Je=ce;try{Je()}catch(ht){Qt(L,Le,ht)}}}C=C.next}while(C!==F)}}catch(ht){Qt(m,m.return,ht)}}function wf(d){var m=d.updateQueue;if(m!==null){var A=d.stateNode;try{rl(m,A)}catch(C){Qt(d,d.return,C)}}}function lm(d,m,A){A.props=iu(d.type,d.memoizedProps),A.state=d.memoizedState;try{A.componentWillUnmount()}catch(C){Qt(d,m,C)}}function Mf(d,m){try{var A=d.ref;if(A!==null){switch(d.tag){case 26:case 27:case 5:var C=Lf(d.stateNode);break;case 30:C=d.stateNode;break;default:C=d.stateNode}typeof A=="function"?d.refCleanup=A(C):A.current=C}}catch(L){Qt(d,m,L)}}function qi(d,m){var A=d.ref,C=d.refCleanup;if(A!==null)if(typeof C=="function")try{C()}catch(L){Qt(d,m,L)}finally{d.refCleanup=null,d=d.alternate,d!=null&&(d.refCleanup=null)}else if(typeof A=="function")try{A(null)}catch(L){Qt(d,m,L)}else A.current=null}function lu(d){var m=d.type,A=d.memoizedProps,C=d.stateNode;try{c_(C,m,A,d)}catch(L){Qt(d,d.return,L)}}function nh(d,m,A){try{u_(d.stateNode,d.type,A,m,d)}catch(C){Qt(d,d.return,C)}}function Ly(d){return d.tag===5||d.tag===3||(_s?d.tag===26:!1)||(fi?d.tag===27&&xu(d.type):!1)||d.tag===4}function al(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||Ly(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(fi&&d.tag===27&&xu(d.type)||d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function cm(d,m,A){var C=d.tag;if(C===5||C===6)d=d.stateNode,m?d_(A,d,m):n0(A,d);else if(C!==4&&(fi&&C===27&&xu(d.type)&&(A=d.stateNode,m=null),d=d.child,d!==null))for(cm(d,m,A),d=d.sibling;d!==null;)cm(d,m,A),d=d.sibling}function rh(d,m,A){var C=d.tag;if(C===5||C===6)d=d.stateNode,m?f_(A,d,m):t0(A,d);else if(C!==4&&(fi&&C===27&&xu(d.type)&&(A=d.stateNode),d=d.child,d!==null))for(rh(d,m,A),d=d.sibling;d!==null;)rh(d,m,A),d=d.sibling}function ky(d,m,A){d=d.containerInfo;try{l0(d,A)}catch(C){Qt(m,m.return,C)}}function Y1(d){var m=d.stateNode,A=d.memoizedProps;try{ei(d.type,A,m,d)}catch(C){Qt(d,d.return,C)}}function kT(d,m){for(Mm(d.containerInfo),qr=m;qr!==null;)if(d=qr,m=d.child,(d.subtreeFlags&1028)!==0&&m!==null)m.return=d,qr=m;else for(;qr!==null;){d=qr;var A=d.alternate;switch(m=d.flags,d.tag){case 0:if((m&4)!==0&&(m=d.updateQueue,m=m!==null?m.events:null,m!==null))for(var C=0;C<m.length;C++){var L=m[C];L.ref.impl=L.nextImpl}break;case 11:case 15:break;case 1:if((m&1024)!==0&&A!==null){m=void 0,C=d,L=A.memoizedProps,A=A.memoizedState;var F=C.stateNode;try{var K=iu(C.type,L);m=F.getSnapshotBeforeUpdate(K,A),F.__reactInternalSnapshotBeforeUpdate=m}catch(ce){Qt(C,C.return,ce)}}break;case 3:(m&1024)!==0&&On&&a0(d.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((m&1024)!==0)throw Error(i(163))}if(m=d.sibling,m!==null){m.return=d.return,qr=m;break}qr=d.return}}function J1(d,m,A){var C=A.flags;switch(A.tag){case 0:case 11:case 15:ra(d,A),C&4&&co(5,A);break;case 1:if(ra(d,A),C&4)if(d=A.stateNode,m===null)try{d.componentDidMount()}catch(K){Qt(A,A.return,K)}else{var L=iu(A.type,m.memoizedProps);m=m.memoizedState;try{d.componentDidUpdate(L,m,d.__reactInternalSnapshotBeforeUpdate)}catch(K){Qt(A,A.return,K)}}C&64&&wf(A),C&512&&Mf(A,A.return);break;case 3:if(ra(d,A),C&64&&(C=A.updateQueue,C!==null)){if(d=null,A.child!==null)switch(A.child.tag){case 27:case 5:d=Lf(A.child.stateNode);break;case 1:d=A.child.stateNode}try{rl(C,d)}catch(K){Qt(A,A.return,K)}}break;case 27:fi&&m===null&&C&4&&Y1(A);case 26:case 5:if(ra(d,A),m===null){if(C&4)lu(A);else if(C&64){d=A.type,m=A.memoizedProps,L=A.stateNode;try{N_(L,d,m,A)}catch(K){Qt(A,A.return,K)}}}C&512&&Mf(A,A.return);break;case 12:ra(d,A);break;case 31:ra(d,A),C&4&&ms(d,A);break;case 13:ra(d,A),C&4&&ah(d,A),C&64&&(C=A.memoizedState,C!==null&&(C=C.dehydrated,C!==null&&(A=FT.bind(null,A),Dm(C,A))));break;case 22:if(C=A.memoizedState!==null||kr,!C){m=m!==null&&m.memoizedState!==null||Fr,L=kr;var F=Fr;kr=C,(Fr=m)&&!F?vs(d,A,(A.subtreeFlags&8772)!==0):ra(d,A),kr=L,Fr=F}break;case 30:break;default:ra(d,A)}}function Fy(d){var m=d.alternate;m!==null&&(d.alternate=null,Fy(m)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(m=d.stateNode,m!==null&&Em(m)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function ps(d,m,A){for(A=A.child;A!==null;)ih(d,m,A),A=A.sibling}function ih(d,m,A){if(Sa&&typeof Sa.onCommitFiberUnmount=="function")try{Sa.onCommitFiberUnmount(Su,A)}catch{}switch(A.tag){case 26:if(_s){Fr||qi(A,m),ps(d,m,A),A.memoizedState?dc(A.memoizedState):A.stateNode&&b0(A.stateNode);break}case 27:if(fi){Fr||qi(A,m);var C=Pr,L=$r;xu(A.type)&&(Pr=A.stateNode,$r=!1),ps(d,m,A),Si(A.stateNode),Pr=C,$r=L;break}case 5:Fr||qi(A,m);case 6:if(On){if(C=Pr,L=$r,Pr=null,ps(d,m,A),Pr=C,$r=L,Pr!==null)if($r)try{r0(Pr,A.stateNode)}catch(F){Qt(A,m,F)}else try{h_(Pr,A.stateNode)}catch(F){Qt(A,m,F)}}else ps(d,m,A);break;case 18:On&&Pr!==null&&($r?Nm(Pr,A.stateNode):m0(Pr,A.stateNode));break;case 4:On?(C=Pr,L=$r,Pr=A.stateNode.containerInfo,$r=!0,ps(d,m,A),Pr=C,$r=L):(qa&&ky(A.stateNode,A,s0()),ps(d,m,A));break;case 0:case 11:case 14:case 15:uo(2,A,m),Fr||uo(4,A,m),ps(d,m,A);break;case 1:Fr||(qi(A,m),C=A.stateNode,typeof C.componentWillUnmount=="function"&&lm(A,m,C)),ps(d,m,A);break;case 21:ps(d,m,A);break;case 22:Fr=(C=Fr)||A.memoizedState!==null,ps(d,m,A),Fr=C;break;default:ps(d,m,A)}}function ms(d,m){if(xr&&m.memoizedState===null&&(d=m.alternate,d!==null&&(d=d.memoizedState,d!==null))){d=d.dehydrated;try{GT(d)}catch(A){Qt(m,m.return,A)}}}function ah(d,m){if(xr&&m.memoizedState===null&&(d=m.alternate,d!==null&&(d=d.memoizedState,d!==null&&(d=d.dehydrated,d!==null))))try{HT(d)}catch(A){Qt(m,m.return,A)}}function gs(d){switch(d.tag){case 31:case 13:case 19:var m=d.stateNode;return m===null&&(m=d.stateNode=new O0),m;case 22:return d=d.stateNode,m=d._retryCache,m===null&&(m=d._retryCache=new O0),m;default:throw Error(i(435,d.tag))}}function sl(d,m){var A=gs(d);m.forEach(function(C){if(!A.has(C)){A.add(C);var L=UT.bind(null,d,C);C.then(L,L)}})}function bi(d,m){var A=m.deletions;if(A!==null)for(var C=0;C<A.length;C++){var L=A[C],F=d,K=m;if(On){var ce=K;e:for(;ce!==null;){switch(ce.tag){case 27:if(fi){if(xu(ce.type)){Pr=ce.stateNode,$r=!1;break e}break}case 5:Pr=ce.stateNode,$r=!1;break e;case 3:case 4:Pr=ce.stateNode.containerInfo,$r=!0;break e}ce=ce.return}if(Pr===null)throw Error(i(160));ih(F,K,L),Pr=null,$r=!1}else ih(F,K,L);F=L.alternate,F!==null&&(F.return=null),L.return=null}if(m.subtreeFlags&13886)for(m=m.child;m!==null;)sh(m,d),m=m.sibling}function sh(d,m){var A=d.alternate,C=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:bi(m,d),_i(d),C&4&&(uo(3,d,d.return),co(3,d),uo(5,d,d.return));break;case 1:bi(m,d),_i(d),C&512&&(Fr||A===null||qi(A,A.return)),C&64&&kr&&(d=d.updateQueue,d!==null&&(C=d.callbacks,C!==null&&(A=d.shared.hiddenCallbacks,d.shared.hiddenCallbacks=A===null?C:A.concat(C))));break;case 26:if(_s){var L=Jn;if(bi(m,d),_i(d),C&512&&(Fr||A===null||qi(A,A.return)),C&4){C=A!==null?A.memoizedState:null;var F=d.memoizedState;A===null?F===null?d.stateNode===null?d.stateNode=U_(L,d.type,d.memoizedProps,d):x0(L,d.type,d.stateNode):d.stateNode=y0(L,F,d.memoizedProps):C!==F?(C===null?A.stateNode!==null&&b0(A.stateNode):dc(C),F===null?x0(L,d.type,d.stateNode):y0(L,F,d.memoizedProps)):F===null&&d.stateNode!==null&&nh(d,d.memoizedProps,A.memoizedProps)}break}case 27:if(fi){bi(m,d),_i(d),C&512&&(Fr||A===null||qi(A,A.return)),A!==null&&C&4&&nh(d,d.memoizedProps,A.memoizedProps);break}case 5:if(bi(m,d),_i(d),C&512&&(Fr||A===null||qi(A,A.return)),On){if(d.flags&32){L=d.stateNode;try{i0(L)}catch(nt){Qt(d,d.return,nt)}}C&4&&d.stateNode!=null&&(L=d.memoizedProps,nh(d,L,A!==null?A.memoizedProps:L)),C&1024&&(Hf=!0)}else qa&&d.alternate!==null&&(d.alternate.stateNode=d.stateNode);break;case 6:if(bi(m,d),_i(d),C&4&&On){if(d.stateNode===null)throw Error(i(162));C=d.memoizedProps,A=A!==null?A.memoizedProps:C,L=d.stateNode;try{l_(L,A,C)}catch(nt){Qt(d,d.return,nt)}}break;case 3:if(_s?(j_(),L=Jn,Jn=yh(m.containerInfo),bi(m,d),Jn=L):bi(m,d),_i(d),C&4){if(On&&xr&&A!==null&&A.memoizedState.isDehydrated)try{I_(m.containerInfo)}catch(nt){Qt(d,d.return,nt)}if(qa){C=m.containerInfo,A=m.pendingChildren;try{l0(C,A)}catch(nt){Qt(d,d.return,nt)}}}Hf&&(Hf=!1,um(d));break;case 4:_s?(A=Jn,Jn=yh(d.stateNode.containerInfo),bi(m,d),_i(d),Jn=A):(bi(m,d),_i(d)),C&4&&qa&&ky(d.stateNode,d,d.stateNode.pendingChildren);break;case 12:bi(m,d),_i(d);break;case 31:bi(m,d),_i(d),C&4&&(C=d.updateQueue,C!==null&&(d.updateQueue=null,sl(d,C)));break;case 13:bi(m,d),_i(d),d.child.flags&8192&&d.memoizedState!==null!=(A!==null&&A.memoizedState!==null)&&(Ch=$i()),C&4&&(C=d.updateQueue,C!==null&&(d.updateQueue=null,sl(d,C)));break;case 22:L=d.memoizedState!==null;var K=A!==null&&A.memoizedState!==null,ce=kr,Le=Fr;if(kr=ce||L,Fr=Le||K,bi(m,d),Fr=Le,kr=ce,_i(d),C&8192&&(m=d.stateNode,m._visibility=L?m._visibility&-2:m._visibility|1,L&&(A===null||K||kr||Fr||Ql(d)),On)){e:if(A=null,On)for(m=d;;){if(m.tag===5||_s&&m.tag===26){if(A===null){K=A=m;try{F=K.stateNode,L?jT(F):m_(K.stateNode,K.memoizedProps)}catch(nt){Qt(K,K.return,nt)}}}else if(m.tag===6){if(A===null){K=m;try{var Je=K.stateNode;L?p_(Je):g_(Je,K.memoizedProps)}catch(nt){Qt(K,K.return,nt)}}}else if(m.tag===18){if(A===null){K=m;try{var ht=K.stateNode;L?L_(ht):k_(K.stateNode)}catch(nt){Qt(K,K.return,nt)}}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===d)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break e;for(;m.sibling===null;){if(m.return===null||m.return===d)break e;A===m&&(A=null),m=m.return}A===m&&(A=null),m.sibling.return=m.return,m=m.sibling}}C&4&&(C=d.updateQueue,C!==null&&(A=C.retryQueue,A!==null&&(C.retryQueue=null,sl(d,A))));break;case 19:bi(m,d),_i(d),C&4&&(C=d.updateQueue,C!==null&&(d.updateQueue=null,sl(d,C)));break;case 30:break;case 21:break;default:bi(m,d),_i(d)}}function _i(d){var m=d.flags;if(m&2){try{for(var A,C=d.return;C!==null;){if(Ly(C)){A=C;break}C=C.return}if(On){if(A==null)throw Error(i(160));switch(A.tag){case 27:if(fi){var L=A.stateNode,F=al(d);rh(d,F,L);break}case 5:var K=A.stateNode;A.flags&32&&(i0(K),A.flags&=-33);var ce=al(d);rh(d,ce,K);break;case 3:case 4:var Le=A.stateNode.containerInfo,Je=al(d);cm(d,Je,Le);break;default:throw Error(i(161))}}}catch(ht){Qt(d,d.return,ht)}d.flags&=-3}m&4096&&(d.flags&=-4097)}function um(d){if(d.subtreeFlags&1024)for(d=d.child;d!==null;){var m=d;um(m),m.tag===5&&m.flags&1024&&Jy(m.stateNode),d=d.sibling}}function ra(d,m){if(m.subtreeFlags&8772)for(m=m.child;m!==null;)J1(d,m.alternate,m),m=m.sibling}function Ql(d){for(d=d.child;d!==null;){var m=d;switch(m.tag){case 0:case 11:case 14:case 15:uo(4,m,m.return),Ql(m);break;case 1:qi(m,m.return);var A=m.stateNode;typeof A.componentWillUnmount=="function"&&lm(m,m.return,A),Ql(m);break;case 27:fi&&Si(m.stateNode);case 26:case 5:qi(m,m.return),Ql(m);break;case 22:m.memoizedState===null&&Ql(m);break;case 30:Ql(m);break;default:Ql(m)}d=d.sibling}}function vs(d,m,A){for(A=A&&(m.subtreeFlags&8772)!==0,m=m.child;m!==null;){var C=m.alternate,L=d,F=m,K=F.flags;switch(F.tag){case 0:case 11:case 15:vs(L,F,A),co(4,F);break;case 1:if(vs(L,F,A),C=F,L=C.stateNode,typeof L.componentDidMount=="function")try{L.componentDidMount()}catch(Je){Qt(C,C.return,Je)}if(C=F,L=C.updateQueue,L!==null){var ce=C.stateNode;try{var Le=L.shared.hiddenCallbacks;if(Le!==null)for(L.shared.hiddenCallbacks=null,L=0;L<Le.length;L++)nl(Le[L],ce)}catch(Je){Qt(C,C.return,Je)}}A&&K&64&&wf(F),Mf(F,F.return);break;case 27:fi&&Y1(F);case 26:case 5:vs(L,F,A),A&&C===null&&K&4&&lu(F),Mf(F,F.return);break;case 12:vs(L,F,A);break;case 31:vs(L,F,A),A&&K&4&&ms(L,F);break;case 13:vs(L,F,A),A&&K&4&&ah(L,F);break;case 22:F.memoizedState===null&&vs(L,F,A),Mf(F,F.return);break;case 30:break;default:vs(L,F,A)}m=m.sibling}}function ec(d,m){var A=null;d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(A=d.memoizedState.cachePool.pool),d=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(d=m.memoizedState.cachePool.pool),d!==A&&(d!=null&&d.refCount++,A!=null&&je(A))}function Uy(d,m){d=null,m.alternate!==null&&(d=m.alternate.memoizedState.cache),m=m.memoizedState.cache,m!==d&&(m.refCount++,d!=null&&je(d))}function Tr(d,m,A,C){if(m.subtreeFlags&10256)for(m=m.child;m!==null;)fm(d,m,A,C),m=m.sibling}function fm(d,m,A,C){var L=m.flags;switch(m.tag){case 0:case 11:case 15:Tr(d,m,A,C),L&2048&&co(9,m);break;case 1:Tr(d,m,A,C);break;case 3:Tr(d,m,A,C),L&2048&&(d=null,m.alternate!==null&&(d=m.alternate.memoizedState.cache),m=m.memoizedState.cache,m!==d&&(m.refCount++,d!=null&&je(d)));break;case 12:if(L&2048){Tr(d,m,A,C),d=m.stateNode;try{var F=m.memoizedProps,K=F.id,ce=F.onPostCommit;typeof ce=="function"&&ce(K,m.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(Le){Qt(m,m.return,Le)}}else Tr(d,m,A,C);break;case 31:Tr(d,m,A,C);break;case 13:Tr(d,m,A,C);break;case 23:break;case 22:F=m.stateNode,K=m.alternate,m.memoizedState!==null?F._visibility&2?Tr(d,m,A,C):Ef(d,m):F._visibility&2?Tr(d,m,A,C):(F._visibility|=2,ga(d,m,A,C,(m.subtreeFlags&10256)!==0||!1)),L&2048&&ec(K,m);break;case 24:Tr(d,m,A,C),L&2048&&Uy(m.alternate,m);break;default:Tr(d,m,A,C)}}function ga(d,m,A,C,L){for(L=L&&((m.subtreeFlags&10256)!==0||!1),m=m.child;m!==null;){var F=d,K=m,ce=A,Le=C,Je=K.flags;switch(K.tag){case 0:case 11:case 15:ga(F,K,ce,Le,L),co(8,K);break;case 23:break;case 22:var ht=K.stateNode;K.memoizedState!==null?ht._visibility&2?ga(F,K,ce,Le,L):Ef(F,K):(ht._visibility|=2,ga(F,K,ce,Le,L)),L&&Je&2048&&ec(K.alternate,K);break;case 24:ga(F,K,ce,Le,L),L&&Je&2048&&Uy(K.alternate,K);break;default:ga(F,K,ce,Le,L)}m=m.sibling}}function Ef(d,m){if(m.subtreeFlags&10256)for(m=m.child;m!==null;){var A=d,C=m,L=C.flags;switch(C.tag){case 22:Ef(A,C),L&2048&&ec(C.alternate,C);break;case 24:Ef(A,C),L&2048&&Uy(C.alternate,C);break;default:Ef(A,C)}m=m.sibling}}function fo(d,m,A){if(d.subtreeFlags&Ya)for(d=d.child;d!==null;)tc(d,m,A),d=d.sibling}function tc(d,m,A){switch(d.tag){case 26:if(fo(d,m,A),d.flags&Ya)if(d.memoizedState!==null)z_(A,Jn,d.memoizedState,d.memoizedProps);else{var C=d.stateNode,L=d.type;d=d.memoizedProps,((m&335544128)===m||Ky(L,d))&&Tm(A,C,L,d)}break;case 5:fo(d,m,A),d.flags&Ya&&(C=d.stateNode,L=d.type,d=d.memoizedProps,((m&335544128)===m||Ky(L,d))&&Tm(A,C,L,d));break;case 3:case 4:_s?(C=Jn,Jn=yh(d.stateNode.containerInfo),fo(d,m,A),Jn=C):fo(d,m,A);break;case 22:d.memoizedState===null&&(C=d.alternate,C!==null&&C.memoizedState!==null?(C=Ya,Ya=16777216,fo(d,m,A),Ya=C):fo(d,m,A));break;default:fo(d,m,A)}}function dm(d){var m=d.alternate;if(m!==null&&(d=m.child,d!==null)){m.child=null;do m=d.sibling,d.sibling=null,d=m;while(d!==null)}}function Tf(d){var m=d.deletions;if((d.flags&16)!==0){if(m!==null)for(var A=0;A<m.length;A++){var C=m[A];qr=C,Ha(C,d)}dm(d)}if(d.subtreeFlags&10256)for(d=d.child;d!==null;)hm(d),d=d.sibling}function hm(d){switch(d.tag){case 0:case 11:case 15:Tf(d),d.flags&2048&&uo(9,d,d.return);break;case 3:Tf(d);break;case 12:Tf(d);break;case 22:var m=d.stateNode;d.memoizedState!==null&&m._visibility&2&&(d.return===null||d.return.tag!==13)?(m._visibility&=-3,oh(d)):Tf(d);break;default:Tf(d)}}function oh(d){var m=d.deletions;if((d.flags&16)!==0){if(m!==null)for(var A=0;A<m.length;A++){var C=m[A];qr=C,Ha(C,d)}dm(d)}for(d=d.child;d!==null;){switch(m=d,m.tag){case 0:case 11:case 15:uo(8,m,m.return),oh(m);break;case 22:A=m.stateNode,A._visibility&2&&(A._visibility&=-3,oh(m));break;default:oh(m)}d=d.sibling}}function Ha(d,m){for(;qr!==null;){var A=qr;switch(A.tag){case 0:case 11:case 15:uo(8,A,m);break;case 23:case 22:if(A.memoizedState!==null&&A.memoizedState.cachePool!==null){var C=A.memoizedState.cachePool.pool;C!=null&&C.refCount++}break;case 24:je(A.memoizedState.cache)}if(C=A.child,C!==null)C.return=A,qr=C;else e:for(A=d;qr!==null;){C=qr;var L=C.sibling,F=C.return;if(Fy(C),C===A){qr=null;break e}if(L!==null){L.return=F,qr=L;break e}qr=F}}}function nc(d){var m=on(d);if(m!=null){if(typeof m.memoizedProps["data-testname"]!="string")throw Error(i(364));return m}if(d=Vr(d),d===null)throw Error(i(362));return d.stateNode.current}function rc(d,m){var A=d.tag;switch(m.$$typeof){case Rs:if(d.type===m.value)return!0;break;case Wf:e:{for(m=m.value,d=[d,0],A=0;A<d.length;){var C=d[A++],L=C.tag,F=d[A++],K=m[F];if(L!==5&&L!==26&&L!==27||!uc(C)){for(;K!=null&&rc(C,K);)F++,K=m[F];if(F===m.length){m=!0;break e}else for(C=C.child;C!==null;)d.push(C,F),C=C.sibling}}m=!1}return m;case qf:if((A===5||A===26||A===27)&&e0(d.stateNode,m.value))return!0;break;case yc:if((A===5||A===6||A===26||A===27)&&(d=gh(d),d!==null&&0<=d.indexOf(m.value)))return!0;break;case Eh:if((A===5||A===26||A===27)&&(d=d.memoizedProps["data-testname"],typeof d=="string"&&d.toLowerCase()===m.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function Cf(d){switch(d.$$typeof){case Rs:return"<"+(p(d.value)||"Unknown")+">";case Wf:return":has("+(Cf(d)||"")+")";case qf:return'[role="'+d.value+'"]';case yc:return'"'+d.value+'"';case Eh:return'[data-testname="'+d.value+'"]';default:throw Error(i(365))}}function Rf(d,m){var A=[];d=[d,0];for(var C=0;C<d.length;){var L=d[C++],F=L.tag,K=d[C++],ce=m[K];if(F!==5&&F!==26&&F!==27||!uc(L)){for(;ce!=null&&rc(L,ce);)K++,ce=m[K];if(K===m.length)A.push(L);else for(L=L.child;L!==null;)d.push(L,K),L=L.sibling}}return A}function va(d,m){if(!ui)throw Error(i(363));d=nc(d),d=Rf(d,m),m=[],d=Array.from(d);for(var A=0;A<d.length;){var C=d[A++],L=C.tag;if(L===5||L===26||L===27)uc(C)||m.push(C.stateNode);else for(C=C.child;C!==null;)d.push(C),C=C.sibling}return m}function yr(){return(Sn&2)!==0&&En!==0?En&-En:Vt.T!==null?Ae():Ff()}function ol(){if(ca===0)if((En&536870912)===0||Mn){var d=_u;_u<<=1,(_u&3932160)===0&&(_u=262144),ca=d}else ca=536870912;return d=Aa.current,d!==null&&(d.flags|=32),ca}function Cr(d,m,A){(d===gn&&(Zn===2||Zn===9)||d.cancelPendingCommit!==null)&&(Br(d,0),po(d,En,ca,!1)),D(d,A),((Sn&2)===0||d!==gn)&&(d===gn&&((Sn&2)===0&&(_c|=A),Dr===4&&po(d,En,ca,!1)),_t(d))}function js(d,m,A){if((Sn&6)!==0)throw Error(i(327));var C=!A&&(m&127)===0&&(m&d.expiredLanes)===0||E(d,m),L=C?e_(d,m):mo(d,m,!0),F=C;do{if(L===0){xc&&!C&&po(d,m,0,!1);break}else{if(A=d.current.alternate,F&&!Z1(A)){L=mo(d,m,!1),F=!1;continue}if(L===2){if(F=m,d.errorRecoveryDisabledLanes&F)var K=0;else K=d.pendingLanes&-536870913,K=K!==0?K:K&536870912?536870912:0;if(K!==0){m=K;e:{var ce=d;L=Th;var Le=xr&&ce.current.memoizedState.isDehydrated;if(Le&&(Br(ce,K).flags|=256),K=mo(ce,K,!1),K!==2){if(bc&&!Le){ce.errorRecoveryDisabledLanes|=F,_c|=F,L=4;break e}F=Ma,Ma=L,F!==null&&(Ma===null?Ma=F:Ma.push.apply(Ma,F))}L=K}if(F=!1,L!==2)continue}}if(L===1){Br(d,0),po(d,m,0,!0);break}e:{switch(C=d,F=L,F){case 0:case 1:throw Error(i(345));case 4:if((m&4194048)!==m)break;case 6:po(C,m,ca,!Vs);break e;case 2:Ma=null;break;case 3:case 5:break;default:throw Error(i(329))}if((m&62914560)===m&&(L=Ch+300-$i(),10<L)){if(po(C,m,ca,!Vs),S(C,0,!0)!==0)break e;Ro=m,C.timeoutHandle=Xy(ho.bind(null,C,A,Ma,Rh,Km,m,ca,_c,Xf,Vs,F,"Throttled",-0,0),L);break e}ho(C,A,Ma,Rh,Km,m,ca,_c,Xf,Vs,F,null,-0,0)}}break}while(!0);_t(d)}function ho(d,m,A,C,L,F,K,ce,Le,Je,ht,nt,Mt,sn){if(d.timeoutHandle=ba,nt=m.subtreeFlags,nt&8192||(nt&16785408)===16785408){nt=Yy(),tc(m,F,nt);var Xr=(F&62914560)===F?Ch-$i():(F&4194048)===F?Cu-$i():0;if(Xr=o_(nt,Xr),Xr!==null){Ro=F,d.cancelPendingCommit=Xr(vo.bind(null,d,m,F,A,C,L,K,ce,Le,ht,nt,null,Mt,sn)),po(d,F,K,!Je);return}}vo(d,m,F,A,C,L,K,ce,Le)}function Z1(d){for(var m=d;;){var A=m.tag;if((A===0||A===11||A===15)&&m.flags&16384&&(A=m.updateQueue,A!==null&&(A=A.stores,A!==null)))for(var C=0;C<A.length;C++){var L=A[C],F=L.getSnapshot;L=L.value;try{if(!Wr(F(),L))return!1}catch{return!1}}if(A=m.child,m.subtreeFlags&16384&&A!==null)A.return=m,m=A;else{if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return!0;m=m.return}m.sibling.return=m.return,m=m.sibling}}return!0}function po(d,m,A,C){m&=~$f,m&=~_c,d.suspendedLanes|=m,d.pingedLanes&=~m,C&&(d.warmLanes|=m),C=d.expirationTimes;for(var L=m;0<L;){var F=31-_a(L),K=1<<F;C[F]=-1,L&=~K}A!==0&&k(d,A,m)}function pm(){return(Sn&6)===0?(lt(0),!1):!0}function mm(){if(An!==null){if(Zn===0)var d=An.return;else d=An,Gs=cr=null,Qn(d),mc=null,Au=0,d=An;for(;d!==null;)K1(d.alternate,d),d=d.return;An=null}}function Br(d,m){var A=d.timeoutHandle;A!==ba&&(d.timeoutHandle=ba,s_(A)),A=d.cancelPendingCommit,A!==null&&(d.cancelPendingCommit=null,A()),Ro=0,mm(),gn=d,An=A=Wa(d.current,null),En=m,Zn=0,ti=null,Vs=!1,xc=E(d,m),bc=!1,Xf=ca=$f=_c=xl=Dr=0,Ma=Th=null,Km=!1,(m&8)!==0&&(m|=m&32);var C=d.entangledLanes;if(C!==0)for(d=d.entanglements,C&=m;0<C;){var L=31-_a(C),F=1<<L;m|=d[L],C&=~F}return Co=m,$l(),A}function lr(d,m){ln=null,Vt.H=Ka,m===pi||m===Ts?(m=hn(),Zn=3):m===$m?(m=hn(),Zn=4):Zn=m===la?8:m!==null&&typeof m=="object"&&typeof m.then=="function"?6:1,ti=m,An===null&&(Dr=1,im(d,ie(m,d.current)))}function Rn(){var d=Aa.current;return d===null?!0:(En&4194048)===En?wa===null:(En&62914560)===En||(En&536870912)!==0?d===wa:!1}function ll(){var d=Vt.H;return Vt.H=Ka,d===null?Ka:d}function Va(){var d=Vt.A;return Vt.A=Vf,d}function Of(){Dr=4,Vs||(En&4194048)!==En&&Aa.current!==null||(xc=!0),(xl&134217727)===0&&(_c&134217727)===0||gn===null||po(gn,En,ca,!1)}function mo(d,m,A){var C=Sn;Sn|=2;var L=ll(),F=Va();(gn!==d||En!==m)&&(Rh=null,Br(d,m)),m=!1;var K=Dr;e:do try{if(Zn!==0&&An!==null){var ce=An,Le=ti;switch(Zn){case 8:mm(),K=6;break e;case 3:case 2:case 9:case 6:Aa.current===null&&(m=!0);var Je=Zn;if(Zn=0,ti=null,go(d,ce,Le,Je),A&&xc){K=0;break e}break;default:Je=Zn,Zn=0,ti=null,go(d,ce,Le,Je)}}Q1(),K=Dr;break}catch(ht){lr(d,ht)}while(!0);return m&&d.shellSuspendCounter++,Gs=cr=null,Sn=C,Vt.H=L,Vt.A=F,An===null&&(gn=null,En=0,$l()),K}function Q1(){for(;An!==null;)ic(An)}function e_(d,m){var A=Sn;Sn|=2;var C=ll(),L=Va();gn!==d||En!==m?(Rh=null,Sc=$i()+500,Br(d,m)):xc=E(d,m);e:do try{if(Zn!==0&&An!==null){m=An;var F=ti;t:switch(Zn){case 1:Zn=0,ti=null,go(d,m,F,1);break;case 2:case 9:if(at(F)){Zn=0,ti=null,gm(m);break}m=function(){Zn!==2&&Zn!==9||gn!==d||(Zn=7),_t(d)},F.then(m,m);break e;case 3:Zn=7;break e;case 4:Zn=5;break e;case 7:at(F)?(Zn=0,ti=null,gm(m)):(Zn=0,ti=null,go(d,m,F,7));break;case 5:var K=null;switch(An.tag){case 26:K=An.memoizedState;case 5:case 27:var ce=An,Le=ce.type,Je=ce.pendingProps;if(K?S0(K):Rr(ce.stateNode,Le,Je)){Zn=0,ti=null;var ht=ce.sibling;if(ht!==null)An=ht;else{var nt=ce.return;nt!==null?(An=nt,Df(nt)):An=null}break t}}Zn=0,ti=null,go(d,m,F,5);break;case 6:Zn=0,ti=null,go(d,m,F,6);break;case 8:mm(),Dr=6;break e;default:throw Error(i(462))}}Pf();break}catch(Mt){lr(d,Mt)}while(!0);return Gs=cr=null,Vt.H=C,Vt.A=L,Sn=A,An!==null?0:(gn=null,En=0,$l(),Dr)}function Pf(){for(;An!==null&&!H_();)ic(An)}function ic(d){var m=Dy(d.alternate,d,Co);d.memoizedProps=d.pendingProps,m===null?Df(d):An=m}function gm(d){var m=d,A=m.alternate;switch(m.tag){case 15:case 0:m=Ey(A,m,m.pendingProps,m.type,void 0,En);break;case 11:m=Ey(A,m,m.pendingProps,m.type.render,m.ref,En);break;case 5:Qn(m);default:K1(A,m),m=An=xm(m,Co),m=Dy(A,m,Co)}d.memoizedProps=d.pendingProps,m===null?Df(d):An=m}function go(d,m,A,C){Gs=cr=null,Qn(m),mc=null,Au=0;var L=m.return;try{if(LT(d,L,m,A,En)){Dr=1,im(d,ie(A,d.current)),An=null;return}}catch(F){if(L!==null)throw An=L,F;Dr=1,im(d,ie(A,d.current)),An=null;return}m.flags&32768?(Mn||C===1?d=!0:xc||(En&536870912)!==0?d=!1:(Vs=d=!0,(C===2||C===9||C===3||C===6)&&(C=Aa.current,C!==null&&C.tag===13&&(C.flags|=16384))),ac(m,d)):Df(m)}function Df(d){var m=d;do{if((m.flags&32768)!==0){ac(m,Vs);return}d=m.return;var A=X1(m.alternate,m,Co);if(A!==null){An=A;return}if(m=m.sibling,m!==null){An=m;return}An=m=d}while(m!==null);Dr===0&&(Dr=5)}function ac(d,m){do{var A=By(d.alternate,d);if(A!==null){A.flags&=32767,An=A;return}if(A=d.return,A!==null&&(A.flags|=32768,A.subtreeFlags=0,A.deletions=null),!m&&(d=d.sibling,d!==null)){An=d;return}An=d=A}while(d!==null);Dr=6,An=null}function vo(d,m,A,C,L,F,K,ce,Le){d.cancelPendingCommit=null;do xo();while(ni!==0);if((Sn&6)!==0)throw Error(i(327));if(m!==null){if(m===d.current)throw Error(i(177));if(F=m.lanes|m.childLanes,F|=wu,I(d,A,F,K,ce,Le),d===gn&&(An=gn=null,En=0),Ru=m,_l=d,Ro=A,Kf=F,Ym=L,P0=C,(m.subtreeFlags&10256)!==0||(m.flags&10256)!==0?(d.callbackNode=null,d.callbackPriority=0,Qr(bh,function(){return lh(),null})):(d.callbackNode=null,d.callbackPriority=0),C=(m.flags&13878)!==0,(m.subtreeFlags&13878)!==0||C){C=Vt.T,Vt.T=null,L=bs(),wn(2),K=Sn,Sn|=4;try{kT(d,m,A)}finally{Sn=K,wn(L),Vt.T=C}}ni=1,cl(),yo(),vm()}}function cl(){if(ni===1){ni=0;var d=_l,m=Ru,A=(m.flags&13878)!==0;if((m.subtreeFlags&13878)!==0||A){A=Vt.T,Vt.T=null;var C=bs();wn(2);var L=Sn;Sn|=4;try{sh(m,d),a_(d.containerInfo)}finally{Sn=L,wn(C),Vt.T=A}}d.current=m,ni=2}}function yo(){if(ni===2){ni=0;var d=_l,m=Ru,A=(m.flags&8772)!==0;if((m.subtreeFlags&8772)!==0||A){A=Vt.T,Vt.T=null;var C=bs();wn(2);var L=Sn;Sn|=4;try{J1(d,m.alternate,m)}finally{Sn=L,wn(C),Vt.T=A}}ni=3}}function vm(){if(ni===4||ni===3){ni=0,w0();var d=_l,m=Ru,A=Ro,C=P0;(m.subtreeFlags&10256)!==0||(m.flags&10256)!==0?ni=5:(ni=0,Ru=_l=null,ym(d,d.pendingLanes));var L=d.pendingLanes;if(L===0&&(bl=null),q(A),m=m.stateNode,Sa&&typeof Sa.onCommitFiberRoot=="function")try{Sa.onCommitFiberRoot(Su,m,void 0,(m.current.flags&128)===128)}catch{}if(C!==null){m=Vt.T,L=bs(),wn(2),Vt.T=null;try{for(var F=d.onRecoverableError,K=0;K<C.length;K++){var ce=C[K];F(ce.value,{componentStack:ce.stack})}}finally{Vt.T=m,wn(L)}}(Ro&3)!==0&&xo(),_t(d),L=d.pendingLanes,(A&261930)!==0&&(L&42)!==0?d===Oh?jn++:(jn=0,Oh=d):jn=0,xr&&vh(),lt(0)}}function ym(d,m){(d.pooledCacheLanes&=m)===0&&(m=d.pooledCache,m!=null&&(d.pooledCache=null,je(m)))}function xo(){return cl(),yo(),vm(),lh()}function lh(){if(ni!==5)return!1;var d=_l,m=Kf;Kf=0;var A=q(Ro),C=32>A?32:A;A=Vt.T;var L=bs();try{wn(C),Vt.T=null,C=Ym,Ym=null;var F=_l,K=Ro;if(ni=0,Ru=_l=null,Ro=0,(Sn&6)!==0)throw Error(i(331));var ce=Sn;if(Sn|=4,hm(F.current),fm(F,F.current,K,C),Sn=ce,lt(0,!1),Sa&&typeof Sa.onPostCommitFiberRoot=="function")try{Sa.onPostCommitFiberRoot(Su,F)}catch{}return!0}finally{wn(L),Vt.T=A,ym(d,m)}}function sc(d,m,A){m=ie(A,m),m=wy(d.stateNode,m,2),d=za(d,m,2),d!==null&&(D(d,2),_t(d))}function Qt(d,m,A){if(d.tag===3)sc(d,d,A);else for(;m!==null;){if(m.tag===3){sc(m,d,A);break}else if(m.tag===1){var C=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(bl===null||!bl.has(C))){d=ie(A,d),A=L1(2),C=za(m,A,2),C!==null&&(k1(A,C,m,d),D(C,2),_t(C));break}}m=m.return}}function Nf(d,m,A){var C=d.pingCache;if(C===null){C=d.pingCache=new Ja;var L=new Set;C.set(m,L)}else L=C.get(m),L===void 0&&(L=new Set,C.set(m,L));L.has(A)||(bc=!0,L.add(A),d=t_.bind(null,d,m,A),m.then(d,d))}function t_(d,m,A){var C=d.pingCache;C!==null&&C.delete(m),d.pingedLanes|=d.suspendedLanes&A,d.warmLanes&=~A,gn===d&&(En&A)===A&&(Dr===4||Dr===3&&(En&62914560)===En&&300>$i()-Ch?(Sn&2)===0&&Br(d,0):$f|=A,Xf===En&&(Xf=0)),_t(d)}function n_(d,m){m===0&&(m=P()),d=Wi(d,m),d!==null&&(D(d,m),_t(d))}function FT(d){var m=d.memoizedState,A=0;m!==null&&(A=m.retryLane),n_(d,A)}function UT(d,m){var A=0;switch(d.tag){case 31:case 13:var C=d.stateNode,L=d.memoizedState;L!==null&&(A=L.retryLane);break;case 19:C=d.stateNode;break;case 22:C=d.stateNode._retryCache;break;default:throw Error(i(314))}C!==null&&C.delete(m),n_(d,A)}function Qr(d,m){return xh(d,m)}function jy(d,m,A,C){this.tag=d,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=m,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cu(d){return d=d.prototype,!(!d||!d.isReactComponent)}function Wa(d,m){var A=d.alternate;return A===null?(A=n(d.tag,m,d.key,d.mode),A.elementType=d.elementType,A.type=d.type,A.stateNode=d.stateNode,A.alternate=d,d.alternate=A):(A.pendingProps=m,A.type=d.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=d.flags&65011712,A.childLanes=d.childLanes,A.lanes=d.lanes,A.child=d.child,A.memoizedProps=d.memoizedProps,A.memoizedState=d.memoizedState,A.updateQueue=d.updateQueue,m=d.dependencies,A.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext},A.sibling=d.sibling,A.index=d.index,A.ref=d.ref,A.refCleanup=d.refCleanup,A}function xm(d,m){d.flags&=65011714;var A=d.alternate;return A===null?(d.childLanes=0,d.lanes=m,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=A.childLanes,d.lanes=A.lanes,d.child=A.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=A.memoizedProps,d.memoizedState=A.memoizedState,d.updateQueue=A.updateQueue,d.type=A.type,m=A.dependencies,d.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext}),d}function ul(d,m,A,C,L,F){var K=0;if(C=d,typeof d=="function")cu(d)&&(K=1);else if(typeof d=="string")K=_s&&fi?Im(d,A,Ai.current)?26:A0(d)?27:5:_s?Im(d,A,Ai.current)?26:5:fi&&A0(d)?27:5;else e:switch(d){case dh:return d=n(31,A,m,L),d.elementType=dh,d.lanes=F,d;case hu:return ys(A.children,L,F,m);case pu:K=8,L|=24;break;case mu:return d=n(12,A,m,L|2),d.elementType=mu,d.lanes=F,d;case Am:return d=n(13,A,m,L),d.elementType=Am,d.lanes=F,d;case fl:return d=n(19,A,m,L),d.elementType=fl,d.lanes=F,d;default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case xs:K=10;break e;case fh:K=9;break e;case If:K=11;break e;case wm:K=14;break e;case ia:K=16,C=null;break e}K=29,A=Error(i(130,d===null?"null":typeof d,"")),C=null}return m=n(K,A,m,L),m.elementType=d,m.type=C,m.lanes=F,m}function ys(d,m,A,C){return d=n(7,d,C,m),d.lanes=A,d}function zy(d,m,A){return d=n(6,d,null,m),d.lanes=A,d}function Gy(d){var m=n(18,null,null,0);return m.stateNode=d,m}function Hy(d,m,A){return m=n(4,d.children!==null?d.children:[],d.key,m),m.lanes=A,m.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},m}function r_(d,m,A,C,L,F,K,ce,Le){this.tag=1,this.containerInfo=d,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ba,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=R(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R(0),this.hiddenUpdates=R(null),this.identifierPrefix=C,this.onUncaughtError=L,this.onCaughtError=F,this.onRecoverableError=K,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Le,this.incompleteTransitions=new Map}function oc(d,m,A,C,L,F,K,ce,Le,Je,ht,nt){return d=new r_(d,m,A,K,Le,Je,ht,nt,ce),m=1,F===!0&&(m|=24),F=n(3,null,null,m),d.current=F,F.stateNode=d,m=Ne(),m.refCount++,d.pooledCache=m,m.refCount++,F.memoizedState={element:C,isDehydrated:A,cache:m},li(F),d}function bm(d){return d?(d=_o,d):_o}function ch(d){var m=d._reactInternals;if(m===void 0)throw typeof d.render=="function"?Error(i(188)):(d=Object.keys(d).join(","),Error(i(268,d)));return d=o(m),d=d!==null?c(d):null,d===null?null:Lf(d.stateNode)}function Vy(d,m,A,C,L,F){L=bm(L),C.context===null?C.context=L:C.pendingContext=L,C=ja(m),C.payload={element:A},F=F===void 0?null:F,F!==null&&(C.callback=F),A=za(d,C,m),A!==null&&(Cr(A,d,m),Xl(A,d,m))}function uu(d,m){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var A=d.retryLane;d.retryLane=A!==0&&A<m?A:m}}function uh(d,m){uu(d,m),(d=d.alternate)&&uu(d,m)}var pn={},_m=fe,ya=Y3e,Sm=Object.assign,fu=Symbol.for("react.element"),bo=Symbol.for("react.transitional.element"),du=Symbol.for("react.portal"),hu=Symbol.for("react.fragment"),pu=Symbol.for("react.strict_mode"),mu=Symbol.for("react.profiler"),fh=Symbol.for("react.consumer"),xs=Symbol.for("react.context"),If=Symbol.for("react.forward_ref"),Am=Symbol.for("react.suspense"),fl=Symbol.for("react.suspense_list"),wm=Symbol.for("react.memo"),ia=Symbol.for("react.lazy"),dh=Symbol.for("react.activity"),Wy=Symbol.for("react.memo_cache_sentinel"),dl=Symbol.iterator,lc=Symbol.for("react.client.reference"),cc=Array.isArray,Vt=_m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,qy=e.rendererVersion,hh=e.rendererPackageName,Bf=e.extraDevToolsConfig,Lf=e.getPublicInstance,i_=e.getRootHostContext,kf=e.getChildHostContext,Mm=e.prepareForCommit,a_=e.resetAfterCommit,$y=e.createInstance;e.cloneMutableInstance;var ph=e.appendInitialChild,xa=e.finalizeInitialChildren,aa=e.shouldSetTextContent,hl=e.createTextInstance;e.cloneMutableTextInstance;var Xy=e.scheduleTimeout,s_=e.cancelTimeout,ba=e.noTimeout,Hr=e.isPrimaryRenderer;e.warnsIfNotActing;var On=e.supportsMutation,qa=e.supportsPersistence,xr=e.supportsHydration,on=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var er=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var wn=e.setCurrentUpdatePriority,bs=e.getCurrentUpdatePriority,Ff=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var gu=e.shouldAttemptEagerTransition,Em=e.detachDeletedInstance;e.requestPostPaintCallback;var mh=e.maySuspendCommit,Uf=e.maySuspendCommitOnUpdate,Ky=e.maySuspendCommitInSyncRender,Rr=e.preloadInstance,Yy=e.startSuspendingCommit,Tm=e.suspendInstance;e.suspendOnActiveViewTransition;var o_=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var vu=e.NotPendingTransition,yu=e.HostTransitionContext,Jy=e.resetFormInstance;e.bindToConsole;var Zy=e.supportsMicrotasks,Qy=e.scheduleMicrotask,ui=e.supportsTestSelectors,Vr=e.findFiberRoot,Cm=e.getBoundingRect,gh=e.getTextContent,uc=e.isHiddenSubtree,e0=e.matchAccessibilityRole,pl=e.setFocusIfFocusable,Rm=e.setupIntersectionObserver,t0=e.appendChild,n0=e.appendChildToContainer,l_=e.commitTextUpdate,c_=e.commitMount,u_=e.commitUpdate,f_=e.insertBefore,d_=e.insertInContainerBefore,h_=e.removeChild,r0=e.removeChildFromContainer,i0=e.resetTextContent,jT=e.hideInstance,p_=e.hideTextInstance,m_=e.unhideInstance,g_=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var a0=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var v_=e.cloneInstance,s0=e.createContainerChildSet,o0=e.appendChildToContainerChildSet,y_=e.finalizeContainerChildren,l0=e.replaceContainerChildren,x_=e.cloneHiddenInstance,c0=e.cloneHiddenTextInstance,fc=e.isSuspenseInstancePending,Om=e.isSuspenseInstanceFallback,Pm=e.getSuspenseInstanceFallbackErrorDetails,Dm=e.registerSuspenseInstanceRetry,b_=e.canHydrateFormStateMarker,u0=e.isFormStateMarkerMatching,__=e.getNextHydratableSibling,S_=e.getNextHydratableSiblingAfterSingleton,A_=e.getFirstHydratableChild,w_=e.getFirstHydratableChildWithinContainer,M_=e.getFirstHydratableChildWithinActivityInstance,E_=e.getFirstHydratableChildWithinSuspenseInstance,f0=e.getFirstHydratableChildWithinSingleton,T_=e.canHydrateInstance,C_=e.canHydrateTextInstance,d0=e.canHydrateActivityInstance,R_=e.canHydrateSuspenseInstance,O_=e.hydrateInstance,zT=e.hydrateTextInstance,h0=e.hydrateActivityInstance,P_=e.hydrateSuspenseInstance,D_=e.getNextHydratableInstanceAfterActivityInstance,p0=e.getNextHydratableInstanceAfterSuspenseInstance,N_=e.commitHydratedInstance,I_=e.commitHydratedContainer,GT=e.commitHydratedActivityInstance,HT=e.commitHydratedSuspenseInstance,B_=e.finalizeHydratedChildren,vh=e.flushHydrationEvents;e.clearActivityBoundary;var m0=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var Nm=e.clearSuspenseBoundaryFromContainer,L_=e.hideDehydratedBoundary,k_=e.unhideDehydratedBoundary,jf=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var F_=e.validateHydratableInstance,g0=e.validateHydratableTextInstance,_s=e.supportsResources,Im=e.isHostHoistableType,yh=e.getHoistableRoot,v0=e.getResource,y0=e.acquireResource,dc=e.releaseResource,U_=e.hydrateHoistable,x0=e.mountHoistable,b0=e.unmountHoistable,Bm=e.createHoistableInstance,j_=e.prepareToCommitHoistables,_0=e.mayResourceSuspendCommit,S0=e.preloadResource,z_=e.suspendResource,fi=e.supportsSingletons,Lm=e.resolveSingletonInstance,ei=e.acquireSingletonInstance,Si=e.releaseSingletonInstance,A0=e.isHostSingletonType,xu=e.isSingletonScope,km=[],bu=-1,_o={},_a=Math.clz32?Math.clz32:w,Fm=Math.log,G_=Math.LN2,Um=256,_u=262144,zf=4194304,xh=ya.unstable_scheduleCallback,jm=ya.unstable_cancelCallback,H_=ya.unstable_shouldYield,w0=ya.unstable_requestPaint,$i=ya.unstable_now,zm=ya.unstable_ImmediatePriority,V_=ya.unstable_UserBlockingPriority,bh=ya.unstable_NormalPriority,Gm=ya.unstable_IdlePriority,M0=ya.log,W_=ya.unstable_setDisableYieldValue,Su=null,Sa=null,Wr=typeof Object.is=="function"?Object.is:ee,Hm=typeof reportError=="function"?reportError:function(d){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var m=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof d=="object"&&d!==null&&typeof d.message=="string"?String(d.message):String(d),error:d});if(!window.dispatchEvent(m))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",d);return}console.error(d)},VT=Object.prototype.hasOwnProperty,Vm,So,_h=!1,E0=new WeakMap,ml=[],Ao=0,tr=null,Sh=0,Ss=[],$a=0,As=null,Di=1,zs="",Ai=v(null),gl=v(null),Ni=v(null),Ah=v(null),di=null,br=null,Mn=!1,wo=null,sa=!1,Wm=Error(i(519)),ws=v(null),cr=null,Gs=null,q_=typeof AbortController<"u"?AbortController:function(){var d=[],m=this.signal={aborted:!1,addEventListener:function(A,C){d.push(C)}};this.abort=function(){m.aborted=!0,d.forEach(function(A){return A()})}},wi=ya.unstable_scheduleCallback,WT=ya.unstable_NormalPriority,_r={$$typeof:xs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},wh=null,Yn=null,Xi=!1,Ms=!1,qm=!1,hc=0,Gf=null,T0=0,vl=0,hi=null,Es=Vt.S;Vt.S=function(d,m){Cu=$i(),typeof m=="object"&&m!==null&&typeof m.then=="function"&&dt(d,m),Es!==null&&Es(d,m)};var pc=v(null),pi=Error(i(460)),$m=Error(i(474)),Ts=Error(i(542)),Mo={then:function(){}},oa=null,mc=null,Au=0,Ii=Zc(!0),C0=Zc(!1),Bi=[],Eo=0,wu=0,Xa=!1,Xm=!1,Mu=v(null),gc=v(0),Aa=v(null),wa=null,Lr=v(0),yl=0,ln=null,Ut=null,nn=null,mn=!1,fn=!1,Pn=!1,Ki=0,Cs=0,Hs=null,R0=0,Ka={readContext:te,use:Jr,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};Ka.useEffectEvent=rt;var Or={readContext:te,use:Jr,useCallback:function(d,m){return rn().memoizedState=[d,m===void 0?null:m],d},useContext:te,useEffect:Xd,useImperativeHandle:function(d,m,A){A=A!=null?A.concat([d]):null,ru(4194308,4,vf.bind(null,m,d),A)},useLayoutEffect:function(d,m){return ru(4194308,4,d,m)},useInsertionEffect:function(d,m){ru(4,2,d,m)},useMemo:function(d,m){var A=rn();m=m===void 0?null:m;var C=d();if(Pn){W(!0);try{d()}finally{W(!1)}}return A.memoizedState=[C,m],C},useReducer:function(d,m,A){var C=rn();if(A!==void 0){var L=A(m);if(Pn){W(!0);try{A(m)}finally{W(!1)}}}else L=m;return C.memoizedState=C.baseState=L,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:L},C.queue=d,d=d.dispatch=BT.bind(null,ln,d),[C.memoizedState,d]},useRef:function(d){var m=rn();return d={current:d},m.memoizedState=d},useState:function(d){d=gy(d);var m=d.queue,A=D1.bind(null,ln,m);return m.dispatch=A,[d.memoizedState,A]},useDebugValue:Yd,useDeferredValue:function(d,m){var A=rn();return xf(A,d,m)},useTransition:function(){var d=gy(!1);return d=R1.bind(null,ln,d.queue,!0,!1),rn().memoizedState=d,[!1,d]},useSyncExternalStore:function(d,m,A){var C=ln,L=rn();if(Mn){if(A===void 0)throw Error(i(407));A=A()}else{if(A=m(),gn===null)throw Error(i(349));(En&127)!==0||yi(C,m,A)}L.memoizedState=A;var F={value:A,getSnapshot:m};return L.queue=F,Xd(tu.bind(null,C,F,d),[d]),C.flags|=2048,Ga(9,{destroy:void 0},xi.bind(null,C,F,A,m),null),A},useId:function(){var d=rn(),m=gn.identifierPrefix;if(Mn){var A=zs,C=Di;A=(C&~(1<<32-_a(C)-1)).toString(32)+A,m="_"+m+"R_"+A,A=Ki++,0<A&&(m+="H"+A.toString(32)),m+="_"}else A=R0++,m="_"+m+"r_"+A.toString(32)+"_";return d.memoizedState=m},useHostTransitionStatus:_y,useFormState:yy,useActionState:yy,useOptimistic:function(d){var m=rn();m.memoizedState=m.baseState=d;var A={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return m.queue=A,m=tm.bind(null,ln,!0,A),A.dispatch=m,[d,m]},useMemoCache:Us,useCacheRefresh:function(){return rn().memoizedState=IT.bind(null,ln)},useEffectEvent:function(d){var m=rn(),A={impl:d};return m.memoizedState=A,function(){if((Sn&2)!==0)throw Error(i(440));return A.impl.apply(void 0,arguments)}}},To={readContext:te,use:Jr,useCallback:Qp,useContext:te,useEffect:gf,useImperativeHandle:C1,useInsertionEffect:Jl,useLayoutEffect:Kd,useMemo:yf,useReducer:ea,useRef:Zp,useState:function(){return ea(hr)},useDebugValue:Yd,useDeferredValue:function(d,m){var A=gt();return by(A,Ut.memoizedState,d,m)},useTransition:function(){var d=ea(hr)[0],m=gt().memoizedState;return[typeof d=="boolean"?d:Jt(d),m]},useSyncExternalStore:Zr,useId:em,useHostTransitionStatus:_y,useFormState:pf,useActionState:pf,useOptimistic:function(d,m){var A=gt();return qd(A,Ut,d,m)},useMemoCache:Us,useCacheRefresh:P1};To.useEffectEvent=ta;var vc={readContext:te,use:Jr,useCallback:Qp,useContext:te,useEffect:gf,useImperativeHandle:C1,useInsertionEffect:Jl,useLayoutEffect:Kd,useMemo:yf,useReducer:ci,useRef:Zp,useState:function(){return ci(hr)},useDebugValue:Yd,useDeferredValue:function(d,m){var A=gt();return Ut===null?xf(A,d,m):by(A,Ut.memoizedState,d,m)},useTransition:function(){var d=ci(hr)[0],m=gt().memoizedState;return[typeof d=="boolean"?d:Jt(d),m]},useSyncExternalStore:Zr,useId:em,useHostTransitionStatus:_y,useFormState:mf,useActionState:mf,useOptimistic:function(d,m){var A=gt();return Ut!==null?qd(A,Ut,d,m):(A.baseState=d,[d,A.queue.dispatch])},useMemoCache:Us,useCacheRefresh:P1};vc.useEffectEvent=ta;var Mh={enqueueSetState:function(d,m,A){d=d._reactInternals;var C=yr(),L=ja(C);L.payload=m,A!=null&&(L.callback=A),m=za(d,L,C),m!==null&&(Cr(m,d,C),Xl(m,d,C))},enqueueReplaceState:function(d,m,A){d=d._reactInternals;var C=yr(),L=ja(C);L.tag=1,L.payload=m,A!=null&&(L.callback=A),m=za(d,L,C),m!==null&&(Cr(m,d,C),Xl(m,d,C))},enqueueForceUpdate:function(d,m){d=d._reactInternals;var A=yr(),C=ja(A);C.tag=2,m!=null&&(C.callback=m),m=za(d,C,A),m!==null&&(Cr(m,d,A),Xl(m,d,A))}},la=Error(i(461)),pr=!1,Eu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},kr=!1,Fr=!1,Hf=!1,O0=typeof WeakSet=="function"?WeakSet:Set,qr=null,Pr=null,$r=!1,Jn=null,Ya=8192,Vf={getCacheForType:function(d){var m=te(_r),A=m.data.get(d);return A===void 0&&(A=d(),m.data.set(d,A)),A},cacheSignal:function(){return te(_r).controller.signal}},Rs=0,Wf=1,qf=2,Eh=3,yc=4;if(typeof Symbol=="function"&&Symbol.for){var Tu=Symbol.for;Rs=Tu("selector.component"),Wf=Tu("selector.has_pseudo_class"),qf=Tu("selector.role"),Eh=Tu("selector.test_id"),yc=Tu("selector.text")}var Ja=typeof WeakMap=="function"?WeakMap:Map,Sn=0,gn=null,An=null,En=0,Zn=0,ti=null,Vs=!1,xc=!1,bc=!1,Co=0,Dr=0,xl=0,_c=0,$f=0,ca=0,Xf=0,Th=null,Ma=null,Km=!1,Ch=0,Cu=0,Sc=1/0,Rh=null,bl=null,ni=0,_l=null,Ru=null,Ro=0,Kf=0,Ym=null,P0=null,jn=0,Oh=null;return pn.attemptContinuousHydration=function(d){if(d.tag===13||d.tag===31){var m=Wi(d,67108864);m!==null&&Cr(m,d,67108864),uh(d,67108864)}},pn.attemptHydrationAtCurrentPriority=function(d){if(d.tag===13||d.tag===31){var m=yr();m=z(m);var A=Wi(d,m);A!==null&&Cr(A,d,m),uh(d,m)}},pn.attemptSynchronousHydration=function(d){switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var m=_(d.pendingLanes);if(m!==0){for(d.pendingLanes|=2,d.entangledLanes|=2;m;){var A=1<<31-_a(m);d.entanglements[1]|=A,m&=~A}_t(d),(Sn&6)===0&&(Sc=$i()+500,lt(0))}}break;case 31:case 13:m=Wi(d,2),m!==null&&Cr(m,d,2),pm(),uh(d,2)}},pn.batchedUpdates=function(d,m){return d(m)},pn.createComponentSelector=function(d){return{$$typeof:Rs,value:d}},pn.createContainer=function(d,m,A,C,L,F,K,ce,Le,Je){return oc(d,m,!1,null,A,C,F,null,K,ce,Le,Je)},pn.createHasPseudoClassSelector=function(d){return{$$typeof:Wf,value:d}},pn.createHydrationContainer=function(d,m,A,C,L,F,K,ce,Le,Je,ht,nt,Mt,sn){var Xr;return d=oc(A,C,!0,d,L,F,ce,sn,Le,Je,ht,nt),d.context=bm(null),A=d.current,C=yr(),C=z(C),L=ja(C),L.callback=(Xr=m)!=null?Xr:null,za(A,L,C),m=C,d.current.lanes=m,D(d,m),_t(d),d},pn.createPortal=function(d,m,A){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:du,key:C==null?null:""+C,children:d,containerInfo:m,implementation:A}},pn.createRoleSelector=function(d){return{$$typeof:qf,value:d}},pn.createTestNameSelector=function(d){return{$$typeof:Eh,value:d}},pn.createTextSelector=function(d){return{$$typeof:yc,value:d}},pn.defaultOnCaughtError=function(d){console.error(d)},pn.defaultOnRecoverableError=function(d){Hm(d)},pn.defaultOnUncaughtError=function(d){Hm(d)},pn.deferredUpdates=function(d){var m=Vt.T,A=bs();try{return wn(32),Vt.T=null,d()}finally{wn(A),Vt.T=m}},pn.discreteUpdates=function(d,m,A,C,L){var F=Vt.T,K=bs();try{return wn(2),Vt.T=null,d(m,A,C,L)}finally{wn(K),Vt.T=F,Sn===0&&(Sc=$i()+500)}},pn.findAllNodes=va,pn.findBoundingRects=function(d,m){if(!ui)throw Error(i(363));m=va(d,m),d=[];for(var A=0;A<m.length;A++)d.push(Cm(m[A]));for(m=d.length-1;0<m;m--){A=d[m];for(var C=A.x,L=C+A.width,F=A.y,K=F+A.height,ce=m-1;0<=ce;ce--)if(m!==ce){var Le=d[ce],Je=Le.x,ht=Je+Le.width,nt=Le.y,Mt=nt+Le.height;if(C>=Je&&F>=nt&&L<=ht&&K<=Mt){d.splice(m,1);break}else if(C!==Je||A.width!==Le.width||Mt<F||nt>K){if(!(F!==nt||A.height!==Le.height||ht<C||Je>L)){Je>C&&(Le.width+=Je-C,Le.x=C),ht<L&&(Le.width=L-Je),d.splice(m,1);break}}else{nt>F&&(Le.height+=nt-F,Le.y=F),Mt<K&&(Le.height=K-nt),d.splice(m,1);break}}}return d},pn.findHostInstance=ch,pn.findHostInstanceWithNoPortals=function(d){return d=o(d),d=d!==null?u(d):null,d===null?null:Lf(d.stateNode)},pn.findHostInstanceWithWarning=function(d){return ch(d)},pn.flushPassiveEffects=xo,pn.flushSyncFromReconciler=function(d){var m=Sn;Sn|=1;var A=Vt.T,C=bs();try{if(wn(2),Vt.T=null,d)return d()}finally{wn(C),Vt.T=A,Sn=m,(Sn&6)===0&&lt(0)}},pn.flushSyncWork=pm,pn.focusWithin=function(d,m){if(!ui)throw Error(i(363));for(d=nc(d),m=Rf(d,m),m=Array.from(m),d=0;d<m.length;){var A=m[d++],C=A.tag;if(!uc(A)){if((C===5||C===26||C===27)&&pl(A.stateNode))return!0;for(A=A.child;A!==null;)m.push(A),A=A.sibling}}return!1},pn.getFindAllNodesFailureDescription=function(d,m){if(!ui)throw Error(i(363));var A=0,C=[];d=[nc(d),0];for(var L=0;L<d.length;){var F=d[L++],K=F.tag,ce=d[L++],Le=m[ce];if((K!==5&&K!==26&&K!==27||!uc(F))&&(rc(F,Le)&&(C.push(Cf(Le)),ce++,ce>A&&(A=ce)),ce<m.length))for(F=F.child;F!==null;)d.push(F,ce),F=F.sibling}if(A<m.length){for(d=[];A<m.length;A++)d.push(Cf(m[A]));return`findAllNodes was able to match part of the selector:
`+(C.join(" > ")+`
No matching component was found for:
`)+d.join(" > ")}return null},pn.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 27:case 5:return Lf(d.child.stateNode);default:return d.child.stateNode}},pn.injectIntoDevTools=function(){var d={bundleType:0,version:qy,rendererPackageName:hh,currentDispatcherRef:Vt,reconcilerVersion:"19.2.0"};if(Bf!==null&&(d.rendererConfig=Bf),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var m=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(m.isDisabled||!m.supportsFiber)d=!0;else{try{Su=m.inject(d),Sa=m}catch{}d=!!m.checkDCE}}return d},pn.isAlreadyRendering=function(){return(Sn&6)!==0},pn.observeVisibleRects=function(d,m,A,C){if(!ui)throw Error(i(363));d=va(d,m);var L=Rm(d,A,C).disconnect;return{disconnect:function(){L()}}},pn.shouldError=function(){return null},pn.shouldSuspend=function(){return!1},pn.startHostTransition=function(d,m,A,C){if(d.tag!==5)throw Error(i(476));var L=O1(d).queue;R1(d,L,m,vu,A===null?r:function(){var F=O1(d);return F.next===null&&(F=d.alternate.memoizedState),Jd(d,F.next.queue,{},yr()),A(C)})},pn.updateContainer=function(d,m,A,C){var L=m.current,F=yr();return Vy(L,F,d,m,A,C),F},pn.updateContainerSync=function(d,m,A,C){return Vy(m.current,2,d,m,A,C),2},pn},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(jH)),jH.exports}var GH;function MDe(){return GH||(GH=1,UH.exports=wDe()),UH.exports}var EDe=MDe();const TDe=ADe(EDe);function CDe(t){const e=TDe(t);return e.injectIntoDevTools(),e}const xJ=0,zv={},RDe=/^three(?=[A-Z])/,MT=t=>`${t[0].toUpperCase()}${t.slice(1)}`;let ODe=0;const PDe=t=>typeof t=="function";function DDe(t){if(PDe(t)){const e=`${ODe++}`;return zv[e]=t,e}else Object.assign(zv,t)}function bJ(t,e){const n=MT(t),r=zv[n];if(t!=="primitive"&&!r)throw new Error(`R3F: ${n} 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(t==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function NDe(t,e,n){var r;return t=MT(t)in zv?t:t.replace(RDe,""),bJ(t,e),t==="primitive"&&(r=e.object)!=null&&r.__r3f&&delete e.object.__r3f,XM(e.object,n,t,e)}function IDe(t){if(!t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?YM(t.parent,t):es(t.object)&&(t.object.visible=!1),t.isHidden=!0,dy(t)}}function _J(t){if(t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?KM(t.parent,t):es(t.object)&&t.props.visible!==!1&&(t.object.visible=!0),t.isHidden=!1,dy(t)}}function Mk(t,e,n){const r=e.root.getState();if(!(!t.parent&&t.object!==r.scene)){if(!e.object){var i,a;const s=zv[MT(e.type)];e.object=(i=e.props.object)!=null?i:new s(...(a=e.props.args)!=null?a:[]),e.object.__r3f=e}if(yd(e.object,e.props),e.props.attach)KM(t,e);else if(es(e.object)&&es(t.object)){const s=t.object.children.indexOf(n?.object);if(n&&s!==-1){const o=t.object.children.indexOf(e.object);if(o!==-1){t.object.children.splice(o,1);const c=o<s?s-1:s;t.object.children.splice(c,0,e.object)}else e.object.parent=t.object,t.object.children.splice(s,0,e.object),e.object.dispatchEvent({type:"added"}),t.object.dispatchEvent({type:"childadded",child:e.object})}else t.object.add(e.object)}for(const s of e.children)Mk(e,s);dy(e)}}function BD(t,e){e&&(e.parent=t,t.children.push(e),Mk(t,e))}function HH(t,e,n){if(!e||!n)return;e.parent=t;const r=t.children.indexOf(n);r!==-1?t.children.splice(r,0,e):t.children.push(e),Mk(t,e,n)}function SJ(t){if(typeof t.dispose=="function"){const e=()=>{try{t.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():mB.unstable_scheduleCallback(mB.unstable_IdlePriority,e)}}function vB(t,e,n){if(!e)return;e.parent=null;const r=t.children.indexOf(e);r!==-1&&t.children.splice(r,1),e.props.attach?YM(t,e):es(e.object)&&es(t.object)&&(t.object.remove(e.object),pDe(uJ(e),e.object));const i=e.props.dispose!==null&&n!==!1;for(let a=e.children.length-1;a>=0;a--){const s=e.children[a];vB(e,s,i)}e.children.length=0,delete e.object.__r3f,i&&e.type!=="primitive"&&e.object.type!=="Scene"&&SJ(e.object),n===void 0&&dy(e)}function BDe(t,e){for(const n of[t,t.alternate])if(n!==null)if(typeof n.ref=="function"){n.refCleanup==null||n.refCleanup();const r=n.ref(e);typeof r=="function"&&(n.refCleanup=r)}else n.ref&&(n.ref.current=e)}const zA=[];function LDe(){for(const[n]of zA){const r=n.parent;if(r){n.props.attach?YM(r,n):es(n.object)&&es(r.object)&&r.object.remove(n.object);for(const i of n.children)i.props.attach?YM(n,i):es(i.object)&&es(n.object)&&n.object.remove(i.object)}n.isHidden&&_J(n),n.object.__r3f&&delete n.object.__r3f,n.type!=="primitive"&&SJ(n.object)}for(const[n,r,i]of zA){n.props=r;const a=n.parent;if(a){var t,e;const s=zv[MT(n.type)];n.object=(t=n.props.object)!=null?t:new s(...(e=n.props.args)!=null?e:[]),n.object.__r3f=n,BDe(i,n.object),yd(n.object,n.props),n.props.attach?KM(a,n):es(n.object)&&es(a.object)&&a.object.add(n.object);for(const o of n.children)o.props.attach?KM(n,o):es(o.object)&&es(n.object)&&n.object.add(o.object);dy(n)}}zA.length=0}const LD=()=>{},VH={};let bA=xJ;const kDe=0,FDe=4,yB=CDe({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:NDe,removeChild:vB,appendChild:BD,appendInitialChild:BD,insertBefore:HH,appendChildToContainer(t,e){const n=t.getState().scene.__r3f;!e||!n||BD(n,e)},removeChildFromContainer(t,e){const n=t.getState().scene.__r3f;!e||!n||vB(n,e)},insertInContainerBefore(t,e,n){const r=t.getState().scene.__r3f;!e||!n||!r||HH(r,e,n)},getRootHostContext:()=>VH,getChildHostContext:()=>VH,commitUpdate(t,e,n,r,i){var a,s,o;bJ(e,r);let c=!1;if((t.type==="primitive"&&n.object!==r.object||((a=r.args)==null?void 0:a.length)!==((s=n.args)==null?void 0:s.length)||(o=r.args)!=null&&o.some((h,p)=>{var v;return h!==((v=n.args)==null?void 0:v[p])}))&&(c=!0),c)zA.push([t,{...r},i]);else{const h=uDe(t,r);Object.keys(h).length&&(Object.assign(t.props,h),yd(t.object,h))}(i.sibling===null||(i.flags&FDe)===kDe)&&LDe()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:t=>t?.object,prepareForCommit:()=>null,preparePortalMount:t=>XM(t.getState().scene,t,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:IDe,unhideInstance:_J,createTextInstance:LD,hideTextInstance:LD,unhideTextInstance:LD,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:j.createContext(null),setCurrentUpdatePriority(t){bA=t},getCurrentUpdatePriority(){return bA},resolveUpdatePriority(){var t;if(bA!==xJ)return bA;switch(typeof window<"u"&&((t=window.event)==null?void 0:t.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return _De;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return xDe;default:return bDe}},resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:SDe.version,applyViewTransitionName(t,e,n){},restoreViewTransitionName(t,e){},cancelViewTransitionName(t,e,n){},cancelRootViewTransitionName(t){},restoreRootViewTransitionName(t){},InstanceMeasurement:null,measureInstance:t=>null,wasInstanceInViewport:t=>!0,hasInstanceChanged:(t,e)=>!1,hasInstanceAffectedParent:(t,e)=>!1,suspendOnActiveViewTransition(t,e){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(t){},createViewTransitionInstance:t=>null,getCurrentGestureOffset(t){throw new Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance(t,e){return t},cloneMutableTextInstance(t){return t},cloneRootViewTransitionContainer(t){throw new Error("Not implemented.")},removeRootViewTransitionClone(t,e){throw new Error("Not implemented.")},createFragmentInstance:t=>null,updateFragmentInstanceFiber(t,e){},commitNewChildToFragmentInstance(t,e){},deleteChildFromFragmentInstance(t,e){},measureClonedInstance:t=>null,maySuspendCommitOnUpdate:(t,e,n)=>!1,maySuspendCommitInSyncRender:(t,e)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(t,e)=>null}),Ip=new Map,Cg={objects:"shallow",strict:!1};function UDe(t,e){if(!e&&typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:n,height:r,top:i,left:a}=t.parentElement.getBoundingClientRect();return{width:n,height:r,top:i,left:a}}else if(!e&&typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function jDe(t){const e=Ip.get(t),n=e?.fiber,r=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,a=r||gDe(_B,qH),s=n||yB.createContainer(a,yDe,null,!1,null,"",i,i,i,null);e||Ip.set(t,{fiber:s,store:a});let o,c,u=!1,h=null;return{async configure(p={}){let v;h=new Promise(X=>v=X);let{gl:y,size:b,scene:w,events:_,onCreated:S,shadows:E=!1,linear:T=!1,flat:P=!1,legacy:R=!1,orthographic:D=!1,frameloop:I="always",dpr:k=[1,2],performance:B,raycaster:U,camera:z,onPointerMissed:q}=p,W=a.getState(),ee=W.gl;if(!W.gl){const X={canvas:t,powerPreference:"high-performance",antialias:!0,alpha:!0},ae=typeof y=="function"?await y(X):y;kH(ae)?ee=ae:ee=new iJ({...X,...y}),W.set({gl:ee})}let Q=W.raycaster;Q||W.set({raycaster:Q=new YY});const{params:V,...$}=U||{};if(Ur.equ($,Q,Cg)||yd(Q,{...$}),Ur.equ(V,Q.params,Cg)||yd(Q,{params:{...Q.params,...V}}),!W.camera||W.camera===c&&!Ur.equ(c,z,Cg)){c=z;const X=z?.isCamera,ae=X?z:D?new qo(0,0,0,0,.1,1e3):new jr(75,0,.1,1e3);X||(ae.position.z=5,z&&(yd(ae,z),ae.manual||("aspect"in z||"left"in z||"right"in z||"bottom"in z||"top"in z)&&(ae.manual=!0,ae.updateProjectionMatrix())),!W.camera&&!(z!=null&&z.rotation)&&ae.lookAt(0,0,0)),W.set({camera:ae}),Q.camera=ae}if(!W.scene){let X;w!=null&&w.isScene?(X=w,XM(X,a,"",{})):(X=new W5,XM(X,a,"",{}),w&&yd(X,w)),W.set({scene:X})}_&&!W.events.handlers&&W.set({events:_(a)});const Y=UDe(t,b);if(Ur.equ(Y,W.size,Cg)||W.setSize(Y.width,Y.height,Y.top,Y.left),k&&W.viewport.dpr!==hJ(k)&&W.setDpr(k),W.frameloop!==I&&W.setFrameloop(I),W.onPointerMissed||W.set({onPointerMissed:q}),B&&!Ur.equ(B,W.performance,Cg)&&W.set(X=>({performance:{...X.performance,...B}})),!W.xr){var ie;const X=(Se,$e)=>{const me=a.getState();me.frameloop!=="never"&&qH(Se,!0,me,$e)},ae=()=>{const Se=a.getState();Se.gl.xr.enabled=Se.gl.xr.isPresenting,Se.gl.xr.setAnimationLoop(Se.gl.xr.isPresenting?X:null),Se.gl.xr.isPresenting||_B(Se)},ue={connect(){const Se=a.getState().gl;Se.xr.addEventListener("sessionstart",ae),Se.xr.addEventListener("sessionend",ae)},disconnect(){const Se=a.getState().gl;Se.xr.removeEventListener("sessionstart",ae),Se.xr.removeEventListener("sessionend",ae)}};typeof((ie=ee.xr)==null?void 0:ie.addEventListener)=="function"&&ue.connect(),W.set({xr:ue})}if(ee.shadowMap){const X=ee.shadowMap.enabled,ae=ee.shadowMap.type;if(ee.shadowMap.enabled=!!E,Ur.boo(E))ee.shadowMap.type=Ix;else if(Ur.str(E)){var de;const ue={basic:bK,percentage:Yg,soft:Ix,variance:cp};ee.shadowMap.type=(de=ue[E])!=null?de:Ix}else Ur.obj(E)&&Object.assign(ee.shadowMap,E);(X!==ee.shadowMap.enabled||ae!==ee.shadowMap.type)&&(ee.shadowMap.needsUpdate=!0)}return Fn.enabled=!R,u||(ee.outputColorSpace=T?Od:Pa,ee.toneMapping=P?Wo:GE),W.legacy!==R&&W.set(()=>({legacy:R})),W.linear!==T&&W.set(()=>({linear:T})),W.flat!==P&&W.set(()=>({flat:P})),y&&!Ur.fun(y)&&!kH(y)&&!Ur.equ(y,ee,Cg)&&yd(ee,y),o=S,u=!0,v(),this},render(p){return!u&&!h&&this.configure(),h.then(()=>{yB.updateContainer(M.jsx(zDe,{store:a,children:p,onCreated:o,rootElement:t}),s,null,()=>{})}),a},unmount(){AJ(t)}}}function zDe({store:t,children:e,onCreated:n,rootElement:r}){return v1(()=>{const i=t.getState();i.set(a=>({internal:{...a.internal,active:!0}})),n&&n(i),t.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),M.jsx(gJ.Provider,{value:t,children:e})}function AJ(t,e){const n=Ip.get(t),r=n?.fiber;if(r){const i=n?.store.getState();i&&(i.internal.active=!1),yB.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var a,s,o,c;i.events.disconnect==null||i.events.disconnect(),(a=i.gl)==null||(s=a.renderLists)==null||s.dispose==null||s.dispose(),(o=i.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(c=i.gl)!=null&&c.xr&&i.xr.disconnect(),oDe(i.scene),Ip.delete(t)}catch{}},500)})}}const GDe=new Set,HDe=new Set,VDe=new Set;function kD(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function Gx(t,e){switch(t){case"before":return kD(GDe,e);case"after":return kD(HDe,e);case"tail":return kD(VDe,e)}}let FD,UD;function xB(t,e,n){let r=e.clock.getDelta();e.frameloop==="never"&&typeof t=="number"&&(r=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),FD=e.internal.subscribers;for(let i=0;i<FD.length;i++)UD=FD[i],UD.ref.current(UD.store.getState(),r,n);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}let JM=!1,bB=!1,jD,WH,Rg;function wJ(t){WH=requestAnimationFrame(wJ),JM=!0,jD=0,Gx("before",t),bB=!0;for(const n of Ip.values()){var e;Rg=n.store.getState(),Rg.internal.active&&(Rg.frameloop==="always"||Rg.internal.frames>0)&&!((e=Rg.gl.xr)!=null&&e.isPresenting)&&(jD+=xB(t,Rg))}if(bB=!1,Gx("after",t),jD===0)return Gx("tail",t),JM=!1,cancelAnimationFrame(WH)}function _B(t,e=1){var n;if(!t)return Ip.forEach(r=>_B(r.store.getState(),e));(n=t.gl.xr)!=null&&n.isPresenting||!t.internal.active||t.frameloop==="never"||(e>1?t.internal.frames=Math.min(60,t.internal.frames+e):bB?t.internal.frames=2:t.internal.frames=1,JM||(JM=!0,requestAnimationFrame(wJ)))}function qH(t,e=!0,n,r){if(e&&Gx("before",t),n)xB(t,n,r);else for(const i of Ip.values())xB(t,i.store.getState());e&&Gx("after",t)}const zD={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 WDe(t){const{handlePointer:e}=mDe(t);return{priority:1,enabled:!0,compute(n,r,i){r.pointer.set(n.offsetX/r.size.width*2-1,-(n.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(zD).reduce((n,r)=>({...n,[r]:e(r)}),{}),update:()=>{var n;const{events:r,internal:i}=t.getState();(n=i.lastEvent)!=null&&n.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:n=>{const{set:r,events:i}=t.getState();if(i.disconnect==null||i.disconnect(),r(a=>({events:{...a.events,connected:n}})),i.handlers)for(const a in i.handlers){const s=i.handlers[a],[o,c]=zD[a];n.addEventListener(o,s,{passive:c})}},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){if(r.handlers)for(const i in r.handlers){const a=r.handlers[i],[s]=zD[i];r.connected.removeEventListener(s,a)}n(i=>({events:{...i.events,connected:void 0}}))}}}}function $H(t,e){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...r),e)}}function qDe({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[a,s]=j.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=j.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),c=t?typeof t=="number"?t:t.scroll:null,u=t?typeof t=="number"?t:t.resize:null,h=j.useRef(!1);j.useEffect(()=>(h.current=!0,()=>{h.current=!1}));const[p,v,y]=j.useMemo(()=>{const S=()=>{if(!o.current.element)return;const{left:E,top:T,width:P,height:R,bottom:D,right:I,x:k,y:B}=o.current.element.getBoundingClientRect(),U={left:E,top:T,width:P,height:R,bottom:D,right:I,x:k,y:B};o.current.element instanceof HTMLElement&&r&&(U.height=o.current.element.offsetHeight,U.width=o.current.element.offsetWidth),Object.freeze(U),h.current&&!YDe(o.current.lastBounds,U)&&s(o.current.lastBounds=U)};return[S,u?$H(S,u):S,c?$H(S,c):S]},[s,r,c,u]);function b(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",y,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function w(){o.current.element&&(o.current.resizeObserver=new i(y),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(S=>S.addEventListener("scroll",y,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{y()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const _=S=>{!S||S===o.current.element||(b(),o.current.element=S,o.current.scrollContainers=MJ(S),w())};return XDe(y,!!e),$De(v),j.useEffect(()=>{b(),w()},[e,y,v]),j.useEffect(()=>b,[]),[_,a,p]}function $De(t){j.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[t])}function XDe(t,e){j.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",n,!0)}}},[t,e])}function MJ(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(a=>a==="auto"||a==="scroll")&&e.push(t),[...e,...MJ(t.parentElement)]}const KDe=["x","y","top","bottom","left","right","width","height"],YDe=(t,e)=>KDe.every(n=>t[n]===e[n]);function JDe({ref:t,children:e,fallback:n,resize:r,style:i,gl:a,events:s=WDe,eventSource:o,eventPrefix:c,shadows:u,linear:h,flat:p,legacy:v,orthographic:y,frameloop:b,dpr:w,performance:_,raycaster:S,camera:E,scene:T,onPointerMissed:P,onCreated:R,...D}){j.useMemo(()=>DDe(k3e),[]);const I=rDe(),[k,B]=qDe({scroll:!0,debounce:{scroll:50,resize:0},...r}),U=j.useRef(null),z=j.useRef(null);j.useImperativeHandle(t,()=>U.current);const q=dJ(P),[W,ee]=j.useState(!1),[Q,V]=j.useState(!1);if(W)throw W;if(Q)throw Q;const $=j.useRef(null);v1(()=>{const ie=U.current;if(B.width>0&&B.height>0&&ie){$.current||($.current=jDe(ie));async function de(){await $.current.configure({gl:a,scene:T,events:s,shadows:u,linear:h,flat:p,legacy:v,orthographic:y,frameloop:b,dpr:w,performance:_,raycaster:S,camera:E,size:B,onPointerMissed:(...X)=>q.current==null?void 0:q.current(...X),onCreated:X=>{X.events.connect==null||X.events.connect(o?tDe(o)?o.current:o:z.current),c&&X.setEvents({compute:(ae,ue)=>{const Se=ae[c+"X"],$e=ae[c+"Y"];ue.pointer.set(Se/ue.size.width*2-1,-($e/ue.size.height)*2+1),ue.raycaster.setFromCamera(ue.pointer,ue.camera)}}),R?.(X)}}),$.current.render(M.jsx(I,{children:M.jsx(aDe,{set:V,children:M.jsx(j.Suspense,{fallback:M.jsx(iDe,{set:ee}),children:e??null})})}))}de()}}),j.useEffect(()=>{const ie=U.current;if(ie)return()=>AJ(ie)},[]);const Y=o?"none":"auto";return M.jsx("div",{ref:z,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Y,...i},...D,children:M.jsx("div",{ref:k,style:{width:"100%",height:"100%"},children:M.jsx("canvas",{ref:U,style:{display:"block"},children:n})})})}function EJ(t){return M.jsx(lJ,{children:M.jsx(JDe,{...t})})}const x1=new ne,Ek=new ne,ZDe=new ne,XH=new Ve;function QDe(t,e,n){const r=x1.setFromMatrixPosition(t.matrixWorld);r.project(e);const i=n.width/2,a=n.height/2;return[r.x*i+i,-(r.y*a)+a]}function eNe(t,e){const n=x1.setFromMatrixPosition(t.matrixWorld),r=Ek.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),a=e.getWorldDirection(ZDe);return i.angleTo(a)>Math.PI/2}function tNe(t,e,n,r){const i=x1.setFromMatrixPosition(t.matrixWorld),a=i.clone();a.project(e),XH.set(a.x,a.y),n.setFromCamera(XH,e);const s=n.intersectObjects(r,!0);if(s.length){const o=s[0].distance;return i.distanceTo(n.ray.origin)<o}return!0}function nNe(t,e){if(e instanceof qo)return e.zoom;if(e instanceof jr){const n=x1.setFromMatrixPosition(t.matrixWorld),r=Ek.setFromMatrixPosition(e.matrixWorld),i=e.fov*Math.PI/180,a=n.distanceTo(r);return 1/(2*Math.tan(i/2)*a)}else return 1}function rNe(t,e,n){if(e instanceof jr||e instanceof qo){const r=x1.setFromMatrixPosition(t.matrixWorld),i=Ek.setFromMatrixPosition(e.matrixWorld),a=r.distanceTo(i),s=(n[1]-n[0])/(e.far-e.near),o=n[1]-s*e.far;return Math.round(s*a+o)}}const SB=t=>Math.abs(t)<1e-10?0:t;function TJ(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=SB(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const iNe=(t=>e=>TJ(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),aNe=(t=>(e,n)=>TJ(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]);function sNe(t){return t&&typeof t=="object"&&"current"in t}const oNe=j.forwardRef(({children:t,eps:e=.001,style:n,className:r,prepend:i,center:a,fullscreen:s,portal:o,distanceFactor:c,sprite:u=!1,transform:h=!1,occlude:p,onOcclude:v,castShadow:y,receiveShadow:b,material:w,geometry:_,zIndexRange:S=[16777271,0],calculatePosition:E=QDe,as:T="div",wrapperClass:P,pointerEvents:R="auto",...D},I)=>{const{gl:k,camera:B,scene:U,size:z,raycaster:q,events:W,viewport:ee}=Cl(),[Q]=j.useState(()=>document.createElement(T)),V=j.useRef(null),$=j.useRef(null),Y=j.useRef(0),ie=j.useRef([0,0]),de=j.useRef(null),X=j.useRef(null),ae=o?.current||W.connected||k.domElement.parentNode,ue=j.useRef(null),Se=j.useRef(!1),$e=j.useMemo(()=>p&&p!=="blending"||Array.isArray(p)&&p.length&&sNe(p[0]),[p]);j.useLayoutEffect(()=>{const Fe=k.domElement;p&&p==="blending"?(Fe.style.zIndex=`${Math.floor(S[0]/2)}`,Fe.style.position="absolute",Fe.style.pointerEvents="none"):(Fe.style.zIndex=null,Fe.style.position=null,Fe.style.pointerEvents=null)},[p]),j.useLayoutEffect(()=>{if($.current){const Fe=V.current=PV.createRoot(Q);if(U.updateMatrixWorld(),h)Q.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Xe=E($.current,B,z);Q.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Xe[0]}px,${Xe[1]}px,0);transform-origin:0 0;`}return ae&&(i?ae.prepend(Q):ae.appendChild(Q)),()=>{ae&&ae.removeChild(Q),Fe.unmount()}}},[ae,h]),j.useLayoutEffect(()=>{P&&(Q.className=P)},[P]);const me=j.useMemo(()=>h?{position:"absolute",top:0,left:0,width:z.width,height:z.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:a?"translate3d(-50%,-50%,0)":"none",...s&&{top:-z.height/2,left:-z.width/2,width:z.width,height:z.height},...n},[n,a,s,z,h]),ve=j.useMemo(()=>({position:"absolute",pointerEvents:R}),[R]);j.useLayoutEffect(()=>{if(Se.current=!1,h){var Fe;(Fe=V.current)==null||Fe.render(j.createElement("div",{ref:de,style:me},j.createElement("div",{ref:X,style:ve},j.createElement("div",{ref:I,className:r,style:n,children:t}))))}else{var Xe;(Xe=V.current)==null||Xe.render(j.createElement("div",{ref:I,style:me,className:r,children:t}))}});const We=j.useRef(!0);wk(Fe=>{if($.current){B.updateMatrixWorld(),$.current.updateWorldMatrix(!0,!1);const Xe=h?ie.current:E($.current,B,z);if(h||Math.abs(Y.current-B.zoom)>e||Math.abs(ie.current[0]-Xe[0])>e||Math.abs(ie.current[1]-Xe[1])>e){const Re=eNe($.current,B);let ot=!1;$e&&(Array.isArray(p)?ot=p.map(Ye=>Ye.current):p!=="blending"&&(ot=[U]));const we=We.current;if(ot){const Ye=tNe($.current,B,q,ot);We.current=Ye&&!Re}else We.current=!Re;we!==We.current&&(v?v(!We.current):Q.style.display=We.current?"block":"none");const Ue=Math.floor(S[0]/2),Be=p?$e?[S[0],Ue]:[Ue-1,0]:S;if(Q.style.zIndex=`${rNe($.current,B,Be)}`,h){const[Ye,re]=[z.width/2,z.height/2],At=B.projectionMatrix.elements[5]*re,{isOrthographicCamera:ft,top:Et,left:Ze,bottom:te,right:H}=B,he=iNe(B.matrixWorldInverse),Ne=ft?`scale(${At})translate(${SB(-(H+Ze)/2)}px,${SB((Et+te)/2)}px)`:`translateZ(${At}px)`;let je=$.current.matrixWorld;u&&(je=B.matrixWorldInverse.clone().transpose().copyPosition(je).scale($.current.scale),je.elements[3]=je.elements[7]=je.elements[11]=0,je.elements[15]=1),Q.style.width=z.width+"px",Q.style.height=z.height+"px",Q.style.perspective=ft?"":`${At}px`,de.current&&X.current&&(de.current.style.transform=`${Ne}${he}translate(${Ye}px,${re}px)`,X.current.style.transform=aNe(je,1/((c||10)/400)))}else{const Ye=c===void 0?1:nNe($.current,B)*c;Q.style.transform=`translate3d(${Xe[0]}px,${Xe[1]}px,0) scale(${Ye})`}ie.current=Xe,Y.current=B.zoom}}if(!$e&&ue.current&&!Se.current)if(h){if(de.current){const Xe=de.current.children[0];if(Xe!=null&&Xe.clientWidth&&Xe!=null&&Xe.clientHeight){const{isOrthographicCamera:Re}=B;if(Re||_)D.scale&&(Array.isArray(D.scale)?D.scale instanceof ne?ue.current.scale.copy(D.scale.clone().divideScalar(1)):ue.current.scale.set(1/D.scale[0],1/D.scale[1],1/D.scale[2]):ue.current.scale.setScalar(1/D.scale));else{const ot=(c||10)/400,we=Xe.clientWidth*ot,Ue=Xe.clientHeight*ot;ue.current.scale.set(we,Ue,1)}Se.current=!0}}}else{const Xe=Q.children[0];if(Xe!=null&&Xe.clientWidth&&Xe!=null&&Xe.clientHeight){const Re=1/ee.factor,ot=Xe.clientWidth*Re,we=Xe.clientHeight*Re;ue.current.scale.set(ot,we,1),Se.current=!0}ue.current.lookAt(Fe.camera.position)}});const _e=j.useMemo(()=>({vertexShader:h?void 0:`
/*
This shader is from the THREE's SpriteMaterial.
We need to turn the backing plane into a Sprite
(make it always face the camera) if "transfrom"
is false.
*/
#include <common>
void main() {
vec2 center = vec2(0., 1.);
float rotation = 0.0;
// This is somewhat arbitrary, but it seems to work well
// Need to figure out how to derive this dynamically if it even matters
float size = 0.03;
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 ) );
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
if ( isPerspective ) scale *= - mvPosition.z;
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;
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;
}
`,fragmentShader:`
void main() {
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
}
`}),[h]);return j.createElement("group",Iw({},D,{ref:$}),p&&!$e&&j.createElement("mesh",{castShadow:y,receiveShadow:b,ref:ue},_||j.createElement("planeGeometry",null),w||j.createElement("shaderMaterial",{side:Fo,vertexShader:_e.vertexShader,fragmentShader:_e.fragmentShader})))}),lNe=parseInt(s1.replace(/\D+/g,""));function KH(t,e){if(e===WK)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===HM||e===U5){let n=t.getIndex();if(n===null){const s=[],o=t.getAttribute("position");if(o!==void 0){for(let c=0;c<o.count;c++)s.push(c);t.setIndex(s),n=t.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t}const r=n.count-2,i=[];if(n)if(e===HM)for(let s=1;s<=r;s++)i.push(n.getX(0)),i.push(n.getX(s)),i.push(n.getX(s+1));else for(let s=0;s<r;s++)s%2===0?(i.push(n.getX(s)),i.push(n.getX(s+1)),i.push(n.getX(s+2))):(i.push(n.getX(s+2)),i.push(n.getX(s+1)),i.push(n.getX(s)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=t.clone();return a.setIndex(i),a.clearGroups(),a}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}var cNe=Object.defineProperty,uNe=(t,e,n)=>e in t?cNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fNe=(t,e,n)=>(uNe(t,e+"",n),n);class dNe{constructor(){fNe(this,"_listeners")}addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const a=i.indexOf(n);a!==-1&&i.splice(a,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 a=0,s=i.length;a<s;a++)i[a].call(this,e);e.target=null}}}var hNe=Object.defineProperty,pNe=(t,e,n)=>e in t?hNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Yt=(t,e,n)=>(pNe(t,typeof e!="symbol"?e+"":e,n),n);const _A=new Hp,YH=new ju,mNe=Math.cos(70*(Math.PI/180)),JH=(t,e)=>(t%e+e)%e;let gNe=class extends dNe{constructor(e,n){super(),Yt(this,"object"),Yt(this,"domElement"),Yt(this,"enabled",!0),Yt(this,"target",new ne),Yt(this,"minDistance",0),Yt(this,"maxDistance",1/0),Yt(this,"minZoom",0),Yt(this,"maxZoom",1/0),Yt(this,"minPolarAngle",0),Yt(this,"maxPolarAngle",Math.PI),Yt(this,"minAzimuthAngle",-1/0),Yt(this,"maxAzimuthAngle",1/0),Yt(this,"enableDamping",!1),Yt(this,"dampingFactor",.05),Yt(this,"enableZoom",!0),Yt(this,"zoomSpeed",1),Yt(this,"enableRotate",!0),Yt(this,"rotateSpeed",1),Yt(this,"enablePan",!0),Yt(this,"panSpeed",1),Yt(this,"screenSpacePanning",!0),Yt(this,"keyPanSpeed",7),Yt(this,"zoomToCursor",!1),Yt(this,"autoRotate",!1),Yt(this,"autoRotateSpeed",2),Yt(this,"reverseOrbit",!1),Yt(this,"reverseHorizontalOrbit",!1),Yt(this,"reverseVerticalOrbit",!1),Yt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Yt(this,"mouseButtons",{LEFT:Cc.ROTATE,MIDDLE:Cc.DOLLY,RIGHT:Cc.PAN}),Yt(this,"touches",{ONE:Zh.ROTATE,TWO:Zh.DOLLY_PAN}),Yt(this,"target0"),Yt(this,"position0"),Yt(this,"zoom0"),Yt(this,"_domElementKeyEvents",null),Yt(this,"getPolarAngle"),Yt(this,"getAzimuthalAngle"),Yt(this,"setPolarAngle"),Yt(this,"setAzimuthalAngle"),Yt(this,"getDistance"),Yt(this,"getZoomScale"),Yt(this,"listenToKeyEvents"),Yt(this,"stopListenToKeyEvents"),Yt(this,"saveState"),Yt(this,"reset"),Yt(this,"update"),Yt(this,"connect"),Yt(this,"dispose"),Yt(this,"dollyIn"),Yt(this,"dollyOut"),Yt(this,"getScale"),Yt(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=se=>{let Ae=JH(se,2*Math.PI),dt=h.phi;dt<0&&(dt+=2*Math.PI),Ae<0&&(Ae+=2*Math.PI);let oe=Math.abs(Ae-dt);2*Math.PI-oe<oe&&(Ae<dt?Ae+=2*Math.PI:dt+=2*Math.PI),p.phi=Ae-dt,r.update()},this.setAzimuthalAngle=se=>{let Ae=JH(se,2*Math.PI),dt=h.theta;dt<0&&(dt+=2*Math.PI),Ae<0&&(Ae+=2*Math.PI);let oe=Math.abs(Ae-dt);2*Math.PI-oe<oe&&(Ae<dt?Ae+=2*Math.PI:dt+=2*Math.PI),p.theta=Ae-dt,r.update()},this.getDistance=()=>r.object.position.distanceTo(r.target),this.listenToKeyEvents=se=>{se.addEventListener("keydown",Ie),this._domElementKeyEvents=se},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Ie),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),c=o.NONE},this.update=(()=>{const se=new ne,Ae=new ne(0,1,0),dt=new gi().setFromUnitVectors(e.up,Ae),oe=dt.clone().invert(),it=new ne,et=new gi,pt=2*Math.PI;return function(){const He=r.object.position;dt.setFromUnitVectors(e.up,Ae),oe.copy(dt).invert(),se.copy(He).sub(r.target),se.applyQuaternion(dt),h.setFromVector3(se),r.autoRotate&&c===o.NONE&&ee(q()),r.enableDamping?(h.theta+=p.theta*r.dampingFactor,h.phi+=p.phi*r.dampingFactor):(h.theta+=p.theta,h.phi+=p.phi);let at=r.minAzimuthAngle,jt=r.maxAzimuthAngle;isFinite(at)&&isFinite(jt)&&(at<-Math.PI?at+=pt:at>Math.PI&&(at-=pt),jt<-Math.PI?jt+=pt:jt>Math.PI&&(jt-=pt),at<=jt?h.theta=Math.max(at,Math.min(jt,h.theta)):h.theta=h.theta>(at+jt)/2?Math.max(at,h.theta):Math.min(jt,h.theta)),h.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,h.phi)),h.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(y,r.dampingFactor):r.target.add(y),r.zoomToCursor&&B||r.object.isOrthographicCamera?h.radius=ue(h.radius):h.radius=ue(h.radius*v),se.setFromSpherical(h),se.applyQuaternion(oe),He.copy(r.target).add(se),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(p.theta*=1-r.dampingFactor,p.phi*=1-r.dampingFactor,y.multiplyScalar(1-r.dampingFactor)):(p.set(0,0,0),y.set(0,0,0));let un=!1;if(r.zoomToCursor&&B){let hn=null;if(r.object instanceof jr&&r.object.isPerspectiveCamera){const Mr=se.length();hn=ue(Mr*v);const oi=Mr-hn;r.object.position.addScaledVector(I,oi),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const Mr=new ne(k.x,k.y,0);Mr.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/v)),r.object.updateProjectionMatrix(),un=!0;const oi=new ne(k.x,k.y,0);oi.unproject(r.object),r.object.position.sub(oi).add(Mr),r.object.updateMatrixWorld(),hn=se.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;hn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(hn).add(r.object.position):(_A.origin.copy(r.object.position),_A.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(_A.direction))<mNe?e.lookAt(r.target):(YH.setFromNormalAndCoplanarPoint(r.object.up,r.target),_A.intersectPlane(YH,r.target))))}else r.object instanceof qo&&r.object.isOrthographicCamera&&(un=v!==1,un&&(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/v)),r.object.updateProjectionMatrix()));return v=1,B=!1,un||it.distanceToSquared(r.object.position)>u||8*(1-et.dot(r.object.quaternion))>u?(r.dispatchEvent(i),it.copy(r.object.position),et.copy(r.object.quaternion),un=!1,!0):!1}})(),this.connect=se=>{r.domElement=se,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Tt),r.domElement.addEventListener("pointerdown",Ze),r.domElement.addEventListener("pointercancel",H),r.domElement.addEventListener("wheel",je)},this.dispose=()=>{var se,Ae,dt,oe,it,et;r.domElement&&(r.domElement.style.touchAction="auto"),(se=r.domElement)==null||se.removeEventListener("contextmenu",Tt),(Ae=r.domElement)==null||Ae.removeEventListener("pointerdown",Ze),(dt=r.domElement)==null||dt.removeEventListener("pointercancel",H),(oe=r.domElement)==null||oe.removeEventListener("wheel",je),(it=r.domElement)==null||it.ownerDocument.removeEventListener("pointermove",te),(et=r.domElement)==null||et.ownerDocument.removeEventListener("pointerup",H),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",Ie)};const r=this,i={type:"change"},a={type:"start"},s={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=o.NONE;const u=1e-6,h=new uB,p=new uB;let v=1;const y=new ne,b=new Ve,w=new Ve,_=new Ve,S=new Ve,E=new Ve,T=new Ve,P=new Ve,R=new Ve,D=new Ve,I=new ne,k=new Ve;let B=!1;const U=[],z={};function q(){return 2*Math.PI/60/60*r.autoRotateSpeed}function W(){return Math.pow(.95,r.zoomSpeed)}function ee(se){r.reverseOrbit||r.reverseHorizontalOrbit?p.theta+=se:p.theta-=se}function Q(se){r.reverseOrbit||r.reverseVerticalOrbit?p.phi+=se:p.phi-=se}const V=(()=>{const se=new ne;return function(dt,oe){se.setFromMatrixColumn(oe,0),se.multiplyScalar(-dt),y.add(se)}})(),$=(()=>{const se=new ne;return function(dt,oe){r.screenSpacePanning===!0?se.setFromMatrixColumn(oe,1):(se.setFromMatrixColumn(oe,0),se.crossVectors(r.object.up,se)),se.multiplyScalar(dt),y.add(se)}})(),Y=(()=>{const se=new ne;return function(dt,oe){const it=r.domElement;if(it&&r.object instanceof jr&&r.object.isPerspectiveCamera){const et=r.object.position;se.copy(et).sub(r.target);let pt=se.length();pt*=Math.tan(r.object.fov/2*Math.PI/180),V(2*dt*pt/it.clientHeight,r.object.matrix),$(2*oe*pt/it.clientHeight,r.object.matrix)}else it&&r.object instanceof qo&&r.object.isOrthographicCamera?(V(dt*(r.object.right-r.object.left)/r.object.zoom/it.clientWidth,r.object.matrix),$(oe*(r.object.top-r.object.bottom)/r.object.zoom/it.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function ie(se){r.object instanceof jr&&r.object.isPerspectiveCamera||r.object instanceof qo&&r.object.isOrthographicCamera?v=se:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function de(se){ie(v/se)}function X(se){ie(v*se)}function ae(se){if(!r.zoomToCursor||!r.domElement)return;B=!0;const Ae=r.domElement.getBoundingClientRect(),dt=se.clientX-Ae.left,oe=se.clientY-Ae.top,it=Ae.width,et=Ae.height;k.x=dt/it*2-1,k.y=-(oe/et)*2+1,I.set(k.x,k.y,1).unproject(r.object).sub(r.object.position).normalize()}function ue(se){return Math.max(r.minDistance,Math.min(r.maxDistance,se))}function Se(se){b.set(se.clientX,se.clientY)}function $e(se){ae(se),P.set(se.clientX,se.clientY)}function me(se){S.set(se.clientX,se.clientY)}function ve(se){w.set(se.clientX,se.clientY),_.subVectors(w,b).multiplyScalar(r.rotateSpeed);const Ae=r.domElement;Ae&&(ee(2*Math.PI*_.x/Ae.clientHeight),Q(2*Math.PI*_.y/Ae.clientHeight)),b.copy(w),r.update()}function We(se){R.set(se.clientX,se.clientY),D.subVectors(R,P),D.y>0?de(W()):D.y<0&&X(W()),P.copy(R),r.update()}function _e(se){E.set(se.clientX,se.clientY),T.subVectors(E,S).multiplyScalar(r.panSpeed),Y(T.x,T.y),S.copy(E),r.update()}function Fe(se){ae(se),se.deltaY<0?X(W()):se.deltaY>0&&de(W()),r.update()}function Xe(se){let Ae=!1;switch(se.code){case r.keys.UP:Y(0,r.keyPanSpeed),Ae=!0;break;case r.keys.BOTTOM:Y(0,-r.keyPanSpeed),Ae=!0;break;case r.keys.LEFT:Y(r.keyPanSpeed,0),Ae=!0;break;case r.keys.RIGHT:Y(-r.keyPanSpeed,0),Ae=!0;break}Ae&&(se.preventDefault(),r.update())}function Re(){if(U.length==1)b.set(U[0].pageX,U[0].pageY);else{const se=.5*(U[0].pageX+U[1].pageX),Ae=.5*(U[0].pageY+U[1].pageY);b.set(se,Ae)}}function ot(){if(U.length==1)S.set(U[0].pageX,U[0].pageY);else{const se=.5*(U[0].pageX+U[1].pageX),Ae=.5*(U[0].pageY+U[1].pageY);S.set(se,Ae)}}function we(){const se=U[0].pageX-U[1].pageX,Ae=U[0].pageY-U[1].pageY,dt=Math.sqrt(se*se+Ae*Ae);P.set(0,dt)}function Ue(){r.enableZoom&&we(),r.enablePan&&ot()}function Be(){r.enableZoom&&we(),r.enableRotate&&Re()}function Ye(se){if(U.length==1)w.set(se.pageX,se.pageY);else{const dt=vt(se),oe=.5*(se.pageX+dt.x),it=.5*(se.pageY+dt.y);w.set(oe,it)}_.subVectors(w,b).multiplyScalar(r.rotateSpeed);const Ae=r.domElement;Ae&&(ee(2*Math.PI*_.x/Ae.clientHeight),Q(2*Math.PI*_.y/Ae.clientHeight)),b.copy(w)}function re(se){if(U.length==1)E.set(se.pageX,se.pageY);else{const Ae=vt(se),dt=.5*(se.pageX+Ae.x),oe=.5*(se.pageY+Ae.y);E.set(dt,oe)}T.subVectors(E,S).multiplyScalar(r.panSpeed),Y(T.x,T.y),S.copy(E)}function At(se){const Ae=vt(se),dt=se.pageX-Ae.x,oe=se.pageY-Ae.y,it=Math.sqrt(dt*dt+oe*oe);R.set(0,it),D.set(0,Math.pow(R.y/P.y,r.zoomSpeed)),de(D.y),P.copy(R)}function ft(se){r.enableZoom&&At(se),r.enablePan&&re(se)}function Et(se){r.enableZoom&&At(se),r.enableRotate&&Ye(se)}function Ze(se){var Ae,dt;r.enabled!==!1&&(U.length===0&&((Ae=r.domElement)==null||Ae.ownerDocument.addEventListener("pointermove",te),(dt=r.domElement)==null||dt.ownerDocument.addEventListener("pointerup",H)),Gt(se),se.pointerType==="touch"?_t(se):he(se))}function te(se){r.enabled!==!1&&(se.pointerType==="touch"?lt(se):Ne(se))}function H(se){var Ae,dt,oe;Qe(se),U.length===0&&((Ae=r.domElement)==null||Ae.releasePointerCapture(se.pointerId),(dt=r.domElement)==null||dt.ownerDocument.removeEventListener("pointermove",te),(oe=r.domElement)==null||oe.ownerDocument.removeEventListener("pointerup",H)),r.dispatchEvent(s),c=o.NONE}function he(se){let Ae;switch(se.button){case 0:Ae=r.mouseButtons.LEFT;break;case 1:Ae=r.mouseButtons.MIDDLE;break;case 2:Ae=r.mouseButtons.RIGHT;break;default:Ae=-1}switch(Ae){case Cc.DOLLY:if(r.enableZoom===!1)return;$e(se),c=o.DOLLY;break;case Cc.ROTATE:if(se.ctrlKey||se.metaKey||se.shiftKey){if(r.enablePan===!1)return;me(se),c=o.PAN}else{if(r.enableRotate===!1)return;Se(se),c=o.ROTATE}break;case Cc.PAN:if(se.ctrlKey||se.metaKey||se.shiftKey){if(r.enableRotate===!1)return;Se(se),c=o.ROTATE}else{if(r.enablePan===!1)return;me(se),c=o.PAN}break;default:c=o.NONE}c!==o.NONE&&r.dispatchEvent(a)}function Ne(se){if(r.enabled!==!1)switch(c){case o.ROTATE:if(r.enableRotate===!1)return;ve(se);break;case o.DOLLY:if(r.enableZoom===!1)return;We(se);break;case o.PAN:if(r.enablePan===!1)return;_e(se);break}}function je(se){r.enabled===!1||r.enableZoom===!1||c!==o.NONE&&c!==o.ROTATE||(se.preventDefault(),r.dispatchEvent(a),Fe(se),r.dispatchEvent(s))}function Ie(se){r.enabled===!1||r.enablePan===!1||Xe(se)}function _t(se){switch(st(se),U.length){case 1:switch(r.touches.ONE){case Zh.ROTATE:if(r.enableRotate===!1)return;Re(),c=o.TOUCH_ROTATE;break;case Zh.PAN:if(r.enablePan===!1)return;ot(),c=o.TOUCH_PAN;break;default:c=o.NONE}break;case 2:switch(r.touches.TWO){case Zh.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ue(),c=o.TOUCH_DOLLY_PAN;break;case Zh.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Be(),c=o.TOUCH_DOLLY_ROTATE;break;default:c=o.NONE}break;default:c=o.NONE}c!==o.NONE&&r.dispatchEvent(a)}function lt(se){switch(st(se),c){case o.TOUCH_ROTATE:if(r.enableRotate===!1)return;Ye(se),r.update();break;case o.TOUCH_PAN:if(r.enablePan===!1)return;re(se),r.update();break;case o.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ft(se),r.update();break;case o.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Et(se),r.update();break;default:c=o.NONE}}function Tt(se){r.enabled!==!1&&se.preventDefault()}function Gt(se){U.push(se)}function Qe(se){delete z[se.pointerId];for(let Ae=0;Ae<U.length;Ae++)if(U[Ae].pointerId==se.pointerId){U.splice(Ae,1);return}}function st(se){let Ae=z[se.pointerId];Ae===void 0&&(Ae=new Ve,z[se.pointerId]=Ae),Ae.set(se.pageX,se.pageY)}function vt(se){const Ae=se.pointerId===U[0].pointerId?U[1]:U[0];return z[Ae.pointerId]}this.dollyIn=(se=W())=>{X(se),r.update()},this.dollyOut=(se=W())=>{de(se),r.update()},this.getScale=()=>v,this.setScale=se=>{ie(se),r.update()},this.getZoomScale=()=>W(),n!==void 0&&this.connect(n),this.update()}};function ZM(t){if(typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch{return e}}const mp="srgb",ef="srgb-linear",ZH=3001,vNe=3e3;class Tk extends ka{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(n){return new SNe(n)}),this.register(function(n){return new ANe(n)}),this.register(function(n){return new DNe(n)}),this.register(function(n){return new NNe(n)}),this.register(function(n){return new INe(n)}),this.register(function(n){return new MNe(n)}),this.register(function(n){return new ENe(n)}),this.register(function(n){return new TNe(n)}),this.register(function(n){return new CNe(n)}),this.register(function(n){return new _Ne(n)}),this.register(function(n){return new RNe(n)}),this.register(function(n){return new wNe(n)}),this.register(function(n){return new PNe(n)}),this.register(function(n){return new ONe(n)}),this.register(function(n){return new xNe(n)}),this.register(function(n){return new BNe(n)}),this.register(function(n){return new LNe(n)})}load(e,n,r,i){const a=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const u=Ed.extractUrlBase(e);s=Ed.resolveURL(u,this.path)}else s=Ed.extractUrlBase(e);this.manager.itemStart(e);const o=function(u){i?i(u):console.error(u),a.manager.itemError(e),a.manager.itemEnd(e)},c=new io(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(u){try{a.parse(u,s,function(h){n(h),a.manager.itemEnd(e)},o)}catch(h){o(h)}},r,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,r,i){let a;const s={},o={};if(typeof e=="string")a=JSON.parse(e);else if(e instanceof ArrayBuffer)if(ZM(new Uint8Array(e.slice(0,4)))===CJ){try{s[Nn.KHR_BINARY_GLTF]=new kNe(e)}catch(h){i&&i(h);return}a=JSON.parse(s[Nn.KHR_BINARY_GLTF].content)}else a=JSON.parse(ZM(new Uint8Array(e)));else a=e;if(a.asset===void 0||a.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new YNe(a,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const h=this.pluginCallbacks[u](c);h.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[h.name]=h,s[h.name]=!0}if(a.extensionsUsed)for(let u=0;u<a.extensionsUsed.length;++u){const h=a.extensionsUsed[u],p=a.extensionsRequired||[];switch(h){case Nn.KHR_MATERIALS_UNLIT:s[h]=new bNe;break;case Nn.KHR_DRACO_MESH_COMPRESSION:s[h]=new FNe(a,this.dracoLoader);break;case Nn.KHR_TEXTURE_TRANSFORM:s[h]=new UNe;break;case Nn.KHR_MESH_QUANTIZATION:s[h]=new jNe;break;default:p.indexOf(h)>=0&&o[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(s),c.setPlugins(o),c.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,a){r.parse(e,n,i,a)})}}function yNe(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Nn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class xNe{constructor(e){this.parser=e,this.name=Nn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r<i;r++){const a=n[r];a.extensions&&a.extensions[this.name]&&a.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}_loadLight(e){const n=this.parser,r="light:"+e;let i=n.cache.get(r);if(i)return i;const a=n.json,c=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e];let u;const h=new bt(16777215);c.color!==void 0&&h.setRGB(c.color[0],c.color[1],c.color[2],ef);const p=c.range!==void 0?c.range:0;switch(c.type){case"directional":u=new pk(h),u.target.position.set(0,0,-1),u.add(u.target);break;case"point":u=new hk(h),u.distance=p;break;case"spot":u=new dk(h),u.distance=p,c.spot=c.spot||{},c.spot.innerConeAngle=c.spot.innerConeAngle!==void 0?c.spot.innerConeAngle:0,c.spot.outerConeAngle=c.spot.outerConeAngle!==void 0?c.spot.outerConeAngle:Math.PI/4,u.angle=c.spot.outerConeAngle,u.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,u.target.position.set(0,0,-1),u.add(u.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return u.position.set(0,0,0),u.decay=2,Uu(u,c),c.intensity!==void 0&&(u.intensity=c.intensity),u.name=n.createUniqueName(c.name||"light_"+e),i=Promise.resolve(u),n.cache.add(r,i),i}getDependency(e,n){if(e==="light")return this._loadLight(n)}createNodeAttachment(e){const n=this,r=this.parser,a=r.json.nodes[e],o=(a.extensions&&a.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(c){return r._getNodeRef(n.cache,o,c)})}}class bNe{constructor(){this.name=Nn.KHR_MATERIALS_UNLIT}getMaterialType(){return Qs}extendParams(e,n,r){const i=[];e.color=new bt(1,1,1),e.opacity=1;const a=n.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){const s=a.baseColorFactor;e.color.setRGB(s[0],s[1],s[2],ef),e.opacity=s[3]}a.baseColorTexture!==void 0&&i.push(r.assignTexture(e,"map",a.baseColorTexture,mp))}return Promise.all(i)}}class _Ne{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,n){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=i.extensions[this.name].emissiveStrength;return a!==void 0&&(n.emissiveIntensity=a),Promise.resolve()}}class SNe{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];if(s.clearcoatFactor!==void 0&&(n.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&a.push(r.assignTexture(n,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(n.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&a.push(r.assignTexture(n,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(a.push(r.assignTexture(n,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const o=s.clearcoatNormalTexture.scale;n.clearcoatNormalScale=new Ve(o,o)}return Promise.all(a)}}class ANe{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_DISPERSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=i.extensions[this.name];return n.dispersion=a.dispersion!==void 0?a.dispersion:0,Promise.resolve()}}class wNe{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];return s.iridescenceFactor!==void 0&&(n.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&a.push(r.assignTexture(n,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(n.iridescenceIOR=s.iridescenceIor),n.iridescenceThicknessRange===void 0&&(n.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(n.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(n.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&a.push(r.assignTexture(n,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(a)}}class MNe{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_SHEEN}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[];n.sheenColor=new bt(0,0,0),n.sheenRoughness=0,n.sheen=1;const s=i.extensions[this.name];if(s.sheenColorFactor!==void 0){const o=s.sheenColorFactor;n.sheenColor.setRGB(o[0],o[1],o[2],ef)}return s.sheenRoughnessFactor!==void 0&&(n.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&a.push(r.assignTexture(n,"sheenColorMap",s.sheenColorTexture,mp)),s.sheenRoughnessTexture!==void 0&&a.push(r.assignTexture(n,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(a)}}class ENe{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];return s.transmissionFactor!==void 0&&(n.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&a.push(r.assignTexture(n,"transmissionMap",s.transmissionTexture)),Promise.all(a)}}class TNe{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_VOLUME}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];n.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&a.push(r.assignTexture(n,"thicknessMap",s.thicknessTexture)),n.attenuationDistance=s.attenuationDistance||1/0;const o=s.attenuationColor||[1,1,1];return n.attenuationColor=new bt().setRGB(o[0],o[1],o[2],ef),Promise.all(a)}}class CNe{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_IOR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=i.extensions[this.name];return n.ior=a.ior!==void 0?a.ior:1.5,Promise.resolve()}}class RNe{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_SPECULAR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];n.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&a.push(r.assignTexture(n,"specularIntensityMap",s.specularTexture));const o=s.specularColorFactor||[1,1,1];return n.specularColor=new bt().setRGB(o[0],o[1],o[2],ef),s.specularColorTexture!==void 0&&a.push(r.assignTexture(n,"specularColorMap",s.specularColorTexture,mp)),Promise.all(a)}}class ONe{constructor(e){this.parser=e,this.name=Nn.EXT_MATERIALS_BUMP}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];return n.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&a.push(r.assignTexture(n,"bumpMap",s.bumpTexture)),Promise.all(a)}}class PNe{constructor(e){this.parser=e,this.name=Nn.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zo}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];return s.anisotropyStrength!==void 0&&(n.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(n.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&a.push(r.assignTexture(n,"anisotropyMap",s.anisotropyTexture)),Promise.all(a)}}class DNe{constructor(e){this.parser=e,this.name=Nn.KHR_TEXTURE_BASISU}loadTexture(e){const n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const a=i.extensions[this.name],s=n.options.ktx2Loader;if(!s){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,a.source,s)}}class NNe{constructor(e){this.parser=e,this.name=Nn.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=i.images[s.source];let c=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(c=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,c);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class INe{constructor(e){this.parser=e,this.name=Nn.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=i.images[s.source];let c=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(c=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,c);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class BNe{constructor(e){this.name=Nn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],a=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then(function(o){const c=i.byteOffset||0,u=i.byteLength||0,h=i.count,p=i.byteStride,v=new Uint8Array(o,c,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(h,p,v,i.mode,i.filter).then(function(y){return y.buffer}):s.ready.then(function(){const y=new ArrayBuffer(h*p);return s.decodeGltfBuffer(new Uint8Array(y),h,p,v,i.mode,i.filter),y})})}else return null}}class LNe{constructor(e){this.name=Nn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==ko.TRIANGLES&&u.mode!==ko.TRIANGLE_STRIP&&u.mode!==ko.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=r.extensions[this.name].attributes,o=[],c={};for(const u in s)o.push(this.parser.getDependency("accessor",s[u]).then(h=>(c[u]=h,c[u])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(u=>{const h=u.pop(),p=h.isGroup?h.children:[h],v=u[0].count,y=[];for(const b of p){const w=new qt,_=new ne,S=new gi,E=new ne(1,1,1),T=new X5(b.geometry,b.material,v);for(let P=0;P<v;P++)c.TRANSLATION&&_.fromBufferAttribute(c.TRANSLATION,P),c.ROTATION&&S.fromBufferAttribute(c.ROTATION,P),c.SCALE&&E.fromBufferAttribute(c.SCALE,P),T.setMatrixAt(P,w.compose(_,S,E));for(const P in c)if(P==="_COLOR_0"){const R=c[P];T.instanceColor=new Rp(R.array,R.itemSize,R.normalized)}else P!=="TRANSLATION"&&P!=="ROTATION"&&P!=="SCALE"&&b.geometry.setAttribute(P,c[P]);zn.prototype.copy.call(T,b),this.parser.assignFinalMaterial(T),y.push(T)}return h.isGroup?(h.clear(),h.add(...y),h):y[0]}))}}const CJ="glTF",hx=12,QH={JSON:1313821514,BIN:5130562};class kNe{constructor(e){this.name=Nn.KHR_BINARY_GLTF,this.content=null,this.body=null;const n=new DataView(e,0,hx);if(this.header={magic:ZM(new Uint8Array(e.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==CJ)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-hx,i=new DataView(e,hx);let a=0;for(;a<r;){const s=i.getUint32(a,!0);a+=4;const o=i.getUint32(a,!0);if(a+=4,o===QH.JSON){const c=new Uint8Array(e,hx+a,s);this.content=ZM(c)}else if(o===QH.BIN){const c=hx+a;this.body=e.slice(c,c+s)}a+=s}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class FNe{constructor(e,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Nn.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=n,this.dracoLoader.preload()}decodePrimitive(e,n){const r=this.json,i=this.dracoLoader,a=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,o={},c={},u={};for(const h in s){const p=AB[h]||h.toLowerCase();o[p]=s[h]}for(const h in e.attributes){const p=AB[h]||h.toLowerCase();if(s[h]!==void 0){const v=r.accessors[e.attributes[h]],y=Qg[v.componentType];u[p]=y.name,c[p]=v.normalized===!0}}return n.getDependency("bufferView",a).then(function(h){return new Promise(function(p,v){i.decodeDracoFile(h,function(y){for(const b in y.attributes){const w=y.attributes[b],_=c[b];_!==void 0&&(w.normalized=_)}p(y)},o,u,ef,v)})})}}class UNe{constructor(){this.name=Nn.KHR_TEXTURE_TRANSFORM}extendTexture(e,n){return(n.texCoord===void 0||n.texCoord===e.channel)&&n.offset===void 0&&n.rotation===void 0&&n.scale===void 0||(e=e.clone(),n.texCoord!==void 0&&(e.channel=n.texCoord),n.offset!==void 0&&e.offset.fromArray(n.offset),n.rotation!==void 0&&(e.rotation=n.rotation),n.scale!==void 0&&e.repeat.fromArray(n.scale),e.needsUpdate=!0),e}}class jNe{constructor(){this.name=Nn.KHR_MESH_QUANTIZATION}}class RJ extends uy{constructor(e,n,r,i){super(e,n,r,i)}copySampleValue_(e){const n=this.resultBuffer,r=this.sampleValues,i=this.valueSize,a=e*i*3+i;for(let s=0;s!==i;s++)n[s]=r[a+s];return n}interpolate_(e,n,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,c=o*2,u=o*3,h=i-n,p=(r-n)/h,v=p*p,y=v*p,b=e*u,w=b-u,_=-2*y+3*v,S=y-v,E=1-_,T=S-v+p;for(let P=0;P!==o;P++){const R=s[w+P+o],D=s[w+P+c]*h,I=s[b+P+o],k=s[b+P]*h;a[P]=E*R+T*D+_*I+S*k}return a}}const zNe=new gi;class GNe extends RJ{interpolate_(e,n,r,i){const a=super.interpolate_(e,n,r,i);return zNe.fromArray(a).normalize().toArray(a),a}}const ko={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Qg={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},eV={9728:si,9729:vr,9984:VE,9985:Jg,9986:up,9987:zo},tV={33071:ss,33648:Cv,10497:Rd},GD={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},AB={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...lNe>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},fd={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},HNe={CUBICSPLINE:void 0,LINEAR:Dv,STEP:Pv},HD={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function VNe(t){return t.DefaultMaterial===void 0&&(t.DefaultMaterial=new g1({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Vc})),t.DefaultMaterial}function Xh(t,e,n){for(const r in n.extensions)t[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=n.extensions[r])}function Uu(t,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function WNe(t,e,n){let r=!1,i=!1,a=!1;for(let u=0,h=e.length;u<h;u++){const p=e[u];if(p.POSITION!==void 0&&(r=!0),p.NORMAL!==void 0&&(i=!0),p.COLOR_0!==void 0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(t);const s=[],o=[],c=[];for(let u=0,h=e.length;u<h;u++){const p=e[u];if(r){const v=p.POSITION!==void 0?n.getDependency("accessor",p.POSITION):t.attributes.position;s.push(v)}if(i){const v=p.NORMAL!==void 0?n.getDependency("accessor",p.NORMAL):t.attributes.normal;o.push(v)}if(a){const v=p.COLOR_0!==void 0?n.getDependency("accessor",p.COLOR_0):t.attributes.color;c.push(v)}}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(c)]).then(function(u){const h=u[0],p=u[1],v=u[2];return r&&(t.morphAttributes.position=h),i&&(t.morphAttributes.normal=p),a&&(t.morphAttributes.color=v),t.morphTargetsRelative=!0,t})}function qNe(t,e){if(t.updateMorphTargets(),e.weights!==void 0)for(let n=0,r=e.weights.length;n<r;n++)t.morphTargetInfluences[n]=e.weights[n];if(e.extras&&Array.isArray(e.extras.targetNames)){const n=e.extras.targetNames;if(t.morphTargetInfluences.length===n.length){t.morphTargetDictionary={};for(let r=0,i=n.length;r<i;r++)t.morphTargetDictionary[n[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function $Ne(t){let e;const n=t.extensions&&t.extensions[Nn.KHR_DRACO_MESH_COMPRESSION];if(n?e="draco:"+n.bufferView+":"+n.indices+":"+VD(n.attributes):e=t.indices+":"+VD(t.attributes)+":"+t.mode,t.targets!==void 0)for(let r=0,i=t.targets.length;r<i;r++)e+=":"+VD(t.targets[r]);return e}function VD(t){let e="";const n=Object.keys(t).sort();for(let r=0,i=n.length;r<i;r++)e+=n[r]+":"+t[n[r]]+";";return e}function wB(t){switch(t){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function XNe(t){return t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const KNe=new qt;class YNe{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new yNe,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=!1,a=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,a=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||i&&a<98?this.textureLoader=new FY(this.options.manager):this.textureLoader=new WY(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new io(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(s){const o={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:r,userData:{}};return Xh(a,o,i),Uu(o,i),Promise.all(r._invokeAll(function(c){return c.afterRoot&&c.afterRoot(o)})).then(function(){for(const c of o.scenes)c.updateMatrixWorld();e(o)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,a=n.length;i<a;i++){const s=n[i].joints;for(let o=0,c=s.length;o<c;o++)e[s[o]].isBone=!0}for(let i=0,a=e.length;i<a;i++){const s=e[i];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(r[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,n){n!==void 0&&(e.refs[n]===void 0&&(e.refs[n]=e.uses[n]=0),e.refs[n]++)}_getNodeRef(e,n,r){if(e.refs[n]<=1)return r;const i=r.clone(),a=(s,o)=>{const c=this.associations.get(s);c!=null&&this.associations.set(o,c);for(const[u,h]of s.children.entries())a(h,o.children[u])};return a(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r<n.length;r++){const i=e(n[r]);if(i)return i}return null}_invokeAll(e){const n=Object.values(this.plugins);n.unshift(this);const r=[];for(let i=0;i<n.length;i++){const a=e(n[i]);a&&r.push(a)}return r}getDependency(e,n){const r=e+":"+n;let i=this.cache.get(r);if(!i){switch(e){case"scene":i=this.loadScene(n);break;case"node":i=this._invokeOne(function(a){return a.loadNode&&a.loadNode(n)});break;case"mesh":i=this._invokeOne(function(a){return a.loadMesh&&a.loadMesh(n)});break;case"accessor":i=this.loadAccessor(n);break;case"bufferView":i=this._invokeOne(function(a){return a.loadBufferView&&a.loadBufferView(n)});break;case"buffer":i=this.loadBuffer(n);break;case"material":i=this._invokeOne(function(a){return a.loadMaterial&&a.loadMaterial(n)});break;case"texture":i=this._invokeOne(function(a){return a.loadTexture&&a.loadTexture(n)});break;case"skin":i=this.loadSkin(n);break;case"animation":i=this._invokeOne(function(a){return a.loadAnimation&&a.loadAnimation(n)});break;case"camera":i=this.loadCamera(n);break;default:if(i=this._invokeOne(function(a){return a!=this&&a.getDependency&&a.getDependency(e,n)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(r,i)}return i}getDependencies(e){let n=this.cache.get(e);if(!n){const r=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];n=Promise.all(i.map(function(a,s){return r.getDependency(e,s)})),this.cache.add(e,n)}return n}loadBuffer(e){const n=this.json.buffers[e],r=this.fileLoader;if(n.type&&n.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+n.type+" buffer type is not supported.");if(n.uri===void 0&&e===0)return Promise.resolve(this.extensions[Nn.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(a,s){r.load(Ed.resolveURL(n.uri,i.path),a,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+n.uri+'".'))})})}loadBufferView(e){const n=this.json.bufferViews[e];return this.getDependency("buffer",n.buffer).then(function(r){const i=n.byteLength||0,a=n.byteOffset||0;return r.slice(a,a+i)})}loadAccessor(e){const n=this,r=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const s=GD[i.type],o=Qg[i.componentType],c=i.normalized===!0,u=new o(i.count*s);return Promise.resolve(new qn(u,s,c))}const a=[];return i.bufferView!==void 0?a.push(this.getDependency("bufferView",i.bufferView)):a.push(null),i.sparse!==void 0&&(a.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(a).then(function(s){const o=s[0],c=GD[i.type],u=Qg[i.componentType],h=u.BYTES_PER_ELEMENT,p=h*c,v=i.byteOffset||0,y=i.bufferView!==void 0?r.bufferViews[i.bufferView].byteStride:void 0,b=i.normalized===!0;let w,_;if(y&&y!==p){const S=Math.floor(v/y),E="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+S+":"+i.count;let T=n.cache.get(E);T||(w=new u(o,S*y,i.count*y/h),T=new u1(w,y/h),n.cache.add(E,T)),_=new Dd(T,c,v%y/h,b)}else o===null?w=new u(i.count*c):w=new u(o,v,i.count*c),_=new qn(w,c,b);if(i.sparse!==void 0){const S=GD.SCALAR,E=Qg[i.sparse.indices.componentType],T=i.sparse.indices.byteOffset||0,P=i.sparse.values.byteOffset||0,R=new E(s[1],T,i.sparse.count*S),D=new u(s[2],P,i.sparse.count*c);o!==null&&(_=new qn(_.array.slice(),_.itemSize,_.normalized));for(let I=0,k=R.length;I<k;I++){const B=R[I];if(_.setX(B,D[I*c]),c>=2&&_.setY(B,D[I*c+1]),c>=3&&_.setZ(B,D[I*c+2]),c>=4&&_.setW(B,D[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return _})}loadTexture(e){const n=this.json,r=this.options,a=n.textures[e].source,s=n.images[a];let o=this.textureLoader;if(s.uri){const c=r.manager.getHandler(s.uri);c!==null&&(o=c)}return this.loadTextureImage(e,a,o)}loadTextureImage(e,n,r){const i=this,a=this.json,s=a.textures[e],o=a.images[n],c=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[c])return this.textureCache[c];const u=this.loadImageSource(n,r).then(function(h){h.flipY=!1,h.name=s.name||o.name||"",h.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(h.name=o.uri);const v=(a.samplers||{})[s.sampler]||{};return h.magFilter=eV[v.magFilter]||vr,h.minFilter=eV[v.minFilter]||zo,h.wrapS=tV[v.wrapS]||Rd,h.wrapT=tV[v.wrapT]||Rd,i.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[c]=u,u}loadImageSource(e,n){const r=this,i=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(p=>p.clone());const s=i.images[e],o=self.URL||self.webkitURL;let c=s.uri||"",u=!1;if(s.bufferView!==void 0)c=r.getDependency("bufferView",s.bufferView).then(function(p){u=!0;const v=new Blob([p],{type:s.mimeType});return c=o.createObjectURL(v),c});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(c).then(function(p){return new Promise(function(v,y){let b=v;n.isImageBitmapLoader===!0&&(b=function(w){const _=new Gr(w);_.needsUpdate=!0,v(_)}),n.load(Ed.resolveURL(p,a.path),b,void 0,y)})}).then(function(p){return u===!0&&o.revokeObjectURL(c),Uu(p,s),p.userData.mimeType=s.mimeType||XNe(s.uri),p}).catch(function(p){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),p});return this.sourceCache[e]=h,h}assignTexture(e,n,r,i){const a=this;return this.getDependency("texture",r.index).then(function(s){if(!s)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(s=s.clone(),s.channel=r.texCoord),a.extensions[Nn.KHR_TEXTURE_TRANSFORM]){const o=r.extensions!==void 0?r.extensions[Nn.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const c=a.associations.get(s);s=a.extensions[Nn.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),a.associations.set(s,c)}}return i!==void 0&&(typeof i=="number"&&(i=i===ZH?mp:ef),"colorSpace"in s?s.colorSpace=i:s.encoding=i===mp?ZH:vNe),e[n]=s,s})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,a=n.attributes.color!==void 0,s=n.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+r.uuid;let c=this.cache.get(o);c||(c=new oT,zi.prototype.copy.call(c,r),c.color.copy(r.color),c.map=r.map,c.sizeAttenuation=!1,this.cache.add(o,c)),r=c}else if(e.isLine){const o="LineBasicMaterial:"+r.uuid;let c=this.cache.get(o);c||(c=new La,zi.prototype.copy.call(c,r),c.color.copy(r.color),c.map=r.map,this.cache.add(o,c)),r=c}if(i||a||s){let o="ClonedMaterial:"+r.uuid+":";i&&(o+="derivative-tangents:"),a&&(o+="vertex-colors:"),s&&(o+="flat-shading:");let c=this.cache.get(o);c||(c=r.clone(),a&&(c.vertexColors=!0),s&&(c.flatShading=!0),i&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(o,c),this.associations.set(c,this.associations.get(r))),r=c}e.material=r}getMaterialType(){return g1}loadMaterial(e){const n=this,r=this.json,i=this.extensions,a=r.materials[e];let s;const o={},c=a.extensions||{},u=[];if(c[Nn.KHR_MATERIALS_UNLIT]){const p=i[Nn.KHR_MATERIALS_UNLIT];s=p.getMaterialType(),u.push(p.extendParams(o,a,n))}else{const p=a.pbrMetallicRoughness||{};if(o.color=new bt(1,1,1),o.opacity=1,Array.isArray(p.baseColorFactor)){const v=p.baseColorFactor;o.color.setRGB(v[0],v[1],v[2],ef),o.opacity=v[3]}p.baseColorTexture!==void 0&&u.push(n.assignTexture(o,"map",p.baseColorTexture,mp)),o.metalness=p.metallicFactor!==void 0?p.metallicFactor:1,o.roughness=p.roughnessFactor!==void 0?p.roughnessFactor:1,p.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(o,"metalnessMap",p.metallicRoughnessTexture)),u.push(n.assignTexture(o,"roughnessMap",p.metallicRoughnessTexture))),s=this._invokeOne(function(v){return v.getMaterialType&&v.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(v){return v.extendMaterialParams&&v.extendMaterialParams(e,o)})))}a.doubleSided===!0&&(o.side=Fo);const h=a.alphaMode||HD.OPAQUE;if(h===HD.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===HD.MASK&&(o.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&s!==Qs&&(u.push(n.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new Ve(1,1),a.normalTexture.scale!==void 0)){const p=a.normalTexture.scale;o.normalScale.set(p,p)}if(a.occlusionTexture!==void 0&&s!==Qs&&(u.push(n.assignTexture(o,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&s!==Qs){const p=a.emissiveFactor;o.emissive=new bt().setRGB(p[0],p[1],p[2],ef)}return a.emissiveTexture!==void 0&&s!==Qs&&u.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture,mp)),Promise.all(u).then(function(){const p=new s(o);return a.name&&(p.name=a.name),Uu(p,a),n.associations.set(p,{materials:e}),a.extensions&&Xh(i,p,a),p})}createUniqueName(e){const n=Hn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function a(o){return r[Nn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,n).then(function(c){return nV(c,o,n)})}const s=[];for(let o=0,c=e.length;o<c;o++){const u=e[o],h=$Ne(u),p=i[h];if(p)s.push(p.promise);else{let v;u.extensions&&u.extensions[Nn.KHR_DRACO_MESH_COMPRESSION]?v=a(u):v=nV(new an,u,n),i[h]={primitive:u,promise:v},s.push(v)}}return Promise.all(s)}loadMesh(e){const n=this,r=this.json,i=this.extensions,a=r.meshes[e],s=a.primitives,o=[];for(let c=0,u=s.length;c<u;c++){const h=s[c].material===void 0?VNe(this.cache):this.getDependency("material",s[c].material);o.push(h)}return o.push(n.loadGeometries(s)),Promise.all(o).then(function(c){const u=c.slice(0,c.length-1),h=c[c.length-1],p=[];for(let y=0,b=h.length;y<b;y++){const w=h[y],_=s[y];let S;const E=u[y];if(_.mode===ko.TRIANGLES||_.mode===ko.TRIANGLE_STRIP||_.mode===ko.TRIANGLE_FAN||_.mode===void 0)S=a.isSkinnedMesh===!0?new $5(w,E):new vi(w,E),S.isSkinnedMesh===!0&&S.normalizeSkinWeights(),_.mode===ko.TRIANGLE_STRIP?S.geometry=KH(S.geometry,U5):_.mode===ko.TRIANGLE_FAN&&(S.geometry=KH(S.geometry,HM));else if(_.mode===ko.LINES)S=new Hl(w,E);else if(_.mode===ko.LINE_STRIP)S=new of(w,E);else if(_.mode===ko.LINE_LOOP)S=new K5(w,E);else if(_.mode===ko.POINTS)S=new Y5(w,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+_.mode);Object.keys(S.geometry.morphAttributes).length>0&&qNe(S,a),S.name=n.createUniqueName(a.name||"mesh_"+e),Uu(S,a),_.extensions&&Xh(i,S,_),n.assignFinalMaterial(S),p.push(S)}for(let y=0,b=p.length;y<b;y++)n.associations.set(p[y],{meshes:e,primitives:y});if(p.length===1)return a.extensions&&Xh(i,p[0],a),p[0];const v=new $u;a.extensions&&Xh(i,v,a),n.associations.set(v,{meshes:e});for(let y=0,b=p.length;y<b;y++)v.add(p[y]);return v})}loadCamera(e){let n;const r=this.json.cameras[e],i=r[r.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?n=new jr(rY.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):r.type==="orthographic"&&(n=new qo(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(n.name=this.createUniqueName(r.name)),Uu(n,r),Promise.resolve(n)}loadSkin(e){const n=this.json.skins[e],r=[];for(let i=0,a=n.joints.length;i<a;i++)r.push(this._loadNodeShallow(n.joints[i]));return n.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",n.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(i){const a=i.pop(),s=i,o=[],c=[];for(let u=0,h=s.length;u<h;u++){const p=s[u];if(p){o.push(p);const v=new qt;a!==null&&v.fromArray(a.array,u*16),c.push(v)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',n.joints[u])}return new f1(o,c)})}loadAnimation(e){const n=this.json,r=this,i=n.animations[e],a=i.name?i.name:"animation_"+e,s=[],o=[],c=[],u=[],h=[];for(let p=0,v=i.channels.length;p<v;p++){const y=i.channels[p],b=i.samplers[y.sampler],w=y.target,_=w.node,S=i.parameters!==void 0?i.parameters[b.input]:b.input,E=i.parameters!==void 0?i.parameters[b.output]:b.output;w.node!==void 0&&(s.push(this.getDependency("node",_)),o.push(this.getDependency("accessor",S)),c.push(this.getDependency("accessor",E)),u.push(b),h.push(w))}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(c),Promise.all(u),Promise.all(h)]).then(function(p){const v=p[0],y=p[1],b=p[2],w=p[3],_=p[4],S=[];for(let E=0,T=v.length;E<T;E++){const P=v[E],R=y[E],D=b[E],I=w[E],k=_[E];if(P===void 0)continue;P.updateMatrix&&P.updateMatrix();const B=r._createAnimationTracks(P,R,D,I,k);if(B)for(let U=0;U<B.length;U++)S.push(B[U])}return new jv(a,void 0,S)})}createNodeMesh(e){const n=this.json,r=this,i=n.nodes[e];return i.mesh===void 0?null:r.getDependency("mesh",i.mesh).then(function(a){const s=r._getNodeRef(r.meshCache,i.mesh,a);return i.weights!==void 0&&s.traverse(function(o){if(o.isMesh)for(let c=0,u=i.weights.length;c<u;c++)o.morphTargetInfluences[c]=i.weights[c]}),s})}loadNode(e){const n=this.json,r=this,i=n.nodes[e],a=r._loadNodeShallow(e),s=[],o=i.children||[];for(let u=0,h=o.length;u<h;u++)s.push(r.getDependency("node",o[u]));const c=i.skin===void 0?Promise.resolve(null):r.getDependency("skin",i.skin);return Promise.all([a,Promise.all(s),c]).then(function(u){const h=u[0],p=u[1],v=u[2];v!==null&&h.traverse(function(y){y.isSkinnedMesh&&y.bind(v,KNe)});for(let y=0,b=p.length;y<b;y++)h.add(p[y]);return h})}_loadNodeShallow(e){const n=this.json,r=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const a=n.nodes[e],s=a.name?i.createUniqueName(a.name):"",o=[],c=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return c&&o.push(c),a.camera!==void 0&&o.push(i.getDependency("camera",a.camera).then(function(u){return i._getNodeRef(i.cameraCache,a.camera,u)})),i._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){o.push(u)}),this.nodeCache[e]=Promise.all(o).then(function(u){let h;if(a.isBone===!0?h=new aT:u.length>1?h=new $u:u.length===1?h=u[0]:h=new zn,h!==u[0])for(let p=0,v=u.length;p<v;p++)h.add(u[p]);if(a.name&&(h.userData.name=a.name,h.name=s),Uu(h,a),a.extensions&&Xh(r,h,a),a.matrix!==void 0){const p=new qt;p.fromArray(a.matrix),h.applyMatrix4(p)}else a.translation!==void 0&&h.position.fromArray(a.translation),a.rotation!==void 0&&h.quaternion.fromArray(a.rotation),a.scale!==void 0&&h.scale.fromArray(a.scale);return i.associations.has(h)||i.associations.set(h,{}),i.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const n=this.extensions,r=this.json.scenes[e],i=this,a=new $u;r.name&&(a.name=i.createUniqueName(r.name)),Uu(a,r),r.extensions&&Xh(n,a,r);const s=r.nodes||[],o=[];for(let c=0,u=s.length;c<u;c++)o.push(i.getDependency("node",s[c]));return Promise.all(o).then(function(c){for(let h=0,p=c.length;h<p;h++)a.add(c[h]);const u=h=>{const p=new Map;for(const[v,y]of i.associations)(v instanceof zi||v instanceof Gr)&&p.set(v,y);return h.traverse(v=>{const y=i.associations.get(v);y!=null&&p.set(v,y)}),p};return i.associations=u(a),a})}_createAnimationTracks(e,n,r,i,a){const s=[],o=e.name?e.name:e.uuid,c=[];fd[a.path]===fd.weights?e.traverse(function(v){v.morphTargetInfluences&&c.push(v.name?v.name:v.uuid)}):c.push(o);let u;switch(fd[a.path]){case fd.weights:u=Pp;break;case fd.rotation:u=Dp;break;case fd.position:case fd.scale:u=Np;break;default:r.itemSize===1?u=Pp:u=Np;break}const h=i.interpolation!==void 0?HNe[i.interpolation]:Dv,p=this._getArrayFromAccessor(r);for(let v=0,y=c.length;v<y;v++){const b=new u(c[v]+"."+fd[a.path],n.array,p,h);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(b),s.push(b)}return s}_getArrayFromAccessor(e){let n=e.array;if(e.normalized){const r=wB(n.constructor),i=new Float32Array(n.length);for(let a=0,s=n.length;a<s;a++)i[a]=n[a]*r;n=i}return n}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(r){const i=this instanceof Dp?GNe:RJ;return new i(this.times,this.values,this.getValueSize()/3,r)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function JNe(t,e,n){const r=e.attributes,i=new Oi;if(r.POSITION!==void 0){const o=n.json.accessors[r.POSITION],c=o.min,u=o.max;if(c!==void 0&&u!==void 0){if(i.set(new ne(c[0],c[1],c[2]),new ne(u[0],u[1],u[2])),o.normalized){const h=wB(Qg[o.componentType]);i.min.multiplyScalar(h),i.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const a=e.targets;if(a!==void 0){const o=new ne,c=new ne;for(let u=0,h=a.length;u<h;u++){const p=a[u];if(p.POSITION!==void 0){const v=n.json.accessors[p.POSITION],y=v.min,b=v.max;if(y!==void 0&&b!==void 0){if(c.setX(Math.max(Math.abs(y[0]),Math.abs(b[0]))),c.setY(Math.max(Math.abs(y[1]),Math.abs(b[1]))),c.setZ(Math.max(Math.abs(y[2]),Math.abs(b[2]))),v.normalized){const w=wB(Qg[v.componentType]);c.multiplyScalar(w)}o.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(o)}t.boundingBox=i;const s=new Zi;i.getCenter(s.center),s.radius=i.min.distanceTo(i.max)/2,t.boundingSphere=s}function nV(t,e,n){const r=e.attributes,i=[];function a(s,o){return n.getDependency("accessor",s).then(function(c){t.setAttribute(o,c)})}for(const s in r){const o=AB[s]||s.toLowerCase();o in t.attributes||i.push(a(r[s],o))}if(e.indices!==void 0&&!t.index){const s=n.getDependency("accessor",e.indices).then(function(o){t.setIndex(o)});i.push(s)}return Uu(t,e),JNe(t,e,n),Promise.all(i).then(function(){return e.targets!==void 0?WNe(t,e.targets,n):t})}const WD=new WeakMap;class ZNe extends ka{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,n,r,i){const a=new io(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,s=>{const o={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(s,o).then(n).catch(i)},r,i)}decodeDracoFile(e,n,r,i){const a={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,a).then(n)}decodeGeometry(e,n){for(const c in n.attributeTypes){const u=n.attributeTypes[c];u.BYTES_PER_ELEMENT!==void 0&&(n.attributeTypes[c]=u.name)}const r=JSON.stringify(n);if(WD.has(e)){const c=WD.get(e);if(c.key===r)return c.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const a=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(a,s).then(c=>(i=c,new Promise((u,h)=>{i._callbacks[a]={resolve:u,reject:h},i.postMessage({type:"decode",id:a,taskConfig:n,buffer:e},[e])}))).then(c=>this._createGeometry(c.geometry));return o.catch(()=>!0).then(()=>{i&&a&&this._releaseTask(i,a)}),WD.set(e,{key:r,promise:o}),o}_createGeometry(e){const n=new an;e.index&&n.setIndex(new qn(e.index.array,1));for(let r=0;r<e.attributes.length;r++){const i=e.attributes[r],a=i.name,s=i.array,o=i.itemSize;n.setAttribute(a,new qn(s,o))}return n}_loadLibrary(e,n){const r=new io(this.manager);return r.setPath(this.decoderPath),r.setResponseType(n),r.setWithCredentials(this.withCredentials),new Promise((i,a)=>{r.load(e,i,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",n=[];return e?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then(r=>{const i=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const a=QNe.toString(),s=["/* draco decoder */",i,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(`
`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,n){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(a){const s=a.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,a){return i._taskLoad>a._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=n,r._taskLoad+=n,r})}_releaseTask(e,n){e._taskLoad-=e._taskCosts[n],delete e._callbacks[n],delete e._taskCosts[n]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function QNe(){let t,e;onmessage=function(s){const o=s.data;switch(o.type){case"init":t=o.decoderConfig,e=new Promise(function(h){t.onModuleLoaded=function(p){h({draco:p})},DracoDecoderModule(t)});break;case"decode":const c=o.buffer,u=o.taskConfig;e.then(h=>{const p=h.draco,v=new p.Decoder,y=new p.DecoderBuffer;y.Init(new Int8Array(c),c.byteLength);try{const b=n(p,v,y,u),w=b.attributes.map(_=>_.array.buffer);b.index&&w.push(b.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:b},w)}catch(b){console.error(b),self.postMessage({type:"error",id:o.id,error:b.message})}finally{p.destroy(y),p.destroy(v)}});break}};function n(s,o,c,u){const h=u.attributeIDs,p=u.attributeTypes;let v,y;const b=o.GetEncodedGeometryType(c);if(b===s.TRIANGULAR_MESH)v=new s.Mesh,y=o.DecodeBufferToMesh(c,v);else if(b===s.POINT_CLOUD)v=new s.PointCloud,y=o.DecodeBufferToPointCloud(c,v);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!y.ok()||v.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+y.error_msg());const w={index:null,attributes:[]};for(const _ in h){const S=self[p[_]];let E,T;if(u.useUniqueIDs)T=h[_],E=o.GetAttributeByUniqueId(v,T);else{if(T=o.GetAttributeId(v,s[h[_]]),T===-1)continue;E=o.GetAttribute(v,T)}w.attributes.push(i(s,o,v,_,S,E))}return b===s.TRIANGULAR_MESH&&(w.index=r(s,o,v)),s.destroy(v),w}function r(s,o,c){const h=c.num_faces()*3,p=h*4,v=s._malloc(p);o.GetTrianglesUInt32Array(c,p,v);const y=new Uint32Array(s.HEAPF32.buffer,v,h).slice();return s._free(v),{array:y,itemSize:1}}function i(s,o,c,u,h,p){const v=p.num_components(),b=c.num_points()*v,w=b*h.BYTES_PER_ELEMENT,_=a(s,h),S=s._malloc(w);o.GetAttributeDataArrayForAllPoints(c,p,_,w,S);const E=new h(s.HEAPF32.buffer,S,b).slice();return s._free(S),{name:u,array:E,itemSize:v}}function a(s,o){switch(o){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}let SA;const qD=()=>{if(SA)return SA;const t="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let i=t;WebAssembly.validate(n)&&(i=e);let a;const s=WebAssembly.instantiate(o(i),{}).then(p=>{a=p.instance,a.exports.__wasm_call_ctors()});function o(p){const v=new Uint8Array(p.length);for(let b=0;b<p.length;++b){const w=p.charCodeAt(b);v[b]=w>96?w-71:w>64?w-65:w>47?w+4:w>46?63:62}let y=0;for(let b=0;b<p.length;++b)v[y++]=v[b]<60?r[v[b]]:(v[b]-60)*64+v[++b];return v.buffer.slice(0,y)}function c(p,v,y,b,w,_){const S=a.exports.sbrk,E=y+3&-4,T=S(E*b),P=S(w.length),R=new Uint8Array(a.exports.memory.buffer);R.set(w,P);const D=p(T,y,b,P,w.length);if(D===0&&_&&_(T,E,b),v.set(R.subarray(T,T+y*b)),S(T-S(0)),D!==0)throw new Error(`Malformed buffer data: ${D}`)}const u={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return SA={ready:s,supported:!0,decodeVertexBuffer(p,v,y,b,w){c(a.exports.meshopt_decodeVertexBuffer,p,v,y,b,a.exports[u[w]])},decodeIndexBuffer(p,v,y,b){c(a.exports.meshopt_decodeIndexBuffer,p,v,y,b)},decodeIndexSequence(p,v,y,b){c(a.exports.meshopt_decodeIndexSequence,p,v,y,b)},decodeGltfBuffer(p,v,y,b,w,_){c(a.exports[h[w]],p,v,y,b,a.exports[u[_]])}},SA};let AA=null,OJ="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function PJ(t=!0,e=!0,n){return r=>{n&&n(r),t&&(AA||(AA=new ZNe),AA.setDecoderPath(typeof t=="string"?t:OJ),r.setDRACOLoader(AA)),e&&r.setMeshoptDecoder(typeof qD=="function"?qD():qD)}}const hy=(t,e,n,r)=>y1(Tk,t,PJ(e,n,r));hy.preload=(t,e,n,r)=>y1.preload(Tk,t,PJ(e,n,r));hy.clear=t=>y1.clear(Tk,t);hy.setDecoderPath=t=>{OJ=t};const DJ=j.forwardRef(({makeDefault:t,camera:e,regress:n,domElement:r,enableDamping:i=!0,keyEvents:a=!1,onChange:s,onStart:o,onEnd:c,...u},h)=>{const p=Cl(D=>D.invalidate),v=Cl(D=>D.camera),y=Cl(D=>D.gl),b=Cl(D=>D.events),w=Cl(D=>D.setEvents),_=Cl(D=>D.set),S=Cl(D=>D.get),E=Cl(D=>D.performance),T=e||v,P=r||b.connected||y.domElement,R=j.useMemo(()=>new gNe(T),[T]);return wk(()=>{R.enabled&&R.update()},-1),j.useEffect(()=>(a&&R.connect(a===!0?P:a),R.connect(P),()=>{R.dispose()}),[a,P,n,R,p]),j.useEffect(()=>{const D=B=>{p(),n&&E.regress(),s&&s(B)},I=B=>{o&&o(B)},k=B=>{c&&c(B)};return R.addEventListener("change",D),R.addEventListener("start",I),R.addEventListener("end",k),()=>{R.removeEventListener("start",I),R.removeEventListener("end",k),R.removeEventListener("change",D)}},[s,o,c,R,p,w]),j.useEffect(()=>{if(t){const D=S().controls;return _({controls:R}),()=>_({controls:D})}},[t,R]),j.createElement("primitive",Iw({ref:h,object:R,enableDamping:i},u))});var Lo=(function(t){return t[t.NONE=0]="NONE",t[t.START=1]="START",t[t.ACTIVE=2]="ACTIVE",t})(Lo||{});const Og=t=>t&&t.isOrthographicCamera,eIe=t=>t&&t.isBox3,tIe=t=>1-Math.exp(-5*t)+.007*t,nIe=j.createContext(null);function NJ({children:t,maxDuration:e=1,margin:n=1.2,observe:r,fit:i,clip:a,interpolateFunc:s=tIe,onFit:o}){const c=j.useRef(null),{camera:u,size:h,invalidate:p}=Cl(),v=Cl(R=>R.controls),y=j.useRef(o);y.current=o;const b=j.useRef({camPos:new ne,camRot:new gi,camZoom:1}),w=j.useRef({camPos:void 0,camRot:void 0,camZoom:void 0,camUp:void 0,target:void 0}),_=j.useRef(Lo.NONE),S=j.useRef(0),[E]=j.useState(()=>new Oi),T=j.useMemo(()=>{function R(){const D=E.getSize(new ne),I=E.getCenter(new ne),k=Math.max(D.x,D.y,D.z),B=Og(u)?k*4:k/(2*Math.atan(Math.PI*u.fov/360)),U=Og(u)?k*4:B/u.aspect,z=n*Math.max(B,U);return{box:E,size:D,center:I,distance:z}}return{getSize:R,refresh(D){if(eIe(D))E.copy(D);else{const I=D||c.current;if(!I)return this;I.updateWorldMatrix(!0,!0),E.setFromObject(I)}if(E.isEmpty()){const I=u.position.length()||10;E.setFromCenterAndSize(new ne,new ne(I,I,I))}return b.current.camPos.copy(u.position),b.current.camRot.copy(u.quaternion),Og(u)&&(b.current.camZoom=u.zoom),w.current.camPos=void 0,w.current.camRot=void 0,w.current.camZoom=void 0,w.current.camUp=void 0,w.current.target=void 0,this},reset(){const{center:D,distance:I}=R(),k=u.position.clone().sub(D).normalize();w.current.camPos=D.clone().addScaledVector(k,I),w.current.target=D.clone();const B=new qt().lookAt(w.current.camPos,w.current.target,u.up);return w.current.camRot=new gi().setFromRotationMatrix(B),_.current=Lo.START,S.current=0,this},moveTo(D){return w.current.camPos=Array.isArray(D)?new ne(...D):D.clone(),_.current=Lo.START,S.current=0,this},lookAt({target:D,up:I}){w.current.target=Array.isArray(D)?new ne(...D):D.clone(),I?w.current.camUp=Array.isArray(I)?new ne(...I):I.clone():w.current.camUp=u.up.clone();const k=new qt().lookAt(w.current.camPos||u.position,w.current.target,w.current.camUp);return w.current.camRot=new gi().setFromRotationMatrix(k),_.current=Lo.START,S.current=0,this},to({position:D,target:I}){return this.moveTo(D).lookAt({target:I})},fit(){if(!Og(u))return this.reset();let D=0,I=0;const k=[new ne(E.min.x,E.min.y,E.min.z),new ne(E.min.x,E.max.y,E.min.z),new ne(E.min.x,E.min.y,E.max.z),new ne(E.min.x,E.max.y,E.max.z),new ne(E.max.x,E.max.y,E.max.z),new ne(E.max.x,E.max.y,E.min.z),new ne(E.max.x,E.min.y,E.max.z),new ne(E.max.x,E.min.y,E.min.z)],B=w.current.camPos||u.position,U=w.current.target||v?.target,z=w.current.camUp||u.up,q=U?new qt().lookAt(B,U,z).setPosition(B).invert():u.matrixWorldInverse;for(const Q of k)Q.applyMatrix4(q),D=Math.max(D,Math.abs(Q.y)),I=Math.max(I,Math.abs(Q.x));D*=2,I*=2;const W=(u.top-u.bottom)/D,ee=(u.right-u.left)/I;return w.current.camZoom=Math.min(W,ee)/n,_.current=Lo.START,S.current=0,y.current&&y.current(this.getSize()),this},clip(){const{distance:D}=R();return u.near=D/100,u.far=D*100,u.updateProjectionMatrix(),v&&(v.maxDistance=D*10,v.update()),p(),this}}},[E,u,v,n,p]);j.useLayoutEffect(()=>{if(v){const R=()=>{if(v&&w.current.target&&_.current!==Lo.NONE){const D=new ne().setFromMatrixColumn(u.matrix,2),I=b.current.camPos.distanceTo(v.target),k=(w.current.camPos||b.current.camPos).distanceTo(w.current.target),B=(1-S.current)*I+S.current*k;v.target.copy(u.position).addScaledVector(D,-B),v.update()}_.current=Lo.NONE};return v.addEventListener("start",R),()=>v.removeEventListener("start",R)}},[v]);const P=j.useRef(0);return j.useLayoutEffect(()=>{(r||P.current++===0)&&(T.refresh(),i&&T.reset().fit(),a&&T.clip())},[h,a,i,r,u,v]),wk((R,D)=>{if(_.current===Lo.START)_.current=Lo.ACTIVE,p();else if(_.current===Lo.ACTIVE){if(S.current+=D/e,S.current>=1)w.current.camPos&&u.position.copy(w.current.camPos),w.current.camRot&&u.quaternion.copy(w.current.camRot),w.current.camUp&&u.up.copy(w.current.camUp),w.current.camZoom&&Og(u)&&(u.zoom=w.current.camZoom),u.updateMatrixWorld(),u.updateProjectionMatrix(),v&&w.current.target&&(v.target.copy(w.current.target),v.update()),_.current=Lo.NONE;else{const I=s(S.current);w.current.camPos&&u.position.lerpVectors(b.current.camPos,w.current.camPos,I),w.current.camRot&&u.quaternion.slerpQuaternions(b.current.camRot,w.current.camRot,I),w.current.camUp&&u.up.set(0,1,0).applyQuaternion(u.quaternion),w.current.camZoom&&Og(u)&&(u.zoom=(1-I)*b.current.camZoom+I*w.current.camZoom),u.updateMatrixWorld(),u.updateProjectionMatrix()}p()}}),j.createElement("group",{ref:c},j.createElement(nIe.Provider,{value:T},t))}const Gv={u1:"/penthouse-images/1.jpg",u2:"/penthouse-images/2.jpg",u3:"/penthouse-images/3.jpg",u4:"/penthouse-images/4.jpg",u5:"/penthouse-images/5.jpg",u6:"/penthouse-images/6.jpg",u7:"/penthouse-images/7.jpg",u8:"/penthouse-images/8.jpg"},rIe=new URL(""+new URL("f6b441fc43a460a957df992433ee39ca-CmWpZmjx.jpg",import.meta.url).href,import.meta.url).href,iIe=new URL(""+new URL("ee2057aab582951894fea5b1f56ea27e-B0aag1Nm.jpg",import.meta.url).href,import.meta.url).href,Ck="/models/house1/house1.glb",Rk="/models/house2/house2.glb",aIe="https://www.google.com/maps?q=Dubai+Marina&output=embed";hy.preload(Ck);hy.preload(Rk);function IJ({status:t}){const e={available:{icon:Dae,label:"Available",color:"text-green-300 bg-green-500/20 border-green-500/30"},reserved:{icon:RN,label:"Reserved",color:"text-amber-300 bg-amber-500/20 border-amber-500/30"},sold:{icon:Iae,label:"Sold",color:"text-zinc-300 bg-zinc-500/20 border-zinc-500/30"},hold:{icon:RN,label:"On Hold",color:"text-red-300 bg-red-500/20 border-red-500/30"}},{icon:n,label:r,color:i}=e[t];return M.jsxs("span",{"code-path":"src\\components\\modules\\Inventory.tsx:68:5",className:`inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-[11px] ${i}`,children:[M.jsx(n,{"code-path":"src\\components\\modules\\Inventory.tsx:69:7",className:"h-3 w-3"}),r]})}function BJ({onClose:t}){return M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:77:5",className:"flex items-center gap-2",children:[M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:78:7",type:"button",onClick:t,className:"h-3.5 w-3.5 rounded-full bg-[#ff5f57] hover:brightness-110"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:79:7",className:"h-3.5 w-3.5 rounded-full bg-[#febc2e]"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:80:7",className:"h-3.5 w-3.5 rounded-full bg-[#28c840]"})]})}function LJ({url:t}){const{scene:e}=hy(t),n=j.useMemo(()=>{const r=e.clone(),i=new Oi().setFromObject(r),a=new ne;i.getSize(a);const o=5/(Math.max(a.x,a.y,a.z)||1);r.scale.setScalar(o);const c=new Oi().setFromObject(r),u=new ne;return c.getCenter(u),r.position.sub(u),r},[e]);return M.jsx("primitive",{"code-path":"src\\components\\modules\\Inventory.tsx:108:10",object:n})}function sIe({unit:t}){const e=t.id==="u1"||t.id==="u2"?Rk:Ck;return M.jsxs(EJ,{"code-path":"src\\components\\modules\\Inventory.tsx:115:5",camera:{position:[6,5,8],fov:55},gl:{antialias:!0},dpr:[1,2],children:[M.jsx("color",{"code-path":"src\\components\\modules\\Inventory.tsx:116:7",attach:"background",args:["#060d1f"]}),M.jsx("ambientLight",{"code-path":"src\\components\\modules\\Inventory.tsx:117:7",intensity:1.2}),M.jsx("directionalLight",{"code-path":"src\\components\\modules\\Inventory.tsx:118:7",intensity:1.5,position:[10,12,8],castShadow:!0}),M.jsx("directionalLight",{"code-path":"src\\components\\modules\\Inventory.tsx:119:7",intensity:.6,position:[-8,4,-6]}),M.jsx("pointLight",{"code-path":"src\\components\\modules\\Inventory.tsx:120:7",position:[0,8,0],intensity:.4}),M.jsx(j.Suspense,{"code-path":"src\\components\\modules\\Inventory.tsx:122:7",fallback:M.jsx(oNe,{"code-path":"src\\components\\modules\\Inventory.tsx:124:11",center:!0,children:M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:125:13",className:"rounded-lg border border-white/20 bg-zinc-900/90 px-4 py-3 text-sm text-zinc-200 backdrop-blur-xl",children:M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:126:15",className:"flex items-center gap-2",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:127:17",className:"h-4 w-4 animate-spin rounded-full border-2 border-cyan-400 border-t-transparent"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:128:17",children:"Loading 3D model…"})]})})}),children:M.jsx(NJ,{"code-path":"src\\components\\modules\\Inventory.tsx:134:9",fit:!0,clip:!0,observe:!0,margin:1.15,children:M.jsx(LJ,{"code-path":"src\\components\\modules\\Inventory.tsx:135:11",url:e})})}),M.jsx(DJ,{"code-path":"src\\components\\modules\\Inventory.tsx:139:7",enableDamping:!0,dampingFactor:.06,minDistance:1,maxDistance:30,enablePan:!0,mouseButtons:{LEFT:Cc.ROTATE,MIDDLE:Cc.DOLLY,RIGHT:Cc.PAN}})]})}const kJ={u1:{bedrooms:4,bathrooms:4,parking:2,description:"Sky-high penthouse with unobstructed panoramic sea views, private terrace, and bespoke interiors across two levels.",features:["Private Rooftop Terrace","Smart Home Automation","Floor-to-Ceiling Glazing","Private Elevator Lobby","Chef's Kitchen","Maid's Room"],paymentPlan:[{label:"On Booking",value:"10%"},{label:"During Construction",value:"40%"},{label:"On Handover",value:"50%"}]},u2:{bedrooms:3,bathrooms:3,parking:2,description:"Expansive penthouse overlooking the sea and marina, featuring a wraparound terrace and premium finishes throughout.",features:["Wraparound Terrace","Marina & Sea Views","Smart Home System","Private Pool","Walk-in Wardrobes","Maid's Room"],paymentPlan:[{label:"On Booking",value:"10%"},{label:"During Construction",value:"40%"},{label:"On Handover",value:"50%"}]},u3:{bedrooms:3,bathrooms:3,parking:2,description:"Generous 3-bedroom residence with sweeping sea views, open-plan living, and premium finishes on the 45th floor.",features:["Sea View","Open-Plan Living","Balcony","Built-in Wardrobes","Laundry Room","Storage Room"],paymentPlan:[{label:"On Booking",value:"10%"},{label:"During Construction",value:"50%"},{label:"On Handover",value:"40%"}]},u4:{bedrooms:3,bathrooms:3,parking:2,description:"Elegant 3-bedroom apartment with marina views, contemporary design, and a spacious open-plan layout.",features:["Marina View","Open-Plan Living","Balcony","Built-in Wardrobes","Laundry Room","Storage Room"],paymentPlan:[{label:"On Booking",value:"10%"},{label:"During Construction",value:"50%"},{label:"On Handover",value:"40%"}]},u5:{bedrooms:2,bathrooms:2,parking:1,description:"Bright 2-bedroom apartment with sea views and a modern open-plan kitchen and living area on the 44th floor.",features:["Sea View","Open-Plan Kitchen","Balcony","Built-in Wardrobes","Laundry Closet"],paymentPlan:[{label:"On Booking",value:"10%"},{label:"During Construction",value:"50%"},{label:"On Handover",value:"40%"}]},u6:{bedrooms:2,bathrooms:2,parking:1,description:"Contemporary 2-bedroom apartment with city views, modern interiors, and a private balcony on the 44th floor.",features:["City View","Open-Plan Kitchen","Balcony","Built-in Wardrobes","Laundry Closet"],paymentPlan:[{label:"On Booking",value:"10%"},{label:"During Construction",value:"50%"},{label:"On Handover",value:"40%"}]},u7:{bedrooms:1,bathrooms:1,parking:1,description:"Stylish 1-bedroom apartment with sea views and a well-appointed open-plan layout on the 43rd floor.",features:["Sea View","Open-Plan Layout","Balcony","Built-in Wardrobe"],paymentPlan:[{label:"On Booking",value:"10%"},{label:"During Construction",value:"60%"},{label:"On Handover",value:"30%"}]},u8:{bedrooms:1,bathrooms:1,parking:1,description:"Modern 1-bedroom apartment with city views and a compact, efficient layout on the 43rd floor.",features:["City View","Open-Plan Layout","Balcony","Built-in Wardrobe"],paymentPlan:[{label:"On Booking",value:"10%"},{label:"During Construction",value:"60%"},{label:"On Handover",value:"30%"}]}},oIe=kJ.u1;function lIe({unit:t,onClose:e,onOpen3D:n,onOpenBlueprint:r}){const i=kJ[t.id]??oIe,a=Gv[t.id]??Gv.u1,s={available:"text-emerald-300 border-emerald-400/30 bg-emerald-500/10",reserved:"text-amber-300 border-amber-400/30 bg-amber-500/10",sold:"text-red-300 border-red-400/30 bg-red-500/10",hold:"text-zinc-300 border-zinc-400/30 bg-zinc-500/10"},o=Math.round(t.price/t.area);return M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Inventory.tsx:241:5",className:"fixed inset-0 z-[95] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:248:7",className:"absolute inset-0 bg-black/75 backdrop-blur-md",onClick:e}),M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Inventory.tsx:251:7",initial:{y:24,scale:.96},animate:{y:0,scale:1},exit:{y:24,scale:.96},transition:{type:"spring",stiffness:320,damping:28},className:"relative z-10 flex h-[88vh] w-full max-w-5xl flex-col overflow-hidden rounded-3xl border border-white/15 bg-gradient-to-br from-zinc-900/95 via-zinc-900/90 to-zinc-950/95 shadow-2xl backdrop-blur-2xl",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:259:9",className:"flex shrink-0 items-center justify-between border-b border-white/10 px-5 py-3.5",children:[M.jsx(BJ,{"code-path":"src\\components\\modules\\Inventory.tsx:260:11",onClose:e}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:261:11",className:"flex items-center gap-2",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:262:13",className:"text-xs text-zinc-500",children:"Unit"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:263:13",className:"text-sm font-semibold text-zinc-100",children:t.unitNumber}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:264:13",className:"mx-1 text-zinc-600",children:"·"}),M.jsxs("span",{"code-path":"src\\components\\modules\\Inventory.tsx:265:13",className:"text-xs text-zinc-400",children:["Floor ",t.floor]})]}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:267:11",className:`rounded-full border px-3 py-1 text-xs font-medium capitalize ${s[t.status]}`,children:t.status})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:273:9",className:"flex-1 overflow-y-auto custom-scrollbar",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:275:11",className:"relative h-64 w-full shrink-0 overflow-hidden",children:[M.jsx("img",{"code-path":"src\\components\\modules\\Inventory.tsx:276:13",src:a,alt:t.unitNumber,className:"h-full w-full object-cover"}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:281:13",className:"absolute inset-0 bg-gradient-to-t from-zinc-950/90 via-zinc-950/20 to-transparent"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:283:13",className:"absolute bottom-4 left-5",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:284:15",className:"text-xs text-zinc-400",children:"Starting from"}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:285:15",className:"text-3xl font-bold tracking-tight text-white",children:lp(t.price)}),M.jsxs("p",{"code-path":"src\\components\\modules\\Inventory.tsx:286:15",className:"text-xs text-zinc-400",children:[lp(o)," / m²"]})]})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:291:11",className:"grid gap-5 p-5 md:grid-cols-[1fr_280px]",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:293:13",className:"space-y-5",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:295:15",children:[M.jsxs("h2",{"code-path":"src\\components\\modules\\Inventory.tsx:296:17",className:"mb-1 text-xl font-semibold text-zinc-100",children:[t.type==="penthouse"?"Penthouse":t.type.toUpperCase()," · ",t.unitNumber]}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:299:17",className:"text-sm leading-relaxed text-zinc-400",children:i.description})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:303:15",className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[{icon:M.jsx(hae,{"code-path":"src\\components\\modules\\Inventory.tsx:305:27",className:"h-4 w-4"}),label:"Bedrooms",value:i.bedrooms},{icon:M.jsx(fae,{"code-path":"src\\components\\modules\\Inventory.tsx:306:27",className:"h-4 w-4"}),label:"Bathrooms",value:i.bathrooms},{icon:M.jsx(ose,{"code-path":"src\\components\\modules\\Inventory.tsx:307:27",className:"h-4 w-4"}),label:"Area",value:`${t.area} m²`},{icon:M.jsx(AW,{"code-path":"src\\components\\modules\\Inventory.tsx:308:27",className:"h-4 w-4"}),label:"Floor",value:t.floor}].map(c=>M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:310:19",className:"flex flex-col items-center gap-1.5 rounded-xl border border-white/10 bg-white/5 p-3",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:311:21",className:"text-cyan-300",children:c.icon}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:312:21",className:"text-lg font-semibold text-zinc-100",children:c.value}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:313:21",className:"text-[11px] text-zinc-500",children:c.label})]},c.label))}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:319:15",className:"grid grid-cols-3 gap-2",children:[{icon:M.jsx(kae,{"code-path":"src\\components\\modules\\Inventory.tsx:321:27",className:"h-3.5 w-3.5"}),label:"View",value:t.view},{icon:M.jsx(dL,{"code-path":"src\\components\\modules\\Inventory.tsx:322:27",className:"h-3.5 w-3.5"}),label:"Parking",value:`${i.parking} Bay${i.parking>1?"s":""}`},{icon:M.jsx(zse,{"code-path":"src\\components\\modules\\Inventory.tsx:323:27",className:"h-3.5 w-3.5"}),label:"Type",value:t.type.toUpperCase()}].map(c=>M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:325:19",className:"rounded-xl border border-white/10 bg-white/5 px-3 py-2.5",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:326:21",className:"mb-1 flex items-center gap-1.5 text-zinc-500",children:[c.icon,M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:328:23",className:"text-[10px] uppercase tracking-wide",children:c.label})]}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:330:21",className:"text-sm font-medium text-zinc-200",children:c.value})]},c.label))}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:336:15",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:337:17",className:"mb-2.5 text-xs uppercase tracking-widest text-zinc-500",children:"Features & Amenities"}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:338:17",className:"flex flex-wrap gap-2",children:i.features.map(c=>M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:340:21",className:"rounded-full border border-cyan-300/20 bg-cyan-500/10 px-3 py-1 text-xs text-cyan-200",children:c},c))})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:351:15",className:"grid grid-cols-2 gap-3",children:[M.jsxs("button",{"code-path":"src\\components\\modules\\Inventory.tsx:352:17",type:"button",onClick:()=>{e(),n(t)},className:"flex items-center justify-center gap-2 rounded-xl border border-cyan-300/30 bg-cyan-500/10 py-3 text-sm font-medium text-cyan-100 transition-colors hover:bg-cyan-500/20",children:["3D Viewer ",M.jsx(n4,{"code-path":"src\\components\\modules\\Inventory.tsx:357:29",className:"h-4 w-4"})]}),M.jsxs("button",{"code-path":"src\\components\\modules\\Inventory.tsx:359:17",type:"button",onClick:()=>{e(),r(t)},className:"flex items-center justify-center gap-2 rounded-xl border border-blue-300/30 bg-blue-500/10 py-3 text-sm font-medium text-blue-100 transition-colors hover:bg-blue-500/20",children:["Blueprint Studio ",M.jsx(n4,{"code-path":"src\\components\\modules\\Inventory.tsx:364:36",className:"h-4 w-4"})]})]})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:370:13",className:"space-y-4",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:372:15",className:"rounded-2xl border border-white/10 bg-white/5 p-4",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:373:17",className:"mb-3 text-xs uppercase tracking-widest text-zinc-500",children:"Pricing"}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:374:17",className:"text-2xl font-bold text-zinc-100",children:lp(t.price)}),M.jsxs("p",{"code-path":"src\\components\\modules\\Inventory.tsx:375:17",className:"mt-0.5 text-xs text-zinc-500",children:[lp(o)," per m²"]}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:376:17",className:"my-3 border-t border-white/10"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:377:17",className:"space-y-1.5 text-sm",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:378:19",className:"flex justify-between",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:379:21",className:"text-zinc-400",children:"Unit Area"}),M.jsxs("span",{"code-path":"src\\components\\modules\\Inventory.tsx:380:21",className:"text-zinc-200",children:[t.area," m²"]})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:382:19",className:"flex justify-between",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:383:21",className:"text-zinc-400",children:"Floor"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:384:21",className:"text-zinc-200",children:t.floor})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:386:19",className:"flex justify-between",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:387:21",className:"text-zinc-400",children:"Parking"}),M.jsxs("span",{"code-path":"src\\components\\modules\\Inventory.tsx:388:21",className:"text-zinc-200",children:[i.parking," Bay",i.parking>1?"s":""]})]})]})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:394:15",className:"rounded-2xl border border-white/10 bg-white/5 p-4",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:395:17",className:"mb-3 text-xs uppercase tracking-widest text-zinc-500",children:"Payment Plan"}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:396:17",className:"space-y-2",children:i.paymentPlan.map((c,u)=>M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:398:21",className:"flex items-center gap-3",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:399:23",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-cyan-300/30 bg-cyan-500/10 text-[10px] font-bold text-cyan-300",children:u+1}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:402:23",className:"flex flex-1 items-center justify-between",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:403:25",className:"text-xs text-zinc-400",children:c.label}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:404:25",className:"text-sm font-semibold text-zinc-100",children:c.value})]})]},c.label))})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:412:15",className:"rounded-2xl border border-white/10 bg-white/5 p-4",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:413:17",className:"mb-2 text-xs uppercase tracking-widest text-zinc-500",children:"Availability"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:414:17",className:`inline-block rounded-full border px-3 py-1 text-sm font-medium capitalize ${s[t.status]}`,children:t.status==="available"?"✓ Available Now":t.status==="reserved"?"⏳ Reserved":t.status==="sold"?"✗ Sold":"⏸ On Hold"}),M.jsxs("p",{"code-path":"src\\components\\modules\\Inventory.tsx:419:17",className:"mt-2 text-[11px] text-zinc-600",children:["Last updated: ",t.lastUpdated.toLocaleDateString("en-AE",{day:"numeric",month:"short",year:"numeric"})]})]})]})]})]})]})]})}function cIe({unit:t,onOpen3D:e,onOpenBlueprint:n,onViewDetails:r}){const i=Gv[t.id]??Gv.u1,[a,s]=j.useState(!1),o=t.status==="available"?"rgba(34,197,94,0.15)":t.status==="reserved"?"rgba(245,158,11,0.15)":t.status==="sold"?"rgba(139,92,246,0.12)":"rgba(239,68,68,0.12)";return M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Inventory.tsx:453:5",className:"group relative cursor-pointer overflow-hidden rounded-2xl",style:{background:"rgba(14, 16, 21, 0.72)",border:"1px solid rgba(255,255,255,0.08)",backdropFilter:"blur(18px)",WebkitBackdropFilter:"blur(18px)"},onClick:()=>r(t),whileHover:{y:-3,scale:1.008},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),transition:{type:"spring",stiffness:400,damping:28},children:[M.jsx(yt.div,{"code-path":"src\\components\\modules\\Inventory.tsx:468:7",className:"absolute top-0 right-0 w-32 h-32 rounded-full blur-3xl pointer-events-none",style:{background:o},animate:{opacity:a?1:.5},transition:{duration:.3}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:476:7",className:"relative z-10 p-4",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:479:9",className:"mb-2.5 flex items-start justify-between",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:480:11",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:481:13",className:"mb-1.5 inline-flex items-center gap-1.5 rounded-lg px-2 py-0.5 text-[10px] font-medium tracking-wide",style:{background:"rgba(255,255,255,0.06)",color:"hsl(var(--muted-fg))",border:"1px solid rgba(255,255,255,0.08)"},children:[M.jsx($ae,{"code-path":"src\\components\\modules\\Inventory.tsx:485:15",className:"h-3 w-3",style:{color:"hsl(var(--accent))"}}),"Unit Folder"]}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:488:13",className:"text-2xl font-bold leading-none tracking-tight text-white",children:t.unitNumber}),M.jsxs("p",{"code-path":"src\\components\\modules\\Inventory.tsx:489:13",className:"text-xs mt-1",style:{color:"hsl(var(--muted-fg))"},children:["Floor ",t.floor]})]}),M.jsx(IJ,{"code-path":"src\\components\\modules\\Inventory.tsx:491:11",status:t.status})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:495:9",className:"mb-3 overflow-hidden rounded-xl",style:{border:"1px solid rgba(255,255,255,0.07)"},children:a?M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:502:13",className:"h-36 w-full",style:{background:"hsl(var(--background))"},children:M.jsxs(EJ,{"code-path":"src\\components\\modules\\Inventory.tsx:503:15",camera:{position:[6,5,8],fov:50},children:[M.jsx("ambientLight",{"code-path":"src\\components\\modules\\Inventory.tsx:504:17",intensity:1.2}),M.jsx("directionalLight",{"code-path":"src\\components\\modules\\Inventory.tsx:505:17",intensity:1.4,position:[8,10,6]}),M.jsx(j.Suspense,{"code-path":"src\\components\\modules\\Inventory.tsx:506:17",fallback:null,children:M.jsx(NJ,{"code-path":"src\\components\\modules\\Inventory.tsx:507:19",fit:!0,clip:!0,observe:!0,margin:1.1,children:M.jsx(LJ,{"code-path":"src\\components\\modules\\Inventory.tsx:508:21",url:t.id==="u1"||t.id==="u2"?Rk:Ck})})}),M.jsx(DJ,{"code-path":"src\\components\\modules\\Inventory.tsx:511:17",autoRotate:!0,autoRotateSpeed:1.2,enablePan:!1,enableZoom:!1})]})}):M.jsx("img",{"code-path":"src\\components\\modules\\Inventory.tsx:500:13",src:i,alt:`${t.unitNumber} preview`,className:"h-36 w-full object-cover"})}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:518:9",className:"mb-3 grid grid-cols-3 gap-1.5",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:519:11",className:"tag text-center uppercase",children:t.type}),M.jsxs("span",{"code-path":"src\\components\\modules\\Inventory.tsx:520:11",className:"tag text-center",children:[t.area," m²"]}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:521:11",className:"tag text-center truncate",children:t.view})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:525:9",className:"mb-3",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:526:11",className:"stat-label mb-0.5",children:"Starting from"}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:527:11",className:"text-xl font-bold leading-none tracking-tight text-white",children:lp(t.price)})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:531:9",className:"mb-3 h-px",style:{background:"rgba(255,255,255,0.06)"}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:534:9",className:"grid grid-cols-2 gap-2",children:[M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:535:11",type:"button",onClick:c=>{c.stopPropagation(),e(t)},className:"rounded-xl py-2 text-xs font-semibold transition-all hover:brightness-110 active:scale-95",style:{background:"hsl(var(--accent))",color:"hsl(var(--accent-fg))"},children:"3D Viewer"}),M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:543:11",type:"button",onClick:c=>{c.stopPropagation(),n(t)},className:"rounded-xl py-2 text-xs font-medium transition-all hover:brightness-110 active:scale-95",style:{background:"rgba(255,255,255,0.06)",color:"hsl(var(--muted-fg))",border:"1px solid rgba(255,255,255,0.1)"},children:"Blueprint"})]})]})]})}function uIe({blueprintImage:t,unitNumber:e}){const n=j.useRef(null),r=j.useRef(null),[i,a]=j.useState(1),[s,o]=j.useState(1),[c,u]=j.useState({x:0,y:0}),[h,p]=j.useState(!1),v=j.useRef({mx:0,my:0,ox:0,oy:0}),y=()=>{const I=r.current,k=n.current;if(!I||!k)return;const B=I.naturalWidth,U=I.naturalHeight,z=k.clientHeight,q=k.clientWidth,W=z/U,ee=q/B,Q=Math.min(W,ee)*.92;o(Q),a(Q),u({x:0,y:0})},b=I=>Math.max(s*.5,Math.min(s*8,I)),w=I=>{I.preventDefault();const k=I.deltaY<0?1.12:1/1.12;a(B=>b(B*k))},_=I=>{I.preventDefault(),p(!0),v.current={mx:I.clientX,my:I.clientY,ox:c.x,oy:c.y}},S=I=>{h&&u({x:v.current.ox+(I.clientX-v.current.mx),y:v.current.oy+(I.clientY-v.current.my)})},E=()=>p(!1),T=()=>a(I=>b(I*1.25)),P=()=>a(I=>b(I/1.25)),R=()=>{a(s),u({x:0,y:0})},D=Math.round(i/s*100);return M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:622:5",ref:n,className:"relative h-full w-full overflow-hidden bg-[#060d1f]",onWheel:w,onMouseDown:_,onMouseMove:S,onMouseUp:E,onMouseLeave:E,style:{cursor:h?"grabbing":"grab",userSelect:"none"},children:[M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:633:7",className:"absolute inset-0 flex items-center justify-center",style:{pointerEvents:"none"},children:M.jsx("img",{"code-path":"src\\components\\modules\\Inventory.tsx:637:9",ref:r,src:t,alt:`${e} blueprint`,onLoad:y,draggable:!1,className:"brightness-110 contrast-125 saturate-0",style:{transform:`translate(${c.x}px, ${c.y}px) scale(${i})`,transformOrigin:"center center",maxWidth:"none",maxHeight:"none"}})}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:654:7",className:"absolute right-4 top-4 flex flex-col gap-1.5 z-10",children:[M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:655:9",type:"button",onClick:T,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-white/20 bg-zinc-900/90 text-lg font-light text-zinc-200 backdrop-blur-xl transition-colors hover:bg-zinc-800/90",title:"Zoom In",children:"+"}),M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:661:9",type:"button",onClick:P,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-white/20 bg-zinc-900/90 text-lg font-light text-zinc-200 backdrop-blur-xl transition-colors hover:bg-zinc-800/90",title:"Zoom Out",children:""}),M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:667:9",type:"button",onClick:R,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-white/20 bg-zinc-900/90 text-[10px] text-zinc-300 backdrop-blur-xl transition-colors hover:bg-zinc-800/90",title:"Reset View",children:"⌂"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:676:7",className:"absolute bottom-4 left-4 z-10 rounded-lg border border-white/20 bg-zinc-900/90 px-3 py-1.5 text-xs text-zinc-300 backdrop-blur-xl",children:[D,"%"]})]})}function fIe({unit:t,mode:e,onClose:n}){if(!t||!e)return null;const r=t.id==="u1"||t.id==="u2"?iIe:rIe;return M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Inventory.tsx:696:5",className:"fixed inset-0 z-[90] grid place-items-center p-6",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:697:7",className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:n}),M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Inventory.tsx:698:7",initial:{y:18,scale:.97},animate:{y:0,scale:1},className:"relative z-10 h-[80vh] w-[92vw] overflow-hidden rounded-3xl border border-white/15 bg-zinc-900/90 backdrop-blur-2xl",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:703:9",className:"flex items-center justify-between border-b border-white/10 px-4 py-3",children:[M.jsx(BJ,{"code-path":"src\\components\\modules\\Inventory.tsx:704:11",onClose:n}),M.jsxs("p",{"code-path":"src\\components\\modules\\Inventory.tsx:705:11",className:"text-sm font-medium text-zinc-200",children:[e==="3d"?"3D Unit Studio":"Blueprint Studio"," - ",t.unitNumber]}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:706:11"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:709:9",className:["h-[calc(80vh-56px)]",e==="3d"?"grid grid-rows-[1fr_auto]":"grid grid-rows-[1fr]"].join(" "),children:[M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:710:11",className:"relative bg-[#060d1f]",children:e==="3d"?M.jsx(sIe,{"code-path":"src\\components\\modules\\Inventory.tsx:711:30",unit:t}):M.jsx(uIe,{"code-path":"src\\components\\modules\\Inventory.tsx:711:57",blueprintImage:r,unitNumber:t.unitNumber})}),e==="3d"&&M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:715:13",className:"grid grid-cols-[1fr_280px] gap-3 border-t border-white/10 bg-zinc-950/75 p-3",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:716:15",className:"rounded-xl border border-white/10 bg-white/5 p-3",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:717:17",className:"text-xs uppercase tracking-wide text-zinc-400",children:"Model Viewport"}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:718:17",className:"mt-1 text-sm text-zinc-200",children:"Interactive 3D model loaded from OBJ + MTL + textures."})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:720:15",className:"rounded-xl border border-white/10 bg-white/5 p-3",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:721:17",className:"mb-2 text-xs uppercase tracking-wide text-zinc-400",children:"Controls"}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:722:17",className:"text-xs text-zinc-300",children:"Mouse: rotate, pan, zoom"}),M.jsxs("p",{"code-path":"src\\components\\modules\\Inventory.tsx:723:17",className:"text-xs text-zinc-300",children:["Model source: House ",t.id==="u1"||t.id==="u2"?"2":"1"]})]})]})]})]})]})}function dIe({units:t}){return M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:735:5",className:"relative h-full min-h-[36rem] overflow-hidden rounded-2xl border border-white/10 bg-zinc-900/70",children:[M.jsx("iframe",{"code-path":"src\\components\\modules\\Inventory.tsx:736:7",title:"Dubai Map",src:aIe,className:"h-full w-full border-0",loading:"lazy",referrerPolicy:"no-referrer-when-downgrade"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:737:7",className:"absolute left-3 top-3 rounded-xl border border-white/20 bg-zinc-900/80 px-3 py-2 text-xs text-zinc-200 backdrop-blur-xl",children:[M.jsx(Tx,{"code-path":"src\\components\\modules\\Inventory.tsx:738:9",className:"mr-1 inline h-3.5 w-3.5 text-cyan-300"}),"Google Maps - Inventory Region"]}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:741:7",className:"absolute bottom-3 left-3 right-3 grid grid-cols-2 gap-2 rounded-xl border border-white/15 bg-zinc-900/75 p-2 backdrop-blur-xl",children:t.slice(0,4).map(e=>M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:743:11",className:"rounded-lg border border-white/10 bg-white/5 px-2 py-1 text-xs text-zinc-200",children:[e.unitNumber," - ",lp(e.price)]},e.id))})]})}function hIe({unit:t,onViewDetails:e,onOpen3D:n,onOpenBlueprint:r}){return M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Inventory.tsx:766:5",className:"flex items-center gap-4 px-4 py-3 rounded-xl cursor-pointer transition-colors",style:{background:"hsl(var(--surface-2))"},whileHover:{background:"hsl(var(--surface-3))"},onClick:()=>e(t),layout:!0,children:[M.jsx("img",{"code-path":"src\\components\\modules\\Inventory.tsx:774:7",src:Gv[t.id]??Gv.u1,alt:t.unitNumber,className:"w-14 h-10 rounded-lg object-cover flex-shrink-0",style:{border:"1px solid hsl(var(--border-subtle))"}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:782:7",className:"flex-1 min-w-0 grid grid-cols-5 items-center gap-3",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:783:9",className:"col-span-1",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:784:11",className:"font-bold text-white text-sm leading-none",children:t.unitNumber}),M.jsxs("p",{"code-path":"src\\components\\modules\\Inventory.tsx:785:11",className:"text-xs mt-0.5",style:{color:"hsl(var(--muted-fg))"},children:["Floor ",t.floor]})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:787:9",className:"col-span-1",children:M.jsx(IJ,{"code-path":"src\\components\\modules\\Inventory.tsx:788:11",status:t.status})}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:790:9",className:"col-span-1 flex gap-1.5",children:[M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:791:11",className:"tag",children:t.type}),M.jsxs("span",{"code-path":"src\\components\\modules\\Inventory.tsx:792:11",className:"tag",children:[t.area," m²"]})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:794:9",className:"col-span-1",children:M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:795:11",className:"text-xs",style:{color:"hsl(var(--muted-fg))"},children:t.view})}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:797:9",className:"col-span-1",children:M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:798:11",className:"text-sm font-bold text-white",children:lp(t.price)})})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:803:7",className:"flex items-center gap-2 flex-shrink-0",onClick:i=>i.stopPropagation(),children:[M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:804:9",type:"button",onClick:()=>n(t),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-opacity hover:opacity-90",style:{background:"hsl(var(--accent))",color:"hsl(var(--accent-fg))"},children:"3D"}),M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:812:9",type:"button",onClick:()=>r(t),className:"px-3 py-1.5 rounded-lg text-xs font-medium transition-colors",style:{background:"hsl(var(--surface-3))",color:"hsl(var(--muted-fg))",border:"1px solid hsl(var(--border-subtle))"},children:"Blueprint"})]})]})}function pIe(){const{units:t,filterStatus:e,setFilterStatus:n}=ao(),[r,i]=j.useState(""),[a,s]=j.useState("grid"),[o,c]=j.useState(null),[u,h]=j.useState(null),[p,v]=j.useState(null),y=j.useMemo(()=>({total:t.length,available:t.filter(S=>S.status==="available").length,reserved:t.filter(S=>S.status==="reserved").length,sold:t.filter(S=>S.status==="sold").length}),[t]),b=j.useMemo(()=>t.filter(S=>{const E=S.unitNumber.toLowerCase().includes(r.toLowerCase())||S.view.toLowerCase().includes(r.toLowerCase()),T=e==="all"||S.status===e;return E&&T}),[t,r,e]),w=[{value:"all",label:"All Units"},{value:"available",label:"Available"},{value:"reserved",label:"Reserved"},{value:"sold",label:"Sold"},{value:"hold",label:"On Hold"}],_=[{label:"Total Units",value:y.total,sub:"In portfolio",color:"hsl(var(--accent))",fill:100},{label:"Available",value:y.available,sub:`${Math.round(y.available/y.total*100)||0}% of total`,color:"hsl(var(--success))",fill:y.available/y.total*100},{label:"Reserved",value:y.reserved,sub:`${Math.round(y.reserved/y.total*100)||0}% of total`,color:"hsl(var(--warning))",fill:y.reserved/y.total*100},{label:"Sold",value:y.sold,sub:`${Math.round(y.sold/y.total*100)||0}% of total`,color:"#a78bfa",fill:y.sold/y.total*100}];return M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:892:5",className:"space-y-4",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:895:7",className:"grid grid-cols-4 gap-3",children:_.map(S=>M.jsxs(yt.div,{"code-path":"src\\components\\modules\\Inventory.tsx:897:11",className:"rounded-2xl p-4 relative overflow-hidden",style:{background:"rgba(18,20,26,0.6)",border:"1px solid rgba(255,255,255,0.08)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.3},children:[M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:911:13",className:"absolute top-0 right-0 w-20 h-20 rounded-full blur-2xl opacity-20 -translate-y-1/2 translate-x-1/2 pointer-events-none",style:{background:S.color}}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:917:13",className:"flex items-center justify-between mb-3",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:918:15",className:"text-xs font-medium uppercase tracking-widest",style:{color:"hsl(var(--muted-fg))"},children:S.label}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:921:15",className:"w-2 h-2 rounded-full",style:{background:S.color,boxShadow:`0 0 8px ${S.color}`}})]}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:925:13",className:"text-4xl font-bold text-white leading-none mb-1",children:S.value}),M.jsx("p",{"code-path":"src\\components\\modules\\Inventory.tsx:926:13",className:"text-xs mb-3",style:{color:"hsl(var(--subtle-fg))"},children:S.sub}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:929:13",className:"h-1 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.07)"},children:M.jsx(yt.div,{"code-path":"src\\components\\modules\\Inventory.tsx:930:15",className:"h-full rounded-full",style:{background:S.color},initial:{width:0},animate:{width:`${S.fill}%`},transition:{duration:.8,ease:[.4,0,.2,1]}})})]},S.label))}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:943:7",className:"flex flex-wrap items-center gap-3 p-3 rounded-2xl",style:{background:"rgba(18,20,26,0.6)",border:"1px solid rgba(255,255,255,0.08)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:948:9",className:"relative min-w-[240px] flex-1",children:[M.jsx(Tse,{"code-path":"src\\components\\modules\\Inventory.tsx:949:11",className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:"hsl(var(--muted-fg))"}}),M.jsx("input",{"code-path":"src\\components\\modules\\Inventory.tsx:950:11",type:"text",value:r,onChange:S=>i(S.target.value),placeholder:"Search units...",className:"h-9 w-full rounded-xl pl-9 pr-3 text-sm text-white placeholder:text-zinc-500 focus:outline-none transition-all",style:{background:"hsl(var(--surface-2))",border:"1px solid hsl(var(--border-subtle))"}})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:961:9",className:"flex items-center gap-1.5",children:w.map(S=>M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:963:13",type:"button",onClick:()=>n(S.value),className:"rounded-xl px-3 py-1.5 text-xs font-medium transition-all",style:e===S.value?{background:"hsl(var(--accent))",color:"hsl(var(--accent-fg))"}:{background:"hsl(var(--surface-2))",color:"hsl(var(--muted-fg))",border:"1px solid hsl(var(--border-subtle))"},children:S.label},S.value))}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:979:9",className:"flex items-center rounded-xl p-1 gap-1",style:{background:"hsl(var(--surface-2))",border:"1px solid hsl(var(--border-subtle))"},children:[M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:983:11",type:"button",onClick:()=>s("grid"),className:"p-1.5 rounded-lg transition-all",style:a==="grid"?{background:"hsl(var(--accent))",color:"hsl(var(--accent-fg))"}:{color:"hsl(var(--muted-fg))"},title:"Grid view",children:M.jsx(AW,{"code-path":"src\\components\\modules\\Inventory.tsx:993:13",className:"w-4 h-4"})}),M.jsx("button",{"code-path":"src\\components\\modules\\Inventory.tsx:995:11",type:"button",onClick:()=>s("list"),className:"p-1.5 rounded-lg transition-all",style:a==="list"?{background:"hsl(var(--accent))",color:"hsl(var(--accent-fg))"}:{color:"hsl(var(--muted-fg))"},title:"List view",children:M.jsx(dL,{"code-path":"src\\components\\modules\\Inventory.tsx:1005:13",className:"w-4 h-4"})})]})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:1011:7",className:"grid gap-4 xl:grid-cols-2",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:1012:9",className:"h-[44rem] overflow-y-auto rounded-2xl p-3 custom-scrollbar",style:{background:"hsl(var(--surface))",border:"1px solid hsl(var(--border-subtle))"},children:a==="grid"?M.jsx("div",{"code-path":"src\\components\\modules\\Inventory.tsx:1017:13",className:"grid grid-cols-2 gap-3",children:b.map(S=>M.jsx(cIe,{"code-path":"src\\components\\modules\\Inventory.tsx:1019:17",unit:S,onViewDetails:E=>v(E),onOpen3D:E=>{c(E),h("3d")},onOpenBlueprint:E=>{c(E),h("blueprint")}},S.id))}):M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:1029:13",className:"space-y-2",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Inventory.tsx:1031:15",className:"grid grid-cols-5 gap-3 px-4 py-2 text-xs font-medium uppercase tracking-widest",style:{color:"hsl(var(--subtle-fg))"},children:[M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:1032:17",className:"col-span-1",children:"Unit"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:1033:17",className:"col-span-1",children:"Status"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:1034:17",className:"col-span-1",children:"Type / Area"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:1035:17",className:"col-span-1",children:"View"}),M.jsx("span",{"code-path":"src\\components\\modules\\Inventory.tsx:1036:17",className:"col-span-1",children:"Price"})]}),b.map(S=>M.jsx(hIe,{"code-path":"src\\components\\modules\\Inventory.tsx:1039:17",unit:S,onViewDetails:E=>v(E),onOpen3D:E=>{c(E),h("3d")},onOpenBlueprint:E=>{c(E),h("blueprint")}},S.id))]})}),M.jsx(dIe,{"code-path":"src\\components\\modules\\Inventory.tsx:1051:9",units:b})]}),M.jsx(Bs,{"code-path":"src\\components\\modules\\Inventory.tsx:1054:7",children:p&&M.jsx(lIe,{"code-path":"src\\components\\modules\\Inventory.tsx:1056:11",unit:p,onClose:()=>v(null),onOpen3D:S=>{v(null),c(S),h("3d")},onOpenBlueprint:S=>{v(null),c(S),h("blueprint")}})}),M.jsx(Bs,{"code-path":"src\\components\\modules\\Inventory.tsx:1065:7",children:u&&M.jsx(fIe,{"code-path":"src\\components\\modules\\Inventory.tsx:1067:11",unit:o,mode:u,onClose:()=>{h(null),c(null)}})})]})}const mIe={background:"rgba(14, 16, 21, 0.72)",border:"1px solid rgba(255,255,255,0.08)",backdropFilter:"blur(18px)",WebkitBackdropFilter:"blur(18px)"},Nc={background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"};function Vd({children:t,delay:e=0,className:n=""}){return M.jsx(yt.div,{"code-path":"src\\components\\modules\\Settings.tsx:46:5",className:`rounded-2xl overflow-hidden ${n}`,style:mIe,initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.35,delay:e},children:t})}function Wd({icon:t,title:e,accent:n="hsl(var(--accent))"}){return M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:60:5",className:"flex items-center gap-3 px-6 pt-6 pb-4 mb-2",style:{borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:61:7",className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:`${n}22`,border:`1px solid ${n}33`},children:M.jsx(t,{"code-path":"src\\components\\modules\\Settings.tsx:65:9",className:"w-4 h-4",style:{color:n}})}),M.jsx("h3",{"code-path":"src\\components\\modules\\Settings.tsx:67:7",className:"text-white font-semibold text-base tracking-tight",children:e})]})}function pa({label:t,description:e,children:n,danger:r=!1}){return M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:84:5",className:"flex items-center justify-between px-6 py-3.5",style:{borderBottom:"1px solid rgba(255,255,255,0.04)"},children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:88:7",className:"flex-1 min-w-0 pr-4",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:89:9",className:`text-sm font-medium ${r?"text-red-400":"text-white"}`,children:t}),e&&M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:91:11",className:"text-xs mt-0.5",style:{color:"hsl(var(--muted-fg))"},children:e})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:94:7",className:"flex-shrink-0",children:n})]})}function Bp({enabled:t,onChange:e}){return M.jsx("button",{"code-path":"src\\components\\modules\\Settings.tsx:102:5",type:"button",onClick:()=>e(!t),className:"relative w-11 h-6 rounded-full transition-colors duration-200 flex-shrink-0",style:{background:t?"hsl(var(--accent))":"rgba(255,255,255,0.12)"},children:M.jsx(yt.div,{"code-path":"src\\components\\modules\\Settings.tsx:108:7",className:"absolute top-1 w-4 h-4 rounded-full bg-white shadow-sm",animate:{left:t?"24px":"4px"},transition:{type:"spring",stiffness:500,damping:32}})})}function QM({value:t,onChange:e,options:n}){const[r,i]=j.useState(!1),a=n.find(s=>s.value===t)??n[0];return M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:131:5",className:"relative",children:[M.jsxs("button",{"code-path":"src\\components\\modules\\Settings.tsx:132:7",type:"button",onClick:()=>i(s=>!s),className:"flex items-center gap-2 rounded-xl px-3 py-2 text-sm text-white transition-colors min-w-[140px] justify-between",style:Nc,children:[M.jsx("span",{"code-path":"src\\components\\modules\\Settings.tsx:138:9",children:a.label}),M.jsx(_W,{"code-path":"src\\components\\modules\\Settings.tsx:139:9",className:"w-3.5 h-3.5 transition-transform flex-shrink-0",style:{color:"hsl(var(--muted-fg))",transform:r?"rotate(180deg)":"rotate(0deg)"}})]}),M.jsx(Bs,{"code-path":"src\\components\\modules\\Settings.tsx:144:7",children:r&&M.jsx(yt.div,{"code-path":"src\\components\\modules\\Settings.tsx:146:11",className:"absolute right-0 top-full mt-1.5 z-50 rounded-xl overflow-hidden min-w-[160px]",style:{background:"rgba(18,20,26,0.96)",border:"1px solid rgba(255,255,255,0.1)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",boxShadow:"0 16px 48px rgba(0,0,0,0.5)"},initial:{opacity:0,y:-6,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.97},transition:{duration:.15},children:n.map(s=>M.jsx("button",{"code-path":"src\\components\\modules\\Settings.tsx:161:15",type:"button",onClick:()=>{e(s.value),i(!1)},className:"w-full text-left px-4 py-2.5 text-sm transition-colors",style:{color:s.value===t?"hsl(var(--accent))":"rgba(255,255,255,0.85)",background:s.value===t?"hsl(var(--accent) / 0.1)":"transparent"},onMouseEnter:o=>{s.value!==t&&(o.currentTarget.style.background="rgba(255,255,255,0.06)")},onMouseLeave:o=>{s.value!==t&&(o.currentTarget.style.background="transparent")},children:s.label},s.value))})}),r&&M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:179:16",className:"fixed inset-0 z-40",onClick:()=>i(!1)})]})}function zb({children:t,onClick:e,danger:n=!1}){return M.jsx(yt.button,{"code-path":"src\\components\\modules\\Settings.tsx:187:5",type:"button",onClick:e,className:"px-4 py-2 rounded-xl text-sm font-medium transition-colors",style:n?{background:"rgba(239,68,68,0.12)",color:"#f87171",border:"1px solid rgba(239,68,68,0.2)"}:{...Nc,color:"rgba(255,255,255,0.8)"},whileHover:{scale:1.02},whileTap:{scale:.97},children:t})}function $D({type:t="text",defaultValue:e,placeholder:n}){return M.jsx("input",{"code-path":"src\\components\\modules\\Settings.tsx:206:5",type:t,defaultValue:e,placeholder:n,className:"rounded-xl px-3 py-2 text-sm text-white w-48 focus:outline-none transition-all",style:{...Nc,caretColor:"hsl(var(--accent))"},onFocus:r=>{r.currentTarget.style.border="1px solid hsl(var(--accent) / 0.4)"},onBlur:r=>{r.currentTarget.style.border="1px solid rgba(255,255,255,0.07)"}})}function gIe(){const{status:t,updateStatus:e}=ao();return M.jsxs(Vd,{"code-path":"src\\components\\modules\\Settings.tsx:226:5",delay:0,children:[M.jsx(Wd,{"code-path":"src\\components\\modules\\Settings.tsx:227:7",icon:Pse,title:"System Status"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:228:7",className:"px-6 pb-6 space-y-3",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:230:9",className:"flex items-center justify-between p-4 rounded-xl",style:Nc,children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:231:11",className:"flex items-center gap-3",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:232:13",className:"relative w-3 h-3",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:233:15",className:`w-3 h-3 rounded-full ${t.isConnected?"bg-green-500":"bg-red-500"}`}),t.isConnected&&M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:234:38",className:"absolute inset-0 rounded-full bg-green-500 status-pulse"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:236:13",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:237:15",className:"text-white text-sm font-medium",children:"Backend Connection"}),M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:238:15",className:"text-xs mt-0.5",style:{color:"hsl(var(--muted-fg))"},children:t.isConnected?"Connected to local server":"Connection lost"})]})]}),M.jsx("span",{"code-path":"src\\components\\modules\\Settings.tsx:243:11",className:"px-2.5 py-1 rounded-full text-[11px] font-medium",style:t.isConnected?{background:"rgba(34,197,94,0.15)",color:"#86efac"}:{background:"rgba(239,68,68,0.15)",color:"#fca5a5"},children:t.serverStatus.toUpperCase()})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:255:9",className:"grid grid-cols-2 gap-3",children:[{label:"Version",value:t.version},{label:"Last Sync",value:t.lastSync.toLocaleTimeString()}].map(({label:n,value:r})=>M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:260:13",className:"p-3 rounded-xl",style:Nc,children:[M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:261:15",className:"text-xs mb-1",style:{color:"hsl(var(--muted-fg))"},children:n}),M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:262:15",className:"text-white text-sm font-medium",children:r})]},n))}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:268:9",className:"flex gap-3",children:[M.jsxs(yt.button,{"code-path":"src\\components\\modules\\Settings.tsx:269:11",type:"button",className:"flex-1 py-2.5 rounded-xl text-sm font-medium flex items-center justify-center gap-2 transition-colors",style:Nc,whileHover:{scale:1.02},whileTap:{scale:.97},onClick:()=>e({serverStatus:"syncing"}),children:[M.jsx(MW,{"code-path":"src\\components\\modules\\Settings.tsx:277:13",className:"w-4 h-4",style:{color:"hsl(var(--accent))"}}),M.jsx("span",{"code-path":"src\\components\\modules\\Settings.tsx:278:13",className:"text-white",children:"Sync Now"})]}),M.jsxs(yt.button,{"code-path":"src\\components\\modules\\Settings.tsx:280:11",type:"button",className:"flex-1 py-2.5 rounded-xl text-sm font-medium flex items-center justify-center gap-2 transition-colors",style:Nc,whileHover:{scale:1.02},whileTap:{scale:.97},children:[M.jsx(_se,{"code-path":"src\\components\\modules\\Settings.tsx:287:13",className:"w-4 h-4",style:{color:"hsl(var(--muted-fg))"}}),M.jsx("span",{"code-path":"src\\components\\modules\\Settings.tsx:288:13",className:"text-white",children:"Restart"})]})]})]})]})}function vIe(){const[t,e]=j.useState(!1),[n,r]=j.useState(!1),[i,a]=j.useState(!1),s="VLC-7F3A-9B2D",o="192.168.1.42:8765",c=()=>{r(!0),setTimeout(()=>{r(!1),e(!0)},2e3)},u=h=>{navigator.clipboard.writeText(h),a(!0),setTimeout(()=>a(!1),1800)};return M.jsxs(Vd,{"code-path":"src\\components\\modules\\Settings.tsx:316:5",delay:.05,children:[M.jsx(Wd,{"code-path":"src\\components\\modules\\Settings.tsx:317:7",icon:s4,title:"iOS App / Device",accent:"#a78bfa"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:318:7",className:"px-6 pb-6 space-y-3",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:321:9",className:"flex items-center justify-between p-4 rounded-xl",style:Nc,children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:322:11",className:"flex items-center gap-3",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:323:13",className:"relative w-3 h-3",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:324:15",className:`w-3 h-3 rounded-full ${t?"bg-green-500":"bg-zinc-500"}`}),t&&M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:325:26",className:"absolute inset-0 rounded-full bg-green-500 status-pulse"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:327:13",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:328:15",className:"text-white text-sm font-medium",children:t?"iPhone Paired":"No Device Paired"}),M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:329:15",className:"text-xs mt-0.5",style:{color:"hsl(var(--muted-fg))"},children:t?"Ahmeds iPhone 15 Pro":"Open Velocity iOS app to connect"})]})]}),t?M.jsx("span",{"code-path":"src\\components\\modules\\Settings.tsx:335:15",className:"px-2.5 py-1 rounded-full text-[11px] font-medium",style:{background:"rgba(34,197,94,0.15)",color:"#86efac"},children:"CONNECTED"}):M.jsx(RW,{"code-path":"src\\components\\modules\\Settings.tsx:336:15",className:"w-4 h-4",style:{color:"hsl(var(--muted-fg))"}})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:341:9",className:"p-4 rounded-xl space-y-3",style:Nc,children:[M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:342:11",className:"text-xs font-medium uppercase tracking-widest",style:{color:"hsl(var(--muted-fg))"},children:"Pairing Code"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:343:11",className:"flex items-center justify-between",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:344:13",className:"text-2xl font-bold tracking-[0.2em] text-white font-mono",children:s}),M.jsx("button",{"code-path":"src\\components\\modules\\Settings.tsx:345:13",type:"button",onClick:()=>u(s),className:"p-2 rounded-lg transition-colors",style:{background:"rgba(255,255,255,0.06)"},children:i?M.jsx(r4,{"code-path":"src\\components\\modules\\Settings.tsx:351:25",className:"w-4 h-4 text-green-400"}):M.jsx(i4,{"code-path":"src\\components\\modules\\Settings.tsx:351:72",className:"w-4 h-4",style:{color:"hsl(var(--muted-fg))"}})})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:354:11",className:"flex items-center gap-2",children:[M.jsxs("p",{"code-path":"src\\components\\modules\\Settings.tsx:355:13",className:"text-xs",style:{color:"hsl(var(--muted-fg))"},children:["Local IP: ",M.jsx("span",{"code-path":"src\\components\\modules\\Settings.tsx:355:88",className:"text-white font-mono",children:o})]}),M.jsx("button",{"code-path":"src\\components\\modules\\Settings.tsx:356:13",type:"button",onClick:()=>u(o),className:"p-1 rounded transition-colors hover:opacity-70",children:M.jsx(i4,{"code-path":"src\\components\\modules\\Settings.tsx:357:15",className:"w-3 h-3",style:{color:"hsl(var(--muted-fg))"}})})]})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:363:9",className:"flex gap-3",children:[M.jsx(yt.button,{"code-path":"src\\components\\modules\\Settings.tsx:364:11",type:"button",onClick:c,disabled:n||t,className:"flex-1 py-2.5 rounded-xl text-sm font-semibold flex items-center justify-center gap-2 transition-all",style:t?{background:"rgba(34,197,94,0.15)",color:"#86efac",border:"1px solid rgba(34,197,94,0.2)"}:{background:"hsl(var(--accent))",color:"hsl(var(--accent-fg))"},whileHover:t?{}:{scale:1.02},whileTap:t?{}:{scale:.97},children:n?M.jsxs(M.Fragment,{children:[M.jsx(MW,{"code-path":"src\\components\\modules\\Settings.tsx:377:17",className:"w-4 h-4 animate-spin"})," Pairing…"]}):t?M.jsxs(M.Fragment,{children:[M.jsx(r4,{"code-path":"src\\components\\modules\\Settings.tsx:379:17",className:"w-4 h-4"})," Paired"]}):M.jsxs(M.Fragment,{children:[M.jsx(s4,{"code-path":"src\\components\\modules\\Settings.tsx:381:17",className:"w-4 h-4"})," Pair Device"]})}),t&&M.jsx(zb,{"code-path":"src\\components\\modules\\Settings.tsx:385:13",onClick:()=>e(!1),danger:!0,children:"Unpair"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:390:9",className:"flex items-center justify-between pt-1",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:391:11",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:392:13",className:"text-sm font-medium text-white",children:"Push Notifications"}),M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:393:13",className:"text-xs mt-0.5",style:{color:"hsl(var(--muted-fg))"},children:"Send alerts to paired iPhone"})]}),M.jsx(Bp,{"code-path":"src\\components\\modules\\Settings.tsx:395:11",enabled:t,onChange:()=>{}})]})]})]})}function yIe(){const{user:t}=ao(),e=t?.name.split(" ").map(n=>n[0]).join("")??"AA";return M.jsxs(Vd,{"code-path":"src\\components\\modules\\Settings.tsx:408:5",delay:.1,children:[M.jsx(Wd,{"code-path":"src\\components\\modules\\Settings.tsx:409:7",icon:CW,title:"Profile"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:410:7",className:"px-6 pb-6",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:411:9",className:"flex items-center gap-4 mb-5 p-4 rounded-xl",style:Nc,children:[M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:412:11",className:"w-14 h-14 rounded-full flex items-center justify-center flex-shrink-0 text-white text-lg font-bold",style:{background:"hsl(var(--accent))",boxShadow:"0 0 20px hsl(var(--accent) / 0.3)"},children:e}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:418:11",children:[M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:419:13",className:"text-white font-semibold",children:t?.name}),M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:420:13",className:"text-xs mt-0.5",style:{color:"hsl(var(--muted-fg))"},children:t?.role==="sales_director"?"Sales Director":"Administrator"})]})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:425:9",className:"space-y-0 -mx-6",children:[M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:426:11",label:"Full Name",description:"Your display name",children:M.jsx($D,{"code-path":"src\\components\\modules\\Settings.tsx:427:13",defaultValue:t?.name})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:429:11",label:"Email",description:"Notification email",children:M.jsx($D,{"code-path":"src\\components\\modules\\Settings.tsx:430:13",type:"email",defaultValue:"ahmed@velocity.re"})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:432:11",label:"Phone",description:"Contact number",children:M.jsx($D,{"code-path":"src\\components\\modules\\Settings.tsx:433:13",type:"tel",defaultValue:"+971 50 123 4567"})})]})]})]})}function xIe(){const[t,e]=j.useState({newLeads:!0,sentimentAlerts:!0,viewings:!0,systemUpdates:!1,emailDigest:!0}),n=[{key:"newLeads",label:"New Lead Alerts",desc:"Get notified when a new lead is captured"},{key:"sentimentAlerts",label:"Sentiment Alerts",desc:"Alert when visitor sentiment drops"},{key:"viewings",label:"Viewing Reminders",desc:"Reminders for scheduled viewings"},{key:"systemUpdates",label:"System Updates",desc:"Notifications about system maintenance"},{key:"emailDigest",label:"Daily Email Digest",desc:"Summary of daily activity"}];return M.jsxs(Vd,{"code-path":"src\\components\\modules\\Settings.tsx:453:5",delay:.15,children:[M.jsx(Wd,{"code-path":"src\\components\\modules\\Settings.tsx:454:7",icon:mae,title:"Notifications"}),M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:455:7",className:"-mx-0",children:n.map(({key:r,label:i,desc:a})=>M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:457:11",label:i,description:a,children:M.jsx(Bp,{"code-path":"src\\components\\modules\\Settings.tsx:458:13",enabled:t[r],onChange:s=>e({...t,[r]:s})})},r))})]})}function bIe(){const[t,e]=j.useState(!0),[n,r]=j.useState(!0),[i,a]=j.useState("30");return M.jsxs(Vd,{"code-path":"src\\components\\modules\\Settings.tsx:473:5",delay:.2,children:[M.jsx(Wd,{"code-path":"src\\components\\modules\\Settings.tsx:474:7",icon:Bse,title:"Security",accent:"#f59e0b"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:475:7",children:[M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:476:9",label:"Two-Factor Authentication",description:"Require OTP for login",children:M.jsx(Bp,{"code-path":"src\\components\\modules\\Settings.tsx:477:11",enabled:t,onChange:e})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:479:9",label:"Biometric Login",description:"Use FaceID for authentication",children:M.jsx(Bp,{"code-path":"src\\components\\modules\\Settings.tsx:480:11",enabled:n,onChange:r})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:482:9",label:"Change Password",description:"Update your password",children:M.jsx(zb,{"code-path":"src\\components\\modules\\Settings.tsx:483:11",children:"Change"})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:485:9",label:"API Keys",description:"Manage API access",children:M.jsx(zb,{"code-path":"src\\components\\modules\\Settings.tsx:486:11",children:"Manage"})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:488:9",label:"Session Timeout",description:"Auto-logout after inactivity",children:M.jsx(QM,{"code-path":"src\\components\\modules\\Settings.tsx:489:11",value:i,onChange:a,options:[{value:"15",label:"15 minutes"},{value:"30",label:"30 minutes"},{value:"60",label:"1 hour"},{value:"never",label:"Never"}]})})]})]})}function _Ie(){const[t,e]=j.useState(!1),[n,r]=j.useState(!1),[i,a]=j.useState("en"),[s,o]=j.useState("dxb");return M.jsxs(Vd,{"code-path":"src\\components\\modules\\Settings.tsx:513:5",delay:.25,children:[M.jsx(Wd,{"code-path":"src\\components\\modules\\Settings.tsx:514:7",icon:yse,title:"Display"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:515:7",children:[M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:516:9",label:"Reduced Motion",description:"Minimize animations",children:M.jsx(Bp,{"code-path":"src\\components\\modules\\Settings.tsx:517:11",enabled:t,onChange:e})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:519:9",label:"Compact Mode",description:"Show more content per screen",children:M.jsx(Bp,{"code-path":"src\\components\\modules\\Settings.tsx:520:11",enabled:n,onChange:r})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:522:9",label:"Language",description:"Interface language",children:M.jsx(QM,{"code-path":"src\\components\\modules\\Settings.tsx:523:11",value:i,onChange:a,options:[{value:"en",label:"English"},{value:"ar",label:"العربية"}]})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:532:9",label:"Timezone",description:"Local time display",children:M.jsx(QM,{"code-path":"src\\components\\modules\\Settings.tsx:533:11",value:s,onChange:o,options:[{value:"dxb",label:"Dubai (GMT+4)"},{value:"ruh",label:"Riyadh (GMT+3)"},{value:"lon",label:"London (GMT+0)"}]})})]})]})}function SIe(){const[t,e]=j.useState("90");return M.jsxs(Vd,{"code-path":"src\\components\\modules\\Settings.tsx:553:5",delay:.3,children:[M.jsx(Wd,{"code-path":"src\\components\\modules\\Settings.tsx:554:7",icon:Gae,title:"Data & Privacy"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:555:7",children:[M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:556:9",label:"Auto-Backup",description:"Automatically backup data daily",children:M.jsx(Bp,{"code-path":"src\\components\\modules\\Settings.tsx:557:11",enabled:!0,onChange:()=>{}})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:559:9",label:"Data Retention",description:"How long to keep visitor data",children:M.jsx(QM,{"code-path":"src\\components\\modules\\Settings.tsx:560:11",value:t,onChange:e,options:[{value:"30",label:"30 days"},{value:"90",label:"90 days"},{value:"180",label:"6 months"},{value:"365",label:"1 year"}]})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:571:9",label:"Export Data",description:"Download all your data",children:M.jsx(zb,{"code-path":"src\\components\\modules\\Settings.tsx:572:11",children:"Export"})}),M.jsx(pa,{"code-path":"src\\components\\modules\\Settings.tsx:574:9",label:"Clear Cache",description:"Remove temporary files",danger:!0,children:M.jsx(zb,{"code-path":"src\\components\\modules\\Settings.tsx:575:11",danger:!0,children:"Clear"})})]})]})}function AIe(){return M.jsxs(Vd,{"code-path":"src\\components\\modules\\Settings.tsx:585:5",delay:.35,children:[M.jsx(Wd,{"code-path":"src\\components\\modules\\Settings.tsx:586:7",icon:RW,title:"About"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:587:7",className:"px-6 pb-6 text-center",children:[M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:588:9",className:"w-16 h-16 rounded-2xl flex items-center justify-center mx-auto mb-4 text-white text-2xl font-bold",style:{background:"hsl(var(--accent))",boxShadow:"0 0 28px hsl(var(--accent) / 0.35)"},children:"V"}),M.jsx("h4",{"code-path":"src\\components\\modules\\Settings.tsx:594:9",className:"text-white font-semibold text-lg mb-1",children:"Velocity WebOS"}),M.jsx("p",{"code-path":"src\\components\\modules\\Settings.tsx:595:9",className:"text-sm mb-4",style:{color:"hsl(var(--muted-fg))"},children:"Real Estate Operating System"}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:596:9",className:"flex items-center justify-center gap-2 text-xs mb-6",style:{color:"hsl(var(--subtle-fg))"},children:[M.jsx("span",{"code-path":"src\\components\\modules\\Settings.tsx:597:11",children:"Version 2.1.0"}),M.jsx("span",{"code-path":"src\\components\\modules\\Settings.tsx:598:11",children:"•"}),M.jsx("span",{"code-path":"src\\components\\modules\\Settings.tsx:599:11",children:"Build 2024.02.18"})]}),M.jsx("div",{"code-path":"src\\components\\modules\\Settings.tsx:601:9",className:"flex items-center justify-center gap-4",children:["Terms of Service","Privacy Policy","Documentation"].map(t=>M.jsx("button",{"code-path":"src\\components\\modules\\Settings.tsx:603:13",type:"button",className:"text-sm transition-colors hover:opacity-80",style:{color:"hsl(var(--accent))"},children:t},t))})]})]})}function wIe(){return M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:616:5",className:"space-y-4",children:[M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:618:7",className:"grid grid-cols-2 gap-4",children:[M.jsx(gIe,{"code-path":"src\\components\\modules\\Settings.tsx:619:9"}),M.jsx(vIe,{"code-path":"src\\components\\modules\\Settings.tsx:620:9"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:624:7",className:"grid grid-cols-2 gap-4",children:[M.jsx(yIe,{"code-path":"src\\components\\modules\\Settings.tsx:625:9"}),M.jsx(xIe,{"code-path":"src\\components\\modules\\Settings.tsx:626:9"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:630:7",className:"grid grid-cols-2 gap-4",children:[M.jsx(bIe,{"code-path":"src\\components\\modules\\Settings.tsx:631:9"}),M.jsx(_Ie,{"code-path":"src\\components\\modules\\Settings.tsx:632:9"})]}),M.jsxs("div",{"code-path":"src\\components\\modules\\Settings.tsx:636:7",className:"grid grid-cols-2 gap-4",children:[M.jsx(SIe,{"code-path":"src\\components\\modules\\Settings.tsx:637:9"}),M.jsx(AIe,{"code-path":"src\\components\\modules\\Settings.tsx:638:9"})]})]})}function Vn(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}function b1(t,e=[]){let n=[];function r(a,s){const o=j.createContext(s),c=n.length;n=[...n,s];const u=p=>{const{scope:v,children:y,...b}=p,w=v?.[t]?.[c]||o,_=j.useMemo(()=>b,Object.values(b));return M.jsx(w.Provider,{value:_,children:y})};u.displayName=a+"Provider";function h(p,v){const y=v?.[t]?.[c]||o,b=j.useContext(y);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[u,h]}const i=()=>{const a=n.map(s=>j.createContext(s));return function(o){const c=o?.[t]||a;return j.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return i.scopeName=t,[r,MIe(i,...e)]}function MIe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:u})=>{const p=c(a)[`__scope${u}`];return{...o,...p}},{});return j.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}var EIe=NB[" useInsertionEffect ".trim().toString()]||Ul;function FJ({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,a,s]=TIe({defaultProp:e,onChange:n}),o=t!==void 0,c=o?t:i;{const h=j.useRef(t!==void 0);j.useEffect(()=>{const p=h.current;p!==o&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=o},[o,r])}const u=j.useCallback(h=>{if(o){const p=CIe(h)?h(t):h;p!==t&&s.current?.(p)}else a(h)},[o,t,a,s]);return[c,u]}function TIe({defaultProp:t,onChange:e}){const[n,r]=j.useState(t),i=j.useRef(n),a=j.useRef(e);return EIe(()=>{a.current=e},[e]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function CIe(t){return typeof t=="function"}function RIe(t){const e=OIe(t),n=j.forwardRef((r,i)=>{const{children:a,...s}=r,o=j.Children.toArray(a),c=o.find(DIe);if(c){const u=c.props.children,h=o.map(p=>p===c?j.Children.count(u)>1?j.Children.only(null):j.isValidElement(u)?u.props.children:null:p);return M.jsx(e,{...s,ref:i,children:j.isValidElement(u)?j.cloneElement(u,void 0,h):null})}return M.jsx(e,{...s,ref:i,children:a})});return n.displayName=`${t}.Slot`,n}function OIe(t){const e=j.forwardRef((n,r)=>{const{children:i,...a}=n;if(j.isValidElement(i)){const s=IIe(i),o=NIe(a,i.props);return i.type!==j.Fragment&&(o.ref=r?Gp(r,s):s),j.cloneElement(i,o)}return j.Children.count(i)>1?j.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var PIe=Symbol("radix.slottable");function DIe(t){return j.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===PIe}function NIe(t,e){const n={...e};for(const r in e){const i=t[r],a=e[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const c=a(...o);return i(...o),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...t,...n}}function IIe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var BIe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],us=BIe.reduce((t,e)=>{const n=RIe(`Primitive.${e}`),r=j.forwardRef((i,a)=>{const{asChild:s,...o}=i,c=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),M.jsx(c,{...o,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function UJ(t,e){t&&o5.flushSync(()=>t.dispatchEvent(e))}function rV(t){const e=LIe(t),n=j.forwardRef((r,i)=>{const{children:a,...s}=r,o=j.Children.toArray(a),c=o.find(FIe);if(c){const u=c.props.children,h=o.map(p=>p===c?j.Children.count(u)>1?j.Children.only(null):j.isValidElement(u)?u.props.children:null:p);return M.jsx(e,{...s,ref:i,children:j.isValidElement(u)?j.cloneElement(u,void 0,h):null})}return M.jsx(e,{...s,ref:i,children:a})});return n.displayName=`${t}.Slot`,n}function LIe(t){const e=j.forwardRef((n,r)=>{const{children:i,...a}=n;if(j.isValidElement(i)){const s=jIe(i),o=UIe(a,i.props);return i.type!==j.Fragment&&(o.ref=r?Gp(r,s):s),j.cloneElement(i,o)}return j.Children.count(i)>1?j.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var kIe=Symbol("radix.slottable");function FIe(t){return j.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===kIe}function UIe(t,e){const n={...e};for(const r in e){const i=t[r],a=e[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const c=a(...o);return i(...o),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...t,...n}}function jIe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function jJ(t){const e=t+"CollectionProvider",[n,r]=b1(e),[i,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=w=>{const{scope:_,children:S}=w,E=fe.useRef(null),T=fe.useRef(new Map).current;return M.jsx(i,{scope:_,itemMap:T,collectionRef:E,children:S})};s.displayName=e;const o=t+"CollectionSlot",c=rV(o),u=fe.forwardRef((w,_)=>{const{scope:S,children:E}=w,T=a(o,S),P=Ls(_,T.collectionRef);return M.jsx(c,{ref:P,children:E})});u.displayName=o;const h=t+"CollectionItemSlot",p="data-radix-collection-item",v=rV(h),y=fe.forwardRef((w,_)=>{const{scope:S,children:E,...T}=w,P=fe.useRef(null),R=Ls(_,P),D=a(h,S);return fe.useEffect(()=>(D.itemMap.set(P,{ref:P,...T}),()=>{D.itemMap.delete(P)})),M.jsx(v,{[p]:"",ref:R,children:E})});y.displayName=h;function b(w){const _=a(t+"CollectionConsumer",w);return fe.useCallback(()=>{const E=_.collectionRef.current;if(!E)return[];const T=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(_.itemMap.values()).sort((D,I)=>T.indexOf(D.ref.current)-T.indexOf(I.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:s,Slot:u,ItemSlot:y},b,r]}var zIe=j.createContext(void 0);function zJ(t){const e=j.useContext(zIe);return t||e||"ltr"}function GIe(t,e=globalThis?.document){const n=Hc(t);j.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var HIe="DismissableLayer",MB="dismissableLayer.update",VIe="dismissableLayer.pointerDownOutside",WIe="dismissableLayer.focusOutside",iV,GJ=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),HJ=j.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:o,...c}=t,u=j.useContext(GJ),[h,p]=j.useState(null),v=h?.ownerDocument??globalThis?.document,[,y]=j.useState({}),b=Ls(e,I=>p(I)),w=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(_),E=h?w.indexOf(h):-1,T=u.layersWithOutsidePointerEventsDisabled.size>0,P=E>=S,R=XIe(I=>{const k=I.target,B=[...u.branches].some(U=>U.contains(k));!P||B||(i?.(I),s?.(I),I.defaultPrevented||o?.())},v),D=KIe(I=>{const k=I.target;[...u.branches].some(U=>U.contains(k))||(a?.(I),s?.(I),I.defaultPrevented||o?.())},v);return GIe(I=>{E===u.layers.size-1&&(r?.(I),!I.defaultPrevented&&o&&(I.preventDefault(),o()))},v),j.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(iV=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),aV(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=iV)}},[h,v,n,u]),j.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),aV())},[h,u]),j.useEffect(()=>{const I=()=>y({});return document.addEventListener(MB,I),()=>document.removeEventListener(MB,I)},[]),M.jsx(us.div,{...c,ref:b,style:{pointerEvents:T?P?"auto":"none":void 0,...t.style},onFocusCapture:Vn(t.onFocusCapture,D.onFocusCapture),onBlurCapture:Vn(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Vn(t.onPointerDownCapture,R.onPointerDownCapture)})});HJ.displayName=HIe;var qIe="DismissableLayerBranch",$Ie=j.forwardRef((t,e)=>{const n=j.useContext(GJ),r=j.useRef(null),i=Ls(e,r);return j.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),M.jsx(us.div,{...t,ref:i})});$Ie.displayName=qIe;function XIe(t,e=globalThis?.document){const n=Hc(t),r=j.useRef(!1),i=j.useRef(()=>{});return j.useEffect(()=>{const a=o=>{if(o.target&&!r.current){let c=function(){VJ(VIe,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",a),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function KIe(t,e=globalThis?.document){const n=Hc(t),r=j.useRef(!1);return j.useEffect(()=>{const i=a=>{a.target&&!r.current&&VJ(WIe,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function aV(){const t=new CustomEvent(MB);document.dispatchEvent(t)}function VJ(t,e,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?UJ(i,a):i.dispatchEvent(a)}var XD=0;function YIe(){j.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??sV()),document.body.insertAdjacentElement("beforeend",t[1]??sV()),XD++,()=>{XD===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),XD--}},[])}function sV(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var KD="focusScope.autoFocusOnMount",YD="focusScope.autoFocusOnUnmount",oV={bubbles:!1,cancelable:!0},JIe="FocusScope",WJ=j.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=t,[o,c]=j.useState(null),u=Hc(i),h=Hc(a),p=j.useRef(null),v=Ls(e,w=>c(w)),y=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let w=function(T){if(y.paused||!o)return;const P=T.target;o.contains(P)?p.current=P:pd(p.current,{select:!0})},_=function(T){if(y.paused||!o)return;const P=T.relatedTarget;P!==null&&(o.contains(P)||pd(p.current,{select:!0}))},S=function(T){if(document.activeElement===document.body)for(const R of T)R.removedNodes.length>0&&pd(o)};document.addEventListener("focusin",w),document.addEventListener("focusout",_);const E=new MutationObserver(S);return o&&E.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",_),E.disconnect()}}},[r,o,y.paused]),j.useEffect(()=>{if(o){cV.add(y);const w=document.activeElement;if(!o.contains(w)){const S=new CustomEvent(KD,oV);o.addEventListener(KD,u),o.dispatchEvent(S),S.defaultPrevented||(ZIe(rBe(qJ(o)),{select:!0}),document.activeElement===w&&pd(o))}return()=>{o.removeEventListener(KD,u),setTimeout(()=>{const S=new CustomEvent(YD,oV);o.addEventListener(YD,h),o.dispatchEvent(S),S.defaultPrevented||pd(w??document.body,{select:!0}),o.removeEventListener(YD,h),cV.remove(y)},0)}}},[o,u,h,y]);const b=j.useCallback(w=>{if(!n&&!r||y.paused)return;const _=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(_&&S){const E=w.currentTarget,[T,P]=QIe(E);T&&P?!w.shiftKey&&S===P?(w.preventDefault(),n&&pd(T,{select:!0})):w.shiftKey&&S===T&&(w.preventDefault(),n&&pd(P,{select:!0})):S===E&&w.preventDefault()}},[n,r,y.paused]);return M.jsx(us.div,{tabIndex:-1,...s,ref:v,onKeyDown:b})});WJ.displayName=JIe;function ZIe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(pd(r,{select:e}),document.activeElement!==n)return}function QIe(t){const e=qJ(t),n=lV(e,t),r=lV(e.reverse(),t);return[n,r]}function qJ(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function lV(t,e){for(const n of t)if(!eBe(n,{upTo:e}))return n}function eBe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function tBe(t){return t instanceof HTMLInputElement&&"select"in t}function pd(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&tBe(t)&&e&&t.select()}}var cV=nBe();function nBe(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=uV(t,e),t.unshift(e)},remove(e){t=uV(t,e),t[0]?.resume()}}}function uV(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function rBe(t){return t.filter(e=>e.tagName!=="A")}var iBe=NB[" useId ".trim().toString()]||(()=>{}),aBe=0;function EB(t){const[e,n]=j.useState(iBe());return Ul(()=>{n(r=>r??String(aBe++))},[t]),t||(e?`radix-${e}`:"")}const sBe=["top","right","bottom","left"],Nd=Math.min,Ys=Math.max,eE=Math.round,wA=Math.floor,Uc=t=>({x:t,y:t}),oBe={left:"right",right:"left",bottom:"top",top:"bottom"},lBe={start:"end",end:"start"};function TB(t,e,n){return Ys(t,Nd(e,n))}function lf(t,e){return typeof t=="function"?t(e):t}function cf(t){return t.split("-")[0]}function py(t){return t.split("-")[1]}function Ok(t){return t==="x"?"y":"x"}function Pk(t){return t==="y"?"height":"width"}const cBe=new Set(["top","bottom"]);function Ic(t){return cBe.has(cf(t))?"y":"x"}function Dk(t){return Ok(Ic(t))}function uBe(t,e,n){n===void 0&&(n=!1);const r=py(t),i=Dk(t),a=Pk(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=tE(s)),[s,tE(s)]}function fBe(t){const e=tE(t);return[CB(t),e,CB(e)]}function CB(t){return t.replace(/start|end/g,e=>lBe[e])}const fV=["left","right"],dV=["right","left"],dBe=["top","bottom"],hBe=["bottom","top"];function pBe(t,e,n){switch(t){case"top":case"bottom":return n?e?dV:fV:e?fV:dV;case"left":case"right":return e?dBe:hBe;default:return[]}}function mBe(t,e,n,r){const i=py(t);let a=pBe(cf(t),n==="start",r);return i&&(a=a.map(s=>s+"-"+i),e&&(a=a.concat(a.map(CB)))),a}function tE(t){return t.replace(/left|right|bottom|top/g,e=>oBe[e])}function gBe(t){return{top:0,right:0,bottom:0,left:0,...t}}function $J(t){return typeof t!="number"?gBe(t):{top:t,right:t,bottom:t,left:t}}function nE(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function hV(t,e,n){let{reference:r,floating:i}=t;const a=Ic(e),s=Dk(e),o=Pk(s),c=cf(e),u=a==="y",h=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,v=r[o]/2-i[o]/2;let y;switch(c){case"top":y={x:h,y:r.y-i.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-i.width,y:p};break;default:y={x:r.x,y:r.y}}switch(py(e)){case"start":y[s]-=v*(n&&u?-1:1);break;case"end":y[s]+=v*(n&&u?-1:1);break}return y}const vBe=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:p}=hV(u,r,c),v=r,y={},b=0;for(let w=0;w<o.length;w++){const{name:_,fn:S}=o[w],{x:E,y:T,data:P,reset:R}=await S({x:h,y:p,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:u,platform:s,elements:{reference:t,floating:e}});h=E??h,p=T??p,y={...y,[_]:{...y[_],...P}},R&&b<=50&&(b++,typeof R=="object"&&(R.placement&&(v=R.placement),R.rects&&(u=R.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):R.rects),{x:h,y:p}=hV(u,v,c)),w=-1)}return{x:h,y:p,placement:v,strategy:i,middlewareData:y}};async function Gb(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:a,rects:s,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:v=!1,padding:y=0}=lf(e,t),b=$J(y),_=o[v?p==="floating"?"reference":"floating":p],S=nE(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(_)))==null||n?_:_.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:u,rootBoundary:h,strategy:c})),E=p==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),P=await(a.isElement==null?void 0:a.isElement(T))?await(a.getScale==null?void 0:a.getScale(T))||{x:1,y:1}:{x:1,y:1},R=nE(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:E,offsetParent:T,strategy:c}):E);return{top:(S.top-R.top+b.top)/P.y,bottom:(R.bottom-S.bottom+b.bottom)/P.y,left:(S.left-R.left+b.left)/P.x,right:(R.right-S.right+b.right)/P.x}}const yBe=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:a,platform:s,elements:o,middlewareData:c}=e,{element:u,padding:h=0}=lf(t,e)||{};if(u==null)return{};const p=$J(h),v={x:n,y:r},y=Dk(i),b=Pk(y),w=await s.getDimensions(u),_=y==="y",S=_?"top":"left",E=_?"bottom":"right",T=_?"clientHeight":"clientWidth",P=a.reference[b]+a.reference[y]-v[y]-a.floating[b],R=v[y]-a.reference[y],D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let I=D?D[T]:0;(!I||!await(s.isElement==null?void 0:s.isElement(D)))&&(I=o.floating[T]||a.floating[b]);const k=P/2-R/2,B=I/2-w[b]/2-1,U=Nd(p[S],B),z=Nd(p[E],B),q=U,W=I-w[b]-z,ee=I/2-w[b]/2+k,Q=TB(q,ee,W),V=!c.arrow&&py(i)!=null&&ee!==Q&&a.reference[b]/2-(ee<q?U:z)-w[b]/2<0,$=V?ee<q?ee-q:ee-W:0;return{[y]:v[y]+$,data:{[y]:Q,centerOffset:ee-Q-$,...V&&{alignmentOffset:$}},reset:V}}}),xBe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:a,rects:s,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,..._}=lf(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const S=cf(i),E=Ic(o),T=cf(o)===o,P=await(c.isRTL==null?void 0:c.isRTL(u.floating)),R=v||(T||!w?[tE(o)]:fBe(o)),D=b!=="none";!v&&D&&R.push(...mBe(o,w,b,P));const I=[o,...R],k=await Gb(e,_),B=[];let U=((r=a.flip)==null?void 0:r.overflows)||[];if(h&&B.push(k[S]),p){const ee=uBe(i,s,P);B.push(k[ee[0]],k[ee[1]])}if(U=[...U,{placement:i,overflows:B}],!B.every(ee=>ee<=0)){var z,q;const ee=(((z=a.flip)==null?void 0:z.index)||0)+1,Q=I[ee];if(Q&&(!(p==="alignment"?E!==Ic(Q):!1)||U.every(Y=>Ic(Y.placement)===E?Y.overflows[0]>0:!0)))return{data:{index:ee,overflows:U},reset:{placement:Q}};let V=(q=U.filter($=>$.overflows[0]<=0).sort(($,Y)=>$.overflows[1]-Y.overflows[1])[0])==null?void 0:q.placement;if(!V)switch(y){case"bestFit":{var W;const $=(W=U.filter(Y=>{if(D){const ie=Ic(Y.placement);return ie===E||ie==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(ie=>ie>0).reduce((ie,de)=>ie+de,0)]).sort((Y,ie)=>Y[1]-ie[1])[0])==null?void 0:W[0];$&&(V=$);break}case"initialPlacement":V=o;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function pV(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function mV(t){return sBe.some(e=>t[e]>=0)}const bBe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=lf(t,e);switch(r){case"referenceHidden":{const a=await Gb(e,{...i,elementContext:"reference"}),s=pV(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:mV(s)}}}case"escaped":{const a=await Gb(e,{...i,altBoundary:!0}),s=pV(a,n.floating);return{data:{escapedOffsets:s,escaped:mV(s)}}}default:return{}}}}},XJ=new Set(["left","top"]);async function _Be(t,e){const{placement:n,platform:r,elements:i}=t,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=cf(n),o=py(n),c=Ic(n)==="y",u=XJ.has(s)?-1:1,h=a&&c?-1:1,p=lf(e,t);let{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return o&&typeof b=="number"&&(y=o==="end"?b*-1:b),c?{x:y*h,y:v*u}:{x:v*u,y:y*h}}const SBe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:a,placement:s,middlewareData:o}=e,c=await _Be(e,t);return s===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:s}}}}},ABe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:_=>{let{x:S,y:E}=_;return{x:S,y:E}}},...c}=lf(t,e),u={x:n,y:r},h=await Gb(e,c),p=Ic(cf(i)),v=Ok(p);let y=u[v],b=u[p];if(a){const _=v==="y"?"top":"left",S=v==="y"?"bottom":"right",E=y+h[_],T=y-h[S];y=TB(E,y,T)}if(s){const _=p==="y"?"top":"left",S=p==="y"?"bottom":"right",E=b+h[_],T=b-h[S];b=TB(E,b,T)}const w=o.fn({...e,[v]:y,[p]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[v]:a,[p]:s}}}}}},wBe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:a,middlewareData:s}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=lf(t,e),h={x:n,y:r},p=Ic(i),v=Ok(p);let y=h[v],b=h[p];const w=lf(o,e),_=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const T=v==="y"?"height":"width",P=a.reference[v]-a.floating[T]+_.mainAxis,R=a.reference[v]+a.reference[T]-_.mainAxis;y<P?y=P:y>R&&(y=R)}if(u){var S,E;const T=v==="y"?"width":"height",P=XJ.has(cf(i)),R=a.reference[p]-a.floating[T]+(P&&((S=s.offset)==null?void 0:S[p])||0)+(P?0:_.crossAxis),D=a.reference[p]+a.reference[T]+(P?0:((E=s.offset)==null?void 0:E[p])||0)-(P?_.crossAxis:0);b<R?b=R:b>D&&(b=D)}return{[v]:y,[p]:b}}}},MBe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:a,platform:s,elements:o}=e,{apply:c=()=>{},...u}=lf(t,e),h=await Gb(e,u),p=cf(i),v=py(i),y=Ic(i)==="y",{width:b,height:w}=a.floating;let _,S;p==="top"||p==="bottom"?(_=p,S=v===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(S=p,_=v==="end"?"top":"bottom");const E=w-h.top-h.bottom,T=b-h.left-h.right,P=Nd(w-h[_],E),R=Nd(b-h[S],T),D=!e.middlewareData.shift;let I=P,k=R;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(k=T),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(I=E),D&&!v){const U=Ys(h.left,0),z=Ys(h.right,0),q=Ys(h.top,0),W=Ys(h.bottom,0);y?k=b-2*(U!==0||z!==0?U+z:Ys(h.left,h.right)):I=w-2*(q!==0||W!==0?q+W:Ys(h.top,h.bottom))}await c({...e,availableWidth:k,availableHeight:I});const B=await s.getDimensions(o.floating);return b!==B.width||w!==B.height?{reset:{rects:!0}}:{}}}};function ET(){return typeof window<"u"}function my(t){return KJ(t)?(t.nodeName||"").toLowerCase():"#document"}function no(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Jc(t){var e;return(e=(KJ(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function KJ(t){return ET()?t instanceof Node||t instanceof no(t).Node:!1}function jl(t){return ET()?t instanceof Element||t instanceof no(t).Element:!1}function Xc(t){return ET()?t instanceof HTMLElement||t instanceof no(t).HTMLElement:!1}function gV(t){return!ET()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof no(t).ShadowRoot}const EBe=new Set(["inline","contents"]);function _1(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=zl(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!EBe.has(i)}const TBe=new Set(["table","td","th"]);function CBe(t){return TBe.has(my(t))}const RBe=[":popover-open",":modal"];function TT(t){return RBe.some(e=>{try{return t.matches(e)}catch{return!1}})}const OBe=["transform","translate","scale","rotate","perspective"],PBe=["transform","translate","scale","rotate","perspective","filter"],DBe=["paint","layout","strict","content"];function Nk(t){const e=Ik(),n=jl(t)?zl(t):t;return OBe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||PBe.some(r=>(n.willChange||"").includes(r))||DBe.some(r=>(n.contain||"").includes(r))}function NBe(t){let e=Id(t);for(;Xc(e)&&!Hv(e);){if(Nk(e))return e;if(TT(e))return null;e=Id(e)}return null}function Ik(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const IBe=new Set(["html","body","#document"]);function Hv(t){return IBe.has(my(t))}function zl(t){return no(t).getComputedStyle(t)}function CT(t){return jl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Id(t){if(my(t)==="html")return t;const e=t.assignedSlot||t.parentNode||gV(t)&&t.host||Jc(t);return gV(e)?e.host:e}function YJ(t){const e=Id(t);return Hv(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xc(e)&&_1(e)?e:YJ(e)}function Hb(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=YJ(t),a=i===((r=t.ownerDocument)==null?void 0:r.body),s=no(i);if(a){const o=RB(s);return e.concat(s,s.visualViewport||[],_1(i)?i:[],o&&n?Hb(o):[])}return e.concat(i,Hb(i,[],n))}function RB(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function JJ(t){const e=zl(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Xc(t),a=i?t.offsetWidth:n,s=i?t.offsetHeight:r,o=eE(n)!==a||eE(r)!==s;return o&&(n=a,r=s),{width:n,height:r,$:o}}function Bk(t){return jl(t)?t:t.contextElement}function ev(t){const e=Bk(t);if(!Xc(e))return Uc(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:a}=JJ(e);let s=(a?eE(n.width):n.width)/r,o=(a?eE(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const BBe=Uc(0);function ZJ(t){const e=no(t);return!Ik()||!e.visualViewport?BBe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function LBe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==no(t)?!1:e}function Lp(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),a=Bk(t);let s=Uc(1);e&&(r?jl(r)&&(s=ev(r)):s=ev(t));const o=LBe(a,n,r)?ZJ(a):Uc(0);let c=(i.left+o.x)/s.x,u=(i.top+o.y)/s.y,h=i.width/s.x,p=i.height/s.y;if(a){const v=no(a),y=r&&jl(r)?no(r):r;let b=v,w=RB(b);for(;w&&r&&y!==b;){const _=ev(w),S=w.getBoundingClientRect(),E=zl(w),T=S.left+(w.clientLeft+parseFloat(E.paddingLeft))*_.x,P=S.top+(w.clientTop+parseFloat(E.paddingTop))*_.y;c*=_.x,u*=_.y,h*=_.x,p*=_.y,c+=T,u+=P,b=no(w),w=RB(b)}}return nE({width:h,height:p,x:c,y:u})}function RT(t,e){const n=CT(t).scrollLeft;return e?e.left+n:Lp(Jc(t)).left+n}function QJ(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-RT(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function kBe(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const a=i==="fixed",s=Jc(r),o=e?TT(e.floating):!1;if(r===s||o&&a)return n;let c={scrollLeft:0,scrollTop:0},u=Uc(1);const h=Uc(0),p=Xc(r);if((p||!p&&!a)&&((my(r)!=="body"||_1(s))&&(c=CT(r)),Xc(r))){const y=Lp(r);u=ev(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const v=s&&!p&&!a?QJ(s,c):Uc(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+v.x,y:n.y*u.y-c.scrollTop*u.y+h.y+v.y}}function FBe(t){return Array.from(t.getClientRects())}function UBe(t){const e=Jc(t),n=CT(t),r=t.ownerDocument.body,i=Ys(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=Ys(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+RT(t);const o=-n.scrollTop;return zl(r).direction==="rtl"&&(s+=Ys(e.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:o}}const vV=25;function jBe(t,e){const n=no(t),r=Jc(t),i=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,o=0,c=0;if(i){a=i.width,s=i.height;const h=Ik();(!h||h&&e==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}const u=RT(r);if(u<=0){const h=r.ownerDocument,p=h.body,v=getComputedStyle(p),y=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(r.clientWidth-p.clientWidth-y);b<=vV&&(a-=b)}else u<=vV&&(a+=u);return{width:a,height:s,x:o,y:c}}const zBe=new Set(["absolute","fixed"]);function GBe(t,e){const n=Lp(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,a=Xc(t)?ev(t):Uc(1),s=t.clientWidth*a.x,o=t.clientHeight*a.y,c=i*a.x,u=r*a.y;return{width:s,height:o,x:c,y:u}}function yV(t,e,n){let r;if(e==="viewport")r=jBe(t,n);else if(e==="document")r=UBe(Jc(t));else if(jl(e))r=GBe(e,n);else{const i=ZJ(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return nE(r)}function eZ(t,e){const n=Id(t);return n===e||!jl(n)||Hv(n)?!1:zl(n).position==="fixed"||eZ(n,e)}function HBe(t,e){const n=e.get(t);if(n)return n;let r=Hb(t,[],!1).filter(o=>jl(o)&&my(o)!=="body"),i=null;const a=zl(t).position==="fixed";let s=a?Id(t):t;for(;jl(s)&&!Hv(s);){const o=zl(s),c=Nk(s);!c&&o.position==="fixed"&&(i=null),(a?!c&&!i:!c&&o.position==="static"&&!!i&&zBe.has(i.position)||_1(s)&&!c&&eZ(t,s))?r=r.filter(h=>h!==s):i=o,s=Id(s)}return e.set(t,r),r}function VBe(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?TT(e)?[]:HBe(e,this._c):[].concat(n),r],o=s[0],c=s.reduce((u,h)=>{const p=yV(e,h,i);return u.top=Ys(p.top,u.top),u.right=Nd(p.right,u.right),u.bottom=Nd(p.bottom,u.bottom),u.left=Ys(p.left,u.left),u},yV(e,o,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function WBe(t){const{width:e,height:n}=JJ(t);return{width:e,height:n}}function qBe(t,e,n){const r=Xc(e),i=Jc(e),a=n==="fixed",s=Lp(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const c=Uc(0);function u(){c.x=RT(i)}if(r||!r&&!a)if((my(e)!=="body"||_1(i))&&(o=CT(e)),r){const y=Lp(e,!0,a,e);c.x=y.x+e.clientLeft,c.y=y.y+e.clientTop}else i&&u();a&&!r&&i&&u();const h=i&&!r&&!a?QJ(i,o):Uc(0),p=s.left+o.scrollLeft-c.x-h.x,v=s.top+o.scrollTop-c.y-h.y;return{x:p,y:v,width:s.width,height:s.height}}function JD(t){return zl(t).position==="static"}function xV(t,e){if(!Xc(t)||zl(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Jc(t)===n&&(n=n.ownerDocument.body),n}function tZ(t,e){const n=no(t);if(TT(t))return n;if(!Xc(t)){let i=Id(t);for(;i&&!Hv(i);){if(jl(i)&&!JD(i))return i;i=Id(i)}return n}let r=xV(t,e);for(;r&&CBe(r)&&JD(r);)r=xV(r,e);return r&&Hv(r)&&JD(r)&&!Nk(r)?n:r||NBe(t)||n}const $Be=async function(t){const e=this.getOffsetParent||tZ,n=this.getDimensions,r=await n(t.floating);return{reference:qBe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XBe(t){return zl(t).direction==="rtl"}const KBe={convertOffsetParentRelativeRectToViewportRelativeRect:kBe,getDocumentElement:Jc,getClippingRect:VBe,getOffsetParent:tZ,getElementRects:$Be,getClientRects:FBe,getDimensions:WBe,getScale:ev,isElement:jl,isRTL:XBe};function nZ(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function YBe(t,e){let n=null,r;const i=Jc(t);function a(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),a();const u=t.getBoundingClientRect(),{left:h,top:p,width:v,height:y}=u;if(o||e(),!v||!y)return;const b=wA(p),w=wA(i.clientWidth-(h+v)),_=wA(i.clientHeight-(p+y)),S=wA(h),T={rootMargin:-b+"px "+-w+"px "+-_+"px "+-S+"px",threshold:Ys(0,Nd(1,c))||1};let P=!0;function R(D){const I=D[0].intersectionRatio;if(I!==c){if(!P)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!nZ(u,t.getBoundingClientRect())&&s(),P=!1}try{n=new IntersectionObserver(R,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(R,T)}n.observe(t)}return s(!0),a}function JBe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Bk(t),h=i||a?[...u?Hb(u):[],...Hb(e)]:[];h.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),a&&S.addEventListener("resize",n)});const p=u&&o?YBe(u,n):null;let v=-1,y=null;s&&(y=new ResizeObserver(S=>{let[E]=S;E&&E.target===u&&y&&(y.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var T;(T=y)==null||T.observe(e)})),n()}),u&&!c&&y.observe(u),y.observe(e));let b,w=c?Lp(t):null;c&&_();function _(){const S=Lp(t);w&&!nZ(w,S)&&n(),w=S,b=requestAnimationFrame(_)}return n(),()=>{var S;h.forEach(E=>{i&&E.removeEventListener("scroll",n),a&&E.removeEventListener("resize",n)}),p?.(),(S=y)==null||S.disconnect(),y=null,c&&cancelAnimationFrame(b)}}const ZBe=SBe,QBe=ABe,eLe=xBe,tLe=MBe,nLe=bBe,bV=yBe,rLe=wBe,iLe=(t,e,n)=>{const r=new Map,i={platform:KBe,...n},a={...i.platform,_c:r};return vBe(t,e,{...i,platform:a})};var aLe=typeof document<"u",sLe=function(){},GA=aLe?j.useLayoutEffect:sLe;function rE(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!rE(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&t.$$typeof)&&!rE(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function rZ(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function _V(t,e){const n=rZ(t);return Math.round(e*n)/n}function ZD(t){const e=j.useRef(t);return GA(()=>{e.current=t}),e}function oLe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[h,p]=j.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,y]=j.useState(r);rE(v,r)||y(r);const[b,w]=j.useState(null),[_,S]=j.useState(null),E=j.useCallback(Y=>{Y!==D.current&&(D.current=Y,w(Y))},[]),T=j.useCallback(Y=>{Y!==I.current&&(I.current=Y,S(Y))},[]),P=a||b,R=s||_,D=j.useRef(null),I=j.useRef(null),k=j.useRef(h),B=c!=null,U=ZD(c),z=ZD(i),q=ZD(u),W=j.useCallback(()=>{if(!D.current||!I.current)return;const Y={placement:e,strategy:n,middleware:v};z.current&&(Y.platform=z.current),iLe(D.current,I.current,Y).then(ie=>{const de={...ie,isPositioned:q.current!==!1};ee.current&&!rE(k.current,de)&&(k.current=de,o5.flushSync(()=>{p(de)}))})},[v,e,n,z,q]);GA(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[u]);const ee=j.useRef(!1);GA(()=>(ee.current=!0,()=>{ee.current=!1}),[]),GA(()=>{if(P&&(D.current=P),R&&(I.current=R),P&&R){if(U.current)return U.current(P,R,W);W()}},[P,R,W,U,B]);const Q=j.useMemo(()=>({reference:D,floating:I,setReference:E,setFloating:T}),[E,T]),V=j.useMemo(()=>({reference:P,floating:R}),[P,R]),$=j.useMemo(()=>{const Y={position:n,left:0,top:0};if(!V.floating)return Y;const ie=_V(V.floating,h.x),de=_V(V.floating,h.y);return o?{...Y,transform:"translate("+ie+"px, "+de+"px)",...rZ(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:de}},[n,o,V.floating,h.x,h.y]);return j.useMemo(()=>({...h,update:W,refs:Q,elements:V,floatingStyles:$}),[h,W,Q,V,$])}const lLe=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?bV({element:r.current,padding:i}).fn(n):{}:r?bV({element:r,padding:i}).fn(n):{}}}},cLe=(t,e)=>({...ZBe(t),options:[t,e]}),uLe=(t,e)=>({...QBe(t),options:[t,e]}),fLe=(t,e)=>({...rLe(t),options:[t,e]}),dLe=(t,e)=>({...eLe(t),options:[t,e]}),hLe=(t,e)=>({...tLe(t),options:[t,e]}),pLe=(t,e)=>({...nLe(t),options:[t,e]}),mLe=(t,e)=>({...lLe(t),options:[t,e]});var gLe="Arrow",iZ=j.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...a}=t;return M.jsx(us.svg,{...a,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:M.jsx("polygon",{points:"0,0 30,0 15,10"})})});iZ.displayName=gLe;var vLe=iZ;function yLe(t){const[e,n]=j.useState(void 0);return Ul(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;s=u.inlineSize,o=u.blockSize}else s=t.offsetWidth,o=t.offsetHeight;n({width:s,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Lk="Popper",[aZ,sZ]=b1(Lk),[xLe,oZ]=aZ(Lk),lZ=t=>{const{__scopePopper:e,children:n}=t,[r,i]=j.useState(null);return M.jsx(xLe,{scope:e,anchor:r,onAnchorChange:i,children:n})};lZ.displayName=Lk;var cZ="PopperAnchor",uZ=j.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,a=oZ(cZ,n),s=j.useRef(null),o=Ls(e,s),c=j.useRef(null);return j.useEffect(()=>{const u=c.current;c.current=r?.current||s.current,u!==c.current&&a.onAnchorChange(c.current)}),r?null:M.jsx(us.div,{...i,ref:o})});uZ.displayName=cZ;var kk="PopperContent",[bLe,_Le]=aZ(kk),fZ=j.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:b,...w}=t,_=oZ(kk,n),[S,E]=j.useState(null),T=Ls(e,ve=>E(ve)),[P,R]=j.useState(null),D=yLe(P),I=D?.width??0,k=D?.height??0,B=r+(a!=="center"?"-"+a:""),U=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(u)?u:[u],q=z.length>0,W={padding:U,boundary:z.filter(ALe),altBoundary:q},{refs:ee,floatingStyles:Q,placement:V,isPositioned:$,middlewareData:Y}=oLe({strategy:"fixed",placement:B,whileElementsMounted:(...ve)=>JBe(...ve,{animationFrame:y==="always"}),elements:{reference:_.anchor},middleware:[cLe({mainAxis:i+k,alignmentAxis:s}),c&&uLe({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?fLe():void 0,...W}),c&&dLe({...W}),hLe({...W,apply:({elements:ve,rects:We,availableWidth:_e,availableHeight:Fe})=>{const{width:Xe,height:Re}=We.reference,ot=ve.floating.style;ot.setProperty("--radix-popper-available-width",`${_e}px`),ot.setProperty("--radix-popper-available-height",`${Fe}px`),ot.setProperty("--radix-popper-anchor-width",`${Xe}px`),ot.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),P&&mLe({element:P,padding:o}),wLe({arrowWidth:I,arrowHeight:k}),v&&pLe({strategy:"referenceHidden",...W})]}),[ie,de]=pZ(V),X=Hc(b);Ul(()=>{$&&X?.()},[$,X]);const ae=Y.arrow?.x,ue=Y.arrow?.y,Se=Y.arrow?.centerOffset!==0,[$e,me]=j.useState();return Ul(()=>{S&&me(window.getComputedStyle(S).zIndex)},[S]),M.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:$?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:M.jsx(bLe,{scope:n,placedSide:ie,onArrowChange:R,arrowX:ae,arrowY:ue,shouldHideArrow:Se,children:M.jsx(us.div,{"data-side":ie,"data-align":de,...w,ref:T,style:{...w.style,animation:$?void 0:"none"}})})})});fZ.displayName=kk;var dZ="PopperArrow",SLe={top:"bottom",right:"left",bottom:"top",left:"right"},hZ=j.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,a=_Le(dZ,r),s=SLe[a.placedSide];return M.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:M.jsx(vLe,{...i,ref:n,style:{...i.style,display:"block"}})})});hZ.displayName=dZ;function ALe(t){return t!==null}var wLe=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:i}=e,s=i.arrow?.centerOffset!==0,o=s?0:t.arrowWidth,c=s?0:t.arrowHeight,[u,h]=pZ(n),p={start:"0%",center:"50%",end:"100%"}[h],v=(i.arrow?.x??0)+o/2,y=(i.arrow?.y??0)+c/2;let b="",w="";return u==="bottom"?(b=s?p:`${v}px`,w=`${-c}px`):u==="top"?(b=s?p:`${v}px`,w=`${r.floating.height+c}px`):u==="right"?(b=`${-c}px`,w=s?p:`${y}px`):u==="left"&&(b=`${r.floating.width+c}px`,w=s?p:`${y}px`),{data:{x:b,y:w}}}});function pZ(t){const[e,n="center"]=t.split("-");return[e,n]}var MLe=lZ,ELe=uZ,TLe=fZ,CLe=hZ,RLe="Portal",mZ=j.forwardRef((t,e)=>{const{container:n,...r}=t,[i,a]=j.useState(!1);Ul(()=>a(!0),[]);const s=n||i&&globalThis?.document?.body;return s?r0e.createPortal(M.jsx(us.div,{...r,ref:e}),s):null});mZ.displayName=RLe;function OLe(t,e){return j.useReducer((n,r)=>e[n][r]??n,t)}var S1=t=>{const{present:e,children:n}=t,r=PLe(e),i=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),a=Ls(r.ref,DLe(i));return typeof n=="function"||r.isPresent?j.cloneElement(i,{ref:a}):null};S1.displayName="Presence";function PLe(t){const[e,n]=j.useState(),r=j.useRef(null),i=j.useRef(t),a=j.useRef("none"),s=t?"mounted":"unmounted",[o,c]=OLe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const u=MA(r.current);a.current=o==="mounted"?u:"none"},[o]),Ul(()=>{const u=r.current,h=i.current;if(h!==t){const v=a.current,y=MA(u);t?c("MOUNT"):y==="none"||u?.display==="none"?c("UNMOUNT"):c(h&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Ul(()=>{if(e){let u;const h=e.ownerDocument.defaultView??window,p=y=>{const w=MA(r.current).includes(CSS.escape(y.animationName));if(y.target===e&&w&&(c("ANIMATION_END"),!i.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",u=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},v=y=>{y.target===e&&(a.current=MA(r.current))};return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",p),e.addEventListener("animationend",p),()=>{h.clearTimeout(u),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",p),e.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:j.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function MA(t){return t?.animationName||"none"}function DLe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var QD="rovingFocusGroup.onEntryFocus",NLe={bubbles:!1,cancelable:!0},A1="RovingFocusGroup",[OB,gZ,ILe]=jJ(A1),[BLe,vZ]=b1(A1,[ILe]),[LLe,kLe]=BLe(A1),yZ=j.forwardRef((t,e)=>M.jsx(OB.Provider,{scope:t.__scopeRovingFocusGroup,children:M.jsx(OB.Slot,{scope:t.__scopeRovingFocusGroup,children:M.jsx(FLe,{...t,ref:e})})}));yZ.displayName=A1;var FLe=j.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...p}=t,v=j.useRef(null),y=Ls(e,v),b=zJ(a),[w,_]=FJ({prop:s,defaultProp:o??null,onChange:c,caller:A1}),[S,E]=j.useState(!1),T=Hc(u),P=gZ(n),R=j.useRef(!1),[D,I]=j.useState(0);return j.useEffect(()=>{const k=v.current;if(k)return k.addEventListener(QD,T),()=>k.removeEventListener(QD,T)},[T]),M.jsx(LLe,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:w,onItemFocus:j.useCallback(k=>_(k),[_]),onItemShiftTab:j.useCallback(()=>E(!0),[]),onFocusableItemAdd:j.useCallback(()=>I(k=>k+1),[]),onFocusableItemRemove:j.useCallback(()=>I(k=>k-1),[]),children:M.jsx(us.div,{tabIndex:S||D===0?-1:0,"data-orientation":r,...p,ref:y,style:{outline:"none",...t.style},onMouseDown:Vn(t.onMouseDown,()=>{R.current=!0}),onFocus:Vn(t.onFocus,k=>{const B=!R.current;if(k.target===k.currentTarget&&B&&!S){const U=new CustomEvent(QD,NLe);if(k.currentTarget.dispatchEvent(U),!U.defaultPrevented){const z=P().filter(V=>V.focusable),q=z.find(V=>V.active),W=z.find(V=>V.id===w),Q=[q,W,...z].filter(Boolean).map(V=>V.ref.current);_Z(Q,h)}}R.current=!1}),onBlur:Vn(t.onBlur,()=>E(!1))})})}),xZ="RovingFocusGroupItem",bZ=j.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:s,...o}=t,c=EB(),u=a||c,h=kLe(xZ,n),p=h.currentTabStopId===u,v=gZ(n),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:w}=h;return j.useEffect(()=>{if(r)return y(),()=>b()},[r,y,b]),M.jsx(OB.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:M.jsx(us.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...o,ref:e,onMouseDown:Vn(t.onMouseDown,_=>{r?h.onItemFocus(u):_.preventDefault()}),onFocus:Vn(t.onFocus,()=>h.onItemFocus(u)),onKeyDown:Vn(t.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){h.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const S=zLe(_,h.orientation,h.dir);if(S!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let T=v().filter(P=>P.focusable).map(P=>P.ref.current);if(S==="last")T.reverse();else if(S==="prev"||S==="next"){S==="prev"&&T.reverse();const P=T.indexOf(_.currentTarget);T=h.loop?GLe(T,P+1):T.slice(P+1)}setTimeout(()=>_Z(T))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:w!=null}):s})})});bZ.displayName=xZ;var ULe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jLe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function zLe(t,e,n){const r=jLe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ULe[r]}function _Z(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function GLe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var HLe=yZ,VLe=bZ;function WLe(t){const e=qLe(t),n=j.forwardRef((r,i)=>{const{children:a,...s}=r,o=j.Children.toArray(a),c=o.find(XLe);if(c){const u=c.props.children,h=o.map(p=>p===c?j.Children.count(u)>1?j.Children.only(null):j.isValidElement(u)?u.props.children:null:p);return M.jsx(e,{...s,ref:i,children:j.isValidElement(u)?j.cloneElement(u,void 0,h):null})}return M.jsx(e,{...s,ref:i,children:a})});return n.displayName=`${t}.Slot`,n}function qLe(t){const e=j.forwardRef((n,r)=>{const{children:i,...a}=n;if(j.isValidElement(i)){const s=YLe(i),o=KLe(a,i.props);return i.type!==j.Fragment&&(o.ref=r?Gp(r,s):s),j.cloneElement(i,o)}return j.Children.count(i)>1?j.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var $Le=Symbol("radix.slottable");function XLe(t){return j.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===$Le}function KLe(t,e){const n={...e};for(const r in e){const i=t[r],a=e[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const c=a(...o);return i(...o),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...t,...n}}function YLe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var JLe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Pg=new WeakMap,EA=new WeakMap,TA={},eN=0,SZ=function(t){return t&&(t.host||SZ(t.parentNode))},ZLe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=SZ(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},QLe=function(t,e,n,r){var i=ZLe(e,Array.isArray(t)?t:[t]);TA[n]||(TA[n]=new WeakMap);var a=TA[n],s=[],o=new Set,c=new Set(i),u=function(p){!p||o.has(p)||(o.add(p),u(p.parentNode))};i.forEach(u);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(v){if(o.has(v))h(v);else try{var y=v.getAttribute(r),b=y!==null&&y!=="false",w=(Pg.get(v)||0)+1,_=(a.get(v)||0)+1;Pg.set(v,w),a.set(v,_),s.push(v),w===1&&b&&EA.set(v,!0),_===1&&v.setAttribute(n,"true"),b||v.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",v,S)}})};return h(e),o.clear(),eN++,function(){s.forEach(function(p){var v=Pg.get(p)-1,y=a.get(p)-1;Pg.set(p,v),a.set(p,y),v||(EA.has(p)||p.removeAttribute(r),EA.delete(p)),y||p.removeAttribute(n)}),eN--,eN||(Pg=new WeakMap,Pg=new WeakMap,EA=new WeakMap,TA={})}},e5e=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=JLe(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),QLe(r,i,n,"aria-hidden")):function(){return null}},Rc=function(){return Rc=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Rc.apply(this,arguments)};function AZ(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function t5e(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}var HA="right-scroll-bar-position",VA="width-before-scroll-bar",n5e="with-scroll-bars-hidden",r5e="--removed-body-scroll-bar-size";function tN(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function i5e(t,e){var n=j.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var a5e=typeof window<"u"?j.useLayoutEffect:j.useEffect,SV=new WeakMap;function s5e(t,e){var n=i5e(null,function(r){return t.forEach(function(i){return tN(i,r)})});return a5e(function(){var r=SV.get(n);if(r){var i=new Set(r),a=new Set(t),s=n.current;i.forEach(function(o){a.has(o)||tN(o,null)}),a.forEach(function(o){i.has(o)||tN(o,s)})}SV.set(n,t)},[t]),n}function o5e(t){return t}function l5e(t,e){e===void 0&&(e=o5e);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(a){var s=e(a,r);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(o){return a(o)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(a),s=n}var c=function(){var h=s;s=[],h.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(h){s.push(h),u()},filter:function(h){return s=s.filter(h),n}}}};return i}function c5e(t){t===void 0&&(t={});var e=l5e(null);return e.options=Rc({async:!0,ssr:!1},t),e}var wZ=function(t){var e=t.sideCar,n=AZ(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return j.createElement(r,Rc({},n))};wZ.isSideCarExport=!0;function u5e(t,e){return t.useMedium(e),wZ}var MZ=c5e(),nN=function(){},OT=j.forwardRef(function(t,e){var n=j.useRef(null),r=j.useState({onScrollCapture:nN,onWheelCapture:nN,onTouchMoveCapture:nN}),i=r[0],a=r[1],s=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,h=t.enabled,p=t.shards,v=t.sideCar,y=t.noRelative,b=t.noIsolation,w=t.inert,_=t.allowPinchZoom,S=t.as,E=S===void 0?"div":S,T=t.gapMode,P=AZ(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=v,D=s5e([n,e]),I=Rc(Rc({},P),i);return j.createElement(j.Fragment,null,h&&j.createElement(R,{sideCar:MZ,removeScrollBar:u,shards:p,noRelative:y,noIsolation:b,inert:w,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:T}),s?j.cloneElement(j.Children.only(o),Rc(Rc({},I),{ref:D})):j.createElement(E,Rc({},I,{className:c,ref:D}),o))});OT.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};OT.classNames={fullWidth:VA,zeroRight:HA};var f5e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function d5e(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=f5e();return e&&t.setAttribute("nonce",e),t}function h5e(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function p5e(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var m5e=function(){var t=0,e=null;return{add:function(n){t==0&&(e=d5e())&&(h5e(e,n),p5e(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},g5e=function(){var t=m5e();return function(e,n){j.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},EZ=function(){var t=g5e(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},v5e={left:0,top:0,right:0,gap:0},rN=function(t){return parseInt(t||"",10)||0},y5e=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[rN(n),rN(r),rN(i)]},x5e=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return v5e;var e=y5e(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},b5e=EZ(),tv="data-scroll-locked",_5e=function(t,e,n,r){var i=t.left,a=t.top,s=t.right,o=t.gap;return n===void 0&&(n="margin"),`
.`.concat(n5e,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(o,"px ").concat(r,`;
}
body[`).concat(tv,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(i,`px;
padding-top: `).concat(a,`px;
padding-right: `).concat(s,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(o,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(HA,` {
right: `).concat(o,"px ").concat(r,`;
}
.`).concat(VA,` {
margin-right: `).concat(o,"px ").concat(r,`;
}
.`).concat(HA," .").concat(HA,` {
right: 0 `).concat(r,`;
}
.`).concat(VA," .").concat(VA,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(tv,`] {
`).concat(r5e,": ").concat(o,`px;
}
`)},AV=function(){var t=parseInt(document.body.getAttribute(tv)||"0",10);return isFinite(t)?t:0},S5e=function(){j.useEffect(function(){return document.body.setAttribute(tv,(AV()+1).toString()),function(){var t=AV()-1;t<=0?document.body.removeAttribute(tv):document.body.setAttribute(tv,t.toString())}},[])},A5e=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;S5e();var a=j.useMemo(function(){return x5e(i)},[i]);return j.createElement(b5e,{styles:_5e(a,!e,i,n?"":"!important")})},PB=!1;if(typeof window<"u")try{var CA=Object.defineProperty({},"passive",{get:function(){return PB=!0,!0}});window.addEventListener("test",CA,CA),window.removeEventListener("test",CA,CA)}catch{PB=!1}var Dg=PB?{passive:!1}:!1,w5e=function(t){return t.tagName==="TEXTAREA"},TZ=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!w5e(t)&&n[e]==="visible")},M5e=function(t){return TZ(t,"overflowY")},E5e=function(t){return TZ(t,"overflowX")},wV=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=CZ(t,r);if(i){var a=RZ(t,r),s=a[1],o=a[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},T5e=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},C5e=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},CZ=function(t,e){return t==="v"?M5e(e):E5e(e)},RZ=function(t,e){return t==="v"?T5e(e):C5e(e)},R5e=function(t,e){return t==="h"&&e==="rtl"?-1:1},O5e=function(t,e,n,r,i){var a=R5e(t,window.getComputedStyle(e).direction),s=a*r,o=n.target,c=e.contains(o),u=!1,h=s>0,p=0,v=0;do{if(!o)break;var y=RZ(t,o),b=y[0],w=y[1],_=y[2],S=w-_-a*b;(b||S)&&CZ(t,o)&&(p+=S,v+=b);var E=o.parentNode;o=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(h&&Math.abs(p)<1||!h&&Math.abs(v)<1)&&(u=!0),u},RA=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},MV=function(t){return[t.deltaX,t.deltaY]},EV=function(t){return t&&"current"in t?t.current:t},P5e=function(t,e){return t[0]===e[0]&&t[1]===e[1]},D5e=function(t){return`
.block-interactivity-`.concat(t,` {pointer-events: none;}
.allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},N5e=0,Ng=[];function I5e(t){var e=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),i=j.useState(N5e++)[0],a=j.useState(EZ)[0],s=j.useRef(t);j.useEffect(function(){s.current=t},[t]),j.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var w=t5e([t.lockRef.current],(t.shards||[]).map(EV),!0).filter(Boolean);return w.forEach(function(_){return _.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var o=j.useCallback(function(w,_){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!s.current.allowPinchZoom;var S=RA(w),E=n.current,T="deltaX"in w?w.deltaX:E[0]-S[0],P="deltaY"in w?w.deltaY:E[1]-S[1],R,D=w.target,I=Math.abs(T)>Math.abs(P)?"h":"v";if("touches"in w&&I==="h"&&D.type==="range")return!1;var k=window.getSelection(),B=k&&k.anchorNode,U=B?B===D||B.contains(D):!1;if(U)return!1;var z=wV(I,D);if(!z)return!0;if(z?R=I:(R=I==="v"?"h":"v",z=wV(I,D)),!z)return!1;if(!r.current&&"changedTouches"in w&&(T||P)&&(r.current=R),!R)return!0;var q=r.current||R;return O5e(q,_,w,q==="h"?T:P)},[]),c=j.useCallback(function(w){var _=w;if(!(!Ng.length||Ng[Ng.length-1]!==a)){var S="deltaY"in _?MV(_):RA(_),E=e.current.filter(function(R){return R.name===_.type&&(R.target===_.target||_.target===R.shadowParent)&&P5e(R.delta,S)})[0];if(E&&E.should){_.cancelable&&_.preventDefault();return}if(!E){var T=(s.current.shards||[]).map(EV).filter(Boolean).filter(function(R){return R.contains(_.target)}),P=T.length>0?o(_,T[0]):!s.current.noIsolation;P&&_.cancelable&&_.preventDefault()}}},[]),u=j.useCallback(function(w,_,S,E){var T={name:w,delta:_,target:S,should:E,shadowParent:B5e(S)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(P){return P!==T})},1)},[]),h=j.useCallback(function(w){n.current=RA(w),r.current=void 0},[]),p=j.useCallback(function(w){u(w.type,MV(w),w.target,o(w,t.lockRef.current))},[]),v=j.useCallback(function(w){u(w.type,RA(w),w.target,o(w,t.lockRef.current))},[]);j.useEffect(function(){return Ng.push(a),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Dg),document.addEventListener("touchmove",c,Dg),document.addEventListener("touchstart",h,Dg),function(){Ng=Ng.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,Dg),document.removeEventListener("touchmove",c,Dg),document.removeEventListener("touchstart",h,Dg)}},[]);var y=t.removeScrollBar,b=t.inert;return j.createElement(j.Fragment,null,b?j.createElement(a,{styles:D5e(i)}):null,y?j.createElement(A5e,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function B5e(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const L5e=u5e(MZ,I5e);var OZ=j.forwardRef(function(t,e){return j.createElement(OT,Rc({},t,{ref:e,sideCar:L5e}))});OZ.classNames=OT.classNames;var DB=["Enter"," "],k5e=["ArrowDown","PageUp","Home"],PZ=["ArrowUp","PageDown","End"],F5e=[...k5e,...PZ],U5e={ltr:[...DB,"ArrowRight"],rtl:[...DB,"ArrowLeft"]},j5e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},w1="Menu",[Vb,z5e,G5e]=jJ(w1),[$p,DZ]=b1(w1,[G5e,sZ,vZ]),PT=sZ(),NZ=vZ(),[H5e,Xp]=$p(w1),[V5e,M1]=$p(w1),IZ=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:a,modal:s=!0}=t,o=PT(e),[c,u]=j.useState(null),h=j.useRef(!1),p=Hc(a),v=zJ(i);return j.useEffect(()=>{const y=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),M.jsx(MLe,{...o,children:M.jsx(H5e,{scope:e,open:n,onOpenChange:p,content:c,onContentChange:u,children:M.jsx(V5e,{scope:e,onClose:j.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:v,modal:s,children:r})})})};IZ.displayName=w1;var W5e="MenuAnchor",Fk=j.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=PT(n);return M.jsx(ELe,{...i,...r,ref:e})});Fk.displayName=W5e;var Uk="MenuPortal",[q5e,BZ]=$p(Uk,{forceMount:void 0}),LZ=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,a=Xp(Uk,e);return M.jsx(q5e,{scope:e,forceMount:n,children:M.jsx(S1,{present:n||a.open,children:M.jsx(mZ,{asChild:!0,container:i,children:r})})})};LZ.displayName=Uk;var $o="MenuContent",[$5e,jk]=$p($o),kZ=j.forwardRef((t,e)=>{const n=BZ($o,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,a=Xp($o,t.__scopeMenu),s=M1($o,t.__scopeMenu);return M.jsx(Vb.Provider,{scope:t.__scopeMenu,children:M.jsx(S1,{present:r||a.open,children:M.jsx(Vb.Slot,{scope:t.__scopeMenu,children:s.modal?M.jsx(X5e,{...i,ref:e}):M.jsx(K5e,{...i,ref:e})})})})}),X5e=j.forwardRef((t,e)=>{const n=Xp($o,t.__scopeMenu),r=j.useRef(null),i=Ls(e,r);return j.useEffect(()=>{const a=r.current;if(a)return e5e(a)},[]),M.jsx(zk,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Vn(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),K5e=j.forwardRef((t,e)=>{const n=Xp($o,t.__scopeMenu);return M.jsx(zk,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Y5e=WLe("MenuContent.ScrollLock"),zk=j.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:v,onDismiss:y,disableOutsideScroll:b,...w}=t,_=Xp($o,n),S=M1($o,n),E=PT(n),T=NZ(n),P=z5e(n),[R,D]=j.useState(null),I=j.useRef(null),k=Ls(e,I,_.onContentChange),B=j.useRef(0),U=j.useRef(""),z=j.useRef(0),q=j.useRef(null),W=j.useRef("right"),ee=j.useRef(0),Q=b?OZ:j.Fragment,V=b?{as:Y5e,allowPinchZoom:!0}:void 0,$=ie=>{const de=U.current+ie,X=P().filter(ve=>!ve.disabled),ae=document.activeElement,ue=X.find(ve=>ve.ref.current===ae)?.textValue,Se=X.map(ve=>ve.textValue),$e=lke(Se,de,ue),me=X.find(ve=>ve.textValue===$e)?.ref.current;(function ve(We){U.current=We,window.clearTimeout(B.current),We!==""&&(B.current=window.setTimeout(()=>ve(""),1e3))})(de),me&&setTimeout(()=>me.focus())};j.useEffect(()=>()=>window.clearTimeout(B.current),[]),YIe();const Y=j.useCallback(ie=>W.current===q.current?.side&&uke(ie,q.current?.area),[]);return M.jsx($5e,{scope:n,searchRef:U,onItemEnter:j.useCallback(ie=>{Y(ie)&&ie.preventDefault()},[Y]),onItemLeave:j.useCallback(ie=>{Y(ie)||(I.current?.focus(),D(null))},[Y]),onTriggerLeave:j.useCallback(ie=>{Y(ie)&&ie.preventDefault()},[Y]),pointerGraceTimerRef:z,onPointerGraceIntentChange:j.useCallback(ie=>{q.current=ie},[]),children:M.jsx(Q,{...V,children:M.jsx(WJ,{asChild:!0,trapped:i,onMountAutoFocus:Vn(a,ie=>{ie.preventDefault(),I.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:M.jsx(HJ,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:v,onDismiss:y,children:M.jsx(HLe,{asChild:!0,...T,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:D,onEntryFocus:Vn(c,ie=>{S.isUsingKeyboardRef.current||ie.preventDefault()}),preventScrollOnEntryFocus:!0,children:M.jsx(TLe,{role:"menu","aria-orientation":"vertical","data-state":QZ(_.open),"data-radix-menu-content":"",dir:S.dir,...E,...w,ref:k,style:{outline:"none",...w.style},onKeyDown:Vn(w.onKeyDown,ie=>{const X=ie.target.closest("[data-radix-menu-content]")===ie.currentTarget,ae=ie.ctrlKey||ie.altKey||ie.metaKey,ue=ie.key.length===1;X&&(ie.key==="Tab"&&ie.preventDefault(),!ae&&ue&&$(ie.key));const Se=I.current;if(ie.target!==Se||!F5e.includes(ie.key))return;ie.preventDefault();const me=P().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);PZ.includes(ie.key)&&me.reverse(),ske(me)}),onBlur:Vn(t.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(B.current),U.current="")}),onPointerMove:Vn(t.onPointerMove,Wb(ie=>{const de=ie.target,X=ee.current!==ie.clientX;if(ie.currentTarget.contains(de)&&X){const ae=ie.clientX>ee.current?"right":"left";W.current=ae,ee.current=ie.clientX}}))})})})})})})});kZ.displayName=$o;var J5e="MenuGroup",Gk=j.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return M.jsx(us.div,{role:"group",...r,ref:e})});Gk.displayName=J5e;var Z5e="MenuLabel",FZ=j.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return M.jsx(us.div,{...r,ref:e})});FZ.displayName=Z5e;var iE="MenuItem",TV="menu.itemSelect",DT=j.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,a=j.useRef(null),s=M1(iE,t.__scopeMenu),o=jk(iE,t.__scopeMenu),c=Ls(e,a),u=j.useRef(!1),h=()=>{const p=a.current;if(!n&&p){const v=new CustomEvent(TV,{bubbles:!0,cancelable:!0});p.addEventListener(TV,y=>r?.(y),{once:!0}),UJ(p,v),v.defaultPrevented?u.current=!1:s.onClose()}};return M.jsx(UZ,{...i,ref:c,disabled:n,onClick:Vn(t.onClick,h),onPointerDown:p=>{t.onPointerDown?.(p),u.current=!0},onPointerUp:Vn(t.onPointerUp,p=>{u.current||p.currentTarget?.click()}),onKeyDown:Vn(t.onKeyDown,p=>{const v=o.searchRef.current!=="";n||v&&p.key===" "||DB.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});DT.displayName=iE;var UZ=j.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=t,s=jk(iE,n),o=NZ(n),c=j.useRef(null),u=Ls(e,c),[h,p]=j.useState(!1),[v,y]=j.useState("");return j.useEffect(()=>{const b=c.current;b&&y((b.textContent??"").trim())},[a.children]),M.jsx(Vb.ItemSlot,{scope:n,disabled:r,textValue:i??v,children:M.jsx(VLe,{asChild:!0,...o,focusable:!r,children:M.jsx(us.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:Vn(t.onPointerMove,Wb(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Vn(t.onPointerLeave,Wb(b=>s.onItemLeave(b))),onFocus:Vn(t.onFocus,()=>p(!0)),onBlur:Vn(t.onBlur,()=>p(!1))})})})}),Q5e="MenuCheckboxItem",jZ=j.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return M.jsx(WZ,{scope:t.__scopeMenu,checked:n,children:M.jsx(DT,{role:"menuitemcheckbox","aria-checked":aE(n)?"mixed":n,...i,ref:e,"data-state":Vk(n),onSelect:Vn(i.onSelect,()=>r?.(aE(n)?!0:!n),{checkForDefaultPrevented:!1})})})});jZ.displayName=Q5e;var zZ="MenuRadioGroup",[eke,tke]=$p(zZ,{value:void 0,onValueChange:()=>{}}),GZ=j.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,a=Hc(r);return M.jsx(eke,{scope:t.__scopeMenu,value:n,onValueChange:a,children:M.jsx(Gk,{...i,ref:e})})});GZ.displayName=zZ;var HZ="MenuRadioItem",VZ=j.forwardRef((t,e)=>{const{value:n,...r}=t,i=tke(HZ,t.__scopeMenu),a=n===i.value;return M.jsx(WZ,{scope:t.__scopeMenu,checked:a,children:M.jsx(DT,{role:"menuitemradio","aria-checked":a,...r,ref:e,"data-state":Vk(a),onSelect:Vn(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});VZ.displayName=HZ;var Hk="MenuItemIndicator",[WZ,nke]=$p(Hk,{checked:!1}),qZ=j.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,a=nke(Hk,n);return M.jsx(S1,{present:r||aE(a.checked)||a.checked===!0,children:M.jsx(us.span,{...i,ref:e,"data-state":Vk(a.checked)})})});qZ.displayName=Hk;var rke="MenuSeparator",$Z=j.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return M.jsx(us.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});$Z.displayName=rke;var ike="MenuArrow",XZ=j.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=PT(n);return M.jsx(CLe,{...i,...r,ref:e})});XZ.displayName=ike;var ake="MenuSub",[m2e,KZ]=$p(ake),_x="MenuSubTrigger",YZ=j.forwardRef((t,e)=>{const n=Xp(_x,t.__scopeMenu),r=M1(_x,t.__scopeMenu),i=KZ(_x,t.__scopeMenu),a=jk(_x,t.__scopeMenu),s=j.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=a,u={__scopeMenu:t.__scopeMenu},h=j.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return j.useEffect(()=>h,[h]),j.useEffect(()=>{const p=o.current;return()=>{window.clearTimeout(p),c(null)}},[o,c]),M.jsx(Fk,{asChild:!0,...u,children:M.jsx(UZ,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":QZ(n.open),...t,ref:Gp(e,i.onTriggerChange),onClick:p=>{t.onClick?.(p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Vn(t.onPointerMove,Wb(p=>{a.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!n.open&&!s.current&&(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Vn(t.onPointerLeave,Wb(p=>{h();const v=n.content?.getBoundingClientRect();if(v){const y=n.content?.dataset.side,b=y==="right",w=b?-5:5,_=v[b?"left":"right"],S=v[b?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+w,y:p.clientY},{x:_,y:v.top},{x:S,y:v.top},{x:S,y:v.bottom},{x:_,y:v.bottom}],side:y}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Vn(t.onKeyDown,p=>{const v=a.searchRef.current!=="";t.disabled||v&&p.key===" "||U5e[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});YZ.displayName=_x;var JZ="MenuSubContent",ZZ=j.forwardRef((t,e)=>{const n=BZ($o,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,a=Xp($o,t.__scopeMenu),s=M1($o,t.__scopeMenu),o=KZ(JZ,t.__scopeMenu),c=j.useRef(null),u=Ls(e,c);return M.jsx(Vb.Provider,{scope:t.__scopeMenu,children:M.jsx(S1,{present:r||a.open,children:M.jsx(Vb.Slot,{scope:t.__scopeMenu,children:M.jsx(zk,{id:o.contentId,"aria-labelledby":o.triggerId,...i,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{s.isUsingKeyboardRef.current&&c.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Vn(t.onFocusOutside,h=>{h.target!==o.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Vn(t.onEscapeKeyDown,h=>{s.onClose(),h.preventDefault()}),onKeyDown:Vn(t.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),v=j5e[s.dir].includes(h.key);p&&v&&(a.onOpenChange(!1),o.trigger?.focus(),h.preventDefault())})})})})})});ZZ.displayName=JZ;function QZ(t){return t?"open":"closed"}function aE(t){return t==="indeterminate"}function Vk(t){return aE(t)?"indeterminate":t?"checked":"unchecked"}function ske(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function oke(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function lke(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=n?t.indexOf(n):-1;let s=oke(t,Math.max(a,0));i.length===1&&(s=s.filter(u=>u!==n));const c=s.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function cke(t,e){const{x:n,y:r}=t;let i=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const o=e[a],c=e[s],u=o.x,h=o.y,p=c.x,v=c.y;h>r!=v>r&&n<(p-u)*(r-h)/(v-h)+u&&(i=!i)}return i}function uke(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return cke(n,e)}function Wb(t){return e=>e.pointerType==="mouse"?t(e):void 0}var fke=IZ,dke=Fk,hke=LZ,pke=kZ,mke=Gk,gke=FZ,vke=DT,yke=jZ,xke=GZ,bke=VZ,_ke=qZ,Ske=$Z,Ake=XZ,wke=YZ,Mke=ZZ,NT="DropdownMenu",[Eke]=b1(NT,[DZ]),fs=DZ(),[Tke,eQ]=Eke(NT),tQ=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:o=!0}=t,c=fs(e),u=j.useRef(null),[h,p]=FJ({prop:i,defaultProp:a??!1,onChange:s,caller:NT});return M.jsx(Tke,{scope:e,triggerId:EB(),triggerRef:u,contentId:EB(),open:h,onOpenChange:p,onOpenToggle:j.useCallback(()=>p(v=>!v),[p]),modal:o,children:M.jsx(fke,{...c,open:h,onOpenChange:p,dir:r,modal:o,children:n})})};tQ.displayName=NT;var nQ="DropdownMenuTrigger",rQ=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,a=eQ(nQ,n),s=fs(n);return M.jsx(dke,{asChild:!0,...s,children:M.jsx(us.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Gp(e,a.triggerRef),onPointerDown:Vn(t.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(a.onOpenToggle(),a.open||o.preventDefault())}),onKeyDown:Vn(t.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&a.onOpenToggle(),o.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});rQ.displayName=nQ;var Cke="DropdownMenuPortal",iQ=t=>{const{__scopeDropdownMenu:e,...n}=t,r=fs(e);return M.jsx(hke,{...r,...n})};iQ.displayName=Cke;var aQ="DropdownMenuContent",sQ=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=eQ(aQ,n),a=fs(n),s=j.useRef(!1);return M.jsx(pke,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:e,onCloseAutoFocus:Vn(t.onCloseAutoFocus,o=>{s.current||i.triggerRef.current?.focus(),s.current=!1,o.preventDefault()}),onInteractOutside:Vn(t.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,h=c.button===2||u;(!i.modal||h)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sQ.displayName=aQ;var Rke="DropdownMenuGroup",Oke=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(mke,{...i,...r,ref:e})});Oke.displayName=Rke;var Pke="DropdownMenuLabel",Dke=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(gke,{...i,...r,ref:e})});Dke.displayName=Pke;var Nke="DropdownMenuItem",oQ=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(vke,{...i,...r,ref:e})});oQ.displayName=Nke;var Ike="DropdownMenuCheckboxItem",Bke=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(yke,{...i,...r,ref:e})});Bke.displayName=Ike;var Lke="DropdownMenuRadioGroup",kke=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(xke,{...i,...r,ref:e})});kke.displayName=Lke;var Fke="DropdownMenuRadioItem",Uke=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(bke,{...i,...r,ref:e})});Uke.displayName=Fke;var jke="DropdownMenuItemIndicator",zke=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(_ke,{...i,...r,ref:e})});zke.displayName=jke;var Gke="DropdownMenuSeparator",lQ=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(Ske,{...i,...r,ref:e})});lQ.displayName=Gke;var Hke="DropdownMenuArrow",Vke=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(Ake,{...i,...r,ref:e})});Vke.displayName=Hke;var Wke="DropdownMenuSubTrigger",qke=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(wke,{...i,...r,ref:e})});qke.displayName=Wke;var $ke="DropdownMenuSubContent",Xke=j.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=fs(n);return M.jsx(Mke,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Xke.displayName=$ke;var Kke=tQ,Yke=rQ,Jke=iQ,Zke=sQ,Qke=oQ,e2e=lQ;function t2e({...t}){return M.jsx(Kke,{"code-path":"src\\components\\ui\\dropdown-menu.tsx:10:10","data-slot":"dropdown-menu",...t})}function n2e({...t}){return M.jsx(Yke,{"code-path":"src\\components\\ui\\dropdown-menu.tsx:25:5","data-slot":"dropdown-menu-trigger",...t})}function r2e({className:t,sideOffset:e=4,...n}){return M.jsx(Jke,{"code-path":"src\\components\\ui\\dropdown-menu.tsx:38:5",children:M.jsx(Zke,{"code-path":"src\\components\\ui\\dropdown-menu.tsx:39:7","data-slot":"dropdown-menu-content",sideOffset:e,className:hf("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...n})})}function CV({className:t,inset:e,variant:n="default",...r}){return M.jsx(Qke,{"code-path":"src\\components\\ui\\dropdown-menu.tsx:70:5","data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:hf("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function i2e({className:t,...e}){return M.jsx(e2e,{"code-path":"src\\components\\ui\\dropdown-menu.tsx:169:5","data-slot":"dropdown-menu-separator",className:hf("bg-border -mx-1 my-1 h-px",t),...e})}const a2e={dashboard:vAe,oracle:HAe,sentinel:swe,inventory:pIe,settings:wIe},s2e={dashboard:"Dashboard",oracle:"The Oracle",sentinel:"The Sentinel",inventory:"Inventory",settings:"Settings"};function o2e(){const{activeModule:t,setActiveModule:e,sidebarExpanded:n,logout:r}=ao(),i=a2e[t];return M.jsxs("div",{"code-path":"src\\App.tsx:45:5",className:"min-h-screen flex",style:{background:"#000"},children:[M.jsx(noe,{"code-path":"src\\App.tsx:47:7"}),M.jsxs(yt.main,{"code-path":"src\\App.tsx:50:7",className:"flex-1 min-h-screen overflow-auto custom-scrollbar",initial:{marginLeft:72},animate:{marginLeft:n?232:72},transition:{type:"spring",stiffness:320,damping:32,mass:.8},children:[M.jsx("header",{"code-path":"src\\App.tsx:62:9",className:"sticky top-0 z-40 px-6 py-4",children:M.jsxs("div",{"code-path":"src\\App.tsx:63:11",className:"flex items-center justify-between px-5 py-3 rounded-2xl",style:{background:"hsl(var(--surface))",border:"1px solid hsl(var(--border-subtle))"},children:[M.jsxs(yt.div,{"code-path":"src\\App.tsx:70:13",initial:{opacity:0,x:-12},animate:{opacity:1,x:0},transition:{duration:.25},children:[M.jsx("h1",{"code-path":"src\\App.tsx:76:15",className:"text-base font-semibold text-white tracking-tight",children:s2e[t]}),M.jsx("p",{"code-path":"src\\App.tsx:77:15",className:"text-xs",style:{color:"hsl(var(--muted-fg))"},children:"Project Velocity · v.1.1"})]},t),M.jsxs("div",{"code-path":"src\\App.tsx:81:13",className:"flex items-center gap-3",children:[M.jsxs("div",{"code-path":"src\\App.tsx:82:15",className:"text-right",children:[M.jsx("p",{"code-path":"src\\App.tsx:83:17",className:"text-sm font-medium text-white",children:"Ahmed Al-Farsi"}),M.jsx("p",{"code-path":"src\\App.tsx:84:17",className:"text-xs",style:{color:"hsl(var(--muted-fg))"},children:"Sales Director"})]}),M.jsx("div",{"code-path":"src\\App.tsx:86:15",className:"w-9 h-9 rounded-xl flex items-center justify-center text-sm font-semibold",style:{background:"hsl(var(--accent))",color:"hsl(var(--accent-fg))"},children:"AA"}),M.jsxs(t2e,{"code-path":"src\\App.tsx:95:15",children:[M.jsx(n2e,{"code-path":"src\\App.tsx:96:17",asChild:!0,children:M.jsx("button",{"code-path":"src\\App.tsx:97:19",className:"h-9 w-9 flex items-center justify-center rounded-lg hover:bg-white/5 text-zinc-400 hover:text-white transition-colors outline-none",children:M.jsx(Vae,{"code-path":"src\\App.tsx:98:21",className:"w-5 h-5"})})}),M.jsxs(r2e,{"code-path":"src\\App.tsx:101:17",align:"end",className:"w-48 bg-[#0A0B10] border-white/10 text-zinc-200",children:[M.jsxs(CV,{"code-path":"src\\App.tsx:102:19",className:"cursor-pointer focus:bg-white/5",onClick:()=>e("settings"),children:[M.jsx(Nse,{"code-path":"src\\App.tsx:106:21",className:"mr-2 h-4 w-4 text-zinc-400"}),M.jsx("span",{"code-path":"src\\App.tsx:107:21",children:"Settings"})]}),M.jsx(i2e,{"code-path":"src\\App.tsx:109:19",className:"bg-white/10"}),M.jsxs(CV,{"code-path":"src\\App.tsx:110:19",className:"text-red-400 focus:text-red-400 focus:bg-red-500/10 cursor-pointer",onClick:()=>r(),children:[M.jsx(rse,{"code-path":"src\\App.tsx:111:21",className:"mr-2 h-4 w-4"}),M.jsx("span",{"code-path":"src\\App.tsx:112:21",children:"Log out"})]})]})]})]})]})}),M.jsx("div",{"code-path":"src\\App.tsx:121:9",className:"px-8 pb-8",children:M.jsx(Bs,{"code-path":"src\\App.tsx:122:11",mode:"wait",children:M.jsx(yt.div,{"code-path":"src\\App.tsx:123:13",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:[.4,0,.2,1]},children:M.jsx(i,{"code-path":"src\\App.tsx:133:15"})},t)})})]})]})}function l2e(){const{isAuthenticated:t}=ao();return M.jsx(Bs,{"code-path":"src\\App.tsx:146:5",mode:"wait",children:t?M.jsx(yt.div,{"code-path":"src\\App.tsx:158:9",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},children:M.jsx(o2e,{"code-path":"src\\App.tsx:165:11"})},"app"):M.jsx(yt.div,{"code-path":"src\\App.tsx:148:9",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},children:M.jsx(roe,{"code-path":"src\\App.tsx:155:11"})},"login")})}PV.createRoot(document.getElementById("root")).render(M.jsx(j.StrictMode,{"code-path":"src\\main.tsx:7:3",children:M.jsx(l2e,{"code-path":"src\\main.tsx:8:5"})}));