vendor: 6,138 bytes, lines 1-9
1var zk=e=>{throw TypeError(e)};var Ty=(e,t,r)=>t.has(e)||zk("Cannot "+r);var F=(e,t,r)=>(Ty(e,t,"read from private field"),r?r.call(e):t.get(e)),ge=(e,t,r)=>t.has(e)?zk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ae=(e,t,r,n)=>(Ty(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Oe=(e,t,r)=>(Ty(e,t,"access private method"),r);var yh=(e,t,r,n)=>({set _(i){ae(e,t,i,r)},get _(){return F(e,t,n)}});function MF(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(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 n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var xh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Le(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cT={exports:{}},Ig={},uT={exports:{}},Ee={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Bf=Symbol.for("react.element"),DF=Symbol.for("react.portal"),LF=Symbol.for("react.fragment"),FF=Symbol.for("react.strict_mode"),BF=Symbol.for("react.profiler"),WF=Symbol.for("react.provider"),UF=Symbol.for("react.context"),zF=Symbol.for("react.forward_ref"),VF=Symbol.for("react.suspense"),HF=Symbol.for("react.memo"),qF=Symbol.for("react.lazy"),Vk=Symbol.iterator;function GF(e){return e===null||typeof e!="object"?null:(e=Vk&&e[Vk]||e["@@iterator"],typeof e=="function"?e:null)}var dT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fT=Object.assign,hT={};function Dc(e,t,r){this.props=e,this.context=t,this.refs=hT,this.updater=r||dT}Dc.prototype.isReactComponent={};Dc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Dc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function mT(){}mT.prototype=Dc.prototype;function O1(e,t,r){this.props=e,this.context=t,this.refs=hT,this.updater=r||dT}var T1=O1.prototype=new mT;T1.constructor=O1;fT(T1,Dc.prototype);T1.isPureReactComponent=!0;var Hk=Array.isArray,pT=Object.prototype.hasOwnProperty,$1={current:null},gT={key:!0,ref:!0,__self:!0,__source:!0};function vT(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)pT.call(t,n)&&!gT.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Bf,type:e,key:a,ref:o,props:i,_owner:$1.current}}function KF(e,t){return{$$typeof:Bf,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function R1(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bf}function YF(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var qk=/\/+/g;function $y(e,t){return typeof e=="object"&&e!==null&&e.key!=null?YF(""+e.key):t.toString(36)}function bm(e,t,r,n,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Bf:case DF:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+$y(o,0):n,Hk(i)?(r="",e!=null&&(r=e.replace(qk,"$&/")+"/"),bm(i,t,r,"",function(u){return u})):i!=null&&(R1(i)&&(i=KF(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(qk,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",Hk(e))for(var l=0;l<e.length;l++){a=e[l];var c=n+$y(a,l);o+=bm(a,t,r,c,i)}else if(c=GF(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=n+$y(a,l++),o+=bm(a,t,r,c,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function bh(e,t,r){if(e==null)return e;var n=[],i=0;return bm(e,n,"","",function(a){return t.call(r,a,i++)}),n}function XF(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var mr={current:null},wm={transition:null},QF={ReactCurrentDispatcher:mr,ReactCurrentBatchConfig:wm,ReactCurrentOwner:$1};function yT(){throw Error("act(...) is not supported in production builds of React.")}Ee.Children={map:bh,forEach:function(e,t,r){bh(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return bh(e,function(){t++}),t},toArray:function(e){return bh(e,function(t){return t})||[]},only:function(e){if(!R1(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};
vendor: 5,860 bytes, lines 9-25
9Ee.Component=Dc;Ee.Fragment=LF;Ee.Profiler=BF;Ee.PureComponent=O1;Ee.StrictMode=FF;Ee.Suspense=VF;Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QF;Ee.act=yT;Ee.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=fT({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=$1.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)pT.call(t,c)&&!gT.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Bf,type:e.type,key:i,ref:a,props:n,_owner:o}};Ee.createContext=function(e){return e={$$typeof:UF,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:WF,_context:e},e.Consumer=e};Ee.createElement=vT;Ee.createFactory=function(e){var t=vT.bind(null,e);return t.type=e,t};Ee.createRef=function(){return{current:null}};Ee.forwardRef=function(e){return{$$typeof:zF,render:e}};Ee.isValidElement=R1;Ee.lazy=function(e){return{$$typeof:qF,_payload:{_status:-1,_result:e},_init:XF}};Ee.memo=function(e,t){return{$$typeof:HF,type:e,compare:t===void 0?null:t}};Ee.startTransition=function(e){var t=wm.transition;wm.transition={};try{e()}finally{wm.transition=t}};Ee.unstable_act=yT;Ee.useCallback=function(e,t){return mr.current.useCallback(e,t)};Ee.useContext=function(e){return mr.current.useContext(e)};Ee.useDebugValue=function(){};Ee.useDeferredValue=function(e){return mr.current.useDeferredValue(e)};Ee.useEffect=function(e,t){return mr.current.useEffect(e,t)};Ee.useId=function(){return mr.current.useId()};Ee.useImperativeHandle=function(e,t,r){return mr.current.useImperativeHandle(e,t,r)};Ee.useInsertionEffect=function(e,t){return mr.current.useInsertionEffect(e,t)};Ee.useLayoutEffect=function(e,t){return mr.current.useLayoutEffect(e,t)};Ee.useMemo=function(e,t){return mr.current.useMemo(e,t)};Ee.useReducer=function(e,t,r){return mr.current.useReducer(e,t,r)};Ee.useRef=function(e){return mr.current.useRef(e)};Ee.useState=function(e){return mr.current.useState(e)};Ee.useSyncExternalStore=function(e,t,r){return mr.current.useSyncExternalStore(e,t,r)};Ee.useTransition=function(){return mr.current.useTransition()};Ee.version="18.3.1";uT.exports=Ee;var w=uT.exports;const O=Le(w),I1=MF({__proto__:null,default:O},[w]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var JF=w,ZF=Symbol.for("react.element"),e6=Symbol.for("react.fragment"),t6=Object.prototype.hasOwnProperty,r6=JF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n6={key:!0,ref:!0,__self:!0,__source:!0};function xT(e,t,r){var n,i={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)t6.call(t,n)&&!n6.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:ZF,type:e,key:a,ref:o,props:i,_owner:r6.current}}Ig.Fragment=e6;Ig.jsx=xT;Ig.jsxs=xT;cT.exports=Ig;var s=cT.exports,bT={exports:{}},Gr={},wT={exports:{}},jT={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(e){function t(T,L){var B=T.length;T.push(L);e:for(;0<B;){var H=B-1>>>1,z=T[H];if(0<i(z,L))T[H]=L,T[B]=z,B=H;else break e}}function r(T){return T.length===0?null:T[0]}function n(T){if(T.length===0)return null;var L=T[0],B=T.pop();if(B!==L){T[0]=B;e:for(var H=0,z=T.length,q=z>>>1;H<q;){var te=2*(H+1)-1,ve=T[te],Pe=te+1,Q=T[Pe];if(0>i(ve,B))Pe<z&&0>i(Q,ve)?(T[H]=Q,T[Pe]=B,H=Pe):(T[H]=ve,T[te]=B,H=te);else if(Pe<z&&0>i(Q,B))T[H]=Q,T[Pe]=B,H=Pe;else break e}}return L}function i(T,L){var B=T.sortIndex-L.sortIndex;return B!==0?B:T.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,p=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(T){for(var L=r(u);L!==null;){if(L.callback===null)n(u);else if(L.startTime<=T)n(u),L.sortIndex=L.expirationTime,t(c,L);else break;L=r(u)}}function S(T){if(p=!1,b(T),!g)if(r(c)!==null)g=!0,M(j);else{var L=r(u);L!==null&&I(S,L.startTime-T)}}function j(T,L){g=!1,p&&(p=!1,x(_),_=-1),m=!0;var B=h;try{for(b(L),f=r(c);f!==null&&(!(f.expirationTime>L)||T&&!E());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var z=H(f.expirationTime<=L);L=e.unstable_now(),typeof z=="function"?f.callback=z:f===r(c)&&n(c),b(L)}else n(c);f=r(c)}if(f!==null)var q=!0;else{var te=r(u);te!==null&&I(S,te.startTime-L),q=!1}return q}finally{f=null,h=B,m=!1}}var N=!1,k=null,_=-1,C=5,P=-1;function E(){return!(e.unstable_now()-P<C)}function A(){if(k!==null){var T=e.unstable_now();P=T;var L=!0;try{L=k(!0,T)}finally{L?R():(N=!1,k=null)}}else N=!1}var R;if(typeof y=="function")R=function(){y(A)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,D=$.port2;$.port1.onmessage=A,R=function(){D.postMessage(null)}}else R=function(){v(A,0)};function M(T){k=T,N||(N=!0,R())}
vendor: 8,450 bytes, lines 25-34
25function I(T,L){_=v(function(){T(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,M(j))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var L=3;break;default:L=h}var B=h;h=L;try{return T()}finally{h=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,L){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var B=h;h=T;try{return L()}finally{h=B}},e.unstable_scheduleCallback=function(T,L,B){var H=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?H+B:H):B=H,T){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=B+z,T={id:d++,callback:L,priorityLevel:T,startTime:B,expirationTime:z,sortIndex:-1},B>H?(T.sortIndex=B,t(u,T),r(c)===null&&T===r(u)&&(p?(x(_),_=-1):p=!0,I(S,B-H))):(T.sortIndex=z,t(c,T),g||m||(g=!0,M(j))),T},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(T){var L=h;return function(){var B=h;h=L;try{return T.apply(this,arguments)}finally{h=B}}}})(jT);wT.exports=jT;var i6=wT.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var a6=w,qr=i6;function Y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ST=new Set,xd={};function ko(e,t){Xl(e,t),Xl(e+"Capture",t)}function Xl(e,t){for(xd[e]=t,e=0;e<t.length;e++)ST.add(t[e])}var Ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),o0=Object.prototype.hasOwnProperty,s6=/^[: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]*$/,Gk={},Kk={};function o6(e){return o0.call(Kk,e)?!0:o0.call(Gk,e)?!1:s6.test(e)?Kk[e]=!0:(Gk[e]=!0,!1)}function l6(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function c6(e,t,r,n){if(t===null||typeof t>"u"||l6(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function pr(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Yt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Yt[e]=new pr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Yt[t]=new pr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Yt[e]=new pr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Yt[e]=new pr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Yt[e]=new pr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Yt[e]=new pr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Yt[e]=new pr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Yt[e]=new pr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Yt[e]=new pr(e,5,!1,e.toLowerCase(),null,!1,!1)});var M1=/[\-:]([a-z])/g;function D1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(M1,D1);Yt[t]=new pr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(M1,D1);Yt[t]=new pr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(M1,D1);Yt[t]=new pr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Yt[e]=new pr(e,1,!1,e.toLowerCase(),null,!1,!1)});Yt.xlinkHref=new pr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Yt[e]=new pr(e,1,!1,e.toLowerCase(),null,!0,!0)});function L1(e,t,r,n){var i=Yt.hasOwnProperty(t)?Yt[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(c6(t,r,i,n)&&(r=null),n||i===null?o6(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var oa=a6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wh=Symbol.for("react.element"),ol=Symbol.for("react.portal"),ll=Symbol.for("react.fragment"),F1=Symbol.for("react.strict_mode"),l0=Symbol.for("react.profiler"),kT=Symbol.for("react.provider"),NT=Symbol.for("react.context"),B1=Symbol.for("react.forward_ref"),c0=Symbol.for("react.suspense"),u0=Symbol.for("react.suspense_list"),W1=Symbol.for("react.memo"),Sa=Symbol.for("react.lazy"),_T=Symbol.for("react.offscreen"),Yk=Symbol.iterator;function cu(e){return e===null||typeof e!="object"?null:(e=Yk&&e[Yk]||e["@@iterator"],typeof e=="function"?e:null)}var lt=Object.assign,Ry;function Fu(e){if(Ry===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ry=t&&t[1]||""}return` 34`+Ry+e}var Iy=!1;function My(e,t){if(!e||Iy)return"";Iy=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}
vendor: 14,090 bytes, lines 34-37
34catch(u){if(u&&n&&typeof u.stack=="string"){for(var i=u.stack.split(` 35`),a=n.stack.split(` 36`),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var c=` 37`+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Iy=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Fu(e):""}function u6(e){switch(e.tag){case 5:return Fu(e.type);case 16:return Fu("Lazy");case 13:return Fu("Suspense");case 19:return Fu("SuspenseList");case 0:case 2:case 15:return e=My(e.type,!1),e;case 11:return e=My(e.type.render,!1),e;case 1:return e=My(e.type,!0),e;default:return""}}function d0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ll:return"Fragment";case ol:return"Portal";case l0:return"Profiler";case F1:return"StrictMode";case c0:return"Suspense";case u0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case NT:return(e.displayName||"Context")+".Consumer";case kT:return(e._context.displayName||"Context")+".Provider";case B1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W1:return t=e.displayName||null,t!==null?t:d0(e.type)||"Memo";case Sa:t=e._payload,e=e._init;try{return d0(e(t))}catch{}}return null}function d6(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return d0(t);case 8:return t===F1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function is(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function CT(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function f6(e){var t=CT(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jh(e){e._valueTracker||(e._valueTracker=f6(e))}function AT(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=CT(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Um(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function f0(e,t){var r=t.checked;return lt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Xk(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=is(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ET(e,t){t=t.checked,t!=null&&L1(e,"checked",t,!1)}function h0(e,t){ET(e,t);var r=is(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?m0(e,t.type,r):t.hasOwnProperty("defaultValue")&&m0(e,t.type,is(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Qk(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function m0(e,t,r){(t!=="number"||Um(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Bu=Array.isArray;function Nl(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+is(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function p0(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Y(91));return lt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Jk(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Y(92));if(Bu(r)){if(1<r.length)throw Error(Y(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:is(r)}}function PT(e,t){var r=is(t.value),n=is(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Zk(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function OT(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function g0(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?OT(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Sh,TT=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Sh=Sh||document.createElement("div"),Sh.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Sh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bd(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Yu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},h6=["Webkit","ms","Moz","O"];Object.keys(Yu).forEach(function(e){h6.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yu[t]=Yu[e]})});function $T(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Yu.hasOwnProperty(e)&&Yu[e]?(""+t).trim():t+"px"}function RT(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=$T(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var m6=lt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function v0(e,t){if(t){if(m6[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Y(62))}}function y0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 x0=null;function U1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var b0=null,_l=null,Cl=null;function eN(e){if(e=zf(e)){if(typeof b0!="function")throw Error(Y(280));var t=e.stateNode;t&&(t=Bg(t),b0(e.stateNode,e.type,t))}}function IT(e){_l?Cl?Cl.push(e):Cl=[e]:_l=e}function MT(){if(_l){var e=_l,t=Cl;if(Cl=_l=null,eN(e),t)for(e=0;e<t.length;e++)eN(t[e])}}function DT(e,t){return e(t)}function LT(){}var Dy=!1;function FT(e,t,r){if(Dy)return e(t,r);Dy=!0;try{return DT(e,t,r)}finally{Dy=!1,(_l!==null||Cl!==null)&&(LT(),MT())}}function wd(e,t){var r=e.stateNode;if(r===null)return null;var n=Bg(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Y(231,t,typeof r));return r}var w0=!1;if(Ki)try{var uu={};Object.defineProperty(uu,"passive",{get:function(){w0=!0}}),window.addEventListener("test",uu,uu),window.removeEventListener("test",uu,uu)}catch{w0=!1}function p6(e,t,r,n,i,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Xu=!1,zm=null,Vm=!1,j0=null,g6={onError:function(e){Xu=!0,zm=e}};function v6(e,t,r,n,i,a,o,l,c){Xu=!1,zm=null,p6.apply(g6,arguments)}function y6(e,t,r,n,i,a,o,l,c){if(v6.apply(this,arguments),Xu){if(Xu){var u=zm;Xu=!1,zm=null}else throw Error(Y(198));Vm||(Vm=!0,j0=u)}}function No(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function BT(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function tN(e){if(No(e)!==e)throw Error(Y(188))}function x6(e){var t=e.alternate;if(!t){if(t=No(e),t===null)throw Error(Y(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return tN(i),e;if(a===n)return tN(i),t;a=a.sibling}throw Error(Y(188))}if(r.return!==n.return)r=i,n=a;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o)throw Error(Y(189))}}if(r.alternate!==n)throw Error(Y(190))}if(r.tag!==3)throw Error(Y(188));return r.stateNode.current===r?e:t}function WT(e){return e=x6(e),e!==null?UT(e):null}function UT(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=UT(e);if(t!==null)return t;e=e.sibling}return null}var zT=qr.unstable_scheduleCallback,rN=qr.unstable_cancelCallback,b6=qr.unstable_shouldYield,w6=qr.unstable_requestPaint,pt=qr.unstable_now,j6=qr.unstable_getCurrentPriorityLevel,z1=qr.unstable_ImmediatePriority,VT=qr.unstable_UserBlockingPriority,Hm=qr.unstable_NormalPriority,S6=qr.unstable_LowPriority,HT=qr.unstable_IdlePriority,Mg=null,fi=null;function k6(e){if(fi&&typeof fi.onCommitFiberRoot=="function")try{fi.onCommitFiberRoot(Mg,e,void 0,(e.current.flags&128)===128)}catch{}}var Bn=Math.clz32?Math.clz32:C6,N6=Math.log,_6=Math.LN2;function C6(e){return e>>>=0,e===0?32:31-(N6(e)/_6|0)|0}var kh=64,Nh=4194304;function Wu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function qm(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=Wu(l):(a&=o,a!==0&&(n=Wu(a)))}else o=r&~i,o!==0?n=Wu(o):a!==0&&(n=Wu(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Bn(t),i=1<<r,n|=e[r],t&=~i;return n}function A6(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function E6(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Bn(a),l=1<<o,c=i[o];c===-1?(!(l&r)||l&n)&&(i[o]=A6(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function S0(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function qT(){var e=kh;return kh<<=1,!(kh&4194240)&&(kh=64),e}function Ly(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 4,087 bytes, line 37
37function Wf(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Bn(t),e[t]=r}function P6(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Bn(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function V1(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Bn(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Fe=0;function GT(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var KT,H1,YT,XT,QT,k0=!1,_h=[],Ha=null,qa=null,Ga=null,jd=new Map,Sd=new Map,_a=[],O6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function nN(e,t){switch(e){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":jd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sd.delete(t.pointerId)}}function du(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=zf(t),t!==null&&H1(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function T6(e,t,r,n,i){switch(t){case"focusin":return Ha=du(Ha,e,t,r,n,i),!0;case"dragenter":return qa=du(qa,e,t,r,n,i),!0;case"mouseover":return Ga=du(Ga,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return jd.set(a,du(jd.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,Sd.set(a,du(Sd.get(a)||null,e,t,r,n,i)),!0}return!1}function JT(e){var t=Ms(e.target);if(t!==null){var r=No(t);if(r!==null){if(t=r.tag,t===13){if(t=BT(r),t!==null){e.blockedOn=t,QT(e.priority,function(){YT(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jm(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=N0(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);x0=n,r.target.dispatchEvent(n),x0=null}else return t=zf(r),t!==null&&H1(t),e.blockedOn=r,!1;t.shift()}return!0}function iN(e,t,r){jm(e)&&r.delete(t)}function $6(){k0=!1,Ha!==null&&jm(Ha)&&(Ha=null),qa!==null&&jm(qa)&&(qa=null),Ga!==null&&jm(Ga)&&(Ga=null),jd.forEach(iN),Sd.forEach(iN)}function fu(e,t){e.blockedOn===t&&(e.blockedOn=null,k0||(k0=!0,qr.unstable_scheduleCallback(qr.unstable_NormalPriority,$6)))}function kd(e){function t(i){return fu(i,e)}if(0<_h.length){fu(_h[0],e);for(var r=1;r<_h.length;r++){var n=_h[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Ha!==null&&fu(Ha,e),qa!==null&&fu(qa,e),Ga!==null&&fu(Ga,e),jd.forEach(t),Sd.forEach(t),r=0;r<_a.length;r++)n=_a[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<_a.length&&(r=_a[0],r.blockedOn===null);)JT(r),r.blockedOn===null&&_a.shift()}var Al=oa.ReactCurrentBatchConfig,Gm=!0;function R6(e,t,r,n){var i=Fe,a=Al.transition;Al.transition=null;try{Fe=1,q1(e,t,r,n)}finally{Fe=i,Al.transition=a}}function I6(e,t,r,n){var i=Fe,a=Al.transition;Al.transition=null;try{Fe=4,q1(e,t,r,n)}finally{Fe=i,Al.transition=a}}function q1(e,t,r,n){if(Gm){var i=N0(e,t,r,n);if(i===null)Ky(e,t,n,Km,r),nN(e,n);else if(T6(i,e,t,r,n))n.stopPropagation();else if(nN(e,n),t&4&&-1<O6.indexOf(e)){for(;i!==null;){var a=zf(i);if(a!==null&&KT(a),a=N0(e,t,r,n),a===null&&Ky(e,t,n,Km,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else Ky(e,t,n,null,r)}}var Km=null;function N0(e,t,r,n){if(Km=null,e=U1(n),e=Ms(e),e!==null)if(t=No(e),t===null)e=null;else if(r=t.tag,r===13){if(e=BT(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Km=e,null}
vendor: 10,401 bytes, line 37
37function ZT(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(j6()){case z1:return 1;case VT:return 4;case Hm:case S6:return 16;case HT:return 536870912;default:return 16}default:return 16}}var Ba=null,G1=null,Sm=null;function e2(){if(Sm)return Sm;var e,t=G1,r=t.length,n,i="value"in Ba?Ba.value:Ba.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[a-n];n++);return Sm=i.slice(e,1<n?1-n:void 0)}function km(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ch(){return!0}function aN(){return!1}function Kr(e){function t(r,n,i,a,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Ch:aN,this.isPropagationStopped=aN,this}return lt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ch)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ch)},persist:function(){},isPersistent:Ch}),t}var Lc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},K1=Kr(Lc),Uf=lt({},Lc,{view:0,detail:0}),M6=Kr(Uf),Fy,By,hu,Dg=lt({},Uf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Y1,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==hu&&(hu&&e.type==="mousemove"?(Fy=e.screenX-hu.screenX,By=e.screenY-hu.screenY):By=Fy=0,hu=e),Fy)},movementY:function(e){return"movementY"in e?e.movementY:By}}),sN=Kr(Dg),D6=lt({},Dg,{dataTransfer:0}),L6=Kr(D6),F6=lt({},Uf,{relatedTarget:0}),Wy=Kr(F6),B6=lt({},Lc,{animationName:0,elapsedTime:0,pseudoElement:0}),W6=Kr(B6),U6=lt({},Lc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),z6=Kr(U6),V6=lt({},Lc,{data:0}),oN=Kr(V6),H6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q6={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"},G6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K6(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=G6[e])?!!t[e]:!1}function Y1(){return K6}var Y6=lt({},Uf,{key:function(e){if(e.key){var t=H6[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=km(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?q6[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Y1,charCode:function(e){return e.type==="keypress"?km(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?km(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),X6=Kr(Y6),Q6=lt({},Dg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lN=Kr(Q6),J6=lt({},Uf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Y1}),Z6=Kr(J6),eB=lt({},Lc,{propertyName:0,elapsedTime:0,pseudoElement:0}),tB=Kr(eB),rB=lt({},Dg,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),nB=Kr(rB),iB=[9,13,27,32],X1=Ki&&"CompositionEvent"in window,Qu=null;Ki&&"documentMode"in document&&(Qu=document.documentMode);var aB=Ki&&"TextEvent"in window&&!Qu,t2=Ki&&(!X1||Qu&&8<Qu&&11>=Qu),cN=" ",uN=!1;function r2(e,t){switch(e){case"keyup":return iB.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function n2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cl=!1;function sB(e,t){switch(e){case"compositionend":return n2(t);case"keypress":return t.which!==32?null:(uN=!0,cN);case"textInput":return e=t.data,e===cN&&uN?null:e;default:return null}}function oB(e,t){if(cl)return e==="compositionend"||!X1&&r2(e,t)?(e=e2(),Sm=G1=Ba=null,cl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return t2&&t.locale!=="ko"?null:t.data;default:return null}}var lB={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 dN(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lB[e.type]:t==="textarea"}function i2(e,t,r,n){IT(n),t=Ym(t,"onChange"),0<t.length&&(r=new K1("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ju=null,Nd=null;function cB(e){p2(e,0)}function Lg(e){var t=fl(e);if(AT(t))return e}function uB(e,t){if(e==="change")return t}var a2=!1;if(Ki){var Uy;if(Ki){var zy="oninput"in document;if(!zy){var fN=document.createElement("div");fN.setAttribute("oninput","return;"),zy=typeof fN.oninput=="function"}Uy=zy}else Uy=!1;a2=Uy&&(!document.documentMode||9<document.documentMode)}function hN(){Ju&&(Ju.detachEvent("onpropertychange",s2),Nd=Ju=null)}function s2(e){if(e.propertyName==="value"&&Lg(Nd)){var t=[];i2(t,Nd,e,U1(e)),FT(cB,t)}}function dB(e,t,r){e==="focusin"?(hN(),Ju=t,Nd=r,Ju.attachEvent("onpropertychange",s2)):e==="focusout"&&hN()}function fB(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Lg(Nd)}function hB(e,t){if(e==="click")return Lg(t)}function mB(e,t){if(e==="input"||e==="change")return Lg(t)}function pB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qn=typeof Object.is=="function"?Object.is:pB;function _d(e,t){if(qn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!o0.call(t,i)||!qn(e[i],t[i]))return!1}return!0}function mN(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pN(e,t){var r=mN(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=mN(r)}}function o2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?o2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function l2(){for(var e=window,t=Um();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Um(e.document)}return t}function Q1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function gB(e){var t=l2(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&o2(r.ownerDocument.documentElement,r)){if(n!==null&&Q1(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=pN(r,a);var o=pN(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var vB=Ki&&"documentMode"in document&&11>=document.documentMode,ul=null,_0=null,Zu=null,C0=!1;function gN(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;C0||ul==null||ul!==Um(n)||(n=ul,"selectionStart"in n&&Q1(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),Zu&&_d(Zu,n)||(Zu=n,n=Ym(_0,"onSelect"),0<n.length&&(t=new K1("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=ul)))}function Ah(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var dl={animationend:Ah("Animation","AnimationEnd"),animationiteration:Ah("Animation","AnimationIteration"),animationstart:Ah("Animation","AnimationStart"),transitionend:Ah("Transition","TransitionEnd")},Vy={},c2={};Ki&&(c2=document.createElement("div").style,"AnimationEvent"in window||(delete dl.animationend.animation,delete dl.animationiteration.animation,delete dl.animationstart.animation),"TransitionEvent"in window||delete dl.transitionend.transition);function Fg(e){if(Vy[e])return Vy[e];if(!dl[e])return e;var t=dl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in c2)return Vy[e]=t[r];return e}var u2=Fg("animationend"),d2=Fg("animationiteration"),f2=Fg("animationstart"),h2=Fg("transitionend"),m2=new Map,vN="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function cs(e,t){m2.set(e,t),ko(t,[e])}for(var Hy=0;Hy<vN.length;Hy++){var qy=vN[Hy],yB=qy.toLowerCase(),xB=qy[0].toUpperCase()+qy.slice(1);cs(yB,"on"+xB)}cs(u2,"onAnimationEnd");cs(d2,"onAnimationIteration");cs(f2,"onAnimationStart");cs("dblclick","onDoubleClick");cs("focusin","onFocus");cs("focusout","onBlur");cs(h2,"onTransitionEnd");Xl("onMouseEnter",["mouseout","mouseover"]);Xl("onMouseLeave",["mouseout","mouseover"]);Xl("onPointerEnter",["pointerout","pointerover"]);Xl("onPointerLeave",["pointerout","pointerover"]);ko("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ko("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ko("onBeforeInput",["compositionend","keypress","textInput","paste"]);ko("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ko("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ko("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uu="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(" "),bB=new Set("cancel close invalid load scroll toggle".split(" ").concat(Uu));function yN(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,y6(n,t,void 0,e),e.currentTarget=null}function p2(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;yN(i,l,u),a=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;yN(i,l,u),a=c}}}if(Vm)throw e=j0,Vm=!1,j0=null,e}function Ze(e,t){var r=t[T0];r===void 0&&(r=t[T0]=new Set);var n=e+"__bubble";r.has(n)||(g2(t,e,2,!1),r.add(n))}function Gy(e,t,r){var n=0;t&&(n|=4),g2(r,e,n,t)}var Eh="_reactListening"+Math.random().toString(36).slice(2);function Cd(e){if(!e[Eh]){e[Eh]=!0,ST.forEach(function(r){r!=="selectionchange"&&(bB.has(r)||Gy(r,!1,e),Gy(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Eh]||(t[Eh]=!0,Gy("selectionchange",!1,t))}}function g2(e,t,r,n){switch(ZT(t)){case 1:var i=R6;break;case 4:i=I6;break;default:i=q1}r=i.bind(null,t,r,e),i=void 0,!w0||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Ky(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;
vendor: 5,572 bytes, lines 37-38
37if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;l!==null;){if(o=Ms(l),o===null)return;if(c=o.tag,c===5||c===6){n=a=o;continue e}l=l.parentNode}}n=n.return}FT(function(){var u=a,d=U1(r),f=[];e:{var h=m2.get(e);if(h!==void 0){var m=K1,g=e;switch(e){case"keypress":if(km(r)===0)break e;case"keydown":case"keyup":m=X6;break;case"focusin":g="focus",m=Wy;break;case"focusout":g="blur",m=Wy;break;case"beforeblur":case"afterblur":m=Wy;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=sN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=L6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Z6;break;case u2:case d2:case f2:m=W6;break;case h2:m=tB;break;case"scroll":m=M6;break;case"wheel":m=nB;break;case"copy":case"cut":case"paste":m=z6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=lN}var p=(t&4)!==0,v=!p&&e==="scroll",x=p?h!==null?h+"Capture":null:h;p=[];for(var y=u,b;y!==null;){b=y;var S=b.stateNode;if(b.tag===5&&S!==null&&(b=S,x!==null&&(S=wd(y,x),S!=null&&p.push(Ad(y,S,b)))),v)break;y=y.return}0<p.length&&(h=new m(h,g,null,r,d),f.push({event:h,listeners:p}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&r!==x0&&(g=r.relatedTarget||r.fromElement)&&(Ms(g)||g[Yi]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=r.relatedTarget||r.toElement,m=u,g=g?Ms(g):null,g!==null&&(v=No(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(p=sN,S="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(p=lN,S="onPointerLeave",x="onPointerEnter",y="pointer"),v=m==null?h:fl(m),b=g==null?h:fl(g),h=new p(S,y+"leave",m,r,d),h.target=v,h.relatedTarget=b,S=null,Ms(d)===u&&(p=new p(x,y+"enter",g,r,d),p.target=b,p.relatedTarget=v,S=p),v=S,m&&g)t:{for(p=m,x=g,y=0,b=p;b;b=Fo(b))y++;for(b=0,S=x;S;S=Fo(S))b++;for(;0<y-b;)p=Fo(p),y--;for(;0<b-y;)x=Fo(x),b--;for(;y--;){if(p===x||x!==null&&p===x.alternate)break t;p=Fo(p),x=Fo(x)}p=null}else p=null;m!==null&&xN(f,h,m,p,!1),g!==null&&v!==null&&xN(f,v,g,p,!0)}}e:{if(h=u?fl(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var j=uB;else if(dN(h))if(a2)j=mB;else{j=fB;var N=dB}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=hB);if(j&&(j=j(e,u))){i2(f,j,r,d);break e}N&&N(e,h,u),e==="focusout"&&(N=h._wrapperState)&&N.controlled&&h.type==="number"&&m0(h,"number",h.value)}switch(N=u?fl(u):window,e){case"focusin":(dN(N)||N.contentEditable==="true")&&(ul=N,_0=u,Zu=null);break;case"focusout":Zu=_0=ul=null;break;case"mousedown":C0=!0;break;case"contextmenu":case"mouseup":case"dragend":C0=!1,gN(f,r,d);break;case"selectionchange":if(vB)break;case"keydown":case"keyup":gN(f,r,d)}var k;if(X1)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else cl?r2(e,r)&&(_="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(_="onCompositionStart");_&&(t2&&r.locale!=="ko"&&(cl||_!=="onCompositionStart"?_==="onCompositionEnd"&&cl&&(k=e2()):(Ba=d,G1="value"in Ba?Ba.value:Ba.textContent,cl=!0)),N=Ym(u,_),0<N.length&&(_=new oN(_,e,null,r,d),f.push({event:_,listeners:N}),k?_.data=k:(k=n2(r),k!==null&&(_.data=k)))),(k=aB?sB(e,r):oB(e,r))&&(u=Ym(u,"onBeforeInput"),0<u.length&&(d=new oN("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=k))}p2(f,t)})}function Ad(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Ym(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=wd(e,r),a!=null&&n.unshift(Ad(e,a,i)),a=wd(e,t),a!=null&&n.push(Ad(e,a,i))),e=e.return}return n}function Fo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xN(e,t,r,n,i){for(var a=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,i?(c=wd(r,a),c!=null&&o.unshift(Ad(r,c,l))):i||(c=wd(r,a),c!=null&&o.push(Ad(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var wB=/\r\n?/g,jB=/\u0000|\uFFFD/g;function bN(e){return(typeof e=="string"?e:""+e).replace(wB,` 38`).replace(jB,"")}function Ph(e,t,r){if(t=bN(t),bN(e)!==t&&r)throw Error(Y(425))}function Xm(){}var A0=null,E0=null;function P0(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var O0=typeof setTimeout=="function"?setTimeout:void 0,SB=typeof clearTimeout=="function"?clearTimeout:void 0,wN=typeof Promise=="function"?Promise:void 0,kB=typeof queueMicrotask=="function"?queueMicrotask:typeof wN<"u"?function(e){return wN.resolve(null).then(e).catch(NB)}:O0;function NB(e){setTimeout(function(){throw e})}function Yy(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),kd(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}
vendor: 4,658 bytes, line 38
38while(r);kd(t)}function Ka(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function jN(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Fc=Math.random().toString(36).slice(2),oi="__reactFiber$"+Fc,Ed="__reactProps$"+Fc,Yi="__reactContainer$"+Fc,T0="__reactEvents$"+Fc,_B="__reactListeners$"+Fc,CB="__reactHandles$"+Fc;function Ms(e){var t=e[oi];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Yi]||r[oi]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=jN(e);e!==null;){if(r=e[oi])return r;e=jN(e)}return t}e=r,r=e.parentNode}return null}function zf(e){return e=e[oi]||e[Yi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function fl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Y(33))}function Bg(e){return e[Ed]||null}var $0=[],hl=-1;function us(e){return{current:e}}function rt(e){0>hl||(e.current=$0[hl],$0[hl]=null,hl--)}function Xe(e,t){hl++,$0[hl]=e.current,e.current=t}var as={},nr=us(as),_r=us(!1),so=as;function Ql(e,t){var r=e.type.contextTypes;if(!r)return as;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Cr(e){return e=e.childContextTypes,e!=null}function Qm(){rt(_r),rt(nr)}function SN(e,t,r){if(nr.current!==as)throw Error(Y(168));Xe(nr,t),Xe(_r,r)}function v2(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Y(108,d6(e)||"Unknown",i));return lt({},r,n)}function Jm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||as,so=nr.current,Xe(nr,e),Xe(_r,_r.current),!0}function kN(e,t,r){var n=e.stateNode;if(!n)throw Error(Y(169));r?(e=v2(e,t,so),n.__reactInternalMemoizedMergedChildContext=e,rt(_r),rt(nr),Xe(nr,e)):rt(_r),Xe(_r,r)}var Mi=null,Wg=!1,Xy=!1;function y2(e){Mi===null?Mi=[e]:Mi.push(e)}function AB(e){Wg=!0,y2(e)}function ds(){if(!Xy&&Mi!==null){Xy=!0;var e=0,t=Fe;try{var r=Mi;for(Fe=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Mi=null,Wg=!1}catch(i){throw Mi!==null&&(Mi=Mi.slice(e+1)),zT(z1,ds),i}finally{Fe=t,Xy=!1}}return null}var ml=[],pl=0,Zm=null,ep=0,an=[],sn=0,oo=null,Li=1,Fi="";function As(e,t){ml[pl++]=ep,ml[pl++]=Zm,Zm=e,ep=t}function x2(e,t,r){an[sn++]=Li,an[sn++]=Fi,an[sn++]=oo,oo=e;var n=Li;e=Fi;var i=32-Bn(n)-1;n&=~(1<<i),r+=1;var a=32-Bn(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Li=1<<32-Bn(t)+i|r<<i|n,Fi=a+e}else Li=1<<a|r<<i|n,Fi=e}function J1(e){e.return!==null&&(As(e,1),x2(e,1,0))}function Z1(e){for(;e===Zm;)Zm=ml[--pl],ml[pl]=null,ep=ml[--pl],ml[pl]=null;for(;e===oo;)oo=an[--sn],an[sn]=null,Fi=an[--sn],an[sn]=null,Li=an[--sn],an[sn]=null}var Wr=null,Br=null,it=!1,Dn=null;function b2(e,t){var r=ln(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function NN(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Wr=e,Br=Ka(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Wr=e,Br=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=oo!==null?{id:Li,overflow:Fi}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ln(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Wr=e,Br=null,!0):!1;default:return!1}}function R0(e){return(e.mode&1)!==0&&(e.flags&128)===0}function I0(e){if(it){var t=Br;if(t){var r=t;if(!NN(e,t)){if(R0(e))throw Error(Y(418));t=Ka(r.nextSibling);var n=Wr;t&&NN(e,t)?b2(n,r):(e.flags=e.flags&-4097|2,it=!1,Wr=e)}}else{if(R0(e))throw Error(Y(418));e.flags=e.flags&-4097|2,it=!1,Wr=e}}}function _N(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wr=e}function Oh(e){if(e!==Wr)return!1;if(!it)return _N(e),it=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!P0(e.type,e.memoizedProps)),t&&(t=Br)){if(R0(e))throw w2(),Error(Y(418));for(;t;)b2(e,t),t=Ka(t.nextSibling)}if(_N(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Y(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Br=Ka(e.nextSibling);break e}t--}
vendor: 11,483 bytes, line 38
38else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Br=null}}else Br=Wr?Ka(e.stateNode.nextSibling):null;return!0}function w2(){for(var e=Br;e;)e=Ka(e.nextSibling)}function Jl(){Br=Wr=null,it=!1}function ej(e){Dn===null?Dn=[e]:Dn.push(e)}var EB=oa.ReactCurrentBatchConfig;function mu(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Y(309));var n=r.stateNode}if(!n)throw Error(Y(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(Y(284));if(!r._owner)throw Error(Y(290,e))}return e}function Th(e,t){throw e=Object.prototype.toString.call(t),Error(Y(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function CN(e){var t=e._init;return t(e._payload)}function j2(e){function t(x,y){if(e){var b=x.deletions;b===null?(x.deletions=[y],x.flags|=16):b.push(y)}}function r(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function n(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function i(x,y){return x=Ja(x,y),x.index=0,x.sibling=null,x}function a(x,y,b){return x.index=b,e?(b=x.alternate,b!==null?(b=b.index,b<y?(x.flags|=2,y):b):(x.flags|=2,y)):(x.flags|=1048576,y)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,y,b,S){return y===null||y.tag!==6?(y=nx(b,x.mode,S),y.return=x,y):(y=i(y,b),y.return=x,y)}function c(x,y,b,S){var j=b.type;return j===ll?d(x,y,b.props.children,S,b.key):y!==null&&(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Sa&&CN(j)===y.type)?(S=i(y,b.props),S.ref=mu(x,y,b),S.return=x,S):(S=Om(b.type,b.key,b.props,null,x.mode,S),S.ref=mu(x,y,b),S.return=x,S)}function u(x,y,b,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=ix(b,x.mode,S),y.return=x,y):(y=i(y,b.children||[]),y.return=x,y)}function d(x,y,b,S,j){return y===null||y.tag!==7?(y=ro(b,x.mode,S,j),y.return=x,y):(y=i(y,b),y.return=x,y)}function f(x,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=nx(""+y,x.mode,b),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case wh:return b=Om(y.type,y.key,y.props,null,x.mode,b),b.ref=mu(x,null,y),b.return=x,b;case ol:return y=ix(y,x.mode,b),y.return=x,y;case Sa:var S=y._init;return f(x,S(y._payload),b)}if(Bu(y)||cu(y))return y=ro(y,x.mode,b,null),y.return=x,y;Th(x,y)}return null}function h(x,y,b,S){var j=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return j!==null?null:l(x,y,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case wh:return b.key===j?c(x,y,b,S):null;case ol:return b.key===j?u(x,y,b,S):null;case Sa:return j=b._init,h(x,y,j(b._payload),S)}if(Bu(b)||cu(b))return j!==null?null:d(x,y,b,S,null);Th(x,b)}return null}function m(x,y,b,S,j){if(typeof S=="string"&&S!==""||typeof S=="number")return x=x.get(b)||null,l(y,x,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case wh:return x=x.get(S.key===null?b:S.key)||null,c(y,x,S,j);case ol:return x=x.get(S.key===null?b:S.key)||null,u(y,x,S,j);case Sa:var N=S._init;return m(x,y,b,N(S._payload),j)}if(Bu(S)||cu(S))return x=x.get(b)||null,d(y,x,S,j,null);Th(y,S)}return null}function g(x,y,b,S){for(var j=null,N=null,k=y,_=y=0,C=null;k!==null&&_<b.length;_++){k.index>_?(C=k,k=null):C=k.sibling;var P=h(x,k,b[_],S);if(P===null){k===null&&(k=C);break}e&&k&&P.alternate===null&&t(x,k),y=a(P,y,_),N===null?j=P:N.sibling=P,N=P,k=C}if(_===b.length)return r(x,k),it&&As(x,_),j;if(k===null){for(;_<b.length;_++)k=f(x,b[_],S),k!==null&&(y=a(k,y,_),N===null?j=k:N.sibling=k,N=k);return it&&As(x,_),j}for(k=n(x,k);_<b.length;_++)C=m(k,x,_,b[_],S),C!==null&&(e&&C.alternate!==null&&k.delete(C.key===null?_:C.key),y=a(C,y,_),N===null?j=C:N.sibling=C,N=C);return e&&k.forEach(function(E){return t(x,E)}),it&&As(x,_),j}function p(x,y,b,S){var j=cu(b);if(typeof j!="function")throw Error(Y(150));if(b=j.call(b),b==null)throw Error(Y(151));for(var N=j=null,k=y,_=y=0,C=null,P=b.next();k!==null&&!P.done;_++,P=b.next()){k.index>_?(C=k,k=null):C=k.sibling;var E=h(x,k,P.value,S);if(E===null){k===null&&(k=C);break}e&&k&&E.alternate===null&&t(x,k),y=a(E,y,_),N===null?j=E:N.sibling=E,N=E,k=C}if(P.done)return r(x,k),it&&As(x,_),j;if(k===null){for(;!P.done;_++,P=b.next())P=f(x,P.value,S),P!==null&&(y=a(P,y,_),N===null?j=P:N.sibling=P,N=P);return it&&As(x,_),j}for(k=n(x,k);!P.done;_++,P=b.next())P=m(k,x,_,P.value,S),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?_:P.key),y=a(P,y,_),N===null?j=P:N.sibling=P,N=P);return e&&k.forEach(function(A){return t(x,A)}),it&&As(x,_),j}function v(x,y,b,S){if(typeof b=="object"&&b!==null&&b.type===ll&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case wh:e:{for(var j=b.key,N=y;N!==null;){if(N.key===j){if(j=b.type,j===ll){if(N.tag===7){r(x,N.sibling),y=i(N,b.props.children),y.return=x,x=y;break e}}else if(N.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Sa&&CN(j)===N.type){r(x,N.sibling),y=i(N,b.props),y.ref=mu(x,N,b),y.return=x,x=y;break e}r(x,N);break}else t(x,N);N=N.sibling}b.type===ll?(y=ro(b.props.children,x.mode,S,b.key),y.return=x,x=y):(S=Om(b.type,b.key,b.props,null,x.mode,S),S.ref=mu(x,y,b),S.return=x,x=S)}return o(x);case ol:e:{for(N=b.key;y!==null;){if(y.key===N)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){r(x,y.sibling),y=i(y,b.children||[]),y.return=x,x=y;break e}else{r(x,y);break}else t(x,y);y=y.sibling}y=ix(b,x.mode,S),y.return=x,x=y}return o(x);case Sa:return N=b._init,v(x,y,N(b._payload),S)}if(Bu(b))return g(x,y,b,S);if(cu(b))return p(x,y,b,S);Th(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(r(x,y.sibling),y=i(y,b),y.return=x,x=y):(r(x,y),y=nx(b,x.mode,S),y.return=x,x=y),o(x)):r(x,y)}return v}var Zl=j2(!0),S2=j2(!1),tp=us(null),rp=null,gl=null,tj=null;function rj(){tj=gl=rp=null}function nj(e){var t=tp.current;rt(tp),e._currentValue=t}function M0(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function El(e,t){rp=e,tj=gl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Sr=!0),e.firstContext=null)}function hn(e){var t=e._currentValue;if(tj!==e)if(e={context:e,memoizedValue:t,next:null},gl===null){if(rp===null)throw Error(Y(308));gl=e,rp.dependencies={lanes:0,firstContext:e}}else gl=gl.next=e;return t}var Ds=null;function ij(e){Ds===null?Ds=[e]:Ds.push(e)}function k2(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,ij(t)):(r.next=i.next,i.next=r),t.interleaved=r,Xi(e,n)}function Xi(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var ka=!1;function aj(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function N2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function zi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,$e&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Xi(e,r)}return i=n.interleaved,i===null?(t.next=t,ij(n)):(t.next=i.next,i.next=t),n.interleaved=t,Xi(e,r)}function Nm(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,V1(e,r)}}function AN(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function np(e,t,r,n){var i=e.updateQueue;ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=i.baseState;o=0,d=u=c=null,l=a;do{var h=l.lane,m=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,p=l;switch(h=t,m=r,p.tag){case 1:if(g=p.payload,typeof g=="function"){f=g.call(m,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,h=typeof g=="function"?g.call(m,f,h):g,h==null)break e;f=lt({},f,h);break e;case 2:ka=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);co|=o,e.lanes=o,e.memoizedState=f}}function EN(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(Y(191,i));i.call(n)}}}var Vf={},hi=us(Vf),Pd=us(Vf),Od=us(Vf);function Ls(e){if(e===Vf)throw Error(Y(174));return e}function sj(e,t){switch(Xe(Od,t),Xe(Pd,e),Xe(hi,Vf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:g0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=g0(t,e)}rt(hi),Xe(hi,t)}function ec(){rt(hi),rt(Pd),rt(Od)}function _2(e){Ls(Od.current);var t=Ls(hi.current),r=g0(t,e.type);t!==r&&(Xe(Pd,e),Xe(hi,r))}function oj(e){Pd.current===e&&(rt(hi),rt(Pd))}var st=us(0);function ip(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qy=[];function lj(){for(var e=0;e<Qy.length;e++)Qy[e]._workInProgressVersionPrimary=null;Qy.length=0}var _m=oa.ReactCurrentDispatcher,Jy=oa.ReactCurrentBatchConfig,lo=0,ot=null,Nt=null,$t=null,ap=!1,ed=!1,Td=0,PB=0;function Xt(){throw Error(Y(321))}function cj(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!qn(e[r],t[r]))return!1;return!0}function uj(e,t,r,n,i,a){if(lo=a,ot=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_m.current=e===null||e.memoizedState===null?RB:IB,e=r(n,i),ed){a=0;
vendor: 6,592 bytes, line 38
38do{if(ed=!1,Td=0,25<=a)throw Error(Y(301));a+=1,$t=Nt=null,t.updateQueue=null,_m.current=MB,e=r(n,i)}while(ed)}if(_m.current=sp,t=Nt!==null&&Nt.next!==null,lo=0,$t=Nt=ot=null,ap=!1,t)throw Error(Y(300));return e}function dj(){var e=Td!==0;return Td=0,e}function ti(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?ot.memoizedState=$t=e:$t=$t.next=e,$t}function mn(){if(Nt===null){var e=ot.alternate;e=e!==null?e.memoizedState:null}else e=Nt.next;var t=$t===null?ot.memoizedState:$t.next;if(t!==null)$t=t,Nt=e;else{if(e===null)throw Error(Y(310));Nt=e,e={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},$t===null?ot.memoizedState=$t=e:$t=$t.next=e}return $t}function $d(e,t){return typeof t=="function"?t(e):t}function Zy(e){var t=mn(),r=t.queue;if(r===null)throw Error(Y(311));r.lastRenderedReducer=e;var n=Nt,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((lo&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=n):c=c.next=f,ot.lanes|=d,co|=d}u=u.next}while(u!==null&&u!==a);c===null?o=n:c.next=l,qn(n,t.memoizedState)||(Sr=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,ot.lanes|=a,co|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ex(e){var t=mn(),r=t.queue;if(r===null)throw Error(Y(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);qn(a,t.memoizedState)||(Sr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function C2(){}function A2(e,t){var r=ot,n=mn(),i=t(),a=!qn(n.memoizedState,i);if(a&&(n.memoizedState=i,Sr=!0),n=n.queue,fj(O2.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||$t!==null&&$t.memoizedState.tag&1){if(r.flags|=2048,Rd(9,P2.bind(null,r,n,i,t),void 0,null),It===null)throw Error(Y(349));lo&30||E2(r,t,i)}return i}function E2(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ot.updateQueue,t===null?(t={lastEffect:null,stores:null},ot.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function P2(e,t,r,n){t.value=r,t.getSnapshot=n,T2(t)&&$2(e)}function O2(e,t,r){return r(function(){T2(t)&&$2(e)})}function T2(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!qn(e,r)}catch{return!0}}function $2(e){var t=Xi(e,1);t!==null&&Wn(t,e,1,-1)}function PN(e){var t=ti();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$d,lastRenderedState:e},t.queue=e,e=e.dispatch=$B.bind(null,ot,e),[t.memoizedState,e]}function Rd(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ot.updateQueue,t===null?(t={lastEffect:null,stores:null},ot.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function R2(){return mn().memoizedState}function Cm(e,t,r,n){var i=ti();ot.flags|=e,i.memoizedState=Rd(1|t,r,void 0,n===void 0?null:n)}function Ug(e,t,r,n){var i=mn();n=n===void 0?null:n;var a=void 0;if(Nt!==null){var o=Nt.memoizedState;if(a=o.destroy,n!==null&&cj(n,o.deps)){i.memoizedState=Rd(t,r,a,n);return}}ot.flags|=e,i.memoizedState=Rd(1|t,r,a,n)}function ON(e,t){return Cm(8390656,8,e,t)}function fj(e,t){return Ug(2048,8,e,t)}function I2(e,t){return Ug(4,2,e,t)}function M2(e,t){return Ug(4,4,e,t)}function D2(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function L2(e,t,r){return r=r!=null?r.concat([e]):null,Ug(4,4,D2.bind(null,t,e),r)}function hj(){}function F2(e,t){var r=mn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&cj(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function B2(e,t){var r=mn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&cj(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function W2(e,t,r){return lo&21?(qn(r,t)||(r=qT(),ot.lanes|=r,co|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Sr=!0),e.memoizedState=r)}function OB(e,t){var r=Fe;Fe=r!==0&&4>r?r:4,e(!0);var n=Jy.transition;Jy.transition={};try{e(!1),t()}finally{Fe=r,Jy.transition=n}}function U2(){return mn().memoizedState}function TB(e,t,r){var n=Qa(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},z2(e))V2(t,r);else if(r=k2(e,t,r,n),r!==null){var i=ur();Wn(r,e,n,i),H2(r,t,n)}}function $B(e,t,r){var n=Qa(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(z2(e))V2(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,r);if(i.hasEagerState=!0,i.eagerState=l,qn(l,o)){var c=t.interleaved;c===null?(i.next=i,ij(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}r=k2(e,t,i,n),r!==null&&(i=ur(),Wn(r,e,n,i),H2(r,t,n))}}function z2(e){var t=e.alternate;return e===ot||t!==null&&t===ot}function V2(e,t){ed=ap=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function H2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,V1(e,r)}}var sp={readContext:hn,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},RB={readContext:hn,useCallback:function(e,t){return ti().memoizedState=[e,t===void 0?null:t],e},useContext:hn,useEffect:ON,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Cm(4194308,4,D2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Cm(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cm(4,2,e,t)},useMemo:function(e,t){var r=ti();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ti();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=TB.bind(null,ot,e),[n.memoizedState,e]}
vendor: 7,431 bytes, lines 38-40
38,useRef:function(e){var t=ti();return e={current:e},t.memoizedState=e},useState:PN,useDebugValue:hj,useDeferredValue:function(e){return ti().memoizedState=e},useTransition:function(){var e=PN(!1),t=e[0];return e=OB.bind(null,e[1]),ti().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ot,i=ti();if(it){if(r===void 0)throw Error(Y(407));r=r()}else{if(r=t(),It===null)throw Error(Y(349));lo&30||E2(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,ON(O2.bind(null,n,a,e),[e]),n.flags|=2048,Rd(9,P2.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ti(),t=It.identifierPrefix;if(it){var r=Fi,n=Li;r=(n&~(1<<32-Bn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Td++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=PB++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},IB={readContext:hn,useCallback:F2,useContext:hn,useEffect:fj,useImperativeHandle:L2,useInsertionEffect:I2,useLayoutEffect:M2,useMemo:B2,useReducer:Zy,useRef:R2,useState:function(){return Zy($d)},useDebugValue:hj,useDeferredValue:function(e){var t=mn();return W2(t,Nt.memoizedState,e)},useTransition:function(){var e=Zy($d)[0],t=mn().memoizedState;return[e,t]},useMutableSource:C2,useSyncExternalStore:A2,useId:U2,unstable_isNewReconciler:!1},MB={readContext:hn,useCallback:F2,useContext:hn,useEffect:fj,useImperativeHandle:L2,useInsertionEffect:I2,useLayoutEffect:M2,useMemo:B2,useReducer:ex,useRef:R2,useState:function(){return ex($d)},useDebugValue:hj,useDeferredValue:function(e){var t=mn();return Nt===null?t.memoizedState=e:W2(t,Nt.memoizedState,e)},useTransition:function(){var e=ex($d)[0],t=mn().memoizedState;return[e,t]},useMutableSource:C2,useSyncExternalStore:A2,useId:U2,unstable_isNewReconciler:!1};function Pn(e,t){if(e&&e.defaultProps){t=lt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function D0(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:lt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var zg={isMounted:function(e){return(e=e._reactInternals)?No(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=ur(),i=Qa(e),a=zi(n,i);a.payload=t,r!=null&&(a.callback=r),t=Ya(e,a,i),t!==null&&(Wn(t,e,i,n),Nm(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=ur(),i=Qa(e),a=zi(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Ya(e,a,i),t!==null&&(Wn(t,e,i,n),Nm(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=ur(),n=Qa(e),i=zi(r,n);i.tag=2,t!=null&&(i.callback=t),t=Ya(e,i,n),t!==null&&(Wn(t,e,n,r),Nm(t,e,n))}};function TN(e,t,r,n,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,o):t.prototype&&t.prototype.isPureReactComponent?!_d(r,n)||!_d(i,a):!0}function q2(e,t,r){var n=!1,i=as,a=t.contextType;return typeof a=="object"&&a!==null?a=hn(a):(i=Cr(t)?so:nr.current,n=t.contextTypes,a=(n=n!=null)?Ql(e,i):as),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=zg,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function $N(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&zg.enqueueReplaceState(t,t.state,null)}function L0(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},aj(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=hn(a):(a=Cr(t)?so:nr.current,i.context=Ql(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(D0(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&zg.enqueueReplaceState(i,i.state,null),np(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function tc(e,t){try{var r="",n=t;do r+=u6(n),n=n.return;while(n);var i=r}catch(a){i=` 39Error generating stack: `+a.message+` 40`+a.stack}return{value:e,source:t,stack:i,digest:null}}function tx(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function F0(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var DB=typeof WeakMap=="function"?WeakMap:Map;function G2(e,t,r){r=zi(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){lp||(lp=!0,Y0=n),F0(e,t)},r}function K2(e,t,r){r=zi(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){F0(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){F0(e,t),typeof n!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function RN(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new DB;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=QB.bind(null,e,t,r),t.then(e,e))}function IN(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function MN(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=zi(-1,1),t.tag=2,Ya(r,t,1))),r.lanes|=1),e)}var LB=oa.ReactCurrentOwner,Sr=!1;function sr(e,t,r,n){t.child=e===null?S2(t,null,r,n):Zl(t,e.child,r,n)}function DN(e,t,r,n,i){r=r.render;var a=t.ref;return El(t,i),n=uj(e,t,r,n,a,i),r=dj(),e!==null&&!Sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qi(e,t,i)):(it&&r&&J1(t),t.flags|=1,sr(e,t,n,i),t.child)}function LN(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!wj(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,Y2(e,t,a,n,i)):(e=Om(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:_d,r(o,n)&&e.ref===t.ref)return Qi(e,t,i)}return t.flags|=1,e=Ja(a,n),e.ref=t.ref,e.return=t,t.child=e}function Y2(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(_d(a,n)&&e.ref===t.ref)if(Sr=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(Sr=!0);else return t.lanes=e.lanes,Qi(e,t,i)}return B0(e,t,r,n,i)}function X2(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xe(yl,Ir),Ir|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Xe(yl,Ir),Ir|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Xe(yl,Ir),Ir|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Xe(yl,Ir),Ir|=n;return sr(e,t,i,r),t.child}function Q2(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}
vendor: 4,711 bytes, line 40
40function B0(e,t,r,n,i){var a=Cr(r)?so:nr.current;return a=Ql(t,a),El(t,i),r=uj(e,t,r,n,a,i),n=dj(),e!==null&&!Sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qi(e,t,i)):(it&&n&&J1(t),t.flags|=1,sr(e,t,r,i),t.child)}function FN(e,t,r,n,i){if(Cr(r)){var a=!0;Jm(t)}else a=!1;if(El(t,i),t.stateNode===null)Am(e,t),q2(t,r,n),L0(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=hn(u):(u=Cr(r)?so:nr.current,u=Ql(t,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==u)&&$N(t,o,n,u),ka=!1;var h=t.memoizedState;o.state=h,np(t,n,o,i),c=t.memoizedState,l!==n||h!==c||_r.current||ka?(typeof d=="function"&&(D0(t,r,d,n),c=t.memoizedState),(l=ka||TN(t,r,l,n,h,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=u,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,N2(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Pn(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=hn(c):(c=Cr(r)?so:nr.current,c=Ql(t,c));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||h!==c)&&$N(t,o,n,c),ka=!1,h=t.memoizedState,o.state=h,np(t,n,o,i);var g=t.memoizedState;l!==f||h!==g||_r.current||ka?(typeof m=="function"&&(D0(t,r,m,n),g=t.memoizedState),(u=ka||TN(t,r,u,n,h,g,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,g,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),o.props=n,o.state=g,o.context=c,n=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return W0(e,t,r,n,a,i)}function W0(e,t,r,n,i,a){Q2(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&kN(t,r,!1),Qi(e,t,a);n=t.stateNode,LB.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Zl(t,e.child,null,a),t.child=Zl(t,null,l,a)):sr(e,t,l,a),t.memoizedState=n.state,i&&kN(t,r,!0),t.child}function J2(e){var t=e.stateNode;t.pendingContext?SN(e,t.pendingContext,t.pendingContext!==t.context):t.context&&SN(e,t.context,!1),sj(e,t.containerInfo)}function BN(e,t,r,n,i){return Jl(),ej(i),t.flags|=256,sr(e,t,r,n),t.child}var U0={dehydrated:null,treeContext:null,retryLane:0};function z0(e){return{baseLanes:e,cachePool:null,transitions:null}}function Z2(e,t,r){var n=t.pendingProps,i=st.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Xe(st,i&1),e===null)return I0(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=qg(o,n,0,null),e=ro(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=z0(r),t.memoizedState=U0,e):mj(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return FB(e,t,o,n,l,i,r);if(a){a=n.fallback,o=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Ja(i,c),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Ja(l,a):(a=ro(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?z0(r):{base
vendor: 7,641 bytes, line 40
40Lanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=U0,n}return a=e.child,e=a.sibling,n=Ja(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function mj(e,t){return t=qg({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function $h(e,t,r,n){return n!==null&&ej(n),Zl(t,e.child,null,r),e=mj(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function FB(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=tx(Error(Y(422))),$h(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=qg({mode:"visible",children:n.children},i,0,null),a=ro(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Zl(t,e.child,null,o),t.child.memoizedState=z0(o),t.memoizedState=U0,a);if(!(t.mode&1))return $h(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Y(419)),n=tx(a,n,void 0),$h(e,t,o,n)}if(l=(o&e.childLanes)!==0,Sr||l){if(n=It,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,Xi(e,i),Wn(n,e,i,-1))}return bj(),n=tx(Error(Y(421))),$h(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=JB.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Br=Ka(i.nextSibling),Wr=t,it=!0,Dn=null,e!==null&&(an[sn++]=Li,an[sn++]=Fi,an[sn++]=oo,Li=e.id,Fi=e.overflow,oo=t),t=mj(t,n.children),t.flags|=4096,t)}function WN(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),M0(e.return,t,r)}function rx(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function e$(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(sr(e,t,n.children,r),n=st.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&WN(e,r,t);else if(e.tag===19)WN(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Xe(st,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&ip(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),rx(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ip(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}rx(t,!0,r,null,a);break;case"together":rx(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Am(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Qi(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),co|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Y(153));if(t.child!==null){for(e=t.child,r=Ja(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ja(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function BB(e,t,r){switch(t.tag){case 3:J2(t),Jl();break;case 5:_2(t);break;case 1:Cr(t.type)&&Jm(t);break;case 4:sj(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Xe(tp,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Xe(st,st.current&1),t.flags|=128,null):r&t.child.childLanes?Z2(e,t,r):(Xe(st,st.current&1),e=Qi(e,t,r),e!==null?e.sibling:null);Xe(st,st.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return e$(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Xe(st,st.current),n)break;return null;case 22:case 23:return t.lanes=0,X2(e,t,r)}return Qi(e,t,r)}var t$,V0,r$,n$;t$=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};V0=function(){};r$=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Ls(hi.current);var a=null;switch(r){case"input":i=f0(e,i),n=f0(e,n),a=[];break;case"select":i=lt({},i,{value:void 0}),n=lt({},n,{value:void 0}),a=[];break;case"textarea":i=p0(e,i),n=p0(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Xm)}v0(r,n);var o;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(xd.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in n){var c=n[u];if(l=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(a||(a=[]),a.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(xd.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Ze("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};n$=function(e,t,r,n){r!==n&&(t.flags|=4)};function pu(e,t){if(!it)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Qt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function WB(e,t,r){var n=t.pendingProps;switch(Z1(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(t),null;case 1:return Cr(t.type)&&Qm(),Qt(t),null;case 3:return n=t.stateNode,ec(),rt(_r),rt(nr),lj(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Oh(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dn!==null&&(J0(Dn),Dn=null))),V0(e,t),Qt(t),null;case 5:oj(t);var i=Ls(Od.current);if(r=t.type,e!==null&&t.stateNode!=null)r$(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Y(166));return Qt(t),null}if(e=Ls(hi.current),Oh(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;
vendor: 32,334 bytes, line 40
40switch(n[oi]=t,n[Ed]=a,e=(t.mode&1)!==0,r){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(i=0;i<Uu.length;i++)Ze(Uu[i],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":Xk(n,a),Ze("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Ze("invalid",n);break;case"textarea":Jk(n,a),Ze("invalid",n)}v0(r,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&Ph(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Ph(n.textContent,l,e),i=["children",""+l]):xd.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Ze("scroll",n)}switch(r){case"input":jh(n),Qk(n,a,!0);break;case"textarea":jh(n),Zk(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=Xm)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=OT(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[oi]=t,e[Ed]=n,t$(e,t,!1,!1),t.stateNode=e;e:{switch(o=y0(r,n),r){case"dialog":Ze("cancel",e),Ze("close",e),i=n;break;case"iframe":case"object":case"embed":Ze("load",e),i=n;break;case"video":case"audio":for(i=0;i<Uu.length;i++)Ze(Uu[i],e);i=n;break;case"source":Ze("error",e),i=n;break;case"img":case"image":case"link":Ze("error",e),Ze("load",e),i=n;break;case"details":Ze("toggle",e),i=n;break;case"input":Xk(e,n),i=f0(e,n),Ze("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=lt({},n,{value:void 0}),Ze("invalid",e);break;case"textarea":Jk(e,n),i=p0(e,n),Ze("invalid",e);break;default:i=n}v0(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?RT(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&TT(e,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&bd(e,c):typeof c=="number"&&bd(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(xd.hasOwnProperty(a)?c!=null&&a==="onScroll"&&Ze("scroll",e):c!=null&&L1(e,a,c,o))}switch(r){case"input":jh(e),Qk(e,n,!1);break;case"textarea":jh(e),Zk(e);break;case"option":n.value!=null&&e.setAttribute("value",""+is(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Nl(e,!!n.multiple,a,!1):n.defaultValue!=null&&Nl(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Xm)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Qt(t),null;case 6:if(e&&t.stateNode!=null)n$(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Y(166));if(r=Ls(Od.current),Ls(hi.current),Oh(t)){if(n=t.stateNode,r=t.memoizedProps,n[oi]=t,(a=n.nodeValue!==r)&&(e=Wr,e!==null))switch(e.tag){case 3:Ph(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ph(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[oi]=t,t.stateNode=n}return Qt(t),null;case 13:if(rt(st),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(it&&Br!==null&&t.mode&1&&!(t.flags&128))w2(),Jl(),t.flags|=98560,a=!1;else if(a=Oh(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(Y(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Y(317));a[oi]=t}else Jl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qt(t),a=!1}else Dn!==null&&(J0(Dn),Dn=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||st.current&1?At===0&&(At=3):bj())),t.updateQueue!==null&&(t.flags|=4),Qt(t),null);case 4:return ec(),V0(e,t),e===null&&Cd(t.stateNode.containerInfo),Qt(t),null;case 10:return nj(t.type._context),Qt(t),null;case 17:return Cr(t.type)&&Qm(),Qt(t),null;case 19:if(rt(st),a=t.memoizedState,a===null)return Qt(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)pu(a,!1);else{if(At!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ip(e),o!==null){for(t.flags|=128,pu(a,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Xe(st,st.current&1|2),t.child}e=e.sibling}a.tail!==null&&pt()>rc&&(t.flags|=128,n=!0,pu(a,!1),t.lanes=4194304)}else{if(!n)if(e=ip(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),pu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!it)return Qt(t),null}else 2*pt()-a.renderingStartTime>rc&&r!==1073741824&&(t.flags|=128,n=!0,pu(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=pt(),t.sibling=null,r=st.current,Xe(st,n?r&1|2:r&1),t):(Qt(t),null);case 22:case 23:return xj(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Ir&1073741824&&(Qt(t),t.subtreeFlags&6&&(t.flags|=8192)):Qt(t),null;case 24:return null;case 25:return null}throw Error(Y(156,t.tag))}function UB(e,t){switch(Z1(t),t.tag){case 1:return Cr(t.type)&&Qm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ec(),rt(_r),rt(nr),lj(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return oj(t),null;case 13:if(rt(st),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Y(340));Jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return rt(st),null;case 4:return ec(),null;case 10:return nj(t.type._context),null;case 22:case 23:return xj(),null;case 24:return null;default:return null}}var Rh=!1,tr=!1,zB=typeof WeakSet=="function"?WeakSet:Set,re=null;function vl(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ft(e,t,n)}else r.current=null}function H0(e,t,r){try{r()}catch(n){ft(e,t,n)}}var UN=!1;function VB(e,t){if(A0=Gm,e=l2(),Q1(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==r||i!==0&&f.nodeType!==3||(l=o+i),f!==a||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===r&&++u===i&&(l=o),h===a&&++d===n&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(E0={focusedElem:e,selectionRange:r},Gm=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,v=g.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?p:Pn(t.type,p),v);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Y(163))}}catch(S){ft(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return g=UN,UN=!1,g}function td(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&H0(t,r,a)}i=i.next}while(i!==n)}}function Vg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function q0(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function i$(e){var t=e.alternate;t!==null&&(e.alternate=null,i$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[oi],delete t[Ed],delete t[T0],delete t[_B],delete t[CB])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function a$(e){return e.tag===5||e.tag===3||e.tag===4}function zN(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||a$(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function G0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Xm));else if(n!==4&&(e=e.child,e!==null))for(G0(e,t,r),e=e.sibling;e!==null;)G0(e,t,r),e=e.sibling}function K0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(K0(e,t,r),e=e.sibling;e!==null;)K0(e,t,r),e=e.sibling}var Bt=null,Rn=!1;function pa(e,t,r){for(r=r.child;r!==null;)s$(e,t,r),r=r.sibling}function s$(e,t,r){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(Mg,r)}catch{}switch(r.tag){case 5:tr||vl(r,t);case 6:var n=Bt,i=Rn;Bt=null,pa(e,t,r),Bt=n,Rn=i,Bt!==null&&(Rn?(e=Bt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Bt.removeChild(r.stateNode));break;case 18:Bt!==null&&(Rn?(e=Bt,r=r.stateNode,e.nodeType===8?Yy(e.parentNode,r):e.nodeType===1&&Yy(e,r),kd(e)):Yy(Bt,r.stateNode));break;case 4:n=Bt,i=Rn,Bt=r.stateNode.containerInfo,Rn=!0,pa(e,t,r),Bt=n,Rn=i;break;case 0:case 11:case 14:case 15:if(!tr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&H0(r,t,o),i=i.next}while(i!==n)}pa(e,t,r);break;case 1:if(!tr&&(vl(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){ft(r,t,l)}pa(e,t,r);break;case 21:pa(e,t,r);break;case 22:r.mode&1?(tr=(n=tr)||r.memoizedState!==null,pa(e,t,r),tr=n):pa(e,t,r);break;default:pa(e,t,r)}}function VN(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new zB),t.forEach(function(n){var i=ZB.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function kn(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Bt=l.stateNode,Rn=!1;break e;case 3:Bt=l.stateNode.containerInfo,Rn=!0;break e;case 4:Bt=l.stateNode.containerInfo,Rn=!0;break e}l=l.return}if(Bt===null)throw Error(Y(160));s$(a,o,i),Bt=null,Rn=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){ft(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)o$(t,e),t=t.sibling}function o$(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kn(t,e),Zn(e),n&4){try{td(3,e,e.return),Vg(3,e)}catch(p){ft(e,e.return,p)}try{td(5,e,e.return)}catch(p){ft(e,e.return,p)}}break;case 1:kn(t,e),Zn(e),n&512&&r!==null&&vl(r,r.return);break;case 5:if(kn(t,e),Zn(e),n&512&&r!==null&&vl(r,r.return),e.flags&32){var i=e.stateNode;try{bd(i,"")}catch(p){ft(e,e.return,p)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&ET(i,a),y0(l,o);var u=y0(l,a);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?RT(i,f):d==="dangerouslySetInnerHTML"?TT(i,f):d==="children"?bd(i,f):L1(i,d,f,u)}switch(l){case"input":h0(i,a);break;case"textarea":PT(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?Nl(i,!!a.multiple,m,!1):h!==!!a.multiple&&(a.defaultValue!=null?Nl(i,!!a.multiple,a.defaultValue,!0):Nl(i,!!a.multiple,a.multiple?[]:"",!1))}i[Ed]=a}catch(p){ft(e,e.return,p)}}break;case 6:if(kn(t,e),Zn(e),n&4){if(e.stateNode===null)throw Error(Y(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(p){ft(e,e.return,p)}}break;case 3:if(kn(t,e),Zn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{kd(t.containerInfo)}catch(p){ft(e,e.return,p)}break;case 4:kn(t,e),Zn(e);break;case 13:kn(t,e),Zn(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(vj=pt())),n&4&&VN(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(tr=(u=tr)||d,kn(t,e),tr=u):kn(t,e),Zn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(re=e,d=e.child;d!==null;){for(f=re=d;re!==null;){switch(h=re,m=h.child,h.tag){case 0:case 11:case 14:case 15:td(4,h,h.return);break;case 1:vl(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(p){ft(n,r,p)}}break;case 5:vl(h,h.return);break;case 22:if(h.memoizedState!==null){qN(f);continue}}m!==null?(m.return=h,re=m):qN(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=$T("display",o))}catch(p){ft(e,e.return,p)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(p){ft(e,e.return,p)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:kn(t,e),Zn(e),n&4&&VN(e);break;case 21:break;default:kn(t,e),Zn(e)}}function Zn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(a$(r)){var n=r;break e}r=r.return}throw Error(Y(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(bd(i,""),n.flags&=-33);var a=zN(e);K0(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=zN(e);G0(e,l,o);break;default:throw Error(Y(161))}}catch(c){ft(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function HB(e,t,r){re=e,l$(e)}function l$(e,t,r){for(var n=(e.mode&1)!==0;re!==null;){var i=re,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||Rh;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||tr;l=Rh;var u=tr;if(Rh=o,(tr=c)&&!u)for(re=i;re!==null;)o=re,c=o.child,o.tag===22&&o.memoizedState!==null?GN(i):c!==null?(c.return=o,re=c):GN(i);for(;a!==null;)re=a,l$(a),a=a.sibling;re=i,Rh=l,tr=u}HN(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,re=a):HN(e)}}function HN(e){for(;re!==null;){var t=re;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:tr||Vg(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!tr)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Pn(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&EN(t,a,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}EN(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&kd(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Y(163))}tr||t.flags&512&&q0(t)}catch(h){ft(t,t.return,h)}}if(t===e){re=null;break}if(r=t.sibling,r!==null){r.return=t.return,re=r;break}re=t.return}}function qN(e){for(;re!==null;){var t=re;if(t===e){re=null;break}var r=t.sibling;if(r!==null){r.return=t.return,re=r;break}re=t.return}}function GN(e){for(;re!==null;){var t=re;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Vg(4,t)}catch(c){ft(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(c){ft(t,i,c)}}var a=t.return;try{q0(t)}catch(c){ft(t,a,c)}break;case 5:var o=t.return;try{q0(t)}catch(c){ft(t,o,c)}}}catch(c){ft(t,t.return,c)}if(t===e){re=null;break}var l=t.sibling;if(l!==null){l.return=t.return,re=l;break}re=t.return}}var qB=Math.ceil,op=oa.ReactCurrentDispatcher,pj=oa.ReactCurrentOwner,un=oa.ReactCurrentBatchConfig,$e=0,It=null,bt=null,Kt=0,Ir=0,yl=us(0),At=0,Id=null,co=0,Hg=0,gj=0,rd=null,wr=null,vj=0,rc=1/0,Ti=null,lp=!1,Y0=null,Xa=null,Ih=!1,Wa=null,cp=0,nd=0,X0=null,Em=-1,Pm=0;function ur(){return $e&6?pt():Em!==-1?Em:Em=pt()}function Qa(e){return e.mode&1?$e&2&&Kt!==0?Kt&-Kt:EB.transition!==null?(Pm===0&&(Pm=qT()),Pm):(e=Fe,e!==0||(e=window.event,e=e===void 0?16:ZT(e.type)),e):1}function Wn(e,t,r,n){if(50<nd)throw nd=0,X0=null,Error(Y(185));Wf(e,r,n),(!($e&2)||e!==It)&&(e===It&&(!($e&2)&&(Hg|=r),At===4&&Ca(e,Kt)),Ar(e,n),r===1&&$e===0&&!(t.mode&1)&&(rc=pt()+500,Wg&&ds()))}function Ar(e,t){var r=e.callbackNode;E6(e,t);var n=qm(e,e===It?Kt:0);if(n===0)r!==null&&rN(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&rN(r),t===1)e.tag===0?AB(KN.bind(null,e)):y2(KN.bind(null,e)),kB(function(){!($e&6)&&ds()}),r=null;else{switch(GT(n)){case 1:r=z1;break;case 4:r=VT;break;case 16:r=Hm;break;case 536870912:r=HT;break;default:r=Hm}r=g$(r,c$.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function c$(e,t){if(Em=-1,Pm=0,$e&6)throw Error(Y(327));var r=e.callbackNode;if(Pl()&&e.callbackNode!==r)return null;var n=qm(e,e===It?Kt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=up(e,n);else{t=n;var i=$e;$e|=2;var a=d$();(It!==e||Kt!==t)&&(Ti=null,rc=pt()+500,to(e,t));do try{YB();break}catch(l){u$(e,l)}while(!0);rj(),op.current=a,$e=i,bt!==null?t=0:(It=null,Kt=0,t=At)}if(t!==0){if(t===2&&(i=S0(e),i!==0&&(n=i,t=Q0(e,i))),t===1)throw r=Id,to(e,0),Ca(e,n),Ar(e,pt()),r;if(t===6)Ca(e,n);else{if(i=e.current.alternate,!(n&30)&&!GB(i)&&(t=up(e,n),t===2&&(a=S0(e),a!==0&&(n=a,t=Q0(e,a))),t===1))throw r=Id,to(e,0),Ca(e,n),Ar(e,pt()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Y(345));case 2:Es(e,wr,Ti);break;case 3:if(Ca(e,n),(n&130023424)===n&&(t=vj+500-pt(),10<t)){if(qm(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){ur(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=O0(Es.bind(null,e,wr,Ti),t);break}Es(e,wr,Ti);break;case 4:if(Ca(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-Bn(n);a=1<<o,o=t[o],o>i&&(i=o),n&=~a}if(n=i,n=pt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*qB(n/1960))-n,10<n){e.timeoutHandle=O0(Es.bind(null,e,wr,Ti),n);break}Es(e,wr,Ti);break;case 5:Es(e,wr,Ti);break;default:throw Error(Y(329))}}}return Ar(e,pt()),e.callbackNode===r?c$.bind(null,e):null}function Q0(e,t){var r=rd;return e.current.memoizedState.isDehydrated&&(to(e,t).flags|=256),e=up(e,t),e!==2&&(t=wr,wr=r,t!==null&&J0(t)),e}function J0(e){wr===null?wr=e:wr.push.apply(wr,e)}function GB(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!qn(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ca(e,t){for(t&=~gj,t&=~Hg,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Bn(t),n=1<<r;e[r]=-1,t&=~n}}function KN(e){if($e&6)throw Error(Y(327));Pl();var t=qm(e,0);if(!(t&1))return Ar(e,pt()),null;var r=up(e,t);if(e.tag!==0&&r===2){var n=S0(e);n!==0&&(t=n,r=Q0(e,n))}if(r===1)throw r=Id,to(e,0),Ca(e,t),Ar(e,pt()),r;if(r===6)throw Error(Y(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Es(e,wr,Ti),Ar(e,pt()),null}function yj(e,t){var r=$e;$e|=1;try{return e(t)}finally{$e=r,$e===0&&(rc=pt()+500,Wg&&ds())}}function uo(e){Wa!==null&&Wa.tag===0&&!($e&6)&&Pl();var t=$e;$e|=1;var r=un.transition,n=Fe;try{if(un.transition=null,Fe=1,e)return e()}finally{Fe=n,un.transition=r,$e=t,!($e&6)&&ds()}}function xj(){Ir=yl.current,rt(yl)}function to(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,SB(r)),bt!==null)for(r=bt.return;r!==null;){var n=r;switch(Z1(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Qm();break;case 3:ec(),rt(_r),rt(nr),lj();break;case 5:oj(n);break;case 4:ec();break;case 13:rt(st);break;case 19:rt(st);break;case 10:nj(n.type._context);break;case 22:case 23:xj()}r=r.return}if(It=e,bt=e=Ja(e.current,null),Kt=Ir=t,At=0,Id=null,gj=Hg=co=0,wr=rd=null,Ds!==null){for(t=0;t<Ds.length;t++)if(r=Ds[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var o=a.next;a.next=i,n.next=o}r.pending=n}Ds=null}return e}function u$(e,t){do{var r=bt;try{if(rj(),_m.current=sp,ap){for(var n=ot.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}ap=!1}if(lo=0,$t=Nt=ot=null,ed=!1,Td=0,pj.current=null,r===null||r.return===null){At=1,Id=t,bt=null;break}e:{var a=e,o=r.return,l=r,c=t;if(t=Kt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=IN(o);if(m!==null){m.flags&=-257,MN(m,o,l,a,t),m.mode&1&&RN(a,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var p=new Set;p.add(c),t.updateQueue=p}else g.add(c);break e}else{if(!(t&1)){RN(a,u,t),bj();break e}c=Error(Y(426))}}else if(it&&l.mode&1){var v=IN(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),MN(v,o,l,a,t),ej(tc(c,l));break e}}a=c=tc(c,l),At!==4&&(At=2),rd===null?rd=[a]:rd.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var x=G2(a,c,t);AN(a,x);break e;case 1:l=c;var y=a.type,b=a.stateNode;if(!(a.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Xa===null||!Xa.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t;var S=K2(a,l,t);AN(a,S);break e}}a=a.return}while(a!==null)}h$(r)}catch(j){t=j,bt===r&&r!==null&&(bt=r=r.return);continue}break}while(!0)}function d$(){var e=op.current;return op.current=sp,e===null?sp:e}function bj(){(At===0||At===3||At===2)&&(At=4),It===null||!(co&268435455)&&!(Hg&268435455)||Ca(It,Kt)}function up(e,t){var r=$e;$e|=2;var n=d$();(It!==e||Kt!==t)&&(Ti=null,to(e,t));do try{KB();break}catch(i){u$(e,i)}while(!0);if(rj(),$e=r,op.current=n,bt!==null)throw Error(Y(261));return It=null,Kt=0,At}function KB(){for(;bt!==null;)f$(bt)}function YB(){for(;bt!==null&&!b6();)f$(bt)}function f$(e){var t=p$(e.alternate,e,Ir);e.memoizedProps=e.pendingProps,t===null?h$(e):bt=t,pj.current=null}function h$(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=UB(r,t),r!==null){r.flags&=32767,bt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{At=6,bt=null;return}}else if(r=WB(r,t,Ir),r!==null){bt=r;return}if(t=t.sibling,t!==null){bt=t;return}bt=t=e}while(t!==null);At===0&&(At=5)}function Es(e,t,r){var n=Fe,i=un.transition;try{un.transition=null,Fe=1,XB(e,t,r,n)}finally{un.transition=i,Fe=n}return null}function XB(e,t,r,n){do Pl();while(Wa!==null);if($e&6)throw Error(Y(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Y(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(P6(e,a),e===It&&(bt=It=null,Kt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ih||(Ih=!0,g$(Hm,function(){return Pl(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=un.transition,un.transition=null;var o=Fe;Fe=1;var l=$e;$e|=4,pj.current=null,VB(e,r),o$(r,e),gB(E0),Gm=!!A0,E0=A0=null,e.current=r,HB(r),w6(),$e=l,Fe=o,un.transition=a}else e.current=r;if(Ih&&(Ih=!1,Wa=e,cp=i),a=e.pendingLanes,a===0&&(Xa=null),k6(r.stateNode),Ar(e,pt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(lp)throw lp=!1,e=Y0,Y0=null,e;return cp&1&&e.tag!==0&&Pl(),a=e.pendingLanes,a&1?e===X0?nd++:(nd=0,X0=e):nd=0,ds(),null}function Pl(){if(Wa!==null){var e=GT(cp),t=un.transition,r=Fe;try{if(un.transition=null,Fe=16>e?16:e,Wa===null)var n=!1;else{if(e=Wa,Wa=null,cp=0,$e&6)throw Error(Y(331));var i=$e;for($e|=4,re=e.current;re!==null;){var a=re,o=a.child;if(re.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(re=u;re!==null;){var d=re;switch(d.tag){case 0:case 11:case 15:td(8,d,a)}var f=d.child;if(f!==null)f.return=d,re=f;else for(;re!==null;){d=re;var h=d.sibling,m=d.return;if(i$(d),d===u){re=null;break}if(h!==null){h.return=m,re=h;break}re=m}}}var g=a.alternate;if(g!==null){var p=g.child;if(p!==null){g.child=null;do{var v=p.sibling;p.sibling=null,p=v}while(p!==null)}}re=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,re=o;else e:for(;re!==null;){if(a=re,a.flags&2048)switch(a.tag){case 0:case 11:case 15:td(9,a,a.return)}var x=a.sibling;if(x!==null){x.return=a.return,re=x;break e}re=a.return}}var y=e.current;for(re=y;re!==null;){o=re;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,re=b;else e:for(o=y;re!==null;){if(l=re,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Vg(9,l)}}catch(j){ft(l,l.return,j)}if(l===o){re=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,re=S;break e}re=l.return}}if($e=i,ds(),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(Mg,e)}catch{}n=!0}return n}finally{Fe=r,un.transition=t}}return!1}function YN(e,t,r){t=tc(r,t),t=G2(e,t,1),e=Ya(e,t,1),t=ur(),e!==null&&(Wf(e,1,t),Ar(e,t))}function ft(e,t,r){if(e.tag===3)YN(e,e,r);else for(;t!==null;){if(t.tag===3){YN(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Xa===null||!Xa.has(n))){e=tc(r,e),e=K2(t,e,1),t=Ya(t,e,1),e=ur(),t!==null&&(Wf(t,1,e),Ar(t,e));break}}t=t.return}}function QB(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=ur(),e.pingedLanes|=e.suspendedLanes&r,It===e&&(Kt&r)===r&&(At===4||At===3&&(Kt&130023424)===Kt&&500>pt()-vj?to(e,0):gj|=r),Ar(e,t)}function m$(e,t){t===0&&(e.mode&1?(t=Nh,Nh<<=1,!(Nh&130023424)&&(Nh=4194304)):t=1);var r=ur();e=Xi(e,t),e!==null&&(Wf(e,t,r),Ar(e,r))}function JB(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),m$(e,r)}function ZB(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Y(314))}n!==null&&n.delete(t),m$(e,r)}var p$;p$=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||_r.current)Sr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Sr=!1,BB(e,t,r);Sr=!!(e.flags&131072)}else Sr=!1,it&&t.flags&1048576&&x2(t,ep,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Am(e,t),e=t.pendingProps;var i=Ql(t,nr.current);El(t,r),i=uj(null,t,n,e,i,r);var a=dj();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Cr(n)?(a=!0,Jm(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,aj(t),i.updater=zg,t.stateNode=i,i._reactInternals=t,L0(t,n,e,r),t=W0(null,t,n,!0,a,r)):(t.tag=0,it&&a&&J1(t),sr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Am(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=tW(n),e=Pn(n,e),i){case 0:t=B0(null,t,n,e,r);break e;case 1:t=FN(null,t,n,e,r);break e;case 11:t=DN(null,t,n,e,r);break e;case 14:t=LN(null,t,n,Pn(n.type,e),r);break e}throw Error(Y(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Pn(n,i),B0(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Pn(n,i),FN(e,t,n,i,r);case 3:e:{if(J2(t),e===null)throw Error(Y(387));n=t.pendingProps,a=t.memoizedState,i=a.element,N2(e,t),np(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=tc(Error(Y(423)),t),t=BN(e,t,n,r,i);break e}else if(n!==i){i=tc(Error(Y(424)),t),t=BN(e,t,n,r,i);break e}else for(Br=Ka(t.stateNode.containerInfo.firstChild),Wr=t,it=!0,Dn=null,r=S2(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Jl(),n===i){t=Qi(e,t,r);break e}sr(e,t,n,r)}t=t.child}return t;case 5:return _2(t),e===null&&I0(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,P0(n,i)?o=null:a!==null&&P0(n,a)&&(t.flags|=32),Q2(e,t),sr(e,t,o,r),t.child;case 6:return e===null&&I0(t),null;case 13:return Z2(e,t,r);case 4:return sj(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Zl(t,null,n,r):sr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Pn(n,i),DN(e,t,n,i,r);case 7:return sr(e,t,t.pendingProps,r),t.child;case 8:return sr(e,t,t.pendingProps.children,r),t.child;case 12:return sr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Xe(tp,n._currentValue),n._currentValue=o,a!==null)if(qn(a.value,o)){if(a.children===i.children&&!_r.current){t=Qi(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(a.tag===1){c=zi(-1,r&-r),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),M0(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Y(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),M0(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}sr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,El(t,r),i=hn(i),n=n(i),t.flags|=1,sr(e,t,n,r),t.child;case 14:return n=t.type,i=Pn(n,t.pendingProps),i=Pn(n.type,i),LN(e,t,n,i,r);case 15:return Y2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Pn(n,i),Am(e,t),t.tag=1,Cr(n)?(e=!0,Jm(t)):e=!1,El(t,r),q2(t,n,i),L0(t,n,i,r),W0(null,t,n,!0,e,r);case 19:return e$(e,t,r);case 22:return X2(e,t,r)}throw Error(Y(156,t.tag))};function g$(e,t){return zT(e,t)}function eW(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 5,638 bytes, line 40
40ype=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ln(e,t,r,n){return new eW(e,t,r,n)}function wj(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tW(e){if(typeof e=="function")return wj(e)?1:0;if(e!=null){if(e=e.$$typeof,e===B1)return 11;if(e===W1)return 14}return 2}function Ja(e,t){var r=e.alternate;return r===null?(r=ln(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Om(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")wj(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ll:return ro(r.children,i,a,t);case F1:o=8,i|=8;break;case l0:return e=ln(12,r,t,i|2),e.elementType=l0,e.lanes=a,e;case c0:return e=ln(13,r,t,i),e.elementType=c0,e.lanes=a,e;case u0:return e=ln(19,r,t,i),e.elementType=u0,e.lanes=a,e;case _T:return qg(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kT:o=10;break e;case NT:o=9;break e;case B1:o=11;break e;case W1:o=14;break e;case Sa:o=16,n=null;break e}throw Error(Y(130,e==null?e:typeof e,""))}return t=ln(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function ro(e,t,r,n){return e=ln(7,e,n,t),e.lanes=r,e}function qg(e,t,r,n){return e=ln(22,e,n,t),e.elementType=_T,e.lanes=r,e.stateNode={isHidden:!1},e}function nx(e,t,r){return e=ln(6,e,null,t),e.lanes=r,e}function ix(e,t,r){return t=ln(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rW(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ly(0),this.expirationTimes=Ly(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ly(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function jj(e,t,r,n,i,a,o,l,c){return e=new rW(e,t,r,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=ln(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},aj(a),e}function nW(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ol,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function v$(e){if(!e)return as;e=e._reactInternals;e:{if(No(e)!==e||e.tag!==1)throw Error(Y(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Cr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Y(171))}if(e.tag===1){var r=e.type;if(Cr(r))return v2(e,r,t)}return t}function y$(e,t,r,n,i,a,o,l,c){return e=jj(r,n,!0,e,i,a,o,l,c),e.context=v$(null),r=e.current,n=ur(),i=Qa(r),a=zi(n,i),a.callback=t??null,Ya(r,a,i),e.current.lanes=i,Wf(e,i,n),Ar(e,n),e}function Gg(e,t,r,n){var i=t.current,a=ur(),o=Qa(i);return r=v$(r),t.context===null?t.context=r:t.pendingContext=r,t=zi(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Ya(i,t,o),e!==null&&(Wn(e,i,o,a),Nm(e,i,o)),o}function dp(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function XN(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Sj(e,t){XN(e,t),(e=e.alternate)&&XN(e,t)}function iW(){return null}var x$=typeof reportError=="function"?reportError:function(e){console.error(e)};function kj(e){this._internalRoot=e}Kg.prototype.render=kj.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Y(409));Gg(e,t,null,null)};Kg.prototype.unmount=kj.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;uo(function(){Gg(null,e,null,null)}),t[Yi]=null}};function Kg(e){this._internalRoot=e}Kg.prototype.unstable_scheduleHydration=function(e){if(e){var t=XT();e={blockedOn:null,target:e,priority:t};for(var r=0;r<_a.length&&t!==0&&t<_a[r].priority;r++);_a.splice(r,0,e),r===0&&JT(e)}};function Nj(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function QN(){}function aW(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var u=dp(o);a.call(u)}}var o=y$(t,n,e,0,null,!1,!1,"",QN);return e._reactRootContainer=o,e[Yi]=o.current,Cd(e.nodeType===8?e.parentNode:e),uo(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var u=dp(c);l.call(u)}}var c=jj(e,0,!1,null,null,!1,!1,"",QN);return e._reactRootContainer=c,e[Yi]=c.current,Cd(e.nodeType===8?e.parentNode:e),uo(function(){Gg(t,c,r,n)}),c}function Xg(e,t,r,n,i){var a=r._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;
vendor: 4,580 bytes, line 40
40i=function(){var c=dp(o);l.call(c)}}Gg(t,o,e,i)}else o=aW(r,t,e,i,n);return dp(o)}KT=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Wu(t.pendingLanes);r!==0&&(V1(t,r|1),Ar(t,pt()),!($e&6)&&(rc=pt()+500,ds()))}break;case 13:uo(function(){var n=Xi(e,1);if(n!==null){var i=ur();Wn(n,e,1,i)}}),Sj(e,1)}};H1=function(e){if(e.tag===13){var t=Xi(e,134217728);if(t!==null){var r=ur();Wn(t,e,134217728,r)}Sj(e,134217728)}};YT=function(e){if(e.tag===13){var t=Qa(e),r=Xi(e,t);if(r!==null){var n=ur();Wn(r,e,t,n)}Sj(e,t)}};XT=function(){return Fe};QT=function(e,t){var r=Fe;try{return Fe=e,t()}finally{Fe=r}};b0=function(e,t,r){switch(t){case"input":if(h0(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=Bg(n);if(!i)throw Error(Y(90));AT(n),h0(n,i)}}}break;case"textarea":PT(e,r);break;case"select":t=r.value,t!=null&&Nl(e,!!r.multiple,t,!1)}};DT=yj;LT=uo;var sW={usingClientEntryPoint:!1,Events:[zf,fl,Bg,IT,MT,yj]},gu={findFiberByHostInstance:Ms,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},oW={bundleType:gu.bundleType,version:gu.version,rendererPackageName:gu.rendererPackageName,rendererConfig:gu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:oa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=WT(e),e===null?null:e.stateNode},findFiberByHostInstance:gu.findFiberByHostInstance||iW,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mh.isDisabled&&Mh.supportsFiber)try{Mg=Mh.inject(oW),fi=Mh}catch{}}Gr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sW;Gr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nj(t))throw Error(Y(200));return nW(e,t,null,r)};Gr.createRoot=function(e,t){if(!Nj(e))throw Error(Y(299));var r=!1,n="",i=x$;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=jj(e,1,!1,null,null,r,!1,n,i),e[Yi]=t.current,Cd(e.nodeType===8?e.parentNode:e),new kj(t)};Gr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Y(188)):(e=Object.keys(e).join(","),Error(Y(268,e)));return e=WT(t),e=e===null?null:e.stateNode,e};Gr.flushSync=function(e){return uo(e)};Gr.hydrate=function(e,t,r){if(!Yg(t))throw Error(Y(200));return Xg(null,e,t,!0,r)};Gr.hydrateRoot=function(e,t,r){if(!Nj(e))throw Error(Y(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=x$;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=y$(t,null,e,1,r??null,i,!1,a,o),e[Yi]=t.current,Cd(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Kg(t)};Gr.render=function(e,t,r){if(!Yg(t))throw Error(Y(200));return Xg(null,e,t,!1,r)};Gr.unmountComponentAtNode=function(e){if(!Yg(e))throw Error(Y(40));return e._reactRootContainer?(uo(function(){Xg(null,null,e,!1,function(){e._reactRootContainer=null,e[Yi]=null})}),!0):!1};Gr.unstable_batchedUpdates=yj;Gr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Yg(r))throw Error(Y(200));if(e==null||e._reactInternals===void 0)throw Error(Y(38));return Xg(e,t,r,!1,n)};Gr.version="18.3.1-next-f1338f8080-20240426";function b$(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(b$)}catch(e){console.error(e)}}b$(),bT.exports=Gr;var _o=bT.exports;const w$=Le(_o);var j$,JN=_o;j$=JN.createRoot,JN.hydrateRoot;const lW=1,cW=1e6;let ax=0;function uW(){return ax=(ax+1)%Number.MAX_SAFE_INTEGER,ax.toString()}const sx=new Map,ZN=e=>{if(sx.has(e))return;const t=setTimeout(()=>{sx.delete(e),id({type:"REMOVE_TOAST",toastId:e})},cW);sx.set(e,t)},dW=(e,t)=>
40{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,lW)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?ZN(r):e.toasts.forEach(n=>{ZN(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Tm=[];let $m={toasts:[]};function id(e){$m=dW($m,e),Tm.forEach(t=>{t($m)})}function fW({...e}){const t=uW(),r=i=>id({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>id({type:"DISMISS_TOAST",toastId:t});return id({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function Qg(){const[e,t]=w.useState($m);return w.useEffect(()=>(Tm.push(t),()=>{const r=Tm.indexOf(t);r>-1&&Tm.splice(r,1)}),[e]),{...e,toast:fW,dismiss:r=>id({type:"DISMISS_TOAST",toastId:r})}}function ne(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function e_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function S$(...e){return t=>{let r=!1;const n=e.map(i=>{const a=e_(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():e_(e[i],null)}}}}function Ne(...e){return w.useCallback(S$(...e),e)}function hW(e,t){const r=w.createContext(t),n=a=>{const{children:o,...l}=a,c=w.useMemo(()=>l,Object.values(l));return s.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function i(a){const o=w.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,i]}function Yr(e,t=[]){let r=[];function n(a,o){const l=w.createContext(o),c=r.length;r=[...r,o];const u=f=>{var x;const{scope:h,children:m,...g}=f,p=((x=h==null?void 0:h[e])==null?void 0:x[c])||l,v=w.useMemo(()=>g,Object.values(g));return s.jsx(p.Provider,{value:v,children:m})};u.displayName=a+"Provider";function d(f,h){var p;const m=((p=h==null?void 0:h[e])==null?void 0:p[c])||l,g=w.useContext(m);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=r.map(o=>w.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return w.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[n,mW(i,...t)]}function mW(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function nc(e){const t=gW(e),r=w.forwardRef((n,i)=>{const{children:a,...o}=n,l=w.Children.toArray(a),c=l.find(yW);if(c){const u=c.props.children,d=l.map(f=>f===c?w.Children.count(u)>1?w.Children.only(null):w.isValidElement(u)?u.props.children:null:f);return s.jsx(t,{...o,ref:i,children:w.isValidElement(u)?w.cloneElement(u,void 0,d):null})}return s.jsx(t,{...o,ref:i,children:a})});return r.displayName=`${e}.Slot`,r}var pW=nc("Slot");function gW(e){const t=w.forwardRef((r,n)=>{const{children:i,...a}=r;if(w.isValidElement(i)){const o=bW(i),l=xW(a,i.props);return i.type!==w.Fragment&&(l.ref=n?S$(n,o):o),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var k$=Symbol("radix.slottable");function vW(e){const t=({children:r})=>s.jsx(s.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=k$,t}function yW(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k$}function xW(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...l)=>{const c=a(...l);return i(...l),c}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function bW(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Jg(e){const t=e+"CollectionProvider",[r,n]=Yr(t),[i,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:v,children:x}=p,y=O.useRef(null),b=O.useRef(new Map).current;return s.jsx(i,{scope:v,itemMap:b,collectionRef:y,children:x})};o.displayName=t;const l=e+"CollectionSlot",c=nc(l),u=O.forwardRef((p,v)=>{const{scope:x,children:y}=p,b=a(l,x),S=Ne(v,b.collectionRef);return s.jsx(c,{ref:S,children:y})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=nc(d),m=O.forwardRef((p,v)=>{const{scope:x,children:y,...b}=p,S=O.useRef(null),j=Ne(v,S),N=a(d,x);return O.useEffect(()=>(N.itemMap.set(S,{ref:S,...b}),()=>void N.itemMap.delete(S))),s.jsx(h,{[f]:"",ref:j,children:y})});m.displayName=d;function g(p){const v=a(e+"CollectionConsumer",p);return O.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((N,k)=>b.indexOf(N.ref.current)-b.indexOf(k.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},g,n]}var wW=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ce=wW.reduce((e,t)=>
vendor: 8,609 bytes, line 40
40{const r=nc(`Primitive.${t}`),n=w.forwardRef((i,a)=>{const{asChild:o,...l}=i,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function N$(e,t){e&&_o.flushSync(()=>e.dispatchEvent(t))}function Ct(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function jW(e,t=globalThis==null?void 0:globalThis.document){const r=Ct(e);w.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var SW="DismissableLayer",Z0="dismissableLayer.update",kW="dismissableLayer.pointerDownOutside",NW="dismissableLayer.focusOutside",t_,_$=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hf=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=w.useContext(_$),[d,f]=w.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=w.useState({}),g=Ne(t,k=>f(k)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(v),y=d?p.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,S=y>=x,j=CW(k=>{const _=k.target,C=[...u.branches].some(P=>P.contains(_));!S||C||(i==null||i(k),o==null||o(k),k.defaultPrevented||l==null||l())},h),N=AW(k=>{const _=k.target;[...u.branches].some(P=>P.contains(_))||(a==null||a(k),o==null||o(k),k.defaultPrevented||l==null||l())},h);return jW(k=>{y===u.layers.size-1&&(n==null||n(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},h),w.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(t_=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),r_(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=t_)}},[d,h,r,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),r_())},[d,u]),w.useEffect(()=>{const k=()=>m({});return document.addEventListener(Z0,k),()=>document.removeEventListener(Z0,k)},[]),s.jsx(ce.div,{...c,ref:g,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:ne(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ne(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ne(e.onPointerDownCapture,j.onPointerDownCapture)})});Hf.displayName=SW;var _W="DismissableLayerBranch",C$=w.forwardRef((e,t)=>{const r=w.useContext(_$),n=w.useRef(null),i=Ne(t,n);return w.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),s.jsx(ce.div,{...e,ref:i})});C$.displayName=_W;function CW(e,t=globalThis==null?void 0:globalThis.document){const r=Ct(e),n=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let c=function(){A$(kW,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function AW(e,t=globalThis==null?void 0:globalThis.document){const r=Ct(e),n=w.useRef(!1);return w.useEffect(()=>{const i=a=>{a.target&&!n.current&&A$(NW,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function r_(){const e=new CustomEvent(Z0);document.dispatchEvent(e)}function A$(e,t,r,{discrete:n}){const i=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?N$(i,a):i.dispatchEvent(a)}var EW=Hf,PW=C$,Pt=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},OW="Portal",Zg=w.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[i,a]=w.useState(!1);Pt(()=>a(!0),[]);const o=r||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?w$.createPortal(s.jsx(ce.div,{...n,ref:t}),o):null});Zg.displayName=OW;function TW(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var Xr=e=>{const{present:t,children:r}=e,n=$W(t),i=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),a=Ne(n.ref,RW(i));return typeof r=="function"||n.isPresent?w.cloneElement(i,{ref:a}):null};Xr.displayName="Presence";function $W(e){const[t,r]=w.useState(),n=w.useRef(null),i=w.useRef(e),a=w.useRef("none"),o=e?"mounted":"unmounted",[l,c]=TW(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Dh(n.current);a.current=l==="mounted"?u:"none"},[l]),Pt(()=>{const u=n.current,d=i.current;if(d!==e){const h=a.current,m=Dh(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Pt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=m=>{const p=Dh(n.current).includes(m.animationName);if(m.target===t&&p&&(c("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=m=>{m.target===t&&(a.current=Dh(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Dh(e){return(e==null?void 0:e.animationName)||"none"}function RW(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var IW=I1[" useInsertionEffect ".trim().toString()]||Pt;function bi({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,a,o]=MW({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:i;{const d=w.useRef(e!==void 0);w.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${l?"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.`),d.current=l},[l,n])}const u=w.useCallback(d=>{var f;if(l){const h=DW(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else a(d)},[l,e,a,o]);return[c,u]}function MW({defaultProp:e,onChange:t}){const[r,n]=w.useState(e),i=w.useRef(r),a=w.useRef(t);return IW(()=>{a.current=t},[t]),w.useEffect(()=>{var o;i.current!==r&&((o=a.current)==null||o.call(a,r),i.current=r)},[r,i]),[r,n,a]}function DW(e){return typeof e=="function"}var E$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),LW="VisuallyHidden",ev=w.forwardRef((e,t)=>s.jsx(ce.span,{...e,ref:t,style:{...E$,...e.style}}));ev.displayName=LW;var FW=ev,_j="ToastProvider",[Cj,BW,WW]=Jg("Toast"),[P$,WNe]=Yr("Toast",[WW]),[UW,tv]=P$(_j),O$=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:a=50,children:o}=e,[l,c]=w.useState(null),[u,d]=w.useState(0),f=w.useRef(!1),h=w.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${_j}\`. Expected non-empty \`string\`.`),s.jsx(Cj.Provider,{scope:t,children:s.jsx(UW,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:w.useCallback(()=>d(m=>m+1),[]),onToastRemove:w.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:o})})};O$.displayName=_j;var T$="ToastViewport",zW=["F8"],eb="toast.viewportPause",tb="toast.viewportResume",$$=w.forwardRef((e,t)=>
40{const{__scopeToast:r,hotkey:n=zW,label:i="Notifications ({hotkey})",...a}=e,o=tv(T$,r),l=BW(r),c=w.useRef(null),u=w.useRef(null),d=w.useRef(null),f=w.useRef(null),h=Ne(t,f,o.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;w.useEffect(()=>{const v=x=>{var b;n.length!==0&&n.every(S=>x[S]||x.code===S)&&((b=f.current)==null||b.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n]),w.useEffect(()=>{const v=c.current,x=f.current;if(g&&v&&x){const y=()=>{if(!o.isClosePausedRef.current){const N=new CustomEvent(eb);x.dispatchEvent(N),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const N=new CustomEvent(tb);x.dispatchEvent(N),o.isClosePausedRef.current=!1}},S=N=>{!v.contains(N.relatedTarget)&&b()},j=()=>{v.contains(document.activeElement)||b()};return v.addEventListener("focusin",y),v.addEventListener("focusout",S),v.addEventListener("pointermove",y),v.addEventListener("pointerleave",j),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{v.removeEventListener("focusin",y),v.removeEventListener("focusout",S),v.removeEventListener("pointermove",y),v.removeEventListener("pointerleave",j),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[g,o.isClosePausedRef]);const p=w.useCallback(({tabbingDirection:v})=>{const y=l().map(b=>{const S=b.ref.current,j=[S,...r8(S)];return v==="forwards"?j:j.reverse()});return(v==="forwards"?y.reverse():y).flat()},[l]);return w.useEffect(()=>{const v=f.current;if(v){const x=y=>{var j,N,k;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const _=document.activeElement,C=y.shiftKey;if(y.target===v&&C){(j=u.current)==null||j.focus();return}const A=p({tabbingDirection:C?"backwards":"forwards"}),R=A.findIndex($=>$===_);ox(A.slice(R+1))?y.preventDefault():C?(N=u.current)==null||N.focus():(k=d.current)==null||k.focus()}};return v.addEventListener("keydown",x),()=>v.removeEventListener("keydown",x)}},[l,p]),s.jsxs(PW,{ref:c,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&s.jsx(rb,{ref:u,onFocusFromOutsideViewport:()=>{const v=p({tabbingDirection:"forwards"});ox(v)}}),s.jsx(Cj.Slot,{scope:r,children:s.jsx(ce.ol,{tabIndex:-1,...a,ref:h})}),g&&s.jsx(rb,{ref:d,onFocusFromOutsideViewport:()=>{const v=p({tabbingDirection:"backwards"});ox(v)}})]})});$$.displayName=T$;var R$="ToastFocusProxy",rb=w.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,a=tv(R$,r);return s.jsx(ev,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&n()}})});rb.displayName=R$;var qf="Toast",VW="toast.swipeStart",HW="toast.swipeMove",qW="toast.swipeCancel",GW="toast.swipeEnd",I$=w.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:a,...o}=e,[l,c]=bi({prop:n,defaultProp:i??!0,onChange:a,caller:qf});return s.jsx(Xr,{present:r||l,children:s.jsx(XW,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Ct(e.onPause),onResume:Ct(e.onResume),onSwipeStart:ne(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ne(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:ne(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ne(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});I$.displayName=qf;var[KW,YW]=P$(qf,{onClose(){}}),XW=w.forwardRef((e,t)=>
40{const{__scopeToast:r,type:n="foreground",duration:i,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:m,...g}=e,p=tv(qf,r),[v,x]=w.useState(null),y=Ne(t,$=>x($)),b=w.useRef(null),S=w.useRef(null),j=i||p.duration,N=w.useRef(0),k=w.useRef(j),_=w.useRef(0),{onToastAdd:C,onToastRemove:P}=p,E=Ct(()=>{var D;(v==null?void 0:v.contains(document.activeElement))&&((D=p.viewport)==null||D.focus()),o()}),A=w.useCallback($=>{!$||$===1/0||(window.clearTimeout(_.current),N.current=new Date().getTime(),_.current=window.setTimeout(E,$))},[E]);w.useEffect(()=>{const $=p.viewport;if($){const D=()=>{A(k.current),u==null||u()},M=()=>{const I=new Date().getTime()-N.current;k.current=k.current-I,window.clearTimeout(_.current),c==null||c()};return $.addEventListener(eb,M),$.addEventListener(tb,D),()=>{$.removeEventListener(eb,M),$.removeEventListener(tb,D)}}},[p.viewport,j,c,u,A]),w.useEffect(()=>{a&&!p.isClosePausedRef.current&&A(j)},[a,j,p.isClosePausedRef,A]),w.useEffect(()=>(C(),()=>P()),[C,P]);const R=w.useMemo(()=>v?U$(v):null,[v]);return p.viewport?s.jsxs(s.Fragment,{children:[R&&s.jsx(QW,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),s.jsx(KW,{scope:r,onClose:E,children:_o.createPortal(s.jsx(Cj.ItemSlot,{scope:r,children:s.jsx(EW,{asChild:!0,onEscapeKeyDown:ne(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||E(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(ce.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...g,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ne(e.onKeyDown,$=>{$.key==="Escape"&&(l==null||l($.nativeEvent),$.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,E()))}),onPointerDown:ne(e.onPointerDown,$=>{$.button===0&&(b.current={x:$.clientX,y:$.clientY})}),onPointerMove:ne(e.onPointerMove,$=>{if(!b.current)return;const D=$.clientX-b.current.x,M=$.clientY-b.current.y,I=!!S.current,T=["left","right"].includes(p.swipeDirection),L=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,B=T?L(0,D):0,H=T?0:L(0,M),z=$.pointerType==="touch"?10:2,q={x:B,y:H},te={originalEvent:$,delta:q};I?(S.current=q,Lh(HW,f,te,{discrete:!1})):n_(q,p.swipeDirection,z)?(S.current=q,Lh(VW,d,te,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(D)>z||Math.abs(M)>z)&&(b.current=null)}),onPointerUp:ne(e.onPointerUp,$=>{const D=S.current,M=$.target;if(M.hasPointerCapture($.pointerId)&&M.releasePointerCapture($.pointerId),S.current=null,b.current=null,D){const I=$.currentTarget,T={originalEvent:$,delta:D};n_(D,p.swipeDirection,p.swipeThreshold)?Lh(GW,m,T,{discrete:!0}):Lh(qW,h,T,{discrete:!0}),I.addEventListener("click",L=>L.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),QW=e=>{const{__scopeToast:t,children:r,...n}=e,i=tv(qf,t),[a,o]=w.useState(!1),[l,c]=w.useState(!1);return e8(()=>o(!0)),w.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:s.jsx(Zg,{asChild:!0,children:s.jsx(ev,{...n,children:a&&s.jsxs(s.Fragment,{children:[i.label," ",r]})})})},JW="ToastTitle",M$=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(ce.div,{...n,ref:t})});M$.displayName=JW;var ZW="ToastDescription",D$=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(ce.div,{...n,ref:t})});D$.displayName=ZW;var L$="ToastAction",F$=w.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?s.jsx(W$,{altText:r,asChild:!0,children:s.jsx(Aj,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${L$}\`. Expected non-empty \`string\`.`),null)});F$.displayName=L$;var B$="ToastClose",Aj=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=YW(B$,r);return s.jsx(W$,{asChild:!0,children:s.jsx(ce.button,{type:"button",...n,ref:t,onClick:ne(e.onClick,i.onClose)})})});Aj.displayName=B$;var W$=w.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return s.jsx(ce.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:t})});function U$(e){const t=[];
vendor: 7,109 bytes, lines 40-100
40return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),t8(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!i)if(a){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...U$(n))}}),t}function Lh(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?N$(i,a):i.dispatchEvent(a)}var n_=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),a=n>i;return t==="left"||t==="right"?a&&n>r:!a&&i>r};function e8(e=()=>{}){const t=Ct(e);Pt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function t8(e){return e.nodeType===e.ELEMENT_NODE}function r8(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ox(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var n8=O$,z$=$$,V$=I$,H$=M$,q$=D$,G$=F$,K$=Aj;function Y$(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Y$(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function we(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Y$(e))&&(n&&(n+=" "),n+=t);return n}const i_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,a_=we,Gf=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return a_(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const d=r==null?void 0:r[u],f=a==null?void 0:a[u];if(d===null)return null;const h=i_(d)||i_(f);return i[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...m}=d;return Object.entries(m).every(g=>{let[p,v]=g;return Array.isArray(v)?v.includes({...a,...l}[p]):{...a,...l}[p]===v})?[...u,f,h]:u},[]);return a_(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const i8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),X$=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var a8={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"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const s8=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...l},c)=>w.createElement("svg",{ref:c,...a8,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:X$("lucide",i),...l},[...o.map(([u,d])=>w.createElement(u,d)),...Array.isArray(a)?a:[a]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const oe=(e,t)=>{const r=w.forwardRef(({className:n,...i},a)=>w.createElement(s8,{ref:a,iconNode:t,className:X$(`lucide-${i8(e)}`,n),...i}));return r.displayName=`${e}`,r};/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const ic=oe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const fp=oe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const s_=oe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const nb=oe("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const ac=oe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const o8=oe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const Q$=oe("Briefcase",[["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"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const Ej=oe("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
100],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const hp=oe("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const Kf=oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const dr=oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const J$=oe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const mp=oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const mi=oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const Za=oe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const Z$=oe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const ib=oe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const eR=oe("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const tR=oe("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const rR=oe("Diamond",[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const l8=oe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const c8=oe("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const Pj=oe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const nR=oe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const iR=oe("Eye",[["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"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const ab=oe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const u8=oe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const sb=oe("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const o_=oe("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const d8=oe("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const f8=oe("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const aR=oe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const sR=oe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 226 * @license lucide-react v0.462.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const Rm=oe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 231 * @license lucide-react v0.462.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree.
235 */const Oj=oe("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);/** 236 * @license lucide-react v0.462.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const l_=oe("Layers",[["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:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 241 * @license lucide-react v0.462.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const kr=oe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 246 * @license lucide-react v0.462.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const Tj=oe("Lock",[["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"}]]);/** 251 * @license lucide-react v0.462.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree. 255 */const h8=oe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 256 * @license lucide-react v0.462.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree. 260 */const m8=oe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** 261 * @license lucide-react v0.462.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const sc=oe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 266 * @license lucide-react v0.462.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const $j=oe("RefreshCw",[["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"}]]);/** 271 * @license lucide-react v0.462.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const Bc=oe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 276 * @license lucide-react v0.462.0 - ISC 277 * 278 * This source code is licensed under the ISC license. 279 * See the LICENSE file in the root directory of this source tree. 280 */const p8=oe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 281 * @license lucide-react v0.462.0 - ISC 282 * 283 * This source code is licensed under the ISC license. 284 * See the LICENSE file in the root directory of this source tree. 285 */const g8=oe("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/** 286 * @license lucide-react v0.462.0 - ISC 287 * 288 * This source code is licensed under the ISC license. 289 * See the LICENSE file in the root directory of this source tree. 290 */const v8=oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 291 * @license lucide-react v0.462.0 - ISC 292 * 293 * This source code is licensed under the ISC license. 294 * See the LICENSE file in the root directory of this source tree. 295 */const oR=oe("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 296 * @license lucide-react v0.462.0 - ISC 297 * 298 * This source code is licensed under the ISC license. 299 * See the LICENSE file in the root directory of this source tree. 300 */const c_=oe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 301 * @license lucide-react v0.462.0 - ISC 302 * 303 * This source code is licensed under the ISC license. 304 * See the LICENSE file in the root directory of this source tree. 305 */const lR=oe("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** 306 * @license lucide-react v0.462.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree. 310 */const ad=oe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
vendor: 9,786 bytes, lines 310-360
310],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 311 * @license lucide-react v0.462.0 - ISC 312 * 313 * This source code is licensed under the ISC license. 314 * See the LICENSE file in the root directory of this source tree. 315 */const rv=oe("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** 316 * @license lucide-react v0.462.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const wi=oe("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 321 * @license lucide-react v0.462.0 - ISC 322 * 323 * This source code is licensed under the ISC license. 324 * See the LICENSE file in the root directory of this source tree. 325 */const Fs=oe("TriangleAlert",[["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"}]]);/** 326 * @license lucide-react v0.462.0 - ISC 327 * 328 * This source code is licensed under the ISC license. 329 * See the LICENSE file in the root directory of this source tree. 330 */const Fh=oe("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 331 * @license lucide-react v0.462.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const y8=oe("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** 336 * @license lucide-react v0.462.0 - ISC 337 * 338 * This source code is licensed under the ISC license. 339 * See the LICENSE file in the root directory of this source tree. 340 */const x8=oe("User",[["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"}]]);/** 341 * @license lucide-react v0.462.0 - ISC 342 * 343 * This source code is licensed under the ISC license. 344 * See the LICENSE file in the root directory of this source tree. 345 */const ob=oe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 346 * @license lucide-react v0.462.0 - ISC 347 * 348 * This source code is licensed under the ISC license. 349 * See the LICENSE file in the root directory of this source tree. 350 */const b8=oe("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/** 351 * @license lucide-react v0.462.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const Yf=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 356 * @license lucide-react v0.462.0 - ISC 357 * 358 * This source code is licensed under the ISC license. 359 * See the LICENSE file in the root directory of this source tree. 360 */const Md=oe("Zap",[["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"}]]),Rj="-",w8=e=>{const t=S8(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Rj);return l[0]===""&&l.length!==1&&l.shift(),cR(l,t)||j8(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},cR=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?cR(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(Rj);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},u_=/^\[(.+)\]$/,j8=e=>{if(u_.test(e)){const t=u_.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},S8=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return N8(Object.entries(e.classGroups),r).forEach(([a,o])=>{lb(o,n,a,t)}),n},lb=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:d_(t,i);a.classGroupId=r;return}if(typeof i=="function"){if(k8(i)){lb(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([a,o])=>{lb(o,d_(t,a),r,n)})})},d_=(e,t)=>{let r=e;return t.split(Rj).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},k8=e=>e.isThemeGetter,N8=(e,t)=>t?e.map(([r,n])=>{const i=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[r,i]}):e,_8=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return i(a,o),o},set(a,o){r.has(a)?r.set(a,o):i(a,o)}}},uR="!",C8=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],a=t.length,o=l=>{const c=[];let u=0,d=0,f;for(let v=0;v<l.length;v++){let x=l[v];if(u===0){if(x===i&&(n||l.slice(v,v+a)===t)){c.push(l.slice(d,v)),d=v+a;continue}if(x==="/"){f=v;continue}}x==="["?u++:x==="]"&&u--}const h=c.length===0?l:l.substring(d),m=h.startsWith(uR),g=m?h.substring(1):h,p=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:p}};return r?l=>r({className:l,parseClassName:o}):o},A8=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},E8=e=>({cache:_8(e.cacheSize),parseClassName:C8(e),...w8(e)}),P8=/\s+/,O8=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(P8);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:m}=r(u);let g=!!m,p=n(g?h.substring(0,m):h);if(!p){if(!g){l=u+(l.length>0?" "+l:l);continue}if(p=n(h),!p){l=u+(l.length>0?" "+l:l);continue}g=!1}const v=A8(d).join(":"),x=f?v+uR:v,y=x+p;if(a.includes(y))continue;a.push(y);const b=i(p,g);for(let S=0;S<b.length;++S){const j=b[S];a.push(x+j)}l=u+(l.length>0?" "+l:l)}return l};function T8(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=dR(t))&&(n&&(n+=" "),n+=r);return n}const dR=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=dR(e[n]))&&(r&&(r+=" "),r+=t);return r};function $8(e,...t){let r,n,i,a=o;function o(c){const u=t.reduce((d,f)=>f(d),e());return r=E8(u),n=r.cache.get,i=r.cache.set,a=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=O8(c,r);return i(c,d),d}return function(){return a(T8.apply(null,arguments))}}const Je=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},fR=/^\[(?:([a-z-]+):)?(.+)\]$/i,R8=/^\d+\/\d+$/,I8=new Set(["px","full","screen"]),M8=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,D8=/\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$/,L8=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,F8=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ei=e=>Ol(e)||I8.has(e)||R8.test(e),ga=e=>Wc(e,"length",K8),Ol=e=>!!e&&!Number.isNaN(Number(e)),lx=e=>Wc(e,"number",Ol),vu=e=>!!e&&Number.isInteger(Number(e)),W8=e=>e.endsWith("%")&&Ol(e.slice(0,-1)),ke=e=>fR.test(e),va=e=>M8.test(e),U8=new Set(["length","size","percentage"]),z8=e=>Wc(e,U8,hR),V8=e=>Wc(e,"position",hR),H8=new Set(["image","url"]),q8=e=>Wc(e,H8,X8),G8=e=>Wc(e,"",Y8),yu=()=>!0,Wc=(e,t,r)=>{const n=fR.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},K8=e=>D8.test(e)&&!L8.test(e),hR=()=>!1,Y8=e=>F8.test(e),X8=e=>B8.test(e),Q8=()=>{const e=Je("colors"),t=Je("spacing"),r=Je("blur"),n=Je("brightness"),i=Je("borderColor"),a=Je("borderRadius"),o=Je("borderSpacing"),l=Je("borderWidth"),c=Je("contrast"),u=Je("grayscale"),d=Je("hueRotate"),f=Je("invert"),h=Je("gap"),m=Je("gradientColorStops"),g=Je("gradientColorStopPositions"),p=Je("inset"),v=Je("margin"),x=Je("opacity"),y=Je("padding"),b=Je("saturate"),S=Je("scale"),j=Je("sepia"),N=Je("skew"),k=Je("space"),_=Je("translate"),C=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",ke,t],A=()=>[ke,t],R=()=>["",Ei,ga],$=()=>["auto",Ol,ke],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",ke],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Ol,ke];return{cacheSize:500,separator:":",theme:{colors:[yu],spacing:[Ei,ga],blur:["none","",va,ke],brightness:H(),borderColor:[e],borderRadius:["n
360one","","full",va,ke],borderSpacing:A(),borderWidth:R(),contrast:H(),grayscale:L(),hueRotate:H(),invert:L(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[W8,ga],inset:E(),margin:E(),opacity:H(),padding:A(),saturate:H(),scale:H(),sepia:L(),skew:H(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",ke]}],container:["container"],columns:[{columns:[va]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"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"],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:[...D(),ke]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",vu,ke]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ke]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",vu,ke]}],"grid-cols":[{"grid-cols":[yu]}],"col-start-end":[{col:["auto",{span:["full",vu,ke]},ke]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[yu]}],"row-start-end":[{row:["auto",{span:[vu,ke]},ke]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ke]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],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"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ke,t]}],"min-w":[{"min-w":[ke,t,"min","max","fit"]}],"max-w":[{"max-w":[ke,t,"none","full","min","max","fit","prose",{screen:[va]},va]}],h:[{h:[ke,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ke,t,"auto","min","max","fit"]}],"font-size":[{text:["base",va,ga]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",lx]}],"font-family":[{font:[yu]}],"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:["tighter","tight","normal","wide","wider","widest",ke]}],"line-clamp":[{"line-clamp":["none",Ol,lx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ei,ke]}],"list-image":[{"list-image":["none",ke]}],"list-style-type":[{list:["none","disc","decimal",ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ei,ga]}],"underline-offset":[{"underline-offset":["auto",Ei,ke]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...D(),V8]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",z8]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},q8]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}
vendor: 5,180 bytes, line 360
360],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[Ei,ke]}],"outline-w":[{outline:[Ei,ga]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Ei,ga]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",va,G8]}],"shadow-color":[{shadow:[yu]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",va,ke]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ke]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",ke]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[vu,ke]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ke]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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"]}
vendor: 4,642 bytes, line 360
360],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",ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ei,ga,lx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},J8=$8(Q8);function X(...e){return J8(we(e))}const Z8=n8,mR=w.forwardRef(({className:e,...t},r)=>s.jsx(z$,{ref:r,className:X("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));mR.displayName=z$.displayName;const eU=Gf("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),pR=w.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(V$,{ref:n,className:X(eU({variant:t}),e),...r}));pR.displayName=V$.displayName;const tU=w.forwardRef(({className:e,...t},r)=>s.jsx(G$,{ref:r,className:X("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));tU.displayName=G$.displayName;const gR=w.forwardRef(({className:e,...t},r)=>s.jsx(K$,{ref:r,className:X("absolute right-2 top-2 rounded-md p-1 text-foreground
360/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(Yf,{className:"h-4 w-4"})}));gR.displayName=K$.displayName;const vR=w.forwardRef(({className:e,...t},r)=>s.jsx(H$,{ref:r,className:X("text-sm font-semibold",e),...t}));vR.displayName=H$.displayName;const yR=w.forwardRef(({className:e,...t},r)=>s.jsx(q$,{ref:r,className:X("text-sm opacity-90",e),...t}));yR.displayName=q$.displayName;function rU(){const{toasts:e}=Qg();return s.jsxs(Z8,{children:[e.map(function({id:t,title:r,description:n,action:i,...a}){return s.jsxs(pR,{...a,children:[s.jsxs("div",{className:"grid gap-1",children:[r&&s.jsx(vR,{children:r}),n&&s.jsx(yR,{children:n})]}),i,s.jsx(gR,{})]},t)}),s.jsx(mR,{})]})}var f_=["light","dark"],nU="(prefers-color-scheme: dark)",iU=w.createContext(void 0),aU={setTheme:e=>{},themes:[]},sU=()=>{var e;return(e=w.useContext(iU))!=null?e:aU};w.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:i,defaultTheme:a,value:o,attrs:l,nonce:c})=>{let u=a==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=i?f_.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(g,p=!1,v=!0)=>{let x=o?o[g]:g,y=p?g+"|| ''":`'${x}'`,b="";return i&&v&&!p&&f_.includes(g)&&(b+=`d.style.colorScheme = '${g}';`),r==="class"?p||x?b+=`c.add(${y})`:b+="null":x&&(b+=`d[s](n,${y})`),b},m=e?`!function(){${d}${h(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${nU}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${u?"":"else{"+h(a,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(a,!1,!1)};}${f}}catch(t){}}();`;return w.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var oU=e=>{switch(e){case"success":return uU;case"info":return fU;case"warning":return dU;case"error":return hU;default:return null}},lU=Array(12).fill(0),cU=({visible:e,className:t})=>O.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},O.createElement("div",{className:"sonner-spinner"},lU.map((r,n)=>O.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),uU=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),dU=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),fU=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),hU=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),mU=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},O.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),O.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),pU=()=>{let[e,t]=O.useState(document.hidden);return O.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},cb=1,gU=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>
vendor: 1,050 bytes, line 360
360{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:cb++,a=this.toasts.find(l=>l.id===i),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:r}),{...l,...e,id:i,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
360this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),i=r!==void 0,a,o=n.then(async c=>{if(a=["resolve",c],O.isValidElement(c))i=!1,this.create({id:r,type:"default",message:c});else if(yU(c)&&!c.ok){i=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:d})}else if(t.success!==void 0){i=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){i=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var c;i&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||cb++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},xr=new gU,vU=(e,t)=>{let r=(t==null?void 0:t.id)||cb++;return xr.addToast({title:e,...t,id:r}),r},yU=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",xU=vU,bU=()=>xr.toasts,wU=()=>xr.getActiveToasts(),cx=Object.assign(xU,{success:xr.success,info:xr.info,warning:xr.warning,error:xr.error,custom:xr.custom,message:xr.message,promise:xr.promise,dismiss:xr.dismiss,loading:xr.loading},{getHistory:bU,getToasts:wU});function jU(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}jU(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
360left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
360:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
360--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 361`);function Bh(e){return e.label!==void 0}var SU=3,kU="32px",NU="16px",h_=4e3,_U=356,CU=14,AU=20,EU=200;function Nn(...e){return e.filter(Boolean).join(" ")}function PU(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var OU=e=>{var t,r,n,i,a,o,l,c,u,d,f;let{invert:h,toast:m,unstyled:g,interacting:p,setHeights:v,visibleToasts:x,heights:y,index:b,toasts:S,expanded:j,removeToast:N,defaultRichColors:k,closeButton:_,style:C,cancelButtonStyle:P,actionButtonStyle:E,className:A="",descriptionClassName:R="",duration:$,position:D,gap:M,loadingIcon:I,expandByDefault:T,classNames:L,icons:B,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:z}=e,[q,te]=O.useState(null),[ve,Pe]=O.useState(null),[Q,je]=O.useState(!1),[G,ee]=O.useState(!1),[Z,U]=O.useState(!1),[Ce,ye]=O.useState(!1),[He,We]=O.useState(!1),[ct,gr]=O.useState(0),[Pr,ws]=O.useState(0),Or=O.useRef(m.duration||$||h_),Jn=O.useRef(null),bn=O.useRef(null),ph=b===0,gh=b+1<=x,Qr=m.type,Mo=m.dismissible!==!1,EF=m.className||"",PF=m.descriptionClassName||"",vh=O.useMemo(()=>y.findIndex(Se=>Se.toastId===m.id)||0,[y,m.id]),OF=O.useMemo(()=>{var Se;return(Se=m.closeButton)!=null?Se:_},[m.closeButton,_]),Fk=O.useMemo(()=>m.duration||$||h_,[m.duration,$]),Py=O.useRef(0),Do=O.useRef(0),Bk=O.useRef(0),Lo=O.useRef(null),[TF,$F]=D.split("-"),Wk=O.useMemo(()=>y.reduce((Se,Ue,nt)=>nt>=vh?Se:Se+Ue.height,0),[y,vh]),Uk=pU(),RF=m.invert||h,Oy=Qr==="loading";Do.current=O.useMemo(()=>vh*M+Wk,[vh,Wk]),O.useEffect(()=>{Or.current=Fk},[Fk]),O.useEffect(()=>{je(!0)},[]),O.useEffect(()=>{let Se=bn.current;if(Se){let Ue=Se.getBoundingClientRect().height;return ws(Ue),v(nt=>[{toastId:m.id,height:Ue,position:m.position},...nt]),()=>v(nt=>nt.filter(wn=>wn.toastId!==m.id))}},[v,m.id]),O.useLayoutEffect(()=>{if(!Q)return;let Se=bn.current,Ue=Se.style.height;Se.style.height="auto";let nt=Se.getBoundingClientRect().height;Se.style.height=Ue,ws(nt),v(wn=>wn.find(jn=>jn.toastId===m.id)?wn.map(jn=>jn.toastId===m.id?{...jn,height:nt}:jn):[{toastId:m.id,height:nt,position:m.position},...wn])},[Q,m.title,m.description,v,m.id]);let fa=O.useCallback(()=>
361{ee(!0),gr(Do.current),v(Se=>Se.filter(Ue=>Ue.toastId!==m.id)),setTimeout(()=>{N(m)},EU)},[m,N,v,Do]);O.useEffect(()=>{if(m.promise&&Qr==="loading"||m.duration===1/0||m.type==="loading")return;let Se;return j||p||z&&Uk?(()=>{if(Bk.current<Py.current){let Ue=new Date().getTime()-Py.current;Or.current=Or.current-Ue}Bk.current=new Date().getTime()})():Or.current!==1/0&&(Py.current=new Date().getTime(),Se=setTimeout(()=>{var Ue;(Ue=m.onAutoClose)==null||Ue.call(m,m),fa()},Or.current)),()=>clearTimeout(Se)},[j,p,m,Qr,z,Uk,fa]),O.useEffect(()=>{m.delete&&fa()},[fa,m.delete]);function IF(){var Se,Ue,nt;return B!=null&&B.loading?O.createElement("div",{className:Nn(L==null?void 0:L.loader,(Se=m==null?void 0:m.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":Qr==="loading"},B.loading):I?O.createElement("div",{className:Nn(L==null?void 0:L.loader,(Ue=m==null?void 0:m.classNames)==null?void 0:Ue.loader,"sonner-loader"),"data-visible":Qr==="loading"},I):O.createElement(cU,{className:Nn(L==null?void 0:L.loader,(nt=m==null?void 0:m.classNames)==null?void 0:nt.loader),visible:Qr==="loading"})}return O.createElement("li",{tabIndex:0,ref:bn,className:Nn(A,EF,L==null?void 0:L.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,L==null?void 0:L.default,L==null?void 0:L[Qr],(r=m==null?void 0:m.classNames)==null?void 0:r[Qr]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:k,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":Q,"data-promise":!!m.promise,"data-swiped":He,"data-removed":G,"data-visible":gh,"data-y-position":TF,"data-x-position":$F,"data-index":b,"data-front":ph,"data-swiping":Z,"data-dismissible":Mo,"data-type":Qr,"data-invert":RF,"data-swipe-out":Ce,"data-swipe-direction":ve,"data-expanded":!!(j||T&&Q),style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${G?ct:Do.current}px`,"--initial-height":T?"auto":`${Pr}px`,...C,...m.style},onDragEnd:()=>{U(!1),te(null),Lo.current=null},onPointerDown:Se=>{Oy||!Mo||(Jn.current=new Date,gr(Do.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(U(!0),Lo.current={x:Se.clientX,y:Se.clientY}))},onPointerUp:()=>{var Se,Ue,nt,wn;if(Ce||!Mo)return;Lo.current=null;let jn=Number(((Se=bn.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ha=Number(((Ue=bn.current)==null?void 0:Ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),js=new Date().getTime()-((nt=Jn.current)==null?void 0:nt.getTime()),Sn=q==="x"?jn:ha,ma=Math.abs(Sn)/js;if(Math.abs(Sn)>=AU||ma>.11){gr(Do.current),(wn=m.onDismiss)==null||wn.call(m,m),Pe(q==="x"?jn>0?"right":"left":ha>0?"down":"up"),fa(),ye(!0),We(!1);return}U(!1),te(null)},onPointerMove:Se=>{var Ue,nt,wn,jn;if(!Lo.current||!Mo||((Ue=window.getSelection())==null?void 0:Ue.toString().length)>0)return;let ha=Se.clientY-Lo.current.y,js=Se.clientX-Lo.current.x,Sn=(nt=e.swipeDirections)!=null?nt:PU(D);!q&&(Math.abs(js)>1||Math.abs(ha)>1)&&te(Math.abs(js)>Math.abs(ha)?"x":"y");let ma={x:0,y:0};q==="y"?(Sn.includes("top")||Sn.includes("bottom"))&&(Sn.includes("top")&&ha<0||Sn.includes("bottom")&&ha>0)&&(ma.y=ha):q==="x"&&(Sn.includes("left")||Sn.includes("right"))&&(Sn.includes("left")&&js<0||Sn.includes("right")&&js>0)&&(ma.x=js),(Math.abs(ma.x)>0||Math.abs(ma.y)>0)&&We(!0),(wn=bn.current)==null||wn.style.setProperty("--swipe-amount-x",`${ma.x}px`),(jn=bn.current)==null||jn.style.setProperty("--swipe-amount-y",`${ma.y}px`)}},OF&&!m.jsx?O.createElement("button",{"aria-label":H,"data-disabled":Oy,"data-close-button":!0,onClick:Oy||!Mo?()=>{}:()=>{var Se;fa(),(Se=m.onDismiss)==null||Se.call(m,m)},className:Nn(L==null?void 0:L.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(a=B==null?void 0:B.close)!=null?a:mU):null,m.jsx||w.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:O.createElement(O.Fragment,null,Qr||m.icon||m.promise?O.createElement("div",{"data-icon":"",className:Nn(L==null?void 0:L.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||IF():null,m.type!=="loading"?m.
361icon||(B==null?void 0:B[Qr])||oU(Qr):null):null,O.createElement("div",{"data-content":"",className:Nn(L==null?void 0:L.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},O.createElement("div",{"data-title":"",className:Nn(L==null?void 0:L.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?O.createElement("div",{"data-description":"",className:Nn(R,PF,L==null?void 0:L.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),w.isValidElement(m.cancel)?m.cancel:m.cancel&&Bh(m.cancel)?O.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||P,onClick:Se=>{var Ue,nt;Bh(m.cancel)&&Mo&&((nt=(Ue=m.cancel).onClick)==null||nt.call(Ue,Se),fa())},className:Nn(L==null?void 0:L.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,w.isValidElement(m.action)?m.action:m.action&&Bh(m.action)?O.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||E,onClick:Se=>{var Ue,nt;Bh(m.action)&&((nt=(Ue=m.action).onClick)==null||nt.call(Ue,Se),!Se.defaultPrevented&&fa())},className:Nn(L==null?void 0:L.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function m_(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function TU(e,t){let r={};return[e,t].forEach((n,i)=>{let a=i===1,o=a?"--mobile-offset":"--offset",l=a?NU:kU;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=l:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}var $U=w.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:h,style:m,visibleToasts:g=SU,toastOptions:p,dir:v=m_(),gap:x=CU,loadingIcon:y,icons:b,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:j}=e,[N,k]=O.useState([]),_=O.useMemo(()=>Array.from(new Set([n].concat(N.filter(z=>z.position).map(z=>z.position)))),[N,n]),[C,P]=O.useState([]),[E,A]=O.useState(!1),[R,$]=O.useState(!1),[D,M]=O.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=O.useRef(null),T=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=O.useRef(null),B=O.useRef(!1),H=O.useCallback(z=>{k(q=>{var te;return(te=q.find(ve=>ve.id===z.id))!=null&&te.delete||xr.dismiss(z.id),q.filter(({id:ve})=>ve!==z.id)})},[]);return O.useEffect(()=>xr.subscribe(z=>{if(z.dismiss){k(q=>q.map(te=>te.id===z.id?{...te,delete:!0}:te));return}setTimeout(()=>{w$.flushSync(()=>{k(q=>{let te=q.findIndex(ve=>ve.id===z.id);return te!==-1?[...q.slice(0,te),{...q[te],...z},...q.slice(te+1)]:[z,...q]})})})}),[]),O.useEffect(()=>{if(d!=="system"){M(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window>"u")return;let z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:q})=>{M(q?"dark":"light")})}catch{z.addListener(({matches:te})=>{try{M(te?"dark":"light")}catch(ve){console.error(ve)}})}},[d]),O.useEffect(()=>{N.length<=1&&A(!1)},[N]),O.useEffect(()=>{let z=q=>{var te,ve;i.every(Pe=>q[Pe]||q.code===Pe)&&(A(!0),(te=I.current)==null||te.focus()),q.code==="Escape"&&(document.activeElement===I.current||(ve=I.current)!=null&&ve.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),O.useEffect(()=>{if(I.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,B.current=!1)}},[I.current]),O.createElement("section",{ref:t,"aria-label":`${S} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((z,q)=>{var te;let[ve,Pe]=z.split("-");return N.length?O.createElement("ol",{key:z,dir:v==="auto"?m_():v,tabIndex:-1,ref:I,className:l,"data-sonner-toaster":!0,"data-theme":D,"data-y-position":ve,"data-lifted":E&&N.length>1&&!a,"data-x-position":Pe,style:{"--front-toast-height":`${((te=C[0])==null?void 0:te.height)||0}px`,"--width":`${_U}px`,"--gap":`${x}px`,...m,...TU(c,u)},onBlur:Q=>{B.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(B.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||B.current||(B.current=!0,L.current=Q.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{R||A(!1)},onDragEnd:()=>A(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},N.filter(Q=>!Q.position&&q===0||Q.position===z).map((Q,je)=>{var G,ee;return O.createElement(OU,{key:Q.id,icons:b,index:je,toast:Q,defaultRichColors:f,duration:(G=p==null?void 0:p.duration)!=null?G:h,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:g,closeButton:(ee=p==null?void 0:p.closeButton)!=null?ee:o,interacting:R,position:z,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:H,toasts:N.filter(Z=>Z.position==Q.position),heights:C.filter(Z=>Z.position==Q.position),setHeights:P,expandByDefault:a,gap:x,loadingIcon:y,expanded:E,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))});const RU=({...e})=>{const{theme:t="system"}=sU();return s.jsx($U,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var IU=I1[" useId ".trim().toString()]||(()=>{}),MU=0;function pi(e){const[t,r]=w.useState(IU());return Pt(()=>{e||r(n=>n??String(MU++))},[e]),e||(t?`radix-${t}`:"")}const DU=["top","right","bottom","left"],ss=Math.min,Dr=Math.max,pp=Math.round,Wh=Math.floor,gi=e=>({x:e,y:e}
vendor: 11,913 bytes, line 361
361),LU={left:"right",right:"left",bottom:"top",top:"bottom"},FU={start:"end",end:"start"};function ub(e,t,r){return Dr(e,ss(t,r))}function Ji(e,t){return typeof e=="function"?e(t):e}function Zi(e){return e.split("-")[0]}function Uc(e){return e.split("-")[1]}function Ij(e){return e==="x"?"y":"x"}function Mj(e){return e==="y"?"height":"width"}const BU=new Set(["top","bottom"]);function ci(e){return BU.has(Zi(e))?"y":"x"}function Dj(e){return Ij(ci(e))}function WU(e,t,r){r===void 0&&(r=!1);const n=Uc(e),i=Dj(e),a=Mj(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=gp(o)),[o,gp(o)]}function UU(e){const t=gp(e);return[db(e),t,db(t)]}function db(e){return e.replace(/start|end/g,t=>FU[t])}const p_=["left","right"],g_=["right","left"],zU=["top","bottom"],VU=["bottom","top"];function HU(e,t,r){switch(e){case"top":case"bottom":return r?t?g_:p_:t?p_:g_;case"left":case"right":return t?zU:VU;default:return[]}}function qU(e,t,r,n){const i=Uc(e);let a=HU(Zi(e),r==="start",n);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(db)))),a}function gp(e){return e.replace(/left|right|bottom|top/g,t=>LU[t])}function GU(e){return{top:0,right:0,bottom:0,left:0,...e}}function xR(e){return typeof e!="number"?GU(e):{top:e,right:e,bottom:e,left:e}}function vp(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function v_(e,t,r){let{reference:n,floating:i}=e;const a=ci(t),o=Dj(t),l=Mj(o),c=Zi(t),u=a==="y",d=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,h=n[l]/2-i[l]/2;let m;switch(c){case"top":m={x:d,y:n.y-i.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-i.width,y:f};break;default:m={x:n.x,y:n.y}}switch(Uc(t)){case"start":m[o]-=h*(r&&u?-1:1);break;case"end":m[o]+=h*(r&&u?-1:1);break}return m}const KU=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=v_(u,n,c),h=n,m={},g=0;for(let p=0;p<l.length;p++){const{name:v,fn:x}=l[p],{x:y,y:b,data:S,reset:j}=await x({x:d,y:f,initialPlacement:n,placement:h,strategy:i,middlewareData:m,rects:u,platform:o,elements:{reference:e,floating:t}});d=y??d,f=b??f,m={...m,[v]:{...m[v],...S}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(u=j.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):j.rects),{x:d,y:f}=v_(u,h,c)),p=-1)}return{x:d,y:f,placement:h,strategy:i,middlewareData:m}};async function Dd(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Ji(t,e),g=xR(m),v=l[h?f==="floating"?"reference":"floating":f],x=vp(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(v)))==null||r?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),y=f==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),S=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},j=vp(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:c}):y);return{top:(x.top-j.top+g.top)/S.y,bottom:(j.bottom-x.bottom+g.bottom)/S.y,left:(x.left-j.left+g.left)/S.x,right:(j.right-x.right+g.right)/S.x}}const YU=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Ji(e,t)||{};if(u==null)return{};const f=xR(d),h={x:r,y:n},m=Dj(i),g=Mj(m),p=await o.getDimensions(u),v=m==="y",x=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",S=a.reference[g]+a.reference[m]-h[m]-a.floating[g],j=h[m]-a.reference[m],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=N?N[b]:0;(!k||!await(o.isElement==null?void 0:o.isElement(N)))&&(k=l.floating[b]||a.floating[g]);const _=S/2-j/2,C=k/2-p[g]/2-1,P=ss(f[x],C),E=ss(f[y],C),A=P,R=k-p[g]-E,$=k/2-p[g]/2+_,D=ub(A,$,R),M=!c.arrow&&Uc(i)!=null&&$!==D&&a.reference[g]/2-($<A?P:E)-p[g]/2<0,I=M?$<A?$-A:$-R:0;return{[m]:h[m]+I,data:{[m]:D,centerOffset:$-D-I,...M&&{alignmentOffset:I}},reset:M}}}),XU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...v}=Ji(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const x=Zi(i),y=ci(l),b=Zi(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=h||(b||!p?[gp(l)]:UU(l)),N=g!=="none";!h&&N&&j.push(...qU(l,p,g,S));const k=[l,...j],_=await Dd(t,v),C=[];let P=((n=a.flip)==null?void 0:n.overflows)||[];if(d&&C.push(_[x]),f){const $=WU(i,o,S);C.push(_[$[0]],_[$[1]])}if(P=[...P,{placement:i,overflows:C}],!C.every($=>$<=0)){var E,A;const $=(((E=a.flip)==null?void 0:E.index)||0)+1,D=k[$];if(D&&(!(f==="alignment"?y!==ci(D):!1)||P.every(T=>T.overflows[0]>0&&ci(T.placement)===y)))return{data:{index:$,overflows:P},reset:{placement:D}};let M=(A=P.filter(I=>I.overflows[0]<=0).sort((I,T)=>I.overflows[1]-T.overflows[1])[0])==null?void 0:A.placement;if(!M)switch(m){case"bestFit":{var R;const I=(R=P.filter(T=>{if(N){const L=ci(T.placement);return L===y||L==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(L=>L>0).reduce((L,B)=>L+B,0)]).sort((T,L)=>T[1]-L[1])[0])==null?void 0:R[0];I&&(M=I);break}case"initialPlacement":M=l;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function y_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function x_(e){return DU.some(t=>e[t]>=0)}const QU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=Ji(e,t);switch(n){case"referenceHidden":{const a=await Dd(t,{...i,elementContext:"reference"}),o=y_(a,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:x_(o)}}}case"escaped":{const a=await Dd(t,{...i,altBoundary:!0}),o=y_(a,r.floating);return{data:{escapedOffsets:o,escaped:x_(o)}}}default:return{}}}}},bR=new Set(["left","top"]);async function JU(e,t){const{placement:r,platform:n,elements:i}=e,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Zi(r),l=Uc(r),c=ci(r)==="y",u=bR.has(o)?-1:1,d=a&&c?-1:1,f=Ji(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const ZU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:a,placement:o,middlewareData:l}=t,c=await JU(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},ez=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:v=>{let{x,y}=v;return{x,y}}},...c}=Ji(e,t),u={x:r,y:n},d=await Dd(t,c),f=ci(Zi(i)),h=Ij(f);let m=u[h],g=u[f];if(a){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=m+d[v],b=m-d[x];m=ub(y,m,b)}if(o){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=g+d[v],b=g-d[x];g=ub(y,g,b)}const p=l.fn({...t,[h]:m,[f]:g});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[h]:a,[f]:o}}}}}},tz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Ji(e,t),d={x:r,y:n},f=ci(i),h=Ij(f);let m=d[h],g=d[f];const p=Ji(l,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const b=h==="y"?"height":"width",S=a.reference[h]-a.floating[b]+v.mainAxis,j=a.reference[h]+a.reference[b]-v.mainAxis;m<S?m=S:m>j&&(m=j)}if(u){var x,y;const b=h==="y"?"width":"height",S=bR.has(Zi(i)),j=a.reference[f]-a.floating[b]+(S&&((x=o.offset)==null?void 0:x[f])||0)+(S?0:v.crossAxis),N=a.reference[f]+a.reference[b]+(S?0:((y=o.offset)==null?void 0:y[f])||0)-(S?v.crossAxis:0);g<j?g=j:g>N&&(g=N)}return{[h]:m,[f]:g}}}},rz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=Ji(e,t),d=await Dd(t,u),f=Zi(i),h=Uc(i),m=ci(i)==="y",{width:g,height:p}=a.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const y=p-d.top-d.bottom,b=g-d.left-d.right,S=ss(p-d[v],y),j=ss(g-d[x],b),N=!t.middlewareData.shift;let k=S,_=j;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(_=b),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=y),N&&!h){const P=Dr(d.left,0),E=Dr(d.right,0),A=Dr(d.top,0),R=Dr(d.bottom,0);m?_=g-2*(P!==0||E!==0?P+E:Dr(d.left,d.right)):k=p-2*(A!==0||R!==0?A+R:Dr(d.top,d.bottom))}await c({...t,availableWidth:_,availableHeight:k});const C=await o.getDimensions(l.floating);return g!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function nv(){return typeof window<"u"}function zc(e){return wR(e)?(e.nodeName||"").toLowerCase():"#document"}function Ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ki(e){var t;return(t=(wR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wR(e){return nv()?e instanceof Node||e instanceof Ur(e).Node:!1}function Gn(e){return nv()?e instanceof Element||e instanceof Ur(e).Element:!1}function ji(e){return nv()?e instanceof HTMLElement||e instanceof Ur(e).HTMLElement:!1}function b_(e){return!nv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ur(e).ShadowRoot}const nz=new Set(["inline","contents"]);function Xf(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Kn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!nz.has(i)}const iz=new Set(["table","td","th"]);function az(e){return iz.has(zc(e))}const sz=[":popover-open",":modal"];function iv(e){return sz.some(t=>{try{return e.matches(t)}catch{return!1}})}const oz=["transform","translate","scale","rotate","perspective"],lz=["transform","translate","scale","rotate","perspective","filter"],cz=["paint","layout","strict","content"];function Lj(e){const t=Fj(),r=Gn(e)?Kn(e):e;return oz.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||lz.some(n=>(r.willChange||"").includes(n))||cz.some(n=>(r.contain||"").includes(n))}function uz(e){let t=os(e);for(;ji(t)&&!oc(t);){if(Lj(t))return t;if(iv(t))return null;t=os(t)}return null}function Fj(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const dz=new Set(["html","body","#document"]);function oc(e){return dz.has(zc(e))}function Kn(e){return Ur(e).getComputedStyle(e)}function av(e){return Gn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function os(e){if(zc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||b_(e)&&e.host||ki(e);return b_(t)?t.host:t}function jR(e){const t=os(e);return oc(t)?e.ownerDocument?e.ownerDocument.body:e.body:ji(t)&&Xf(t)?t:jR(t)}function Ld(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=jR(e),a=i===((n=e.ownerDocument)==null?void 0:n.body),o=Ur(i);if(a){const l=fb(o);
vendor: 4,772 bytes, line 361
361return t.concat(o,o.visualViewport||[],Xf(i)?i:[],l&&r?Ld(l):[])}return t.concat(i,Ld(i,[],r))}function fb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function SR(e){const t=Kn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=ji(e),a=i?e.offsetWidth:r,o=i?e.offsetHeight:n,l=pp(r)!==a||pp(n)!==o;return l&&(r=a,n=o),{width:r,height:n,$:l}}function Bj(e){return Gn(e)?e:e.contextElement}function Tl(e){const t=Bj(e);if(!ji(t))return gi(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:a}=SR(t);let o=(a?pp(r.width):r.width)/n,l=(a?pp(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const fz=gi(0);function kR(e){const t=Ur(e);return!Fj()||!t.visualViewport?fz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hz(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ur(e)?!1:t}function fo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),a=Bj(e);let o=gi(1);t&&(n?Gn(n)&&(o=Tl(n)):o=Tl(e));const l=hz(a,r,n)?kR(a):gi(0);let c=(i.left+l.x)/o.x,u=(i.top+l.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a){const h=Ur(a),m=n&&Gn(n)?Ur(n):n;let g=h,p=fb(g);for(;p&&n&&m!==g;){const v=Tl(p),x=p.getBoundingClientRect(),y=Kn(p),b=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,S=x.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=b,u+=S,g=Ur(p),p=fb(g)}}return vp({width:d,height:f,x:c,y:u})}function Wj(e,t){const r=av(e).scrollLeft;return t?t.left+r:fo(ki(e)).left+r}function NR(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:Wj(e,n)),a=n.top+t.scrollTop;return{x:i,y:a}}function mz(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const a=i==="fixed",o=ki(n),l=t?iv(t.floating):!1;if(n===o||l&&a)return r;let c={scrollLeft:0,scrollTop:0},u=gi(1);const d=gi(0),f=ji(n);if((f||!f&&!a)&&((zc(n)!=="body"||Xf(o))&&(c=av(n)),ji(n))){const m=fo(n);u=Tl(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}const h=o&&!f&&!a?NR(o,c,!0):gi(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:r.y*u.y-c.scrollTop*u.y+d.y+h.y}}function pz(e){return Array.from(e.getClientRects())}function gz(e){const t=ki(e),r=av(e),n=e.ownerDocument.body,i=Dr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Dr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Wj(e);const l=-r.scrollTop;return Kn(n).direction==="rtl"&&(o+=Dr(t.clientWidth,n.clientWidth)-i),{width:i,height:a,x:o,y:l}}function vz(e,t){const r=Ur(e),n=ki(e),i=r.visualViewport;let a=n.clientWidth,o=n.clientHeight,l=0,c=0;if(i){a=i.width,o=i.height;const u=Fj();(!u||u&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:l,y:c}}const yz=new Set(["absolute","fixed"]);function xz(e,t){const r=fo(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,a=ji(e)?Tl(e):gi(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=i*a.x,u=n*a.y;return{width:o,height:l,x:c,y:u}}function w_(e,t,r){let n;if(t==="viewport")n=vz(e,r);else if(t==="document")n=gz(ki(e));else if(Gn(t))n=xz(t,r);else{const i=kR(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return vp(n)}function _R(e,t){const r=os(e);return r===t||!Gn(r)||oc(r)?!1:Kn(r).position==="fixed"||_R(r,t)}function bz(e,t){const r=t.get(e);if(r)return r;let n=Ld(e,[],!1).filter(l=>Gn(l)&&zc(l)!=="body"),i=null;const a=Kn(e).position==="fixed";let o=a?os(e):e;for(;Gn(o)&&!oc(o);){const l=Kn(o),c=Lj(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&yz.has(i.position)||Xf(o)&&!c&&_R(e,o))?n=n.filter(d=>d!==o):i=l,o=os(o)}return t.set(e,n),n}function wz(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?iv(t)?[]:bz(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((u,d)=>{const f=w_(t,d,i);return u.top=Dr(f.top,u.top),u.right=ss(f.right,u.right),u.bottom=ss(f.bottom,u.bottom),u.left=Dr(f.left,u.left),u},w_(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function jz(e){const{width:t,height:r}=SR(e);return{width:t,height:r}}function Sz(e,t,r){const n=ji(t),i=ki(t),a=r==="fixed",o=fo(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=gi(0);function u(){c.x=Wj(i)}if(n||!n&&!a)if((zc(t)!=="body"||Xf(i))&&(l=av(t)),n){const m=fo(t,!0,a,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else i&&u();a&&!n&&i&&u();const d=i&&!n&&!a?NR(i,l):gi(0),f=o.left+l.scrollLeft-c.x-d.x,h=o.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function ux(e){return Kn(e).position==="static"}function j_(e,t){if(!ji(e)||Kn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ki(e)===r&&(r=r.ownerDocument.body),r}function CR(e,t){const r=Ur(e);
vendor: 9,639 bytes, line 361
361if(iv(e))return r;if(!ji(e)){let i=os(e);for(;i&&!oc(i);){if(Gn(i)&&!ux(i))return i;i=os(i)}return r}let n=j_(e,t);for(;n&&az(n)&&ux(n);)n=j_(n,t);return n&&oc(n)&&ux(n)&&!Lj(n)?r:n||uz(e)||r}const kz=async function(e){const t=this.getOffsetParent||CR,r=this.getDimensions,n=await r(e.floating);return{reference:Sz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Nz(e){return Kn(e).direction==="rtl"}const _z={convertOffsetParentRelativeRectToViewportRelativeRect:mz,getDocumentElement:ki,getClippingRect:wz,getOffsetParent:CR,getElementRects:kz,getClientRects:pz,getDimensions:jz,getScale:Tl,isElement:Gn,isRTL:Nz};function AR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cz(e,t){let r=null,n;const i=ki(e);function a(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(l||t(),!h||!m)return;const g=Wh(f),p=Wh(i.clientWidth-(d+h)),v=Wh(i.clientHeight-(f+m)),x=Wh(d),b={rootMargin:-g+"px "+-p+"px "+-v+"px "+-x+"px",threshold:Dr(0,ss(1,c))||1};let S=!0;function j(N){const k=N[0].intersectionRatio;if(k!==c){if(!S)return o();k?o(!1,k):n=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!AR(u,e.getBoundingClientRect())&&o(),S=!1}try{r=new IntersectionObserver(j,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(j,b)}r.observe(e)}return o(!0),a}function Az(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Bj(e),d=i||a?[...u?Ld(u):[],...Ld(t)]:[];d.forEach(x=>{i&&x.addEventListener("scroll",r,{passive:!0}),a&&x.addEventListener("resize",r)});const f=u&&l?Cz(u,r):null;let h=-1,m=null;o&&(m=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let g,p=c?fo(e):null;c&&v();function v(){const x=fo(e);p&&!AR(p,x)&&r(),p=x,g=requestAnimationFrame(v)}return r(),()=>{var x;d.forEach(y=>{i&&y.removeEventListener("scroll",r),a&&y.removeEventListener("resize",r)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Ez=ZU,Pz=ez,Oz=XU,Tz=rz,$z=QU,S_=YU,Rz=tz,Iz=(e,t,r)=>{const n=new Map,i={platform:_z,...r},a={...i.platform,_c:n};return KU(e,t,{...i,platform:a})};var Mz=typeof document<"u",Dz=function(){},Im=Mz?w.useLayoutEffect:Dz;function yp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!yp(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const a=i[n];if(!(a==="_owner"&&e.$$typeof)&&!yp(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function ER(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function k_(e,t){const r=ER(e);return Math.round(t*r)/r}function dx(e){const t=w.useRef(e);return Im(()=>{t.current=e}),t}function Lz(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=w.useState(n);yp(h,n)||m(n);const[g,p]=w.useState(null),[v,x]=w.useState(null),y=w.useCallback(T=>{T!==N.current&&(N.current=T,p(T))},[]),b=w.useCallback(T=>{T!==k.current&&(k.current=T,x(T))},[]),S=a||g,j=o||v,N=w.useRef(null),k=w.useRef(null),_=w.useRef(d),C=c!=null,P=dx(c),E=dx(i),A=dx(u),R=w.useCallback(()=>{if(!N.current||!k.current)return;const T={placement:t,strategy:r,middleware:h};E.current&&(T.platform=E.current),Iz(N.current,k.current,T).then(L=>{const B={...L,isPositioned:A.current!==!1};$.current&&!yp(_.current,B)&&(_.current=B,_o.flushSync(()=>{f(B)}))})},[h,t,r,E,A]);Im(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[u]);const $=w.useRef(!1);Im(()=>($.current=!0,()=>{$.current=!1}),[]),Im(()=>{if(S&&(N.current=S),j&&(k.current=j),S&&j){if(P.current)return P.current(S,j,R);R()}},[S,j,R,P,C]);const D=w.useMemo(()=>({reference:N,floating:k,setReference:y,setFloating:b}),[y,b]),M=w.useMemo(()=>({reference:S,floating:j}),[S,j]),I=w.useMemo(()=>{const T={position:r,left:0,top:0};if(!M.floating)return T;const L=k_(M.floating,d.x),B=k_(M.floating,d.y);return l?{...T,transform:"translate("+L+"px, "+B+"px)",...ER(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:L,top:B}},[r,l,M.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:R,refs:D,elements:M,floatingStyles:I}),[d,R,D,M,I])}const Fz=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?S_({element:n.current,padding:i}).fn(r):{}:n?S_({element:n,padding:i}).fn(r):{}}}},Bz=(e,t)=>({...Ez(e),options:[e,t]}),Wz=(e,t)=>({...Pz(e),options:[e,t]}),Uz=(e,t)=>({...Rz(e),options:[e,t]}),zz=(e,t)=>({...Oz(e),options:[e,t]}),Vz=(e,t)=>({...Tz(e),options:[e,t]}),Hz=(e,t)=>({...$z(e),options:[e,t]}),qz=(e,t)=>({...Fz(e),options:[e,t]});var Gz="Arrow",PR=w.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...a}=e;return s.jsx(ce.svg,{...a,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});PR.displayName=Gz;var Kz=PR;function Uj(e){const[t,r]=w.useState(void 0);return Pt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var zj="Popper",[OR,sv]=Yr(zj),[Yz,TR]=OR(zj),$R=e=>{const{__scopePopper:t,children:r}=e,[n,i]=w.useState(null);return s.jsx(Yz,{scope:t,anchor:n,onAnchorChange:i,children:r})};$R.displayName=zj;var RR="PopperAnchor",IR=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,a=TR(RR,r),o=w.useRef(null),l=Ne(t,o);return w.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:s.jsx(ce.div,{...i,ref:l})});IR.displayName=RR;var Vj="PopperContent",[Xz,Qz]=OR(Vj),MR=w.forwardRef((e,t)=>{var Q,je,G,ee,Z,U;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...p}=e,v=TR(Vj,r),[x,y]=w.useState(null),b=Ne(t,Ce=>y(Ce)),[S,j]=w.useState(null),N=Uj(S),k=(N==null?void 0:N.width)??0,_=(N==null?void 0:N.height)??0,C=n+(a!=="center"?"-"+a:""),P=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},E=Array.isArray(u)?u:[u],A=E.length>0,R={padding:P,boundary:E.filter(Zz),altBoundary:A},{refs:$,floatingStyles:D,placement:M,isPositioned:I,middlewareData:T}=Lz({strategy:"fixed",placement:C,whileElementsMounted:(...Ce)=>Az(...Ce,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[Bz({mainAxis:i+_,alignmentAxis:o}),c&&Wz({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Uz():void 0,...R}),c&&zz({...R}),Vz({...R,apply:({elements:Ce,rects:ye,availableWidth:He,availableHeight:We})=>{const{width:ct,height:gr}=ye.reference,Pr=Ce.floating.style;Pr.setProperty("--radix-popper-available-width",`${He}px`),Pr.setProperty("--radix-popper-available-height",`${We}px`),Pr.setProperty("--radix-popper-anchor-width",`${ct}px`),Pr.setProperty("--radix-popper-anchor-height",`${gr}px`)}}),S&&qz({element:S,padding:l}),e7({arrowWidth:k,arrowHeight:_}),h&&Hz({strategy:"referenceHidden",...R})]}),[L,B]=FR(M),H=Ct(g);Pt(()=>{I&&(H==null||H())},[I,H]);const z=(Q=T.arrow)==null?void 0:Q.x,q=(je=T.arrow)==null?void 0:je.y,te=((G=T.arrow)==null?void 0:G.centerOffset)!==0,[ve,Pe]=w.useState();return Pt(()=>{x&&Pe(window.getComputedStyle(x).zIndex)},[x]),s.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:I?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(ee=T.transformOrigin)==null?void 0:ee.x,(Z=T.transformOrigin)==null?void 0:Z.y].join(" "),...((U=T.hide)==null?void 0:U.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(Xz,{scope:r,placedSide:L,onArrowChange:j,arrowX:z,arrowY:q,shouldHideArrow:te,children:s.jsx(ce.div,{"data-side":L,"data-align":B,...p,ref:b,style:{...p.style,animation:I?void 0:"none"}})})})});MR.displayName=Vj;var DR="PopperArrow",Jz={top:"bottom",right:"left",bottom:"top",left:"right"},LR=w.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,a=Qz(DR,n),o=Jz[a.placedSide];return s.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]: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}
vendor: 4,245 bytes, line 361
361,children:s.jsx(Kz,{...i,ref:r,style:{...i.style,display:"block"}})})});LR.displayName=DR;function Zz(e){return e!==null}var e7=e=>({name:"transformOrigin",options:e,fn(t){var v,x,y;const{placement:r,rects:n,middlewareData:i}=t,o=((v=i.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=FR(r),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=i.arrow)==null?void 0:x.x)??0)+l/2,m=(((y=i.arrow)==null?void 0:y.y)??0)+c/2;let g="",p="";return u==="bottom"?(g=o?f:`${h}px`,p=`${-c}px`):u==="top"?(g=o?f:`${h}px`,p=`${n.floating.height+c}px`):u==="right"?(g=`${-c}px`,p=o?f:`${m}px`):u==="left"&&(g=`${n.floating.width+c}px`,p=o?f:`${m}px`),{data:{x:g,y:p}}}});function FR(e){const[t,r="center"]=e.split("-");return[t,r]}var BR=$R,WR=IR,UR=MR,zR=LR,[ov,UNe]=Yr("Tooltip",[sv]),lv=sv(),VR="TooltipProvider",t7=700,hb="tooltip.open",[r7,Hj]=ov(VR),HR=e=>{const{__scopeTooltip:t,delayDuration:r=t7,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:a}=e,o=w.useRef(!0),l=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(r7,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:a})};HR.displayName=VR;var Fd="Tooltip",[n7,cv]=ov(Fd),qR=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=Hj(Fd,e.__scopeTooltip),u=lv(t),[d,f]=w.useState(null),h=pi(),m=w.useRef(0),g=o??c.disableHoverableContent,p=l??c.delayDuration,v=w.useRef(!1),[x,y]=bi({prop:n,defaultProp:i??!1,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(hb))):c.onClose(),a==null||a(k)},caller:Fd}),b=w.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),S=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,y(!0)},[y]),j=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),N=w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,y(!0),m.current=0},p)},[p,y]);return w.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),s.jsx(BR,{...u,children:s.jsx(n7,{scope:t,contentId:h,open:x,stateAttribute:b,trigger:d,onTriggerChange:f,onTriggerEnter:w.useCallback(()=>{c.isOpenDelayedRef.current?N():S()},[c.isOpenDelayedRef,N,S]),onTriggerLeave:w.useCallback(()=>{g?j():(window.clearTimeout(m.current),m.current=0)},[j,g]),onOpen:S,onClose:j,disableHoverableContent:g,children:r})})};qR.displayName=Fd;var mb="TooltipTrigger",GR=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=cv(mb,r),a=Hj(mb,r),o=lv(r),l=w.useRef(null),c=Ne(t,l,i.onTriggerChange),u=w.useRef(!1),d=w.useRef(!1),f=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),s.jsx(WR,{asChild:!0,...o,children:s.jsx(ce.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:ne(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:ne(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:ne(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ne(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:ne(e.onBlur,i.onClose),onClick:ne(e.onClick,i.onClose)})})});GR.displayName=mb;var i7="TooltipPortal",[zNe,a7]=ov(i7,{forceMount:void 0}),lc="TooltipContent",KR=w.forwardRef((e,t)=>{const r=a7(lc,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...a}=e,o=cv(lc,e.__scopeTooltip);return s.jsx(Xr,{present:n||o.open,children:o.disableHoverableContent?s.jsx(YR,{side:i,...a,ref:t}):s.jsx(s7,{side:i,...a,ref:t})})}),s7=w.forwardRef((e,t)=>{const r=cv(lc,e.__scopeTooltip),n=Hj(lc,e.__scopeTooltip),i=w.useRef(null),a=Ne(t,i),[o,l]=w.useState(null),{trigger:c,onClose:u}=r,d=i.current,{onPointerInTransitChange:f}=n,h=w.useCallback(()=>
vendor: 4,195 bytes, line 361
361{l(null),f(!1)},[f]),m=w.useCallback((g,p)=>{const v=g.currentTarget,x={x:g.clientX,y:g.clientY},y=d7(x,v.getBoundingClientRect()),b=f7(x,y),S=h7(p.getBoundingClientRect()),j=p7([...b,...S]);l(j),f(!0)},[f]);return w.useEffect(()=>()=>h(),[h]),w.useEffect(()=>{if(c&&d){const g=v=>m(v,d),p=v=>m(v,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",p)}}},[c,d,m,h]),w.useEffect(()=>{if(o){const g=p=>{const v=p.target,x={x:p.clientX,y:p.clientY},y=(c==null?void 0:c.contains(v))||(d==null?void 0:d.contains(v)),b=!m7(x,o);y?h():b&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,o,u,h]),s.jsx(YR,{...e,ref:a})}),[o7,l7]=ov(Fd,{isInside:!1}),c7=vW("TooltipContent"),YR=w.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=cv(lc,r),u=lv(r),{onClose:d}=c;return w.useEffect(()=>(document.addEventListener(hb,d),()=>document.removeEventListener(hb,d)),[d]),w.useEffect(()=>{if(c.trigger){const f=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),s.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:s.jsxs(UR,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(c7,{children:n}),s.jsx(o7,{scope:r,isInside:!0,children:s.jsx(FW,{id:c.contentId,role:"tooltip",children:i||n})})]})})});KR.displayName=lc;var XR="TooltipArrow",u7=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=lv(r);return l7(XR,r).isInside?null:s.jsx(zR,{...i,...n,ref:t})});u7.displayName=XR;function d7(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,i,a)){case a:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function f7(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function h7(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function m7(e,t){const{x:r,y:n}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],u=l.x,d=l.y,f=c.x,h=c.y;d>n!=h>n&&r<(f-u)*(n-d)/(h-d)+u&&(i=!i)}return i}function p7(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),g7(t)}function g7(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const i=e[n];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const a=r[r.length-1],o=r[r.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var v7=HR,y7=qR,x7=GR,QR=KR;const sd=v7,Mm=y7,Dm=x7,od=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(QR,{ref:n,sideOffset:t,className:X("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
361de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));od.displayName=QR.displayName;var Qf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ho=typeof window>"u"||"Deno"in globalThis;function br(){}function b7(e,t){return typeof e=="function"?e(t):e}function pb(e){return typeof e=="number"&&e>=0&&e!==1/0}function JR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function es(e,t){return typeof e=="function"?e(t):e}function nn(e,t){return typeof e=="function"?e(t):e}function N_(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==qj(o,t.options))return!1}else if(!Wd(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||a&&!a(t))}function __(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Bd(t.options.mutationKey)!==Bd(a))return!1}else if(!Wd(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function qj(e,t){return((t==null?void 0:t.queryKeyHashFn)||Bd)(e)}function Bd(e){return JSON.stringify(e,(t,r)=>vb(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Wd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Wd(e[r],t[r])):!1}function ZR(e,t){if(e===t)return e;const r=C_(e)&&C_(t);if(r||vb(e)&&vb(t)){const n=r?e:Object.keys(e),i=n.length,a=r?t:Object.keys(t),o=a.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d<o;d++){const f=r?d:a[d];(!r&&c.has(f)||r)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=ZR(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return i===o&&u===i?e:l}return t}function gb(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function C_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vb(e){if(!A_(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!A_(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function A_(e){return Object.prototype.toString.call(e)==="[object Object]"}function w7(e){return new Promise(t=>{setTimeout(t,e)})}function yb(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?ZR(e,t):t}function j7(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function S7(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Gj=Symbol();function eI(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Gj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function k7(e,t){return typeof e=="function"?e(...t):!!e}var qs,Ta,Ll,eT,N7=(eT=class extends Qf{constructor(){super();ge(this,qs);ge(this,Ta);ge(this,Ll);ae(this,Ll,t=>{if(!ho&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){F(this,Ta)||this.setEventListener(F(this,Ll))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Ta))==null||t.call(this),ae(this,Ta,void 0))}setEventListener(t){var r;ae(this,Ll,t),(r=F(this,Ta))==null||r.call(this),ae(this,Ta,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){F(this,qs)!==t&&(ae(this,qs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof F(this,qs)=="boolean"?F(this,qs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},qs=new WeakMap,Ta=new WeakMap,Ll=new WeakMap,eT),Kj=new N7,Fl,$a,Bl,tT,_7=(tT=class extends Qf{constructor(){super();ge(this,Fl,!0);ge(this,$a);ge(this,Bl);ae(this,Bl,t=>{if(!ho&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n
vendor: 4,353 bytes, line 361
361)}}})}onSubscribe(){F(this,$a)||this.setEventListener(F(this,Bl))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,$a))==null||t.call(this),ae(this,$a,void 0))}setEventListener(t){var r;ae(this,Bl,t),(r=F(this,$a))==null||r.call(this),ae(this,$a,t(this.setOnline.bind(this)))}setOnline(t){F(this,Fl)!==t&&(ae(this,Fl,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return F(this,Fl)}},Fl=new WeakMap,$a=new WeakMap,Bl=new WeakMap,tT),xp=new _7;function xb(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}function C7(e){return Math.min(1e3*2**e,3e4)}function tI(e){return(e??"online")==="online"?xp.isOnline():!0}var rI=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function fx(e){return e instanceof rI}function nI(e){let t=!1,r=0,n=!1,i;const a=xb(),o=p=>{var v;n||(h(new rI(p)),(v=e.abort)==null||v.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>Kj.isFocused()&&(e.networkMode==="always"||xp.isOnline())&&e.canRun(),d=()=>tI(e.networkMode)&&e.canRun(),f=p=>{var v;n||(n=!0,(v=e.onSuccess)==null||v.call(e,p),i==null||i(),a.resolve(p))},h=p=>{var v;n||(n=!0,(v=e.onError)==null||v.call(e,p),i==null||i(),a.reject(p))},m=()=>new Promise(p=>{var v;i=x=>{(n||u())&&p(x)},(v=e.onPause)==null||v.call(e)}).then(()=>{var p;i=void 0,n||(p=e.onContinue)==null||p.call(e)}),g=()=>{if(n)return;let p;const v=r===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(x){p=Promise.reject(x)}Promise.resolve(p).then(f).catch(x=>{var N;if(n)return;const y=e.retry??(ho?0:3),b=e.retryDelay??C7,S=typeof b=="function"?b(r,x):b,j=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,x);if(t||!j){h(x);return}r++,(N=e.onFail)==null||N.call(e,r,x),w7(S).then(()=>u()?void 0:m()).then(()=>{t?h(x):g()})})};return{promise:a,cancel:o,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?g():m().then(g),a)}}var A7=e=>setTimeout(e,0);function E7(){let e=[],t=0,r=l=>{l()},n=l=>{l()},i=A7;const a=l=>{t?e.push(l):i(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{i=l}}}var zt=E7(),Gs,rT,iI=(rT=class{constructor(){ge(this,Gs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pb(this.gcTime)&&ae(this,Gs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ho?1/0:5*60*1e3))}clearGcTimeout(){F(this,Gs)&&(clearTimeout(F(this,Gs)),ae(this,Gs,void 0))}},Gs=new WeakMap,rT),Wl,Ks,rn,Ys,Zt,Mf,Xs,Tn,Oi,nT,P7=(nT=class extends iI{constructor(t){super();ge(this,Tn);ge(this,Wl);ge(this,Ks);ge(this,rn);ge(this,Ys);ge(this,Zt);ge(this,Mf);ge(this,Xs);ae(this,Xs,!1),ae(this,Mf,t.defaultOptions),this.setOptions(t.options),this.observers=[],ae(this,Ys,t.client),ae(this,rn,F(this,Ys).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ae(this,Wl,O7(this.options)),this.state=t.state??F(this,Wl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=F(this,Zt))==null?void 0:t.promise}setOptions(t){this.options={...F(this,Mf),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,rn).remove(this)}setData(t,r){const n=yb(this.state.data,t,this.options);return Oe(this,Tn,Oi).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Oe(this,Tn,Oi).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=F(this,Zt))==null?void 0:n.promise;return(i=F(this,Zt))==null||i.cancel(t),r?r.then(br).catch(br):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(F(this,Wl))}isActive(){return this.observers.some(t=>nn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gj||this.state.dataUpdateCount+this.state.errorUpdate
361Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>es(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!JR(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Zt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Zt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,rn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(F(this,Zt)&&(F(this,Xs)?F(this,Zt).cancel({revert:!0}):F(this,Zt).cancelRetry()),this.scheduleGc()),F(this,rn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,Tn,Oi).call(this,{type:"invalidate"})}fetch(t,r){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(F(this,Zt))return F(this,Zt).continueRetry(),F(this,Zt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(ae(this,Xs,!0),n.signal)})},a=()=>{const h=eI(this.options,r),g=(()=>{const p={client:F(this,Ys),queryKey:this.queryKey,meta:this.meta};return i(p),p})();return ae(this,Xs,!1),this.options.persister?this.options.persister(h,g,this):h(g)},l=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:F(this,Ys),state:this.state,fetchFn:a};return i(h),h})();(u=this.options.behavior)==null||u.onFetch(l,this),ae(this,Ks,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Oe(this,Tn,Oi).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=h=>{var m,g,p,v;fx(h)&&h.silent||Oe(this,Tn,Oi).call(this,{type:"error",error:h}),fx(h)||((g=(m=F(this,rn).config).onError)==null||g.call(m,h,this),(v=(p=F(this,rn).config).onSettled)==null||v.call(p,this.state.data,h,this)),this.scheduleGc()};return ae(this,Zt,nI({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var m,g,p,v;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(x){c(x);return}(g=(m=F(this,rn).config).onSuccess)==null||g.call(m,h,this),(v=(p=F(this,rn).config).onSettled)==null||v.call(p,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,m)=>{Oe(this,Tn,Oi).call(this,{type:"failed",failureCount:h,error:m})},onPause:()=>{Oe(this,Tn,Oi).call(this,{type:"pause"})},onContinue:()=>{Oe(this,Tn,Oi).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),F(this,Zt).start()}},Wl=new WeakMap,Ks=new WeakMap,rn=new WeakMap,Ys=new WeakMap,Zt=new WeakMap,Mf=new WeakMap,Xs=new WeakMap,Tn=new WeakSet,Oi=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...aI(n.data,this.options),fetchMeta:t.meta??null};case"success":return ae(this,Ks,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return fx(i)&&i.revert&&F(this,Ks)?{...F(this,Ks),fetchStatus:"idle"}
vendor: 5,105 bytes, line 361
361:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),zt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),F(this,rn).notify({query:this,type:"updated",action:t})})},nT);function aI(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tI(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function O7(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ni,iT,T7=(iT=class extends Qf{constructor(t={}){super();ge(this,ni);this.config=t,ae(this,ni,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??qj(i,r);let o=this.get(a);return o||(o=new P7({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){F(this,ni).has(t.queryHash)||(F(this,ni).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=F(this,ni).get(t.queryHash);r&&(t.destroy(),r===t&&F(this,ni).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,ni).get(t)}getAll(){return[...F(this,ni).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>N_(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>N_(t,n)):r}notify(t){zt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){zt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ni=new WeakMap,iT),ii,ir,Qs,ai,ba,aT,$7=(aT=class extends iI{constructor(t){super();ge(this,ai);ge(this,ii);ge(this,ir);ge(this,Qs);this.mutationId=t.mutationId,ae(this,ir,t.mutationCache),ae(this,ii,[]),this.state=t.state||R7(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,ii).includes(t)||(F(this,ii).push(t),this.clearGcTimeout(),F(this,ir).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ae(this,ii,F(this,ii).filter(r=>r!==t)),this.scheduleGc(),F(this,ir).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,ii).length||(this.state.status==="pending"?this.scheduleGc():F(this,ir).remove(this))}continue(){var t;return((t=F(this,Qs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,c,u,d,f,h,m,g,p,v,x,y,b,S,j,N,k,_;const r=()=>{Oe(this,ai,ba).call(this,{type:"continue"})};ae(this,Qs,nI({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(C,P)=>{Oe(this,ai,ba).call(this,{type:"failed",failureCount:C,error:P})},onPause:()=>{Oe(this,ai,ba).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,ir).canRun(this)}));const n=this.state.status==="pending",i=!F(this,Qs).canStart();try{if(n)r();else{Oe(this,ai,ba).call(this,{type:"pending",variables:t,isPaused:i}),await((o=(a=F(this,ir).config).onMutate)==null?void 0:o.call(a,t,this));const P=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));P!==this.state.context&&Oe(this,ai,ba).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const C=await F(this,Qs).start();return await((d=(u=F(this,ir).config).onSuccess)==null?void 0:d.call(u,C,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,C,t,this.state.context)),await((g=(m=F(this,ir).config).onSettled)==null?void 0:g.call(m,C,null,this.state.variables,this.state.context,this)),await((v=(p=this.options).onSettled)==null?void 0:v.call(p,C,null,t,this.state.context)),Oe(this,ai,ba).call(this,{type:"success",data:C}),C}catch(C){try{throw await((y=(x=F(this,ir).config).onError)==null?void 0:y.call(x,C,t,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,C,t,this.state.context)),await((N=(j=F(this,ir).config).onSettled)==null?void 0:N.call(j,void 0,C,this.state.variables,this.state.context,this)),await((_=(k=this.options).onSettled)==null?void 0:_.call(k,void 0,C,t,this.state.context)),C}finally{Oe(this,ai,ba).call(this,{type:"error",error:C})}}finally{F(this,ir).runNext(this)}}},ii=new WeakMap,ir=new WeakMap,Qs=new WeakMap,ai=new WeakSet,ba=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
361case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),zt.batch(()=>{F(this,ii).forEach(n=>{n.onMutationUpdate(t)}),F(this,ir).notify({mutation:this,type:"updated",action:t})})},aT);function R7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Di,$n,Df,sT,I7=(sT=class extends Qf{constructor(t={}){super();ge(this,Di);ge(this,$n);ge(this,Df);this.config=t,ae(this,Di,new Set),ae(this,$n,new Map),ae(this,Df,0)}build(t,r,n){const i=new $7({mutationCache:this,mutationId:++yh(this,Df)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){F(this,Di).add(t);const r=Uh(t);if(typeof r=="string"){const n=F(this,$n).get(r);n?n.push(t):F(this,$n).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,Di).delete(t)){const r=Uh(t);if(typeof r=="string"){const n=F(this,$n).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&F(this,$n).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Uh(t);if(typeof r=="string"){const n=F(this,$n).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=Uh(t);if(typeof r=="string"){const i=(n=F(this,$n).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zt.batch(()=>{F(this,Di).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,Di).clear(),F(this,$n).clear()})}getAll(){return Array.from(F(this,Di))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>__(r,n))}findAll(t={}){return this.getAll().filter(r=>__(t,r))}notify(t){zt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>
vendor: 14,781 bytes, line 361
361r.state.isPaused);return zt.batch(()=>Promise.all(t.map(r=>r.continue().catch(br))))}},Di=new WeakMap,$n=new WeakMap,Df=new WeakMap,sT);function Uh(e){var t;return(t=e.options.scope)==null?void 0:t.id}function E_(e){return{onFetch:(t,r)=>{var d,f,h,m,g;const n=t.options,i=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const v=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},x=eI(t.options,t.fetchOptions),y=async(b,S,j)=>{if(p)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const k=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:S,direction:j?"backward":"forward",meta:t.options.meta};return v(E),E})(),_=await x(k),{maxPages:C}=t.options,P=j?S7:j7;return{pages:P(b.pages,_,C),pageParams:P(b.pageParams,S,C)}};if(i&&a.length){const b=i==="backward",S=b?M7:P_,j={pages:a,pageParams:o},N=S(n,j);l=await y(j,N,b)}else{const b=e??a.length;do{const S=c===0?o[0]??n.initialPageParam:P_(n,l);if(c>0&&S==null)break;l=await y(l,S),c++}while(c<b)}return l};t.options.persister?t.fetchFn=()=>{var p,v;return(v=(p=t.options).persister)==null?void 0:v.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function P_(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function M7(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ut,Ra,Ia,Ul,zl,Ma,Vl,Hl,oT,D7=(oT=class{constructor(e={}){ge(this,ut);ge(this,Ra);ge(this,Ia);ge(this,Ul);ge(this,zl);ge(this,Ma);ge(this,Vl);ge(this,Hl);ae(this,ut,e.queryCache||new T7),ae(this,Ra,e.mutationCache||new I7),ae(this,Ia,e.defaultOptions||{}),ae(this,Ul,new Map),ae(this,zl,new Map),ae(this,Ma,0)}mount(){yh(this,Ma)._++,F(this,Ma)===1&&(ae(this,Vl,Kj.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,ut).onFocus())})),ae(this,Hl,xp.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,ut).onOnline())})))}unmount(){var e,t;yh(this,Ma)._--,F(this,Ma)===0&&((e=F(this,Vl))==null||e.call(this),ae(this,Vl,void 0),(t=F(this,Hl))==null||t.call(this),ae(this,Hl,void 0))}isFetching(e){return F(this,ut).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Ra).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,ut).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=F(this,ut).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(es(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return F(this,ut).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=F(this,ut).get(n.queryHash),a=i==null?void 0:i.state.data,o=b7(t,a);if(o!==void 0)return F(this,ut).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return zt.batch(()=>F(this,ut).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,ut).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=F(this,ut);zt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=F(this,ut);return zt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=zt.batch(()=>F(this,ut).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(br).catch(br)}invalidateQueries(e,t={}){return zt.batch(()=>(F(this,ut).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=zt.batch(()=>F(this,ut).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(br)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(br)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=F(this,ut).build(this,t);return r.isStaleByTime(es(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(br).catch(br)}fetchInfiniteQuery(e){return e.behavior=E_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(br).catch(br)}ensureInfiniteQueryData(e){return e.behavior=E_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xp.isOnline()?F(this,Ra).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,ut)}getMutationCache(){return F(this,Ra)}getDefaultOptions(){return F(this,Ia)}setDefaultOptions(e){ae(this,Ia,e)}setQueryDefaults(e,t){F(this,Ul).set(Bd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,Ul).values()],r={};return t.forEach(n=>{Wd(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){F(this,zl).set(Bd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,zl).values()],r={};return t.forEach(n=>{Wd(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,Ia).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qj(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Gj&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,Ia).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,ut).clear(),F(this,Ra).clear()}},ut=new WeakMap,Ra=new WeakMap,Ia=new WeakMap,Ul=new WeakMap,zl=new WeakMap,Ma=new WeakMap,Vl=new WeakMap,Hl=new WeakMap,oT),yr,Te,Lf,ar,Js,ql,Da,La,Ff,Gl,Kl,Zs,eo,Fa,Yl,De,zu,bb,wb,jb,Sb,kb,Nb,_b,sI,lT,L7=(lT=class extends Qf{constructor(t,r){super();ge(this,De);ge(this,yr);ge(this,Te);ge(this,Lf);ge(this,ar);ge(this,Js);ge(this,ql);ge(this,Da);ge(this,La);ge(this,Ff);ge(this,Gl);ge(this,Kl);ge(this,Zs);ge(this,eo);ge(this,Fa);ge(this,Yl,new Set);this.options=r,ae(this,yr,t),ae(this,La,null),ae(this,Da,xb()),this.options.experimental_prefetchInRender||F(this,Da).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Te).addObserver(this),O_(F(this,Te),this.options)?Oe(this,De,zu).call(this):this.updateResult(),Oe(this,De,Sb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Cb(F(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Cb(F(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,De,kb).call(this),Oe(this,De,Nb).call(this),F(this,Te).removeObserver(this)}setOptions(t){const r=this.options,n=F(this,Te);if(this.options=F(this,yr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nn(this.options.enabled,F(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,De,_b).call(this),F(this,Te).setOptions(this.options),r._defaulted&&!gb(this.options,r)&&F(this,yr).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Te),observer:this});const i=this.hasListeners();i&&T_(F(this,Te),n,this.options,r)&&Oe(this,De,zu).call(this),this.updateResult(),i&&(F(this,Te)!==n||nn(this.options.enabled,F(this,Te))!==nn(r.enabled,F(this,Te))||es(this.options.staleTime,F(this,Te))!==es(r.staleTime,F(this,Te)))&&Oe(this,De,bb).call(this);const a=Oe(this,De,wb).call(this);i&&(F(this,Te)!==n||nn(this.options.enabled,F(this,Te))!==nn(r.enabled,F(this,Te))||a!==F(this,Fa))&&Oe(this,De,jb).call(this,a)}getOptimisticResult(t){const r=F(this,yr).getQueryCache().build(F(this,yr),t),n=this.createResult(r,t);return B7(this,n)&&(ae(this,ar,n),ae(this,ql,this.options),ae(this,Js,F(this,Te).state)),n}getCurrentResult(){return F(this,ar)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),Reflect.get(n,i))})}trackProp(t){F(this,Yl).add(t)}getCurrentQuery(){return F(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=F(this,yr).defaultQueryOptions(t),n=F(this,yr).getQueryCache().build(F(this,yr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Oe(this,De,zu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,ar)))}createResult(t,r){var C;const n=F(this,Te),i=this.options,a=F(this,ar),o=F(this,Js),l=F(this,ql),u=t!==n?t.state:F(this,Lf),{state:d}=t;let f={...d},h=!1,m;if(r._optimisticResults){const P=this.hasListeners(),E=!P&&O_(t,r),A=P&&T_(t,n,r,i);(E||A)&&(f={...f,...aI(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:v}=f;m=f.data;let x=!1;if(r.placeholderData!==void 0&&m===void 0&&v==="pending"){let P;a!=null&&a.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(P=a.data,x=!0):P=typeof r.placeholderData=="function"?r.placeholderData((C=F(this,Kl))==null?void 0:C.state.data,F(this,Kl)):r.placeholderData,P!==void 0&&(v="success",m=yb(a==null?void 0:a.data,P,r),h=!0)}if(r.select&&m!==void 0&&!x)if(a&&m===(o==null?void 0:o.data)&&r.select===F(this,Ff))m=F(this,Gl);else try{ae(this,Ff,r.select),m=r.select(m),m=yb(a==null?void 0:a.data,m,r),ae(this,Gl,m),ae(this,La,null)}catch(P){ae(this,La,P)}F(this,La)&&(g=F(this,La),m=F(this,Gl),p=Date.now(),v="error");const y=f.fetchStatus==="fetching",b=v==="pending",S=v==="error",j=b&&y,N=m!==void 0,_={status:v,fetchStatus:f.fetchStatus,isPending:b,isSuccess:v==="success",isError:S,isInitialLoading:j,isLoading:j,data:m,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:S&&!N,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&N,isStale:Yj(t,r),refetch:this.refetch,promise:F(this,Da),isEnabled:nn(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=R=>{_.status==="error"?R.reject(_.error):_.data!==void 0&&R.resolve(_.data)},E=()=>{const R=ae(this,Da,_.promise=xb());P(R)},A=F(this,Da);switch(A.status){case"pending":t.queryHash===n.queryHash&&P(A);break;case"fulfilled":(_.status==="error"||_.data!==A.value)&&E();break;case"rejected":(_.status!=="error"||_.error!==A.reason)&&E();break}}return _}updateResult(){const t=F(this,ar),r=this.createResult(F(this,Te),this.options);if(ae(this,Js,F(this,Te).state),ae(this,ql,this.options),F(this,Js).data!==void 0&&ae(this,Kl,F(this,Te)),gb(r,t))return;ae(this,ar,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!F(this,Yl).size)return!0;const o=new Set(a??F(this,Yl));return this.options.throwOnError&&o.add("error"),Object.keys(F(this,ar)).some(l=>{const c=l;return F(this,ar)[c]!==t[c]&&o.has(c)})};Oe(this,De,sI).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,De,Sb).call(this)}},yr=new WeakMap,Te=new WeakMap,Lf=new WeakMap,ar=new WeakMap,Js=new WeakMap,ql=new WeakMap,Da=new WeakMap,La=new WeakMap,Ff=new WeakMap,Gl=new WeakMap,Kl=new WeakMap,Zs=new WeakMap,eo=new WeakMap,Fa=new WeakMap,Yl=new WeakMap,De=new WeakSet,zu=function(t){Oe(this,De,_b).call(this);let r=F(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(br)),r},bb=function(){Oe(this,De,kb).call(this);const t=es(this.options.staleTime,F(this,Te));if(ho||F(this,ar).isStale||!pb(t))return;const n=JR(F(this,ar).dataUpdatedAt,t)+1;ae(this,Zs,setTimeout(()=>{F(this,ar).isStale||this.updateResult()},n))},wb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Te)):this.options.refetchInterval)??!1},jb=function(t){Oe(this,De,Nb).call(this),ae(this,Fa,t),!(ho||nn(this.options.enabled,F(this,Te))===!1||!pb(F(this,Fa))||F(this,Fa)===0)&&ae(this,eo,setInterval(()=>{(this.options.refetchIntervalInBackground||Kj.isFocused())&&Oe(this,De,zu).call(this)},F(this,Fa)))},Sb=function(){Oe(this,De,bb).call(this),Oe(this,De,jb).call(this,Oe(this,De,wb).call(this))},kb=function(){F(this,Zs)&&(clearTimeout(F(this,Zs)),ae(this,Zs,void 0))},Nb=function(){F(this,eo)&&(clearInterval(F(this,eo)),ae(this,eo,void 0))},_b=function(){const t=F(this,yr).getQueryCache().build(F(this,yr),this.options);if(t===F(this,Te))return;const r=F(this,Te);ae(this,Te,t),ae(this,Lf,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},sI=function(t){zt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(F(this,ar))}),F(this,yr).getQueryCache().notify({query:F(this,Te),type:"observerResultsUpdated"})})},lT);function F7(e,t){return nn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function O_(e,t){return F7(e,t)||e.state.data!==void 0&&Cb(e,t,t.refetchOnMount)}function Cb(e,t,r){if(nn(t.enabled,e)!==!1&&es(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Yj(e,t)}return!1}function T_(e,t,r,n){return(e!==t||nn(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Yj(e,r)}function Yj(e,t){return nn(t.enabled,e)!==!1&&e.isStaleByTime(es(t.staleTime,e))}function B7(e,t){return!gb(e.getCurrentResult(),t)}var oI=w.createContext(void 0),uv=e=>{const t=w.useContext(oI);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},W7=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(oI.Provider,{value:e,children:t})),lI=w.createContext(!1),U7=()=>w.useContext(lI);lI.Provider;function z7(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}
361var V7=w.createContext(z7()),H7=()=>w.useContext(V7),q7=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},G7=e=>{w.useEffect(()=>{e.clearReset()},[e])},K7=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||k7(r,[e.error,n])),Y7=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},X7=(e,t)=>e.isLoading&&e.isFetching&&!t,Q7=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,$_=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function J7(e,t,r){var f,h,m,g,p;const n=U7(),i=H7(),a=uv(),o=a.defaultQueryOptions(e);(h=(f=a.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||h.call(f,o),o._optimisticResults=n?"isRestoring":"optimistic",Y7(o),q7(o,i),G7(i);const l=!a.getQueryCache().get(o.queryHash),[c]=w.useState(()=>new t(a,o)),u=c.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(v=>{const x=d?c.subscribe(zt.batchCalls(v)):br;return c.updateResult(),x},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),w.useEffect(()=>{c.setOptions(o)},[o,c]),Q7(o,u))throw $_(o,c,i);if(K7({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((g=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||g.call(m,o,u),o.experimental_prefetchInRender&&!ho&&X7(u,n)){const v=l?$_(o,c,i):(p=a.getQueryCache().get(o.queryHash))==null?void 0:p.promise;v==null||v.catch(br).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function gn(e,t){return J7(e,L7)}/** 362 * @remix-run/router v1.23.0 363 * 364 * Copyright (c) Remix Software Inc. 365 * 366 * This source code is licensed under the MIT license found in the 367 * LICENSE.md file in the root directory of this source tree. 368 * 369 * @license MIT 370 */function Ud(){return Ud=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ud.apply(this,arguments)}var Ua;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ua||(Ua={}));const R_="popstate";function Z7(e){e===void 0&&(e={});function t(n,i){let{pathname:a,search:o,hash:l}=n.location;return Ab("",{pathname:a,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:bp(i)}return t9(t,r,null,e)}function wt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cI(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function e9(){return Math.random().toString(36).substr(2,8)}function I_(e,t){return{usr:e.state,key:e.key,idx:t}}function Ab(e,t,r,n){return r===void 0&&(r=null),Ud({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Vc(t):t,{state:r,key:t&&t.key||n||e9()})}function bp(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Vc(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function t9(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,l=Ua.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Ud({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Ua.Pop;let v=d(),x=v==null?null:v-u;u=v,c&&c({action:l,location:p.location,delta:x})}function h(v,x){l=Ua.Push;let y=Ab(p.location,v,x);u=d()+1;let b=I_(y,u),S=p.createHref(y);try{o.pushState(b,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(S)}a&&c&&c({action:l,location:p.location,delta:1})}function m(v,x){l=Ua.Replace;let y=Ab(p.location,v,x);u=d();let b=I_(y,u),S=p.createHref(y);o.replaceState(b,"",S),a&&c&&c({action:l,location:p.location,delta:0})}function g(v){let x=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof v=="string"?v:bp(v);return y=y.replace(/ $/,"%20"),wt(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let p={get action(){return l},get location(){return e(i,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(R_,f),c=v,()=>{i.removeEventListener(R_,f),c=null}},createHref(v){return t(i,v)},createURL:g,encodeLocation(v){let x=g(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:m,go(v){return o.go(v)}};return p}var M_;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(M_||(M_={}));function r9(e,t,r){return r===void 0&&(r="/"),n9(e,t,r,!1)}function n9(e,t,r,n){let i=typeof t=="string"?Vc(t):t,a=Xj(i.pathname||"/",r);if(a==null)return null;let o=uI(e);i9(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=p9(a);l=h9(o[c],u,n)}return l}function uI(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let i=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(wt(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not val
370id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=ts([n,c.relativePath]),d=r.concat(c);a.children&&a.children.length>0&&(wt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),uI(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:d9(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of dI(a.path))i(a,o,c)}),t}function dI(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=dI(n.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function i9(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:f9(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const a9=/^:[\w-]+$/,s9=3,o9=2,l9=1,c9=10,u9=-2,D_=e=>e==="*";function d9(e,t){let r=e.split("/"),n=r.length;return r.some(D_)&&(n+=u9),t&&(n+=o9),r.filter(i=>!D_(i)).reduce((i,a)=>i+(a9.test(a)?s9:a===""?l9:c9),n)}function f9(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function h9(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=L_({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=L_({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;
vendor: 9,495 bytes, lines 370-379
370Object.assign(i,f.params),o.push({params:i,pathname:ts([a,f.pathname]),pathnameBase:x9(ts([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=ts([a,f.pathnameBase]))}return o}function L_(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=m9(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:n.reduce((u,d,f)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let p=l[f]||"";o=a.slice(0,a.length-p.length).replace(/(.)\/+$/,"$1")}const g=l[f];return m&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function m9(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),cI(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function p9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return cI(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Xj(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function g9(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Vc(e):e;return{pathname:r?r.startsWith("/")?r:v9(r,t):t,search:b9(n),hash:w9(i)}}function v9(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function hx(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function y9(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function fI(e,t){let r=y9(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function hI(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Vc(e):(i=Ud({},e),wt(!i.pathname||!i.pathname.includes("?"),hx("?","pathname","search",i)),wt(!i.pathname||!i.pathname.includes("#"),hx("#","pathname","hash",i)),wt(!i.search||!i.search.includes("#"),hx("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=g9(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const ts=e=>e.join("/").replace(/\/\/+/g,"/"),x9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),b9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,w9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function j9(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const mI=["post","put","patch","delete"];new Set(mI);const S9=["get",...mI];new Set(S9);/** 371 * React Router v6.30.1 372 * 373 * Copyright (c) Remix Software Inc. 374 * 375 * This source code is licensed under the MIT license found in the 376 * LICENSE.md file in the root directory of this source tree. 377 * 378 * @license MIT 379 */function zd(){return zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zd.apply(this,arguments)}const Qj=w.createContext(null),k9=w.createContext(null),Co=w.createContext(null),dv=w.createContext(null),fs=w.createContext({outlet:null,matches:[],isDataRoute:!1}),pI=w.createContext(null);function N9(e,t){let{relative:r}=t===void 0?{}:t;Jf()||wt(!1);let{basename:n,navigator:i}=w.useContext(Co),{hash:a,pathname:o,search:l}=yI(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:ts([n,o])),i.createHref({pathname:c,search:l,hash:a})}function Jf(){return w.useContext(dv)!=null}function Ao(){return Jf()||wt(!1),w.useContext(dv).location}function gI(e){w.useContext(Co).static||w.useLayoutEffect(e)}function fv(){let{isDataRoute:e}=w.useContext(fs);return e?L9():_9()}function _9(){Jf()||wt(!1);let e=w.useContext(Qj),{basename:t,future:r,navigator:n}=w.useContext(Co),{matches:i}=w.useContext(fs),{pathname:a}=Ao(),o=JSON.stringify(fI(i,r.v7_relativeSplatPath)),l=w.useRef(!1);return gI(()=>{l.current=!0}),w.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=hI(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ts([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,o,a,e])}function vI(){let{matches:e}=w.useContext(fs),t=e[e.length-1];return t?t.params:{}}function yI(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=w.useContext(Co),{matches:i}=w.useContext(fs),{pathname:a}=Ao(),o=JSON.stringify(fI(i,n.v7_relativeSplatPath));return w.useMemo(()=>hI(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function C9(e,t){return A9(e,t)}function A9(e,t,r,n){Jf()||wt(!1);let{navigator:i}=w.useContext(Co),{matches:a}=w.useContext(fs),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Ao(),d;if(t){var f;let v=typeof t=="string"?Vc(t):t;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||wt(!1),d=v}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let v=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=r9(e,{pathname:m}),p=$9(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:ts([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:ts([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,r,n);return t&&p?w.createElement(dv.Provider,{value:{location:zd({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Ua.Pop}},p):p}function E9(){let e=D9(),t=j9(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:i},r):null,null)}const P9=w.createElement(E9,null);class O9 extends w.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?w.createElement(fs.Provider,{value:this.props.routeContext},w.createElement(pI.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function T9(e){let{routeContext:t,match:r,children:n}=e,i=w.useContext(Qj);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(fs.Provider,{value:t},n)}function $9(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(i=r)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||wt(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:m}=r,g=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let m,g=!1,p=null,v=null;r&&(m=l&&f.route.id?l[f.route.id]:void 0,p=f.route.errorElement||P9,c&&(u<0&&h===0?(g=!0,v=null):u===h&&(g=!0,v=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,h+1)),y=()=>{let b;return m?b=p:g?b=v:f.route.Component?b=w.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=d,w.createElement(T9,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:r!=null},children:b})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?w.createElement(O9,{location:r.location,revalidation:r.revalidation,component:p,error:m,children:y(),routeC
379ontext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var xI=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(xI||{}),wp=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(wp||{});function R9(e){let t=w.useContext(Qj);return t||wt(!1),t}function I9(e){let t=w.useContext(k9);return t||wt(!1),t}function M9(e){let t=w.useContext(fs);return t||wt(!1),t}function bI(e){let t=M9(),r=t.matches[t.matches.length-1];return r.route.id||wt(!1),r.route.id}function D9(){var e;let t=w.useContext(pI),r=I9(wp.UseRouteError),n=bI(wp.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function L9(){let{router:e}=R9(xI.UseNavigateStable),t=bI(wp.UseNavigateStable),r=w.useRef(!1);return gI(()=>{r.current=!0}),w.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,zd({fromRouteId:t},a)))},[e,t])}function F9(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function tn(e){wt(!1)}function B9(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Ua.Pop,navigator:a,static:o=!1,future:l}=e;Jf()&&wt(!1);let c=t.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:c,navigator:a,static:o,future:zd({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof n=="string"&&(n=Vc(n));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:g="default"}=n,p=w.useMemo(()=>{let v=Xj(d,c);return v==null?null:{location:{pathname:v,search:f,hash:h,state:m,key:g},navigationType:i}},[c,d,f,h,m,g,i]);return p==null?null:w.createElement(Co.Provider,{value:u},w.createElement(dv.Provider,{children:r,value:p}))}function W9(e){let{children:t,location:r}=e;return C9(Eb(t),r)}new Promise(()=>{});function Eb(e,t){t===void 0&&(t=[]);let r=[];return w.Children.forEach(e,(n,i)=>{if(!w.isValidElement(n))return;let a=[...t,i];if(n.type===w.Fragment){r.push.apply(r,Eb(n.props.children,a));return}n.type!==tn&&wt(!1),!n.props.index||!n.props.children||wt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Eb(n.props.children,a)),r.push(o)}),r}/** 380 * React Router DOM v6.30.1 381 * 382 * Copyright (c) Remix Software Inc. 383 * 384 * This source code is licensed under the MIT license found in the 385 * LICENSE.md file in the root directory of this source tree. 386 * 387 * @license MIT 388 */function Pb(){return Pb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pb.apply(this,arguments)}function U9(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function z9(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function V9(e,t){return e.button===0&&(!t||t==="_self")&&!z9(e)}function Ob(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function H9(e,t){let r=Ob(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(a=>{r.append(i,a)})}),r}const q9=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],G9="6";try{window.__reactRouterVersion=G9}catch{}const K9="startTransition",F_=I1[K9];function Y9(e){let{basename:t,children:r,future:n,window:i}=e,a=w.useRef();a.current==null&&(a.current=Z7({window:i,v5Compat:!0}));let o=a.current,[l,c]=w.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=w.useCallback(f=>{u&&F_?F_(()=>c(f)):c(f)},[c,u]);return w.useLayoutEffect(()=>o.listen(d),[o,d]),w.useEffect(()=>F9(n),[n]),w.createElement(B9,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const X9=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_e=w.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}
388=t,h=U9(t,q9),{basename:m}=w.useContext(Co),g,p=!1;if(typeof u=="string"&&Q9.test(u)&&(g=u,X9))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),j=Xj(S.pathname,m);S.origin===b.origin&&j!=null?u=j+S.search+S.hash:p=!0}catch{}let v=N9(u,{relative:i}),x=J9(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function y(b){n&&n(b),b.defaultPrevented||x(b)}return w.createElement("a",Pb({},h,{href:g||v,onClick:p||a?n:y,ref:r,target:c}))});var B_;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(B_||(B_={}));var W_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(W_||(W_={}));function J9(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=fv(),u=Ao(),d=yI(e,{relative:o});return w.useCallback(f=>{if(V9(f,r)){f.preventDefault();let h=n!==void 0?n:bp(u)===bp(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,n,i,r,e,a,o,l])}function Z9(e){let t=w.useRef(Ob(e)),r=w.useRef(!1),n=Ao(),i=w.useMemo(()=>H9(n.search,r.current?null:t.current),[n.search]),a=fv(),o=w.useCallback((l,c)=>{const u=Ob(typeof l=="function"?l(i):l);r.current=!0,a("?"+u,c)},[a,i]);return[i,o]}var li=function(){return li=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},li.apply(this,arguments)};function Hc(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function eV(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(d){try{u(n.next(d))}catch(f){o(f)}}function c(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):i(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}function tV(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}const rV=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Jj extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class nV extends Jj{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class U_ extends Jj{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class z_ extends Jj{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Tb;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Tb||(Tb={}));class iV{constructor(t,{headers:r={},customFetch:n,region:i=Tb.Any}={}){this.url=t,this.headers=r,this.region=i,this.fetch=rV(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return eV(this,arguments,void 0,function*(r,n={}){var i;let a,o;try{const{headers:l,method:c,body:u,signal:d,timeout:f}=n;let h={},{region:m}=n;m||(m=this.region);const g=new URL(`${this.url}/${r}`);m&&m!=="any"&&(h["x-region"]=m,g.searchParams.set("forceFunctionRegion",m));let p;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",p=u):typeof u=="string"?(h["Content-Type"]="text/plain",p=u):typeof FormData<"u"&&u instanceof FormData?p=u:(h["Content-Type"]="application/json",p=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?p=JSON.stringify(u):p=u;let v=d;f&&(o=new AbortController,a=setTimeout(()=>
388o.abort(),f),d?(v=o.signal,d.addEventListener("abort",()=>o.abort())):v=o.signal);const x=yield this.fetch(g.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),l),body:p,signal:v}).catch(j=>{throw new nV(j)}),y=x.headers.get("x-relay-error");if(y&&y==="true")throw new U_(x);if(!x.ok)throw new z_(x);let b=((i=x.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),S;return b==="application/json"?S=yield x.json():b==="application/octet-stream"||b==="application/pdf"?S=yield x.blob():b==="text/event-stream"?S=x:b==="multipart/form-data"?S=yield x.formData():S=yield x.text(),{data:S,error:null,response:x}}catch(l){return{data:null,error:l,response:l instanceof z_||l instanceof U_?l.context:void 0}}finally{a&&clearTimeout(a)}})}}const wI=3,V_=e=>Math.min(1e3*2**e,3e4),aV=[520,503],jI=["GET","HEAD","OPTIONS"];var sV=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function H_(e,t){return new Promise(r=>{if(t!=null&&t.aborted){r();return}const n=setTimeout(()=>{t==null||t.removeEventListener("abort",i),r()},e);function i(){clearTimeout(n),r()}t==null||t.addEventListener("abort",i)})}function oV(e,t,r,n){return!(!n||r>=wI||!jI.includes(e)||!aV.includes(t))}var lV=class{constructor(e){var t,r,n,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(n=e.urlLengthLimit)!==null&&n!==void 0?n:8e3,this.retryEnabled=(i=e.retry)!==null&&i!==void 0?i:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const n=this.fetch;let a=(async()=>{let o=0;for(;;){const u=new Headers(r.headers);o>0&&u.set("X-Retry-Count",String(o));let d;try{d=await n(r.url.toString(),{method:r.method,headers:u,body:JSON.stringify(r.body),signal:r.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!jI.includes(r.method))throw f;if(r.retryEnabled&&o<wI){const h=V_(o);o++,await H_(h,r.signal);continue}throw f}if(oV(r.method,d.status,o,r.retryEnabled)){var l,c;const f=(l=(c=d.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&l!==void 0?l:null,h=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:V_(o);await d.text(),o++,await H_(h,r.signal);continue}return await r.processResponse(d)}})();return this.shouldThrowOnError||(a=a.catch(o=>{var l;let c="",u="",d="";const f=o==null?void 0:o.cause;if(f){var h,m,g,p;const y=(h=f==null?void 0:f.message)!==null&&h!==void 0?h:"",b=(m=f==null?void 0:f.code)!==null&&m!==void 0?m:"";c=`${(g=o==null?void 0:o.name)!==null&&g!==void 0?g:"FetchError"}: ${o==null?void 0:o.message}`,c+=` 389 390Caused by: ${(p=f==null?void 0:f.name)!==null&&p!==void 0?p:"Error"}: ${y}`,b&&(c+=` (${b})`),f!=null&&f.stack&&(c+=` 391${f.stack}`)}else{var v;c=(v=o==null?void 0:o.stack)!==null&&v!==void 0?v:""}const x=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(d="",u="Request was aborted (timeout or manual cancellation)",x>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${x} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",u="HTTP headers exceeded server limits (typically 16KB)",x>this.urlLengthLimit&&(u+=`. Your request URL is ${x} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(l=o==null?void 0:o.name)!==null&&l!==void 0?l:"FetchError"}: ${o==null?void 0:o.message}`,details:c,hint:u,code:d},data:null,count:null,status:0,statusText:""}}
391)),a.then(e,t)}async processResponse(e){var t=this;let r=null,n=null,i=null,a=e.status,o=e.statusText;if(e.ok){var l,c;if(t.method!=="HEAD"){var u;const h=await e.text();h===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((u=t.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?n=h:n=JSON.parse(h))}const d=(l=t.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),f=(c=e.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");d&&f&&f.length>1&&(i=parseInt(f[1])),t.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,i=null,a=406,o="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const d=await e.text();try{r=JSON.parse(d),Array.isArray(r)&&e.status===404&&(n=[],r=null,a=200,o="OK")}catch{e.status===404&&d===""?(a=204,o="No Content"):r={message:d}}if(r&&t.shouldThrowOnError)throw new sV(r)}return{success:r===null,error:r,data:n,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},cV=class extends lV{select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:i=n}={}){const a=i?`${i}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"offset":`${n}.offset`,a=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:i=!1,format:a="text"}={}){var o;const l=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${c}"; options=${l};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const q_=new RegExp("[,()]");var el=class extends cV{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&q_.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&q_.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let i="";n==="plain"?i="pl":n==="phrase"?i="ph":n==="websearch"&&(i="w");const a=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([t,r])=>
391r!==void 0).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},uV=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:i=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},i=r?"HEAD":"GET";let a=!1;const o=(e??"*").split("").map(u=>/\s/.test(u)&&!a?"":(u==='"'&&(a=!a),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",o),n&&c.append("Prefer",`count=${n}`),new el({method:i,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const i="POST",{url:a,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),r||o.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);a.searchParams.set("columns",c.join(","))}}return new el({method:i,url:a,headers:o,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:i=!0}={}){var a;const o="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),n&&c.append("Prefer",`count=${n}`),i||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);l.searchParams.set("columns",d.join(","))}}return new el({method:o,url:l,headers:c,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;const n="PATCH",{url:i,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new el({method:n,url:i,headers:a,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new el({method:r,url:n,headers:i,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}function dV(e,t){if(Vd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Vd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fV(e){var t=dV(e,"string");return Vd(t)=="symbol"?t:t+""}function hV(e,t,r){return(t=fV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?G_(Object(r),!0).forEach(function(n){hV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var mV=class SI{constructor(t,{headers:r={},schema:n,fetch:i,timeout:a,urlLengthLimit:o=8e3,retry:l}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const c=i??globalThis.fetch;a!==void 0&&a>0?this.fetch=(u,d)=>{const f=new AbortController,h=setTimeout(()=>f.abort(),a),m=d==null?void 0:d.signal;if(m){if(m.aborted)return clearTimeout(h),c(u,d);const g=()=>{clearTimeout(h),f.abort()};return m.addEventListener("abort",g,{once:!0}),c(u,zh(zh({},d),{}
391,{signal:f.signal})).finally(()=>{clearTimeout(h),m.removeEventListener("abort",g)})}return c(u,zh(zh({},d),{},{signal:f.signal})).finally(()=>clearTimeout(h))}:this.fetch=c,this.retry=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new uV(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new SI(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,r={},{head:n=!1,get:i=!1,count:a}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(d)),f=n&&Object.values(r).some(d);f?(l="POST",u=r):n||i?(l=n?"HEAD":"GET",Object.entries(r).filter(([m,g])=>g!==void 0).map(([m,g])=>[m,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([m,g])=>{c.searchParams.append(m,g)})):(l="POST",u=r);const h=new Headers(this.headers);return f?h.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&h.set("Prefer",`count=${a}`),new el({method:l,url:c,headers:h,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class pV{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const i=n.node,a=parseInt(i.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 392import ws from "ws" 393new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 394 395Suggested solution: ${t.workaround}`),new Error(r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const gV="2.102.1",vV=`realtime-js/${gV}`,yV="1.0.0",kI="2.0.0",xV=kI,bV=1e4,wV=100,Aa={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},NI={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},$b={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class jV{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const i=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(t){var r,n;const i=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,r,n){var i,a;const o=t.topic,l=(i=t.ref)!==null&&i!==void 0?i:"",c=(a=t.join_ref)!==null&&a!==void 0?a:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+u.length+f.length,m=new ArrayBuffer(this.HEADER_LENGTH+h);let g=new DataView(m),p=0;g.setUint8(p++,this.KINDS.userBroadcastPush),g.setUint8(p++,c.length),g.setUint8(p++,l.length),g.setUint8(p++,o.length),g.setUint8(p++,u.length),g.setUint8(p++,f.length),g.setUint8(p++,r),Array.from(c,x=>g.setUint8(p++,x.charCodeAt(0))),Array.from(l,x=>g.setUint8(p++,x.charCodeAt(0))),Array.from(o,x=>g.setUint8(p++,x.charCodeAt(0))),Array.from(u,x=>g.setUint8(p++,x.charCodeAt(0))),Array.from(f,x=>g.setUint8(p++,x.charCodeAt(0)));var v=new Uint8Array(m.byteLength+n.byteLength);return v.set(new Uint8Array(m),0),v.set(new Uint8Array(n),m.byteLength),v.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[i,a,o,l,c]=n;return r({join_ref:i,ref:a,topic:o,event:l,payload:c})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,i)}}_decodeUserBroadcast(t,r,n){const i=r.getUint8(1),a=r.getUint8(2),o=r.getUint8(3),l=r.getUint8(4);let c=this.HEADER_LENGTH+4;const u=n.decode(t.slice(c,c+i));c=c+i;const d=n.decode(t.slice(c,c+a));c=c+a;
395const f=n.decode(t.slice(c,c+o));c=c+o;const h=t.slice(c,t.byteLength),m=l===this.JSON_ENCODING?JSON.parse(n.decode(h)):h,g={type:this.BROADCAST_EVENT,event:d,payload:m};return o>0&&(g.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}var Ge;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Ge||(Ge={}));const K_=(e,t,r={})=>{var n;const i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((a,o)=>(a[o]=SV(o,e,t,i),a),{}):{}},SV=(e,t,r,n)=>{const i=t.find(l=>
vendor: 5,523 bytes, line 395
395l.name===e),a=i==null?void 0:i.type,o=r[e];return a&&!n.includes(a)?_I(a,o):Rb(o)},_I=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return CV(t,r)}switch(e){case Ge.bool:return kV(t);case Ge.float4:case Ge.float8:case Ge.int2:case Ge.int4:case Ge.int8:case Ge.numeric:case Ge.oid:return NV(t);case Ge.json:case Ge.jsonb:return _V(t);case Ge.timestamp:return AV(t);case Ge.abstime:case Ge.date:case Ge.daterange:case Ge.int4range:case Ge.int8range:case Ge.money:case Ge.reltime:case Ge.text:case Ge.time:case Ge.timestamptz:case Ge.timetz:case Ge.tsrange:case Ge.tstzrange:return Rb(t);default:return Rb(t)}},Rb=e=>e,kV=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},NV=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},_V=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},CV=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let a;const o=e.slice(1,r);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(l=>_I(t,l))}return e},AV=e=>typeof e=="string"?e.replace(" ","T"):e,CI=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var ld=e=>typeof e=="function"?e:function(){return e},EV=typeof self<"u"?self:null,tl=typeof window<"u"?window:null,ri=EV||tl||globalThis,PV="2.0.0",OV=1e4,TV=1e3,si={connecting:0,open:1,closing:2,closed:3},vr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},$i={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Ib={longpoll:"longpoll",websocket:"websocket"},$V={complete:4},Mb="base64url.bearer.phx.",Vh=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},AI=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},RV=class{constructor(e,t,r){this.state=vr.closed,this.topic=e,this.params=ld(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Vh(this,$i.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new AI(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=vr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=vr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=vr.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=vr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Vh(this,$i.leave,ld({}),this.timeout).send(),this.state=vr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on($i.reply,(n,i)=>{this.trigger(this.replyEventName(i),n)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 5,263 bytes, line 395
395teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=vr.closed,this.bindings=[]}onClose(e){this.on($i.close,e)}onError(e){return this.on($i.error,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>!(r.event===e&&(typeof t>"u"||t===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new Vh(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=vr.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger($i.close,"leave")},r=new Vh(this,$i.leave,ld({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=vr.joining,this.joinPush.resend(e))}trigger(e,t,r,n){let i=this.onMessage(e,t,r,n);if(t&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let a=this.bindings.filter(o=>o.event===e&&this.filterBindings(o,t,r));for(let o=0;o<a.length;o++)a[o].callback(i,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===vr.closed}isErrored(){return this.state===vr.errored}isJoined(){return this.state===vr.joined}isJoining(){return this.state===vr.joining}isLeaving(){return this.state===vr.leaving}},jp=class{static request(e,t,r,n,i,a,o){if(ri.XDomainRequest){let l=new ri.XDomainRequest;return this.xdomainRequest(l,e,t,n,i,a,o)}else if(ri.XMLHttpRequest){let l=new ri.XMLHttpRequest;return this.xhrRequest(l,e,t,r,n,i,a,o)}else{if(ri.fetch&&ri.AbortController)return this.fetchRequest(e,t,r,n,i,a,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,r,n,i,a,o){let l={method:e,headers:r,body:n},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),l.signal=c.signal),ri.fetch(t,l).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,r,n,i,a,o){return e.timeout=i,e.open(t,r),e.onload=()=>{let l=this.parseJSON(e.responseText);o&&o(l)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,i,a,o,l){e.open(t,r,!0),e.timeout=a;for(let[c,u]of Object.entries(n))e.setRequestHeader(c,u);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===$V.complete&&l){let c=this.parseJSON(e.responseText);l(c)}},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let i=t?`${t}[${n}]`:n,a=e[n];typeof a=="object"?r.push(this.serialize(a,i)):r.push(encodeURIComponent(i)+"="+encodeURIComponent(a))}return r.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},IV=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(r[i]);return btoa(t)},Bo=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Mb)&&(this.authToken=atob(t[1].slice(Mb.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=si.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Ib.websocket),"$1/"+Ib.longpoll)}endpointURL(){return jp.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=si.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===si.open||this.readyState===si.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:r,token:n,messages:i}=t;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:i.forEach(a=>{setTimeout(()=>this.onmessage({data:a}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=si.open,this.onopen({}),this.poll();break;
395case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(e){typeof e!="string"&&(e=IV(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(` 396`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,r){for(let i of this.reqs)i.abort();this.readyState=si.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,i){let a,o=()=>{this.reqs.delete(a),n()};a=jp.request(e,this.endpointURL(),t,r,this.timeout,o,l=>{this.reqs.delete(a),this.isActive()&&i(l)}),this.reqs.add(a)}},MV=class Vu{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,i=>{let{onJoin:a,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Vu.syncState(this.state,i,a,o),this.pendingDiffs.forEach(c=>{this.state=Vu.syncDiff(this.state,c,a,o)}),this.pendingDiffs=[],l()}),this.channel.on(n.diff,i=>{let{onJoin:a,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Vu.syncDiff(this.state,i,a,o),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Vu.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,r,n,i){let a=this.clone(t),o={},l={};return this.map(a,(c,u)=>{r[c]||(l[c]=u)}),this.map(r,(c,u)=>{let d=a[c];if(d){let f=u.metas.map(p=>p.phx_ref),h=d.metas.map(p=>p.phx_ref),m=u.metas.filter(p=>h.indexOf(p.phx_ref)<0),g=d.metas.filter(p=>f.indexOf(p.phx_ref)<0);m.length>0&&(o[c]=u,o[c].metas=m),g.length>0&&(l[c]=this.clone(d),l[c].metas=g)}else o[c]=u}),this.syncDiff(a,{joins:o,leaves:l},n,i)}static syncDiff(t,r,n,i){let{joins:a,leaves:o}=this.clone(r);return n||(n=function(){}),i||(i=function(){}),this.map(a,(l,c)=>{let u=t[l];if(t[l]=this.clone(c),u){let d=t[l].metas.map(h=>h.phx_ref),f=u.metas.filter(h=>d.indexOf(h.phx_ref)<0);t[l].metas.unshift(...f)}n(l,u,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;let d=c.metas.map(f=>f.phx_ref);u.metas=u.metas.filter(f=>d.indexOf(f.phx_ref)<0),i(l,u,c),u.metas.length===0&&delete t[l]}),t}static list(t,r){return r||(r=function(n,i){return i}),this.map(t,(n,i)=>r(n,i))}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static clone(t){return JSON.parse(JSON.stringify(t))}},Hh={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,i,a,o]=JSON.parse(e);return t({join_ref:r,ref:n,topic:i,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:i,payload:a}=e,o=this.META_LENGTH+t.length+r.length+i.length+n.length,l=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(l),u=0;c.setUint8(u++,this.KINDS.push),c.setUint8(u++,t.length),c.setUint8(u++,r.length),c.setUint8(u++,i.length),c.setUint8(u++,n.length),Array.from(t,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(r,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(i,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(n,f=>c.setUint8(u++,f.charCodeAt(0)));var d=new Uint8Array(l.byteLength+a.byteLength);return d.set(new Uint8Array(l),0),d.set(new Uint8Array(a),l.byteLength),d.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;
vendor: 8,595 bytes, line 396
396switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,l=r.decode(e.slice(o,o+n));o=o+n;let c=r.decode(e.slice(o,o+i));o=o+i;let u=r.decode(e.slice(o,o+a));o=o+a;let d=e.slice(o,e.byteLength);return{join_ref:l,ref:null,topic:c,event:u,payload:d}},decodeReply(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,c=r.decode(e.slice(l,l+n));l=l+n;let u=r.decode(e.slice(l,l+i));l=l+i;let d=r.decode(e.slice(l,l+a));l=l+a;let f=r.decode(e.slice(l,l+o));l=l+o;let h=e.slice(l,e.byteLength),m={status:f,response:h};return{join_ref:c,ref:u,topic:d,event:$i.reply,payload:m}},decodeBroadcast(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,o=r.decode(e.slice(a,a+n));a=a+n;let l=r.decode(e.slice(a,a+i));a=a+i;let c=e.slice(a,e.byteLength);return{join_ref:null,ref:null,topic:o,event:l,payload:c}}},DV=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||OV,this.transport=t.transport||ri.WebSocket||Bo,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||ri&&ri.sessionStorage,this.establishedConnections=0,this.defaultEncoder=Hh.encode.bind(Hh),this.defaultDecoder=Hh.decode.bind(Hh),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Bo?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;tl&&tl.addEventListener&&(tl.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),r=this.connectClock)}),tl.addEventListener("pageshow",n=>{r===this.connectClock&&(r=null,this.connect())}),tl.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>t.rejoinAfterMs?t.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>t.reconnectAfterMs?t.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(n,i,a)=>{console.log(`${n}: ${i}`,a)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=ld(t.params||{}),this.endPoint=`${e}/${Ib.websocket}`,this.vsn=t.vsn||PV,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new AI(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Bo}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=jp.appendParams(jp.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=ld(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Bo?this.connectWithFallback(Bo,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(i=>{i.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){switch(e){case Bo:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Mb}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,i,a,o=this.transportName(e),l=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([i,a]),n=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return l("memorized");this.fallbackTimer=setTimeout(l,t),a=this.onError(c=>{this.log("transport","error",c),n&&!r&&(clearTimeout(this.fallbackTimer),l(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let c=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(l,t),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),TV,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();const n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){if(r===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r)}waitForSocketClosed(e,t,r=1){if(r===5||e.readyState===si.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError()}
396triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger($i.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case si.connecting:return"connecting";case si.open:return"open";case si.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([r])=>e.indexOf(r)===-1)}channel(e,t={}){let r=new RV(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:i,join_ref:a}=e;this.log("push",`${t} ${r} (${a}, ${i})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:n,payload:i,ref:a,join_ref:o}=t;if(a&&a===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.status==="ok"?"ok":"error",l)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${i.status||""} ${r} ${n} ${a&&"("+a+")"||""}`.trim(),i);for(let l=0;l<this.channels.length;l++){const c=this.channels[l];c.isMember(r,n,i,o)&&c.trigger(n,i,a,o)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r.isJoined()||r.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class cd{constructor(t,r){const n=FV(r);this.presence=new MV(t.getChannel(),n),this.presence.onJoin((i,a,o)=>{const l=cd.onJoinPayload(i,a,o);t.getChannel().trigger("presence",l)}),this.presence.onLeave((i,a,o)=>{const l=cd.onLeavePayload(i,a,o);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return cd.transformState(this.presence.state)}static transformState(t){return t=LV(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const i=t[n];return r[n]=Lm(i),r},{})}static onJoinPayload(t,r,n){const i=Y_(r),a=Lm(n);return{event:"join",key:t,currentPresences:i,newPresences:a}}static onLeavePayload(t,r,n){const i=Y_(r),a=Lm(n);return{event:"leave",key:t,currentPresences:i,leftPresences:a}}}function Lm(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function LV(e){return JSON.parse(JSON.stringify(e))}function FV(e){return(e==null?void 0:e.events)&&{events:e.events}}function Y_(e){return e!=null&&e.metas?Lm(e):[]}var X_;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(X_||(X_={}));class BV{get state(){return this.presenceAdapter.state}constructor(t,r){this.channel=t,this.presenceAdapter=new cd(this.channel.channelAdapter,r)}}class WV{constructor(t,r,n){const i=UV(n);this.channel=t.getSocket().channel(r,i),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,r){return this.channel.on(t,r)}off(t,r){this.channel.off(t,r)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,r,n){let i;try{i=this.channel.push(t,r,n)}catch{throw`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>wV){const a=this.channel.pushBuffer.shift();a.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${a.event}`,a.payload())}return i}updateJoinPayload(t){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),t)}canPush(){return this.socket.isConnected()&&this.state===Aa.joined}isJoined(){return this.state===Aa.joined}isJoining(){return this.state===Aa.joining}isClosed(){return this.state===Aa.closed}isLeaving(){return this.state===Aa.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function UV(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var Q_;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Q_||(Q_={}));var xl;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(xl||(xl={}));var Ri;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Ri||(Ri={}));class ud{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,r={config:{}},n){var i,a;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new WV(this.socket.socketAdapter,t,this.params),this.presence=new BV(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=CI(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((a=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||a===void 0)&&a.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,i,a;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:l,private:c}}=this.params,u=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(m=>m.filter))!==null&&i!==void 0?i:[],d=!!this.bindings[xl.PRESENCE]&&this.bindings[xl.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,f={},h={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(m=>{t==null||t(Ri.CHANNEL_ERROR,m)}),this._onClose(()=>t==null?void 0:t(Ri.CLOSED)),this.updateJoinPayload(Object.assign({config:h},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:m})=>
396{if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){t==null||t(Ri.SUBSCRIBED);return}this._updatePostgresBindings(m,t)}).receive("error",m=>{this.state=Aa.errored,t==null||t(Ri.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Ri.TIMED_OUT)})}return this}_updatePostgresBindings(t,r){var n;const i=this.bindings.postgres_changes,a=(n=i==null?void 0:i.length)!==null&&n!==void 0?n:0,o=[];for(let l=0;l<a;l++){const c=i[l],{filter:{event:u,schema:d,table:f,filter:h}}=c,m=t&&t[l];if(m&&m.event===u&&ud.isFilterValueEqual(m.schema,d)&&ud.isFilterValueEqual(m.table,f)&&ud.isFilterValueEqual(m.filter,h))o.push(Object.assign(Object.assign({},c),{id:m.id}));else{this.unsubscribe(),this.state=Aa.errored,r==null||r(Ri.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=Aa.errored&&r&&r(Ri.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){const i=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),a=t===xl.PRESENCE||t===xl.POSTGRES_CHANGES;if(i&&a)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,r,n)}async httpSend(t,r,n={}){var i;if(r==null)return Promise.reject("Payload is required for httpSend()");const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,r={}){var n,i;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
396in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:o}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,l,c;const u=this.channelAdapter.push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&a("ok"),u.receive("ok",()=>a("ok")),u.receive("error",()=>a("error")),u.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,r,n){const i=new AbortController,a=setTimeout(()=>i.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(a),o}_on(t,r,n){const i=t.toLocaleLowerCase(),a=this.channelAdapter.on(t,n),o={type:i,filter:r,callback:n,ref:a};return this.bindings[i]?this.bindings[i].push(o):this.bindings[i]=[o],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,r,n)=>{var i,a,o,l,c,u,d;const f=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,n))return!1;const h=(i=this.bindings[f])===null||i===void 0?void 0:i.find(m=>m.ref===t.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in h){const m=h.id,g=(a=h.filter)===null||a===void 0?void 0:a.event;return m&&((o=r.ids)===null||o===void 0?void 0:o.includes(m))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((l=r.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const m=(u=(c=h==null?void 0:h.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return m==="*"||m===((d=r==null?void 0:r.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===f})}_notThisChannelEvent(t,r){const{close:n,error:i,leave:a,join:o}=NI;return r&&[n,i,a,o].includes(t)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,r,n)=>{if(typeof r=="object"&&"ids"in r){const i=r.data,{schema:a,table:o,commit_timestamp:l,type:c,errors:u}=i;return Object.assign(Object.assign({},{schema:a,table:o,commit_timestamp:l,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(i))}return r})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in t.bindings)for(const n of t.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=K_(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=K_(t.columns,t.old_record)),r}}class zV{constructor(t,r){this.socket=new DV(t,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,r,n,i=1e4){return new Promise(a=>{setTimeout(()=>a("timeout"),i),this.socket.disconnect(()=>{t(),a("ok")},r,n)})}push(t){this.socket.push(t)}log(t,r,n){this.socket.log(t,r,n)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==$b.connecting}isDisconnecting(){return this.socket.connectionState()==$b.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const VV={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},HV=[1e3,2e3,5e3,1e4],qV=1e4,GV=` 397 addEventListener("message", (e) => { 398 if (e.data.event === "start") { 399 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 400 } 401 });`;class KV{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
401,this.ref=0,this.serializer=new jV,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=a=>a?(...o)=>a(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const i=this._initializeOptions(r);this.socketAdapter=new zV(t,i),this.httpEndpoint=CI(t),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const r=t.message;throw r.includes("Node.js")?new Error(`${r} 402 403To use Realtime in Node.js, you need to provide a WebSocket implementation: 404 405Option 1: Use Node.js 22+ which has native WebSocket support 406Option 2: Install and provide the "ws" package: 407 408 npm install ws 409 410 import ws from "ws" 411 const client = new RealtimeClient(url, { 412 ...options, 413 transport: ws 414 })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,r){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,r)}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return r==="ok"&&t.teardown(),this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=this.channels.map(async n=>{const i=await n.unsubscribe();return n.teardown(),i}),r=await Promise.all(t);return this.disconnect(),r}log(t,r,n){this.socketAdapter.log(t,r,n)}connectionState(){return this.socketAdapter.connectionState()||$b.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,r={config:{}}){const n=`realtime:${t}`,i=this.getChannels().find(a=>a.topic===n);if(i)return i;{const a=new ud(`realtime:${t}`,r,this);return this.channels.push(a),a}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(i=>{const a={access_token:r,version:vV};r&&i.updateJoinPayload(a),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(NI.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(r,n)=>{r=="sent"&&this._setAuthSafely(),t&&t(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([GV],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(t){var r,n,i,a,o,l,c,u,d;this.worker=(r=t==null?void 0:t.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=t==null?void 0:t.accessToken)!==null&&n!==void 0?n:null;const f={};
414f.timeout=(i=t==null?void 0:t.timeout)!==null&&i!==void 0?i:bV,f.heartbeatIntervalMs=(a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:VV.HEARTBEAT_INTERVAL,f.transport=(o=t==null?void 0:t.transport)!==null&&o!==void 0?o:pV.getWebSocketConstructor(),f.params=t==null?void 0:t.params,f.logger=t==null?void 0:t.logger,f.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),f.reconnectAfterMs=(l=t==null?void 0:t.reconnectAfterMs)!==null&&l!==void 0?l:p=>HV[p-1]||qV;let h,m;const g=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:xV;switch(g){case yV:h=(p,v)=>v(JSON.stringify(p)),m=(p,v)=>v(JSON.parse(p));break;case kI:h=this.serializer.encode.bind(this.serializer),m=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${f.vsn}`)}if(f.vsn=g,f.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:h,f.decode=(d=t==null?void 0:t.decode)!==null&&d!==void 0?d:m,f.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,f.params=Object.assign(Object.assign({},f.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,f.autoSendHeartbeat=!this.worker}return f}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Hd=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function YV(e,t,r){const n=new URL(t,e);if(r)for(const[i,a]of Object.entries(r))a!==void 0&&n.searchParams.set(i,a);return n.toString()}async function XV(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function QV(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:a,headers:o}){const l=YV(e.baseUrl,n,i),c=await XV(e.auth),u=await t(l,{method:r,headers:{...a?{"Content-Type":"application/json"}:{},...c,...o},body:a?JSON.stringify(a):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),h=f&&d?JSON.parse(d):d;if(!u.ok){const m=f?h:void 0,g=m==null?void 0:m.error;throw new Hd((g==null?void 0:g.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:g==null?void 0:g.type,icebergCode:g==null?void 0:g.code,details:m})}return{status:u.status,headers:u.headers,data:h}}}}function qh(e){return e.join("�")}var JV=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:qh(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${qh(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${qh(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${qh(e.namespace)}`}),!0}catch(t){if(t instanceof Hd&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Hd&&r.status===409)return;throw r}}};function Wo(e){return e.join("�")}var ZV=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Wo(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Wo(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Wo(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Wo(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Wo(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Wo(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Hd&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Hd&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},eH=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=QV({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new J
414V(this.client,t),this.tableOps=new ZV(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},hv=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}};function mv(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Db=class extends hv{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},EI=class extends hv{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const tH=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),rH=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Lb=e=>{if(Array.isArray(e))return e.map(r=>Lb(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const i=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[i]=Lb(n)}),t},nH=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function qd(e){"@babel/helpers - typeof";return qd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qd(e)}function iH(e,t){if(qd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aH(e){var t=iH(e,"string");return qd(t)=="symbol"?t:t+""}function sH(e,t,r){return(t=aH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function J_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?J_(Object(r),!0).forEach(function(n){sH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const Z_=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},oH=async(e,t,r,n)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const i=e;let a=parseInt(i.status,10);Number.isFinite(a)||(a=500),i.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";t(new Db(Z_(o),a,l,n))}).catch(()=>{const o=a+"";t(new Db(i.statusText||`HTTP ${a} error`,a,o,n))})}else t(new EI(Z_(e),e,n))},lH=(e,t,r,n)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!n)return de(de({},i),r);if(rH(n)){var a;const o=(t==null?void 0:t.headers)||{};let l;for(const[c,u]of Object.entries(o))c.toLowerCase()==="content-type"&&(l=u);i.headers=cH(o,"Content-Type",(a=l)!==null&&a!==void 0?a:"application/json"),i.body=JSON.stringify(n)}else i.body=n;return t!=null&&t.duplex&&(i.duplex=t.duplex),de(de({},i),r)};function cH(e,t,r){const n=de({},e);for(const i of Object.keys(n))i.toLowerCase()===t.toLowerCase()&&delete n[i];return n[t]=r,n}async function xu(e,t,r,n,i,a,o){return new Promise((l,c)=>{e(r,lH(t,n,i,a)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>l(u)).catch(u=>oH(u,c,n,o))})}function PI(e="storage"){return{get:async(t,r,n,i)=>xu(t,"GET",r,n,i,void 0,e),post:async(t,r,n,i,a)=>xu(t,"POST",r,i,a,n,e),put:async(t,r,n,i,a)=>xu(t,"PUT",r,i,a,n,e),head:async(t,r,n,i)=>xu(t,"HEAD",r,de(de({},n),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,r,n,i,a)=>xu(t,"DELETE",r,i,a,n,e)}}const uH=PI("storage"),{get:Gd,post:On,put:Fb,head:dH,remove:Zj}=uH,Lr=PI("vectors");
414var qc=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=Object.fromEntries(Object.entries(t).map(([i,a])=>[i.toLowerCase(),a])),this.fetch=tH(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=de(de({},this.headers),{},{[e.toLowerCase()]:t}),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(mv(r))return{data:null,error:r};throw r}}},fH=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(mv(t))return{data:null,error:t};throw t}}};let OI;OI=Symbol.toStringTag;var hH=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[OI]="BlobDownloadBuilder",this.promise=null}asStream(){return new fH(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(mv(t))return{data:null,error:t};throw t}}};const mH={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},eC={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var pH=class extends qc{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var i=this;return i.handleOperation(async()=>{let a;const o=de(de({},eC),n);let l=de(de({},i.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),c&&a.append("metadata",i.encodeMetadata(c)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),c&&!a.has("metadata")&&a.append("metadata",i.encodeMetadata(c))):(a=r,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers&&(l=de(de({},l),n.headers));const u=i._removeEmptyFolders(t),d=i._getFinalPath(u),f=await(e=="PUT"?Fb:On)(i.fetch,`${i.url}/object/${d}`,a,de({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:f.Id,fullPath:f.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var i=this;const a=i._removeEmptyFolders(e),o=i._getFinalPath(a),l=new URL(i.url+`/object/upload/sign/${o}`);return l.searchParams.set("token",t),i.handleOperation(async()=>{let c;const u=de(de({},eC),n),d=de(de({},i.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",u.cacheControl)):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:a,fullPath:(await Fb(i.fetch,l.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const i=de({},r.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const a=await On(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(r.url+a.url),l=o.searchParams.get("token");if(!l)throw new hv("No token returned by API");return{signedUrl:o.toString(),path:e,token:l}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await On(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
414stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await On(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let i=n._getFinalPath(e);const a=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await On(n.fetch,`${n.url}/object/sign/${i}`,de({expiresIn:t},a?{transform:r.transform}:{}),{headers:n.headers});const l=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"",c=a&&o.signedURL.includes("/object/sign/")?o.signedURL.replace("/object/sign/","/render/image/sign/"):o.signedURL;return{signedUrl:encodeURI(`${n.url}${c}${l}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const i=await On(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i.map(o=>de(de({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${a}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),a=i?`?${i}`:"",o=this._getFinalPath(e),l=()=>Gd(this.fetch,`${this.url}/${n}/${o}${a}`,{headers:this.headers,noResolveJson:!0},r);return new hH(l,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>Lb(await Gd(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await dH(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(i){if(t.shouldThrowOnError)throw i;if(mv(i)){var n;const a=i instanceof Db?i.status:i instanceof EI?(n=i.originalError)===null||n===void 0?void 0:n.status:void 0;if(a!==void 0&&[400,404].includes(a))return{data:!1,error:i}}throw i}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=[],i=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&n.push(i);const a=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",o=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});o!==""&&n.push(o);let l=n.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${l}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Zj(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const i=de(de(de({},mH),t),{},{prefix:e||""});return await On(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=de({},e);return await On(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const gH="2.102.1",Zf={"X-Client-Info":`storage-js/${gH}`};var vH=class extends qc{constructor(e,t={},r,n){const i=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const a=i.href.replace(/\/$/,""),o=de(de({},Zf),t);super(a,o,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await Gd(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Gd(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await On(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await Fb(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await On(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Zj(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},yH=class extends qc{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=de(de({},Zf),t);super(n,i,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await On(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>
414{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),i=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await Gd(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Zj(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!nH(e))throw new hv("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new eH({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(i,a){const o=i[a];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(i,l),error:null}}catch(c){if(n)throw c;return{data:null,error:c}}}}})}},xH=class extends qc{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=de(de({},Zf),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await Lr.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await Lr.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},bH=class extends qc{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=de(de({},Zf),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},wH=class extends qc{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=de(de({},Zf),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Lr.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},jH=class extends wH{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new SH(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},SH=class extends xH{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,de(de({},e),{},{vectorBucketName:r.vectorBucketName}))}
414async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,de(de({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new kH(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},kH=class extends bH{constructor(e,t,r,n,i){super(e,t,i),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,de(de({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,de(de({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,de(de({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,de(de({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,de(de({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},NH=class extends vH{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new pH(this.url,this.headers,e,this.fetch)}get vectors(){return new jH(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new yH(this.url+"/iceberg",this.headers,this.fetch)}};const TI="2.102.1",rl=30*1e3,Bb=3,mx=Bb*rl,_H="http://localhost:9999",CH="supabase.auth.token",AH={"X-Client-Info":`gotrue-js/${TI}`},Wb="X-Supabase-Api-Version",$I={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},EH=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,PH=10*60*1e3;class Kd extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function se(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class OH extends Kd{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function TH(e){return se(e)&&e.name==="AuthApiError"}class Rs extends Kd{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class la extends Kd{constructor(t,r,n,i){super(t,n,i),this.name=r,this.status=n}}class Tr extends la{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Gh(e){return se(e)&&e.name==="AuthSessionMissingError"}class Uo extends la{constructor(){super("Auth session or user missing","AuthInvalidToken
414ResponseError",500,void 0)}}class Kh extends la{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Yh extends la{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function $H(e){return se(e)&&e.name==="AuthImplicitGrantRedirectError"}class tC extends la{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class RH extends la{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Ub extends la{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function px(e){return se(e)&&e.name==="AuthRetryableFetchError"}class rC extends la{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class zb extends la{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Sp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),nC=` 415\r=`.split(""),IH=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<nC.length;t+=1)e[nC[t].charCodeAt(0)]=-2;for(let t=0;t<Sp.length;t+=1)e[Sp[t].charCodeAt(0)]=t;return e})();function iC(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Sp[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Sp[n]),t.queuedBits-=6}}function RI(e,t,r){const n=IH[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function aC(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=o=>{LH(o,n,r)};for(let o=0;o<e.length;o+=1)RI(e.charCodeAt(o),i,a);return t.join("")}function MH(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function DH(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const i=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|i)+65536,r+=1}MH(n,t)}}function LH(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function $l(e){const t=[],r={queue:0,queuedBits:0},n=i=>{t.push(i)};for(let i=0;i<e.length;i+=1)RI(e.charCodeAt(i),r,n);return new Uint8Array(t)}function FH(e){const t=[];return DH(e,r=>t.push(r)),new Uint8Array(t)}function Bs(e){const t=[],r={queue:0,queuedBits:0},n=i=>{t.push(i)};return e.forEach(i=>iC(i,r,n)),iC(null,r,n),t.join("")}function BH(e){return Math.round(Date.now()/1e3)+e}function WH(){return Symbol("auth-callback")}const Lt=()=>typeof window<"u"&&typeof document<"u",Ss={tested:!1,writable:!1},II=()=>{if(!Lt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ss.tested)return Ss.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Ss.tested=!0,Ss.writable=!0}catch{Ss.tested=!0,Ss.writable=!1}return Ss.writable};function UH(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEac
415h((i,a)=>{t[a]=i})}catch{}return r.searchParams.forEach((n,i)=>{t[i]=n}),t}const MI=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),zH=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",nl=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},ks=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Dt=async(e,t)=>{await e.removeItem(t)};class pv{constructor(){this.promise=new pv.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}pv.promiseConstructor=Promise;function Xh(e){const t=e.split(".");if(t.length!==3)throw new zb("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!EH.test(t[n]))throw new zb("JWT not in base64url format");return{header:JSON.parse(aC(t[0])),payload:JSON.parse(aC(t[1])),signature:$l(t[2]),raw:{header:t[0],payload:t[1]}}}async function VH(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function HH(e,t){return new Promise((n,i)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await e(a);if(!t(a,null,o)){n(o);return}}catch(o){if(!t(a,o)){i(o);return}}})()})}function qH(e){return("0"+e.toString(16)).substr(-2)}function GH(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let i="";for(let a=0;a<56;a++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(t),Array.from(t,qH).join("")}async function KH(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(a=>String.fromCharCode(a)).join("")}async function YH(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await KH(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function zo(e,t,r=!1){const n=GH();let i=n;r&&(i+="/PASSWORD_RECOVERY"),await nl(e,`${t}-code-verifier`,i);const a=await YH(n);return[a,n===a?"plain":"s256"]}const XH=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function QH(e){const t=e.headers.get(Wb);if(!t||!t.match(XH))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function JH(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function ZH(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const eq=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Vo(e){if(!eq.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function gx(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function tq(e,t){return new Proxy(e,{get:(r,n,i)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,i)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,i)}})}function sC(e){return JSON.parse(JSON.stringify(e))}const Ps=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),rq=[502,503,504];async function oC(e){var t;if(!zH(e))throw new Ub(Ps(e),0);if(rq.includes(e.status))throw new Ub(Ps(e),e.status);let r;try{r=await e.json()}catch(a){throw new Rs(Ps(a),a)}let n;const i=QH(e);if(i&&i.getTime()>=$I["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new rC(Ps(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new Tr}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,o)=>
415a&&typeof o=="string",!0))throw new rC(Ps(r),e.status,r.weak_password.reasons);throw new OH(Ps(r),e.status||500,n)}const nq=(e,t,r,n)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function ue(e,t,r,n){var i;const a=Object.assign({},n==null?void 0:n.headers);a[Wb]||(a[Wb]=$I["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const o=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await iq(e,t,r+l,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function iq(e,t,r,n,i,a){const o=nq(t,n,i,a);let l;try{l=await e(r,Object.assign({},o))}catch(c){throw console.error(c),new Ub(Ps(c),0)}if(l.ok||await oC(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await oC(c)}}function An(e){var t;let r=null;oq(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=BH(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function lC(e){const t=An(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Ea(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function aq(e){return{data:e,error:null}}function sq(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a}=e,o=Hc(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function cC(e){return e}function oq(e){return e.access_token&&e.refresh_token&&e.expires_in}const vx=["global","local","others"];class lq{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=MI(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(t,r=vx[0]){if(vx.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${vx.join(", ")}`);try{return await ue(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(se(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await ue(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Ea})}catch(n){if(se(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=Hc(t,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n==null?void 0:n.newEmail,delete i.newEmail),await ue(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:sq,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(se(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await ue(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Ea})}catch(r){if(se(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,i,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await ue(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:cC});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);u[`${v}Page`]=p}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(se(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){Vo(t);try{return await ue(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Ea})}catch(r){if(se(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Vo(t);try{return await ue(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Ea})}catch(n){if(se(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){Vo(t);
415try{return await ue(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Ea})}catch(n){if(se(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Vo(t.userId);try{const{data:r,error:n}=await ue(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Vo(t.userId),Vo(t.id);try{return{data:await ue(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,i,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await ue(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:cC});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);u[`${v}Page`]=p}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(se(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await ue(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await ue(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await ue(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(se(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await ue(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await ue(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _listCustomProviders(t){try{const r={};return t!=null&&t.type&&(r.type=t.type),await ue(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var i;return{data:{providers:(i=n==null?void 0:n.providers)!==null&&i!==void 0?i:[]},error:null}}})}catch(r){if(se(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(t){try{return await ue(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _getCustomProvider(t){try{return await ue(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _updateCustomProvider(t,r){try{return await ue(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(se(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(t){try{return await ue(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(se(r))return{data:null,error:r};throw r}}}function uC(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const ei={debug:!!(globalThis&&II()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};
415class DI extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class dC extends DI{}async function cq(e,t,r){ei.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;let i;t>0&&(i=setTimeout(()=>{n.abort(),ei.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async a=>{if(a){clearTimeout(i),ei.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await r()}finally{ei.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw ei.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new dC(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(ei.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(i),await r()}})}catch(a){if(t>0&&clearTimeout(i),(a==null?void 0:a.name)==="AbortError"&&t>0){if(n.signal.aborted)return ei.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async o=>{if(o){ei.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,o.name);try{return await r()}finally{ei.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw ei.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new dC(`Lock "${e}" was released because another request stole it`)}throw a}}function uq(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function LI(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function dq(e){return parseInt(e,16)}function fq(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function hq(e){var t;const{chainId:r,domain:n,expirationTime:i,issuedAt:a=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:d,uri:f,version:h}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 416`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=LI(e.address),g=d?`${d}://${n}`:n,p=e.statement?`${e.statement} 417`:"",v=`${g} wants you to sign in with your Ethereum account: 418${m} 419 420${p}`;let x=`URI: ${f} 421Version: ${h} 422Chain ID: ${r}${o?` 423Nonce: ${o}`:""} 424Issued At: ${a.toISOString()}`;if(i&&(x+=` 425Expiration Time: ${i.toISOString()}`),l&&(x+=` 426Not Before: ${l.toISOString()}
426`),c&&(x+=` 427Request ID: ${c}`),u){let y=` 428Resources:`;for(const b of u){if(!b||typeof b!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${b}`);y+=` 429- ${b}`}x+=y}return`${v} 430${x}`}class yt extends Error{constructor({message:t,code:r,cause:n,name:i}){var a;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(a=i??(n instanceof Error?n.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}}class kp extends yt{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function mq({error:e,options:t}){var r,n,i;const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new yt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new yt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new yt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((i=a.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new yt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new yt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new yt({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new yt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new yt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(FI(o)){if(a.rp.id!==o)return new yt({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new yt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new yt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new yt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new yt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function pq({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new yt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new yt({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(FI(n)){if(r.rpId!==n)return new yt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new yt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new yt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ER
430ROR",cause:e})}return new yt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class gq{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const vq=new gq;function yq(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,i=Hc(e,["challenge","user","excludeCredentials"]),a=$l(t).buffer,o=Object.assign(Object.assign({},r),{id:$l(r.id).buffer}),l=Object.assign(Object.assign({},i),{challenge:a,user:o});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const u=n[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:$l(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function xq(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=Hc(e,["challenge","allowCredentials"]),i=$l(t).buffer,a=Object.assign(Object.assign({},n),{challenge:i});if(r&&r.length>0){a.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const l=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},l),{id:$l(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function bq(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:Bs(new Uint8Array(e.response.attestationObject)),clientDataJSON:Bs(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function wq(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),i=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Bs(new Uint8Array(i.authenticatorData)),clientDataJSON:Bs(new Uint8Array(i.clientDataJSON)),signature:Bs(new Uint8Array(i.signature)),userHandle:i.userHandle?Bs(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function FI(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function fC(){var e,t;return!!(Lt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function jq(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new kp("Browser returned unexpected credential type",t)}:{data:null,error:new kp("Empty credential response",t)}}catch(t){return{data:null,error:mq({error:t,options:e})}}}async function Sq(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new kp("Browser returned unexpected credential type",t)}:{data:null,error:new kp("Empty credential response",t)}}catch(t){return{data:null,error:pq({error:t,options:e})}}}const kq={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Nq={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Np(...e){const t=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),r=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),n={};for(const i of e)if(i)for(const a in i){const o=i[a];if(o!==void 0)if(Array.isArray(o))n[a]=o;else if(r(o))n[a]=o;else if(t(o)){const l=n[a];t(l)?n[a]=Np(l,o):n[a]=Np(o)}else n[a]=o}return n}function _q(e,t){return Np(kq,e,t||{})}function Cq(e,t){return Np(Nq,e,t||{})}class Aq{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:i},a){var o;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!l)return{data:null,error:c};const u=i??vq.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:d}=l.webauthn.credential_options.publicKey;if(!d.name){const f=n;if(f)d.name=`${d.id}:${f}`;else{const m=(await this.client.getUser()).data.user,g=((o=m==null?void 0:m.user_metadata)===null||o===void 0?void 0:o.name)||(m==null?void 0:m.email)||(m==null?void 0:m.id)||"User";d.name=`${d.id}:${g}`}}d.displayName||(d.displayName=d.name)}switch(l.webauthn.type){case"create":{const d=_q(l.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:f,error:h}=await jq({publicKey:d,signal:u});return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}case"request":{const d=Cq(l.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:f,error:h}=await Sq(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:d,signal:u}));return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}}}catch(l){return se(l)?{data:null,error:l}:{data:null,error:new Rs("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new Kd("rpId is required for WebAuthn authentication")};try{if(!fC())return{data:null,error:new Rs("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:a});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(o){return se(o)?{data:null,error:o}:{data:null,error:new Rs("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new Kd("rpId is required for WebAuthn registration")};try{if(!fC())return{data:null,error:new Rs("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:a});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return se(o)?{data:null,error:o}:{data:null,error:new Rs("Unexpected error in register",o)}}}}uq();const Eq={url:_H,storageKey:CH,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:AH,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function hC(e,t,r){return await r()}const Ho={};class Yd{get jwks(){var t,r;return(r=(t=Ho[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Ho[this.storageKey]=Object.assign(Object.assign({},Ho[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Ho[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Ho[this.storageKey]=Object.assign(Object.assign({},Ho[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const a=Object.assign(Object.assign({},Eq),t);if(this.storageKey=a.storageKey,this.instanceID=(r=Yd.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Yd.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&Lt()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new lq({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=MI(a.fetch),this.lock=a.lock||hC,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,this.lockAcquireTimeout=a.lockAcquireTimeout,a.lock?this.lock=a.lock:this.persistSession&&Lt()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=cq:this.lock=hC,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Aq(this)}
430,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:II()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=uC(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=uC(this.memoryStorage)),Lt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}a.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${TI}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(Lt()&&(r=UH(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Lt()&&this.detectSessionInUrl&&n!=="none"){const{data:i,error:a}=await this._getSessionFromURL(r,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),$H(a)){const c=(t=a.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:o,redirectType:l}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return se(r)?this._returnResult({error:r}):this._returnResult({error:new Rs("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,i;try{const a=await ue(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:An}),{data:o,error:l}=a;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(se(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var r,n,i;try{let a;if("email"in t){const{email:d,password:f,options:h}=t;let m=null,g=null;this.flowType==="pkce"&&([m,g]=await zo(this.storage,this.storageKey)),a=await ue(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:d,password:f,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:m,code_challenge_method:g},xform:An})}else if("phone"in t){const{phone:d,password:f,options:h}=t;a=await ue(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},channel:(i=h==null?void 0:h.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:An})}else throw new Kh("You must provide either an email or phone number and a password");const{data:o,error:l}=a;if(l||!o)return await Dt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(await Dt(this.storage,`${this.storageKey}-code-verifier`),se(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(t){try{let r;if("email"in t){const{email:a,password:o,options:l}=t;r=await ue(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:lC})}else if("phone"in t){const{phone:a,password:o,options:l}=t;r=await ue(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:lC})}else throw new Kh("You must provide either an email or phone number and a password");const{data:n,error:i}=r;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!n||!n.session||!n.user){const a=new Uo;return this._returnResult({data:{user:null,session:null},error:a})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,i,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(a=t.o
430ptions)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,i,a,o,l,c,u,d,f,h;let m,g;if("message"in t)m=t.message,g=t.signature;else{const{chain:p,wallet:v,statement:x,options:y}=t;let b;if(Lt())if(typeof v=="object")b=v;else{const C=window;if("ethereum"in C&&typeof C.ethereum=="object"&&"request"in C.ethereum&&typeof C.ethereum.request=="function")b=C.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=v}const S=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href),j=await b.request({method:"eth_requestAccounts"}).then(C=>C).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!j||j.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const N=LI(j[0]);let k=(n=y==null?void 0:y.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!k){const C=await b.request({method:"eth_chainId"});k=dq(C)}const _={domain:S.host,address:N,statement:x,uri:S.href,version:"1",chainId:k,nonce:(i=y==null?void 0:y.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=y==null?void 0:y.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=y==null?void 0:y.signInWithEthereum)===null||d===void 0?void 0:d.resources};m=hq(_),g=await b.request({method:"personal_sign",params:[fq(m),N]})}try{const{data:p,error:v}=await ue(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:g},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:An});if(v)throw v;if(!p||!p.session||!p.user){const x=new Uo;return this._returnResult({data:{user:null,session:null},error:x})}return p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),this._returnResult({data:Object.assign({},p),error:v})}catch(p){if(se(p))return this._returnResult({data:{user:null,session:null},error:p});throw p}}async signInWithSolana(t){var r,n,i,a,o,l,c,u,d,f,h,m;let g,p;if("message"in t)g=t.message,p=t.signature;else{const{chain:v,wallet:x,statement:y,options:b}=t;let S;if(Lt())if(typeof x=="object")S=x;else{const N=window;if("solana"in N&&typeof N.solana=="object"&&("signIn"in N.solana&&typeof N.solana.signIn=="function"||"signMessage"in N.solana&&typeof N.solana.signMessage=="function"))S=N.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=x}const j=new URL((r=b==null?void 0:b.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in S&&S.signIn){const N=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:j.host,uri:j.href}),y?{statement:y}:null));let k;if(Array.isArray(N)&&N[0]&&typeof N[0]=="object")k=N[0];else if(N&&typeof N=="object"&&"signedMessage"in N&&"signature"in N)k=N;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in k&&"signature"in k&&(typeof k.signedMessage=="string"||k.signedMessage instanceof Uint8Array)&&k.signature instanceof Uint8Array)g=typeof k.signedMessage=="string"?k.signedMessage:new TextDecoder().decode(k.signedMessage),p=k.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${j.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${j.href}`,`Issued At: ${(i=(n=b==null?void 0:b.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=b==null?void 0:b.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((o=b==null?void 0:b.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((l=b==null?void 0:b.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((c=b==null?void 0:b.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((u=b==null?void 0:b.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((f=(d=b==null?void 0:b.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...b.signInWithSolana.resources.map(k=>`- ${k}`)]:[]].join(` 431`);const N=await S.signMessage(new TextEncoder().encode(g),"utf8");if(!N||!(N instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=N}}try{const{data:v,error:x}=await ue(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:Bs(p)}
431,!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:An});if(x)throw x;if(!v||!v.session||!v.user){const y=new Uo;return this._returnResult({data:{user:null,session:null},error:y})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:x})}catch(v){if(se(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(t){const r=await ks(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new RH;const{data:a,error:o}=await ue(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:An});if(await Dt(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const l=new Uo;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:o})}catch(a){if(await Dt(this.storage,`${this.storageKey}-code-verifier`),se(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(t){try{const{options:r,provider:n,token:i,access_token:a,nonce:o}=t,l=await ue(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:An}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new Uo;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,i,a,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await zo(this.storage,this.storageKey));const{error:f}=await ue(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await ue(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new Kh("You must provide either an email or phone number.")}catch(l){if(await Dt(this.storage,`${this.storageKey}-code-verifier`),se(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var r,n;try{let i,a;"options"in t&&(i=(r=t.options)===null||r===void 0?void 0:r.redirectTo,a=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:l}=await ue(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:An});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(se(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(t){var r,n,i,a,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await zo(this.storage,this.storageKey));const u=await ue(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:aq});return!((a=u.data)===null||a===void 0)&&a.url&&Lt()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await Dt(this.storage,`${this.storageKey}-code-verifier`),se(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new Tr;const{error:i}=await ue(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(t){if(se(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:i,options:a}=t,{error:o}=await ue(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:n,type:i,options:a}=t,{data:o,error:l}=await ue(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new Kh("You must provide either an email or phone number and a type")}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await ks(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
431id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<mx:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const o=await ks(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=gx()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=tq(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:i,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await ue(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ea}):await this._useSession(async r=>{var n,i,a;const{data:o,error:l}=r;if(l)throw l;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Tr}:await ue(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&a!==void 0?a:void 0,xform:Ea})})}catch(r){if(se(r))return Gh(r)&&(await this._removeSession(),await Dt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:i,error:a}=n;if(a)throw a;if(!i.session)throw new Tr;const o=i.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await zo(this.storage,this.storageKey));const{data:u,error:d}=await ue(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:Ea});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(await Dt(this.storage,`${this.storageKey}-code-verifier`),se(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Tr;const r=Date.now()/1e3;let n=r,i=!0,a=null;const{payload:o}=Xh(t.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};a=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});a={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(r){if(se(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:o,error:l}=r;if(l)throw l;t=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new Tr;const{data:i,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!Lt())throw new Yh("No browser detected.");
431if(t.error||t.error_description||t.error_code)throw new Yh(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new tC("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Yh("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new tC("No code detected.");const{data:y,error:b}=await this._exchangeCodeForSession(t.code);if(b)throw b;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:i,access_token:a,refresh_token:o,expires_in:l,expires_at:c,token_type:u}=t;if(!a||!l||!o||!u)throw new Yh("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(l);let h=d+f;c&&(h=parseInt(c));const m=h-d;m*1e3<=rl&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${f}s`);const g=h-f;d-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,h,d):d-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,h,d);const{data:p,error:v}=await this._getUser(a);if(v)throw v;const x={provider_token:n,provider_refresh_token:i,access_token:a,expires_in:f,expires_at:h,refresh_token:o,token_type:u,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:x,redirectType:t.type},error:null})}catch(n){if(se(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await ks(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a&&!Gh(a))return this._returnResult({error:a});const o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(TH(l)&&(l.status===404||l.status===401||l.status===403)||Gh(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await Dt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=WH(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,i;try{const{data:{session:a},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),Gh(a)?console.warn(a):console.error(a)}})}async resetPasswordForEmail(t,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await zo(this.storage,this.storageKey,!0));try{return await ue(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(await Dt(this.storage,`${this.storageKey}-code-verifier`),se(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:i}=await this._useSession(async a=>{var o,l,c,u,d;const{data:f,error:h}=a;if(h)throw h;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await ue(this.fetch,"GET",m,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;return Lt()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(se(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:i,data:{session:a}}=r;if(i)throw i;const{options:o,provider:l,token:c,access_token:u,nonce:d}=t,f=await ue(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=a==null?void 0:a.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:An}),{data:h,error:m}=f;return m?this._returnResult({data:{user:null,session:null},error:m}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new Uo}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:m}))}catch(i){if(await Dt(this.storage,`${this.storageKey}-code-verifier`),se(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)throw o;
431return await ue(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await HH(async i=>(i>0&&await VH(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await ue(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:An})),(i,a)=>{const o=200*Math.pow(2,i);return a&&px(a)&&Date.now()+o-n<rl})}catch(n){if(this._debug(r,"error",n),se(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),Lt()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const i=await ks(this.storage,this.storageKey);if(i&&this.userStorage){let o=await ks(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await nl(this.userStorage,this.storageKey+"-user",o)),i.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:gx()}else if(i&&!i.user&&!i.user){const o=await ks(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(i.user=o.user,await Dt(this.storage,this.storageKey+"-user"),await nl(this.storage,this.storageKey,i)):i.user=gx()}if(this._debug(n,"session from storage",i),!this._isValidSession(i)){this._debug(n,"session is not valid"),i!==null&&await this._removeSession();return}const a=((r=i.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<mx;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${mx}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),px(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(i.access_token);!l&&(o!=null&&o.user)?(i.user=o.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(n,"error",i),console.error(i);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new Tr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new pv;const{data:a,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!a.session)throw new Tr;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const l={data:a.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(a){if(this._debug(i,"error",a),se(a)){const o={data:null,error:a};return px(a)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(a),a}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(t,r,n=!0){const i=`#_notifyAllSubscribers(${t})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){a.push(c)}});if(await Promise.all(o),a.length>0){for(let l=0;l<a.length;l+=1)console.error(a[l]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Dt(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await nl(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const a=sC(i);await nl(this.storage,this.storageKey,a)}else{const i=sC(r);await nl(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Dt(this.storage,this.storageKey),await Dt(this.storage,this.storageKey+"-code-verifier"),await Dt(this.storage,this.storageKey+"-user"),this.userStorage&&await Dt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;
431try{t&&Lt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),rl);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((n.expires_at*1e3-t)/rl);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${rl}ms, refresh threshold is ${Bb} ticks`),i<=Bb&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof DI)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Lt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const i=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,o]=await zo(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(l.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);i.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;return a?this._returnResult({data:null,error:a}):await ue(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await ue(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?bq(t.webauthn.credential_response):wq(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await ue(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=await ue(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:yq(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:xq(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const i={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])i.all.push(a),a.status==="verified"&&i[a.factor_type].push(a);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,i,a;if(t)try{const{payload:m}=Xh(t);let g=null;m.aal&&(g=m.aal);let p=g;const{data:{user:v},error:x}=await this.getUser(t);if(x)return this._returnResult({data:null,error:x});((n=(r=v==null?void 0:v.factors)===null||r===void 0?void 0:r.filter(S=>S.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(p="aal2");const b=m.amr||[];return{data:{currentLevel:g,nextLevel:p,currentAuthenticationMethods:b},error:null}}catch(m){if(se(m))return this._returnResult({data:null,error:m});throw m}const{data:{session:o},error:l}
431=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Xh(o.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((a=(i=o.user.factors)===null||i===void 0?void 0:i.filter(m=>m.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(d="aal2");const h=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await ue(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new Tr})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new Tr});const o=await ue(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Lt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(se(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new Tr});const o=await ue(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Lt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(se(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await ue(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Tr})})}catch(t){if(se(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?(await ue(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Tr})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+PH>i)return n;const{data:a,error:o}=await ue(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=i,n=a.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:m,error:g}
431=await this.getSession();if(g||!m.session)return this._returnResult({data:null,error:g});n=m.session.access_token}const{header:i,payload:a,signature:o,raw:{header:l,payload:c}}=Xh(n);r!=null&&r.allowExpired||JH(a.exp);const u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:m}=await this.getUser(n);if(m)throw m;return{data:{claims:a,header:i,signature:o},error:null}}const d=ZH(i.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,o,FH(`${l}.${c}`)))throw new zb("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(n){if(se(n))return this._returnResult({data:null,error:n});throw n}}}Yd.nextInstanceID={};const Pq=Yd,Oq="2.102.1";let Hu="";typeof Deno<"u"?Hu="deno":typeof document<"u"?Hu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Hu="react-native":Hu="node";const Tq={"X-Client-Info":`supabase-js-${Hu}/${Oq}`},$q={headers:Tq},Rq={schema:"public"},Iq={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Mq={};function Xd(e){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xd(e)}function Dq(e,t){if(Xd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Xd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lq(e){var t=Dq(e,"string");return Xd(t)=="symbol"?t:t+""}function Fq(e,t,r){return(t=Lq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mC(Object(r),!0).forEach(function(n){Fq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const Bq=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Wq=()=>Headers,Uq=(e,t,r)=>{const n=Bq(r),i=Wq();return async(a,o)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let u=new i(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),n(a,dt(dt({},o),{},{headers:u}))}};function zq(e){return e.endsWith("/")?e:e+"/"}function Vq(e,t){var r,n;const{db:i,auth:a,realtime:o,global:l}=e,{db:c,auth:u,realtime:d,global:f}=t,h={db:dt(dt({},c),i),auth:dt(dt({},u),a),realtime:dt(dt({},d),o),storage:{},global:dt(dt(dt({},f),l),{},{headers:dt(dt({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function Hq(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(zq(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var qq=class extends Pq{constructor(e){super(e)}},Gq=class{constructor(e,t,r){var n,i;this.supabaseUrl=e,this.supabaseKey=t;const a=Hq(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,l={db:Rq,realtime:Mq,auth:dt(dt({},Iq),{},{storageKey:o}),global:$q},c=Vq(r??{},l);if(this.storageKey=(n=c.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=Uq(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(dt({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new mV(new URL("rest/v1",a).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new NH(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new iV(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
431channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,storageKey:a,flowType:o,lock:l,debug:c,throwOnError:u},d,f){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new qq({url:this.authUrl.href,headers:dt(dt({},h),d),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,flowType:o,lock:l,debug:c,throwOnError:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new KV(this.realtimeUrl.href,dt(dt({},e),{},{params:dt(dt({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Kq=(e,t,r)=>new Gq(e,t,r);function Yq(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}Yq()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Xq="https://fgtxusfzbivelnnnqmjf.supabase.co",Qq="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZndHh1c2Z6Yml2ZWxubm5xbWpmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjkwMTA4MTksImV4cCI6MjA4NDU4NjgxOX0.eslVbrBM8W_5I7MeJTqcSf146ChMjun5amO_5xpNLoQ",hs=Kq(Xq,Qq),Jq={index_type:"dai",criteria:["Minimum $50M fully diluted valuation (FDV)","Active on-chain utility or revenue generation","Meaningful liquidity across CEX and DEX venues","Technical assessment of protocol sustainability"],constraints:[{label:"Liquidity",text:"25% maximum allocation to tokens with <$20M daily volume"},{label:"Concentration",text:"30% maximum single asset concentration limit"},{label:"Category",text:"40% maximum sector concentration limit"},{label:"Emissions",text:"Tokens with >50% annual inflation capped at 10% weight"}],index_description:"The Index tracks the performance of leading decentralized AI infrastructure tokens, providing comprehensive exposure to the emerging AI x Crypto ecosystem."},Zq={index_type:"rwa",criteria:["Minimum $50M fully diluted valuation","Direct involvement in RWA tokenization, lending, or infrastru
431cture","Demonstrated total value tokenized (TVT) or on-chain RWA value","Regulatory compliance framework or clear compliance roadmap"],constraints:[{label:"Concentration",text:"Maximum 20% single-asset weight"},{label:"Category",text:"Maximum 40% single-category exposure"},{label:"Credit Risk",text:"Credit risk diversification across borrower types"},{label:"Rebalancing",text:"Quarterly rebalancing with credit quality review"}],index_description:"The Index provides systematic exposure to the real-world asset tokenization ecosystem."},eG={dai:Jq,rwa:Zq};function tG(e){return gn({queryKey:["index-methodology",e],queryFn:async()=>{const{data:t,error:r}=await hs.from("index_methodology").select("*").eq("index_type",e).single();return r||!t?{id:"",updated_at:"",...eG[e]}:{id:t.id,index_type:t.index_type,criteria:t.criteria,constraints:t.constraints,index_description:t.index_description,updated_at:t.updated_at}},staleTime:5*60*1e3})}function BI({indexType:e,criteriaId:t="criteria",constraintsId:r="risk-constraints"}){const{data:n}=tG(e);return n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{id:t,className:e==="dai"?"mb-8":"space-y-3",children:[s.jsx("h3",{className:"font-serif text-lg mb-3",children:"Criteria for Inclusion"}),s.jsx("ol",{className:"list-decimal list-inside space-y-1.5 text-muted-foreground text-sm",children:n.criteria.map((i,a)=>s.jsx("li",{children:i},a))})]}),s.jsxs("div",{id:r,className:e==="dai"?"mb-8":"space-y-3",children:[s.jsx("h3",{className:"font-serif text-lg mb-3",children:"Constraints"}),s.jsx("ul",{className:"space-y-2 text-muted-foreground text-sm",children:n.constraints.map((i,a)=>s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsxs("span",{className:"font-medium text-foreground",children:[i.label,":"]}),s.jsx("span",{children:i.text})]},a))})]})]}):null}const WI=Gf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),pe=w.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},a)=>{const o=n?pW:"button";return s.jsx(o,{className:X(WI({variant:t,size:r,className:e})),ref:a,...i})});pe.displayName="Button";const Vi=()=>{const{pathname:e}=Ao(),t=e==="/"||e===""||e==="/backtest/dai",r=e==="/rwa"||e==="/backtest/rwa";return s.jsx("header",{className:"w-full py-4",children:s.jsxs("div",{className:"container flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"w-9 h-9 rounded-md bg-foreground flex items-center justify-center relative",children:[s.jsx("span",{className:"text-background font-serif text-lg",children:"O"}),s.jsx("span",{className:"absolute text-[#E07A5F] font-serif text-lg top-0.5 right-1.5",children:"/"})]}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"font-serif text-xl tracking-tight text-foreground leading-tight",children:"Openw3b"}),s.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Tokenized Intelligence"})]})]}),s.jsxs("nav",{className:"flex items-center gap-1",children:[s.jsx(_e,{to:"/",className:X("px-3 py-1.5 text-xs font-medium tracking-wide transition-colors",t?"text-foreground underline underline-offset-4 decoration-primary":"text-muted-foreground hover:text-foreground"),children:"dAI INDEX"}),s.jsx(_e,{to:"/rwa",className:X("px-3 py-1.5 text-xs font-medium tracking-wide transition-colors",r?"text-foreground underline underline-offset-4 decoration-primary":"text-muted-foreground hover:text-foreground"),children:"RWA INDEX"})]})]})})},rG=[{id:"methodology",label:"Index Methodology",children:[{id:"ai-index",label:"dAI Token Index"},{id:"criteria",label:"Criteria for Inclusion"},{id:"risk-constraints",label:"Constraints"},{id:"weighting",label:"Factor-Based Portfolio Weighting"}]},{id:"weight-distribution",label:"Weight Distribution"},{id:"scorecards",label:"Constituent Scorecards"},{id:"constituents",label:"Index Constituents"},{id:"liquidity",label:"Liquidity Analysis"},{id:"sustainability",label:"Research Report"}],nG=()=>{const e=t=>{const r=document.getElementById(t);r&&r.scrollIntoView({behavior:"smooth"})};return s.jsx("nav",{className:"space-y-1",children:rG.map(t=>s.jsxs("div",{children:[s.jsx("button",{onClick:()=>e(t.id),className:"w-full text-left py-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors tracking-wide",children:t.label}),t.children&&s.jsx("div",{className:"ml-3 space-y-0.5",children:t.children.map(r=>s.jsx("button",{onClick:()=>e(r.id),className:"w-full text-left py-1 text-xs text-muted-foreground
431/80 hover:text-foreground transition-colors tracking-wide",children:r.label},r.id))})]},t.id))})},iG=Gf("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Me({className:e,variant:t,...r}){return s.jsx("div",{className:X(iG({variant:t}),e),...r})}var yx="focusScope.autoFocusOnMount",xx="focusScope.autoFocusOnUnmount",pC={bubbles:!1,cancelable:!0},aG="FocusScope",eS=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=w.useState(null),u=Ct(i),d=Ct(a),f=w.useRef(null),h=Ne(t,p=>c(p)),m=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let p=function(b){if(m.paused||!l)return;const S=b.target;l.contains(S)?f.current=S:wa(f.current,{select:!0})},v=function(b){if(m.paused||!l)return;const S=b.relatedTarget;S!==null&&(l.contains(S)||wa(f.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const j of b)j.removedNodes.length>0&&wa(l)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const y=new MutationObserver(x);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),y.disconnect()}}},[n,l,m.paused]),w.useEffect(()=>{if(l){vC.add(m);const p=document.activeElement;if(!l.contains(p)){const x=new CustomEvent(yx,pC);l.addEventListener(yx,u),l.dispatchEvent(x),x.defaultPrevented||(sG(dG(UI(l)),{select:!0}),document.activeElement===p&&wa(l))}return()=>{l.removeEventListener(yx,u),setTimeout(()=>{const x=new CustomEvent(xx,pC);l.addEventListener(xx,d),l.dispatchEvent(x),x.defaultPrevented||wa(p??document.body,{select:!0}),l.removeEventListener(xx,d),vC.remove(m)},0)}}},[l,u,d,m]);const g=w.useCallback(p=>{if(!r&&!n||m.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(v&&x){const y=p.currentTarget,[b,S]=oG(y);b&&S?!p.shiftKey&&x===S?(p.preventDefault(),r&&wa(b,{select:!0})):p.shiftKey&&x===b&&(p.preventDefault(),r&&wa(S,{select:!0})):x===y&&p.preventDefault()}},[r,n,m.paused]);return s.jsx(ce.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});eS.displayName=aG;function sG(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(wa(n,{select:t}),document.activeElement!==r)return}function oG(e){const t=UI(e),r=gC(t,e),n=gC(t.reverse(),e);return[r,n]}function UI(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function gC(e,t){for(const r of e)if(!lG(r,{upTo:t}))return r}function lG(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cG(e){return e instanceof HTMLInputElement&&"select"in e}function wa(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&cG(e)&&t&&e.select()}}var vC=uG();function uG(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=yC(e,t),e.unshift(t)},remove(t){var r;e=yC(e,t),(r=e[0])==null||r.resume()}}}function yC(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function dG(e){return e.filter(t=>t.tagName!=="A")}var bx=0;function zI(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xC()),document.body.insertAdjacentElement("beforeend",e[1]??xC()),bx++,()=>{bx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bx--}},[])}function xC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.
vendor: 4,904 bytes, lines 431-446
431style.position="fixed",e.style.pointerEvents="none",e}var Fm="right-scroll-bar-position",Bm="width-before-scroll-bar",fG="with-scroll-bars-hidden",hG="--removed-body-scroll-bar-size";function wx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mG(e,t){var r=w.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=t,r.facade}var pG=typeof window<"u"?w.useLayoutEffect:w.useEffect,bC=new WeakMap;function gG(e,t){var r=mG(null,function(n){return e.forEach(function(i){return wx(i,n)})});return pG(function(){var n=bC.get(r);if(n){var i=new Set(n),a=new Set(e),o=r.current;i.forEach(function(l){a.has(l)||wx(l,null)}),a.forEach(function(l){i.has(l)||wx(l,o)})}bC.set(r,e)},[e]),r}function vG(e){return e}function yG(e,t){t===void 0&&(t=vG);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var o=t(a,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(n=!0;r.length;){var o=r;r=[],o.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(a),o=r}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),r}}}};return i}function xG(e){e===void 0&&(e={});var t=yG(null);return t.options=li({async:!0,ssr:!1},e),t}var VI=function(e){var t=e.sideCar,r=Hc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return w.createElement(n,li({},r))};VI.isSideCarExport=!0;function bG(e,t){return e.useMedium(t),VI}var HI=xG(),jx=function(){},gv=w.forwardRef(function(e,t){var r=w.useRef(null),n=w.useState({onScrollCapture:jx,onWheelCapture:jx,onTouchMoveCapture:jx}),i=n[0],a=n[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noRelative,g=e.noIsolation,p=e.inert,v=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,S=Hc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=h,N=gG([r,t]),k=li(li({},S),i);return w.createElement(w.Fragment,null,d&&w.createElement(j,{sideCar:HI,removeScrollBar:u,shards:f,noRelative:m,noIsolation:g,inert:p,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:b}),o?w.cloneElement(w.Children.only(l),li(li({},k),{ref:N})):w.createElement(y,li({},k,{className:c,ref:N}),l))});gv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gv.classNames={fullWidth:Bm,zeroRight:Fm};var wG=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wG();return t&&e.setAttribute("nonce",t),e}function SG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var NG=function(){var e=0,t=null;return{add:function(r){e==0&&(t=jG())&&(SG(t,r),kG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_G=function(){var e=NG();return function(t,r){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},qI=function(){var e=_G(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},CG={left:0,top:0,right:0,gap:0},Sx=function(e){return parseInt(e||"",10)||0},AG=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Sx(r),Sx(n),Sx(i)]},EG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return CG;var t=AG(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},PG=qI(),Rl="data-scroll-locked",OG=function(e,t,r,n){var i=e.left,a=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),` 432 .`.concat(fG,` { 433 overflow: hidden `).concat(n,`; 434 padding-right: `).concat(l,"px ").concat(n,`; 435 } 436 body[`).concat(Rl,`] { 437 overflow: hidden `).concat(n,`; 438 overscroll-behavior: contain; 439 `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` 440 padding-left: `.concat(i,`px; 441 padding-top: `).concat(a,`px; 442 padding-right: `).concat(o,`px; 443 margin-left:0; 444 margin-top:0; 445 margin-right: `).concat(l,"px ").concat(n,`; 446 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
446")].filter(Boolean).join(""),` 447 } 448 449 .`).concat(Fm,` { 450 right: `).concat(l,"px ").concat(n,`; 451 } 452 453 .`).concat(Bm,` { 454 margin-right: `).concat(l,"px ").concat(n,`; 455 } 456 457 .`).concat(Fm," .").concat(Fm,` { 458 right: 0 `).concat(n,`; 459 } 460 461 .`).concat(Bm," .").concat(Bm,` { 462 margin-right: 0 `).concat(n,`; 463 } 464 465 body[`).concat(Rl,`] { 466 `).concat(hG,": ").concat(l,`px; 467 } 468`)},wC=function(){var e=parseInt(document.body.getAttribute(Rl)||"0",10);return isFinite(e)?e:0},TG=function(){w.useEffect(function(){return document.body.setAttribute(Rl,(wC()+1).toString()),function(){var e=wC()-1;e<=0?document.body.removeAttribute(Rl):document.body.setAttribute(Rl,e.toString())}},[])},$G=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;TG();var a=w.useMemo(function(){return EG(i)},[i]);return w.createElement(PG,{styles:OG(a,!t,i,r?"":"!important")})},Vb=!1;if(typeof window<"u")try{var Qh=Object.defineProperty({},"passive",{get:function(){return Vb=!0,!0}});window.addEventListener("test",Qh,Qh),window.removeEventListener("test",Qh,Qh)}catch{Vb=!1}var qo=Vb?{passive:!1}:!1,RG=function(e){return e.tagName==="TEXTAREA"},GI=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!RG(e)&&r[t]==="visible")},IG=function(e){return GI(e,"overflowY")},MG=function(e){return GI(e,"overflowX")},jC=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=KI(e,n);if(i){var a=YI(e,n),o=a[1],l=a[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},DG=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},LG=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},KI=function(e,t){return e==="v"?IG(t):MG(t)},YI=function(e,t){return e==="v"?DG(t):LG(t)},FG=function(e,t){return e==="h"&&t==="rtl"?-1:1},BG=function(e,t,r,n,i){var a=FG(e,window.getComputedStyle(t).direction),o=a*n,l=r.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var m=YI(e,l),g=m[0],p=m[1],v=m[2],x=p-v-a*g;(g||x)&&KI(e,l)&&(f+=x,h+=g);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!i)||!d&&(Math.abs(h)<1||!i))&&(u=!0),u},Jh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},SC=function(e){return[e.deltaX,e.deltaY]},kC=function(e){return e&&"current"in e?e.current:e},WG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},UG=function(e){return` 469 .block-interactivity-`.concat(e,` {pointer-events: none;} 470 .allow-interactivity-`).concat(e,` {pointer-events: all;} 471`)},zG=0,Go=[];function VG(e){var t=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),i=w.useState(zG++)[0],a=w.useState(qI)[0],o=w.useRef(e);w.useEffect(function(){o.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=tV([e.lockRef.current],(e.shards||[]).map(kC),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=w.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var x=Jh(p),y=r.current,b="deltaX"in p?p.deltaX:y[0]-x[0],S="deltaY"in p?p.deltaY:y[1]-x[1],j,N=p.target,k=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in p&&k==="h"&&N.type==="range")return!1;var _=jC(k,N);if(!_)return!0;if(_?j=k:(j=k==="v"?"h":"v",_=jC(k,N)),!_)return!1;if(!n.current&&"changedTouches"in p&&(b||S)&&(n.current=j),!j)return!0;var C=n.current||j;return BG(C,v,p,C==="h"?b:S,!0)},[]),c=w.useCallback(function(p){var v=p;if(!(!Go.length||Go[Go.length-1]!==a)){var x="deltaY"in v?SC(v):Jh(v),y=t.current.filter(function(j){return j.name===v.type&&(j.target===v.target||v.target===j.shadowParent)&&WG(j.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}
vendor: 4,334 bytes, line 471
471if(!y){var b=(o.current.shards||[]).map(kC).filter(Boolean).filter(function(j){return j.contains(v.target)}),S=b.length>0?l(v,b[0]):!o.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),u=w.useCallback(function(p,v,x,y){var b={name:p,delta:v,target:x,should:y,shadowParent:HG(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),d=w.useCallback(function(p){r.current=Jh(p),n.current=void 0},[]),f=w.useCallback(function(p){u(p.type,SC(p),p.target,l(p,e.lockRef.current))},[]),h=w.useCallback(function(p){u(p.type,Jh(p),p.target,l(p,e.lockRef.current))},[]);w.useEffect(function(){return Go.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,qo),document.addEventListener("touchmove",c,qo),document.addEventListener("touchstart",d,qo),function(){Go=Go.filter(function(p){return p!==a}),document.removeEventListener("wheel",c,qo),document.removeEventListener("touchmove",c,qo),document.removeEventListener("touchstart",d,qo)}},[]);var m=e.removeScrollBar,g=e.inert;return w.createElement(w.Fragment,null,g?w.createElement(a,{styles:UG(i)}):null,m?w.createElement($G,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function HG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qG=bG(HI,VG);var tS=w.forwardRef(function(e,t){return w.createElement(gv,li({},e,{ref:t,sideCar:qG}))});tS.classNames=gv.classNames;var GG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ko=new WeakMap,Zh=new WeakMap,em={},kx=0,XI=function(e){return e&&(e.host||XI(e.parentNode))},KG=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=XI(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},YG=function(e,t,r,n){var i=KG(t,Array.isArray(e)?e:[e]);em[r]||(em[r]=new WeakMap);var a=em[r],o=[],l=new Set,c=new Set(i),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};i.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(n),g=m!==null&&m!=="false",p=(Ko.get(h)||0)+1,v=(a.get(h)||0)+1;Ko.set(h,p),a.set(h,v),o.push(h),p===1&&g&&Zh.set(h,!0),v===1&&h.setAttribute(r,"true"),g||h.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(t),l.clear(),kx++,function(){o.forEach(function(f){var h=Ko.get(f)-1,m=a.get(f)-1;Ko.set(f,h),a.set(f,m),h||(Zh.has(f)||f.removeAttribute(n),Zh.delete(f)),m||f.removeAttribute(r)}),kx--,kx||(Ko=new WeakMap,Ko=new WeakMap,Zh=new WeakMap,em={})}},QI=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=GG(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),YG(n,i,r,"aria-hidden")):function(){return null}},vv="Dialog",[JI,VNe]=Yr(vv),[XG,Xn]=JI(vv),ZI=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=w.useRef(null),c=w.useRef(null),[u,d]=bi({prop:n,defaultProp:i??!1,onChange:a,caller:vv});return s.jsx(XG,{scope:t,triggerRef:l,contentRef:c,contentId:pi(),titleId:pi(),descriptionId:pi(),open:u,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(f=>!f),[d]),modal:o,children:r})};ZI.displayName=vv;var eM="DialogTrigger",QG=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Xn(eM,r),a=Ne(t,i.triggerRef);return s.jsx(ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":iS(i.open),...n,ref:a,onClick:ne(e.onClick,i.onOpenToggle)})});QG.displayName=eM;var rS="DialogPortal",[JG,tM]=JI(rS,{forceMount:void 0}),rM=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,a=Xn(rS,t);return s.jsx(JG,{scope:t,forceMount:r,children:w.Children.map(n,o=>s.jsx(Xr,{present:r||a.open,children:s.jsx(Zg,{asChild:!0,container:i,children:o})}))})};rM.displayName=rS;var _p="DialogOverlay",nM=w.forwardRef((e,t)=>{const r=tM(_p,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,a=Xn(_p,e.__scopeDialog);return a.modal?s.jsx(Xr,{present:n||a.open,children:s.jsx(eK,{...i,ref:t})}):null});nM.displayName=_p;var ZG=nc("DialogOverlay.RemoveScroll"),eK=w.forwardRef((e,t)=>
vendor: 4,627 bytes, lines 471-475
471{const{__scopeDialog:r,...n}=e,i=Xn(_p,r);return s.jsx(tS,{as:ZG,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx(ce.div,{"data-state":iS(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),mo="DialogContent",iM=w.forwardRef((e,t)=>{const r=tM(mo,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,a=Xn(mo,e.__scopeDialog);return s.jsx(Xr,{present:n||a.open,children:a.modal?s.jsx(tK,{...i,ref:t}):s.jsx(rK,{...i,ref:t})})});iM.displayName=mo;var tK=w.forwardRef((e,t)=>{const r=Xn(mo,e.__scopeDialog),n=w.useRef(null),i=Ne(t,r.contentRef,n);return w.useEffect(()=>{const a=n.current;if(a)return QI(a)},[]),s.jsx(aM,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ne(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:ne(e.onFocusOutside,a=>a.preventDefault())})}),rK=w.forwardRef((e,t)=>{const r=Xn(mo,e.__scopeDialog),n=w.useRef(!1),i=w.useRef(!1);return s.jsx(aM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),a.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),aM=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=Xn(mo,r),c=w.useRef(null),u=Ne(t,c);return zI(),s.jsxs(s.Fragment,{children:[s.jsx(eS,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(Hf,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":iS(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(nK,{titleId:l.titleId}),s.jsx(aK,{contentRef:c,descriptionId:l.descriptionId})]})]})}),nS="DialogTitle",sM=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Xn(nS,r);return s.jsx(ce.h2,{id:i.titleId,...n,ref:t})});sM.displayName=nS;var oM="DialogDescription",lM=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Xn(oM,r);return s.jsx(ce.p,{id:i.descriptionId,...n,ref:t})});lM.displayName=oM;var cM="DialogClose",uM=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Xn(cM,r);return s.jsx(ce.button,{type:"button",...n,ref:t,onClick:ne(e.onClick,()=>i.onOpenChange(!1))})});uM.displayName=cM;function iS(e){return e?"open":"closed"}var dM="DialogTitleWarning",[HNe,fM]=hW(dM,{contentName:mo,titleName:nS,docsSlug:"dialog"}),nK=({titleId:e})=>{const t=fM(dM),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 472 473If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 474 475For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},iK="DialogDescriptionWarning",aK=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fM(iK).contentName}}.`;return w.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},sK=ZI,oK=rM,hM=nM,mM=iM,pM=sM,gM=lM,lK=uM;const aS=sK,cK=oK,vM=w.forwardRef(({className:e,...t},r)=>s.jsx(hM,{ref:r,className:X("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));vM.displayName=hM.displayName;const yv=w.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(cK,{children:[s.jsx(vM,{}),s.jsxs(mM,{ref:n,className:X("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
475nded-lg",e),...r,children:[t,s.jsxs(lK,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Yf,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yv.displayName=mM.displayName;const xv=({className:e,...t})=>s.jsx("div",{className:X("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});xv.displayName="DialogHeader";const sS=({className:e,...t})=>s.jsx("div",{className:X("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});sS.displayName="DialogFooter";const bv=w.forwardRef(({className:e,...t},r)=>s.jsx(pM,{ref:r,className:X("text-lg font-semibold leading-none tracking-tight",e),...t}));bv.displayName=pM.displayName;const oS=w.forwardRef(({className:e,...t},r)=>s.jsx(gM,{ref:r,className:X("text-sm text-muted-foreground",e),...t}));oS.displayName=gM.displayName;function be({className:e,...t}){return s.jsx("div",{className:X("animate-pulse rounded-md bg-muted",e),...t})}var uK=w.createContext(void 0);function eh(e){const t=w.useContext(uK);return e||t||"ltr"}function Qd(e,[t,r]){return Math.min(r,Math.max(t,e))}function dK(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var lS="ScrollArea",[yM,qNe]=Yr(lS),[fK,vn]=yM(lS),xM=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,c]=w.useState(null),[u,d]=w.useState(null),[f,h]=w.useState(null),[m,g]=w.useState(null),[p,v]=w.useState(null),[x,y]=w.useState(0),[b,S]=w.useState(0),[j,N]=w.useState(!1),[k,_]=w.useState(!1),C=Ne(t,E=>c(E)),P=eh(i);return s.jsx(fK,{scope:r,type:n,dir:P,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:j,onScrollbarXEnabledChange:N,scrollbarY:p,onScrollbarYChange:v,scrollbarYEnabled:k,onScrollbarYEnabledChange:_,onCornerWidthChange:y,onCornerHeightChange:S,children:s.jsx(ce.div,{dir:P,...o,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});xM.displayName=lS;var bM="ScrollAreaViewport",wM=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:i,...a}=e,o=vn(bM,r),l=w.useRef(null),c=Ne(t,l,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),s.jsx(ce.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});wM.displayName=bM;var Ni="ScrollAreaScrollbar",cS=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=vn(Ni,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,l=e.orientation==="horizontal";return w.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),i.type==="hover"?s.jsx(hK,{...n,ref:t,forceMount:r}):i.type==="scroll"?s.jsx(mK,{...n,ref:t,forceMount:r}):i.type==="auto"?s.jsx(jM,{...n,ref:t,forceMount:r}):i.type==="always"?s.jsx(uS,{...n,ref:t}):null});cS.displayName=Ni;var hK=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=vn(Ni,e.__scopeScrollArea),[a,o]=w.useState(!1);return w.useEffect(()=>{const l=i.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),s.jsx(Xr,{present:r||a,children:s.jsx(jM,{"data-state":a?"visible":"hidden",...n,ref:t})})}),mK=w.forwardRef((e,t)=>
vendor: 4,111 bytes, line 475
475{const{forceMount:r,...n}=e,i=vn(Ni,e.__scopeScrollArea),a=e.orientation==="horizontal",o=jv(()=>c("SCROLL_END"),100),[l,c]=dK("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,i.scrollHideDelay,c]),w.useEffect(()=>{const u=i.viewport,d=a?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(c("SCROLL"),o()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[i.viewport,a,c,o]),s.jsx(Xr,{present:r||l!=="hidden",children:s.jsx(uS,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ne(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ne(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),jM=w.forwardRef((e,t)=>{const r=vn(Ni,e.__scopeScrollArea),{forceMount:n,...i}=e,[a,o]=w.useState(!1),l=e.orientation==="horizontal",c=jv(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;o(l?u:d)}},10);return cc(r.viewport,c),cc(r.content,c),s.jsx(Xr,{present:n||a,children:s.jsx(uS,{"data-state":a?"visible":"hidden",...i,ref:t})})}),uS=w.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,i=vn(Ni,e.__scopeScrollArea),a=w.useRef(null),o=w.useRef(0),[l,c]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=CM(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>a.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,m){return bK(h,o.current,l,m)}return r==="horizontal"?s.jsx(pK,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const h=i.viewport.scrollLeft,m=NC(h,l,i.dir);a.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):r==="vertical"?s.jsx(gK,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const h=i.viewport.scrollTop,m=NC(h,l);a.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),pK=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,a=vn(Ni,e.__scopeScrollArea),[o,l]=w.useState(),c=w.useRef(null),u=Ne(t,c,a.onScrollbarXChange);return w.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(kM,{"data-orientation":"horizontal",...i,ref:u,sizes:r,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":wv(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(a.viewport){const h=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),EM(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Ap(o.paddingLeft),paddingEnd:Ap(o.paddingRight)}})}})}),gK=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,a=vn(Ni,e.__scopeScrollArea),[o,l]=w.useState(),c=w.useRef(null),u=Ne(t,c,a.onScrollbarYChange);return w.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(kM,{"data-orientation":"vertical",...i,ref:u,sizes:r,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":wv(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(a.viewport){const h=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),EM(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&n({content:a.viewport.scrollHeight,viewport:
vendor: 5,697 bytes, line 475
475a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Ap(o.paddingTop),paddingEnd:Ap(o.paddingBottom)}})}})}),[vK,SM]=yM(Ni),kM=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=e,m=vn(Ni,r),[g,p]=w.useState(null),v=Ne(t,C=>p(C)),x=w.useRef(null),y=w.useRef(""),b=m.viewport,S=n.content-n.viewport,j=Ct(d),N=Ct(c),k=jv(f,10);function _(C){if(x.current){const P=C.clientX-x.current.left,E=C.clientY-x.current.top;u({x:P,y:E})}}return w.useEffect(()=>{const C=P=>{const E=P.target;(g==null?void 0:g.contains(E))&&j(P,S)};return document.addEventListener("wheel",C,{passive:!1}),()=>document.removeEventListener("wheel",C,{passive:!1})},[b,g,S,j]),w.useEffect(N,[n,N]),cc(g,k),cc(m.content,k),s.jsx(vK,{scope:r,scrollbar:g,hasThumb:i,onThumbChange:Ct(a),onThumbPointerUp:Ct(o),onThumbPositionChange:N,onThumbPointerDown:Ct(l),children:s.jsx(ce.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:ne(e.onPointerDown,C=>{C.button===0&&(C.target.setPointerCapture(C.pointerId),x.current=g.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),_(C))}),onPointerMove:ne(e.onPointerMove,_),onPointerUp:ne(e.onPointerUp,C=>{const P=C.target;P.hasPointerCapture(C.pointerId)&&P.releasePointerCapture(C.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})})}),Cp="ScrollAreaThumb",NM=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=SM(Cp,e.__scopeScrollArea);return s.jsx(Xr,{present:r||i.hasThumb,children:s.jsx(yK,{ref:t,...n})})}),yK=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...i}=e,a=vn(Cp,r),o=SM(Cp,r),{onThumbPositionChange:l}=o,c=Ne(t,f=>o.onThumbChange(f)),u=w.useRef(void 0),d=jv(()=>{u.current&&(u.current(),u.current=void 0)},100);return w.useEffect(()=>{const f=a.viewport;if(f){const h=()=>{if(d(),!u.current){const m=wK(f,l);u.current=m,l()}};return l(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[a.viewport,d,l]),s.jsx(ce.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ne(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),g=f.clientX-m.left,p=f.clientY-m.top;o.onThumbPointerDown({x:g,y:p})}),onPointerUp:ne(e.onPointerUp,o.onThumbPointerUp)})});NM.displayName=Cp;var dS="ScrollAreaCorner",_M=w.forwardRef((e,t)=>{const r=vn(dS,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?s.jsx(xK,{...e,ref:t}):null});_M.displayName=dS;var xK=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,i=vn(dS,r),[a,o]=w.useState(0),[l,c]=w.useState(0),u=!!(a&&l);return cc(i.scrollbarX,()=>{var f;const d=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(d),c(d)}),cc(i.scrollbarY,()=>{var f;const d=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(d),o(d)}),u?s.jsx(ce.div,{...n,ref:t,style:{width:a,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ap(e){return e?parseInt(e,10):0}function CM(e,t){const r=e/t;return isNaN(r)?0:r}function wv(e){const t=CM(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function bK(e,t,r,n="ltr"){const i=wv(r),a=i/2,o=t||a,l=i-o,c=r.scrollbar.paddingStart+o,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return AM([c,u],f)(e)}function NC(e,t,r="ltr"){const n=wv(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,l=a-n,c=r==="ltr"?[0,o]:[o*-1,0],u=Qd(e,c);return AM([0,o],[0,l])(u)}function AM(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function EM(e,t){return e>0&&e<t}var wK=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function i(){const a={left:e.scrollLeft,top:e.scrollTop},o=r.left!==a.left,l=r.top!==a.top;(o||l)&&t(),r=a,n=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(n)};function jv(e,t){const r=Ct(e),n=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),w.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function cc(e,t){const r=Ct(t);Pt(()=>{let n=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(n),i.unobserve(e)}}},[e,r])}var PM=xM,jK=wM,SK=_M;const OM=w.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(PM,{ref:n,className:X("relative overflow-hidden",e),...r,children:[s.jsx(jK,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(TM,{}),s.jsx(SK,{})]}));OM.displayName=PM.displayName;const TM=w.forwardRef(({className:e,orientation:t="vertical",...r},n)=>s.jsx(cS,{ref:n,orientation:t,className:X("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:s.jsx(NM,{className:"relative flex-1 rounded-full bg-border"})}));TM.displayName=cS.displayName;var Nx="rovingFocusGroup.onEntryFocus",kK={bubbles:!1,cancelable:!0},th="RovingFocusGroup",[Hb,$M,NK]=Jg(th),[_K,RM]=Yr(th,[NK]),[CK,AK]=_K(th),IM=w.forwardRef((e,t)=>
vendor: 4,673 bytes, line 475
475s.jsx(Hb.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Hb.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(EK,{...e,ref:t})})}));IM.displayName=th;var EK=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=w.useRef(null),m=Ne(t,h),g=eh(a),[p,v]=bi({prop:o,defaultProp:l??null,onChange:c,caller:th}),[x,y]=w.useState(!1),b=Ct(u),S=$M(r),j=w.useRef(!1),[N,k]=w.useState(0);return w.useEffect(()=>{const _=h.current;if(_)return _.addEventListener(Nx,b),()=>_.removeEventListener(Nx,b)},[b]),s.jsx(CK,{scope:r,orientation:n,dir:g,loop:i,currentTabStopId:p,onItemFocus:w.useCallback(_=>v(_),[v]),onItemShiftTab:w.useCallback(()=>y(!0),[]),onFocusableItemAdd:w.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:w.useCallback(()=>k(_=>_-1),[]),children:s.jsx(ce.div,{tabIndex:x||N===0?-1:0,"data-orientation":n,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:ne(e.onMouseDown,()=>{j.current=!0}),onFocus:ne(e.onFocus,_=>{const C=!j.current;if(_.target===_.currentTarget&&C&&!x){const P=new CustomEvent(Nx,kK);if(_.currentTarget.dispatchEvent(P),!P.defaultPrevented){const E=S().filter(M=>M.focusable),A=E.find(M=>M.active),R=E.find(M=>M.id===p),D=[A,R,...E].filter(Boolean).map(M=>M.ref.current);LM(D,d)}}j.current=!1}),onBlur:ne(e.onBlur,()=>y(!1))})})}),MM="RovingFocusGroupItem",DM=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:a,children:o,...l}=e,c=pi(),u=a||c,d=AK(MM,r),f=d.currentTabStopId===u,h=$M(r),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:p}=d;return w.useEffect(()=>{if(n)return m(),()=>g()},[n,m,g]),s.jsx(Hb.ItemSlot,{scope:r,id:u,focusable:n,active:i,children:s.jsx(ce.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:ne(e.onMouseDown,v=>{n?d.onItemFocus(u):v.preventDefault()}),onFocus:ne(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ne(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=TK(v,d.orientation,d.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=h().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")b.reverse();else if(x==="prev"||x==="next"){x==="prev"&&b.reverse();const S=b.indexOf(v.currentTarget);b=d.loop?$K(b,S+1):b.slice(S+1)}setTimeout(()=>LM(b))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:p!=null}):o})})});DM.displayName=MM;var PK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function OK(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TK(e,t,r){const n=OK(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return PK[n]}function LM(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function $K(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var RK=IM,IK=DM,Sv="Tabs",[MK,GNe]=Yr(Sv,[RM]),FM=RM(),[DK,fS]=MK(Sv),BM=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=eh(l),[f,h]=bi({prop:n,onChange:i,defaultProp:a??"",caller:Sv});return s.jsx(DK,{scope:r,baseId:pi(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:c,children:s.jsx(ce.div,{dir:d,"data-orientation":o,...u,ref:t})})});BM.displayName=Sv;var WM="TabsList",UM=w.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...i}=e,a=fS(WM,r),o=FM(r);return s.jsx(RK,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:n,children:s.jsx(ce.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});UM.displayName=WM;var zM="TabsTrigger",VM=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...a}=e,o=fS(zM,r),l=FM(r),c=GM(o.baseId,n),u=KM(o.baseId,n),d=n===o.value;return s.jsx(IK,{asChild:!0,...l,focusable:!i,active:d,children:s.jsx(ce.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:t,onMouseDown:ne(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:ne(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:ne(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!i&&f&&o.onValueChange(n)})})})});VM.displayName=zM;var HM="TabsContent",qM=w.forwardRef((e,t)=>
475{const{__scopeTabs:r,value:n,forceMount:i,children:a,...o}=e,l=fS(HM,r),c=GM(l.baseId,n),u=KM(l.baseId,n),d=n===l.value,f=w.useRef(d);return w.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),s.jsx(Xr,{present:i||d,children:({present:h})=>s.jsx(ce.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&a})})});qM.displayName=HM;function GM(e,t){return`${e}-trigger-${t}`}function KM(e,t){return`${e}-content-${t}`}var LK=BM,YM=UM,XM=VM,QM=qM;const hS=LK,kv=w.forwardRef(({className:e,...t},r)=>s.jsx(YM,{ref:r,className:X("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));kv.displayName=YM.displayName;const Hi=w.forwardRef(({className:e,...t},r)=>s.jsx(XM,{ref:r,className:X("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Hi.displayName=XM.displayName;const dd=w.forwardRef(({className:e,...t},r)=>s.jsx(QM,{ref:r,className:X("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));dd.displayName=QM.displayName;const FK="",JM="https://fgtxusfzbivelnnnqmjf.supabase.co",Nv="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZndHh1c2Z6Yml2ZWxubm5xbWpmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjkwMTA4MTksImV4cCI6MjA4NDU4NjgxOX0.eslVbrBM8W_5I7MeJTqcSf146ChMjun5amO_5xpNLoQ";function mS(e){return`${JM}/functions/v1/admin-scanner/${e}`}async function Eo(e,t){const r=mS(e),n={"Content-Type":"application/json",Accept:"application/json"};n.apikey=Nv;const i=await fetch(r,{method:"POST",headers:n,body:JSON.stringify(t)});if(!i.ok){const a=await i.json().catch(()=>null);throw new _v((a==null?void 0:a.error)||`API request failed: ${i.statusText}`,i.status,a==null?void 0:a.details)}return i.json()}async function pS(e,t,r){let n=mS(e);const i={Accept:"application/json",...r};i.apikey=Nv;const a=await fetch(n,{method:"GET",headers:i});if(!a.ok){const o=await a.json().catch(()=>null);throw new _v((o==null?void 0:o.error)||`API request failed: ${a.statusText}`,a.status,o==null?void 0:o.details)}return a.json()}class _v extends Error{constructor(t,r,n){super(t),this.status=r,this.details=n,this.name="ApiError"}}function BK(e){const t=e.replace(/^\/api\/market\/?/,"");return`${JM}/functions/v1/market-data/${t}`}async function Cv(e,t,r){const n=e.startsWith("/api/market");let i=n?BK(e):`${FK}${e}`;if(t){const l=new URLSearchParams;Object.entries(t).forEach(([c,u])=>{l.set(c,String(u))}),i+=`?${l.toString()}`}const a={Accept:"application/json",...r};n&&(a.apikey=Nv);const o=await fetch(i,{method:"GET",headers:a});if(!o.ok){const l=await o.json().catch(()=>null);throw new _v((l==null?void 0:l.error)||`API request failed: ${o.statusText}`,o.status,l==null?void 0:l.details)}return o.json()}async function WK(){return(await Cv("/api/market/latest")).data}async function UK(e){return(await Cv(`/api/market/token/${e}`)).data}async function zK(e=30){return(await Cv("/api/market/history",{days:e})).data}async function VK(e=395){return Cv("/api/market/benchmarks",{days:e})}async function _C(e){return Eo("verify-password",{password:e})}async function HK(e,t){return Eo("category-stats",{password:e,categoryType:t})}async function qK(e,t,r){return Eo("scan-candidates",{password:e,categoryType:t,filters:r})}async function GK(e,t,r){return Eo("add-constituent",{password:e,targetIndex:t,candidate:r})}async function KK(e,t,r){return Eo("remove-constituent",{password:e,indexType:t,ticker:r})}async function YK(e,t){return Eo("constituents",{password:e,indexType:t})}async function XK(e,t){return pS(`coin-links/${t}`,void 0,{"x-admin-password":e})}async function QK(e,t){return pS(`browse-category/${t}`,void 0,{"x-admin-password":e})}async function ZM(e){return pS(`public-constituents/${e}`)}async function JK(e,t,r,n){const i=mS("").replace(/admin-scanner\/$/,"ai-recommender"),a={"Content-Type":"application/json",Accept:"application/json"};a.apikey=Nv;const o=await fetch(i,{method:"POST",headers:a,body:JSON.stringify({password:e,categoryType:t,tokens:r,currentConstituents:n})});if(!o.ok){const l=await o.json().catch(()=>null);throw new _v((l==null?void 0:l.error)||`AI recommendation failed: ${o.statusText}`,o.status,l==null?void 0:l.details)}return o.json()}async function ZK(e,t,r,n,i){return Eo("update-methodology",{password:e,id:t,criteria:r,constraints:n,index_description:i})}const bu=e=>e?e>=1e9?`$${(e/1e9).toFixed(2)}B`:e>=1e6?`$${(e/1e6).toFixed(2)}M`:e>=1e3?`$${(e/1e3).toFixed(2)}K`:`$${e.toFixed(2)}`:"â",CC=e=>e?e>=1e9?`${(e/1e9).toFixed(2)}B`:e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(2)}K`:e.toFixed(0):"â",eY=e=>e?e>
475=1e3?`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`:e>=1?`$${e.toFixed(2)}`:`$${e.toFixed(6)}`:"â",_x=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),AC=e=>e==null?"â":`${e>=0,""}${e.toFixed(2)}%`,ya=e=>{if(!e)return 0;const t=parseFloat(e);return isNaN(t)?0:t},tm=e=>{if(!e)return;const t=parseFloat(e);return isNaN(t)?void 0:t},tY=e=>{var g,p,v,x,y,b,S,j,N,k,_,C,P,E,A,R,$,D,M,I,T,L;const t=ya((g=e.market)==null?void 0:g.priceUsd),r=ya((p=e.market)==null?void 0:p.marketCap),n=ya((v=e.market)==null?void 0:v.fullyDilutedValuation)||r,i=ya((x=e.market)==null?void 0:x.volume24h),a=ya((y=e.market)==null?void 0:y.circulatingSupply),o=ya((b=e.market)==null?void 0:b.totalSupply)||a,l=ya((S=e.market)==null?void 0:S.percentChange24h),c=ya((j=e.protocol)==null?void 0:j.tvlUsd),u=tm((N=e.drawdown)==null?void 0:N.maxDrawdown24h),d=tm((k=e.drawdown)==null?void 0:k.maxDrawdown7d),f=tm((_=e.depth)==null?void 0:_.obDepth2PctBid),h=tm((C=e.depth)==null?void 0:C.obDepth2PctAsk),m=f!=null&&h!=null?f+h:void 0;return{price:t,priceFormatted:eY(t),marketCap:r,marketCapFormatted:bu(r),fdv:n,fdvFormatted:bu(n),volume24h:i,volume24hFormatted:bu(i),priceChange24h:l,mcapFdvRatio:n?`${Math.round(r/n*100)}%`:"100%",circulatingSupply:a,circulatingSupplyFormatted:CC(a),totalSupply:o,totalSupplyFormatted:CC(o),maxDrawdown24h:u,maxDrawdown24hFormatted:AC(u),maxDrawdown7d:d,maxDrawdown7dFormatted:AC(d),obDepth2PctBid:f,obDepth2PctAsk:h,obDepth2PctTotal:m,obDepth2PctFormatted:m!=null?bu(m):void 0,obDepthSource:((P=e.depth)==null?void 0:P.source)??void 0,tvl:c||void 0,tvlFormatted:c?bu(c):void 0,githubStars:((E=e.github)==null?void 0:E.stars)??((A=e.developer)==null?void 0:A.githubStars)??void 0,githubForks:((R=e.github)==null?void 0:R.forks)??(($=e.developer)==null?void 0:$.githubForks)??void 0,recentCommits4w:((D=e.github)==null?void 0:D.recentCommits4w)??((M=e.developer)==null?void 0:M.githubCommitCount4Weeks)??void 0,totalCommits:((I=e.github)==null?void 0:I.totalCommits)??void 0,contributors:((T=e.github)==null?void 0:T.contributors)??void 0,githubRepoName:((L=e.github)==null?void 0:L.repoFullName)??void 0,priceHistory:(e.history||[]).filter(B=>B.priceUsd).map(B=>({date:_x(B.timestamp),value:parseFloat(B.priceUsd)})),marketCapHistory:(e.history||[]).filter(B=>B.marketCap).map(B=>({date:_x(B.timestamp),value:parseFloat(B.marketCap)})),volumeHistory:(e.history||[]).filter(B=>B.volume24h).map(B=>({date:_x(B.timestamp),value:parseFloat(B.volume24h)}))}},rY=(e,t=!0)=>gn({queryKey:["detailedMarketData",e],queryFn:async()=>{if(!e)throw new Error("No token identifier provided");const r=await UK(e);return tY(r)},enabled:t&&!!e,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1});var nY=Array.isArray,Er=nY,iY=typeof xh=="object"&&xh&&xh.Object===Object&&xh,e3=iY,aY=e3,sY=typeof self=="object"&&self&&self.Object===Object&&self,oY=aY||sY||Function("return this")(),_i=oY,lY=_i,cY=lY.Symbol,rh=cY,EC=rh,t3=Object.prototype,uY=t3.hasOwnProperty,dY=t3.toString,wu=EC?EC.toStringTag:void 0;function fY(e){var t=uY.call(e,wu),r=e[wu];try{e[wu]=void 0;var n=!0}catch{}var i=dY.call(e);return n&&(t?e[wu]=r:delete e[wu]),i}var hY=fY,mY=Object.prototype,pY=mY.toString;function gY(e){return pY.call(e)}var vY=gY,PC=rh,yY=hY,xY=vY,bY="[object Null]",wY="[object Undefined]",OC=PC?PC.toStringTag:void 0;function jY(e){return e==null?e===void 0?wY:bY:OC&&OC in Object(e)?yY(e):xY(e)}var ca=jY;function SY(e){return e!=null&&typeof e=="object"}var ua=SY,kY=ca,NY=ua,_Y="[object Symbol]";function CY(e){return typeof e=="symbol"||NY(e)&&kY(e)==_Y}var Gc=CY,AY=Er,EY=Gc,PY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OY=/^\w*$/;function TY(e,t){if(AY(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||EY(e)?!0:OY.test(e)||!PY.test(e)||t!=null&&e in Object(t)}var gS=TY;function $Y(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ms=$Y;const Kc=Le(ms);var RY=ca,IY=ms,MY="[object AsyncFunction]",DY="[object Function]",LY="[object GeneratorFunction]",FY="[object Proxy]";function BY(e){if(!IY(e))return!1;var t=RY(e);return t==DY||t==LY||t==MY||t==FY}var vS=BY;const he=Le(vS);var WY=_i,UY=WY["__core-js_shared__"],zY=UY,Cx=zY,TC=function(){var e=/[^.]+$/.exec(Cx&&Cx.keys&&Cx.keys.IE_PROTO||"");
vendor: 3,889 bytes, line 475
475return e?"Symbol(src)_1."+e:""}();function VY(e){return!!TC&&TC in e}var HY=VY,qY=Function.prototype,GY=qY.toString;function KY(e){if(e!=null){try{return GY.call(e)}catch{}try{return e+""}catch{}}return""}var r3=KY,YY=vS,XY=HY,QY=ms,JY=r3,ZY=/[\\^$.*+?()[\]{}|]/g,eX=/^\[object .+?Constructor\]$/,tX=Function.prototype,rX=Object.prototype,nX=tX.toString,iX=rX.hasOwnProperty,aX=RegExp("^"+nX.call(iX).replace(ZY,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sX(e){if(!QY(e)||XY(e))return!1;var t=YY(e)?aX:eX;return t.test(JY(e))}var oX=sX;function lX(e,t){return e==null?void 0:e[t]}var cX=lX,uX=oX,dX=cX;function fX(e,t){var r=dX(e,t);return uX(r)?r:void 0}var Po=fX,hX=Po,mX=hX(Object,"create"),Av=mX,$C=Av;function pX(){this.__data__=$C?$C(null):{},this.size=0}var gX=pX;function vX(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var yX=vX,xX=Av,bX="__lodash_hash_undefined__",wX=Object.prototype,jX=wX.hasOwnProperty;function SX(e){var t=this.__data__;if(xX){var r=t[e];return r===bX?void 0:r}return jX.call(t,e)?t[e]:void 0}var kX=SX,NX=Av,_X=Object.prototype,CX=_X.hasOwnProperty;function AX(e){var t=this.__data__;return NX?t[e]!==void 0:CX.call(t,e)}var EX=AX,PX=Av,OX="__lodash_hash_undefined__";function TX(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=PX&&t===void 0?OX:t,this}var $X=TX,RX=gX,IX=yX,MX=kX,DX=EX,LX=$X;function Yc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Yc.prototype.clear=RX;Yc.prototype.delete=IX;Yc.prototype.get=MX;Yc.prototype.has=DX;Yc.prototype.set=LX;var FX=Yc;function BX(){this.__data__=[],this.size=0}var WX=BX;function UX(e,t){return e===t||e!==e&&t!==t}var yS=UX,zX=yS;function VX(e,t){for(var r=e.length;r--;)if(zX(e[r][0],t))return r;return-1}var Ev=VX,HX=Ev,qX=Array.prototype,GX=qX.splice;function KX(e){var t=this.__data__,r=HX(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():GX.call(t,r,1),--this.size,!0}var YX=KX,XX=Ev;function QX(e){var t=this.__data__,r=XX(t,e);return r<0?void 0:t[r][1]}var JX=QX,ZX=Ev;function eQ(e){return ZX(this.__data__,e)>-1}var tQ=eQ,rQ=Ev;function nQ(e,t){var r=this.__data__,n=rQ(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var iQ=nQ,aQ=WX,sQ=YX,oQ=JX,lQ=tQ,cQ=iQ;function Xc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xc.prototype.clear=aQ;Xc.prototype.delete=sQ;Xc.prototype.get=oQ;Xc.prototype.has=lQ;Xc.prototype.set=cQ;var Pv=Xc,uQ=Po,dQ=_i,fQ=uQ(dQ,"Map"),xS=fQ,RC=FX,hQ=Pv,mQ=xS;function pQ(){this.size=0,this.__data__={hash:new RC,map:new(mQ||hQ),string:new RC}}var gQ=pQ;function vQ(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var yQ=vQ,xQ=yQ;function bQ(e,t){var r=e.__data__;return xQ(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Ov=bQ,wQ=Ov;function jQ(e){var t=wQ(this,e).delete(e);return this.size-=t?1:0,t}var SQ=jQ,kQ=Ov;function NQ(e){return kQ(this,e).get(e)}var _Q=NQ,CQ=Ov;function AQ(e){return CQ(this,e).has(e)}var EQ=AQ,PQ=Ov;function OQ(e,t){var r=PQ(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var TQ=OQ,$Q=gQ,RQ=SQ,IQ=_Q,MQ=EQ,DQ=TQ;function Qc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qc.prototype.clear=$Q;Qc.prototype.delete=RQ;Qc.prototype.get=IQ;Qc.prototype.has=MQ;Qc.prototype.set=DQ;var bS=Qc,n3=bS,LQ="Expected a function";function wS(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(LQ);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(wS.Cache||n3),r}wS.Cache=n3;var i3=wS;const FQ=Le(i3);var BQ=i3,WQ=500;function UQ(e){var t=BQ(e,function(n){return r.size===WQ&&r.clear(),n}
vendor: 6,644 bytes, lines 475-483
475),r=t.cache;return t}var zQ=UQ,VQ=zQ,HQ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qQ=/\\(\\)?/g,GQ=VQ(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(HQ,function(r,n,i,a){t.push(i?a.replace(qQ,"$1"):n||r)}),t}),KQ=GQ;function YQ(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var jS=YQ,IC=rh,XQ=jS,QQ=Er,JQ=Gc,ZQ=1/0,MC=IC?IC.prototype:void 0,DC=MC?MC.toString:void 0;function a3(e){if(typeof e=="string")return e;if(QQ(e))return XQ(e,a3)+"";if(JQ(e))return DC?DC.call(e):"";var t=e+"";return t=="0"&&1/e==-ZQ?"-0":t}var eJ=a3,tJ=eJ;function rJ(e){return e==null?"":tJ(e)}var s3=rJ,nJ=Er,iJ=gS,aJ=KQ,sJ=s3;function oJ(e,t){return nJ(e)?e:iJ(e,t)?[e]:aJ(sJ(e))}var o3=oJ,lJ=Gc,cJ=1/0;function uJ(e){if(typeof e=="string"||lJ(e))return e;var t=e+"";return t=="0"&&1/e==-cJ?"-0":t}var Tv=uJ,dJ=o3,fJ=Tv;function hJ(e,t){t=dJ(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[fJ(t[r++])];return r&&r==n?e:void 0}var SS=hJ,mJ=SS;function pJ(e,t,r){var n=e==null?void 0:mJ(e,t);return n===void 0?r:n}var l3=pJ;const zr=Le(l3);function gJ(e){return e==null}var vJ=gJ;const xe=Le(vJ);var yJ=ca,xJ=Er,bJ=ua,wJ="[object String]";function jJ(e){return typeof e=="string"||!xJ(e)&&bJ(e)&&yJ(e)==wJ}var SJ=jJ;const po=Le(SJ);var c3={exports:{}},Be={};/** 476 * @license React 477 * react-is.production.min.js 478 * 479 * Copyright (c) Facebook, Inc. and its affiliates. 480 * 481 * This source code is licensed under the MIT license found in the 482 * LICENSE file in the root directory of this source tree. 483 */var kS=Symbol.for("react.element"),NS=Symbol.for("react.portal"),$v=Symbol.for("react.fragment"),Rv=Symbol.for("react.strict_mode"),Iv=Symbol.for("react.profiler"),Mv=Symbol.for("react.provider"),Dv=Symbol.for("react.context"),kJ=Symbol.for("react.server_context"),Lv=Symbol.for("react.forward_ref"),Fv=Symbol.for("react.suspense"),Bv=Symbol.for("react.suspense_list"),Wv=Symbol.for("react.memo"),Uv=Symbol.for("react.lazy"),NJ=Symbol.for("react.offscreen"),u3;u3=Symbol.for("react.module.reference");function yn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case kS:switch(e=e.type,e){case $v:case Iv:case Rv:case Fv:case Bv:return e;default:switch(e=e&&e.$$typeof,e){case kJ:case Dv:case Lv:case Uv:case Wv:case Mv:return e;default:return t}}case NS:return t}}}Be.ContextConsumer=Dv;Be.ContextProvider=Mv;Be.Element=kS;Be.ForwardRef=Lv;Be.Fragment=$v;Be.Lazy=Uv;Be.Memo=Wv;Be.Portal=NS;Be.Profiler=Iv;Be.StrictMode=Rv;Be.Suspense=Fv;Be.SuspenseList=Bv;Be.isAsyncMode=function(){return!1};Be.isConcurrentMode=function(){return!1};Be.isContextConsumer=function(e){return yn(e)===Dv};Be.isContextProvider=function(e){return yn(e)===Mv};Be.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===kS};Be.isForwardRef=function(e){return yn(e)===Lv};Be.isFragment=function(e){return yn(e)===$v};Be.isLazy=function(e){return yn(e)===Uv};Be.isMemo=function(e){return yn(e)===Wv};Be.isPortal=function(e){return yn(e)===NS};Be.isProfiler=function(e){return yn(e)===Iv};Be.isStrictMode=function(e){return yn(e)===Rv};Be.isSuspense=function(e){return yn(e)===Fv};Be.isSuspenseList=function(e){return yn(e)===Bv};Be.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===$v||e===Iv||e===Rv||e===Fv||e===Bv||e===NJ||typeof e=="object"&&e!==null&&(e.$$typeof===Uv||e.$$typeof===Wv||e.$$typeof===Mv||e.$$typeof===Dv||e.$$typeof===Lv||e.$$typeof===u3||e.getModuleId!==void 0)};Be.typeOf=yn;c3.exports=Be;var _J=c3.exports,CJ=ca,AJ=ua,EJ="[object Number]";function PJ(e){return typeof e=="number"||AJ(e)&&CJ(e)==EJ}var d3=PJ;const OJ=Le(d3);var TJ=d3;function $J(e){return TJ(e)&&e!=+e}var RJ=$J;const Jc=Le(RJ);var or=function(t){return t===0?0:t>0?1:-1},Ws=function(t){return po(t)&&t.indexOf("%")===t.length-1},K=function(t){return OJ(t)&&!Jc(t)},IJ=function(t){return xe(t)},Et=function(t){return K(t)||po(t)},MJ=0,Oo=function(t){var r=++MJ;return"".concat(t||"").concat(r)},lr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!K(t)&&!po(t))return n;var a;if(Ws(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Jc(a)&&(a=n),i&&a>r&&(a=r),a},Pa=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},DJ=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i<r;i++)if(!n[t[i]])n[t[i]]=!0;else return!0;return!1},_t=function(t,r){return K(t)&&K(r)?function(n){return t+n*(r-t)}:function(){return r}};function Ep(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):zr(n,t))===r})}var LJ=function(t,r){return K(t)&&K(r)?t-r:po(t)&&po(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function Il(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function qb(e){"@babel/helpers - typeof";return qb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qb(e)}var FJ=["viewBox","children"],BJ=["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","colorRen
483dering","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"],LC=["points","pathLength"],Ax={svg:FJ,polygon:LC,polyline:LC},_S=["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","onDrag
483Capture","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"],Pp=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(w.isValidElement(t)&&(n=t.props),!Kc(n))return null;var i={};return Object.keys(n).forEach(function(a){_S.includes(a)&&(i[a]=r||function(o){return n[a](n,o)})}),i},WJ=function(t,r,n){return function(i){return t(r,n,i),null}},go=function(t,r,n){if(!Kc(t)||qb(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var o=t[a];_S.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=WJ(o,r,n))}),i},UJ=["children"],zJ=["children"];function FC(e,t){if(e==null)return{};var r=VJ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function VJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Gb(e){"@babel/helpers - typeof";return Gb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gb(e)}var BC={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"},qi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},WC=null,Ex=null,CS=function e(t){if(t===WC&&Array.isArray(Ex))return Ex;var r=[];return w.Children.forEach(t,function(n){xe(n)||(_J.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Ex=r,WC=t,r};function Vr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return qi(i)}):n=[qi(t)],CS(e).forEach(function(i){var a=zr(i,"type.displayName")||zr(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Mr(e,t){var r=Vr(e,t);return r&&r[0]}var UC=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!K(n)||n<=0||!K(i)||i<=0)},HJ=["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"],qJ=function(t){return t&&t.type&&po(t.type)&&HJ.indexOf(t.type)>=0},f3=function(t){return t&&Gb(t)==="object"&&"clipDot"in t},GJ=function(t,r,n,i){var a,o=(a=Ax==null?void 0:Ax[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!he(t)&&(i&&o.includes(r)||BJ.includes(r))||n&&_S.includes(r)},le=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(w.isValidElement(t)&&(i=t.props),!Kc(i))return null;var a={};
483return Object.keys(i).forEach(function(o){var l;GJ((l=i)===null||l===void 0?void 0:l[o],o,r,n)&&(a[o]=i[o])}),a},Kb=function e(t,r){if(t===r)return!0;var n=w.Children.count(t);if(n!==w.Children.count(r))return!1;if(n===0)return!0;if(n===1)return zC(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var a=t[i],o=r[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!zC(a,o))return!1}return!0},zC=function(t,r){if(xe(t)&&xe(r))return!0;if(!xe(t)&&!xe(r)){var n=t.props||{},i=n.children,a=FC(n,UJ),o=r.props||{},l=o.children,c=FC(o,zJ);return i&&l?Il(a,c)&&Kb(i,l):!i&&!l?Il(a,c):!1}return!1},VC=function(t,r){var n=[],i={};return CS(t).forEach(function(a,o){if(qJ(a))n.push(a);else if(a){var l=qi(a.type),c=r[l]||{},u=c.handler,d=c.once;if(u&&(!d||!i[l])){var f=u(a,l,o);n.push(f),i[l]=!0}}}),n},KJ=function(t){var r=t&&t.type;return r&&BC[r]?BC[r]:null},YJ=function(t,r){return CS(r).indexOf(t)},XJ=["children","width","height","viewBox","className","style","title","desc"];function Yb(){return Yb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yb.apply(this,arguments)}function QJ(e,t){if(e==null)return{};var r=JJ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function JJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Xb(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=QJ(e,XJ),d=i||{width:r,height:n,x:0,y:0},f=we("recharts-surface",a);return O.createElement("svg",Yb({},le(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),O.createElement("title",null,l),O.createElement("desc",null,c),t)}var ZJ=["children","className"];function Qb(){return Qb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qb.apply(this,arguments)}function eZ(e,t){if(e==null)return{};var r=tZ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Ae=O.forwardRef(function(e,t){var r=e.children,n=e.className,i=eZ(e,ZJ),a=we("recharts-layer",n);return O.createElement("g",Qb({className:a},le(i,!0),{ref:t}),r)}),Un=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a]};function rZ(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+t];return a}var nZ=rZ,iZ=nZ;function aZ(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:iZ(e,t,r)}var sZ=aZ,oZ="\\ud800-\\udfff",lZ="\\u0300-\\u036f",cZ="\\ufe20-\\ufe2f",uZ="\\u20d0-\\u20ff",dZ=lZ+cZ+uZ,fZ="\\ufe0e\\ufe0f",hZ="\\u200d",mZ=RegExp("["+hZ+oZ+dZ+fZ+"]");function pZ(e){return mZ.test(e)}var h3=pZ;function gZ(e){return e.split("")}var vZ=gZ,m3="\\ud800-\\udfff",yZ="\\u0300-\\u036f",xZ="\\ufe20-\\ufe2f",bZ="\\u20d0-\\u20ff",wZ=yZ+xZ+bZ,jZ="\\ufe0e\\ufe0f",SZ="["+m3+"]",Jb="["+wZ+"]",Zb="\\ud83c[\\udffb-\\udfff]",kZ="(?:"+Jb+"|"+Zb+")",p3="[^"+m3+"]",g3="(?:\\ud83c[\\udde6-\\uddff]){2}",v3="[\\ud800-\\udbff][\\udc00-\\udfff]",NZ="\\u200d",y3=kZ+"?",x3="["+jZ+"]?",_Z="(?:"+NZ+"(?:"+[p3,g3,v3].join("|")+")"+x3+y3+")*",CZ=x3+y3+_Z,AZ="(?:"+[p3+Jb+"?",Jb,g3,v3,SZ].join("|")+")",EZ=RegExp(Zb+"(?="+Zb+")|"+AZ+CZ,"g");function PZ(e){return e.match(EZ)||[]}var OZ=PZ,TZ=vZ,$Z=h3,RZ=OZ;function IZ(e){return $Z(e)?RZ(e):TZ(e)}var MZ=IZ,DZ=sZ,LZ=h3,FZ=MZ,BZ=s3;function WZ(e){return function(t){t=BZ(t);var r=LZ(t)?FZ(t):void 0,n=r?r[0]:t.charAt(0),i=r?DZ(r,1).join(""):t.slice(1);return n[e]()+i}}var UZ=WZ,zZ=UZ,VZ=zZ("toUpperCase"),HZ=VZ;const zv=Le(HZ);function Ye(e){return function(){return e}}const b3=Math.cos,Op=Math.sin,Qn=Math.sqrt,Tp=Math.PI,Vv=2*Tp,ew=Math.PI,tw=2*ew,Os=1e-6,qZ=tw-Os;function w3(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function GZ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return w3;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class KZ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?w3:GZ(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,o){this._append`C${+t},${+r},${+n}
483,${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=n-t,u=i-r,d=o-t,f=l-r,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Os)if(!(Math.abs(f*c-u*d)>Os)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let m=n-o,g=i-l,p=c*c+u*u,v=m*m+g*g,x=Math.sqrt(p),y=Math.sqrt(h),b=a*Math.tan((ew-Math.acos((p+h-v)/(2*x*y)))/2),S=b/y,j=b/x;Math.abs(S-1)>Os&&this._append`L${t+S*d},${r+S*f}`,this._append`A${a},${a},0,0,${+(f*m>d*g)},${this._x1=t+j*c},${this._y1=r+j*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),u=t+l,d=r+c,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Os||Math.abs(this._y1-d)>Os)&&this._append`L${u},${d}`,n&&(h<0&&(h=h%tw+tw),h>qZ?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:h>Os&&this._append`A${n},${n},0,${+(h>=ew)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function AS(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new KZ(t)}function ES(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function j3(e){this._context=e}j3.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Hv(e){return new j3(e)}function S3(e){return e[0]}function k3(e){return e[1]}function N3(e,t){var r=Ye(!0),n=null,i=Hv,a=null,o=AS(l);e=typeof e=="function"?e:e===void 0?S3:Ye(e),t=typeof t=="function"?t:t===void 0?k3:Ye(t);function l(c){var u,d=(c=ES(c)).length,f,h=!1,m;
483for(n==null&&(a=i(m=o())),u=0;u<=d;++u)!(u<d&&r(f=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,c),+t(f,u,c));if(m)return a=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Ye(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Ye(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Ye(!!c),l):r},l.curve=function(c){return arguments.length?(i=c,n!=null&&(a=i(n)),l):i},l.context=function(c){return arguments.length?(c==null?n=a=null:a=i(n=c),l):n},l}function rm(e,t,r){var n=null,i=Ye(!0),a=null,o=Hv,l=null,c=AS(u);e=typeof e=="function"?e:e===void 0?S3:Ye(+e),t=typeof t=="function"?t:Ye(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?k3:Ye(+r);function u(f){var h,m,g,p=(f=ES(f)).length,v,x=!1,y,b=new Array(p),S=new Array(p);for(a==null&&(l=o(y=c())),h=0;h<=p;++h){if(!(h<p&&i(v=f[h],h,f))===x)if(x=!x)m=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=m;--g)l.point(b[g],S[g]);l.lineEnd(),l.areaEnd()}x&&(b[h]=+e(v,h,f),S[h]=+t(v,h,f),l.point(n?+n(v,h,f):b[h],r?+r(v,h,f):S[h]))}if(y)return l=null,y+""||null}function d(){return N3().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ye(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Ye(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ye(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ye(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Ye(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ye(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Ye(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class _3{constructor(t,r){this._context=t,this._x=r}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(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function YZ(e){return new _3(e,!0)}function XZ(e){return new _3(e,!1)}const PS={draw(e,t){const r=Qn(t/Tp);e.moveTo(r,0),e.arc(0,0,r,0,Vv)}},QZ={draw(e,t){const r=Qn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},C3=Qn(1/3),JZ=C3*2,ZZ={draw(e,t){const r=Qn(t/JZ),n=r*C3;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},eee={draw(e,t){const r=Qn(t),n=-r/2;e.rect(n,n,r,r)}},tee=.8908130915292852,A3=Op(Tp/10)/Op(7*Tp/10),ree=Op(Vv/10)*A3,nee=-b3(Vv/10)*A3,iee={draw(e,t){const r=Qn(t*tee),n=ree*r,i=nee*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Vv*a/5,l=b3(o),c=Op(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},Px=Qn(3),aee={draw(e,t){const r=-Qn(t/(Px*3));e.moveTo(0,r*2),e.lineTo(-Px*r,-r),e.lineTo(Px*r,-r),e.closePath()}},Jr=-.5,Zr=Qn(3)/2,rw=1/Qn(12),see=(rw/2+1)*3,oee={draw(e,t){const r=Qn(t/see),n=r/2,i=r*rw,a=n,o=r*rw+r,l=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(Jr*n-Zr*i,Zr*n+Jr*i),e.lineTo(Jr*a-Zr*o,Zr*a+Jr*o),e.lineTo(Jr*l-Zr*c,Zr*l+Jr*c),e.lineTo(Jr*n+Zr*i,Jr*i-Zr*n),e.lineTo(Jr*a+Zr*o,Jr*o-Zr*a),e.lineTo(Jr*l+Zr*c,Jr*c-Zr*l),e.closePath()}};function lee(e,t){let r=null,n=AS(i);e=typeof e=="function"?e:Ye(e||PS),t=typeof t=="function"?t:Ye(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Ye(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Ye(+a),i):t}
vendor: 6,368 bytes, line 483
483,i.context=function(a){return arguments.length?(r=a??null,i):r},i}function $p(){}function Rp(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function E3(e){this._context=e}E3.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:Rp(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:Rp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cee(e){return new E3(e)}function P3(e){this._context=e}P3.prototype={areaStart:$p,areaEnd:$p,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Rp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uee(e){return new P3(e)}function O3(e){this._context=e}O3.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Rp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dee(e){return new O3(e)}function T3(e){this._context=e}T3.prototype={areaStart:$p,areaEnd:$p,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function fee(e){return new T3(e)}function HC(e){return e<0?-1:1}function qC(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(a*i+o*n)/(n+i);return(HC(a)+HC(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function GC(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ox(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,o-l*r,a,o)}function Ip(e){this._context=e}Ip.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:Ox(this,this._t0,GC(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ox(this,GC(this,r=qC(this,e,t)),r);break;default:Ox(this,this._t0,r=qC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function $3(e){this._context=new R3(e)}($3.prototype=Object.create(Ip.prototype)).point=function(e,t){Ip.prototype.point.call(this,t,e)};function R3(e){this._context=e}R3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function hee(e){return new Ip(e)}function mee(e){return new $3(e)}function I3(e){this._context=e}I3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=KC(e),i=KC(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function KC(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function pee(e){return new I3(e)}function qv(e,t){this._context=e,this._t=t}qv.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 9,185 bytes, lines 483-486
483default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function gee(e){return new qv(e,.5)}function vee(e){return new qv(e,0)}function yee(e){return new qv(e,1)}function uc(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,l=a.length;r<o;++r)for(i=a,a=e[t[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function nw(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function xee(e,t){return e[t]}function bee(e){const t=[];return t.key=e,t}function wee(){var e=Ye([]),t=nw,r=uc,n=xee;function i(a){var o=Array.from(e.apply(this,arguments),bee),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l<c;++l)(o[l][u]=[0,+n(f,o[l].key,u,a)]).data=f;for(l=0,d=ES(t(o));l<c;++l)o[d[l]].index=l;return r(o,d),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Ye(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:Ye(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?nw:typeof a=="function"?a:Ye(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??uc,i):r},i}function jee(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}uc(e,t)}}function See(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var o=0,l=0;o<i;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}uc(e,t)}}function kee(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[n][1]||0,h=d[n-1][1]||0,m=(f-h)/2,g=0;g<l;++g){var p=e[t[g]],v=p[n][1]||0,x=p[n-1][1]||0;m+=v-x}c+=f,u+=m*f}i[n-1][1]+=i[n-1][0]=r,c&&(r-=u/c)}i[n-1][1]+=i[n-1][0]=r,uc(e,t)}}function Jd(e){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jd(e)}var Nee=["type","size","sizeType"];function iw(){return iw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iw.apply(this,arguments)}function YC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function XC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YC(Object(r),!0).forEach(function(n){_ee(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _ee(e,t,r){return t=Cee(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cee(e){var t=Aee(e,"string");return Jd(t)=="symbol"?t:t+""}function Aee(e,t){if(Jd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Jd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Eee(e,t){if(e==null)return{};var r=Pee(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var M3={symbolCircle:PS,symbolCross:QZ,symbolDiamond:ZZ,symbolSquare:eee,symbolStar:iee,symbolTriangle:aee,symbolWye:oee},Oee=Math.PI/180,Tee=function(t){var r="symbol".concat(zv(t));return M3[r]||PS},$ee=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*Oee;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Ree=function(t,r){M3["symbol".concat(zv(t))]=r},OS=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,l=o===void 0?"area":o,c=Eee(t,Nee),u=XC(XC({},c),{},{type:n,size:a,sizeType:l}),d=function(){var v=Tee(n),x=lee().type(v).size($ee(a,l,n));return x()},f=u.className,h=u.cx,m=u.cy,g=le(u,!0);return h===+h&&m===+m&&a===+a?O.createElement("path",iw({},g,{className:we("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(m,")"),d:d()})):null};OS.registerSymbol=Ree;function dc(e){"@babel/helpers - typeof";return dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dc(e)}function aw(){return aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aw.apply(this,arguments)}function QC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Iee(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QC(Object(r),!0).forEach(function(n){Zd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dee(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,L3(n.key),n)}}function Lee(e,t,r){return t&&Dee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fee(e,t,r){return t=Mp(t),Bee(e,D3()?Reflect.construct(t,r||[],Mp(e).constructor):t.apply(e,r))}function Bee(e,t){if(t&&(dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wee(e)}function Wee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D3=function(){return!!e})()}function Mp(e){return Mp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mp(e)}function Uee(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sw(e,t)}function sw(e,t){return sw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sw(e,t)}function Zd(e,t,r){return t=L3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L3(e){var t=zee(e,"string");return dc(t)=="symbol"?t:t+""}function zee(e,t){if(dc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(dc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var en=32,TS=function(e){function t(){return Mee(this,t),Fee(this,t,arguments)}return Uee(t,e),Lee(t,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=en/2,o=en/6,l=en/3,c=n.inactive?i:n.color;if(n.type==="plainline")return O.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:en,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return O.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,` 484 A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,` 485 H`).concat(en,"M").concat(2*l,",").concat(a,` 486 A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return O.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(en/8,"h").concat(en,"v").concat(en*3/4,"h").concat(-en,"z"),className:"recharts-legend-icon"});if(O.isValidElement(n.legendIcon)){var u=Iee({},n);return delete u.legendIcon,O.cloneElement(n.legendIcon,u)}return O.createElement(OS,{fill:c,cx:a,cy:a,size:en,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:en,height:en}
486,f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(m,g){var p=m.formatter||c,v=we(Zd(Zd({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",m.inactive));if(m.type==="none")return null;var x=he(m.value)?null:m.value;Un(!he(m.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 y=m.inactive?u:m.color;return O.createElement("li",aw({className:v,style:f,key:"legend-item-".concat(g)},go(n.props,m,g)),O.createElement(Xb,{width:o,height:o,viewBox:d,style:h},n.renderIcon(m)),O.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},p?p(x,m,g):x))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return O.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(w.PureComponent);Zd(TS,"displayName","Legend");Zd(TS,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Vee=Pv;function Hee(){this.__data__=new Vee,this.size=0}var qee=Hee;function Gee(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Kee=Gee;function Yee(e){return this.__data__.get(e)}var Xee=Yee;function Qee(e){return this.__data__.has(e)}var Jee=Qee,Zee=Pv,ete=xS,tte=bS,rte=200;function nte(e,t){var r=this.__data__;if(r instanceof Zee){var n=r.__data__;if(!ete||n.length<rte-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new tte(n)}return r.set(e,t),this.size=r.size,this}var ite=nte,ate=Pv,ste=qee,ote=Kee,lte=Xee,cte=Jee,ute=ite;function Zc(e){var t=this.__data__=new ate(e);this.size=t.size}Zc.prototype.clear=ste;Zc.prototype.delete=ote;Zc.prototype.get=lte;Zc.prototype.has=cte;Zc.prototype.set=ute;var F3=Zc,dte="__lodash_hash_undefined__";function fte(e){return this.__data__.set(e,dte),this}var hte=fte;function mte(e){return this.__data__.has(e)}var pte=mte,gte=bS,vte=hte,yte=pte;function Dp(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new gte;++t<r;)this.add(e[t])}Dp.prototype.add=Dp.prototype.push=vte;Dp.prototype.has=yte;var B3=Dp;function xte(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var W3=xte;function bte(e,t){return e.has(t)}var U3=bte,wte=B3,jte=W3,Ste=U3,kte=1,Nte=2;function _te(e,t,r,n,i,a){var o=r&kte,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,m=r&Nte?new wte:void 0;for(a.set(e,t),a.set(t,e);++f<l;){var g=e[f],p=t[f];if(n)var v=o?n(p,g,f,t,e,a):n(g,p,f,e,t,a);if(v!==void 0){if(v)continue;h=!1;break}if(m){if(!jte(t,function(x,y){if(!Ste(m,y)&&(g===x||i(g,x,r,n,a)))return m.push(y)})){h=!1;break}}else if(!(g===p||i(g,p,r,n,a))){h=!1;break}}return a.delete(e),a.delete(t),h}var z3=_te,Cte=_i,Ate=Cte.Uint8Array,Ete=Ate;function Pte(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var Ote=Pte;function Tte(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var $S=Tte,JC=rh,ZC=Ete,$te=yS,Rte=z3,Ite=Ote,Mte=$S,Dte=1,Lte=2,Fte="[object Boolean]",Bte="[object Date]",Wte="[object Error]",Ute="[object Map]",zte="[object Number]",Vte="[object RegExp]",Hte="[object Set]",qte="[object String]",Gte="[object Symbol]",Kte="[object ArrayBuffer]",Yte="[object DataView]",eA=JC?JC.prototype:void 0,Tx=eA?eA.valueOf:void 0;function Xte(e,t,r,n,i,a,o){switch(r){case Yte:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Kte:return!(e.byteLength!=t.byteLength||!a(new ZC(e),new ZC(t)));case Fte:case Bte:case zte:return $te(+e,+t);case Wte:return e.name==t.name&&e.message==t.message;case Vte:case qte:return e==t+"";case Ute:var l=Ite;case Hte:var c=n&Dte;if(l||(l=Mte),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;n|=Lte,o.set(e,t);var d=Rte(l(e),l(t),n,i,a,o);return o.delete(e),d;case Gte:if(Tx)return Tx.call(e)==Tx.call(t)}return!1}var Qte=Xte;function Jte(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;
vendor: 5,463 bytes, line 486
486)e[i+r]=t[r];return e}var V3=Jte,Zte=V3,ere=Er;function tre(e,t,r){var n=t(e);return ere(e)?n:Zte(n,r(e))}var rre=tre;function nre(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}var ire=nre;function are(){return[]}var sre=are,ore=ire,lre=sre,cre=Object.prototype,ure=cre.propertyIsEnumerable,tA=Object.getOwnPropertySymbols,dre=tA?function(e){return e==null?[]:(e=Object(e),ore(tA(e),function(t){return ure.call(e,t)}))}:lre,fre=dre;function hre(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var mre=hre,pre=ca,gre=ua,vre="[object Arguments]";function yre(e){return gre(e)&&pre(e)==vre}var xre=yre,rA=xre,bre=ua,H3=Object.prototype,wre=H3.hasOwnProperty,jre=H3.propertyIsEnumerable,Sre=rA(function(){return arguments}())?rA:function(e){return bre(e)&&wre.call(e,"callee")&&!jre.call(e,"callee")},RS=Sre,Lp={exports:{}};function kre(){return!1}var Nre=kre;Lp.exports;(function(e,t){var r=_i,n=Nre,i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===i,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(Lp,Lp.exports);var q3=Lp.exports,_re=9007199254740991,Cre=/^(?:0|[1-9]\d*)$/;function Are(e,t){var r=typeof e;return t=t??_re,!!t&&(r=="number"||r!="symbol"&&Cre.test(e))&&e>-1&&e%1==0&&e<t}var IS=Are,Ere=9007199254740991;function Pre(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ere}var MS=Pre,Ore=ca,Tre=MS,$re=ua,Rre="[object Arguments]",Ire="[object Array]",Mre="[object Boolean]",Dre="[object Date]",Lre="[object Error]",Fre="[object Function]",Bre="[object Map]",Wre="[object Number]",Ure="[object Object]",zre="[object RegExp]",Vre="[object Set]",Hre="[object String]",qre="[object WeakMap]",Gre="[object ArrayBuffer]",Kre="[object DataView]",Yre="[object Float32Array]",Xre="[object Float64Array]",Qre="[object Int8Array]",Jre="[object Int16Array]",Zre="[object Int32Array]",ene="[object Uint8Array]",tne="[object Uint8ClampedArray]",rne="[object Uint16Array]",nne="[object Uint32Array]",et={};et[Yre]=et[Xre]=et[Qre]=et[Jre]=et[Zre]=et[ene]=et[tne]=et[rne]=et[nne]=!0;et[Rre]=et[Ire]=et[Gre]=et[Mre]=et[Kre]=et[Dre]=et[Lre]=et[Fre]=et[Bre]=et[Wre]=et[Ure]=et[zre]=et[Vre]=et[Hre]=et[qre]=!1;function ine(e){return $re(e)&&Tre(e.length)&&!!et[Ore(e)]}var ane=ine;function sne(e){return function(t){return e(t)}}var G3=sne,Fp={exports:{}};Fp.exports;(function(e,t){var r=e3,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(Fp,Fp.exports);var one=Fp.exports,lne=ane,cne=G3,nA=one,iA=nA&&nA.isTypedArray,une=iA?cne(iA):lne,K3=une,dne=mre,fne=RS,hne=Er,mne=q3,pne=IS,gne=K3,vne=Object.prototype,yne=vne.hasOwnProperty;function xne(e,t){var r=hne(e),n=!r&&fne(e),i=!r&&!n&&mne(e),a=!r&&!n&&!i&&gne(e),o=r||n||i||a,l=o?dne(e.length,String):[],c=l.length;for(var u in e)(t||yne.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||pne(u,c)))&&l.push(u);return l}var bne=xne,wne=Object.prototype;function jne(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||wne;return e===r}var Sne=jne;function kne(e,t){return function(r){return e(t(r))}}var Y3=kne,Nne=Y3,_ne=Nne(Object.keys,Object),Cne=_ne,Ane=Sne,Ene=Cne,Pne=Object.prototype,One=Pne.hasOwnProperty;function Tne(e){if(!Ane(e))return Ene(e);var t=[];for(var r in Object(e))One.call(e,r)&&r!="constructor"&&t.push(r);return t}var $ne=Tne,Rne=vS,Ine=MS;function Mne(e){return e!=null&&Ine(e.length)&&!Rne(e)}var nh=Mne,Dne=bne,Lne=$ne,Fne=nh;function Bne(e){return Fne(e)?Dne(e):Lne(e)}var Gv=Bne,Wne=rre,Une=fre,zne=Gv;function Vne(e){return Wne(e,zne,Une)}var Hne=Vne,aA=Hne,qne=1,Gne=Object.prototype,Kne=Gne.hasOwnProperty;function Yne(e,t,r,n,i,a){var o=r&qne,l=aA(e),c=l.length,u=aA(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:Kne.call(t,h)))return!1}var m=a.get(e),g=a.get(t);if(m&&g)return m==t&&g==e;var p=!0;a.set(e,t),a.set(t,e);for(var v=o;++f<c;){h=l[f];var x=e[h],y=t[h];if(n)var b=o?n(y,x,h,t,e,a):n(x,y,h,e,t,a);if(!(b===void 0?x===y||i(x,y,r,n,a):b)){p=!1;break}v||(v=h=="constructor")}if(p&&!v){var S=e.constructor,j=t.constructor;S!=j&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof j=="function"&&j instanceof j)&&(p=!1)}return a.delete(e),a.delete(t),p}var Xne=Yne,Qne=Po,Jne=_i,Zne=Qne(Jne,"DataView"),eie=Zne,tie=Po,rie=_i,nie=tie(rie,"Promise"),iie=nie,aie=Po,sie=_i,oie=aie(sie,"Set"),X3=oie,lie=Po,cie=_i,uie=lie(cie,"WeakMap"),die=uie,ow=eie,lw=xS,cw=iie,uw=X3,dw=die,Q3=ca,eu=r3,sA="[object Map]",fie="[object Object]",oA="[object Promise]",lA="[object Set]",cA="[object WeakMap]",uA="[object DataView]",hie=eu(ow),mie=eu(lw),pie=eu(cw),gie=eu(uw),vie=eu(dw),Ts=Q3;(ow&&Ts(new ow(new ArrayBuffer(1)))!=uA||lw&&Ts(new lw)!=sA||cw&&Ts(cw.resolve())!=oA||uw&&Ts(new uw)!=lA||dw&&Ts(new dw)!=cA)&&(Ts=function(e){var t=Q3(e),r=t==fie?e.constructor:void 0,n=r?eu(r):"";if(n)switch(n){case hie:return uA;case mie:return sA;case pie:return oA;case gie:return lA;case vie:return cA}return t});var yie=Ts,$x=F3,xie=z3,bie=Qte,wie=Xne,dA=yie,fA=Er,hA=q3,jie=K3,Sie=1,mA="[object Arguments]",pA="[object Array]",nm="[object Object]",kie=Object.prototype,gA=kie.hasOwnProperty;function Nie(e,t,r,n,i,a){var o=fA(e),l=fA(t),c=o?pA:dA(e),u=l?pA:dA(t);c=c==mA?nm:c,u=u==mA?nm:u;var d=c==nm,f=u==nm,h=c==u;
vendor: 4,135 bytes, line 486
486if(h&&hA(e)){if(!hA(t))return!1;o=!0,d=!1}if(h&&!d)return a||(a=new $x),o||jie(e)?xie(e,t,r,n,i,a):bie(e,t,c,r,n,i,a);if(!(r&Sie)){var m=d&&gA.call(e,"__wrapped__"),g=f&&gA.call(t,"__wrapped__");if(m||g){var p=m?e.value():e,v=g?t.value():t;return a||(a=new $x),i(p,v,r,n,a)}}return h?(a||(a=new $x),wie(e,t,r,n,i,a)):!1}var _ie=Nie,Cie=_ie,vA=ua;function J3(e,t,r,n,i){return e===t?!0:e==null||t==null||!vA(e)&&!vA(t)?e!==e&&t!==t:Cie(e,t,r,n,J3,i)}var DS=J3,Aie=F3,Eie=DS,Pie=1,Oie=2;function Tie(e,t,r,n){var i=r.length,a=i,o=!n;if(e==null)return!a;for(e=Object(e);i--;){var l=r[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=r[i];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new Aie;if(n)var h=n(u,d,c,e,t,f);if(!(h===void 0?Eie(d,u,Pie|Oie,n,f):h))return!1}}return!0}var $ie=Tie,Rie=ms;function Iie(e){return e===e&&!Rie(e)}var Z3=Iie,Mie=Z3,Die=Gv;function Lie(e){for(var t=Die(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Mie(i)]}return t}var Fie=Lie;function Bie(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var e4=Bie,Wie=$ie,Uie=Fie,zie=e4;function Vie(e){var t=Uie(e);return t.length==1&&t[0][2]?zie(t[0][0],t[0][1]):function(r){return r===e||Wie(r,e,t)}}var Hie=Vie;function qie(e,t){return e!=null&&t in Object(e)}var Gie=qie,Kie=o3,Yie=RS,Xie=Er,Qie=IS,Jie=MS,Zie=Tv;function eae(e,t,r){t=Kie(t,e);for(var n=-1,i=t.length,a=!1;++n<i;){var o=Zie(t[n]);if(!(a=e!=null&&r(e,o)))break;e=e[o]}return a||++n!=i?a:(i=e==null?0:e.length,!!i&&Jie(i)&&Qie(o,i)&&(Xie(e)||Yie(e)))}var tae=eae,rae=Gie,nae=tae;function iae(e,t){return e!=null&&nae(e,t,rae)}var aae=iae,sae=DS,oae=l3,lae=aae,cae=gS,uae=Z3,dae=e4,fae=Tv,hae=1,mae=2;function pae(e,t){return cae(e)&&uae(t)?dae(fae(e),t):function(r){var n=oae(r,e);return n===void 0&&n===t?lae(r,e):sae(t,n,hae|mae)}}var gae=pae;function vae(e){return e}var tu=vae;function yae(e){return function(t){return t==null?void 0:t[e]}}var xae=yae,bae=SS;function wae(e){return function(t){return bae(t,e)}}var jae=wae,Sae=xae,kae=jae,Nae=gS,_ae=Tv;function Cae(e){return Nae(e)?Sae(_ae(e)):kae(e)}var Aae=Cae,Eae=Hie,Pae=gae,Oae=tu,Tae=Er,$ae=Aae;function Rae(e){return typeof e=="function"?e:e==null?Oae:typeof e=="object"?Tae(e)?Pae(e[0],e[1]):Eae(e):$ae(e)}var Ci=Rae;function Iae(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var t4=Iae;function Mae(e){return e!==e}var Dae=Mae;function Lae(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var Fae=Lae,Bae=t4,Wae=Dae,Uae=Fae;function zae(e,t,r){return t===t?Uae(e,t,r):Bae(e,Wae,r)}var Vae=zae,Hae=Vae;function qae(e,t){var r=e==null?0:e.length;return!!r&&Hae(e,t,0)>-1}var Gae=qae;function Kae(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var Yae=Kae;function Xae(){}var Qae=Xae,Rx=X3,Jae=Qae,Zae=$S,ese=1/0,tse=Rx&&1/Zae(new Rx([,-0]))[1]==ese?function(e){return new Rx(e)}:Jae,rse=tse,nse=B3,ise=Gae,ase=Yae,sse=U3,ose=rse,lse=$S,cse=200;function use(e,t,r){var n=-1,i=ise,a=e.length,o=!0,l=[],c=l;if(r)o=!1,i=ase;else if(a>=cse){var u=t?null:ose(e);if(u)return lse(u);o=!1,i=sse,c=new nse}else c=t?[]:l;e:for(;++n<a;){var d=e[n],f=t?t(d):d;if(d=r||d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else i(c,f,r)||(c!==l&&c.push(f),l.push(d))}return l}var dse=use,fse=Ci,hse=dse;function mse(e,t){return e&&e.length?hse(e,fse(t)):[]}var pse=mse;const yA=Le(pse);function r4(e,t,r){return t===!0?yA(e,r):he(t)?yA(e,t):e}function fc(e){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(e)}var gse=["ref"];function xA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 4,101 bytes, line 486
486t%2?xA(Object(r),!0).forEach(function(n){Kv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i4(n.key),n)}}function yse(e,t,r){return t&&bA(e.prototype,t),r&&bA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xse(e,t,r){return t=Bp(t),bse(e,n4()?Reflect.construct(t,r||[],Bp(e).constructor):t.apply(e,r))}function bse(e,t){if(t&&(fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wse(e)}function wse(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(n4=function(){return!!e})()}function Bp(e){return Bp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bp(e)}function jse(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fw(e,t)}function fw(e,t){return fw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fw(e,t)}function Kv(e,t,r){return t=i4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i4(e){var t=Sse(e,"string");return fc(t)=="symbol"?t:t+""}function Sse(e,t){if(fc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kse(e,t){if(e==null)return{};var r=Nse(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Nse(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _se(e){return e.value}function Cse(e,t){if(O.isValidElement(e))return O.cloneElement(e,t);if(typeof e=="function")return O.createElement(e,t);t.ref;var r=kse(t,gse);return O.createElement(TS,r)}var wA=1,dn=function(e){function t(){var r;vse(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=xse(this,t,[].concat(i)),Kv(r,"lastBoundingBox",{width:-1,height:-1}),r}return jse(t,e),yse(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>wA||Math.abs(i.height-this.lastBoundingBox.height)>wA)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Pi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHe
486ight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var m=this.getBBoxSnapshot();f={left:((u||0)-m.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();h={top:((d||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Pi(Pi({},f),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,f=Pi(Pi({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return O.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(m){n.wrapperNode=m}},Cse(a,Pi(Pi({},this.props),{},{payload:r4(d,u,_se)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Pi(Pi({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&K(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(w.PureComponent);Kv(dn,"displayName","Legend");Kv(dn,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var jA=rh,Ase=RS,Ese=Er,SA=jA?jA.isConcatSpreadable:void 0;function Pse(e){return Ese(e)||Ase(e)||!!(SA&&e&&e[SA])}var Ose=Pse,Tse=V3,$se=Ose;function a4(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=$se),i||(i=[]);++a<o;){var l=e[a];t>0&&r(l)?t>1?a4(l,t-1,r,n,i):Tse(i,l):n||(i[i.length]=l)}return i}var s4=a4;function Rse(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),l=o.length;l--;){var c=o[e?l:++i];if(r(a[c],c,a)===!1)break}return t}}var Ise=Rse,Mse=Ise,Dse=Mse(),Lse=Dse,Fse=Lse,Bse=Gv;function Wse(e,t){return e&&Fse(e,t,Bse)}var o4=Wse,Use=nh;function zse(e,t){return function(r,n){if(r==null)return r;if(!Use(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++a<i)&&n(o[a],a,o)!==!1;);return r}}var Vse=zse,Hse=o4,qse=Vse,Gse=qse(Hse),LS=Gse,Kse=LS,Yse=nh;function Xse(e,t){var r=-1,n=Yse(e)?Array(e.length):[];return Kse(e,function(i,a,o){n[++r]=t(i,a,o)}),n}var l4=Xse;function Qse(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var Jse=Qse,kA=Gc;function Zse(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,a=kA(e),o=t!==void 0,l=t===null,c=t===t,u=kA(t);if(!l&&!u&&!a&&e>t||a&&o&&c&&!l&&!u||n&&o&&c||!r&&c||!i)return 1;if(!n&&!a&&!u&&e<t||u&&r&&i&&!n&&!a||l&&r&&i||!o&&i||!c)return-1}return 0}var eoe=Zse,toe=eoe;function roe(e,t,r){for(var n=-1,i=e.criteria,a=t.criteria,o=i.length,l=r.length;++n<o;){var c=toe(i[n],a[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var noe=roe,Ix=jS,ioe=SS,aoe=Ci,soe=l4,ooe=Jse,loe=G3,coe=noe,uoe=tu,doe=Er;function foe(e,t,r){t.length?t=Ix(t,function(a){return doe(a)?function(o){return ioe(o,a.length===1?a[0]:a)}:a}):t=[uoe];var n=-1;t=Ix(t,loe(aoe));var i=soe(e,function(a,o,l){var c=Ix(t,function(u){return u(a)});return{criteria:c,index:++n,value:a}});return ooe(i,function(a,o){return coe(a,o,r)})}var hoe=foe;function moe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var poe=moe,goe=poe,NA=Math.max;function voe(e,t,r){return t=NA(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=NA(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(o),goe(e,this,l)}}var yoe=voe;function xoe(e){return function(){return e}}var boe=xoe,woe=Po,joe=function(){try{var e=woe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),c4=joe,Soe=boe,_A=c4,koe=tu,Noe=_A?function(e,t){return _A(e,"toString",{configurable:!0,enumerable:!1,value:Soe(t),writable:!0})}:koe,_oe=Noe,Coe=800,Aoe=16,Eoe=Date.now;function Poe(e){var t=0,r=0;return function(){var n=Eoe(),i=Aoe-(n-r);if(r=n,i>0){if(++t>=Coe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ooe=Poe,Toe=_oe,$oe=Ooe,Roe=$oe(Toe),Ioe=Roe,Moe=tu,Doe=yoe,Loe=Ioe;function Foe(e,t){return Loe(Doe(e,t,Moe),e+"")}var Boe=Foe,Woe=yS,Uoe=nh,zoe=IS,Voe=ms;function Hoe(e,t,r){if(!Voe(r))return!1;var n=typeof t;return(n=="number"?Uoe(r)&&zoe(t,r.length):n=="string"&&t in r)?Woe(r[t],e):!1}var Yv=Hoe,qoe=s4,Goe=hoe,Koe=Boe,CA=Yv,Yoe=Koe(function(e,t){if(e==null)return[];var r=t.length;return r>1&&CA(e,t[0],t[1])?t=[]:r>2&&CA(t[0],t[1],t[2])&&(t=[t[0]]),Goe(e,qoe(t,1),[])}),Xoe=Yoe;const FS=Le(Xoe);function ef(e){"@babel/helpers - typeof";return ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ef(e)}function hw(){return hw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 10,893 bytes, lines 486-487
486for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hw.apply(this,arguments)}function Qoe(e,t){return tle(e)||ele(e,t)||Zoe(e,t)||Joe()}function Joe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 487In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zoe(e,t){if(e){if(typeof e=="string")return AA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AA(e,t)}}function AA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ele(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function tle(e){if(Array.isArray(e))return e}function EA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?EA(Object(r),!0).forEach(function(n){rle(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rle(e,t,r){return t=nle(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nle(e){var t=ile(e,"string");return ef(t)=="symbol"?t:t+""}function ile(e,t){if(ef(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ef(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ale(e){return Array.isArray(e)&&Et(e[0])&&Et(e[1])?e.join(" ~ "):e}var sle=function(t){var r=t.separator,n=r===void 0?" : ":r,i=t.contentStyle,a=i===void 0?{}:i,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,m=t.wrapperClassName,g=t.labelClassName,p=t.label,v=t.labelFormatter,x=t.accessibilityLayer,y=x===void 0?!1:x,b=function(){if(d&&d.length){var A={padding:0,margin:0},R=(h?FS(d,h):d).map(function($,D){if($.type==="none")return null;var M=Mx({display:"block",paddingTop:4,paddingBottom:4,color:$.color||"#000"},l),I=$.formatter||f||ale,T=$.value,L=$.name,B=T,H=L;if(I&&B!=null&&H!=null){var z=I(T,L,$,D,d);if(Array.isArray(z)){var q=Qoe(z,2);B=q[0],H=q[1]}else B=z}return O.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:M},Et(H)?O.createElement("span",{className:"recharts-tooltip-item-name"},H):null,Et(H)?O.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,O.createElement("span",{className:"recharts-tooltip-item-value"},B),O.createElement("span",{className:"recharts-tooltip-item-unit"},$.unit||""))});return O.createElement("ul",{className:"recharts-tooltip-item-list",style:A},R)}return null},S=Mx({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),j=Mx({margin:0},u),N=!xe(p),k=N?p:"",_=we("recharts-default-tooltip",m),C=we("recharts-tooltip-label",g);N&&v&&d!==void 0&&d!==null&&(k=v(p,d));var P=y?{role:"status","aria-live":"assertive"}:{};return O.createElement("div",hw({className:_,style:S},P),O.createElement("p",{className:C,style:j},O.isValidElement(k)?k:"".concat(k)),b())};function tf(e){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(e)}function im(e,t,r){return t=ole(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ole(e){var t=lle(e,"string");return tf(t)=="symbol"?t:t+""}function lle(e,t){if(tf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(tf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ju="recharts-tooltip-wrapper",cle={visibility:"hidden"};function ule(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return we(ju,im(im(im(im({},"".concat(ju,"-right"),K(r)&&t&&K(t.x)&&r>=t.x),"".concat(ju,"-left"),K(r)&&t&&K(t.x)&&r<t.x),"".concat(ju,"-bottom"),K(n)&&t&&K(t.y)&&n>=t.y),"".concat(ju,"-top"),K(n)&&t&&K(t.y)&&n<t.y))}function PA(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&K(a[n]))return a[n];var d=r[n]-l-i,f=r[n]+i;if(t[n])return o[n]?d:f;if(o[n]){var h=d,m=c[n];return h<m?Math.max(f,c[n]):Math.max(d,c[n])}var g=f+l,p=c[n]+u;return g>p?Math.max(d,c[n]):Math.max(f,c[n])}function dle(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function fle(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&r?(d=PA({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=PA({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=dle({translateX:d,translateY:f,useTranslate3d:l})):u=cle,{cssProperties:u,cssClasses:ule({translateX:d,translateY:f,coordinate:r})}}function hc(e){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hc(e)}function OA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function TA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OA(Object(r),!0).forEach(function(n){pw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mle(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d4(n.key),n)}}function ple(e,t,r){return t&&mle(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gle(e,t,r){return t=Wp(t),vle(e,u4()?Reflect.construct(t,r||[],Wp(e).constructor):t.apply(e,r))}function vle(e,t){if(t&&(hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yle(e)}function yle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u4=function(){return!!e})()}function Wp(e){return Wp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wp(e)}function xle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mw(e,t)}function mw(e,t){return mw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mw(e,t)}function pw(e,t,r){return t=d4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d4(e){var t=ble(e,"string");return hc(t)=="symbol"?t:t+""}function ble(e,t){if(hc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(hc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $A=1,wle=function(e){function t(){var r;hle(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=gle(this,t,[].concat(i)),pw(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),pw(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return xle(t,e),ple(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>$A||Math.abs(n.height-this.state.lastBoundingBox.height)>$A)&&this.setState({lastBoundingBox:{width:n.width,height:n.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 n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.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 n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,m=i.offset,g=i.position,p=i.reverseDirection,v=i.useTranslate3d,x=i.viewBox,y=i.wrapperStyle,b=fle({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:m,position:g,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:x}
487),S=b.cssClasses,j=b.cssProperties,N=TA(TA({transition:h&&a?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return O.createElement("div",{tabIndex:-1,className:S,style:N,ref:function(_){n.wrapperNode=_}},u)}}])}(w.PureComponent),jle=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},zn={isSsr:jle(),get:function(t){return zn[t]},set:function(t,r){if(typeof t=="string")zn[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){zn[i]=t[i]})}}};function mc(e){"@babel/helpers - typeof";return mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(e)}function RA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function IA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RA(Object(r),!0).forEach(function(n){BS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kle(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h4(n.key),n)}}function Nle(e,t,r){return t&&kle(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _le(e,t,r){return t=Up(t),Cle(e,f4()?Reflect.construct(t,r||[],Up(e).constructor):t.apply(e,r))}function Cle(e,t){if(t&&(mc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ale(e)}function Ale(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f4=function(){return!!e})()}function Up(e){return Up=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Up(e)}function Ele(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gw(e,t)}function gw(e,t){return gw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gw(e,t)}function BS(e,t,r){return t=h4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h4(e){var t=Ple(e,"string");return mc(t)=="symbol"?t:t+""}function Ple(e,t){if(mc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(mc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ole(e){return e.dataKey}function Tle(e,t){return O.isValidElement(e)?O.cloneElement(e,t):typeof e=="function"?O.createElement(e,t):O.createElement(sle,t)}var mt=function(e){function t(){return Sle(this,t),_le(this,t,arguments)}return Ele(t,e),Nle(t,[{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,f=i.filterNull,h=i.isAnimationActive,m=i.offset,g=i.payload,p=i.payloadUniqBy,v=i.position,x=i.reverseDirection,y=i.useTranslate3d,b=i.viewBox,S=i.wrapperStyle,j=g??[];f&&j.length&&(j=r4(g.filter(function(k){return k.value!=null&&(k.hide!==!0||n.props.includeHidden)}),p,Ole));var N=j.length>0;return O.createElement(wle,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:N,offset:m,position:v,reverseDirection:x,useTranslate3d:y,viewBox:b,wrapperStyle:S},Tle(u,IA(IA({},this.props),{},{payload:j})))}}])}(w.PureComponent);BS(mt,"displayName","Tooltip");BS(mt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!zn.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 $le=_i,Rle=function(){return $le.Date.now()},Ile=Rle,Mle=/\s/;function Dle(e){for(var t=e.length;t--&&Mle.test(e.charAt(t)););return t}var Lle=Dle,Fle=Lle,Ble=/^\s+/;
vendor: 1,209 bytes, line 487
487function Wle(e){return e&&e.slice(0,Fle(e)+1).replace(Ble,"")}var Ule=Wle,zle=Ule,MA=ms,Vle=Gc,DA=NaN,Hle=/^[-+]0x[0-9a-f]+$/i,qle=/^0b[01]+$/i,Gle=/^0o[0-7]+$/i,Kle=parseInt;function Yle(e){if(typeof e=="number")return e;if(Vle(e))return DA;if(MA(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=MA(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=zle(e);var r=qle.test(e);return r||Gle.test(e)?Kle(e.slice(2),r?2:8):Hle.test(e)?DA:+e}var m4=Yle,Xle=ms,Dx=Ile,LA=m4,Qle="Expected a function",Jle=Math.max,Zle=Math.min;function ece(e,t,r){var n,i,a,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Qle);t=LA(t)||0,Xle(r)&&(d=!!r.leading,f="maxWait"in r,a=f?Jle(LA(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function m(N){var k=n,_=i;return n=i=void 0,u=N,o=e.apply(_,k),o}function g(N){return u=N,l=setTimeout(x,t),d?m(N):o}function p(N){var k=N-c,_=N-u,C=t-k;return f?Zle(C,a-_):C}function v(N){var k=N-c,_=N-u;return c===void 0||k>=t||k<0||f&&_>=a}function x(){var N=Dx();if(v(N))return y(N);l=setTimeout(x,p(N))}function y(N){return l=void 0,h&&n?m(N):(n=i=void 0,o)}function b(){l!==void 0&&clearTimeout(l),u=0,n=c=i=l=void 0}function S(){return l===void 0?o:y(Dx())}
vendor: 16,452 bytes, lines 487-494
487function j(){var N=Dx(),k=v(N);if(n=arguments,i=this,c=N,k){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(x,t),m(c)}return l===void 0&&(l=setTimeout(x,t)),o}return j.cancel=b,j.flush=S,j}var tce=ece,rce=tce,nce=ms,ice="Expected a function";function ace(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(ice);return nce(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),rce(e,t,{leading:n,maxWait:t,trailing:i})}var sce=ace;const p4=Le(sce);function rf(e){"@babel/helpers - typeof";return rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rf(e)}function FA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function am(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FA(Object(r),!0).forEach(function(n){oce(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oce(e,t,r){return t=lce(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lce(e){var t=cce(e,"string");return rf(t)=="symbol"?t:t+""}function cce(e,t){if(rf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(rf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uce(e,t){return mce(e)||hce(e,t)||fce(e,t)||dce()}function dce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 488In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fce(e,t){if(e){if(typeof e=="string")return BA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BA(e,t)}}function BA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hce(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function mce(e){if(Array.isArray(e))return e}var fn=w.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,i=n===void 0?{width:-1,height:-1}:n,a=e.width,o=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,m=e.children,g=e.debounce,p=g===void 0?0:g,v=e.id,x=e.className,y=e.onResize,b=e.style,S=b===void 0?{}:b,j=w.useRef(null),N=w.useRef();N.current=y,w.useImperativeHandle(t,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var k=w.useState({containerWidth:i.width,containerHeight:i.height}),_=uce(k,2),C=_[0],P=_[1],E=w.useCallback(function(R,$){P(function(D){var M=Math.round(R),I=Math.round($);return D.containerWidth===M&&D.containerHeight===I?D:{containerWidth:M,containerHeight:I}})},[]);w.useEffect(function(){var R=function(L){var B,H=L[0].contentRect,z=H.width,q=H.height;E(z,q),(B=N.current)===null||B===void 0||B.call(N,z,q)};p>0&&(R=p4(R,p,{trailing:!0,leading:!1}));var $=new ResizeObserver(R),D=j.current.getBoundingClientRect(),M=D.width,I=D.height;return E(M,I),$.observe(j.current),function(){$.disconnect()}},[E,p]);var A=w.useMemo(function(){var R=C.containerWidth,$=C.containerHeight;if(R<0||$<0)return null;Un(Ws(o)||Ws(c),`The width(%s) and height(%s) are both fixed numbers, 489 maybe you don't need to use a ResponsiveContainer.`,o,c),Un(!r||r>0,"The aspect(%s) must be greater than zero.",r);var D=Ws(o)?R:o,M=Ws(c)?$:c;r&&r>0&&(D?M=D/r:M&&(D=M*r),h&&M>h&&(M=h)),Un(D>0||M>0,`The width(%s) and height(%s) of chart should be greater than 0, 490 please check the style of container, or the props width(%s) and height(%s), 491 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 492 height and width.`,D,M,o,c,d,f,r);var I=!Array.isArray(m)&&qi(m.type).endsWith("Chart");return O.Children.map(m,function(T){return O.isValidElement(T)?w.cloneElement(T,am({width:D,height:M},I?{style:am({height:"100%",width:"100%",maxHeight:M,maxWidth:D},T.props.style)}:{})):T})},[r,m,c,h,f,d,C,o]);return O.createElement("div",{id:v?"".concat(v):void 0,className:we("recharts-responsive-container",x),style:am(am({},S),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:j},A)}),To=function(t){return null};To.displayName="Cell";function nf(e){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(e)}function WA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WA(Object(r),!0).forEach(function(n){pce(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pce(e,t,r){return t=gce(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gce(e){var t=vce(e,"string");return nf(t)=="symbol"?t:t+""}function vce(e,t){if(nf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(nf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yo={widthCache:{},cacheCount:0},yce=2e3,xce={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},UA="recharts_measurement_span";function bce(e){var t=vw({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var fd=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||zn.isSsr)return{width:0,height:0};var n=bce(r),i=JSON.stringify({text:t,copyStyle:n});if(Yo.widthCache[i])return Yo.widthCache[i];try{var a=document.getElementById(UA);a||(a=document.createElement("span"),a.setAttribute("id",UA),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=vw(vw({},xce),n);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Yo.widthCache[i]=c,++Yo.cacheCount>yce&&(Yo.cacheCount=0,Yo.widthCache={}),c}catch{return{width:0,height:0}}},wce=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function af(e){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},af(e)}function zp(e,t){return Nce(e)||kce(e,t)||Sce(e,t)||jce()}function jce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 493In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sce(e,t){if(e){if(typeof e=="string")return zA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zA(e,t)}}function zA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kce(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Nce(e){if(Array.isArray(e))return e}function _ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ace(n.key),n)}}function Cce(e,t,r){return t&&VA(e.prototype,t),r&&VA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ace(e){var t=Ece(e,"string");return af(t)=="symbol"?t:t+""}function Ece(e,t){if(af(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(af(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var HA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,qA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Pce=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Oce=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,g4={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Tce=Object.keys(g4),bl="NaN";function $ce(e,t){return e*g4[t]}var sm=function(){function e(t,r){_ce(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!Pce.test(r)&&(this.num=NaN,this.unit=""),Tce.includes(r)&&(this.num=$ce(t,r),this.unit="px")}return Cce(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.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(r){var n,i=(n=Oce.exec(r))!==null&&n!==void 0?n:[],a=zp(i,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function v4(e){if(e.includes(bl))return bl;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=HA.exec(t))!==null&&r!==void 0?r:[],i=zp(n,4),a=i[1],o=i[2],l=i[3],c=sm.parse(a??""),u=sm.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return bl;t=t.replace(HA,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=qA.exec(t))!==null&&f!==void 0?f:[],m=zp(h,4),g=m[1],p=m[2],v=m[3],x=sm.parse(g??""),y=sm.parse(v??""),b=p==="+"?x.add(y):x.subtract(y);if(b.isNaN())return bl;t=t.replace(qA,b.toString())}return t}var GA=/\(([^()]*)\)/;function Rce(e){for(var t=e;t.includes("(");){var r=GA.exec(t),n=zp(r,2),i=n[1];t=t.replace(GA,v4(i))}return t}function Ice(e){var t=e.replace(/\s+/g,"");return t=Rce(t),t=v4(t),t}function Mce(e){try{return Ice(e)}catch{return bl}}function Lx(e){var t=Mce(e.slice(5,-1));return t===bl?"":t}var Dce=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Lce=["dx","dy","angle","className","breakAll"];function yw(){return yw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yw.apply(this,arguments)}function KA(e,t){if(e==null)return{};var r=Fce(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function YA(e,t){return zce(e)||Uce(e,t)||Wce(e,t)||Bce()}function Bce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 494In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wce(e,t){if(e){if(typeof e=="string")return XA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XA(e,t)}}function XA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Uce(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function zce(e){if(Array.isArray(e))return e}var y4=/[ \f\n\r\t\v\u2028\u2029]+/,x4=function(t){var r=t.children,n=t.breakAll,i=t.style;try{var a=[];xe(r)||(n?a=r.toString().split(""):a=r.toString().split(y4));var o=a.map(function(c){return{word:c,width:fd(c,i).width}}),l=n?0:fd(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},Vce=function(t,r,n,i,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=K(o),f=l,h=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return D.reduce(function(M,I){var T=I.word,L=I.width,B=M[M.length-1];if(B&&(i==null||a||B.width+L+n<Number(i)))B.words.push(T),B.width+=L+n;else{var H={words:[T],width:L};M.push(H)}return M},[])},m=h(r),g=function(D){return D.reduce(function(M,I){return M.width>I.width?M:I})};if(!d)return m;for(var p="â¦",v=function(D){var M=f.slice(0,D),I=x4({breakAll:u,style:c,children:M+p}).wordsWithComputedWidth,T=h(I),L=T.length>o||g(T).width>Number(i);return[L,T]},x=0,y=f.length-1,b=0,S;x<=y&&b<=f.length-1;){var j=Math.floor((x+y)/2),N=j-1,k=v(N),_=YA(k,2),C=_[0],P=_[1],E=v(j),A=YA(E,1),R=A[0];if(!C&&!R&&(x=j+1),C&&R&&(y=j-1),!C&&R){S=P;break}b++}return S||m},QA=function(t){var r=xe(t)?[]:t.toString().split(y4);return[{words:r}]},Hce=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!zn.isSsr){var c,u,d=x4({breakAll:o,children:i,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return QA(i);return Vce({breakAll:o,children:i,maxLines:l,style:a},c,u,r,n)}return QA(i)},JA="#808080",vo=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,m=h===void 0?"start":h,g=t.verticalAnchor,p=g===void 0?"end":g,v=t.fill,x=v===void 0?JA:v,y=KA(t,Dce),b=w.useMemo(function(){return Hce({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),S=y.dx,j=y.dy,N=y.angle,k=y.className,_=y.breakAll,C=KA(y,Lce);if(!Et(n)||!Et(a))return null;var P=n+(K(S)?S:0),E=a+(K(j)?j:0),A;switch(p){case"start":A=Lx("calc(".concat(u,")"));break;case"middle":A=Lx("calc(".concat((b.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:A=Lx("calc(".concat(b.length-1," * -").concat(l,")"));break}var R=[];if(f){var $=b[0].width,D=y.width;R.push("scale(".concat((K(D)?D/$:1)/$,")"))}return N&&R.push("rotate(".concat(N,", ").concat(P,", ").concat(E,")")),R.length&&(C.transform=R.join(" ")),O.createElement("text",yw({},le(C,!0),{x:P,y:E,className:we("recharts-text",k),textAnchor:m,fill:x.includes("url")?JA:x}),b.map(function(M,I){var T=M.words.join(_?"":" ");return O.createElement("tspan",{x:P,dy:I===0?A:l,key:"".concat(T,"-").concat(I
494)},T)}))};function rs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qce(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function WS(e){let t,r,n;e.length!==2?(t=rs,r=(l,c)=>rs(e(l),c),n=(l,c)=>e(l)-c):(t=e===rs||e===qce?e:Gce,r=e,n=e);function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=i(l,c,u,d-1);return f>u&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:i,center:o,right:a}}function Gce(){return 0}function b4(e){return e===null?NaN:+e}function*Kce(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Yce=WS(rs),ih=Yce.right;WS(b4).center;class ZA extends Map{constructor(t,r=Jce){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(eE(this,t))}has(t){return super.has(eE(this,t))}set(t,r){return super.set(Xce(this,t),r)}delete(t){return super.delete(Qce(this,t))}}function eE({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function Xce({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Qce({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Jce(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Zce(e=rs){if(e===rs)return w4;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function w4(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const eue=Math.sqrt(50),tue=Math.sqrt(10),rue=Math.sqrt(2);function Vp(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=eue?10:a>=tue?5:a>=rue?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?Vp(e,t,r*2):[l,c,u]}function xw(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,o]=n?Vp(t,e,r):Vp(e,t,r);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(n)if(o<0)for(let u=0;u<l;++u)c[u]=(a-u)/-o;else for(let u=0;u<l;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(i+u)/-o;else for(let u=0;u<l;++u)c[u]=(i+u)*o;return c}function bw(e,t,r){return t=+t,e=+e,r=+r,Vp(e,t,r)[2]}function ww(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?bw(t,e,r):bw(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function tE(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function rE(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function j4(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?w4:Zce(i);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),m=Math.max(r,Math.floor(t-u*f/c+h)),g=Math.min(n,Math.floor(t+(c-u)*f/c+h));j4(e,t,m,g,i)}const a=e[t];let o=r,l=n;for(Su(e,r,t),i(e[n],a)>0&&Su(e,r,n);o<l;){for(Su(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[r],a)===0?Su(e,r,l):(++l,Su(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Su(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function nue(e,t,r){if(e=Float64Array.from(Kce(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return rE(e);if(t>=1)return tE(e);var n,i=(n-1)*t,a=Math.floor(i),o=tE(j4(e,a).subarray(0,a+1)),l=rE(e.subarray(a+1));return o+(l-o)*(i-a)}}function iue(e,t,r=b4){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),l=+r(e[a+1],a+1,e);return o+(l-o)*(i-a)}}function aue(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}function xn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function da(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}
vendor: 5,794 bytes, line 494
494const jw=Symbol("implicit");function US(){var e=new ZA,t=[],r=[],n=jw;function i(a){let o=e.get(a);if(o===void 0){if(n!==jw)return n;e.set(a,o=t.push(a)-1)}return r[o%r.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new ZA;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return US(t,r).unknown(n)},xn.apply(i,arguments),i}function sf(){var e=US().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,m=i<n,g=m?i:n,p=m?n:i;a=(p-g)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),g+=(p-g-a*(h-c))*d,o=a*(1-c),l&&(g=Math.round(g),o=Math.round(o));var v=aue(h).map(function(x){return g+a*x});return r(m?v.reverse():v)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,i]=h,n=+n,i=+i,f()):[n,i]},e.rangeRound=function(h){return[n,i]=h,n=+n,i=+i,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return sf(t(),[n,i]).round(l).paddingInner(c).paddingOuter(u).align(d)},xn.apply(f(),arguments)}function S4(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return S4(t())},e}function hd(){return S4(sf.apply(null,arguments).paddingInner(1))}function zS(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function k4(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function ah(){}var of=.7,Hp=1/of,Ml="\\s*([+-]?\\d+)\\s*",lf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sue=/^#([0-9a-f]{3,8})$/,oue=new RegExp(`^rgb\\(${Ml},${Ml},${Ml}\\)$`),lue=new RegExp(`^rgb\\(${vi},${vi},${vi}\\)$`),cue=new RegExp(`^rgba\\(${Ml},${Ml},${Ml},${lf}\\)$`),uue=new RegExp(`^rgba\\(${vi},${vi},${vi},${lf}\\)$`),due=new RegExp(`^hsl\\(${lf},${vi},${vi}\\)$`),fue=new RegExp(`^hsla\\(${lf},${vi},${vi},${lf}\\)$`),nE={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};zS(ah,cf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:iE,formatHex:iE,formatHex8:hue,formatHsl:mue,formatRgb:aE,toString:aE});function iE(){return this.rgb().formatHex()}function hue(){return this.rgb().formatHex8()}function mue(){return N4(this).formatHsl()}function aE(){return this.rgb().formatRgb()}function cf(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=sue.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?sE(t):r===3?new Nr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?om(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?om(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>
vendor: 15,339 bytes, line 494
4944&15|t&240,((t&15)<<4|t&15)/255):null):(t=oue.exec(e))?new Nr(t[1],t[2],t[3],1):(t=lue.exec(e))?new Nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cue.exec(e))?om(t[1],t[2],t[3],t[4]):(t=uue.exec(e))?om(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=due.exec(e))?cE(t[1],t[2]/100,t[3]/100,1):(t=fue.exec(e))?cE(t[1],t[2]/100,t[3]/100,t[4]):nE.hasOwnProperty(e)?sE(nE[e]):e==="transparent"?new Nr(NaN,NaN,NaN,0):null}function sE(e){return new Nr(e>>16&255,e>>8&255,e&255,1)}function om(e,t,r,n){return n<=0&&(e=t=r=NaN),new Nr(e,t,r,n)}function pue(e){return e instanceof ah||(e=cf(e)),e?(e=e.rgb(),new Nr(e.r,e.g,e.b,e.opacity)):new Nr}function Sw(e,t,r,n){return arguments.length===1?pue(e):new Nr(e,t,r,n??1)}function Nr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}zS(Nr,Sw,k4(ah,{brighter(e){return e=e==null?Hp:Math.pow(Hp,e),new Nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?of:Math.pow(of,e),new Nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nr(no(this.r),no(this.g),no(this.b),qp(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:oE,formatHex:oE,formatHex8:gue,formatRgb:lE,toString:lE}));function oE(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}`}function gue(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}${Us((isNaN(this.opacity)?1:this.opacity)*255)}`}function lE(){const e=qp(this.opacity);return`${e===1?"rgb(":"rgba("}${no(this.r)}, ${no(this.g)}, ${no(this.b)}${e===1?")":`, ${e})`}`}function qp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function no(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Us(e){return e=no(e),(e<16?"0":"")+e.toString(16)}function cE(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ln(e,t,r,n)}function N4(e){if(e instanceof Ln)return new Ln(e.h,e.s,e.l,e.opacity);if(e instanceof ah||(e=cf(e)),!e)return new Ln;if(e instanceof Ln)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,l=a-i,c=(a+i)/2;return l?(t===a?o=(r-n)/l+(r<n)*6:r===a?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?a+i:2-a-i,o*=60):l=c>0&&c<1?0:o,new Ln(o,l,c,e.opacity)}function vue(e,t,r,n){return arguments.length===1?N4(e):new Ln(e,t,r,n??1)}function Ln(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}zS(Ln,vue,k4(ah,{brighter(e){return e=e==null?Hp:Math.pow(Hp,e),new Ln(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?of:Math.pow(of,e),new Ln(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Nr(Fx(e>=240?e-240:e+120,i,n),Fx(e,i,n),Fx(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Ln(uE(this.h),lm(this.s),lm(this.l),qp(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 e=qp(this.opacity);return`${e===1?"hsl(":"hsla("}${uE(this.h)}, ${lm(this.s)*100}%, ${lm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function uE(e){return e=(e||0)%360,e<0?e+360:e}function lm(e){return Math.max(0,Math.min(1,e||0))}function Fx(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const VS=e=>()=>e;function yue(e,t){return function(r){return e+r*t}}function xue(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function bue(e){return(e=+e)==1?_4:function(t,r){return r-t?xue(t,r,e):VS(isNaN(t)?r:t)}}function _4(e,t){var r=t-e;return r?yue(e,r):VS(isNaN(e)?t:e)}const dE=function e(t){var r=bue(t);function n(i,a){var o=r((i=Sw(i)).r,(a=Sw(a)).r),l=r(i.g,a.g),c=r(i.b,a.b),u=_4(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return n.gamma=e,n}(1);function wue(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function jue(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Sue(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=ru(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(l){for(o=0;o<n;++o)a[o]=i[o](l);return a}}function kue(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Gp(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Nue(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=ru(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var kw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Bx=new RegExp(kw.source,"g");function _ue(e){return function(){return e}}function Cue(e){return function(t){return e(t)+""}}function Aue(e,t){var r=kw.lastIndex=Bx.lastIndex=0,n,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=kw.exec(e))&&(i=Bx.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),l[o]?l[o]+=a:l[++o]=a),(n=n[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:Gp(n,i)})),r=Bx.lastIndex;return r<t.length&&(a=t.slice(r),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?Cue(c[0].x):_ue(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function ru(e,t){var r=typeof t,n;return t==null||r==="boolean"?VS(t):(r==="number"?Gp:r==="string"?(n=cf(t))?(t=n,dE):Aue:t instanceof cf?dE:t instanceof Date?kue:jue(t)?wue:Array.isArray(t)?Sue:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Nue:Gp)(e,t)}function HS(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function Eue(e,t){t===void 0&&(t=e,e=ru);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[l](o-l)}}function Pue(e){return function(){return e}}function Kp(e){return+e}var fE=[0,1];function cr(e){return e}function Nw(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Pue(isNaN(t)?NaN:.5)}function Oue(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Tue(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i<n?(n=Nw(i,n),a=r(o,a)):(n=Nw(n,i),a=r(a,o)),function(l){return a(n(l))}}function $ue(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=Nw(e[o],e[o+1]),a[o]=r(t[o],t[o+1]);return function(l){var c=ih(e,l,1,n)-1;return a[c](i[c](l))}}function sh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Xv(){var e=fE,t=fE,r=ru,n,i,a,o=cr,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==cr&&(o=Oue(e[0],e[h-1])),l=h>2?$ue:Tue,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(n),t,r)))(n(o(h)))}return f.invert=function(h){return o(i((u||(u=l(t,e.map(n),Gp)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Kp),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=HS,d()},f.clamp=function(h){return arguments.length?(o=h?!0:cr,d()):o!==cr},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,m){return n=h,i=m,d()}}function qS(){return Xv()(cr,cr)}function Rue(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Yp(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function pc(e){return e=Yp(Math.abs(e)),e?e[1]:NaN}function Iue(e,t){return function(r,n){for(var i=r.length,a=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),a.push(r.substring(i-=l,i+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Mue(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Due=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function uf(e){if(!(t=Due.exec(e)))throw new Error("invalid format: "+e);var t;return new GS({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}uf.prototype=GS.prototype;function GS(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}GS.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 Lue(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var C4;function Fue(e,t){var r=Yp(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(C4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Yp(e,Math.max(0,t+a-1))[0]}function hE(e,t){var r=Yp(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const mE={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Rue,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>hE(e*100,t),r:hE,s:Fue,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function pE(e){return e}var gE=Array.prototype.map,vE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Bue(e){var t=e.grouping===void 0||e.thousands===void 0?pE:Iue(gE.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?pE:Mue(gE.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"â":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=uf(f);var h=f.fill,m=f.align,g=f.sign,p=f.symbol,v=f.zero,x=f.width,y=f.comma,b=f.precision,S=f.trim,j=f.type;j==="n"?(y=!0,j="g"):mE[j]||(b===void 0&&(b=12),S=!0,j="g"),(v||h==="0"&&m==="=")&&(v=!0,h="0",m="=");var N=p==="$"?r:p==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():"",k=p==="$"?n:/[%p]/.test(j)?o:"",_=mE[j],C=/[defgprs%]/.test(j);b=b===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function P(E){var A=N,R=k,$,D,M;if(j==="c")R=_(E)+R,E="";else{E=+E;var I=E<0||1/E<0;if(E=isNaN(E)?c:_(Math.abs(E),b),S&&(E=Lue(E)),I&&+E==0&&g!=="+"&&(I=!1),A=(I?g==="("?g:l:g==="-"||g==="("?"":g)+A,R=(j==="s"?vE[8+C4/3]:"")+R+(I&&g==="("?")":""),C){for($=-1,D=E.length;++$<D;)if(M=E.charCodeAt($),48>M||M>57){R=(M===46?i+E.slice($+1):E.slice($))+R,E=E.slice(0,$);break}}}y&&!v&&(E=t(E,1/0));var T=A.length+E.length+R.length,L=T<x?new Array(x-T+1).join(h):"";switch(y&&v&&(E=t(L+E,L.length?x-R.length:1/0),L=""),m){case"<":E=A+E+R+L;break;case"=":E=A+L+E+R;break;case"^":E=L.slice(0,T=L.length>>1)+A+E+R+L.slice(T);break;default:E=L+A+E+R;break}return a(E)}return P.toString=function(){return f+""},P}function d(f,h){var m=u((f=uf(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(pc(h)/3)))*3,p=Math.pow(10,-g),v=vE[8+g/3];return function(x){return m(p*x)+v}}return{format:u,formatPrefix:d}}var cm,KS,A4;Wue({thousands:",",grouping:[3],currency:["$",""]});function Wue(e){return cm=Bue(e),KS=cm.format,A4=cm.formatPrefix,cm}function Uue(e){return Math.max(0,-pc(Math.abs(e)))}function zue(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(pc(t)/3)))*3-pc(Math.abs(e)))}function Vue(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,pc(t)-pc(e))+1}function E4(e,t,r,n){var i=ww(e,t,r),a;switch(n=uf(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=zue(i,o))&&(n.precision=a),A4(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Vue(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Uue(i))&&(n.precision=a-(n.type==="%")*2);break}}return KS(n)}function ps(e){var t=e.domain;return e.ticks=function(r){var n=t();return xw(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return E4(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],l=n[a],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=i,i=a,a=u);d-- >0;){if(u=bw(o,l,r),u===c)return n[i]=o,n[a]=l,t(n);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function Xp(){var e=qS();return e.copy=function(){return sh(e,Xp())},xn.apply(e,arguments),ps(e)}function P4(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Kp),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return P4(e).unknown(t)},e=arguments.length?Array.from(e,Kp):[0,1],ps(r)}function O4(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return a<i&&(o=r,r=n,n=o,o=i,i=a,a=o),e[r]=t.floor(i),e[n]=t.ceil(a),e}function yE(e){return Math.log(e)}function xE(e){return Math.exp(e)}function Hue(e){return-Math.log(-e)}function que(e){return-Math.exp(-e)}function Gue(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Kue(e){return e===10?Gue:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Yue(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function bE(e){return(t,r)=>-e(-t,r)}function YS(e){const t=e(yE,xE),r=t.domain;let n=10,i,a;function o(){return i=Yue(n),a=Kue(n),r()[0]<0?(i=bE(i),a=bE(a),e(Hue,que)):e(yE,xE),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=i(u),m=i(d),g,p;const v=l==null?10:+l;let x=[];if(!(n%1)&&m-h<v){if(h=Math.floor(h),m=Math.ceil(m),u>0){for(;h<=m;++h)for(g=1;g<n;++g)if(p=h<0?g/a(-h):g*a(h),!(p<u)){if(p>d)break;x.push(p)}}else for(;h<=m;++h)for(g=n-1;g>=1;--g)if(p=h>0?g/a(-h):g*a(h),!(p<u)){if(p>d)break;x.push(p)}x.length*2<v&&(x=xw(u,d,v))}else x=xw(h,m,Math.min(m-h,v)).map(a);return f?x.reverse():x},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=uf(c)).precision==null&&(c.trim=!0),c=KS(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/a(Math.round(i(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(O4(r(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function T4(){const e=YS(Xv()).domain([1,10]);return e.copy=()=>sh(e,T4()).base(e.base()),xn.apply(e,arguments),e}
494function wE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function jE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function XS(e){var t=1,r=e(wE(t),jE(t));return r.constant=function(n){return arguments.length?e(wE(t=+n),jE(t)):t},ps(r)}function $4(){var e=XS(Xv());return e.copy=function(){return sh(e,$4()).constant(e.constant())},xn.apply(e,arguments)}function SE(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Xue(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Que(e){return e<0?-e*e:e*e}function QS(e){var t=e(cr,cr),r=1;function n(){return r===1?e(cr,cr):r===.5?e(Xue,Que):e(SE(r),SE(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},ps(t)}function JS(){var e=QS(Xv());return e.copy=function(){return sh(e,JS()).exponent(e.exponent())},xn.apply(e,arguments),e}function Jue(){return JS.apply(null,arguments).exponent(.5)}function kE(e){return Math.sign(e)*e*e}function Zue(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function R4(){var e=qS(),t=[0,1],r=!1,n;function i(a){var o=Zue(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(kE(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Kp)).map(kE)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return R4(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},xn.apply(i,arguments),ps(i)}function I4(){var e=[],t=[],r=[],n;function i(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=iue(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?n:t[ih(r,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(rs),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return I4().domain(e).range(t).unknown(n)},xn.apply(a,arguments)}function M4(){var e=0,t=1,r=1,n=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[ih(n,c,0,r)]:a}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return M4().domain([e,t]).range(i).unknown(a)},xn.apply(ps(o),arguments)}function D4(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[ih(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return D4().domain(e).range(t).unknown(r)},xn.apply(i,arguments)}const Wx=new Date,Ux=new Date;function Ot(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o<l-a?o:l},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},i.filter=a=>Ot(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Wx.setTime(+a),Ux.setTime(+o),e(Wx),e(Ux),Math.floor(r(Wx,Ux))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Qp=Ot(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Qp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ot(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Qp);Qp.range;const Bi=1e3,cn=Bi*60,Wi=cn*60,ea=Wi*24,ZS=ea*7,NE=ea*30,zx=ea*365,zs=Ot(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Bi)},(e,t)=>(t-e)/Bi,e=>e.getUTCSeconds());zs.range;const ek=Ot(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Bi)},(e,t)=>{e.setTime(+e+t*cn)},(e,t)=>(t-e)/cn,e=>e.getMinutes());ek.range;const tk=Ot(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*cn)},(e,t)=>(t-e)/cn,e=>e.getUTCMinutes());tk.range;const rk=Ot(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Bi-e.getMinutes()*cn)},(e,t)=>{e.setTime(+e+t*Wi)},(e,t)=>(t-e)/Wi,e=>e.getHours());rk.range;const nk=Ot(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Wi)},(e,t)=>(t-e)/Wi,e=>e.getUTCHours());nk.range;const oh=Ot(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*cn)/ea,e=>e.getDate()-1);oh.range;const Qv=Ot(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ea,e=>e.getUTCDate()-1);Qv.range;const L4=Ot(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ea,e=>Math.floor(e/ea));L4.range;function $o(e){return Ot(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*cn)/ZS)}const Jv=$o(0),Jp=$o(1),ede=$o(2),tde=$o(3),gc=$o(4),rde=$o(5),nde=$o(6);Jv.range;Jp.range;ede.range;tde.range;gc.range;rde.range;nde.range;function Ro(e){return Ot(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ZS)}const Zv=Ro(0),Zp=Ro(1),ide=Ro(2),ade=Ro(3),vc=Ro(4),sde=Ro(5),ode=Ro(6);Zv.range;Zp.range;ide.range;ade.range;vc.range;sde.range;ode.range;const ik=Ot(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ik.range;const ak=Ot(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ak.range;const ta=Ot(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ta.every=e=>
vendor: 6,552 bytes, line 494
494!isFinite(e=Math.floor(e))||!(e>0)?null:Ot(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});ta.range;const ra=Ot(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ra.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ot(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ra.range;function F4(e,t,r,n,i,a){const o=[[zs,1,Bi],[zs,5,5*Bi],[zs,15,15*Bi],[zs,30,30*Bi],[a,1,cn],[a,5,5*cn],[a,15,15*cn],[a,30,30*cn],[i,1,Wi],[i,3,3*Wi],[i,6,6*Wi],[i,12,12*Wi],[n,1,ea],[n,2,2*ea],[r,1,ZS],[t,1,NE],[t,3,3*NE],[e,1,zx]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const m=f&&typeof f.range=="function"?f:c(u,d,f),g=m?m.range(u,+d+1):[];return h?g.reverse():g}function c(u,d,f){const h=Math.abs(d-u)/f,m=WS(([,,v])=>v).right(o,h);if(m===o.length)return e.every(ww(u/zx,d/zx,f));if(m===0)return Qp.every(Math.max(ww(u,d,f),1));const[g,p]=o[h/o[m-1][2]<o[m][2]/h?m-1:m];return g.every(p)}return[l,c]}const[lde,cde]=F4(ra,ak,Zv,L4,nk,tk),[ude,dde]=F4(ta,ik,Jv,oh,rk,ek);function Vx(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Hx(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ku(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function fde(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=Nu(i),d=_u(i),f=Nu(a),h=_u(a),m=Nu(o),g=_u(o),p=Nu(l),v=_u(l),x=Nu(c),y=_u(c),b={a:I,A:T,b:L,B,c:null,d:OE,e:OE,f:Ide,g:Hde,G:Gde,H:Tde,I:$de,j:Rde,L:B4,m:Mde,M:Dde,p:H,q:z,Q:RE,s:IE,S:Lde,u:Fde,U:Bde,V:Wde,w:Ude,W:zde,x:null,X:null,y:Vde,Y:qde,Z:Kde,"%":$E},S={a:q,A:te,b:ve,B:Pe,c:null,d:TE,e:TE,f:Jde,g:lfe,G:ufe,H:Yde,I:Xde,j:Qde,L:U4,m:Zde,M:efe,p:Q,q:je,Q:RE,s:IE,S:tfe,u:rfe,U:nfe,V:ife,w:afe,W:sfe,x:null,X:null,y:ofe,Y:cfe,Z:dfe,"%":$E},j={a:P,A:E,b:A,B:R,c:$,d:EE,e:EE,f:Ade,g:AE,G:CE,H:PE,I:PE,j:kde,L:Cde,m:Sde,M:Nde,p:C,q:jde,Q:Pde,s:Ode,S:_de,u:vde,U:yde,V:xde,w:gde,W:bde,x:D,X:M,y:AE,Y:CE,Z:wde,"%":Ede};b.x=N(r,b),b.X=N(n,b),b.c=N(t,b),S.x=N(r,S),S.X=N(n,S),S.c=N(t,S);function N(G,ee){return function(Z){var U=[],Ce=-1,ye=0,He=G.length,We,ct,gr;for(Z instanceof Date||(Z=new Date(+Z));++Ce<He;)G.charCodeAt(Ce)===37&&(U.push(G.slice(ye,Ce)),(ct=_E[We=G.charAt(++Ce)])!=null?We=G.charAt(++Ce):ct=We==="e"?" ":"0",(gr=ee[We])&&(We=gr(Z,ct)),U.push(We),ye=Ce+1);return U.push(G.slice(ye,Ce)),U.join("")}}function k(G,ee){return function(Z){var U=ku(1900,void 0,1),Ce=_(U,G,Z+="",0),ye,He;if(Ce!=Z.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(ee&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(ye=Hx(ku(U.y,0,1)),He=ye.getUTCDay(),ye=He>4||He===0?Zp.ceil(ye):Zp(ye),ye=Qv.offset(ye,(U.V-1)*7),U.y=ye.getUTCFullYear(),U.m=ye.getUTCMonth(),U.d=ye.getUTCDate()+(U.w+6)%7):(ye=Vx(ku(U.y,0,1)),He=ye.getDay(),ye=He>4||He===0?Jp.ceil(ye):Jp(ye),ye=oh.offset(ye,(U.V-1)*7),U.y=ye.getFullYear(),U.m=ye.getMonth(),U.d=ye.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),He="Z"in U?Hx(ku(U.y,0,1)).getUTCDay():Vx(ku(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(He+5)%7:U.w+U.U*7-(He+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,Hx(U)):Vx(U)}}function _(G,ee,Z,U){for(var Ce=0,ye=ee.length,He=Z.length,We,ct;Ce<ye;){if(U>=He)return-1;if(We=ee.charCodeAt(Ce++),We===37){if(We=ee.charAt(Ce++),ct=j[We in _E?ee.charAt(Ce++):We],!ct||(U=ct(G,Z,U))<0)return-1}else if(We!=Z.charCodeAt(U++))return-1}return U}function C(G,ee,Z){var U=u.exec(ee.slice(Z));return U?(G.p=d.get(U[0].toLowerCase()),Z+U[0].length):-1}function P(G,ee,Z){var U=m.exec(ee.slice(Z));return U?(G.w=g.get(U[0].toLowerCase()),Z+U[0].length):-1}function E(G,ee,Z){var U=f.exec(ee.slice(Z));return U?(G.w=h.get(U[0].toLowerCase()),Z+U[0].length):-1}function A(G,ee,Z){var U=x.exec(ee.slice(Z));return U?(G.m=y.get(U[0].toLowerCase()),Z+U[0].length):-1}function R(G,ee,Z){var U=p.exec(ee.slice(Z));return U?(G.m=v.get(U[0].toLowerCase()),Z+U[0].length):-1}function $(G,ee,Z){return _(G,t,ee,Z)}function D(G,ee,Z){return _(G,r,ee,Z)}function M(G,ee,Z){return _(G,n,ee,Z)}function I(G){return o[G.getDay()]}function T(G){return a[G.getDay()]}function L(G){return c[G.getMonth()]}function B(G){return l[G.getMonth()]}function H(G){return i[+(G.getHours()>=12)]}function z(G){return 1+~~(G.getMonth()/3)}function q(G){return o[G.getUTCDay()]}function te(G){return a[G.getUTCDay()]}function ve(G){return c[G.getUTCMonth()]}function Pe(G){return l[G.getUTCMonth()]}function Q(G){return i[+(G.getUTCHours()>=12)]}function je(G){return 1+~~(G.getUTCMonth()/3)}return{format:function(G){var ee=N(G+="",b);return ee.toString=function(){return G},ee},parse:function(G){var ee=k(G+="",!1);return ee.toString=function(){return G},ee},utcFormat:function(G){var ee=N(G+="",S);return ee.toString=function(){return G},ee},utcParse:function(G){var ee=k(G+="",!0);return ee.toString=function(){return G},ee}}}var _E={"-":"",_:" ",0:"0"},Mt=/^\s*\d+/,hde=/^%/,mde=/[\\^$*+?|[\]().{}]/g;function Re(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function pde(e){return e.replace(mde,"\\$&")}function Nu(e){return new RegExp("^(?:"+e.map(pde).join("|")+")","i")}function _u(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function gde(e,t,r){var n=Mt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function vde(e,t,r){var n=Mt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function yde(e,t,r){var n=Mt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function xde(e,t,r){var n=Mt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function bde(e,t,r){var n=Mt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function CE(e,t,r){var n=Mt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function AE(e,t,r){var n=Mt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function wde(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}
vendor: 5,083 bytes, line 494
494function jde(e,t,r){var n=Mt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Sde(e,t,r){var n=Mt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function EE(e,t,r){var n=Mt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function kde(e,t,r){var n=Mt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function PE(e,t,r){var n=Mt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Nde(e,t,r){var n=Mt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function _de(e,t,r){var n=Mt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Cde(e,t,r){var n=Mt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Ade(e,t,r){var n=Mt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ede(e,t,r){var n=hde.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Pde(e,t,r){var n=Mt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Ode(e,t,r){var n=Mt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function OE(e,t){return Re(e.getDate(),t,2)}function Tde(e,t){return Re(e.getHours(),t,2)}function $de(e,t){return Re(e.getHours()%12||12,t,2)}function Rde(e,t){return Re(1+oh.count(ta(e),e),t,3)}function B4(e,t){return Re(e.getMilliseconds(),t,3)}function Ide(e,t){return B4(e,t)+"000"}function Mde(e,t){return Re(e.getMonth()+1,t,2)}function Dde(e,t){return Re(e.getMinutes(),t,2)}function Lde(e,t){return Re(e.getSeconds(),t,2)}function Fde(e){var t=e.getDay();return t===0?7:t}function Bde(e,t){return Re(Jv.count(ta(e)-1,e),t,2)}function W4(e){var t=e.getDay();return t>=4||t===0?gc(e):gc.ceil(e)}function Wde(e,t){return e=W4(e),Re(gc.count(ta(e),e)+(ta(e).getDay()===4),t,2)}function Ude(e){return e.getDay()}function zde(e,t){return Re(Jp.count(ta(e)-1,e),t,2)}function Vde(e,t){return Re(e.getFullYear()%100,t,2)}function Hde(e,t){return e=W4(e),Re(e.getFullYear()%100,t,2)}function qde(e,t){return Re(e.getFullYear()%1e4,t,4)}function Gde(e,t){var r=e.getDay();return e=r>=4||r===0?gc(e):gc.ceil(e),Re(e.getFullYear()%1e4,t,4)}function Kde(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Re(t/60|0,"0",2)+Re(t%60,"0",2)}function TE(e,t){return Re(e.getUTCDate(),t,2)}function Yde(e,t){return Re(e.getUTCHours(),t,2)}function Xde(e,t){return Re(e.getUTCHours()%12||12,t,2)}function Qde(e,t){return Re(1+Qv.count(ra(e),e),t,3)}function U4(e,t){return Re(e.getUTCMilliseconds(),t,3)}function Jde(e,t){return U4(e,t)+"000"}function Zde(e,t){return Re(e.getUTCMonth()+1,t,2)}function efe(e,t){return Re(e.getUTCMinutes(),t,2)}function tfe(e,t){return Re(e.getUTCSeconds(),t,2)}function rfe(e){var t=e.getUTCDay();return t===0?7:t}function nfe(e,t){return Re(Zv.count(ra(e)-1,e),t,2)}function z4(e){var t=e.getUTCDay();return t>=4||t===0?vc(e):vc.ceil(e)}function ife(e,t){return e=z4(e),Re(vc.count(ra(e),e)+(ra(e).getUTCDay()===4),t,2)}function afe(e){return e.getUTCDay()}function sfe(e,t){return Re(Zp.count(ra(e)-1,e),t,2)}function ofe(e,t){return Re(e.getUTCFullYear()%100,t,2)}function lfe(e,t){return e=z4(e),Re(e.getUTCFullYear()%100,t,2)}function cfe(e,t){return Re(e.getUTCFullYear()%1e4,t,4)}function ufe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?vc(e):vc.ceil(e),Re(e.getUTCFullYear()%1e4,t,4)}function dfe(){return"+0000"}function $E(){return"%"}function RE(e){return+e}function IE(e){return Math.floor(+e/1e3)}var Xo,V4,H4;ffe({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 ffe(e){return Xo=fde(e),V4=Xo.format,Xo.parse,H4=Xo.utcFormat,Xo.utcParse,Xo}function hfe(e){return new Date(e)}function mfe(e){return e instanceof Date?+e:+new Date(+e)}function sk(e,t,r,n,i,a,o,l,c,u){var d=qS(),f=d.invert,h=d.domain,m=u(".%L"),g=u(":%S"),p=u("%I:%M"),v=u("%I %p"),x=u("%a %d"),y=u("%b %d"),b=u("%B"),S=u("%Y");function j(N){return(c(N)<N?m:l(N)<N?g:o(N)<N?p:a(N)<N?v:n(N)<N?i(N)<N?x:y:r(N)<N?b:S)(N)}return d.invert=function(N){return new Date(f(N))},d.domain=function(N){return arguments.length?h(Array.from(N,mfe)):h().map(hfe)},d.ticks=function(N){var k=h();return e(k[0],k[k.length-1],N??10)},d.tickFormat=function(N,k){return k==null?j:u(k)},d.nice=function(N){var k=h();return(!N||typeof N.range!="function")&&(N=t(k[0],k[k.length-1],N??10)),N?h(O4(k,N)):d},d.copy=function(){return sh(d,sk(e,t,r,n,i,a,o,l,c,u))},d}function pfe(){return xn.apply(sk(ude,dde,ta,ik,Jv,oh,rk,ek,zs,V4).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gfe(){return xn.apply(sk(lde,cde,ra,ak,Zv,Qv,nk,tk,zs,H4).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ey(){var e=0,t=1,r,n,i,a,o=cr,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(i===0?.5:(f=(a(f)-r)*i,l?Math.max(0,Math.min(1,f)):f))}
vendor: 67,067 bytes, lines 494-521
494u.domain=function(f){return arguments.length?([e,t]=f,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(h){var m,g;return arguments.length?([m,g]=h,o=f(m,g),u):[o(0),o(1)]}}return u.range=d(ru),u.rangeRound=d(HS),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,r=f(e),n=f(t),i=r===n?0:1/(n-r),u}}function gs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function q4(){var e=ps(ey()(cr));return e.copy=function(){return gs(e,q4())},da.apply(e,arguments)}function G4(){var e=YS(ey()).domain([1,10]);return e.copy=function(){return gs(e,G4()).base(e.base())},da.apply(e,arguments)}function K4(){var e=XS(ey());return e.copy=function(){return gs(e,K4()).constant(e.constant())},da.apply(e,arguments)}function ok(){var e=QS(ey());return e.copy=function(){return gs(e,ok()).exponent(e.exponent())},da.apply(e,arguments)}function vfe(){return ok.apply(null,arguments).exponent(.5)}function Y4(){var e=[],t=cr;function r(n){if(n!=null&&!isNaN(n=+n))return t((ih(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(rs),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>nue(e,a/n))},r.copy=function(){return Y4(t).domain(e)},da.apply(r,arguments)}function ty(){var e=0,t=.5,r=1,n=1,i,a,o,l,c,u=cr,d,f=!1,h;function m(p){return isNaN(p=+p)?h:(p=.5+((p=+d(p))-a)*(n*p<n*a?l:c),u(f?Math.max(0,Math.min(1,p)):p))}m.domain=function(p){return arguments.length?([e,t,r]=p,i=d(e=+e),a=d(t=+t),o=d(r=+r),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),n=a<i?-1:1,m):[e,t,r]},m.clamp=function(p){return arguments.length?(f=!!p,m):f},m.interpolator=function(p){return arguments.length?(u=p,m):u};function g(p){return function(v){var x,y,b;return arguments.length?([x,y,b]=v,u=Eue(p,[x,y,b]),m):[u(0),u(.5),u(1)]}}return m.range=g(ru),m.rangeRound=g(HS),m.unknown=function(p){return arguments.length?(h=p,m):h},function(p){return d=p,i=p(e),a=p(t),o=p(r),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),n=a<i?-1:1,m}}function X4(){var e=ps(ty()(cr));return e.copy=function(){return gs(e,X4())},da.apply(e,arguments)}function Q4(){var e=YS(ty()).domain([.1,1,10]);return e.copy=function(){return gs(e,Q4()).base(e.base())},da.apply(e,arguments)}function J4(){var e=XS(ty());return e.copy=function(){return gs(e,J4()).constant(e.constant())},da.apply(e,arguments)}function lk(){var e=QS(ty());return e.copy=function(){return gs(e,lk()).exponent(e.exponent())},da.apply(e,arguments)}function yfe(){return lk.apply(null,arguments).exponent(.5)}const ME=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:sf,scaleDiverging:X4,scaleDivergingLog:Q4,scaleDivergingPow:lk,scaleDivergingSqrt:yfe,scaleDivergingSymlog:J4,scaleIdentity:P4,scaleImplicit:jw,scaleLinear:Xp,scaleLog:T4,scaleOrdinal:US,scalePoint:hd,scalePow:JS,scaleQuantile:I4,scaleQuantize:M4,scaleRadial:R4,scaleSequential:q4,scaleSequentialLog:G4,scaleSequentialPow:ok,scaleSequentialQuantile:Y4,scaleSequentialSqrt:vfe,scaleSequentialSymlog:K4,scaleSqrt:Jue,scaleSymlog:$4,scaleThreshold:D4,scaleTime:pfe,scaleUtc:gfe,tickFormat:E4},Symbol.toStringTag,{value:"Module"}));var xfe=Gc;function bfe(e,t,r){for(var n=-1,i=e.length;++n<i;){var a=e[n],o=t(a);if(o!=null&&(l===void 0?o===o&&!xfe(o):r(o,l)))var l=o,c=a}return c}var ry=bfe;function wfe(e,t){return e>t}var Z4=wfe,jfe=ry,Sfe=Z4,kfe=tu;function Nfe(e){return e&&e.length?jfe(e,kfe,Sfe):void 0}var _fe=Nfe;const za=Le(_fe);function Cfe(e,t){return e<t}var eD=Cfe,Afe=ry,Efe=eD,Pfe=tu;function Ofe(e){return e&&e.length?Afe(e,Pfe,Efe):void 0}var Tfe=Ofe;const ny=Le(Tfe);var $fe=jS,Rfe=Ci,Ife=l4,Mfe=Er;function Dfe(e,t){var r=Mfe(e)?$fe:Ife;return r(e,Rfe(t))}var Lfe=Dfe,Ffe=s4,Bfe=Lfe;function Wfe(e,t){return Ffe(Bfe(e,t),1)}var Ufe=Wfe;const zfe=Le(Ufe);var Vfe=DS;function Hfe(e,t){return Vfe(e,t)}var qfe=Hfe;const yo=Le(qfe);var nu=1e9,Gfe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},uk,at=!0,pn="[DecimalError] ",io=pn+"Invalid argument: ",ck=pn+"Exponent out of range: ",iu=Math.floor,$s=Math.pow,Kfe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Fr,Tt=1e7,tt=7,tD=9007199254740991,eg=iu(tD/tt),ie={};ie.absoluteValue=ie.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ie.comparedTo=ie.cmp=function(e){var t,r,n,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};ie.decimalPlaces=ie.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*tt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};ie.dividedBy=ie.div=function(e){return Gi(this,new this.constructor(e))};ie.dividedToIntegerBy=ie.idiv=function(e){var t=this,r=t.constructor;return qe(Gi(t,new r(e),0,1),r.precision)};ie.equals=ie.eq=function(e){return!this.cmp(e)};ie.exponent=function(){return jt(this)};ie.greaterThan=ie.gt=function(e){return this.cmp(e)>0};ie.greaterThanOrEqualTo=ie.gte=function(e){return this.cmp(e)>=0};ie.isInteger=ie.isint=function(){return this.e>this.d.length-2};ie.isNegative=ie.isneg=function(){return this.s<0};ie.isPositive=ie.ispos=function(){return this.s>0};ie.isZero=function(){return this.s===0};ie.lessThan=ie.lt=function(e){return this.cmp(e)<0};ie.lessThanOrEqualTo=ie.lte=function(e){return this.cmp(e)<1};ie.logarithm=ie.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Fr))throw Error(pn+"NaN");if(r.s<1)throw Error(pn+(r.s?"NaN":"-Infinity"));return r.eq(Fr)?new n(0):(at=!1,t=Gi(df(r,a),df(e,a),a),at=!0,qe(t,i))};ie.minus=ie.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?iD(t,e):rD(t,(e.s=-e.s,e))};ie.modulo=ie.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(pn+"NaN");return r.s?(at=!1,t=Gi(r,e,0,1).times(e),at=!0,r.minus(t)):qe(new n(r),i)};ie.naturalExponential=ie.exp=function(){return nD(this)};ie.naturalLogarithm=ie.ln=function(){return df(this)};ie.negated=ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ie.plus=ie.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rD(t,e):iD(t,(e.s=-e.s,e))};ie.precision=ie.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(io+e);if(t=jt(i)+1,n=i.d.length-1,r=n*tt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};ie.squareRoot=ie.sqrt=function(){var e,t,r,n,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(pn+"NaN")}for(e=jt(l),at=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=ui(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=iu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(Gi(l,a,o+2)).times(.5),ui(a.d).slice(0,o)===(t=ui(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(qe(a,r+1,0),a.times(a).eq(l)){n=a;break}}else if(t!="9999")break;o+=4}return at=!0,qe(n,r)};ie.times=ie.mul=function(e){var t,r,n,i,a,o,l,c,u,d=this,f=d.constructor,h=d.d,m=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=m.length,c<u&&(a=h,h=m,m=a,o=c,c=u,u=o),a=[],o=c+u,n=o;n--;)a.push(0);for(n=u;--n>=0;){for(t=0,i=c+n;i>n;)l=a[i]+m[n]*h[i-n-1]+t,a[i--]=l%Tt|0,t=l/Tt|0;a[i]=(a[i]+t)%Tt|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,at?qe(e,f.precision):e};ie.toDecimalPlaces=ie.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Si(e,0,nu),t===void 0?t=n.rounding:Si(t,0,8),qe(r,e+jt(r)+1,t))};ie.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xo(n,!0):(Si(e,0,nu),t===void 0?t=i.rounding:Si(t,0,8),n=qe(new i(n),e+1,t),r=xo(n,!0,e+1)),r};ie.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?xo(i):(Si(e,0,nu),t===void 0?t=a.rounding:Si(t,0,8),n=qe(new a(i),e+jt(i)+1,t),r=xo(n.abs(),!1,e+jt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};ie.toInteger=ie.toint=function(){var e=this,t=e.constructor;return qe(new t(e),jt(e)+1,t.rounding)};ie.toNumber=function(){return+this};ie.toPower=ie.pow=function(e){var t,r,n,i,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Fr);if(l=new c(l),!l.s){if(e.s<1)throw Error(pn+"Infinity");return l}if(l.eq(Fr))return l;if(n=c.precision,e.eq(Fr))return qe(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=l.s,o){if((r=d<0?-d:d)<=tD){for(i=new c(Fr),t=Math.ceil(n/tt+4),at=!1;r%2&&(i=i.times(l),LE(i.d,t)),r=iu(r/2),r!==0;)l=l.times(l),LE(l.d,t);return at=!0,e.s<0?new c(Fr).div(i):qe(i,n)}}else if(a<0)throw Error(pn+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,at=!1,i=e.times(df(l,n+u)),at=!0,i=nD(i),i.s=a,i};ie.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=jt(i),n=xo(i,r<=a.toExpNeg||r>=a.toExpPos)):(Si(e,1,nu),t===void 0?t=a.rounding:Si(t,0,8),i=qe(new a(i),e,t),r=jt(i),n=xo(i,e<=r||r<=a.toExpNeg,e)),n};ie.toSignificantDigits=ie.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Si(e,1,nu),t===void 0?t=n.rounding:Si(t,0,8)),qe(new n(r),e,t)};ie.toString=ie.valueOf=ie.val=ie.toJSON=ie[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=jt(e),r=e.constructor;return xo(e,t<=r.toExpNeg||t>=r.toExpPos)};function rD(e,t){var r,n,i,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),at?qe(t,f):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,l=u.length):(n=u,i=o,l=c.length),o=Math.ceil(f/tt),l=o>l?o+1:l+1,a>l&&(a=l,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,n=u,u=c,c=n),r=0;a;)r=(c[--a]=c[a]+u[a]+r)/Tt|0,c[a]%=Tt;for(r&&(c.unshift(r),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,at?qe(t,f):t}function Si(e,t,r){if(e!==~~e||e<t||e>r)throw Error(io+e)}function ui(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)n=e[t]+"",r=tt-n.length,r&&(a+=Na(r)),a+=n;o=e[t],n=o+"",r=tt-n.length,r&&(a+=Na(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Gi=function(){function e(n,i){var a,o=0,l=n.length;for(n=n.slice();l--;)a=n[l]*i+o,n[l]=a%Tt|0,o=a/Tt|0;return o&&n.unshift(o),n}function t(n,i,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(n[l]!=i[l]){c=n[l]>i[l]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*Tt+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o){var l,c,u,d,f,h,m,g,p,v,x,y,b,S,j,N,k,_,C=n.constructor,P=n.s==i.s?1:-1,E=n.d,A=i.d;if(!n.s)return new C(n);if(!i.s)throw Error(pn+"Division by zero");for(c=n.e-i.e,k=A.length,j=E.length,m=new C(P),g=m.d=[],u=0;A[u]==(E[u]||0);)++u;if(A[u]>(E[u]||0)&&--c,a==null?y=a=C.precision:o?y=a+(jt(n)-jt(i))+1:y=a,y<0)return new C(0);if(y=y/tt+2|0,u=0,k==1)for(d=0,A=A[0],y++;(u<j||d)&&y--;u++)b=d*Tt+(E[u]||0),g[u]=b/A|0,d=b%A|0;else{for(d=Tt/(A[0]+1)|0,d>1&&(A=e(A,d),E=e(E,d),k=A.length,j=E.length),S=k,p=E.slice(0,k),v=p.length;v<k;)p[v++]=0;_=A.slice(),_.unshift(0),N=A[0],A[1]>=Tt/2&&++N;do d=0,l=t(A,p,k,v),l<0?(x=p[0],k!=v&&(x=x*Tt+(p[1]||0)),d=x/N|0,d>1?(d>=Tt&&(d=Tt-1),f=e(A,d),h=f.length,v=p.length,l=t(f,p,h,v),l==1&&(d--,r(f,k<h?_:A,h))):(d==0&&(l=d=1),f=A.slice()),h=f.length,h<v&&f.unshift(0),r(p,f,v),l==-1&&(v=p.length,l=t(A,p,k,v),l<1&&(d++,r(p,k<v?_:A,v))),v=p.length):l===0&&(d++,p=[0]),g[u++]=d,l&&p[0]?p[v++]=E[S]||0:(p=[E[S]],v=1);while((S++<j||p[0]!==void 0)&&y--)}return g[0]||g.shift(),m.e=c,qe(m,o?a+jt(m)+1:a)}}();function nD(e,t){var r,n,i,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(jt(e)>16)throw Error(ck+jt(e));if(!e.s)return new d(Fr);for(t==null?(at=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log($s(2,u))/Math.LN10*2+5|0,l+=n,r=i=a=new d(Fr),d.precision=l;;){if(i=qe(i.times(e),l),r=r.times(++c),o=a.plus(Gi(i,r,l)),ui(o.d).slice(0,l)===ui(a.d).slice(0,l)){for(;u--;)a=qe(a.times(a),l);return d.precision=f,t==null?(at=!0,qe(a,f)):a}a=o}}function jt(e){for(var t=e.e*tt,r=e.d[0];r>=10;r/=10)t++;return t}function qx(e,t,r){if(t>e.LN10.sd())throw at=!0,r&&(e.precision=r),Error(pn+"LN10 precision limit exceeded");return qe(new e(e.LN10),t)}function Na(e){for(var t="";e--;)t+="0";return t}function df(e,t){var r,n,i,a,o,l,c,u,d,f=1,h=10,m=e,g=m.d,p=m.constructor,v=p.precision;if(m.s<1)throw Error(pn+(m.s?"NaN":"-Infinity"));if(m.eq(Fr))return new p(0);if(t==null?(at=!1,u=v):u=t,m.eq(10))return t==null&&(at=!0),qx(p,u);if(u+=h,p.precision=u,r=ui(g),n=r.charAt(0),a=jt(m),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(e),r=ui(m.d),n=r.charAt(0),f++;a=jt(m),n>1?(m=new p("0."+r),a++):m=new p(n+"."+r.slice(1))}else return c=qx(p,u+2,v).times(a+""),m=df(new p(n+"."+r.slice(1)),u-h).plus(c),p.precision=v,t==null?(at=!0,qe(m,v)):m;for(l=o=m=Gi(m.minus(Fr),m.plus(Fr),u),d=qe(m.times(m),u),i=3;;){if(o=qe(o.times(d),u),c=l.plus(Gi(o,new p(i),u)),ui(c.d).slice(0,u)===ui(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(qx(p,u+2,v).times(a+""))),l=Gi(l,new p(f),u),p.precision=v,t==null?(at=!0,qe(l,v)):l;l=c,i+=2}}function DE(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=iu(r/tt),e.d=[],n=(r+1)%tt,r<0&&(n+=tt),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=tt;n<i;)e.d.push(+t.slice(n,n+=tt));t=t.slice(n),n=tt-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),at&&(e.e>eg||e.e<-eg))throw Error(ck+r)}else e.s=0,e.e=0,e.d=[0];return e}function qe(e,t,r){var n,i,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=tt,i=t,u=f[d=0];else{if(d=Math.ceil((n+1)/tt),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;n%=tt,i=n-tt+o}if(r!==void 0&&(a=$s(10,o-i-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?i>0?u/$s(10,o-i):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(a=jt(e),f.length=1,t=t-a-1,f[0]=$s(10,(tt-t%tt)%tt),e.e=iu(-t/tt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,a=1,d--):(f.length=d+1,a=$s(10,tt-n),f[d]=i>0?(u/$s(10,o-i)%$s(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Tt&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Tt)break;f[d--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(at&&(e.e>eg||e.e<-eg))throw Error(ck+jt(e));return e}function iD(e,t){var r,n,i,a,o,l,c,u,d,f,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),at?qe(t,m):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),o=u-n,o){for(d=o<0,d?(r=c,o=-o,l=f.length):(r=f,n=u,l=c.length),i=Math.max(Math.ceil(m/tt),l)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,l=f.length,d=i<l,d&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}o=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>o;){if(c[--i]<f[i]){for(a=i;a&&c[--a]===0;)c[a]=Tt-1;--c[a],c[i]+=Tt}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,at?qe(t,m):t):new h(0)}function xo(e,t,r){var n,i=jt(e),a=ui(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Na(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Na(-i-1)+a,r&&(n=r-o)>0&&(a+=Na(n))):i>=o?(a+=Na(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Na(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Na(n))),e.s<0?"-"+a:a}function LE(e,t){if(e.length>t)return e.length=t,!0}function aD(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(io+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return DE(o,a.toString())}else if(typeof a!="string")throw Error(io+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Kfe.test(a))DE(o,a);else throw Error(io+a)}if(i.prototype=ie,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=aD,i.config=i.set=Yfe,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function Yfe(e){if(!e||typeof e!="object")throw Error(pn+"Object expected");var t,r,n,i=["precision",1,nu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(iu(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(io+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(io+r+": "+n);return this}var uk=aD(Gfe);Fr=new uk(1);const Ve=uk;function Xfe(e){return ehe(e)||Zfe(e)||Jfe(e)||Qfe()}function Qfe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 495In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jfe(e,t){if(e){if(typeof e=="string")return _w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _w(e,t)}}function Zfe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function ehe(e){if(Array.isArray(e))return _w(e)}function _w(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var the=function(t){return t},sD={"@@functional/placeholder":!0},oD=function(t){return t===sD},FE=function(t){return function r(){return arguments.length===0||arguments.length===1&&oD(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},rhe=function e(t,r){return t===1?r:FE(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=i.filter(function(l){return l!==sD}).length;return o>=t?r.apply(void 0,i):e(t-o,FE(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=i.map(function(f){return oD(f)?c.shift():f});return r.apply(void 0,Xfe(d).concat(c))}))})},iy=function(t){return rhe(t.length,t)},Cw=function(t,r){for(var n=[],i=t;i<r;++i)n[i-t]=i;return n},nhe=iy(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),ihe=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return the;var i=r.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},Aw=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},lD=function(t){var r=null,n=null;return function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return r&&a.every(function(l,c){return l===r[c]})||(r=a,n=t.apply(void 0,a)),n}};function ahe(e){var t;return e===0?t=1:t=Math.floor(new Ve(e).abs().log(10).toNumber())+1,t}function she(e,t,r){for(var n=new Ve(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var ohe=iy(function(e,t,r){var n=+e,i=+t;return n+r*(i-n)}),lhe=iy(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),che=iy(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const ay={rangeStep:she,getDigitCount:ahe,interpolateNumber:ohe,uninterpolateNumber:lhe,uninterpolateTruncation:che};function Ew(e){return fhe(e)||dhe(e)||cD(e)||uhe()}function uhe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 496In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dhe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function fhe(e){if(Array.isArray(e))return Pw(e)}function ff(e,t){return phe(e)||mhe(e,t)||cD(e,t)||hhe()}function hhe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 497In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cD(e,t){if(e){if(typeof e=="string")return Pw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pw(e,t)}}function Pw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mhe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function phe(e){if(Array.isArray(e))return e}function uD(e){var t=ff(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function dD(e,t,r){if(e.lte(0))return new Ve(0);var n=ay.getDigitCount(e.toNumber()),i=new Ve(10).pow(n),a=e.div(i),o=n!==1?.05:.1,l=new Ve(Math.ceil(a.div(o).toNumber())).add(r).mul(o),c=l.mul(i);return t?c:new Ve(Math.ceil(c))}function ghe(e,t,r){var n=1,i=new Ve(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Ve(10).pow(ay.getDigitCount(e)-1),i=new Ve(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Ve(Math.floor(e)))}else e===0?i=new Ve(Math.floor((t-1)/2)):r||(i=new Ve(Math.floor(e)));var o=Math.floor((t-1)/2),l=ihe(nhe(function(c){return i.add(new Ve(c-o).mul(n)).toNumber()}),Cw);return l(0,t)}function fD(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Ve(0),tickMin:new Ve(0),tickMax:new Ve(0)};var a=dD(new Ve(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Ve(0):(o=new Ve(e).add(t).div(2),o=o.sub(new Ve(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new Ve(t).sub(o).div(a).toNumber()),u=l+c+1;return u>r?fD(e,t,r,n,i+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:a,tickMin:o.sub(new Ve(l).mul(a)),tickMax:o.add(new Ve(c).mul(a))})}function vhe(e){var t=ff(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),l=uD([r,n]),c=ff(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Ew(Cw(0,i-1).map(function(){return 1/0}))):[].concat(Ew(Cw(0,i-1).map(function(){return-1/0})),[d]);return r>n?Aw(f):f}if(u===d)return ghe(u,i,a);var h=fD(u,d,o,a),m=h.step,g=h.tickMin,p=h.tickMax,v=ay.rangeStep(g,p.add(new Ve(.1).mul(m)),m);return r>n?Aw(v):v}function yhe(e,t){var r=ff(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=uD([n,i]),l=ff(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,i];if(c===u)return[c];var d=Math.max(t,2),f=dD(new Ve(u).sub(c).div(d-1),a,0),h=[].concat(Ew(ay.rangeStep(new Ve(c),new Ve(u).sub(new Ve(.99).mul(f)),f)),[u]);return n>i?Aw(h):h}var xhe=lD(vhe),bhe=lD(yhe),whe="Invariant failed";function bo(e,t){throw new Error(whe)}var jhe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function tg(){return tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tg.apply(this,arguments)}function She(e,t){return Che(e)||_he(e,t)||Nhe(e,t)||khe()}function khe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 498In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nhe(e,t){if(e){if(typeof e=="string")return BE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BE(e,t)}}function BE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _he(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Che(e){if(Array.isArray(e))return e}function Ahe(e,t){if(e==null)return{};var r=Ehe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ehe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Phe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ohe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pD(n.key),n)}}function The(e,t,r){return t&&Ohe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $he(e,t,r){return t=rg(t),Rhe(e,hD()?Reflect.construct(t,r||[],rg(e).constructor):t.apply(e,r))}function Rhe(e,t){if(t&&(yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ihe(e)}function Ihe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hD=function(){return!!e})()}function rg(e){return rg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rg(e)}function Mhe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ow(e,t)}function Ow(e,t){return Ow=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ow(e,t)}function mD(e,t,r){return t=pD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pD(e){var t=Dhe(e,"string");return yc(t)=="symbol"?t:t+""}function Dhe(e,t){if(yc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lh=function(e){function t(){return Phe(this,t),$he(this,t,arguments)}return Mhe(t,e),The(t,[{key:"render",value:function(){var n=this.props,i=n.offset,a=n.layout,o=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,h=Ahe(n,jhe),m=le(h,!1);this.props.direction==="x"&&d.type!=="number"&&bo();var g=c.map(function(p){var v=u(p,l),x=v.x,y=v.y,b=v.value,S=v.errorVal;if(!S)return null;var j=[],N,k;if(Array.isArray(S)){var _=She(S,2);N=_[0],k=_[1]}else N=k=S;if(a==="vertical"){var C=d.scale,P=y+i,E=P+o,A=P-o,R=C(b-N),$=C(b+k);j.push({x1:$,y1:E,x2:$,y2:A}),j.push({x1:R,y1:P,x2:$,y2:P}),j.push({x1:R,y1:E,x2:R,y2:A})}else if(a==="horizontal"){var D=f.scale,M=x+i,I=M-o,T=M+o,L=D(b-N),B=D(b+k);j.push({x1:I,y1:B,x2:T,y2:B}),j.push({x1:M,y1:L,x2:M,y2:B}),j.push({x1:I,y1:L,x2:T,y2:L})}return O.createElement(Ae,tg({className:"recharts-errorBar",key:"bar-".concat(j.map(function(H){return"".concat(H.x1,"-").concat(H.x2,"-").concat(H.y1,"-").concat(H.y2)}))},m),j.map(function(H){return O.createElement("line",tg({},H,{key:"line-".concat(H.x1,"-").concat(H.x2,"-").concat(H.y1,"-").concat(H.y2)}))}))});return O.createElement(Ae,{className:"recharts-errorBars"},g)}}])}(O.Component);mD(lh,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});mD(lh,"displayName","ErrorBar");function hf(e){"@babel/helpers - typeof";return hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hf(e)}function WE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ns(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WE(Object(r),!0).forEach(function(n){Lhe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Lhe(e,t,r){return t=Fhe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fhe(e){var t=Bhe(e,"string");return hf(t)=="symbol"?t:t+""}function Bhe(e,t){if(hf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(hf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gD=function(t){var r=t.children,n=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,o=Mr(r,dn);if(!o)return null;var l=dn.defaultProps,c=l!==void 0?Ns(Ns({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:a==="children"?u=(n||[]).reduce(function(d,f){var h=f.item,m=f.props,g=m.sectors||m.data||[];return d.concat(g.map(function(p){return{type:o.props.iconType||h.props.legendType,value:p.name,color:p.fill,payload:p}}))},[]):u=(n||[]).map(function(d){var f=d.item,h=f.type.defaultProps,m=h!==void 0?Ns(Ns({},h),f.props):{},g=m.dataKey,p=m.name,v=m.legendType,x=m.hide;return{inactive:x,dataKey:g,type:c.iconType||v||"square",color:dk(f),value:p||g,payload:m}}),Ns(Ns(Ns({},c),dn.getWithHeight(o,i)),{},{payload:u,item:o})};function mf(e){"@babel/helpers - typeof";return mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mf(e)}function UE(e){return Vhe(e)||zhe(e)||Uhe(e)||Whe()}function Whe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 499In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uhe(e,t){if(e){if(typeof e=="string")return Tw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tw(e,t)}}function zhe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vhe(e){if(Array.isArray(e))return Tw(e)}function Tw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zE(Object(r),!0).forEach(function(n){Dl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dl(e,t,r){return t=Hhe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hhe(e){var t=qhe(e,"string");return mf(t)=="symbol"?t:t+""}function qhe(e,t){if(mf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(mf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gt(e,t,r){return xe(e)||xe(t)?r:Et(t)?zr(e,t,r):he(t)?t(e):r}function md(e,t,r,n){var i=zfe(e,function(l){return gt(l,t)});if(r==="number"){var a=i.filter(function(l){return K(l)||parseFloat(l)});return a.length?[ny(a),za(a)]:[1/0,-1/0]}var o=n?i.filter(function(l){return!xe(l)}):i;return o.map(function(l){return Et(l)||l instanceof Date?l:""})}var Ghe=function(t){var r,n=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,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=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<l;u++){var d=u>0?i[u-1].coordinate:i[l-1].coordinate,f=i[u].coordinate,h=u>=l-1?i[0].coordinate:i[u+1].coordinate,m=void 0;if(or(f-d)!==or(h-f)){var g=[];if(or(h-f)===or(c[1]-c[0])){m=h;var p=f+c[1]-c[0];g[0]=Math.min(p,(p+d)/2),g[1]=Math.max(p,(p+d)/2)}else{m=d;var v=h+c[1]-c[0];g[0]=Math.min(f,(v+f)/2),g[1]=Math.max(f,(v+f)/2)}var x=[Math.min(f,(m+f)/2),Math.max(f,(m+f)/2)];if(t>x[0]&&t<=x[1]||t>=g[0]&&t<=g[1]){o=i[u].index;break}}else{var y=Math.min(d,h),b=Math.max(d,h);if(t>(y+f)/2&&t<=(b+f)/2){o=i[u].index;break}}}else for(var S=0;S<l;S++)if(S===0&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S>0&&S<l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},dk=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?ht(ht({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},Khe=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,f=Object.keys(d),h=0,m=f.length;h<m;h++){var g=d[f[h]],p=g.items,v=g.cateAxisId,x=p.filter(function(k){return qi(k.type).indexOf("Bar")>=0});if(x&&x.length){var y=x[0].type.defaultProps,b=y!==void 0?ht(ht({},y),x[0].props):x[0].props,S=b.barSize,j=b[v];o[j]||(o[j]=[]);var N=xe(S)?r:S;o[j].push({item:x[0],stackList:x.slice(1),barSize:xe(N)?void 0:lr(N,n,0)})}}return o},Yhe=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=lr(r,i,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,m=i/c,g=o.reduce(function(S,j){return S+j.barSize||0},0);g+=(c-1)*u,g>=i&&(g-=(c-1)*u,u=0),g>=i&&m>0&&(h=!0,m*=.9,g=c*m);var p=(i-g)/2>>0,v={offset:p-u,size:0};d=o.reduce(function(S,j){var N={item:j.item,position:{offset:v.offset+v.size+u,size:h?m:j.barSize}},k=[].concat(UE(S),[N]);return v=k[k.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(_){k.push({item:_,position:v})}),k},f)}else{var x=lr(n,i,0,!0);i-2*x-(c-1)*u<=0&&(u=0);var y=(i-2*x-(c-1)*u)/c;y>1&&(y>>=0);var b=l===+l?Math.min(y,l):y;d=o.reduce(function(S,j,N){var k=[].concat(UE(S),[{item:j.item,position:{offset:x+(y+u)*N+(y-b)/2,size:b}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(_){k.push({item:_,position:k[k.length-1].position})}),k},f)}return d},Xhe=function(t,r,n,i){var a=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),u=gD({children:a,legendWidth:c});if(u){var d=i||{},f=d.width,h=d.height,m=u.align,g=u.verticalAlign,p=u.layout;if((p==="vertical"||p==="horizontal"&&g==="middle")&&m!=="center"&&K(t[m]))return ht(ht({},t),{},Dl({},m,t[m]+(f||0)));if((p==="horizontal"||p==="vertical"&&m==="center")&&g!=="middle"&&K(t[g]))return ht(ht({},t),{},Dl({},g,t[g]+(h||0)))}return t},Qhe=function(t,r,n){return xe(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},vD=function(t,r,n,i,a){var o=r.props.children,l=Vr(o,lh).filter(function(u){return Qhe(i,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=gt(d,n);if(xe(f))return u;var h=Array.isArray(f)?[ny(f),za(f)]:[f,f],m=c.reduce(function(g,p){var v=gt(d,p,0),x=h[0]-Math.abs(Array.isArray(v)?v[0]:v),y=h[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(x,g[0]),Math.max(y,g[1])]},[1/0,-1/0]);return[Math.min(m[0],u[0]),Math.max(m[1],u[1])]},[1/0,-1/0])}return null},Jhe=function(t,r,n,i,a){var o=r.map(function(l){return vD(t,l,n,a,i)}).filter(function(l){return!xe(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},yD=function(t,r,n,i,a){var o=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&vD(t,c,u,i)||md(t,u,n,a)});if(n==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},xD=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},bD=function(t,r,n,i){if(i)return t.map(function(c){return c.coordinate});var a,o,l=t.map(function(c){return c.coordinate===r&&(a=!0),c.coordinate===n&&(o=!0),c.coordinate});return a||l.push(r),o||l.push(n),l},Ui=function(t,r,n){if(!t)return null;var i=t.scale,a=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?or(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return d.filter(function(f){return!Jc(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:a?a[f]:f,index:h,offset:u}})},Gx=new WeakMap,um=function(t,r){if(typeof r!="function")return t;Gx.has(t)||Gx.set(t,new WeakMap);var n=Gx.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},wD=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,l=t.axisType;if(i==="auto")return o==="radial"&&l==="radiusAxis"?{scale:sf(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:Xp(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:hd(),realScaleType:"point"}:a==="category"?{scale:sf(),realScaleType:"band"}:{scale:Xp(),realScaleType:"linear"};if(po(i)){var c="scale".concat(zv(i));return{scale:(ME[c]||hd)(),realScaleType:ME[c]?c:"point"}}return he(i)?{scale:i}:{scale:hd(),realScaleType:"point"}},VE=1e-4,jD=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-VE,o=Math.max(i[0],i[1])+VE,l=t(r[0]),c=t(r[n-1]);(l<a||l>o||c<a||c>o)&&t.domain([r[0],r[n-1]])}},Zhe=function(t,r){if(!t)return null;for(var n=0,i=t.length;n<i;n++)if(t[n].item===r)return t[n].position;return null},eme=function(t,r){if(!r||r.length!==2||!K(r[0])||!K(r[1]))return t;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),a=[t[0],t[1]];return(!K(t[0])||t[0]<n)&&(a[0]=n),(!K(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<n&&(a[1]=n),a},tme=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n<i;++n)for(var a=0,o=0,l=0;l<r;++l){var c=Jc(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=a,t[l][n][1]=a+c,a=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},rme=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n<i;++n)for(var a=0,o=0;o<r;++o){var l=Jc(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=a,t[o][n][1]=a+l,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},nme={sign:tme,expand:jee,none:uc,silhouette:See,wiggle:kee,positive:rme},ime=function(t,r,n){var i=r.map(function(l){return l.props.dataKey}),a=nme[n],o=wee().keys(i).value(function(l,c){return+gt(l,c,0)}).order(nw).offset(a);return o(t)},ame=function(t,r,n,i,a,o){if(!t)return null;var l=o?r.reverse():r,c={},u=l.reduce(function(f,h){var m,g=(m=h.type)!==null&&m!==void 0&&m.defaultProps?ht(ht({},h.type.defaultProps),h.props):h.props,p=g.stackId,v=g.hide;if(v)return f;var x=g[n],y=f[x]||{hasStack:!1,stackGroups:{}};if(Et(p)){var b=y.stackGroups[p]||{numericAxisId:n,cateAxisId:i,items:[]};b.items.push(h),y.hasStack=!0,y.stackGroups[p]=b}else y.stackGroups[Oo("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return ht(ht({},f),{},Dl({},x,y))},c),d={};return Object.keys(u).reduce(function(f,h){var m=u[h];if(m.hasStack){var g={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(p,v){var x=m.stackGroups[v];return ht(ht({},p),{},Dl({},v,{numericAxisId:n,cateAxisId:i,items:x.items,stackedData:ime(t,x.items,a)}))},g)}return ht(ht({},f),{},Dl({},h,m))},d)},SD=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=xhe(u,a,l);return t.domain([ny(d),za(d)]),{niceTicks:d}}if(a&&i==="number"){var f=t.domain(),h=bhe(f,a,l);return{niceTicks:h}}return null};function ng(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!xe(i[t.dataKey])){var l=Ep(r,"value",i[t.dataKey]);if(l)return l.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var c=gt(i,xe(o)?t.dataKey:o);return xe(c)?null:t.scale(c)}var HE=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+i:null;var c=gt(o,r.dataKey,r.domain[l]);return xe(c)?null:r.scale(c)-a/2+i},sme=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},ome=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?ht(ht({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Et(a)){var o=r[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},lme=function(t){return t.reduce(function(r,n){return[ny(n.concat([r[0]]).filter(K)),za(n.concat([r[1]]).filter(K))]},[1/0,-1/0])},kD=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var f=lme(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[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})},qE=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,GE=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$w=function(t,r,n){if(he(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(K(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(qE.test(t[0])){var a=+qE.exec(t[0])[1];i[0]=r[0]-a}else he(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(K(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(GE.test(t[1])){var o=+GE.exec(t[1])[1];i[1]=r[1]+o}else he(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},ig=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=FS(r,function(f){return f.coordinate}),o=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},KE=function(t,r,n){return!t||!t.length||yo(t,zr(n,"type.defaultProps.domain"))?r:t},ND=function(t,r){var n=t.type.defaultProps?ht(ht({},t.type.defaultProps),t.props):t.props,i=n.dataKey,a=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return ht(ht({},le(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:a||i,color:dk(t),value:gt(r,i),type:c,payload:r,chartType:u,hide:d})};function pf(e){"@babel/helpers - typeof";return pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pf(e)}function YE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ii(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YE(Object(r),!0).forEach(function(n){_D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _D(e,t,r){return t=cme(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cme(e){var t=ume(e,"string");return pf(t)=="symbol"?t:t+""}function ume(e,t){if(pf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dme(e,t){return pme(e)||mme(e,t)||hme(e,t)||fme()}function fme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 500In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hme(e,t){if(e){if(typeof e=="string")return XE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XE(e,t)}}function XE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mme(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function pme(e){if(Array.isArray(e))return e}var ag=Math.PI/180,gme=function(t){return t*180/Math.PI},Qe=function(t,r,n,i){return{x:t+Math.cos(-ag*i)*n,y:r+Math.sin(-ag*i)*n}},CD=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},vme=function(t,r,n,i,a){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=lr(t.cx,o,o/2),f=lr(t.cy,l,l/2),h=CD(o,l,n),m=lr(t.innerRadius,h,0),g=lr(t.outerRadius,h,h*.8),p=Object.keys(r);return p.reduce(function(v,x){var y=r[x],b=y.domain,S=y.reversed,j;if(xe(y.range))i==="angleAxis"?j=[c,u]:i==="radiusAxis"&&(j=[m,g]),S&&(j=[j[1],j[0]]);else{j=y.range;var N=j,k=dme(N,2);c=k[0],u=k[1]}var _=wD(y,a),C=_.realScaleType,P=_.scale;P.domain(b).range(j),jD(P);var E=SD(P,Ii(Ii({},y),{},{realScaleType:C})),A=Ii(Ii(Ii({},y),E),{},{range:j,radius:g,realScaleType:C,scale:P,cx:d,cy:f,innerRadius:m,outerRadius:g,startAngle:c,endAngle:u});return Ii(Ii({},v),{},_D({},x,A))},{})},yme=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},xme=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,l=yme({x:n,y:i},{x:a,y:o});if(l<=0)return{radius:l};var c=(n-a)/l,u=Math.acos(c);return i>o&&(u=2*Math.PI-u),{radius:l,angle:gme(u),angleInRadian:u}},bme=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},wme=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),l=Math.min(a,o);return t+l*360},QE=function(t,r){var n=t.x,i=t.y,a=xme({x:n,y:i},r),o=a.radius,l=a.angle,c=r.innerRadius,u=r.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=bme(r),f=d.startAngle,h=d.endAngle,m=l,g;if(f<=h){for(;m>h;)m-=360;for(;m<f;)m+=360;g=m>=f&&m<=h}else{for(;m>f;)m-=360;for(;m<h;)m+=360;g=m>=h&&m<=f}return g?Ii(Ii({},r),{},{radius:o,angle:wme(m,r)}):null},AD=function(t){return!w.isValidElement(t)&&!he(t)&&typeof t!="boolean"?t.className:""};function gf(e){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gf(e)}var jme=["offset"];function Sme(e){return Cme(e)||_me(e)||Nme(e)||kme()}function kme(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 501In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nme(e,t){if(e){if(typeof e=="string")return Rw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rw(e,t)}}function _me(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cme(e){if(Array.isArray(e))return Rw(e)}function Rw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ame(e,t){if(e==null)return{};var r=Eme(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Eme(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function JE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JE(Object(r),!0).forEach(function(n){Pme(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pme(e,t,r){return t=Ome(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ome(e){var t=Tme(e,"string");return gf(t)=="symbol"?t:t+""}function Tme(e,t){if(gf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vf(){return vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vf.apply(this,arguments)}var $me=function(t){var r=t.value,n=t.formatter,i=xe(t.children)?r:t.children;return he(n)?n(i):i},Rme=function(t,r){var n=or(r-t),i=Math.min(Math.abs(r-t),360);return n*i},Ime=function(t,r,n){var i=t.position,a=t.viewBox,o=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,m=c.startAngle,g=c.endAngle,p=c.clockWise,v=(f+h)/2,x=Rme(m,g),y=x>=0?1:-1,b,S;i==="insideStart"?(b=m+y*o,S=p):i==="insideEnd"?(b=g-y*o,S=!p):i==="end"&&(b=g+y*o,S=p),S=x<=0?S:!S;var j=Qe(u,d,v,b),N=Qe(u,d,v,b+(S?1:-1)*359),k="M".concat(j.x,",").concat(j.y,` 502 A`).concat(v,",").concat(v,",0,1,").concat(S?0:1,`, 503 `).concat(N.x,",").concat(N.y),_=xe(t.id)?Oo("recharts-radial-line-"):t.id;return O.createElement("text",vf({},n,{dominantBaseline:"central",className:we("recharts-radial-bar-label",l)}),O.createElement("defs",null,O.createElement("path",{id:_,d:k})),O.createElement("textPath",{xlinkHref:"#".concat(_)},r))},Mme=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,h=(d+f)/2;if(i==="outside"){var m=Qe(o,l,u+n,h),g=m.x,p=m.y;return{x:g,y:p,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var v=(c+u)/2,x=Qe(o,l,v,h),y=x.x,b=x.y;return{x:y,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Dme=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*i,m=f>0?"end":"start",g=f>0?"start":"end",p=u>=0?1:-1,v=p*i,x=p>0?"end":"start",y=p>0?"start":"end";if(a==="top"){var b={x:l+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:m};return kt(kt({},b),n?{height:Math.max(c-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:g};return kt(kt({},S),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(a==="left"){var j={x:l-v,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return kt(kt({},j),n?{width:Math.max(j.x-n.x,0),height:d}:{})}if(a==="right"){var N={x:l+u+v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return kt(kt({},N),n?{width:Math.max(n.x+n.width-N.x,0),height:d}:{})}var k=n?{width:u,height:d}:{};return a==="insideLeft"?kt({x:l+v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},k):a==="insideRight"?kt({x:l+u-v,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},k):a==="insideTop"?kt({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},k):a==="insideBottom"?kt({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:m},k):a==="insideTopLeft"?kt({x:l+v,y:c+h,textAnchor:y,verticalAnchor:g},k):a==="insideTopRight"?kt({x:l+u-v,y:c+h,textAnchor:x,verticalAnchor:g},k):a==="insideBottomLeft"?kt({x:l+v,y:c+d-h,textAnchor:y,verticalAnchor:m},k):a==="insideBottomRight"?kt({x:l+u-v,y:c+d-h,textAnchor:x,verticalAnchor:m},k):Kc(a)&&(K(a.x)||Ws(a.x))&&(K(a.y)||Ws(a.y))?kt({x:l+lr(a.x,u),y:c+lr(a.y,d),textAnchor:"end",verticalAnchor:"end"},k):kt({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},k)},Lme=function(t){return"cx"in t&&K(t.cx)};function Rt(e){var t=e.offset,r=t===void 0?5:t,n=Ame(e,jme),i=kt({offset:r},n),a=i.viewBox,o=i.position,l=i.value,c=i.children,u=i.content,d=i.className,f=d===void 0?"":d,h=i.textBreakAll;if(!a||xe(l)&&xe(c)&&!w.isValidElement(u)&&!he(u))return null;if(w.isValidElement(u))return w.cloneElement(u,i);var m;if(he(u)){if(m=w.createElement(u,i),w.isValidElement(m))return m}else m=$me(i);var g=Lme(a),p=le(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Ime(i,m,p);var v=g?Mme(i):Dme(i);return O.createElement(vo,vf({className:we("recharts-label",f)},p,v,{breakAll:h}),m)}Rt.displayName="Label";var ED=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,m=t.top,g=t.left,p=t.width,v=t.height,x=t.clockWise,y=t.labelViewBox;if(y)return y;if(K(p)&&K(v)){if(K(f)&&K(h))return{x:f,y:h,width:p,height:v};if(K(m)&&K(g))return{x:m,y:g,width:p,height:v}}return K(f)&&K(h)?{x:f,y:h,width:0,height:0}:K(r)&&K(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:x}:t.viewBox?t.viewBox:{}},Fme=function(t,r){return t?t===!0?O.createElement(Rt,{key:"label-implicit",viewBox:r}):Et(t)?O.createElement(Rt,{key:"label-implicit",viewBox:r,value:t}):w.isValidElement(t)?t.type===Rt?w.cloneElement(t,{key:"label-implicit",viewBox:r}):O.createElement(Rt,{key:"label-implicit",content:t,viewBox:r}):he(t)?O.createElement(Rt,{key:"label-implicit",content:t,viewBox:r}):Kc(t)?O.createElement(Rt,vf({viewBox:r},t,{key:"label-implicit"})):null:null},Bme=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=ED(t),o=Vr(i,Rt).map(function(c,u){return w.cloneElement(c,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var l=Fme(t.label,r||a);return[l].concat(Sme(o))};Rt.parseViewBox=ED;Rt.renderCallByParent=Bme;function Wme(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Ume=Wme;const zme=Le(Ume);function yf(e){"@babel/helpers - typeof";return yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yf(e)}var Vme=["valueAccessor"],Hme=["data","dataKey","clockWise","id","textBreakAll"];function qme(e){return Xme(e)||Yme(e)||Kme(e)||Gme()}function Gme(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 504In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kme(e,t){if(e){if(typeof e=="string")return Iw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Iw(e,t)}}function Yme(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xme(e){if(Array.isArray(e))return Iw(e)}function Iw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sg.apply(this,arguments)}function ZE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function eP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZE(Object(r),!0).forEach(function(n){Qme(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qme(e,t,r){return t=Jme(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jme(e){var t=Zme(e,"string");return yf(t)=="symbol"?t:t+""}function Zme(e,t){if(yf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tP(e,t){if(e==null)return{};var r=epe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function epe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var tpe=function(t){return Array.isArray(t.value)?zme(t.value):t.value};function yi(e){var t=e.valueAccessor,r=t===void 0?tpe:t,n=tP(e,Vme),i=n.data,a=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,u=tP(n,Hme);return!i||!i.length?null:O.createElement(Ae,{className:"recharts-label-list"},i.map(function(d,f){var h=xe(a)?r(d,f):gt(d&&d.payload,a),m=xe(l)?{}:{id:"".concat(l,"-").concat(f)};return O.createElement(Rt,sg({},le(d,!0),u,m,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:Rt.parseViewBox(xe(o)?d:eP(eP({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}yi.displayName="LabelList";function rpe(e,t){return e?e===!0?O.createElement(yi,{key:"labelList-implicit",data:t}):O.isValidElement(e)||he(e)?O.createElement(yi,{key:"labelList-implicit",data:t,content:e}):Kc(e)?O.createElement(yi,sg({data:t},e,{key:"labelList-implicit"})):null:null}function npe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Vr(n,yi).map(function(o,l){return w.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return i;var a=rpe(e.label,t);return[a].concat(qme(i))}yi.renderCallByParent=npe;function xf(e){"@babel/helpers - typeof";return xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xf(e)}function Mw(){return Mw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mw.apply(this,arguments)}function rP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rP(Object(r),!0).forEach(function(n){ipe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ipe(e,t,r){return t=ape(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ape(e){var t=spe(e,"string");return xf(t)=="symbol"?t:t+""}function spe(e,t){if(xf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ope=function(t,r){var n=or(r-t),i=Math.min(Math.abs(r-t),359.999);return n*i},dm=function(t){var r=t.cx,n=t.cy,i=t.radius,a=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+i,f=Math.asin(c/d)/ag,h=u?a:a+o*f,m=Qe(r,n,d,h),g=Qe(r,n,i,h),p=u?a-o*f:a,v=Qe(r,n,d*Math.cos(f*ag),p);return{center:m,circleTangency:g,lineTangency:v,theta:f}},PD=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=ope(o,l),u=o+c,d=Qe(r,n,a,o),f=Qe(r,n,a,u),h="M ".concat(d.x,",").concat(d.y,` 505 A `).concat(a,",").concat(a,`,0, 506 `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`, 507 `).concat(f.x,",").concat(f.y,` 508 `);if(i>0){var m=Qe(r,n,i,o),g=Qe(r,n,i,u);h+="L ".concat(g.x,",").concat(g.y,` 509 A `).concat(i,",").concat(i,`,0, 510 `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`, 511 `).concat(m.x,",").concat(m.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},lpe=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=or(d-u),h=dm({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),m=h.circleTangency,g=h.lineTangency,p=h.theta,v=dm({cx:r,cy:n,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),x=v.circleTangency,y=v.lineTangency,b=v.theta,S=c?Math.abs(u-d):Math.abs(u-d)-p-b;if(S<0)return l?"M ".concat(g.x,",").concat(g.y,` 512 a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 513 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 514 `):PD({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d});var j="M ".concat(g.x,",").concat(g.y,` 515 A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,` 516 A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(x.x,",").concat(x.y,` 517 A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,` 518 `);if(i>0){var N=dm({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),k=N.circleTangency,_=N.lineTangency,C=N.theta,P=dm({cx:r,cy:n,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=P.circleTangency,A=P.lineTangency,R=P.theta,$=c?Math.abs(u-d):Math.abs(u-d)-C-R;if($<0&&o===0)return"".concat(j,"L").concat(r,",").concat(n,"Z");j+="L".concat(A.x,",").concat(A.y,` 519 A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(E.x,",").concat(E.y,` 520 A`).concat(i,",").concat(i,",0,").concat(+($>180),",").concat(+(f>0),",").concat(k.x,",").concat(k.y,` 521 A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,"Z")}else j+="L".concat(r,",").concat(n,"Z");return j},cpe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},OD=function(t){var r=nP(nP({},cpe),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,h=r.className;if(o<a||d===f)return null;var m=we("recharts-sector",h),g=o-a,p=lr(l,g,0,!0),v;return p>0&&Math.abs(d-f)<360?v=lpe({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(p,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):v=PD({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),O.createElement("path",Mw({},le(r,!0),{className:m,d:v,role:"img"}))};function bf(e){"@babel/helpers - typeof";return bf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bf(e)}function Dw(){return Dw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dw.apply(this,arguments)}function iP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function aP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iP(Object(r),!0).forEach(function(n){upe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iP(Object(r)).forEac
521h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function upe(e,t,r){return t=dpe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dpe(e){var t=fpe(e,"string");return bf(t)=="symbol"?t:t+""}function fpe(e,t){if(bf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sP={curveBasisClosed:uee,curveBasisOpen:dee,curveBasis:cee,curveBumpX:YZ,curveBumpY:XZ,curveLinearClosed:fee,curveLinear:Hv,curveMonotoneX:hee,curveMonotoneY:mee,curveNatural:pee,curveStep:gee,curveStepAfter:yee,curveStepBefore:vee},fm=function(t){return t.x===+t.x&&t.y===+t.y},Cu=function(t){return t.x},Au=function(t){return t.y},hpe=function(t,r){if(he(t))return t;var n="curve".concat(zv(t));return(n==="curveMonotone"||n==="curveBump")&&r?sP["".concat(n).concat(r==="vertical"?"Y":"X")]:sP[n]||Hv},mpe=function(t){var r=t.type,n=r===void 0?"linear":r,i=t.points,a=i===void 0?[]:i,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=hpe(n,l),f=u?a.filter(function(p){return fm(p)}):a,h;if(Array.isArray(o)){var m=u?o.filter(function(p){return fm(p)}):o,g=f.map(function(p,v){return aP(aP({},p),{},{base:m[v]})});return l==="vertical"?h=rm().y(Au).x1(Cu).x0(function(p){return p.base.x}):h=rm().x(Cu).y1(Au).y0(function(p){return p.base.y}),h.defined(fm).curve(d),h(g)}return l==="vertical"&&K(o)?h=rm().y(Au).x1(Cu).x0(o):K(o)?h=rm().x(Cu).y1(Au).y0(o):h=N3().x(Cu).y(Au),h.defined(fm).curve(d),h(f)},ao=function(t){var r=t.className,n=t.points,i=t.path,a=t.pathRef;if((!n||!n.length)&&!i)return null;var o=n&&n.length?mpe(t):i;return w.createElement("path",Dw({},le(t,!1),Pp(t),{className:we("recharts-curve",r),d:o,ref:a}))},TD={exports:{}},ppe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",gpe=ppe,vpe=gpe;function $D(){}function RD(){}RD.resetWarningCache=$D;var ype=function(){function e(n,i,a,o,l,c){if(c!==vpe){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:RD,resetWarningCache:$D};return r.PropTypes=r,r};TD.exports=ype();var xpe=TD.exports;const Ie=Le(xpe);var bpe=Object.getOwnPropertyNames,wpe=Object.getOwnPropertySymbols,jpe=Object.prototype.hasOwnProperty;function oP(e,t){return function(n,i,a){return e(n,i,a)&&t(n,i,a)}}function hm(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var a=i.cache,o=a.get(r),l=a.get(n);if(o&&l)return o===n&&l===r;a.set(r,n),a.set(n,r);var c=e(r,n,i);return a.delete(r),a.delete(n),c}}function lP(e){return bpe(e).concat(wpe(e))}var Spe=Object.hasOwn||function(e,t){return jpe.call(e,t)};function Io(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var kpe="__v",Npe="__o",_pe="_owner",cP=Object.getOwnPropertyDescriptor,uP=Object.keys;function Cpe(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Ape(e,t){return Io(e.getTime(),t.getTime())}function Epe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ppe(e,t){return e===t}function dP(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),o,l,c=0;(o=a.next())&&!o.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(i[f]){f++;continue}var h=o.value,m=l.value;if(r.equals(h[0],m[0],c,f,e,t,r)&&r.equals(h[1],m[1],h[0],m[0],e,t,r)){d=i[f]=!0;break}f++}if(!d)return!1;c++}return!0}var Ope=Io;function Tpe(e,t,r){var n=uP(e),i=n.length;if(uP(t).length!==i)return!1;for(;i-- >0;)if(!ID(e,t,r,n[i]))return!1;return!0}function Eu(e,t,r){var n=lP(e),i=n.length;if(lP(t).length!==i)return!1;for(var a,o,l;i-- >0;)if(a=n[i],!ID(e,t,r,a)||(o=cP(e,a),l=cP(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function $pe(e,t){return Io(e.valueOf(),t.valueOf())}function Rpe(e,t){return e.source===t.source&&e.flags===t.flags}function fP(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),o,l;(o=a.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!i[d]&&r.equals(o.value,l.value,o.value,l.value,e,t,r)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function Ipe(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function Mpe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function ID(e,t,r,n){return(n===_pe||n===Npe||n===kpe)&&(e.$$typeof||t.$$typeof)?!0:Spe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var Dpe="[object Arguments]",Lpe="[object Boolean]",Fpe="[object Date]",Bpe="[object Error]",Wpe="[object Map]",Upe="[object Number]",zpe="[object Object]",Vpe="[object RegExp]",Hpe="[object Set]",qpe
521="[object String]",Gpe="[object URL]",Kpe=Array.isArray,hP=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,mP=Object.assign,Ype=Object.prototype.toString.call.bind(Object.prototype.toString);function Xpe(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual;return function(g,p,v){if(g===p)return!0;if(g==null||p==null)return!1;var x=typeof g;if(x!==typeof p)return!1;if(x!=="object")return x==="number"?o(g,p,v):x==="function"?i(g,p,v):!1;var y=g.constructor;if(y!==p.constructor)return!1;if(y===Object)return l(g,p,v);if(Kpe(g))return t(g,p,v);if(hP!=null&&hP(g))return f(g,p,v);if(y===Date)return r(g,p,v);if(y===RegExp)return u(g,p,v);if(y===Map)return a(g,p,v);if(y===Set)return d(g,p,v);var b=Ype(g);return b===Fpe?r(g,p,v):b===Vpe?u(g,p,v):b===Wpe?a(g,p,v):b===Hpe?d(g,p,v):b===zpe?typeof g.then!="function"&&typeof p.then!="function"&&l(g,p,v):b===Gpe?h(g,p,v):b===Bpe?n(g,p,v):b===Dpe?l(g,p,v):b===Lpe||b===Upe||b===qpe?c(g,p,v):!1}}function Qpe(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?Eu:Cpe,areDatesEqual:Ape,areErrorsEqual:Epe,areFunctionsEqual:Ppe,areMapsEqual:n?oP(dP,Eu):dP,areNumbersEqual:Ope,areObjectsEqual:n?Eu:Tpe,arePrimitiveWrappersEqual:$pe,areRegExpsEqual:Rpe,areSetsEqual:n?oP(fP,Eu):fP,areTypedArraysEqual:n?Eu:Ipe,areUrlsEqual:Mpe};if(r&&(i=mP({},i,r(i))),t){var a=hm(i.areArraysEqual),o=hm(i.areMapsEqual),l=hm(i.areObjectsEqual),c=hm(i.areSetsEqual);i=mP({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return i}function Jpe(e){return function(t,r,n,i,a,o,l){return e(t,r,l)}}function Zpe(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(c,u){var d=n(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,m=d.meta;return r(c,u,{cache:h,equals:i,meta:m,strict:a})};if(t)return function(c,u){return r(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,u){return r(c,u,o)}}var ege=vs();vs({strict:!0});vs({circular:!0});vs({circular:!0,strict:!0});vs({createInternalComparator:function(){return Io}});vs({strict:!0,createInternalComparator:function(){return Io}});vs({circular:!0,createInternalComparator:function(){return Io}});vs({circular:!0,createInternalComparator:function(){return Io},strict:!0});function vs(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,l=Qpe(e),c=Xpe(l),u=n?n(c):Jpe(c);return Zpe({circular:r,comparator:c,createState:i,equals:u,strict:o})}function tge(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function pP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):tge(i)};requestAnimationFrame(n)}function Lw(e){"@babel/helpers - typeof";return Lw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lw(e)}function rge(e){return sge(e)||age(e)||ige(e)||nge()}function nge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 522In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ige(e,t){if(e){if(typeof e=="string")return gP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gP(e,t)}}function gP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function age(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sge(e){if(Array.isArray(e))return e}function oge(){var e={},t=function(){return null},r=!1,n=function i(a){if(!r){if(Array.isArray(a)){if(!a.length)return;var o=a,l=rge(o),c=l[0],u=l.slice(1);if(typeof c=="number"){pP(i.bind(null,u),c);return}i(c),pP(i.bind(null,u));return}Lw(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){r=!0},start:function(a){r=!1,n(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function wf(e){"@babel/helpers - typeof";return wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wf(e)}function vP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 58,692 bytes, lines 522-540
522t%2?vP(Object(r),!0).forEach(function(n){MD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MD(e,t,r){return t=lge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lge(e){var t=cge(e,"string");return wf(t)==="symbol"?t:String(t)}function cge(e,t){if(wf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uge=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,i){return n.filter(function(a){return i.includes(a)})})},dge=function(t){return t},fge=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},pd=function(t,r){return Object.keys(r).reduce(function(n,i){return yP(yP({},n),{},MD({},i,t(i,r[i])))},{})},xP=function(t,r,n){return t.map(function(i){return"".concat(fge(i)," ").concat(r,"ms ").concat(n)}).join(",")};function hge(e,t){return gge(e)||pge(e,t)||DD(e,t)||mge()}function mge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 523In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function gge(e){if(Array.isArray(e))return e}function vge(e){return bge(e)||xge(e)||DD(e)||yge()}function yge(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 524In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DD(e,t){if(e){if(typeof e=="string")return Fw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fw(e,t)}}function xge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bge(e){if(Array.isArray(e))return Fw(e)}function Fw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var og=1e-4,LD=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},FD=function(t,r){return t.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},bP=function(t,r){return function(n){var i=LD(t,r);return FD(i,n)}},wge=function(t,r){return function(n){var i=LD(t,r),a=[].concat(vge(i.map(function(o,l){return o*l}).slice(1)),[0]);return FD(a,n)}},wP=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0],a=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,a=0,o=1,l=1;break;case"ease":i=.25,a=.1,o=.25,l=1;break;case"ease-in":i=.42,a=0,o=1,l=1;break;case"ease-out":i=.42,a=0,o=.58,l=1;break;case"ease-in-out":i=0,a=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(v){return parseFloat(v)}),d=hge(u,4);i=d[0],a=d[1],o=d[2],l=d[3]}}}var f=bP(i,o),h=bP(a,l),m=wge(i,o),g=function(x){return x>1?1:x<0?0:x},p=function(x){for(var y=x>1?1:x,b=y,S=0;S<8;++S){var j=f(b)-y,N=m(b);if(Math.abs(j-y)<og||N<og)return h(b);b=g(b-j/N)}return h(b)};return p.isStepper=!1,p},jge=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var m=-(d-f)*n,g=h*a,p=h+(m-g)*l/1e3,v=h*l/1e3+d;return Math.abs(v-f)<og&&Math.abs(p)<og?[f,0]:[v,p]};return c.isStepper=!0,c.dt=l,c},Sge=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return wP(i);case"spring":return jge();default:if(i.split("(")[0]==="cubic-bezier")return wP(i)}return typeof i=="function"?i:null};function jf(e){"@babel/helpers - typeof";return jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jf(e)}function jP(e){return _ge(e)||Nge(e)||BD(e)||kge()}function kge(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 525In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _ge(e){if(Array.isArray(e))return Ww(e)}function SP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ft(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SP(Object(r),!0).forEach(function(n){Bw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bw(e,t,r){return t=Cge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cge(e){var t=Age(e,"string");return jf(t)==="symbol"?t:String(t)}function Age(e,t){if(jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ege(e,t){return Tge(e)||Oge(e,t)||BD(e,t)||Pge()}function Pge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 526In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BD(e,t){if(e){if(typeof e=="string")return Ww(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ww(e,t)}}function Ww(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Oge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Tge(e){if(Array.isArray(e))return e}var lg=function(t,r,n){return t+(r-t)*n},Uw=function(t){var r=t.from,n=t.to;return r!==n},$ge=function e(t,r,n){var i=pd(function(a,o){if(Uw(o)){var l=t(o.from,o.to,o.velocity),c=Ege(l,2),u=c[0],d=c[1];return Ft(Ft({},o),{},{from:u,velocity:d})}return o},r);return n<1?pd(function(a,o){return Uw(o)?Ft(Ft({},o),{},{velocity:lg(o.velocity,i[a].velocity,n),from:lg(o.from,i[a].from,n)}):o},r):e(t,i,n-1)};const Rge=function(e,t,r,n,i){var a=uge(e,t),o=a.reduce(function(v,x){return Ft(Ft({},v),{},Bw({},x,[e[x],t[x]]))},{}),l=a.reduce(function(v,x){return Ft(Ft({},v),{},Bw({},x,{from:e[x],velocity:0,to:t[x]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return pd(function(x,y){return y.from},l)},m=function(){return!Object.values(l).filter(Uw).length},g=function(x){u||(u=x);var y=x-u,b=y/r.dt;l=$ge(r,l,b),i(Ft(Ft(Ft({},e),t),h())),u=x,m()||(c=requestAnimationFrame(f))},p=function(x){d||(d=x);var y=(x-d)/n,b=pd(function(j,N){return lg.apply(void 0,jP(N).concat([r(y)]))},o);if(i(Ft(Ft(Ft({},e),t),b)),y<1)c=requestAnimationFrame(f);else{var S=pd(function(j,N){return lg.apply(void 0,jP(N).concat([r(1)]))},o);i(Ft(Ft(Ft({},e),t),S))}};return f=r.isStepper?g:p,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function xc(e){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(e)}var Ige=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Mge(e,t){if(e==null)return{};var r=Dge(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dge(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function Kx(e){return Wge(e)||Bge(e)||Fge(e)||Lge()}function Lge(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 527In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fge(e,t){if(e){if(typeof e=="string")return zw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zw(e,t)}}function Bge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wge(e){if(Array.isArray(e))return zw(e)}function zw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kP(Object(r),!0).forEach(function(n){qu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qu(e,t,r){return t=WD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,WD(n.key),n)}}function Vge(e,t,r){return t&&zge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function WD(e){var t=Hge(e,"string");return xc(t)==="symbol"?t:String(t)}function Hge(e,t){if(xc(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xc(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vw(e,t)}function Vw(e,t){return Vw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Vw(e,t)}function Gge(e){var t=Kge();return function(){var n=cg(e),i;if(t){var a=cg(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Hw(this,i)}}function Hw(e,t){if(t&&(xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qw(e)}function qw(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kge(){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 cg(e){return cg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cg(e)}var Yn=function(e){qge(r,e);var t=Gge(r);function r(n,i){var a;Uge(this,r),a=t.call(this,n,i);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,m=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(qw(a)),a.changeStyle=a.changeStyle.bind(qw(a)),!l||m<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),Hw(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},Hw(a);a.state={style:c?qu({},c,u):u}}else a.state={style:{}};return a}return Vge(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,h=this.state.style;if(l){if(!o){var m={style:c?qu({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(m);return}if(!(ege(i.to,d)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=g||u?f:i.to;if(this.state&&h){var v={style:c?qu({},c,p):p};(c&&h[c]!==p||!c&&h!==p)&&this.setState(v)}this.runAnimation(_n(_n({},this.props),{},{from:p,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,o=i.from,l=i.to,c=i.duration,u=i.easing,d=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,m=Rge(o,l,Sge(u),c,this.changeStyle),g=function(){a.stopJSAnimation=m()};this.manager.start([h,d,g,c,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,l=i.begin,c=i.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,m=function(p,v,x){if(x===0)return p;var y=v.duration,b=v.easing,S=b===void 0?"ease":b,j=v.style,N=v.properties,k=v.onAnimationEnd,_=x>0?o[x-1]:v,C=N||Object.keys(j);if(typeof S=="function"||S==="spring")return[].concat(Kx(p),[a.runJSAnimation.bind(a,{from:_.style,to:j,duration:y,easing:S}),y]);var P=xP(C,y,S),E=_n(_n(_n({},_.style),j),{},{transition:P});return[].concat(Kx(p),[E,y,k]).filter(dge)};return this.manager.start([c].concat(Kx(o.reduce(m,[d,Math.max(h,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=oge());var a=i.begin,o=i.duration,l=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,m=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof m=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var p=l?qu({},l,c):c,v=xP(Object.keys(p),o,u);g.start([d,a,_n(_n({},p),{},{transition:v}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=Mge(i,Ige),u=w.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var f=function(m){var g=m.props,p=g.style,v=p===void 0?{}:p,x=g.className,y=w.cloneElement(m,_n(_n({},c),{},{style:_n(_n({},v),d),className:x}));return y};return u===1?f(w.Children.only(a)):O.createElement("div",null,w.Children.map(a,function(h){return f(h)}))}}]),r}(w.PureComponent);Yn.displayName="Animate";Yn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Yn.propTypes={from:Ie.oneOfType([Ie.object,Ie.string]),to:Ie.oneOfType([Ie.object,Ie.string]),attributeName:Ie.string,duration:Ie.number,begin:Ie.number,easing:Ie.oneOfType([Ie.string,Ie.func]),steps:Ie.arrayOf(Ie.shape({duration:Ie.number.isRequired,style:Ie.object.isRequired,easing:Ie.oneOfType([Ie.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ie.func]),properties:Ie.arrayOf("string"),onAnimationEnd:Ie.func})),children:Ie.oneOfType([Ie.node,Ie.func]),isActive:Ie.bool,canBegin:Ie.bool,onAnimationEnd:Ie.func,shouldReAnimate:Ie.bool,onAnimationStart:Ie.func,onAnimationReStart:Ie.func};function Sf(e){"@babel/helpers - typeof";return Sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sf(e)}function ug(){return ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ug.apply(this,arguments)}function Yge(e,t){return Zge(e)||Jge(e,t)||Qge(e,t)||Xge()}function Xge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 528In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qge(e,t){if(e){if(typeof e=="string")return NP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NP(e,t)}}function NP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Zge(e){if(Array.isArray(e))return e}function _P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function CP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_P(Object(r),!0).forEach(function(n){eve(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_P(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eve(e,t,r){return t=tve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tve(e){var t=rve(e,"string");return Sf(t)=="symbol"?t:t+""}function rve(e,t){if(Sf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Sf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AP=function(t,r,n,i,a){var o=Math.min(Math.abs(n)/2,Math.abs(i)/2),l=i>=0?1:-1,c=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,d;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,m=4;h<m;h++)f[h]=a[h]>o?o:a[h];d="M".concat(t,",").concat(r+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(r)),d+="L ".concat(t+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, 529 `).concat(t+n,",").concat(r+l*f[1])),d+="L ".concat(t+n,",").concat(r+i-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, 530 `).concat(t+n-c*f[2],",").concat(r+i)),d+="L ".concat(t+c*f[3],",").concat(r+i),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, 531 `).concat(t,",").concat(r+i-l*f[3])),d+="Z"}else if(o>0&&a===+a&&a>0){var g=Math.min(o,a);d="M ".concat(t,",").concat(r+l*g,` 532 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(r,` 533 L `).concat(t+n-c*g,",").concat(r,` 534 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*g,` 535 L `).concat(t+n,",").concat(r+i-l*g,` 536 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n-c*g,",").concat(r+i,` 537 L `).concat(t+c*g,",").concat(r+i,` 538 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(r+i-l*g," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return d},nve=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return n>=u&&n<=d&&i>=f&&i<=h}return!1},ive={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},fk=function(t){var r=CP(CP({},ive),t),n=w.useRef(),i=w.useState(-1),a=Yge(i,2),o=a[0],l=a[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&l(S)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,h=r.radius,m=r.className,g=r.animationEasing,p=r.animationDuration,v=r.animationBegin,x=r.isAnimationActive,y=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var b=we("recharts-rectangle",m);return y?O.createElement(Yn,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:p,animationEasing:g,isActive:y},function(S){var j=S.width,N=S.height,k=S.x,_=S.y;return O.createElement(Yn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:p,isActive:x,easing:g},O.createElement("path",ug({},le(r,!0),{className:b,d:AP(k,_,j,N,h),ref:n})))}):O.createElement("path",ug({},le(r,!0),{className:b,d:AP(c,u,d,f,h)}))},ave=["points","className","baseLinePoints","connectNulls"];function wl(){return wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wl.apply(this,arguments)}function sve(e,t){if(e==null)return{};var r=ove(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ove(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function EP(e){return dve(e)||uve(e)||cve(e)||lve()}function lve(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 539In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cve(e,t){if(e){if(typeof e=="string")return Gw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gw(e,t)}}function uve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dve(e){if(Array.isArray(e))return Gw(e)}function Gw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var PP=function(t){return t&&t.x===+t.x&&t.y===+t.y},fve=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){PP(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),PP(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},gd=function(t,r){var n=fve(t);r&&(n=[n.reduce(function(a,o){return[].concat(EP(a),EP(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},hve=function(t,r,n){var i=gd(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(gd(r.reverse(),n).slice(1))},mve=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=sve(t,ave);if(!r||!r.length)return null;var l=we("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",u=hve(r,i,a);return O.createElement("g",{className:l},O.createElement("path",wl({},le(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?O.createElement("path",wl({},le(o,!0),{fill:"none",d:gd(r,a)})):null,c?O.createElement("path",wl({},le(o,!0),{fill:"none",d:gd(i,a)})):null)}var d=gd(r,a);return O.createElement("path",wl({},le(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function Kw(){return Kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kw.apply(this,arguments)}var ch=function(t){var r=t.cx,n=t.cy,i=t.r,a=t.className,o=we("recharts-dot",a);return r===+r&&n===+n&&i===+i?w.createElement("circle",Kw({},le(t,!1),Pp(t),{className:o,cx:r,cy:n,r:i})):null};function kf(e){"@babel/helpers - typeof";return kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kf(e)}var pve=["x","y","top","left","width","height","className"];function Yw(){return Yw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yw.apply(this,arguments)}function OP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OP(Object(r),!0).forEach(function(n){vve(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vve(e,t,r){return t=yve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yve(e){var t=xve(e,"string");return kf(t)=="symbol"?t:t+""}function xve(e,t){if(kf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(kf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bve(e,t){if(e==null)return{};var r=wve(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var jve=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},Sve=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,m=h===void 0?0:h,g=t.className,p=bve(t,pve),v=gve({x:n,y:a,top:l,left:u,width:f,height:m},p);return!K(n)||!K(a)||!K(f)||!K(m)||!K(l)||!K(u)?null:O.createElement("path",Yw({},le(v,!0),{className:we("recharts-cross",g),d:jve(n,a,f,m,l,u)}))},kve=ry,Nve=Z4,_ve=Ci;function Cve(e,t){return e&&e.length?kve(e,_ve(t),Nve):void 0}var Ave=Cve;const Eve=Le(Ave);var Pve=ry,Ove=Ci,Tve=eD;function $ve(e,t){return e&&e.length?Pve(e,Ove(t),Tve):void 0}var Rve=$ve;const Ive=Le(Rve);var Mve=["cx","cy","angle","ticks","axisLine"],Dve=["ticks","tick","angle","tickFormatter","stroke"];function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function vd(){return vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vd.apply(this,arguments)}function TP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _s(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TP(Object(r),!0).forEach(function(n){sy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $P(e,t){if(e==null)return{};var r=Lve(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Lve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Fve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zD(n.key),n)}}function Bve(e,t,r){return t&&RP(e.prototype,t),r&&RP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wve(e,t,r){return t=dg(t),Uve(e,UD()?Reflect.construct(t,r||[],dg(e).constructor):t.apply(e,r))}function Uve(e,t){if(t&&(bc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zve(e)}function zve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UD=function(){return!!e})()}function dg(e){return dg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dg(e)}function Vve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xw(e,t)}function Xw(e,t){return Xw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Xw(e,t)}function sy(e,t,r){return t=zD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zD(e){var t=Hve(e,"string");return bc(t)=="symbol"?t:t+""}function Hve(e,t){if(bc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oy=function(e){function t(){return Fve(this,t),Wve(this,t,arguments)}return Vve(t,e),Bve(t,[{key:"getTickValueCoord",value:function(n){var i=n.coordinate,a=this.props,o=a.angle,l=a.cx,c=a.cy;return Qe(l,c,i,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,i;switch(n){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.angle,l=n.ticks,c=Eve(l,function(d){return d.coordinate||0}),u=Ive(l,function(d){return d.coordinate||0});return{cx:i,cy:a,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.angle,l=n.ticks,c=n.axisLine,u=$P(n,Mve),d=l.reduce(function(g,p){return[Math.min(g[0],p.coordinate),Math.max(g[1],p.coordinate)]},[1/0,-1/0]),f=Qe(i,a,d[0],o),h=Qe(i,a,d[1],o),m=_s(_s(_s({},le(u,!1)),{},{fill:"none"},le(c,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return O.createElement("line",vd({className:"recharts-polar-radius-axis-line"},m))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,l=i.angle,c=i.tickFormatter,u=i.stroke,d=$P(i,Dve),f=this.getTickTextAnchor(),h=le(d,!1),m=le(o,!1),g=a.map(function(p,v){var x=n.getTickValueCoord(p),y=_s(_s(_s(_s({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(x.x,", ").concat(x.y,")")},h),{},{stroke:"none",fill:u},m),{},{index:v},x),{},{payload:p});return O.createElement(Ae,vd({className:we("recharts-polar-radius-axis-tick",AD(o)),key:"tick-".concat(p.coordinate)},go(n.props,p,v)),t.renderTickItem(o,y,c?c(p.value,v):p.value))});return O.createElement(Ae,{className:"recharts-polar-radius-axis-ticks"},g)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.axisLine,o=n.tick;return!i||!i.length?null:O.createElement(Ae,{className:we("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),o&&this.renderTicks(),Rt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,i,a){var o;return O.isValidElement(n)?o=O.cloneElement(n,i):he(n)?o=n(i):o=O.createElement(vo,vd({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),o}}])}(w.PureComponent);sy(oy,"displayName","PolarRadiusAxis");sy(oy,"axisType","radiusAxis");sy(oy,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function wc(e){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(e)}function Is(){return Is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Is.apply(this,arguments)}function IP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Cs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?IP(Object(r),!0).forEach(function(n){ly(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,HD(n.key),n)}}function Gve(e,t,r){return t&&MP(e.prototype,t),r&&MP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kve(e,t,r){return t=fg(t),Yve(e,VD()?Reflect.construct(t,r||[],fg(e).constructor):t.apply(e,r))}function Yve(e,t){if(t&&(wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xve(e)}function Xve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VD=function(){return!!e})()}function fg(e){return fg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fg(e)}function Qve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qw(e,t)}function Qw(e,t){return Qw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qw(e,t)}function ly(e,t,r){return t=HD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HD(e){var t=Jve(e,"string");return wc(t)=="symbol"?t:t+""}function Jve(e,t){if(wc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zve=Math.PI/180,DP=1e-5,cy=function(e){function t(){return qve(this,t),Kve(this,t,arguments)}return Qve(t,e),Gve(t,[{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.cx,o=i.cy,l=i.radius,c=i.orientation,u=i.tickSize,d=u||8,f=Qe(a,o,l,n.coordinate),h=Qe(a,o,l+(c==="inner"?-1:1)*d,n.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(n){var i=this.props.orientation,a=Math.cos(-n.coordinate*Zve),o;return a>DP?o=i==="outer"?"start":"end":a<-DP?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,l=n.axisLine,c=n.axisLineType,u=Cs(Cs({},le(this.props,!1)),{},{fill:"none"},le(l,!1));if(c==="circle")return O.createElement(ch,Is({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var d=this.props.ticks,f=d.map(function(h){return Qe(i,a,o,h.coordinate)});return O.createElement(mve,Is({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,l=i.tickLine,c=i.tickFormatter,u=i.stroke,d=le(this.props,!1),f=le(o,!1),h=Cs(Cs({},d),{},{fill:"none"},le(l,!1)),m=a.map(function(g,p){var v=n.getTickLineCoord(g),x=n.getTickTextAnchor(g),y=Cs(Cs(Cs({textAnchor:x},d),{},{stroke:"none",fill:u},f),{},{index:p,payload:g,x:v.x2,y:v.y2});return O.createElement(Ae,Is({className:we("recharts-polar-angle-axis-tick",AD(o)),key:"tick-".concat(g.coordinate)},go(n.props,g,p)),l&&O.createElement("line",Is({className:"recharts-polar-angle-axis-tick-line"},h,v)),o&&t.renderTickItem(o,y,c?c(g.value,p):g.value))});return O.createElement(Ae,{className:"recharts-polar-angle-axis-ticks"},m)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:O.createElement(Ae,{className:we("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return O.isValidElement(n)?o=O.cloneElement(n,i):he(n)?o=n(i):o=O.createElement(vo,Is({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(w.PureComponent);ly(cy,"displayName","PolarAngleAxis");ly(cy,"axisType","angleAxis");ly(cy,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var eye=Y3,tye=eye(Object.getPrototypeOf,Object),rye=tye,nye=ca,iye=rye,aye=ua,sye="[object Object]",oye=Function.prototype,lye=Object.prototype,qD=oye.toString,cye=lye.hasOwnProperty,uye=qD.call(Object);function dye(e){if(!aye(e)||nye(e)!=sye)return!1;var t=iye(e);if(t===null)return!0;var r=cye.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&qD.call(r)==uye}var fye=dye;const hye=Le(fye);var mye=ca,pye=ua,gye="[object Boolean]";function vye(e){return e===!0||e===!1||pye(e)&&mye(e)==gye}var yye=vye;const xye=Le(yye);function Nf(e){"@babel/helpers - typeof";return Nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nf(e)}function hg(){return hg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hg.apply(this,arguments)}function bye(e,t){return kye(e)||Sye(e,t)||jye(e,t)||wye()}function wye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 540In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jye(e,t){if(e){if(typeof e=="string")return LP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LP(e,t)}}function LP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Sye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function kye(e){if(Array.isArray(e))return e}function FP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function BP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FP(Object(r),!0).forEach(function(n){Nye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Nye(e,t,r){return t=_ye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _ye(e){var t=Cye(e,"string");return Nf(t)=="symbol"?t:t+""}function Cye(e,t){if(Nf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WP=function(t,r,n,i,a){var o=n-i,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-o/2,",").concat(r+a),l+="L ".concat(t+n-o/2-i,",").concat(r+a),l+="L ".concat(t,",").concat(r," Z"),l},Aye={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Eye=function(t){var r=BP(BP({},Aye),t),n=w.useRef(),i=w.useState(-1),a=bye(i,2),o=a[0],l=a[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var b=n.current.getTotalLength();b&&l(b)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,f=r.lowerWidth,h=r.height,m=r.className,g=r.animationEasing,p=r.animationDuration,v=r.animationBegin,x=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var y=we("recharts-trapezoid",m);return x?O.createElement(Yn,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:p,animationEasing:g,isActive:x},function(b){var S=b.upperWidth,j=b.lowerWidth,N=b.height,k=b.x,_=b.y;return O.createElement(Yn,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:p,easing:g},O.createElement("path",hg({},le(r,!0),{className:y,d:WP(k,_,S,j,N),ref:n})))}):O.createElement("g",null,O.createElement("path",hg({},le(r,!0),{className:y,d:WP(c,u,d,f,h)})))},Pye=["option","shapeType","propTransformer","activeClassName","isActive"];function _f(e){"@babel/helpers - typeof";return _f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_f(e)}function Oye(e,t){if(e==null)return{};var r=Tye(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function UP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UP(Object(r),!0).forEach(function(n){$ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $ye(e,t,r){return t=Rye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rye(e){var t=Iye(e,"string");return _f(t)=="symbol"?t:t+""}function Iye(e,t){if(_f(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_f(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mye(e,t){return mg(mg({},t),e)}function Dye(e,t){return e==="symbols"}function zP(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return O.createElement(fk,r);case"trapezoid":return O.createElement(Eye,r);case"sector":return O.createElement(OD,r);case"symbols":if(Dye(t))return O.createElement(OS,r);break;default:return null}}function Lye(e){return w.isValidElement(e)?e.props:e}function GD(e){var t=e.option,r=e.shapeType,n=e.propTransformer,i=n===void 0?Mye:n,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=Oye(e,Pye),u;if(w.isValidElement(t))u=w.cloneElement(t,mg(mg({},c),Lye(t)));else if(he(t))u=t(c);else if(hye(t)&&!xye(t)){var d=i(t,c);u=O.createElement(zP,{shapeType:r,elementProps:d})}else{var f=c;u=O.createElement(zP,{shapeType:r,elementProps:f})}return l?O.createElement(Ae,{className:o},u):u}function uy(e,t){return t!=null&&"trapezoids"in e.props}function dy(e,t){return t!=null&&"sectors"in e.props}function Cf(e,t){return t!=null&&"points"in e.props}function Fye(e,t){var r,n,i=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,a=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return i&&a}function Bye(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Wye(e,t){var r=e.x===t.x,n=e.y===t.y,i=e.z===t.z;return r&&n&&i}function Uye(e,t){var r;return uy(e,t)?r=Fye:dy(e,t)?r=Bye:Cf(e,t)&&(r=Wye),r}function zye(e,t){var r;return uy(e,t)?r="trapezoids":dy(e,t)?r="sectors":Cf(e,t)&&(r="points"),r}function Vye(e,t){if(uy(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(dy(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Cf(e,t)?t.payload:{}}function Hye(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,i=zye(r,t),a=Vye(r,t),o=n.filter(function(c,u){var d=yo(a,c),f=r.props[i].filter(function(g){var p=Uye(r,t);return p(g,t)}),h=r.props[i].indexOf(f[f.length-1]),m=u===h;return d&&m}),l=n.indexOf(o[o.length-1]);return l}var Wm;function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function jl(){return jl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jl.apply(this,arguments)}function VP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VP(Object(r),!0).forEach(function(n){on(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,YD(n.key),n)}}function Gye(e,t,r){return t&&HP(e.prototype,t),r&&HP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kye(e,t,r){return t=pg(t),Yye(e,KD()?Reflect.construct(t,r||[],pg(e).constructor):t.apply(e,r))}function Yye(e,t){if(t&&(jc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xye(e)}function Xye(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KD=function(){return!!e})()}function pg(e){return pg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pg(e)}function Qye(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jw(e,t)}function Jw(e,t){return Jw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Jw(e,t)}function on(e,t,r){return t=YD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YD(e){var t=Jye(e,"string");return jc(t)=="symbol"?t:t+""}function Jye(e,t){if(jc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ai=function(e){function t(r){var n;return qye(this,t),n=Kye(this,t,[r]),on(n,"pieRef",null),on(n,"sectorRefs",[]),on(n,"id",Oo("recharts-pie-")),on(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),he(i)&&i()}),on(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),he(i)&&i()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return Qye(t,e),Gye(t,[{key:"isActiveIndex",value:function(n){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(n)!==-1:n===i}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.label,l=a.labelLine,c=a.dataKey,u=a.valueKey,d=le(this.props,!1),f=le(o,!1),h=le(l,!1),m=o&&o.offsetRadius||20,g=n.map(function(p,v){var x=(p.startAngle+p.endAngle)/2,y=Qe(p.cx,p.cy,p.outerRadius+m,x),b=Ke(Ke(Ke(Ke({},d),p),{},{stroke:"none"},f),{},{index:v,textAnchor:t.getTextAnchor(y.x,p.cx)},y),S=Ke(Ke(Ke(Ke({},d),p),{},{fill:"none",stroke:p.fill},h),{},{index:v,points:[Qe(p.cx,p.cy,p.outerRadius,x),y]}),j=c;return xe(c)&&xe(u)?j="value":xe(c)&&(j=u),O.createElement(Ae,{key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(v)},l&&t.renderLabelLineItem(l,S,"line"),t.renderLabelItem(o,b,gt(p,j)))});return O.createElement(Ae,{className:"recharts-pie-labels"},g)}},{key:"renderSectorsStatically",value:function(n){var i=this,a=this.props,o=a.activeShape,l=a.blendStroke,c=a.inactiveShape;return n.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var f=i.isActiveIndex(d),h=c&&i.hasActiveIndex()?c:null,m=f?o:h,g=Ke(Ke({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return O.createElement(Ae,jl({ref:function(v){v&&!i.sectorRefs.includes(v)&&i.sectorRefs.push(v)},tabIndex:-1,className:"recharts-pie-sector"},go(i.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),O.createElement(GD,jl({option:m,isActive:f,shapeType:"sector"},g)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,i=this.props,a=i.sectors,o=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,u=i.animationEasing,d=i.animationId,f=this.state,h=f.prevSectors,m=f.prevIsAnimationActive;return O.createElement(Yn,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(m),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(g){var p=g.t,v=[],x=a&&a[0],y=x.startAngle;return a.forEach(function(b,S){var j=h&&h[S],N=S>0?zr(b,"paddingAngle",0):0;if(j){var k=_t(j.endAngle-j.startAngle,b.endAngle-b.startAngle),_=Ke(Ke({},b),{},{startAngle:y+N,endAngle:y+k(p)+N});v.push(_),y=_.endAngle}else{var C=b.endAngle,P=b.startAngle,E=_t(0,C-P),A=E(p),R=Ke(Ke({},b),{},{startAngle:y+N,endAngle:y+A+N});v.push(R),y=R.endAngle}}),O.createElement(Ae,null,n.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!yo(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,l=i.className,c=i.label,u=i.cx,d=i.cy,f=i.innerRadius,h=i.outerRadius,m=i.isAnimationActive,g=this.state.isAnimationFinished;if(a||!o||!o.length||!K(u)||!K(d)||!K(f)||!K(h))return null;var p=we("recharts-pie",l);return O.createElement(Ae,{tabIndex:this.props.rootTabIndex,className:p,ref:function(x){n.pieRef=x}},this.renderSectors(),c&&this.renderLabels(o),Rt.renderCallByParent(this.props,null,!1),(!m||g)&&yi.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,i,a){if(O.isValidElement(n))return O.cloneElement(n,i);if(he(n))return n(i);var o=we("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return O.createElement(ao,jl({},i,{key:a,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,i,a){if(O.isValidElement(n))return O.cloneElement(n,i);var o=a;if(he(n)&&(o=n(i),O.isValidElement(o)))return o;var l=we("recharts-pie-label-text",typeof n!="boolean"&&!he(n)?n.className:"");return O.createElement(vo,jl({},i,{alignmentBaseline:"middle",className:l}),o)}}])}(w.PureComponent);Wm=Ai;on(Ai,"displayName","Pie");on(Ai,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!zn.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});on(Ai,"parseDeltaAngle",function(e,t){var r=or(t-e),n=Math.min(Math.abs(t-e),360);return r*n});on(Ai,"getRealPieData",function(e){var t=e.data,r=e.children,n=le(e,!1),i=Vr(r,To);return t&&t.length?t.map(function(a,o){return Ke(Ke(Ke({payload:a},n),a),i&&i[o]&&i[o].props)}):i&&i.length?i.map(function(a){return Ke(Ke({},n),a.props)}):[]});on(Ai,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,i=t.width,a=t.height,o=CD(i,a),l=n+lr(e.cx,i,i/2),c=r+lr(e.cy,a,a/2),u=lr(e.innerRadius,o,0),d=lr(e.outerRadius,o,o*.8),f=e.maxRadius||Math.sqrt(i*i+a*a)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:f}});on(Ai,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?Ke(Ke({},t.type.defaultProps),t.props):t.props,i=Wm.getRealPieData(n);if(!i||!i.length)return null;var a=n.cornerRadius,o=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,d=n.nameKey,f=n.valueKey,h=n.tooltipType,m=Math.abs(n.minAngle),g=Wm.parseCoordinateOfPie(n,r),p=Wm.parseDeltaAngle(o,l),v=Math.abs(p),x=u;xe(u)&&xe(f)?(Un(!1,`Use "dataKey" to specify the value of pie,
541 the props "valueKey" will be deprecated in 1.1.0`),x="value"):xe(u)&&(Un(!1,`Use "dataKey" to specify the value of pie, 542 the props "valueKey" will be deprecated in 1.1.0`),x=f);var y=i.filter(function(_){return gt(_,x,0)!==0}).length,b=(v>=360?y:y-1)*c,S=v-y*m-b,j=i.reduce(function(_,C){var P=gt(C,x,0);return _+(K(P)?P:0)},0),N;if(j>0){var k;N=i.map(function(_,C){var P=gt(_,x,0),E=gt(_,d,C),A=(K(P)?P:0)/j,R;C?R=k.endAngle+or(p)*c*(P!==0?1:0):R=o;var $=R+or(p)*((P!==0?m:0)+A*S),D=(R+$)/2,M=(g.innerRadius+g.outerRadius)/2,I=[{name:E,value:P,payload:_,dataKey:x,type:h}],T=Qe(g.cx,g.cy,M,D);return k=Ke(Ke(Ke({percent:A,cornerRadius:a,name:E,tooltipPayload:I,midAngle:D,middleRadius:M,tooltipPosition:T},_),g),{},{value:gt(_,x),startAngle:R,endAngle:$,payload:_,paddingAngle:or(p)*c}),k})}return Ke(Ke({},g),{},{sectors:N,data:i})});var Zye=Math.ceil,exe=Math.max;function txe(e,t,r,n){for(var i=-1,a=exe(Zye((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var rxe=txe,nxe=m4,qP=1/0,ixe=17976931348623157e292;function axe(e){if(!e)return e===0?e:0;if(e=nxe(e),e===qP||e===-qP){var t=e<0?-1:1;return t*ixe}return e===e?e:0}var XD=axe,sxe=rxe,oxe=Yv,Yx=XD;function lxe(e){return function(t,r,n){return n&&typeof n!="number"&&oxe(t,r,n)&&(r=n=void 0),t=Yx(t),r===void 0?(r=t,t=0):r=Yx(r),n=n===void 0?t<r?1:-1:Yx(n),sxe(t,r,n,e)}}var cxe=lxe,uxe=cxe,dxe=uxe(),fxe=dxe;const gg=Le(fxe);function Af(e){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(e)}function GP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function KP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GP(Object(r),!0).forEach(function(n){QD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QD(e,t,r){return t=hxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hxe(e){var t=mxe(e,"string");return Af(t)=="symbol"?t:t+""}function mxe(e,t){if(Af(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Af(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pxe=["Webkit","Moz","O","ms"],gxe=function(t,r){var n=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=pxe.reduce(function(a,o){return KP(KP({},a),{},QD({},o+n,r))},{});return i[t]=r,i};function Sc(e){"@babel/helpers - typeof";return Sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sc(e)}function vg(){return vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vg.apply(this,arguments)}function YP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Xx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YP(Object(r),!0).forEach(function(n){Rr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ZD(n.key),n)}}function yxe(e,t,r){return t&&XP(e.prototype,t),r&&XP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xxe(e,t,r){return t=yg(t),bxe(e,JD()?Reflect.construct(t,r||[],yg(e).constructor):t.apply(e,r))}function bxe(e,t){if(t&&(Sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wxe(e)}function wxe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JD=function(){return!!e})()}function yg(e){return yg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yg(e)}function jxe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zw(e,t)}
vendor: 131,109 bytes, lines 542-547
542function Zw(e,t){return Zw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zw(e,t)}function Rr(e,t,r){return t=ZD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZD(e){var t=Sxe(e,"string");return Sc(t)=="symbol"?t:t+""}function Sxe(e,t){if(Sc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Sc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kxe=function(t){var r=t.data,n=t.startIndex,i=t.endIndex,a=t.x,o=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=hd().domain(gg(0,c)).range([a,a+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(i),scale:u,scaleValues:d}},QP=function(t){return t.changedTouches&&!!t.changedTouches.length},kc=function(e){function t(r){var n;return vxe(this,t),n=xxe(this,t,[r]),Rr(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),Rr(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),Rr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,l=i.startIndex;o==null||o({endIndex:a,startIndex:l})}),n.detachDragEndListener()}),Rr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Rr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Rr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Rr(n,"handleSlideDragStart",function(i){var a=QP(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return jxe(t,e),yxe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(i,a),h=Math.max(i,a),m=t.getIndexInRange(o,f),g=t.getIndexInRange(o,h);return{startIndex:m-m%c,endIndex:g===d?d:g-g%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,l=i.dataKey,c=gt(a[n],l,n);return he(o)?o(c,n):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(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,l=i.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,m=c.endIndex,g=c.onChange,p=n.pageX-a;p>0?p=Math.min(p,u+d-f-l,u+d-f-o):p<0&&(p=Math.max(p,u-o,u-l));var v=this.getIndex({startX:o+p,endX:l+p});(v.startIndex!==h||v.endIndex!==m)&&g&&g(v),this.setState({startX:o+p,endX:l+p,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=QP(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,l=i.endX,c=i.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,m=d.travellerWidth,g=d.onChange,p=d.gap,v=d.data,x={startX:this.state.startX,endX:this.state.endX},y=n.pageX-a;y>0?y=Math.min(y,f+h-m-u):y<0&&(y=Math.max(y,f-u)),x[o]=u+y;var b=this.getIndex(x),S=b.startIndex,j=b.endIndex,N=function(){var _=v.length-1;return o==="startX"&&(l>c?S%p===0:j%p===0)||l<c&&j===_||o==="endX"&&(l>c?j%p===0:S%p===0)||l>c&&j===_};this.setState(Rr(Rr({},o,u+y),"brushMoveStartX",n.pageX),function(){g&&N()&&g(b)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[i],f=l.indexOf(d);if(f!==-1){var h=f+n;if(!(h===-1||h>=l.length)){var m=l[h];i==="startX"&&m>=u||i==="endX"&&m<=c||this.setState(Rr({},i,m),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,l=n.height,c=n.fill,u=n.stroke;return O.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,l=n.height,c=n.data,u=n.children,d=n.padding,f=w.Children.only(u);return f?O.cloneElement(f,{x:i,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,m=c.ariaLabel,g=c.data,p=c.startIndex,v=c.endIndex,x=Math.max(n,this.props.x),y=Xx(Xx({},le(this.props,!1)),{},{x,y:u,width:d,height:f}),b=m||"Min value: ".concat((a=g[p])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=g[v])===null||o===void 0?void 0:o.name);return O.createElement(Ae,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,y))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(n,i)+u,f=Math.max(Math.abs(i-n)-u,0);return O.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:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,h=d.endX,m=5,g={pointerEvents:"none",fill:u};return O.createElement(Ae,{className:"recharts-brush-texts"},O.createElement(vo,vg({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-m,y:o+l/2},g),this.getTextOfTick(i)),O.createElement(vo,vg({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+m,y:o+l/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,l=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,h=this.state,m=h.startX,g=h.endX,p=h.isTextActive,v=h.isSlideMoving,x=h.isTravellerMoving,y=h.isTravellerFocused;if(!i||!i.length||!K(l)||!K(c)||!K(u)||!K(d)||u<=0||d<=0)return null;var b=we("recharts-brush",a),S=O.Children.count(o)===1,j=gxe("userSelect","none");return O.createElement(Ae,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(m,g),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(g,"endX"),(p||v||x||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,l=n.height,c=n.stroke,u=Math.floor(a+l/2)-1;return O.createElement(O.Fragment,null,O.createElement("rect",{x:i,y:a,width:o,height:l,fill:c,stroke:"none"}),O.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),O.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return O.isValidElement(n)?a=O.cloneElement(n,i):he(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Xx({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?kxe({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+o-c]);var h=i.scale.domain().map(function(m){return i.scale(m)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>i?l=c:o=c}return i>=n[l]?l:o}}])}(w.PureComponent);Rr(kc,"displayName","Brush");Rr(kc,"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 Nxe=LS;function _xe(e,t){var r;return Nxe(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var Cxe=_xe,Axe=W3,Exe=Ci,Pxe=Cxe,Oxe=Er,Txe=Yv;function $xe(e,t,r){var n=Oxe(e)?Axe:Pxe;return r&&Txe(e,t,r)&&(t=void 0),n(e,Exe(t))}var Rxe=$xe;const Ixe=Le(Rxe);var xi=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},JP=c4;function Mxe(e,t,r){t=="__proto__"&&JP?JP(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Dxe=Mxe,Lxe=Dxe,Fxe=o4,Bxe=Ci;function Wxe(e,t){var r={};return t=Bxe(t),Fxe(e,function(n,i,a){Lxe(r,i,t(n,i,a))}),r}var Uxe=Wxe;const zxe=Le(Uxe);function Vxe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var Hxe=Vxe,qxe=LS;function Gxe(e,t){var r=!0;return qxe(e,function(n,i,a){return r=!!t(n,i,a),r}),r}var Kxe=Gxe,Yxe=Hxe,Xxe=Kxe,Qxe=Ci,Jxe=Er,Zxe=Yv;function e0e(e,t,r){var n=Jxe(e)?Yxe:Xxe;return r&&Zxe(e,t,r)&&(t=void 0),n(e,Qxe(t))}var t0e=e0e;const e5=Le(t0e);var r0e=["x","y"];function Ef(e){"@babel/helpers - typeof";return Ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ef(e)}function e1(){return e1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e1.apply(this,arguments)}function ZP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZP(Object(r),!0).forEach(function(n){n0e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function n0e(e,t,r){return t=i0e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i0e(e){var t=a0e(e,"string");return Ef(t)=="symbol"?t:t+""}function a0e(e,t){if(Ef(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ef(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function s0e(e,t){if(e==null)return{};var r=o0e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function o0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function l0e(e,t){var r=e.x,n=e.y,i=s0e(e,r0e),a="".concat(r),o=parseInt(a,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||i.height),d=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return Pu(Pu(Pu(Pu(Pu({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function eO(e){return O.createElement(GD,e1({shapeType:"rectangle",propTransformer:l0e,activeClassName:"recharts-active-bar"},e))}var c0e=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=K(n)||IJ(n);return a?t(n,i):(a||bo(),r)}},u0e=["value","background"],t5;function Nc(e){"@babel/helpers - typeof";return Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}function d0e(e,t){if(e==null)return{};var r=f0e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xg(){return xg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xg.apply(this,arguments)}function tO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tO(Object(r),!0).forEach(function(n){Va(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function h0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n5(n.key),n)}}function m0e(e,t,r){return t&&rO(e.prototype,t),r&&rO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p0e(e,t,r){return t=bg(t),g0e(e,r5()?Reflect.construct(t,r||[],bg(e).constructor):t.apply(e,r))}function g0e(e,t){if(t&&(Nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return v0e(e)}function v0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r5=function(){return!!e})()}function bg(e){return bg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bg(e)}function y0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&t1(e,t)}function t1(e,t){return t1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},t1(e,t)}function Va(e,t,r){return t=n5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n5(e){var t=x0e(e,"string");return Nc(t)=="symbol"?t:t+""}function x0e(e,t){if(Nc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hr=function(e){function t(){var r;h0e(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=p0e(this,t,[].concat(i)),Va(r,"state",{isAnimationFinished:!1}),Va(r,"id",Oo("recharts-bar-")),Va(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),Va(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return y0e(t,e),m0e(t,[{key:"renderRectanglesStatically",value:function(n){var i=this,a=this.props,o=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=le(this.props,!1);return n&&n.map(function(f,h){var m=h===c,g=m?u:o,p=vt(vt(vt({},d),f),{},{isActive:m,option:g,index:h,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return O.createElement(Ae,xg({className:"recharts-bar-rectangle"},go(i.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),O.createElement(eO,p))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,a=i.data,o=i.layout,l=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,f=i.animationId,h=this.state.prevData;return O.createElement(Yn,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var g=m.t,p=a.map(function(v,x){var y=h&&h[x];if(y){var b=_t(y.x,v.x),S=_t(y.y,v.y),j=_t(y.width,v.width),N=_t(y.height,v.height);return vt(vt({},v),{},{x:b(g),y:S(g),width:j(g),height:N(g)})}if(o==="horizontal"){var k=_t(0,v.height),_=k(g);return vt(vt({},v),{},{y:v.y+v.height-_,height:_})}var C=_t(0,v.width),P=C(g);return vt(vt({},v),{},{width:P})});return O.createElement(Ae,null,n.renderRectanglesStatically(p))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,a=n.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!yo(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,a=i.data,o=i.dataKey,l=i.activeIndex,c=le(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,h=d0e(u,u0e);if(!f)return null;var m=vt(vt(vt(vt(vt({},h),{},{fill:"#eee"},f),c),go(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return O.createElement(eO,xg({key:"background-bar-".concat(d),option:n.props.background,isActive:d===l},m))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=Vr(d,lh);if(!f)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,m=function(v,x){var y=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:y,errorVal:gt(v,x)}},g={clipPath:n?"url(#clipPath-".concat(i,")"):null};return O.createElement(Ae,g,f.map(function(p){return O.cloneElement(p,{key:"error-bar-".concat(i,"-").concat(p.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:m})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.data,o=n.className,l=n.xAxis,c=n.yAxis,u=n.left,d=n.top,f=n.width,h=n.height,m=n.isAnimationActive,g=n.background,p=n.id;if(i||!a||!a.length)return null;var v=this.state.isAnimationFinished,x=we("recharts-bar",o),y=l&&l.allowDataOverflow,b=c&&c.allowDataOverflow,S=y||b,j=xe(p)?this.id:p;return O.createElement(Ae,{className:x},y||b?O.createElement("defs",null,O.createElement("clipPath",{id:"clipPath-".concat(j)},O.createElement("rect",{x:y?u:u-f/2,y:b?d:d-h/2,width:y?f:f*2,height:b?h:h*2}))):null,O.createElement(Ae,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(j,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,j),(!m||v)&&yi.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])}(w.PureComponent);t5=Hr;Va(Hr,"displayName","Bar");Va(Hr,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!zn.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Va(Hr,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,m=Zhe(n,r);if(!m)return null;var g=t.layout,p=r.type.defaultProps,v=p!==void 0?vt(vt({},p),r.props):r.props,x=v.dataKey,y=v.children,b=v.minPointSize,S=g==="horizontal"?o:a,j=u?S.scale.domain():null,N=sme({numericAxis:S}),k=Vr(y,To),_=f.map(function(C,P){var E,A,R,$,D,M;u?E=eme(u[d+P],j):(E=gt(C,x),Array.isArray(E)||(E=[N,E]));var I=c0e(b,t5.defaultProps.minPointSize)(E[1],P);if(g==="horizontal"){var T,L=[o.scale(E[0]),o.scale(E[1])],B=L[0],H=L[1];A=HE({axis:a,ticks:l,bandSize:i,offset:m.offset,entry:C,index:P}),R=(T=H??B)!==null&&T!==void 0?T:void 0,$=m.size;var z=B-H;if(D=Number.isNaN(z)?0:z,M={x:A,y:o.y,width:$,height:o.height},Math.abs(I)>0&&Math.abs(D)<Math.abs(I)){var q=or(D||I)*(Math.abs(I)-Math.abs(D));R-=q,D+=q}}else{var te=[a.scale(E[0]),a.scale(E[1])],ve=te[0],Pe=te[1];if(A=ve,R=HE({axis:o,ticks:c,bandSize:i,offset:m.offset,entry:C,index:P}),$=Pe-ve,D=m.size,M={x:a.x,y:R,width:a.width,height:D},Math.abs(I)>0&&Math.abs($)<Math.abs(I)){var Q=or($||I)*(Math.abs(I)-Math.abs($));$+=Q}}return vt(vt(vt({},C),{},{x:A,y:R,width:$,height:D,value:u?E:E[1],payload:C,background:M},k&&k[P]&&k[P].props),{},{tooltipPayload:[ND(r,C)],tooltipPosition:{x:A+$/2,y:R+D/2}})});return vt({data:_,layout:g},h)});function Pf(e){"@babel/helpers - typeof";return Pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(e)}function b0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i5(n.key),n)}}function w0e(e,t,r){return t&&nO(e.prototype,t),r&&nO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function iO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function In(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iO(Object(r),!0).forEach(function(n){fy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fy(e,t,r){return t=i5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i5(e){var t=j0e(e,"string");return Pf(t)=="symbol"?t:t+""}function j0e(e,t){if(Pf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hk=function(t,r,n,i,a){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(r),f={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!Mr(u,Hr);return d.reduce(function(m,g){var p=r[g],v=p.orientation,x=p.domain,y=p.padding,b=y===void 0?{}:y,S=p.mirror,j=p.reversed,N="".concat(v).concat(S?"Mirror":""),k,_,C,P,E;if(p.type==="number"&&(p.padding==="gap"||p.padding==="no-gap")){var A=x[1]-x[0],R=1/0,$=p.categoricalDomain.sort(LJ);if($.forEach(function(te,ve){ve>0&&(R=Math.min((te||0)-($[ve-1]||0),R))}),Number.isFinite(R)){var D=R/A,M=p.layout==="vertical"?n.height:n.width;if(p.padding==="gap"&&(k=D*M/2),p.padding==="no-gap"){var I=lr(t.barCategoryGap,D*M),T=D*M/2;k=T-I-(T-I)/M*I}}}i==="xAxis"?_=[n.left+(b.left||0)+(k||0),n.left+n.width-(b.right||0)-(k||0)]:i==="yAxis"?_=c==="horizontal"?[n.top+n.height-(b.bottom||0),n.top+(b.top||0)]:[n.top+(b.top||0)+(k||0),n.top+n.height-(b.bottom||0)-(k||0)]:_=p.range,j&&(_=[_[1],_[0]]);var L=wD(p,a,h),B=L.scale,H=L.realScaleType;B.domain(x).range(_),jD(B);var z=SD(B,In(In({},p),{},{realScaleType:H}));i==="xAxis"?(E=v==="top"&&!S||v==="bottom"&&S,C=n.left,P=f[N]-E*p.height):i==="yAxis"&&(E=v==="left"&&!S||v==="right"&&S,C=f[N]-E*p.width,P=n.top);var q=In(In(In({},p),z),{},{realScaleType:H,x:C,y:P,scale:B,width:i==="xAxis"?n.width:p.width,height:i==="yAxis"?n.height:p.height});return q.bandSize=ig(q,z),!p.hide&&i==="xAxis"?f[N]+=(E?-1:1)*q.height:p.hide||(f[N]+=(E?-1:1)*q.width),In(In({},m),{},fy({},g,q))},{})},a5=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},S0e=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return a5({x:r,y:n},{x:i,y:a})},s5=function(){function e(t){b0e(this,e),this.scale=t}return w0e(e,[{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(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();fy(s5,"EPS",1e-4);var mk=function(t){var r=Object.keys(t).reduce(function(n,i){return In(In({},n),{},fy({},i,s5.create(t[i])))},{});return In(In({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return zxe(i,function(c,u){return r[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return e5(i,function(a,o){return r[o].isInRange(a)})}})};function k0e(e){return(e%180+180)%180}var N0e=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=k0e(i),o=a*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},_0e=Ci,C0e=nh,A0e=Gv;function E0e(e){return function(t,r,n){var i=Object(t);if(!C0e(t)){var a=_0e(r);t=A0e(t),r=function(l){return a(i[l],l,i)}}var o=e(t,r,n);return o>-1?i[a?t[o]:o]:void 0}}var P0e=E0e,O0e=XD;function T0e(e){var t=O0e(e),r=t%1;return t===t?r?t-r:t:0}var $0e=T0e,R0e=t4,I0e=Ci,M0e=$0e,D0e=Math.max;function L0e(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:M0e(r);return i<0&&(i=D0e(n+i,0)),R0e(e,I0e(t),i)}var F0e=L0e,B0e=P0e,W0e=F0e,U0e=B0e(W0e),z0e=U0e;const V0e=Le(z0e);var H0e=FQ(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),pk=w.createContext(void 0),gk=w.createContext(void 0),o5=w.createContext(void 0),l5=w.createContext({}),c5=w.createContext(void 0),u5=w.createContext(0),d5=w.createContext(0),aO=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=H0e(a);return O.createElement(pk.Provider,{value:n},O.createElement(gk.Provider,{value:i},O.createElement(l5.Provider,{value:a},O.createElement(o5.Provider,{value:d},O.createElement(c5.Provider,{value:o},O.createElement(u5.Provider,{value:u},O.createElement(d5.Provider,{value:c},l)))))))},q0e=function(){return w.useContext(c5)},f5=function(t){var r=w.useContext(pk);r==null&&bo();var n=r[t];return n==null&&bo(),n},G0e=function(){var t=w.useContext(pk);return Pa(t)},K0e=function(){var t=w.useContext(gk),r=V0e(t,function(n){return e5(n.domain,Number.isFinite)});return r||Pa(t)},h5=function(t){var r=w.useContext(gk);r==null&&bo();var n=r[t];return n==null&&bo(),n},Y0e=function(){var t=w.useContext(o5);return t},X0e=function(){return w.useContext(l5)},vk=function(){return w.useContext(d5)},yk=function(){return w.useContext(u5)};function _c(e){"@babel/helpers - typeof";return _c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_c(e)}function Q0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J0e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p5(n.key),n)}}function Z0e(e,t,r){return t&&J0e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ebe(e,t,r){return t=wg(t),tbe(e,m5()?Reflect.construct(t,r||[],wg(e).constructor):t.apply(e,r))}function tbe(e,t){if(t&&(_c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rbe(e)}function rbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(m5=function(){return!!e})()}function wg(e){return wg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wg(e)}function nbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r1(e,t)}function r1(e,t){return r1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},r1(e,t)}function sO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function oO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sO(Object(r),!0).forEach(function(n){xk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xk(e,t,r){return t=p5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p5(e){var t=ibe(e,"string");return _c(t)=="symbol"?t:t+""}function ibe(e,t){if(_c(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_c(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function abe(e,t){return cbe(e)||lbe(e,t)||obe(e,t)||sbe()}function sbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 543In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function obe(e,t){if(e){if(typeof e=="string")return lO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lO(e,t)}}function lO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lbe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function cbe(e){if(Array.isArray(e))return e}function n1(){return n1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n1.apply(this,arguments)}var ube=function(t,r){var n;return O.isValidElement(t)?n=O.cloneElement(t,r):he(t)?n=t(r):n=O.createElement("line",n1({},r,{className:"recharts-reference-line-line"})),n},dbe=function(t,r,n,i,a,o,l,c,u){var d=a.x,f=a.y,h=a.width,m=a.height;if(n){var g=u.y,p=t.y.apply(g,{position:o});if(xi(u,"discard")&&!t.y.isInRange(p))return null;var v=[{x:d+h,y:p},{x:d,y:p}];return c==="left"?v.reverse():v}if(r){var x=u.x,y=t.x.apply(x,{position:o});if(xi(u,"discard")&&!t.x.isInRange(y))return null;var b=[{x:y,y:f+m},{x:y,y:f}];return l==="top"?b.reverse():b}if(i){var S=u.segment,j=S.map(function(N){return t.apply(N,{position:o})});return xi(u,"discard")&&Ixe(j,function(N){return!t.isInRange(N)})?null:j}return null};function fbe(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=q0e(),d=f5(i),f=h5(a),h=Y0e();if(!u||!h)return null;Un(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=mk({x:d.scale,y:f.scale}),g=Et(t),p=Et(r),v=n&&n.length===2,x=dbe(m,g,p,v,h,e.position,d.orientation,f.orientation,e);if(!x)return null;var y=abe(x,2),b=y[0],S=b.x,j=b.y,N=y[1],k=N.x,_=N.y,C=xi(e,"hidden")?"url(#".concat(u,")"):void 0,P=oO(oO({clipPath:C},le(e,!0)),{},{x1:S,y1:j,x2:k,y2:_});return O.createElement(Ae,{className:we("recharts-reference-line",l)},ube(o,P),Rt.renderCallByParent(e,S0e({x1:S,y1:j,x2:k,y2:_})))}var uh=function(e){function t(){return Q0e(this,t),ebe(this,t,arguments)}return nbe(t,e),Z0e(t,[{key:"render",value:function(){return O.createElement(fbe,this.props)}}])}(O.Component);xk(uh,"displayName","ReferenceLine");xk(uh,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function i1(){return i1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i1.apply(this,arguments)}function Cc(e){"@babel/helpers - typeof";return Cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cc(e)}function cO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function uO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cO(Object(r),!0).forEach(function(n){hy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mbe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v5(n.key),n)}}function pbe(e,t,r){return t&&mbe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gbe(e,t,r){return t=jg(t),vbe(e,g5()?Reflect.construct(t,r||[],jg(e).constructor):t.apply(e,r))}function vbe(e,t){if(t&&(Cc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ybe(e)}function ybe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g5=function(){return!!e})()}function jg(e){return jg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jg(e)}function xbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a1(e,t)}function a1(e,t){return a1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},a1(e,t)}function hy(e,t,r){return t=v5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v5(e){var t=bbe(e,"string");return Cc(t)=="symbol"?t:t+""}function bbe(e,t){if(Cc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Cc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wbe=function(t){var r=t.x,n=t.y,i=t.xAxis,a=t.yAxis,o=mk({x:i.scale,y:a.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return xi(t,"discard")&&!o.isInRange(l)?null:l},my=function(e){function t(){return hbe(this,t),gbe(this,t,arguments)}return xbe(t,e),pbe(t,[{key:"render",value:function(){var n=this.props,i=n.x,a=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,u=Et(i),d=Et(a);if(Un(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=wbe(this.props);if(!f)return null;var h=f.x,m=f.y,g=this.props,p=g.shape,v=g.className,x=xi(this.props,"hidden")?"url(#".concat(c,")"):void 0,y=uO(uO({clipPath:x},le(this.props,!0)),{},{cx:h,cy:m});return O.createElement(Ae,{className:we("recharts-reference-dot",v)},t.renderDot(p,y),Rt.renderCallByParent(this.props,{x:h-o,y:m-o,width:2*o,height:2*o}))}}])}(O.Component);hy(my,"displayName","ReferenceDot");hy(my,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});hy(my,"renderDot",function(e,t){var r;return O.isValidElement(e)?r=O.cloneElement(e,t):he(e)?r=e(t):r=O.createElement(ch,i1({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function s1(){return s1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s1.apply(this,arguments)}function Ac(e){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(e)}function dO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dO(Object(r),!0).forEach(function(n){py(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sbe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,x5(n.key),n)}}function kbe(e,t,r){return t&&Sbe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nbe(e,t,r){return t=Sg(t),_be(e,y5()?Reflect.construct(t,r||[],Sg(e).constructor):t.apply(e,r))}function _be(e,t){if(t&&(Ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cbe(e)}function Cbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y5=function(){return!!e})()}function Sg(e){return Sg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sg(e)}function Abe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o1(e,t)}function o1(e,t){return o1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},o1(e,t)}function py(e,t,r){return t=x5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x5(e){var t=Ebe(e,"string");return Ac(t)=="symbol"?t:t+""}function Ebe(e,t){if(Ac(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ac(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pbe=function(t,r,n,i,a){var o=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,f=a.yAxis;if(!d||!f)return null;var h=mk({x:d.scale,y:f.scale}),m={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},g={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:i?h.y.apply(u,{position:"end"}):h.y.rangeMax};return xi(a,"discard")&&(!h.isInRange(m)||!h.isInRange(g))?null:a5(m,g)},gy=function(e){function t(){return jbe(this,t),Nbe(this,t,arguments)}return Abe(t,e),kbe(t,[{key:"render",value:function(){var n=this.props,i=n.x1,a=n.x2,o=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;Un(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Et(i),h=Et(a),m=Et(o),g=Et(l),p=this.props.shape;if(!f&&!h&&!m&&!g&&!p)return null;var v=Pbe(f,h,m,g,this.props);if(!v&&!p)return null;var x=xi(this.props,"hidden")?"url(#".concat(d,")"):void 0;return O.createElement(Ae,{className:we("recharts-reference-area",c)},t.renderRect(p,fO(fO({clipPath:x},le(this.props,!0)),v)),Rt.renderCallByParent(this.props,v))}}])}(O.Component);py(gy,"displayName","ReferenceArea");py(gy,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});py(gy,"renderRect",function(e,t){var r;return O.isValidElement(e)?r=O.cloneElement(e,t):he(e)?r=e(t):r=O.createElement(fk,s1({},t,{className:"recharts-reference-area-rect"})),r});function b5(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],i=0;i<e.length;i+=t)n.push(e[i]);return n}function Obe(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return N0e(n,r)}function Tbe(e,t,r){var n=r==="width",i=e.x,a=e.y,o=e.width,l=e.height;return t===1?{start:n?i:a,end:n?i+o:a+l}:{start:n?i+o:a+l,end:n?i:a}}function kg(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function $be(e,t){return b5(e,t+1)}function Rbe(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var g=n==null?void 0:n[c];if(g===void 0)return{v:b5(n,u)};var p=c,v,x=function(){return v===void 0&&(v=r(g,p)),v},y=g.coordinate,b=c===0||kg(e,y,x,d,l);b||(c=0,d=o,u+=1),b&&(d=y+e*(x()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function Of(e){"@babel/helpers - typeof";return Of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Of(e)}function hO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hO(Object(r),!0).forEach(function(n){Ibe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ibe(e,t,r){return t=Mbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mbe(e){var t=Dbe(e,"string");return Of(t)=="symbol"?t:t+""}function Dbe(e,t){if(Of(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Of(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lbe(e,t,r,n,i){for(var a=(n||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(h){var m=a[h],g,p=function(){return g===void 0&&(g=r(m,h)),g};if(h===o-1){var v=e*(m.coordinate+e*p()/2-c);a[h]=m=er(er({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate})}else a[h]=m=er(er({},m),{},{tickCoord:m.coordinate});var x=kg(e,m.tickCoord,p,l,c);x&&(c=m.tickCoord-e*(p()/2+i),a[h]=er(er({},m),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function Fbe(e,t,r,n,i,a){var o=(n||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=n[l-1],f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=er(er({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var m=kg(e,d.tickCoord,function(){return f},c,u);m&&(u=d.tickCoord-e*(f/2+i),o[l-1]=er(er({},d),{},{isShow:!0}))}for(var g=a?l-1:l,p=function(y){var b=o[y],S,j=function(){return S===void 0&&(S=r(b,y)),S};if(y===0){var N=e*(b.coordinate-e*j()/2-c);o[y]=b=er(er({},b),{},{tickCoord:N<0?b.coordinate-N*e:b.coordinate})}else o[y]=b=er(er({},b),{},{tickCoord:b.coordinate});var k=kg(e,b.tickCoord,j,c,u);k&&(c=b.tickCoord+e*(j()/2+i),o[y]=er(er({},b),{},{isShow:!0}))},v=0;v<g;v++)p(v);return o}function bk(e,t,r){var n=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!i||!i.length||!n)return[];if(K(c)||zn.isSsr)return $be(i,typeof c=="number"&&K(c)?c:0);var h=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?fd(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},p=function(b,S){var j=he(u)?u(b.value,S):b.value;return m==="width"?Obe(fd(j,{fontSize:t,letterSpacing:r}),g,f):fd(j,{fontSize:t,letterSpacing:r})[m]},v=i.length>=2?or(i[1].coordinate-i[0].coordinate):1,x=Tbe(a,v,m);return c==="equidistantPreserveStart"?Rbe(v,x,p,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=Fbe(v,x,p,i,o,c==="preserveStartEnd"):h=Lbe(v,x,p,i,o),h.filter(function(y){return y.isShow}))}var Bbe=["viewBox"],Wbe=["viewBox"],Ube=["ticks"];function Ec(e){"@babel/helpers - typeof";return Ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ec(e)}function Sl(){return Sl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sl.apply(this,arguments)}function mO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function St(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mO(Object(r),!0).forEach(function(n){wk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qx(e,t){if(e==null)return{};var r=zbe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zbe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Vbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j5(n.key),n)}}function Hbe(e,t,r){return t&&pO(e.prototype,t),r&&pO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function qbe(e,t,r){return t=Ng(t),Gbe(e,w5()?Reflect.construct(t,r||[],Ng(e).constructor):t.apply(e,r))}function Gbe(e,t){if(t&&(Ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kbe(e)}function Kbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w5=function(){return!!e})()}function Ng(e){return Ng=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ng(e)}function Ybe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l1(e,t)}function l1(e,t){return l1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},l1(e,t)}function wk(e,t,r){return t=j5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j5(e){var t=Xbe(e,"string");return Ec(t)=="symbol"?t:t+""}function Xbe(e,t){if(Ec(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ec(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var au=function(e){function t(r){var n;return Vbe(this,t),n=qbe(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return Ybe(t,e),Hbe(t,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,o=Qx(n,Bbe),l=this.props,c=l.viewBox,u=Qx(l,Wbe);return!Il(a,c)||!Il(o,u)||!Il(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.x,o=i.y,l=i.width,c=i.height,u=i.orientation,d=i.tickSize,f=i.mirror,h=i.tickMargin,m,g,p,v,x,y,b=f?-1:1,S=n.tickSize||d,j=K(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":m=g=n.coordinate,v=o+ +!f*c,p=v-b*S,y=p-b*h,x=j;break;case"left":p=v=n.coordinate,g=a+ +!f*l,m=g-b*S,x=m-b*h,y=j;break;case"right":p=v=n.coordinate,g=a+ +f*l,m=g+b*S,x=m+b*h,y=j;break;default:m=g=n.coordinate,v=o+ +f*c,p=v+b*S,y=p+b*h,x=j;break}return{line:{x1:m,y1:p,x2:g,y2:v},tick:{x,y}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,l=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,f=St(St(St({},le(this.props,!1)),le(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=St(St({},f),{},{x1:i,y1:a+h*l,x2:i+o,y2:a+h*l})}else{var m=+(c==="left"&&!u||c==="right"&&u);f=St(St({},f),{},{x1:i+m*o,y1:a,x2:i+m*o,y2:a+l})}return O.createElement("line",Sl({},f,{className:we("recharts-cartesian-axis-line",zr(d,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,m=bk(St(St({},this.props),{},{ticks:n}),i,a),g=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),v=le(this.props,!1),x=le(d,!1),y=St(St({},v),{},{fill:"none"},le(c,!1)),b=m.map(function(S,j){var N=o.getTickLineCoord(S),k=N.line,_=N.tick,C=St(St(St(St({textAnchor:g,verticalAnchor:p},v),{},{stroke:"none",fill:u},x),_),{},{index:j,payload:S,visibleTicksCount:m.length,tickFormatter:f});return O.createElement(Ae,Sl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},go(o.props,S,j)),c&&O.createElement("line",Sl({},y,k,{className:we("recharts-cartesian-axis-tick-line",zr(c,"className"))})),d&&t.renderTickItem(d,C,"".concat(he(f)?f(S.value,j):S.value).concat(h||"")))});return O.createElement("g",{className:"recharts-cartesian-axis-ticks"},b)}},{key:"render",value:function(){var n=this,i=this.props,a=i.axisLine,o=i.width,l=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var f=this.props,h=f.ticks,m=Qx(f,Ube),g=h;return he(c)&&(g=h&&h.length>0?c(this.props):c(m)),o<=0||l<=0||!g||!g.length?null:O.createElement(Ae,{className:we("recharts-cartesian-axis",u),ref:function(v){n.layerReference=v}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Rt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,l=we(i.className,"recharts-cartesian-axis-tick-value");return O.isValidElement(n)?o=O.cloneElement(n,St(St({},i),{},{className:l})):he(n)?o=n(St(St({},i),{},{className:l})):o=O.createElement(vo,Sl({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(w.Component);wk(au,"displayName","CartesianAxis");wk(au,"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 Qbe=["x1","y1","x2","y2","key"],Jbe=["offset"];function wo(e){"@babel/helpers - typeof";return wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wo(e)}function gO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gO(Object(r),!0).forEach(function(n){Zbe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zbe(e,t,r){return t=ewe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ewe(e){var t=twe(e,"string");return wo(t)=="symbol"?t:t+""}function twe(e,t){if(wo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vs(){return Vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vs.apply(this,arguments)}function vO(e,t){if(e==null)return{};var r=rwe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rwe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var nwe=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return O.createElement("rect",{x:i,y:a,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function S5(e,t){var r;if(O.isValidElement(e))r=O.cloneElement(e,t);else if(he(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,l=t.key,c=vO(t,Qbe),u=le(c,!1);u.offset;var d=vO(u,Jbe);r=O.createElement("line",Vs({},d,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:l}))}return r}function iwe(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,c){var u=rr(rr({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return S5(i,u)});return O.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function awe(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,c){var u=rr(rr({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return S5(i,u)});return O.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function swe(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+i-i)}).sort(function(h,m){return h-m});i!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var g=!d[m+1],p=g?i+o-h:d[m+1]-h;if(p<=0)return null;var v=m%t.length;return O.createElement("rect",{key:"react-".concat(m),y:h,x:n,height:p,width:a,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return O.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function owe(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,m){return h-m});a!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var g=!d[m+1],p=g?a+l-h:d[m+1]-h;if(p<=0)return null;var v=m%n.length;return O.createElement("rect",{key:"react-".concat(m),x:h,y:o,width:p,height:c,stroke:"none",fill:n[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return O.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var lwe=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return bD(bk(rr(rr(rr({},au.defaultProps),n),{},{ticks:Ui(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},cwe=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return bD(bk(rr(rr(rr({},au.defaultProps),n),{},{ticks:Ui(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},Qo={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Vn(e){var t,r,n,i,a,o,l=vk(),c=yk(),u=X0e(),d=rr(rr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Qo.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Qo.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Qo.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Qo.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Qo.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Qo.verticalFill,x:K(e.x)?e.x:u.left,y:K(e.y)?e.y:u.top,width:K(e.width)?e.width:u.width,height:K(e.height)?e.height:u.height}),f=d.x,h=d.y,m=d.width,g=d.height,p=d.syncWithTicks,v=d.horizontalValues,x=d.verticalValues,y=G0e(),b=K0e();if(!K(m)||m<=0||!K(g)||g<=0||!K(f)||f!==+f||!K(h)||h!==+h)return null;var S=d.verticalCoordinatesGenerator||lwe,j=d.horizontalCoordinatesGenerator||cwe,N=d.horizontalPoints,k=d.verticalPoints;if((!N||!N.length)&&he(j)){var _=v&&v.length,C=j({yAxis:b?rr(rr({},b),{},{ticks:_?v:b.ticks}):void 0,width:l,height:c,offset:u},_?!0:p);Un(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(wo(C),"]")),Array.isArray(C)&&(N=C)}if((!k||!k.length)&&he(S)){var P=x&&x.length,E=S({xAxis:y?rr(rr({},y),{},{ticks:P?x:y.ticks}):void 0,width:l,height:c,offset:u},P?!0:p);Un(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(wo(E),"]")),Array.isArray(E)&&(k=E)}return O.createElement("g",{className:"recharts-cartesian-grid"},O.createElement(nwe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),O.createElement(iwe,Vs({},d,{offset:u,horizontalPoints:N,xAxis:y,yAxis:b})),O.createElement(awe,Vs({},d,{offset:u,verticalPoints:k,xAxis:y,yAxis:b})),O.createElement(swe,Vs({},d,{horizontalPoints:N})),O.createElement(owe,Vs({},d,{verticalPoints:k})))}Vn.displayName="CartesianGrid";var uwe=["type","layout","connectNulls","ref"],dwe=["key"];function Pc(e){"@babel/helpers - typeof";return Pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pc(e)}function yO(e,t){if(e==null)return{};var r=fwe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fwe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function yd(){return yd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yd.apply(this,arguments)}function xO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xO(Object(r),!0).forEach(function(n){Mn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jo(e){return gwe(e)||pwe(e)||mwe(e)||hwe()}function hwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 544In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mwe(e,t){if(e){if(typeof e=="string")return c1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c1(e,t)}}function pwe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gwe(e){if(Array.isArray(e))return c1(e)}function c1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,N5(n.key),n)}}function ywe(e,t,r){return t&&bO(e.prototype,t),r&&bO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xwe(e,t,r){return t=_g(t),bwe(e,k5()?Reflect.construct(t,r||[],_g(e).constructor):t.apply(e,r))}function bwe(e,t){if(t&&(Pc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wwe(e)}function wwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(k5=function(){return!!e})()}function _g(e){return _g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_g(e)}function jwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u1(e,t)}function u1(e,t){return u1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},u1(e,t)}function Mn(e,t,r){return t=N5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N5(e){var t=Swe(e,"string");return Pc(t)=="symbol"?t:t+""}function Swe(e,t){if(Pc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jr=function(e){function t(){var r;vwe(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=xwe(this,t,[].concat(i)),Mn(r,"state",{isAnimationFinished:!0,totalLength:0}),Mn(r,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Mn(r,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(x,y){return x+y});if(!u)return r.generateSimpleStrokeDasharray(l,o);for(var d=Math.floor(o/u),f=o%u,h=l-o,m=[],g=0,p=0;g<c.length;p+=c[g],++g)if(p+c[g]>f){m=[].concat(Jo(c.slice(0,g)),[f-p]);break}var v=m.length%2===0?[0,h]:[h];return[].concat(Jo(t.repeat(c,d)),Jo(m),v).map(function(x){return"".concat(x,"px")}).join(", ")}),Mn(r,"id",Oo("recharts-line-")),Mn(r,"pathRef",function(o){r.mainCurve=o}),Mn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Mn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return jwe(t,e),ywe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=Vr(d,lh);if(!f)return null;var h=function(p,v){return{x:p.x,y:p.y,value:p.value,errorVal:gt(p.payload,v)}},m={clipPath:n?"url(#clipPath-".concat(i,")"):null};return O.createElement(Ae,m,f.map(function(g){return O.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=le(this.props,!1),h=le(c,!0),m=u.map(function(p,v){var x=$r($r($r({key:"dot-".concat(v),r:3},f),h),{},{index:v,cx:p.x,cy:p.y,value:p.value,dataKey:d,payload:p.payload,points:u});return t.renderDotItem(c,x)}),g={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return O.createElement(Ae,yd({className:"recharts-line-dots",key:"dots"},g),m)}},{key:"renderCurveStatically",value:function(n,i,a,o){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=yO(l,uwe),h=$r($r($r({},le(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:c,layout:u,connectNulls:d});return O.createElement(ao,yd({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,h=o.animationEasing,m=o.animationId,g=o.animateNewValues,p=o.width,v=o.height,x=this.state,y=x.prevPoints,b=x.totalLength;return O.createElement(Yn,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var j=S.t;if(y){var N=y.length/l.length,k=l.map(function(A,R){var $=Math.floor(R*N);if(y[$]){var D=y[$],M=_t(D.x,A.x),I=_t(D.y,A.y);return $r($r({},A),{},{x:M(j),y:I(j)})}if(g){var T=_t(p*2,A.x),L=_t(v/2,A.y);return $r($r({},A),{},{x:T(j),y:L(j)})}return $r($r({},A),{},{x:A.x,y:A.y})});return a.renderCurveStatically(k,n,i)}var _=_t(0,b),C=_(j),P;if(c){var E="".concat(c).split(/[,\s]+/gim).map(function(A){return parseFloat(A)});P=a.getStrokeDasharray(C,b,E)}else P=a.generateSimpleStrokeDasharray(b,C);return a.renderCurveStatically(l,n,i,{strokeDasharray:P})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&o&&o.length&&(!u&&d>0||!yo(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,l=i.points,c=i.className,u=i.xAxis,d=i.yAxis,f=i.top,h=i.left,m=i.width,g=i.height,p=i.isAnimationActive,v=i.id;if(a||!l||!l.length)return null;var x=this.state.isAnimationFinished,y=l.length===1,b=we("recharts-line",c),S=u&&u.allowDataOverflow,j=d&&d.allowDataOverflow,N=S||j,k=xe(v)?this.id:v,_=(n=le(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},C=_.r,P=C===void 0?3:C,E=_.strokeWidth,A=E===void 0?2:E,R=f3(o)?o:{},$=R.clipDot,D=$===void 0?!0:$,M=P*2+A;return O.createElement(Ae,{className:b},S||j?O.createElement("defs",null,O.createElement("clipPath",{id:"clipPath-".concat(k)},O.createElement("rect",{x:S?h:h-m/2,y:j?f:f-g/2,width:S?m:m*2,height:j?g:g*2})),!D&&O.createElement("clipPath",{id:"clipPath-dots-".concat(k)},O.createElement("rect",{x:h-M/2,y:f-M/2,width:m+M,height:g+M}))):null,!y&&this.renderCurve(N,k),this.renderErrorBar(N,k),(y||o)&&this.renderDots(N,D,k),(!p||x)&&yi.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Jo(n),[0]):n,o=[],l=0;l<i;++l)o=[].concat(Jo(o),Jo(a));return o}},{key:"renderDotItem",value:function(n,i){var a;if(O.isValidElement(n))a=O.cloneElement(n,i);else if(he(n))a=n(i);else{var o=i.key,l=yO(i,dwe),c=we("recharts-line-dot",typeof n!="boolean"?n.className:"");a=O.createElement(ch,yd({key:o},l,{className:c}))}return a}}])}(w.PureComponent);Mn(jr,"displayName","Line");Mn(jr,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!zn.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Mn(jr,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(h,m){var g=gt(h,o);return d==="horizontal"?{x:ng({axis:r,ticks:i,bandSize:l,entry:h,index:m}),y:xe(g)?null:n.scale(g),value:g,payload:h}:{x:xe(g)?null:r.scale(g),y:ng({axis:n,ticks:a,bandSize:l,entry:h,index:m}),value:g,payload:h}});return $r({points:f,layout:d},u)});var kwe=["layout","type","stroke","connectNulls","isRange","ref"],Nwe=["key"],_5;function Oc(e){"@babel/helpers - typeof";return Oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oc(e)}function C5(e,t){if(e==null)return{};var r=_we(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _we(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hs.apply(this,arguments)}function wO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ja(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wO(Object(r),!0).forEach(function(n){di(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E5(n.key),n)}}function Awe(e,t,r){return t&&jO(e.prototype,t),r&&jO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ewe(e,t,r){return t=Cg(t),Pwe(e,A5()?Reflect.construct(t,r||[],Cg(e).constructor):t.apply(e,r))}function Pwe(e,t){if(t&&(Oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Owe(e)}function Owe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A5=function(){return!!e})()}function Cg(e){return Cg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cg(e)}function Twe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d1(e,t)}function d1(e,t){return d1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},d1(e,t)}function di(e,t,r){return t=E5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E5(e){var t=$we(e,"string");return Oc(t)=="symbol"?t:t+""}function $we(e,t){if(Oc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Oc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var na=function(e){function t(){var r;Cwe(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=Ewe(this,t,[].concat(i)),di(r,"state",{isAnimationFinished:!0}),di(r,"id",Oo("recharts-area-")),di(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),he(o)&&o()}),di(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),he(o)&&o()}),r}return Twe(t,e),Awe(t,[{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,h=le(this.props,!1),m=le(u,!0),g=d.map(function(v,x){var y=ja(ja(ja({key:"dot-".concat(x),r:3},h),m),{},{index:x,cx:v.x,cy:v.y,dataKey:f,value:v.value,payload:v.payload,points:d});return t.renderDotItem(u,y)}),p={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return O.createElement(Ae,Hs({className:"recharts-area-dots"},p),g)}},{key:"renderHorizontalRect",value:function(n){var i=this.props,a=i.baseLine,o=i.points,l=i.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=n*Math.abs(c-u),f=za(o.map(function(h){return h.y||0}));return K(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(za(a.map(function(h){return h.y||0})),f)),K(f)?O.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var i=this.props,a=i.baseLine,o=i.points,l=i.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=n*Math.abs(c-u),f=za(o.map(function(h){return h.x||0}));return K(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(za(a.map(function(h){return h.x||0})),f)),K(f)?O.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(n){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,i,a,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,h=l.isRange;l.ref;var m=C5(l,kwe);return O.createElement(Ae,{clipPath:a?"url(#clipPath-".concat(o,")"):null},O.createElement(ao,Hs({},le(m,!0),{points:n,connectNulls:f,type:u,baseLine:i,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&O.createElement(ao,Hs({},le(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:n})),d!=="none"&&h&&O.createElement(ao,Hs({},le(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(n,i){var a=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,h=o.animationEasing,m=o.animationId,g=this.state,p=g.prevPoints,v=g.prevBaseLine;return O.createElement(Yn,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var y=x.t;if(p){var b=p.length/l.length,S=l.map(function(_,C){var P=Math.floor(C*b);if(p[P]){var E=p[P],A=_t(E.x,_.x),R=_t(E.y,_.y);return ja(ja({},_),{},{x:A(y),y:R(y)})}return _}),j;if(K(c)&&typeof c=="number"){var N=_t(v,c);j=N(y)}else if(xe(c)||Jc(c)){var k=_t(v,0);j=k(y)}else j=c.map(function(_,C){var P=Math.floor(C*b);if(v[P]){var E=v[P],A=_t(E.x,_.x),R=_t(E.y,_.y);return ja(ja({},_),{},{x:A(y),y:R(y)})}return _});return a.renderAreaStatically(S,j,n,i)}return O.createElement(Ae,null,O.createElement("defs",null,O.createElement("clipPath",{id:"animationClipPath-".concat(i)},a.renderClipRect(y))),O.createElement(Ae,{clipPath:"url(#animationClipPath-".concat(i,")")},a.renderAreaStatically(l,c,n,i)))})}},{key:"renderArea",value:function(n,i){var a=this.props,o=a.points,l=a.baseLine,c=a.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,h=u.totalLength;return c&&o&&o.length&&(!d&&h>0||!yo(d,o)||!yo(f,l))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,l,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,l=i.points,c=i.className,u=i.top,d=i.left,f=i.xAxis,h=i.yAxis,m=i.width,g=i.height,p=i.isAnimationActive,v=i.id;if(a||!l||!l.length)return null;var x=this.state.isAnimationFinished,y=l.length===1,b=we("recharts-area",c),S=f&&f.allowDataOverflow,j=h&&h.allowDataOverflow,N=S||j,k=xe(v)?this.id:v,_=(n=le(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},C=_.r,P=C===void 0?3:C,E=_.strokeWidth,A=E===void 0?2:E,R=f3(o)?o:{},$=R.clipDot,D=$===void 0?!0:$,M=P*2+A;return O.createElement(Ae,{className:b},S||j?O.createElement("defs",null,O.createElement("clipPath",{id:"clipPath-".concat(k)},O.createElement("rect",{x:S?d:d-m/2,y:j?u:u-g/2,width:S?m:m*2,height:j?g:g*2})),!D&&O.createElement("clipPath",{id:"clipPath-dots-".concat(k)},O.createElement("rect",{x:d-M/2,y:u-M/2,width:m+M,height:g+M}))):null,y?null:this.renderArea(N,k),(o||y)&&this.renderDots(N,D,k),(!p||x)&&yi.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(w.PureComponent);_5=na;di(na,"displayName","Area");di(na,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!zn.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});di(na,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(K(l)&&typeof l=="number")return l;var c=i==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});di(na,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,m=t.layout,g=u&&u.length,p=_5.getBaseValue(t,r,n,i),v=m==="horizontal",x=!1,y=f.map(function(S,j){var N;g?N=u[d+j]:(N=gt(S,c),Array.isArray(N)?x=!0:N=[p,N]);var k=N[1]==null||g&>(S,c)==null;return v?{x:ng({axis:n,ticks:a,bandSize:l,entry:S,index:j}),y:k?null:i.scale(N[1]),value:N,payload:S}:{x:k?null:n.scale(N[1]),y:ng({axis:i,ticks:o,bandSize:l,entry:S,index:j}),value:N,payload:S}}),b;return g||x?b=y.map(function(S){var j=Array.isArray(S.value)?S.value[0]:null;return v?{x:S.x,y:j!=null&&S.y!=null?i.scale(j):null}:{x:j!=null?n.scale(j):null,y:S.y}}):b=v?i.scale(p):n.scale(p),ja({points:y,baseLine:b,layout:m,isRange:x},h)});di(na,"renderDotItem",function(e,t){var r;if(O.isValidElement(e))r=O.cloneElement(e,t);else if(he(e))r=e(t);else{var n=we("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=C5(t,Nwe);r=O.createElement(ch,Hs({},a,{key:i,className:n}))}return r});function Tc(e){"@babel/helpers - typeof";return Tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(e)}function Rwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Iwe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,T5(n.key),n)}}function Mwe(e,t,r){return t&&Iwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dwe(e,t,r){return t=Ag(t),Lwe(e,P5()?Reflect.construct(t,r||[],Ag(e).constructor):t.apply(e,r))}function Lwe(e,t){if(t&&(Tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fwe(e)}function Fwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P5=function(){return!!e})()}function Ag(e){return Ag=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ag(e)}function Bwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f1(e,t)}function f1(e,t){return f1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},f1(e,t)}function O5(e,t,r){return t=T5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T5(e){var t=Wwe(e,"string");return Tc(t)=="symbol"?t:t+""}function Wwe(e,t){if(Tc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Tc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function h1(){return h1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h1.apply(this,arguments)}function Uwe(e){var t=e.xAxisId,r=vk(),n=yk(),i=f5(t);return i==null?null:w.createElement(au,h1({},i,{className:we("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Ui(o,!0)}}))}var fr=function(e){function t(){return Rwe(this,t),Dwe(this,t,arguments)}return Bwe(t,e),Mwe(t,[{key:"render",value:function(){return w.createElement(Uwe,this.props)}}])}(w.Component);O5(fr,"displayName","XAxis");O5(fr,"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 $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}function zwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vwe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,I5(n.key),n)}}function Hwe(e,t,r){return t&&Vwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qwe(e,t,r){return t=Eg(t),Gwe(e,$5()?Reflect.construct(t,r||[],Eg(e).constructor):t.apply(e,r))}function Gwe(e,t){if(t&&($c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kwe(e)}function Kwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($5=function(){return!!e})()}function Eg(e){return Eg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Eg(e)}function Ywe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m1(e,t)}function m1(e,t){return m1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},m1(e,t)}function R5(e,t,r){return t=I5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I5(e){var t=Xwe(e,"string");return $c(t)=="symbol"?t:t+""}function Xwe(e,t){if($c(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($c(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function p1(){return p1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p1.apply(this,arguments)}var Qwe=function(t){var r=t.yAxisId,n=vk(),i=yk(),a=h5(r);return a==null?null:w.createElement(au,p1({},a,{className:we("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(l){return Ui(l,!0)}}))},hr=function(e){function t(){return zwe(this,t),qwe(this,t,arguments)}return Ywe(t,e),Hwe(t,[{key:"render",value:function(){return w.createElement(Qwe,this.props)}}])}(w.Component);R5(hr,"displayName","YAxis");R5(hr,"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 SO(e){return t1e(e)||e1e(e)||Zwe(e)||Jwe()}function Jwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 545In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zwe(e,t){if(e){if(typeof e=="string")return g1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g1(e,t)}}function e1e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function t1e(e){if(Array.isArray(e))return g1(e)}function g1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var v1=function(t,r,n,i,a){var o=Vr(t,uh),l=Vr(t,my),c=[].concat(SO(o),SO(l)),u=Vr(t,gy),d="".concat(i,"Id"),f=i[0],h=r;if(c.length&&(h=c.reduce(function(p,v){if(v.props[d]===n&&xi(v.props,"extendDomain")&&K(v.props[f])){var x=v.props[f];return[Math.min(p[0],x),Math.max(p[1],x)]}return p},h)),u.length){var m="".concat(f,"1"),g="".concat(f,"2");h=u.reduce(function(p,v){if(v.props[d]===n&&xi(v.props,"extendDomain")&&K(v.props[m])&&K(v.props[g])){var x=v.props[m],y=v.props[g];return[Math.min(p[0],x,y),Math.max(p[1],x,y)]}return p},h)}return a&&a.length&&(h=a.reduce(function(p,v){return K(v)?[Math.min(p[0],v),Math.max(p[1],v)]:p},h)),h},M5={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new i(d,f||c,h),g=r?r+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],m]:c._events[g].push(m):(c._events[g]=m,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,m=f.length,g=new Array(m);h<m;h++)g[h]=f[h].fn;return g},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,m,g){var p=r?r+u:u;if(!this._events[p])return!1;var v=this._events[p],x=arguments.length,y,b;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),x){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,h),!0;case 5:return v.fn.call(v.context,d,f,h,m),!0;case 6:return v.fn.call(v.context,d,f,h,m,g),!0}for(b=1,y=new Array(x-1);b<x;b++)y[b-1]=arguments[b];v.fn.apply(v.context,y)}else{var S=v.length,j;for(b=0;b<S;b++)switch(v[b].once&&this.removeListener(u,v[b].fn,void 0,!0),x){case 1:v[b].fn.call(v[b].context);break;case 2:v[b].fn.call(v[b].context,d);break;case 3:v[b].fn.call(v[b].context,d,f);break;case 4:v[b].fn.call(v[b].context,d,f,h);break;default:if(!y)for(j=1,y=new Array(x-1);j<x;j++)y[j-1]=arguments[j];v[b].fn.apply(v[b].context,y)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var m=r?r+u:u;if(!this._events[m])return this;if(!d)return o(this,m),this;var g=this._events[m];if(g.fn)g.fn===d&&(!h||g.once)&&(!f||g.context===f)&&o(this,m);else{for(var p=0,v=[],x=g.length;p<x;p++)(g[p].fn!==d||h&&!g[p].once||f&&g[p].context!==f)&&v.push(g[p]);v.length?this._events[m]=v.length===1?v[0]:v:o(this,m)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&o(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(M5);var r1e=M5.exports;const n1e=Le(r1e);var Jx=new n1e,Zx="recharts.syncMouseEvents";function Tf(e){"@babel/helpers - typeof";return Tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tf(e)}function i1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,D5(n.key),n)}}function s1e(e,t,r){return t&&a1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function e0(e,t,r){return t=D5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D5(e){var t=o1e(e,"string");return Tf(t)=="symbol"?t:t+""}function o1e(e,t){if(Tf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Tf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var l1e=function(){function e(){i1e(this,e),e0(this,"activeIndex",0),e0(this,"coordinateList",[]),e0(this,"layout","horizontal")}return s1e(e,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,a=i===void 0?null:i,o=r.container,l=o===void 0?null:o,c=r.layout,u=c===void 0?null:c,d=r.offset,f=d===void 0?null:d,h=r.mouseHandlerCallback,m=h===void 0?null:h;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=m??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(r){if(this.coordinateList.length!==0)switch(r.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(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,o=i.y,l=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=a+c+u,h=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function c1e(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],i=e==null?void 0:e[1];if(n&&i&&K(n)&&K(i))return!0}return!1}function u1e(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function L5(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,a=e.endAngle,o=Qe(t,r,n,i),l=Qe(t,r,n,a);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}function d1e(e,t,r){var n,i,a,o;if(e==="horizontal")n=t.x,a=n,i=r.top,o=r.top+r.height;else if(e==="vertical")i=t.y,o=i,n=r.left,a=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=Qe(l,c,u,f),m=Qe(l,c,d,f);n=h.x,i=h.y,a=m.x,o=m.y}else return L5(t);return[{x:n,y:i},{x:a,y:o}]}function $f(e){"@babel/helpers - typeof";return $f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$f(e)}function kO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kO(Object(r),!0).forEach(function(n){f1e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function f1e(e,t,r){return t=h1e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h1e(e){var t=m1e(e,"string");return $f(t)=="symbol"?t:t+""}function m1e(e,t){if($f(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($f(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function p1e(e){var t,r,n=e.element,i=e.tooltipEventType,a=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,m=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!m||!a||!o||h!=="ScatterChart"&&i!=="axis")return null;var g,p=ao;if(h==="ScatterChart")g=o,p=Sve;else if(h==="BarChart")g=u1e(f,o,c,d),p=fk;else if(f==="radial"){var v=L5(o),x=v.cx,y=v.cy,b=v.radius,S=v.startAngle,j=v.endAngle;g={cx:x,cy:y,startAngle:S,endAngle:j,innerRadius:b,outerRadius:b},p=OD}else g={points:d1e(f,o,c)},p=ao;var N=mm(mm(mm(mm({stroke:"#ccc",pointerEvents:"none"},c),g),le(m,!1)),{},{payload:l,payloadIndex:u,className:we("recharts-tooltip-cursor",m.className)});return w.isValidElement(m)?w.cloneElement(m,N):w.createElement(p,N)}var g1e=["item"],v1e=["children","className","width","height","style","compact","title","desc"];function Rc(e){"@babel/helpers - typeof";return Rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rc(e)}function kl(){return kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kl.apply(this,arguments)}function NO(e,t){return b1e(e)||x1e(e,t)||B5(e,t)||y1e()}function y1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 546In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x1e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function b1e(e){if(Array.isArray(e))return e}function _O(e,t){if(e==null)return{};var r=w1e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function w1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function j1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,W5(n.key),n)}}function k1e(e,t,r){return t&&S1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function N1e(e,t,r){return t=Pg(t),_1e(e,F5()?Reflect.construct(t,r||[],Pg(e).constructor):t.apply(e,r))}function _1e(e,t){if(t&&(Rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C1e(e)}function C1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F5=function(){return!!e})()}function Pg(e){return Pg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Pg(e)}function A1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y1(e,t)}function y1(e,t){return y1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},y1(e,t)}function Ic(e){return O1e(e)||P1e(e)||B5(e)||E1e()}function E1e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 547In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B5(e,t){if(e){if(typeof e=="string")return x1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x1(e,t)}}function P1e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function O1e(e){if(Array.isArray(e))return x1(e)}function x1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function CO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?CO(Object(r),!0).forEach(function(n){fe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fe(e,t,r){return t=W5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W5(e){var t=T1e(e,"string");return Rc(t)=="symbol"?t:t+""}function T1e(e,t){if(Rc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Rc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $1e={xAxis:["bottom","top"],yAxis:["left","right"]},R1e={width:"100%",height:"100%"},U5={x:0,y:0};function pm(e){return e}var I1e=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},M1e=function(t,r,n,i){var a=r.find(function(d){return d&&d.index===n});if(a){if(t==="horizontal")return{x:a.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,l=i.radius;return V(V(V({},i),Qe(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=i.angle;return V(V(V({},i),Qe(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return U5},vy=function(t,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Ic(l),Ic(u)):l},[]);return o.length>0?o:t&&t.length&&K(i)&&K(a)?t.slice(i,a+1):[]};function z5(e){return e==="number"?[0,"auto"]:void 0}var b1=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,l=vy(r,t);return n<0||!a||!a.length||n>=l.length?null:a.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var m=f===void 0?l:f;h=Ep(m,o.dataKey,i)}else h=f&&f[n]||l[n];return h?[].concat(Ic(c),[ND(u,h)]):c},[])},AO=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=I1e(a,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=Ghe(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=b1(t,r,d,f),m=M1e(n,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:m}}return null},D1e=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,m=xD(d,a);return n.reduce(function(g,p){var v,x=p.type.defaultProps!==void 0?V(V({},p.type.defaultProps),p.props):p.props,y=x.type,b=x.dataKey,S=x.allowDataOverflow,j=x.allowDuplicatedCategory,N=x.scale,k=x.ticks,_=x.includeHidden,C=x[o];if(g[C])return g;var P=vy(t.data,{graphicalItems:i.filter(function(z){var q,te=o in z.props?z.props[o]:(q=z.type.defaultProps)===null||q===void 0?void 0:q[o];return te===C}),dataStartIndex:c,dataEndIndex:u}),E=P.length,A,R,$;c1e(x.domain,S,y)&&(A=$w(x.domain,null,S),m&&(y==="number"||N!=="auto")&&($=md(P,b,"category")));var D=z5(y);if(!A||A.length===0){var M,I=(M=x.domain)!==null&&M!==void 0?M:D;if(b){if(A=md(P,b,y),y==="category"&&m){var T=DJ(A);j&&T?(R=A,A=gg(0,E)):j||(A=KE(I,A,p).reduce(function(z,q){return z.indexOf(q)>=0?z:[].concat(Ic(z),[q])},[]))}else if(y==="category")j?A=A.filter(function(z){return z!==""&&!xe(z)}):A=KE(I,A,p).reduce(function(z,q){return z.indexOf(q)>=0||q===""||xe(q)?z:[].concat(Ic(z),[q])},[]);else if(y==="number"){var L=Jhe(P,i.filter(function(z){var q,te,ve=o in z.props?z.props[o]:(q=z.type.defaultProps)===null||q===void 0?void 0:q[o],Pe="hide"in z.props?z.props.hide:(te=z.type.defaultProps)===null||te===void 0?void 0:te.hide;return ve===C&&(_||!Pe)}),b,a,d);L&&(A=L)}m&&(y==="number"||N!=="auto")&&($=md(P,b,"category"))}else m?A=gg(0,E):l&&l[C]&&l[C].hasStack&&y==="number"?A=h==="expand"?[0,1]:kD(l[C].stackGroups,c,u):A=yD(P,i.filter(function(z){var q=o in z.props?z.props[o]:z.type.defaultProps[o],te="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return q===C&&(_||!te)}),y,d,!0);if(y==="number")A=v1(f,A,C,a,k),I&&(A=$w(I,A,S));else if(y==="category"&&I){var B=I,H=A.every(function(z){return B.indexOf(z)>=0});H&&(A=B)}}return V(V({},g),{},fe({},C,V(V({},x),{},{axisType:a,domain:A,categoricalDomain:$,duplicateDomain:R,originalDomain:(v=x.domain)!==null&&v!==void 0?v:D,isCategorical:m,layout:d})))},{})},L1e=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=vy(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),m=h.length,g=xD(d,a),p=-1;return n.reduce(function(v,x){var y=x.type.defaultProps!==void 0?V(V({},x.type.defaultProps),x.props):x.props,b=y[o],S=z5("number");if(!v[b]){p++;var j;return g?j=gg(0,m):l&&l[b]&&l[b].hasStack?(j=kD(l[b].stackGroups,c,u),j=v1(f,j,b,a)):(j=$w(S,yD(h,n.filter(function(N){var k,_,C=o in N.props?N.props[o]:(k=N.type.defaultProps)===null||k===void 0?void 0:k[o],P="hide"in N.props?N.props.hide:(_=N.type.defaultProps)===null||_===void 0?void 0:_.hide;return C===b&&!P}),"number",d),i.defaultProps.allowDataOverflow),j=v1(f,j,b,a)),V(V({},v),{},fe({},b,V(V({axisType:a},i.defaultProps),{},{hide:!0,orientation:zr($1e,"".concat(a,".").concat(p%2),null),domain:j,originalDomain:S,isCategorical:g,layout:d})))}return v},{})},F1e=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.children,f="".concat(i,"Id"),h=Vr(d,a),m={};return h&&h.length?m=D1e(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(m=L1e(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),m},B1e=function(t){var r=Pa(t),n=Ui(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:FS(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:ig(r,n)}},EO=function(t){var r=t.children,n=t.defaultShowTooltip,i=Mr(r,kc),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},W1e=function(t){return!t||!t.length?!1:t.some(function(r){var n=qi(r&&r.type);return n&&n.indexOf("Bar")>=0})},PO=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},U1e=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,d=n.height,f=n.children,h=n.margin||{},m=Mr(f,kc),g=Mr(f,dn),p=Object.keys(c).reduce(function(j,N){var k=c[N],_=k.orientation;return!k.mirror&&!k.hide?V(V({},j),{},fe({},_,j[_]+k.width)):j},{left:h.left||0,right:h.right||0}),v=Object.keys(o).reduce(function(j,N){var k=o[N],_=k.orientation;return!k.mirror&&!k.hide?V(V({},j),{},fe({},_,zr(j,"".concat(_))+k.height)):j},{top:h.top||0,bottom:h.bottom||0}),x=V(V({},v),p),y=x.bottom;m&&(x.bottom+=m.props.height||kc.defaultProps.height),g&&r&&(x=Xhe(x,i,n,r));var b=u-x.left-x.right,S=d-x.top-x.bottom;return V(V({brushBottom:y},x),{},{width:Math.max(b,0),height:Math.max(S,0)})},z1e=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},yy=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(x,y){var b=y.graphicalItems,S=y.stackGroups,j=y.offset,N=y.updateId,k=y.dataStartIndex,_=y.dataEndIndex,C=x.barSize,P=x.layout,E=x.barGap,A=x.barCategoryGap,R=x.maxBarSize,$=PO(P),D=$.numericAxisName,M=$.cateAxisName,I=W1e(b),T=[];return b.forEach(function(L,B){var H=vy(x.data,{graphicalItems:[L],dataStartIndex:k,dataEndIndex:_}),z=L.type.defaultProps!==void 0?V(V({},L.type.defaultProps),L.props):L.props,q=z.dataKey,te=z.maxBarSize,ve=z["".concat(D,"Id")],Pe=z["".concat(M,"Id")],Q={},je=c.reduce(function(Or,Jn){var bn=y["".concat(Jn.axisType,"Map")],ph=z["".concat(Jn.axisType,"Id")];bn&&bn[ph]||Jn.axisType==="zAxis"||bo();var gh=bn[ph];return V(V({},Or),{},fe(fe({},Jn.axisType,gh),"".concat(Jn.axisType,"Ticks"),Ui(gh)))},Q),G=je[M],ee=je["".concat(M,"Ticks")],Z=S&&S[ve]&&S[ve].hasStack&&ome(L,S[ve].stackGroups),U=qi(L.type).indexOf("Bar")>=0,Ce=ig(G,ee),ye=[],He=I&&Khe({barSize:C,stackGroups:S,totalSize:z1e(je,M)});if(U){var We,ct,gr=xe(te)?R:te,Pr=(We=(ct=ig(G,ee,!0))!==null&&ct!==void 0?ct:gr)!==null&&We!==void 0?We:0;ye=Yhe({barGap:E,barCategoryGap:A,bandSize:Pr!==Ce?Pr:Ce,sizeList:He[Pe],maxBarSize:gr}),Pr!==Ce&&(ye=ye.map(function(Or){return V(V({},Or),{},{position:V(V({},Or.position),{},{offset:Or.position.offset-Pr/2})})}))}var ws=L&&L.type&&L.type.getComposedData;ws&&T.push({props:V(V({},ws(V(V({},je),{},{displayedData:H,props:x,dataKey:q,item:L,bandSize:Ce,barPosition:ye,offset:j,stackedData:Z,layout:P,dataStartIndex:k,dataEndIndex:_}))),{},fe(fe(fe({key:L.key||"item-".concat(B)},D,je[D]),M,je[M]),"animationId",N)),childIndex:YJ(L,x.children),item:L})}),T},m=function(x,y){var b=x.props,S=x.dataStartIndex,j=x.dataEndIndex,N=x.updateId;if(!UC({props:b}))return null;var k=b.children,_=b.layout,C=b.stackOffset,P=b.data,E=b.reverseStackOrder,A=PO(_),R=A.numericAxisName,$=A.cateAxisName,D=Vr(k,n),M=ame(P,D,"".concat(R,"Id"),"".concat($,"Id"),C,E),I=c.reduce(function(z,q){var te="".concat(q.axisType,"Map");return V(V({},z),{},fe({},te,F1e(b,V(V({},q),{},{graphicalItems:D,stackGroups:q.axisType===R&&M,dataStartIndex:S,dataEndIndex:j}))))},{}),T=U1e(V(V({},I),{},{props:b,graphicalItems:D}),y==null?void 0:y.legendBBox);Object.keys(I).forEach(function(z){I[z]=d(b,I[z],T,z.replace("Map",""),r)});var L=I["".concat($,"Map")],B=B1e(L),H=h(b,V(V({},I),{},{dataStartIndex:S,dataEndIndex:j,updateId:N,graphicalItems:D,stackGroups:M,offset:T}));return V(V({formattedGraphicalItems:H,graphicalItems:D,offset:T,stackGroups:M},B),I)},g=function(v){function x(y){var b,S,j;return j1e(this,x),j=N1e(this,x,[y]),fe(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),fe(j,"accessibilityManager",new l1e),fe(j,"handleLegendBBoxUpdate",function(N){if(N){var k=j.state,_=k.dataStartIndex,C=k.dataEndIndex,P=k.updateId;j.setState(V({legendBBox:N},m({props:j.props,dataStartIndex:_,dataEndIndex:C,updateId:P},V(V({},j.state),{},{legendBBox:N}))))}}),fe(j,"handleReceiveSyncEvent",function(N,k,_){if(j.props.syncId===N){if(_===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(k)}}),fe(j,"handleBrushChange",function(N){var k=N.startIndex,_=N.endIndex;if(k!==j.state.dataStartIndex||_!==j.state.dataEndIndex){var C=j.state.updateId;j.setState(function(){return V({dataStartIndex:k,dataEndIndex:_},m({props:j.props,dataStartIndex:k,dataEndIndex:_,updateId:C},j.state))}),j.triggerSyncEvent({dataStartIndex:k,dataEndIndex:_})}}),fe(j,"handleMouseEnter",function(N){var k=j.getMouseInfo(N);if(k){var _=V(V({},k),{},{isTooltipActive:!0});j.setState(_),j.triggerSyncEvent(_);var C=j.props.onMouseEnter;he(C)&&C(_,N)}}),fe(j,"triggeredAfterMouseMove",function(N){var k=j.getMouseInfo(N),_=k?V(V({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(_),j.triggerSyncEvent(_);var C=j.props.onMouseMove;he(C)&&C(_,N)}),fe(j,"handleItemMouseEnter",function(N){j.setState(function(){return{isTooltipActive:!0,activeItem:N,activePayload:N.tooltipPayload,activeCoordinate:N.tooltipPosition||{x:N.cx,y:N.cy}}})}),fe(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),fe(j,"handleMouseMove",function(N){N.persist(),j.throttleTriggeredAfterMouseMove(N)}),fe(j,"handleMouseLeave",function(N){j.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};j.setState(k),j.triggerSyncEvent(k);var _=j.props.onMouseLeave;he(_)&&_(k,N)}),fe(j,"handleOuterEvent",function(N){var k=KJ(N),_=zr(j.props,"".concat(k));if(k&&he(_)){var C,P;/.*touch.*/i.test(k)?P=j.getMouseInfo(N.changedTouches[0]):P=j.getMouseInfo(N),_((C=P)!==null&&C!==void 0?C:{},N)}}),fe(j,"handleClick",function(N){var k=j.getMouseInfo(N);if(k){var _=V(V({},k),{},{isTooltipActive:!0});j.setState(_),j.triggerSyncEvent(_);var C=j.props.onClick;he(C)&&C(_,N)}}),fe(j,"handleMouseDown",function(N){var k=j.props.onMouseDown;if(he(k)){var _=j.getMouseInfo(N);k(_,N)}}),fe(j,"handleMouseUp",function(N){var k=j.props.onMouseUp;if(he(k)){var _=j.getMouseInfo(N);k(_,N)}}),fe(j,"handleTouchMove",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(N.changedTouches[0])}),fe(j,"handleTouchStart",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&j.handleMouseDown(N.changedTouches[0])}),fe(j,"handleTouchEnd",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&j.handleMouseUp(N.changedTouches[0])}),fe(j,"handleDoubleClick",function(N){var k=j.props.onDoubleClick;if(he(k)){var _=j.getMouseInfo(N);k(_,N)}}),fe(j,"handleContextMenu",function(N){var k=j.props.onContextMenu;if(he(k)){var _=j.getMouseInfo(N);k(_,N)}}),fe(j,"triggerSyncEvent",function(N){j.props.syncId!==void 0&&Jx.emit(Zx,j.props.syncId,N,j.eventEmitterSymbol)}),fe(j,"applySyncEvent",function(N){var k=j.props,_=k.layout,C=k.syncMethod,P=j.state.updateId,E=N.dataStartIndex,A=N.dataEndIndex;if(N.dataStartIndex!==void 0||N.dataEndIndex!==void 0)j.setState(V({dataStartIndex:E,dataEndIndex:A},m({props:j.props,dataStartIndex:E,dataEndIndex:A,updateId:P},j.state)));else if(N.activeTooltipIndex!==void 0){var R=N.chartX,$=N.chartY,D=N.activeTooltipIndex,M=j.state,I=M.offset,T=M.tooltipTicks;if(!I)return;if(typeof C=="function")D=C(T,N);else if(C==="value"){D=-1;for(var L=0;L<T.length;L++)if(T[L].value===N.activeLabel){D=L;break}}var B=V(V({},I),{},{x:I.left,y:I.top}),H=Math.min(R,B.x+B.width),z=Math.min($,B.y+B.height),q=T[D]&&T[D].value,te=b1(j.state,j.props.data,D),ve=T[D]?{x:_==="horizontal"?T[D].coordinate:H,y:_==="horizontal"?z:T[D].coordinate}:U5;j.setState(V(V({},N),{},{activeLabel:q,activeCoordinate:ve,activePayload:te,activeTooltipIndex:D}))}else j.setState(N)}),fe(j,"renderCursor",function(N){var k,_=j.state,C=_.isTooltipActive,P=_.activeCoordinate,E=_.activePayload,A=_.offset,R=_.activeTooltipIndex,$=_.tooltipAxisBandSize,D=j.getTooltipEventType(),M=(k=N.props.active)!==null&&k!==void 0?k:C,I=j.props.layout,T=N.key||"_recharts-cursor";return O.createElement(p1e,{key:T,activeCoordinate:P,activePayload:E,activeTooltipIndex:R,chartName:r,element:N,isActive:M,layout:I,offset:A,tooltipAxisBandSize:$,tooltipEventType:D})}),fe(j,"renderPolarAxis",function(N,k,_){var C=zr(N,"type.axisType"),P=zr(j.state,"".concat(C,"Map")),E=N.type.defaultProps,A=E!==void 0?V(V({},E),N.props):N.props,R=P&&P[A["".concat(C,"Id")]];return w.cloneElement(N,V(V({},R),{},{className:we(C,R.className),key:N.key||"".concat(k,"-").concat(_),ticks:Ui(R,!0)}))}),fe(j,"renderPolarGrid",function(N){var k=N.props,_=k.radialLines,C=k.polarAngles,P=k.polarRadius,E=j.state,A=E.radiusAxisMap,R=E.angleAxisMap,$=Pa(A),D=Pa(R),M=D.cx,I=D.cy,T=D.innerRadius,L=D.outerRadius;return w.cloneElement(N,{polarAngles:Array.isArray(C)?C:Ui(D,!0).map(function(B){return B.coordinate}),polarRadius:Array.isArray(P)?P:Ui($,!0).map(function(B){return B.coordinate}),cx:M,cy:I,innerRadius:T,outerRadius:L,key:N.key||"polar-grid",radialLines:_})}),fe(j,"renderLegend",function(){var N=j.state.formattedGraphicalItems,k=j.props,_=k.children,C=k.width,P=k.height,E=j.props.margin||{},A=C-(E.left||0)-(E.right||0),R=gD({children:_,formattedGraphicalItems:N,legendWidth:A,legendContent:u});if(!R)return null;var $=R.item,D=_O(R,g1e);return w.cloneElement($,V(V({},D),{},{chartWidth:C,chartHeight:P,margin:E,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),fe(j,"renderTooltip",function(){var N,k=j.props,_=k.children,C=k.accessibilityLayer,P=Mr(_,mt);if(!P)return null;var E=j.state,A=E.isTooltipActive,R=E.activeCoordinate,$=E.activePayload,D=E.activeLabel,M=E.offset,I=(N=P.props.active)!==null&&N!==void 0?N:A;return w.cloneElement(P,{viewBox:V(V({},M),{},{x:M.left,y:M.top}),active:I,label:D,payload:I?$:[],coordinate:R,accessibilityLayer:C})}),fe(j,"renderBrush",function(N){var k=j.props,_=k.margin,C=k.data,P=j.state,E=P.offset,A=P.dataStartIndex,R=P.dataEndIndex,$=P.updateId;return w.cloneElement(N,{key:N.key||"_recharts-brush",onChange:um(j.handleBrushChange,N.props.onChange),data:C,x:K(N.props.x)?N.props.x:E.left,y:K(N.props.y)?N.props.y:E.top+E.height+E.brushBottom-(_.bottom||0),width:K(N.props.width)?N.props.width:E.width,startIndex:A,endIndex:R,updateId:"brush-".concat($)})}),fe(j,"renderReferenceElement",function(N,k,_){if(!N)return null;var C=j,P=C.clipPathId,E=j.state,A=E.xAxisMap,R=E.yAxisMap,$=E.offset,D=N.type.defaultProps||{},M=N.props,I=M.xAxisId,T=I===void 0?D.xAxisId:I,L=M.yAxisId,B=L===void 0?D.yAxisId:L;return w.cloneElement(N,{key:N.key||"".concat(k,"-").concat(_),xAxis:A[T],yAxis:R[B],viewBox:{x:$.left,y:$.top,width:$.width,height:$.height},clipPathId:P})}),fe(j,"renderActivePoints",function(N){var k=N.item,_=N.activePoint,C=N.basePoint,P=N.childIndex,E=N.isRange,A=[],R=k.props.key,$=k.item.type.defaultProps!==void 0?V(V({},k.item.type.defaultProps),k.item.props):k.item.props,D=$.activeDot,M=$.dataKey,I=V(V({index:P,dataKey:M,cx:_.x,cy:_.y,r:4,fill:dk(k.item),strokeWidth:2,stroke:"#fff",payload:_.payload,value:_.value},le(D,!1)),Pp(D));return A.push(x.renderActiveDot(D,I,"".concat(R,"-activePoint-").concat(P))),C?A.push(x.renderActiveDot(D,V(V({},I),{},{cx:C.x,cy:C.y}),"".concat(R,"-basePoint-").concat(P))):E&&A.push(null),A}),fe(j,"renderGraphicChild",function(N,k,_){var C=j.filterFormatItem(N,k,_);if(!C)return null;var P=j.getTooltipEventType(),E=j.state,A=E.isTooltipActive,R=E.tooltipAxis,$=E.activeTooltipIndex,D=E.activeLabel,M=j.props.children,I=Mr(M,mt),T=C.props,L=T.points,B=T.isRange,H=T.baseLine,z=C.item.type.defaultProps!==void 0?V(V({},C.item.type.defaultProps),C.item.props):C.item.props,q=z.activeDot,te=z.hide,ve=z.activeBar,Pe=z.activeShape,Q=!!(!te&&A&&I&&(q||ve||Pe)),je={};P!=="axis"&&I&&I.props.trigger==="click"?je={onClick:um(j.handleItemMouseEnter,N.props.onClick)}:P!=="axis"&&(je={onMouseLeave:um(j.handleItemMouseLeave,N.props.onMouseLeave),onMouseEnter:um(j.handleItemMouseEnter,N.props.onMouseEnter)});var G=w.cloneElement(N,V(V({},C.props),je));function ee(Jn){return typeof R.dataKey=="function"?R.dataKey(Jn.payload):null}if(Q)if($>=0){var Z,U;if(R.dataKey&&!R.allowDuplicatedCategory){var Ce=typeof R.dataKey=="function"?ee:"payload.".concat(R.dataKey.toString());Z=Ep(L,Ce,D),U=B&&H&&Ep(H,Ce,D)}else Z=L==null?void 0:L[$],U=B&&H&&H[$];if(Pe||ve){var ye=N.props.activeIndex!==void 0?N.props.activeIndex:$;return[w.cloneElement(N,V(V(V({},C.props),je),{},{activeIndex:ye})),null,null]}if(!xe(Z))return[G].concat(Ic(j.renderActivePoints({item:C,activePoint:Z,basePoint:U,childIndex:$,isRange:B})))}else{var He,We=(He=j.getItemByXY(j.state.activeCoordinate))!==null&&He!==void 0?He:{graphicalItem:G},ct=We.graphicalItem,gr=ct.item,Pr=gr===void 0?N:gr,ws=ct.childIndex,Or=V(V(V({},C.props),je),{},{activeIndex:ws});return[w.cloneElement(Pr,Or),null,null]}return B?[G,null,null]:[G,null]}),fe(j,"renderCustomized",function(N,k,_){return w.cloneElement(N,V(V({key:"recharts-customized-".concat(_)},j.props),j.state))}),fe(j,"renderMap",{CartesianGrid:{handler:pm,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:pm},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:pm},YAxis:{handler:pm},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((b=y.id)!==null&&b!==void 0?b:Oo("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=p4(j.triggeredAfterMouseMove,(S=y.throttleDelay)!==null&&S!==void 0?S:1e3/60),j.state={},j}return A1e(x,v),k1e(x,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,j=b.data,N=b.height,k=b.layout,_=Mr(S,mt);if(_){var C=_.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length-1)){var P=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,E=b1(this.state,j,C,P),A=this.state.tooltipTicks[C].coordinate,R=(this.state.offset.top+N)/2,$=k==="horizontal",D=$?{x:A,y:R}:{y:A,x:R},M=this.state.formattedGraphicalItems.find(function(T){var L=T.item;return L.type.name==="Scatter"});M&&(D=V(V({},D),M.props.points[C].tooltipPosition),E=M.props.points[C].tooltipPayload);var I={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:P,activePayload:E,activeCoordinate:D};this.setState(I),this.renderCursor(_),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var j,N;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0}})}return null}},{key:"componentDidUpdate",value:function(b){Kb([Mr(b.children,mt)],[Mr(this.props.children,mt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Mr(this.props.children,mt);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return l.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,j=S.getBoundingClientRect(),N=wce(j),k={chartX:Math.round(b.pageX-N.left),chartY:Math.round(b.pageY-N.top)},_=j.width/S.offsetWidth||1,C=this.inRange(k.chartX,k.chartY,_);if(!C)return null;var P=this.state,E=P.xAxisMap,A=P.yAxisMap,R=this.getTooltipEventType(),$=AO(this.state,this.props.data,this.props.layout,C);if(R!=="axis"&&E&&A){var D=Pa(E).scale,M=Pa(A).scale,I=D&&D.invert?D.invert(k.chartX):null,T=M&&M.invert?M.invert(k.chartY):null;return V(V({},k),{},{xValue:I,yValue:T},$)}return $?V(V({},k),$):null}},{key:"inRange",value:function(b,S){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=this.props.layout,k=b/j,_=S/j;if(N==="horizontal"||N==="vertical"){var C=this.state.offset,P=k>=C.left&&k<=C.left+C.width&&_>=C.top&&_<=C.top+C.height;return P?{x:k,y:_}:null}var E=this.state,A=E.angleAxisMap,R=E.radiusAxisMap;if(A&&R){var $=Pa(A);return QE({x:k,y:_},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),j=Mr(b,mt),N={};j&&S==="axis"&&(j.props.trigger==="click"?N={onClick:this.handleClick}:N={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 k=Pp(this.props,this.handleOuterEvent);return V(V({},k),N)}},{key:"addListener",value:function(){Jx.on(Zx,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Jx.removeListener(Zx,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,j){for(var N=this.state.formattedGraphicalItems,k=0,_=N.length;k<_;k++){var C=N[k];if(C.item===b||C.props.key===b.key||S===qi(C.item.type)&&j===C.childIndex)return C}return null}},{key:"renderClipPath",value:function(){var b=this.clipPathId,S=this.state.offset,j=S.left,N=S.top,k=S.height,_=S.width;return O.createElement("defs",null,O.createElement("clipPath",{id:b},O.createElement("rect",{x:j,y:N,height:k,width:_})))}},{key:"getXScales",value:function(){var b=this.state.xAxisMap;return b?Object.entries(b).reduce(function(S,j){var N=NO(j,2),k=N[0],_=N[1];return V(V({},S),{},fe({},k,_.scale))},{}):null}},{key:"getYScales",value:function(){var b=this.state.yAxisMap;return b?Object.entries(b).reduce(function(S,j){var N=NO(j,2),k=N[0],_=N[1];return V(V({},S),{},fe({},k,_.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(b){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[b])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(b){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[b])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(b){var S=this.state,j=S.formattedGraphicalItems,N=S.activeItem;if(j&&j.length)for(var k=0,_=j.length;k<_;k++){var C=j[k],P=C.props,E=C.item,A=E.type.defaultProps!==void 0?V(V({},E.type.defaultProps),E.props):E.props,R=qi(E.type);if(R==="Bar"){var $=(P.data||[]).find(function(T){return nve(b,T)});if($)return{graphicalItem:C,payload:$}}else if(R==="RadialBar"){var D=(P.data||[]).find(function(T){return QE(b,T)});if(D)return{graphicalItem:C,payload:D}}else if(uy(C,N)||dy(C,N)||Cf(C,N)){var M=Hye({graphicalItem:C,activeTooltipItem:N,itemData:A.data}),I=A.activeIndex===void 0?M:A.activeIndex;return{graphicalItem:V(V({},C),{},{childIndex:I}),payload:Cf(C,N)?A.data[M]:C.props.data[M]}}}return null}},{key:"render",value:function(){var b=this;if(!UC(this))return null;var S=this.props,j=S.children,N=S.className,k=S.width,_=S.height,C=S.style,P=S.compact,E=S.title,A=S.desc,R=_O(S,v1e),$=le(R,!1);if(P)return O.createElement(aO,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},O.createElement(Xb,kl({},$,{width:k,height:_,title:E,desc:A}),this.renderClipPath(),VC(j,this.renderMap)));if(this.props.accessibilityLayer){var D,M;$.tabIndex=(D=this.props.tabIndex)!==null&&D!==void 0?D:0,$.role=(M=this.props.role)!==null&&M!==void 0?M:"application",$.onKeyDown=function(T){b.accessibilityManager.keyboardEvent(T)},$.onFocus=function(){b.accessibilityManager.focus()}}var I=this.parseEventsOfWrapper();return O.createElement(aO,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},O.createElement("div",kl({className:we("recharts-wrapper",N),style:V({position:"relative",curs
547or:"default",width:k,height:_},C)},I,{ref:function(L){b.container=L}}),O.createElement(Xb,kl({},$,{width:k,height:_,title:E,desc:A,style:R1e}),this.renderClipPath(),VC(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(w.Component);fe(g,"displayName",r),fe(g,"defaultProps",V({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),fe(g,"getDerivedStateFromProps",function(v,x){var y=v.dataKey,b=v.data,S=v.children,j=v.width,N=v.height,k=v.layout,_=v.stackOffset,C=v.margin,P=x.dataStartIndex,E=x.dataEndIndex;if(x.updateId===void 0){var A=EO(v);return V(V(V({},A),{},{updateId:0},m(V(V({props:v},A),{},{updateId:0}),x)),{},{prevDataKey:y,prevData:b,prevWidth:j,prevHeight:N,prevLayout:k,prevStackOffset:_,prevMargin:C,prevChildren:S})}if(y!==x.prevDataKey||b!==x.prevData||j!==x.prevWidth||N!==x.prevHeight||k!==x.prevLayout||_!==x.prevStackOffset||!Il(C,x.prevMargin)){var R=EO(v),$={chartX:x.chartX,chartY:x.chartY,isTooltipActive:x.isTooltipActive},D=V(V({},AO(x,b,k)),{},{updateId:x.updateId+1}),M=V(V(V({},R),$),D);return V(V(V({},M),m(V({props:v},M),x)),{},{prevDataKey:y,prevData:b,prevWidth:j,prevHeight:N,prevLayout:k,prevStackOffset:_,prevMargin:C,prevChildren:S})}if(!Kb(S,x.prevChildren)){var I,T,L,B,H=Mr(S,kc),z=H&&(I=(T=H.props)===null||T===void 0?void 0:T.startIndex)!==null&&I!==void 0?I:P,q=H&&(L=(B=H.props)===null||B===void 0?void 0:B.endIndex)!==null&&L!==void 0?L:E,te=z!==P||q!==E,ve=!xe(b),Pe=ve&&!te?x.updateId:x.updateId+1;return V(V({updateId:Pe},m(V(V({props:v},x),{},{updateId:Pe,dataStartIndex:z,dataEndIndex:q}),x)),{},{prevChildren:S,dataStartIndex:z,dataEndIndex:q})}return null}),fe(g,"renderActiveDot",function(v,x,y){var b;return w.isValidElement(v)?b=w.cloneElement(v,x):he(v)?b=v(x):b=O.createElement(ch,x),O.createElement(Ae,{className:"recharts-active-dot",key:y},b)});var p=w.forwardRef(function(x,y){return O.createElement(g,kl({},x,{ref:y}))});return p.displayName=g.displayName,p},jk=yy({chartName:"LineChart",GraphicalChild:jr,axisComponents:[{axisType:"xAxis",AxisComp:fr},{axisType:"yAxis",AxisComp:hr}],formatAxisMap:hk}),Rf=yy({chartName:"BarChart",GraphicalChild:Hr,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:fr},{axisType:"yAxis",AxisComp:hr}],formatAxisMap:hk}),V5=yy({chartName:"PieChart",GraphicalChild:Ai,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:cy},{axisType:"radiusAxis",AxisComp:oy}],formatAxisMap:vme,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),OO=yy({chartName:"AreaChart",GraphicalChild:na,axisComponents:[{axisType:"xAxis",AxisComp:fr},{axisType:"yAxis",AxisComp:hr}],formatAxisMap:hk});const xy={bittensor:"https://assets.coingecko.com/coins/images/28452/small/ARUsPeNQ_400x400.jpeg","render-token":"https://assets.coingecko.com/coins/images/11636/small/rndr.png","fetch-ai":"https://assets.coingecko.com/coins/images/5681/standard/ASI.png",io:"https://assets.coingecko.com/coins/images/37754/standard/io_blackbg.png","akash-network":"https://assets.coingecko.com/coins/images/12785/small/akash-logo.png",arweave:"https://assets.coingecko.com/coins/images/4343/small/oRt6SiEN_400x400.jpg","get-grass":"https://assets.coingecko.com/coins/images/40094/standard/Grass.jpg",grass:"https://assets.coingecko.com/coins/images/40094/standard/Grass.jpg","virtual-protocol":"https://assets.coingecko.com/coins/images/34057/standard/LOGOMARK.png",griffain:"https://assets.coingecko.com/coins/images/52547/small/griffain.jpg",near:"https://assets.coingecko.com/coins/images/10365/small/near.jpg","0g-labs":"https://assets.coingecko.com/coins/images/69096/standard/0G_1024x1024_Circular_Outlined.png","venice-token":"https://assets.coingecko.com/coins/images/54023/standard/VVV_Token_Transparent.png","the-graph":"https://assets.coingecko.com/coins/images/13397/standard/Graph_Token.png",clanker:"https://assets.coingecko.com/coins/images/67700/standard/ghy.jpg",origintrail:"https://assets.coingecko.com/coins/images/1877/standard/TRAC.jpg","ondo-finance":"https://assets.coingecko.com/coins/images/26580/small/ONDO.png",maker:"https://assets.coingecko.com/coins/images/1364/small/Mark_Maker.png",pendle:"https://assets.coingecko.com/coins/images/15069/small/Pendle_Logo_Normal-03.png",clearpool:"https://assets.coingecko.com/coins/images/19252/small/CPOOL.png",maple:"https://assets.coingecko.com/coins/images/14097/small/Maple_Token.png",goldfinch:"https://assets.coingecko.com/coins/images/19081/small/Goldfinch-mark-gold.png",centrifuge:"https://assets.coingecko.com/coins/images/17106/small/centrifuge.jpg","realio-network":"https://assets.coingecko.com/coins/images/20040/small/realio-network.jpeg",polymesh:"https://assets.coingecko.com/coins/images/23496/small/Polymesh_Symbol_-_Official.png",truefi:"https://assets.coingecko.com/coins/images/13180/small/truefi_glyph_color.png"},V1e={GPU:"badge-gpu",Data:"badge-data",Agent:"badge-agent",Protocol:"badge-protocol",General:"badge-general",Storage:"badge-gpu",Identity:"badge-protocol","N/A":"badge-general",Lending:"badge-protocol",Credit:"badge-data",Securities:"badge-agent",Platform:"badge-gpu",Yield:"badge-general"},Cn=({label:e,value:t,subValue:r,isLoading:n,isPositive:i,isNegative:a})=>s.jsxs("div",{className:"bg-muted/30 rounded-lg p-3 border border-border/40",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),n?s.jsx(be,{className:"h-6 w-20 mt-1"}):s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("p",{className:`font-mono text-sm font-medium ${i?"text-green-600":a?"text-red-600":""}`,children:t}),r&&s.jsx("span",{className:`text-xs ${i?"text-green-600":a?"text-red-600":"text-muted-foreground"}`,children:r})]})]}),Ou=({icon:e,label:t,value:r,isLoading:n})=>s.jsxs("div",{className:"flex items-center gap-3 bg-muted/30 rounded-lg p-3 border border-border/40",children:[s.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center",children:s.jsx(e,{className:"w-4 h-4 text-primary"})}),s.jsxs("div",{children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:t}),n?s.jsx(be,{className:"h-5 w-12 mt-0.5"}):s.jsx("p",{className:"font-mono text-sm font-medium",children:r??"â"})]})]}),Zo=e=>e>=1e9?`$${(e/1e9).toFixed(1)}B`:e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(1)}K`:`$${e.toFixed(2)}`,su=({open:e,onOpenChange:t,ticker:r,name:n,category:i,description:a,coingeckoId:o})=>{var m,g,p,v,x;const[l,c]=w.useState(!1),{data:u,isLoading:d}
547=rY(r,e),f=o?xy[o]:null,h=((u==null?void 0:u.priceChange24h)??0)>=0;return s.jsx(aS,{open:e,onOpenChange:t,children:s.jsxs(yv,{className:"max-w-4xl max-h-[90vh] p-0",children:[s.jsx(xv,{className:"p-6 pb-4 border-b border-border/40",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"w-14 h-14 rounded-lg bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center border border-primary/10 overflow-hidden",children:f&&!l?s.jsx("img",{src:f,alt:`${n} logo`,className:"w-full h-full object-cover",onError:()=>c(!0)}):s.jsx("span",{className:"font-serif text-xl font-bold text-primary",children:r.slice(0,2)})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(bv,{className:"font-serif text-2xl",children:r}),s.jsx(Me,{variant:"outline",className:`${V1e[i]} text-xs font-medium`,children:i})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),u&&s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"font-mono text-2xl font-medium",children:u.priceFormatted}),s.jsxs("div",{className:`flex items-center justify-end gap-1 text-sm ${h?"text-green-600":"text-red-600"}`,children:[h?s.jsx(wi,{className:"w-4 h-4"}):s.jsx(rv,{className:"w-4 h-4"}),s.jsxs("span",{className:"font-mono",children:[h?"+":"",u.priceChange24h.toFixed(2),"%"]})]})]})]})}),s.jsx(OM,{className:"max-h-[calc(90vh-120px)]",children:s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-serif text-sm font-medium mb-2 text-muted-foreground",children:"About"}),s.jsx("p",{className:"text-sm leading-relaxed",children:a})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-serif text-sm font-medium mb-3 text-muted-foreground",children:"Market Metrics"}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[s.jsx(Cn,{label:"Market Cap",value:(u==null?void 0:u.marketCapFormatted)??"â",isLoading:d}),s.jsx(Cn,{label:"FDV",value:(u==null?void 0:u.fdvFormatted)??"â",isLoading:d}),s.jsx(Cn,{label:"24h Volume",value:(u==null?void 0:u.volume24hFormatted)??"â",isLoading:d}),s.jsx(Cn,{label:"24h Change",value:u?`${h?"+":""}${u.priceChange24h.toFixed(2)}%`:"â",isLoading:d,isPositive:h,isNegative:!h}),s.jsx(Cn,{label:"MCap/FDV",value:(u==null?void 0:u.mcapFdvRatio)??"â",isLoading:d}),s.jsx(Cn,{label:"Circ. Supply",value:(u==null?void 0:u.circulatingSupplyFormatted)??"â",isLoading:d}),s.jsx(Cn,{label:"Total Supply",value:(u==null?void 0:u.totalSupplyFormatted)??"â",isLoading:d}),s.jsx(Cn,{label:"+/-2% OB Depth",value:(u==null?void 0:u.obDepth2PctFormatted)??"â",isLoading:d}),(u==null?void 0:u.tvlFormatted)&&s.jsx(Cn,{label:"TVL",value:u.tvlFormatted,isLoading:d}),s.jsx(Cn,{label:"Max DD 24h",value:(u==null?void 0:u.maxDrawdown24hFormatted)??"â",isLoading:d,isNegative:(u==null?void 0:u.maxDrawdown24h)!=null&&u.maxDrawdown24h<0}),s.jsx(Cn,{label:"Max DD 7d",value:(u==null?void 0:u.maxDrawdown7dFormatted)??"â",isLoading:d,isNegative:(u==null?void 0:u.maxDrawdown7d)!=null&&u.maxDrawdown7d<0})]})]}),(d||u&&(!!u.githubStars||!!u.githubForks||!!u.totalCommits||!!u.contributors||!!u.recentCommits4w))&&s.jsxs("div",{children:[s.jsxs("h3",{className:"font-serif text-sm font-medium mb-3 text-muted-foreground",children:["Developer Activity",(u==null?void 0:u.githubRepoName)&&s.jsx("a",{href:`https://github.com/${u.githubRepoName}`,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-xs text-primary/70 hover:text-primary font-mono",children:u.githubRepoName})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[s.jsx(Ou,{icon:lR,label:"Stars",value:(m=u==null?void 0:u.githubStars)==null?void 0:m.toLocaleString(),isLoading:d}),s.jsx(Ou,{icon:d8,label:"Forks",value:(g=u==null?void 0:u.githubForks)==null?void 0:g.toLocaleString(),isLoading:d}),s.jsx(Ou,{icon:o_,label:"Total Commits",value:(p=u==null?void 0:u.totalCommits)==null?void 0:p.toLocaleString(),isLoading:d}),s.jsx(Ou,{icon:ob,label:"Contributors",value:(v=u==null?void 0:u.contributors)==null?void 0:v.toLocaleStr
547ing(),isLoading:d}),s.jsx(Ou,{icon:o_,label:"Commits (4wk)",value:(x=u==null?void 0:u.recentCommits4w)==null?void 0:x.toLocaleString(),isLoading:d})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-serif text-sm font-medium mb-3 text-muted-foreground",children:"Historical Data (30 Days)"}),s.jsxs(hS,{defaultValue:"price",className:"w-full",children:[s.jsxs(kv,{className:"grid w-full grid-cols-3 mb-4",children:[s.jsx(Hi,{value:"price",className:"text-xs",children:"Price"}),s.jsx(Hi,{value:"mcap",className:"text-xs",children:"Market Cap"}),s.jsx(Hi,{value:"volume",className:"text-xs",children:"Volume"})]}),s.jsx(dd,{value:"price",className:"h-[250px]",children:d?s.jsx(be,{className:"w-full h-full"}):u!=null&&u.priceHistory?s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(OO,{data:u.priceHistory,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"priceGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"hsl(var(--primary))",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"hsl(var(--primary))",stopOpacity:0})]})}),s.jsx(Vn,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),s.jsx(fr,{dataKey:"date",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickLine:!1}),s.jsx(hr,{tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickLine:!1,tickFormatter:y=>Zo(y),width:60}),s.jsx(mt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:"12px"},formatter:y=>[Zo(y),"Price"]}),s.jsx(na,{type:"monotone",dataKey:"value",stroke:"hsl(var(--primary))",strokeWidth:2,fill:"url(#priceGradient)"})]})}):s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No data available"})}),s.jsx(dd,{value:"mcap",className:"h-[250px]",children:d?s.jsx(be,{className:"w-full h-full"}):u!=null&&u.marketCapHistory?s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(OO,{data:u.marketCapHistory,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"mcapGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"hsl(var(--chart-2))",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"hsl(var(--chart-2))",stopOpacity:0})]})}),s.jsx(Vn,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),s.jsx(fr,{dataKey:"date",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickLine:!1}),s.jsx(hr,{tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickLine:!1,tickFormatter:y=>Zo(y),width:60}),s.jsx(mt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:"12px"},formatter:y=>[Zo(y),"Market Cap"]}),s.jsx(na,{type:"monotone",dataKey:"value",stroke:"hsl(var(--chart-2))",strokeWidth:2,fill:"url(#mcapGradient)"})]})}):s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No data available"})}),s.jsx(dd,{value:"volume",className:"h-[250px]",children:d?s.jsx(be,{className:"w-full h-full"}):u!=null&&u.volumeHistory?s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(Rf,{data:u.volumeHistory,children:[s.jsx(Vn,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),s.jsx(fr,{dataKey:"date",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickLine:!1}),s.jsx(hr,{tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickLine:!1,tickFormatter:y=>Zo(y),width:60}),s.jsx(mt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:"12px"},formatter:y=>[Zo(y),"Volume"]}),s.jsx(Hr,{dataKey:"value",fill:"hsl(var(--chart-3))",radius:[4,4,0,0]})]})}):s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No data available"})})]})]})]})})]})})},H1e={GPU:"badge-gpu",Data:"badge-data",Agent:"badge-agent",Protocol:"badge-protocol",General:"badge-general",Storage:"badge-gpu",Identity:"badge-protocol","N/A":"badge-general"},q1e=({ticker:e,name:t,category:r,description:n,coingeckoId:i,metrics:a,marketData:o,isLoading:l=!1,index:c=0})=>{const[u,d]=w.useState(!1),[f,h]=w.useState(!1),m=i?xy[i]:null;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bg-card rounded-lg border border-border/60 p-6 transition-[transform,box-shadow,border-color] duration-300 ease-out group hover:shadow-xl hover:shadow-
547primary/5 hover:border-primary/30 hover:-translate-y-1 hover:scale-[1.02] animate-fade-in cursor-pointer",style:{animationDelay:`${c*50}ms`},onClick:()=>h(!0),children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-12 h-12 rounded-lg bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center border border-primary/10 overflow-hidden",children:m&&!u?s.jsx("img",{src:m,alt:`${t} logo`,className:"w-full h-full object-cover",onError:()=>d(!0)}):s.jsx("span",{className:"font-serif text-lg font-bold text-primary",children:e.slice(0,2)})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-serif text-lg font-medium",children:e}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t})]})]}),s.jsx(Me,{variant:"outline",className:`${H1e[r]} text-xs font-medium`,children:r})]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4 line-clamp-3",children:n}),s.jsx("div",{className:"border-t border-border/40 pt-4 mt-4",children:s.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"MCap"}),l?s.jsx(be,{className:"h-5 w-14 mt-0.5"}):s.jsx("p",{className:"font-medium",children:(o==null?void 0:o.marketCap)||"â"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"24h Vol"}),l?s.jsx(be,{className:"h-5 w-14 mt-0.5"}):s.jsx("p",{className:"font-medium",children:(o==null?void 0:o.volume24h)||"â"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Rating"}),s.jsx("p",{className:"font-medium",children:a.rating||"â"})]})]})})]}),s.jsx(su,{open:f,onOpenChange:h,ticker:e,name:t,category:r,description:n,coingeckoId:i})]})},Vt=w.forwardRef(({className:e,...t},r)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:r,className:X("w-full caption-bottom text-sm",e),...t})}));Vt.displayName="Table";const Ht=w.forwardRef(({className:e,...t},r)=>s.jsx("thead",{ref:r,className:X("[&_tr]:border-b",e),...t}));Ht.displayName="TableHeader";const qt=w.forwardRef(({className:e,...t},r)=>s.jsx("tbody",{ref:r,className:X("[&_tr:last-child]:border-0",e),...t}));qt.displayName="TableBody";const G1e=w.forwardRef(({className:e,...t},r)=>s.jsx("tfoot",{ref:r,className:X("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));G1e.displayName="TableFooter";const me=w.forwardRef(({className:e,...t},r)=>s.jsx("tr",{ref:r,className:X("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));me.displayName="TableRow";const J=w.forwardRef(({className:e,...t},r)=>s.jsx("th",{ref:r,className:X("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));J.displayName="TableHead";const W=w.forwardRef(({className:e,...t},r)=>s.jsx("td",{ref:r,className:X("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));W.displayName="TableCell";const K1e=w.forwardRef(({className:e,...t},r)=>s.jsx("caption",{ref:r,className:X("mt-4 text-sm text-muted-foreground",e),...t}));K1e.displayName="TableCaption";const t0=e=>e>=1e9?`$${(e/1e9).toFixed(1)}B`:e>=1e6?`$${(e/1e6).toFixed(0)}M`:e>=1e3?`$${(e/1e3).toFixed(0)}K`:`$${e.toFixed(0)}`,TO=e=>e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toFixed(0),Y1e=(e,t)=>{if(!t||t===0)return"100%";const r=e/t*100;return`${Math.round(r)}%`},X1e=e=>{const t={};for(const r of e){const n=r.priceUsd?parseFloat(r.priceUsd):0,i=r.marketCap?parseFloat(r.marketCap):0,a=r.volume24h?parseFloat(r.volume24h):0,o=r.fullyDilutedValuation?parseFloat(r.fullyDilutedValuation):null,l=r.percentChange24h?parseFloat(r.percentChange24h):0,c=r.circulatingSupply?parseFloat(r.circulatingSupply):0,u=r.totalSupply?parseFloat(r.totalSupply):0,d=r.athDrawdownPct?parseFloat(r.athDrawdownPct):null,f=r.obDepth2PctBid?parseFloat(r.obDepth2PctBid):null,h=r.obDepth2PctAsk?parseFloat(r.obDepth2PctAsk):null,m=r.obDepth2PctTotal?parseFloat(r.obDepth2PctTotal):null,g={marketCap:t0(i),volume24h:t0(a),mcapFdvRatio:Y1e(i,o),price:n,rawMarketCap:i,rawVolume24h:a,rawFdv:o,percentChange24h:l,circulatingSupply:c,circulatingSupplyFormatted:c?TO(c):"â",totalSupply:u,totalSupplyFormatted:u?TO(u):"â",athDrawdownPct:d,obDepth2PctBid:f,obDepth2PctAsk:h,obDepth2PctTotal:m,obDepth2PctFormatted:m?t0(m):"â"};r.coingeckoId&&(t[r.coingeckoId]=g),t[r.symbol]=g}return t},ys=e=>gn({queryKey:["marketData","api-latest"],queryFn:async()=>{const t=await WK();return X1e(t)},staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,enabled:e.length>0}),ls={dampingAlpha:.75,maxWeight:.25,minWeight:.01},Og={dampingAlpha:.75,maxWeight:.2,minWeight:.01};function Q1e(e,t){const r=e.map(i=>({...i,dampenedCap:Math.pow(i.marketCap,t)})),n=r.reduce((i,a)=>i+a.dampenedCap,0);return r.map(i=>({ticker:i.ticker,name:i.name,category:i.category,marketCap:i.marketCap,rawWeight:n>0?i.dampenedCap/n:0,adjustedWeight:0,finalWeight:0}))}function J1e(e,t){const r=e.map(a=>({...a,adjustedWeight:a.rawWeight}));let n=0;const i=10;for(;n<i;){let a=!1,o=0,l=0;if(r.forEach(c=>{c.adjustedWeight>t.maxWeight?(o+=c.adjustedWeight-t.maxWeight,c.adjustedWeight=t.maxWeight,a=!0):c.adjustedWeight<t.minWeight&&c.marketCap>0&&(c.adjustedWeight=t.minWeight)}),r.forEach(c=>{c.adjustedWeight<t.maxWeight&&c.adjustedWeight>=t.minWeight&&l++}),a&&l>0&&o>0){const c=o/l;r.forEach(u=>{u.adjustedWeight<t.maxWeight&&u.adjustedWeight>=t.minWeight&&(u.adjustedWeight+=c)})}if(!a)break;n++}return r}function Z1e(e){const t=e.reduce((r,n)=>r+n.adjustedWeight,0);if(t===0){const r=1/e.length;return e.map(n=>({...n,finalWeight:r}))}return e.map(r=>({...r,finalWeight:r.adjustedWeight/t}))}function H5(e,t=ls){const r=e.filter(c=>c.marketCap>0),n=e.filter(c=>c.marketCap<=0);if(r.length===0)return e.map(c=>({ticker:c.ticker,name:c.name,category:c.category,marketCap:c.marketCap,rawWeight:0,adjustedWeight:0,finalWeight:1/e.length}));const i=Q1e(r,t.dampingAlpha),a=J1e(i,t),o=Z1e(a),l=n.map(c=>({ticker:c.ticker,name:c.name,category:c.category,marketCap:0,rawWeight:0,adjustedWeight:0,finalWeight:0}));return[...o,...l].sort((c,u)=>u.finalWeight-c.finalWeight)}function eje(e){const t=new Map;return e.forEach(r=>{const n=t.get(r.category)||0;t.set(r.category,n+r.finalWeight)}),Array.from(t.entries()).map(([r,n])=>({category:r,weight:n})).sort((r,n)=>
547n.weight-r.weight)}function Sk(e,t=ls){const r=e.map(l=>l.coingeckoId).filter(l=>!!l),{data:n,isLoading:i}=ys(r),a=w.useMemo(()=>{if(!n||i)return e.map(c=>({ticker:c.ticker,name:c.name,category:c.category,marketCap:0,rawWeight:0,adjustedWeight:0,finalWeight:1/e.length}));const l=e.map(c=>{const u=(c.coingeckoId?n[c.coingeckoId]:void 0)??n[c.ticker],d=(u==null?void 0:u.rawMarketCap)??0;return{ticker:c.ticker,name:c.name,category:c.category,marketCap:d}});return H5(l,t)},[e,n,i,t]),o=w.useMemo(()=>eje(a),[a]);return{weights:a,categoryWeights:o,isLoading:i,config:t,lastUpdated:new Date}}const Tg=[{ticker:"TAO",name:"Bittensor",category:"General",coingeckoId:"bittensor",description:"Bittensor is a decentralized machine learning network that enables the creation and operation of AI models through a blockchain-based incentive mechanism, rewarding contributors for valuable computational work.",metrics:{rating:"A-",sustainabilityScore:75,sustainabilityNotes:"Strong community governance, transparent treasury management"}},{ticker:"RENDER",name:"Render Network",category:"GPU",coingeckoId:"render-token",description:"Render Network provides decentralized GPU rendering services, connecting artists and studios requiring compute power with GPU providers to enable scalable 3D rendering and AI inference.",metrics:{rating:"A",sustainabilityScore:85,sustainabilityNotes:"Real revenue from rendering jobs, established customer base"}},{ticker:"FET",name:"Fetch.ai",category:"Data",coingeckoId:"fetch-ai",description:"Fetch.ai is an AI-powered blockchain platform that enables autonomous agents to perform complex tasks, facilitating decentralized data sharing and machine learning applications.",metrics:{rating:"A-",sustainabilityScore:70,sustainabilityNotes:"Growing enterprise partnerships, agent marketplace revenue"}},{ticker:"IO",name:"io.net",category:"GPU",coingeckoId:"io",description:"io.net aggregates underutilized GPU resources from data centers, crypto miners, and consumer hardware to create a decentralized computing network for AI/ML workloads.",metrics:{rating:"B+",sustainabilityScore:55,sustainabilityNotes:"Early stage with significant token unlocks ahead"}},{ticker:"AKT",name:"Akash Network",category:"GPU",coingeckoId:"akash-network",description:"Akash Network is a decentralized cloud computing marketplace that leverages underutilized compute capacity to offer cloud services at competitive prices through a reverse auction system.",metrics:{rating:"B+",sustainabilityScore:72,sustainabilityNotes:"Growing deployment revenue, active lease marketplace"}},{ticker:"AR",name:"Arweave",category:"GPU",coingeckoId:"arweave",description:"Arweave provides permanent, decentralized data storage through its novel blockweave architecture, enabling permanent hosting of applications, files, and web content.",metrics:{rating:"A",sustainabilityScore:88,sustainabilityNotes:"Fully circulating supply, sustainable storage endowment model"}},{ticker:"GRASS",name:"Grass",category:"Data",coingeckoId:"grass",description:"Grass enables users to monetize their unused internet bandwidth, creating a decentralized data network that rewards participants for contributing to web scraping and data collection.",metrics:{rating:"B",sustainabilityScore:45,sustainabilityNotes:"New token with large unlocks, revenue model still developing"}},{ticker:"VIRTUAL",name:"Virtuals Protocol",category:"Agent",coingeckoId:"virtual-protocol",description:"Virtuals Protocol enables the creation and deployment of AI agents that can own assets, transact autonomously, and generate revenue across gaming and entertainment ecosystems.",metrics:{rating:"B+",sustainabilityScore:68,sustainabilityNotes:"Agent creation fees, growing ecosystem revenue"}},{ticker:"GRIFF",name:"Griffain",category:"Agent",coingeckoId:"griffain",description:"Griffain is an autonomous AI agent platform on Solana that enables users to create, deploy, and manage AI agents for trading, social engagement, and automated tasks.",metrics:{rating:"C",sustainabilityScore:40,sustainabilityNotes:"Early stage, limited revenue data available"}},{ticker:"NEAR",name:"NEAR Protocol",category:"Protocol",coingeckoId:"near",description:"NEAR Protocol is a sharded, developer-friendly Layer 1 blockchain designed for usability and scalability, featuring chain abstraction and AI integration capabilities.",metrics:{rating:"A",sustainabilityScore:80,sustainabilityNotes:"Strong ecosystem fund, growing transaction revenue"}},{ticker:"0G",name:"0G Labs",category:"Protocol",coingeckoId:"zero-gravity",description:"0G is a modular AI blockchain providing infinitely scalable data availability and decentralized storage, purpose-built for AI applications with high-throughput data pipelines.",metrics:{rating:"-",sustainabilityScore:50,sustainabilityNotes:"Pre-launch, sustainability metrics not yet available"}},{ticker:"GLM",name:"Golem",category:"General",coingeckoId:"golem",description:"Golem is a decentralized protocol in the artificial-intelligence category.",metrics:{rating:"N/A",sustainabilityScore:50,sustainabilityNotes:"Added via admin scanner - awaiting manual assessment"}},{ticker:"IP",name:"Story",category:"General",coingeckoId:"story-2",description:"Story is a decentralized protocol in the artificial-intelligence category.",metrics:{rating:"N/A",sustainabilityScore:50,sustainabilityNotes:"Added via admin scanner - awaiting manual assessment"}},{ticker:"EIGEN",name:"EigenCloud (prev. EigenLayer)",category:"Data",coingeckoId:"eigenlayer",description:"EigenCloud (prev. EigenLayer) is a decentralized protocol in the data-availability category.",metrics:{rating:"N/A",sustainabilityScore:50,sustainabilityNotes:"Added via admin scanner - awaiting manual assessment"}}],tje=[{rank:1,name:"Securitize",rwaCount:21,rwaTotalValue:"$3,232,348,905",rwaTotalValueChange:"up",rwaHolders:1741,rwaHoldersChange:"up",assetClasses:["U.S. Treasuries","Institutional Funds"]},{rank:2,name:"Maple",rwaCount:16,rwaTotalValue:"$2,040,000,000",rwaTotalValueChange:"up",rwaHolders:4423,rwaHoldersChange:"up",assetClasses:["Private Credit","U.S. Treasuries"]}
547,{rank:3,name:"Ondo",rwaCount:203,rwaTotalValue:"$1,990,000,000",rwaTotalValueChange:"up",rwaHolders:51605,rwaHoldersChange:"up",assetClasses:["U.S. Treasuries","Stocks"]},{rank:4,name:"Tether Holdings",rwaCount:1,rwaTotalValue:"$1,930,000,000",rwaTotalValueChange:"down",rwaHolders:22411,rwaHoldersChange:"up",assetClasses:["Stablecoins","Commodities"]},{rank:5,name:"Paxos",rwaCount:1,rwaTotalValue:"$1,760,000,000",rwaTotalValueChange:"up",rwaHolders:89587,rwaHoldersChange:"up",assetClasses:["Stablecoins","Commodities"]},{rank:6,name:"Circle",rwaCount:1,rwaTotalValue:"$1,510,000,000",rwaTotalValueChange:"up",rwaHolders:54,rwaHoldersChange:"neutral",assetClasses:["Stablecoins","U.S. Treasuries"]},{rank:7,name:"Centrifuge",rwaCount:4,rwaTotalValue:"$1,250,000,000",rwaTotalValueChange:"up",rwaHolders:23,rwaHoldersChange:"down",assetClasses:["Institutional Funds","U.S. Treasuries"]},{rank:8,name:"Libeara",rwaCount:14,rwaTotalValue:"$1,050,000,000",rwaTotalValueChange:"up",rwaHolders:36,rwaHoldersChange:"up",assetClasses:["U.S. Treasuries","Non-U.S. Gov Debt"]},{rank:9,name:"STOKR",rwaCount:1,rwaTotalValue:"$1,020,000,000",rwaTotalValueChange:"down",rwaHolders:22,rwaHoldersChange:"neutral",assetClasses:["Corporate Bonds"]},{rank:10,name:"Superstate",rwaCount:2,rwaTotalValue:"$925,000,000",rwaTotalValueChange:"up",rwaHolders:140,rwaHoldersChange:"up",assetClasses:["U.S. Treasuries","Institutional Funds"]}],rje=[{name:"Securitize",category:"Platform",description:"Leading digital asset securities platform enabling tokenization of real-world assets with full regulatory compliance.",rwaCount:21,rwaTotalValue:"$3.23B",assetClasses:["U.S. Treasuries","Institutional Funds"]},{name:"Maple",category:"Platform",description:"Institutional capital network providing undercollateralized loans to institutions and corporate borrowers.",rwaCount:16,rwaTotalValue:"$2.04B",assetClasses:["Private Credit","U.S. Treasuries"]},{name:"Ondo",category:"Platform",description:"Tokenized securities platform offering exposure to US Treasuries and institutional-grade financial products.",rwaCount:203,rwaTotalValue:"$1.99B",assetClasses:["U.S. Treasuries","Stocks"]},{name:"Circle",category:"Platform",description:"Global financial technology firm and issuer of USDC stablecoin with treasury-backed reserves.",rwaCount:1,rwaTotalValue:"$1.51B",assetClasses:["Stablecoins","U.S. Treasuries"]},{name:"Paxos",category:"Platform",description:"Regulated blockchain infrastructure company enabling tokenization of commodities and stablecoins.",rwaCount:1,rwaTotalValue:"$1.76B",assetClasses:["Stablecoins","Commodities"]},{name:"Centrifuge",category:"Platform",description:"Infrastructure layer for bringing real-world assets on-chain, enabling structured credit and asset financing.",rwaCount:4,rwaTotalValue:"$1.25B",assetClasses:["Institutional Funds","U.S. Treasuries"]}],w1=[{ticker:"ONDO",name:"Ondo Finance",category:"Securities",description:"Tokenized securities platform offering exposure to US Treasuries and institutional-grade financial products on-chain.",coingeckoId:"ondo-finance",totalValueTokenized:"$1.99B",metrics:{mcapFdv:"â",volume24h:"â",rating:"A"}},{ticker:"MKR",name:"Maker",category:"Lending",description:"Pioneer DeFi lending protocol with significant RWA collateral backing DAI stablecoin through real-world asset vaults.",coingeckoId:"maker",totalValueTokenized:"$3.0B",metrics:{mcapFdv:"â",volume24h:"â",rating:"A+"}},{ticker:"PENDLE",name:"Pendle",category:"Yield",description:"Yield tokenization protocol enabling trading of future yield, with growing integration of RWA yield sources.",coingeckoId:"pendle",totalValueTokenized:"$0",metrics:{mcapFdv:"â",volume24h:"â",rating:"A"}},{ticker:"CPOOL",name:"Clearpool",category:"Credit",description:"Decentralized credit marketplace for institutional borrowers, offering uncollateralized lending with risk-adjusted yields.",coingeckoId:"clearpool",totalValueTokenized:"$100M",metrics:{mcapFdv:"â",volume24h:"â",rating:"B+"}},{ticker:"MPL",name:"Maple Finance",category:"Lending",description:"Institutional capital network providing undercollateralized loans to crypto-native institutions and RWA borrowers.",coingeckoId:"maple",totalValueTokenized:"$2.04B",metrics:{mcapFdv:"â",volume24h:"â",rating:"B+"}},{ticker:"GFI",name:"Goldfinch",category:"Credit",description:"Decentralized credit protocol bringing crypto loans to real-world borrowers in emerging markets without crypto collateral.",coingeckoId:"goldfinch",totalValueTokenized:"$100M",metrics:{mcapFdv:"â",volume24h:"â",rating:"B"}},{ticker:"CFG",name:"Centrifuge",category:"Platform",description:"Infrastru
547cture layer for bringing real-world assets on-chain, enabling structured credit and asset financing.",coingeckoId:"centrifuge",totalValueTokenized:"$1.25B",metrics:{mcapFdv:"â",volume24h:"â",rating:"B+"}},{ticker:"RIO",name:"Realio Network",category:"Platform",description:"End-to-end tokenization platform for private equity, real estate, and alternative investments with compliance built-in.",coingeckoId:"realio-network",totalValueTokenized:"$50M",metrics:{mcapFdv:"â",volume24h:"â",rating:"B"}},{ticker:"POLYX",name:"Polymesh",category:"Platform",description:"Purpose-built blockchain for regulated security tokens with native compliance, identity, and settlement features.",coingeckoId:"polymesh",totalValueTokenized:"$100M",metrics:{mcapFdv:"â",volume24h:"â",rating:"B"}},{ticker:"TRU",name:"TrueFi",category:"Credit",description:"Uncollateralized lending protocol with on-chain credit scoring, serving institutional borrowers and RWA opportunities.",coingeckoId:"truefi",totalValueTokenized:"$50M",metrics:{mcapFdv:"â",volume24h:"â",rating:"B"}}];function nje(e){return{ticker:e.ticker,name:e.name,category:e.category,description:e.description||"",coingeckoId:e.coingecko_id||void 0,metrics:{rating:e.rating||void 0,sustainabilityScore:e.sustainability_score||void 0,sustainabilityNotes:e.sustainability_notes||void 0}}}function ije(e){return{ticker:e.ticker,name:e.name,category:e.category,description:e.description||"",coingeckoId:e.coingecko_id||void 0,totalValueTokenized:e.total_value_tokenized||void 0,metrics:{mcapFdv:"â",volume24h:"â",rating:e.rating||"â"}}}function by(){return gn({queryKey:["dai-constituents"],queryFn:async()=>{try{const{data:e}=await ZM("dai");return!e||e.length===0?Tg:e.map(nje)}catch(e){return console.error("Failed to fetch dAI constituents:",e),Tg}},staleTime:5*60*1e3})}function wy(){return gn({queryKey:["rwa-constituents"],queryFn:async()=>{try{const{data:e}=await ZM("rwa");return!e||e.length===0?w1:e.map(ije)}catch(e){return console.error("Failed to fetch RWA constituents:",e),w1}},staleTime:5*60*1e3})}function $O(e,t){return gn({queryKey:["admin-constituents",t],queryFn:async()=>{if(!e)return[];try{const{constituents:r}=await YK(e,t);return r??[]}catch(r){return console.error(`Failed to fetch ${t} admin constituents:`,r),[]}},enabled:!!e,staleTime:1*60*1e3})}const RO=["All","GPU","Data","Agent","Protocol","General","Storage","Identity","N/A"],aje={GPU:"badge-gpu",Data:"badge-data",Agent:"badge-agent",Protocol:"badge-protocol",General:"badge-general",Storage:"badge-gpu",Identity:"badge-protocol"},sje=()=>{const{data:e=Tg,isLoading:t}=by(),r=w.useMemo(()=>e.map(k=>k.coingeckoId).filter(k=>!!k),[e]),{data:n,isLoading:i}=ys(r),{weights:a,isLoading:o}=Sk(e,ls),l=i||o,[c,u]=w.useState("All"),[d,f]=w.useState(null),[h,m]=w.useState(null),[g,p]=w.useState(null),v=w.useMemo(()=>{const k={};for(const _ of a)k[_.ticker]=_.finalWeight*100;return k},[a]),x=k=>{if(k.coingeckoId&&(n!=null&&n[k.coingeckoId]))return n[k.coingeckoId];if(n!=null&&n[k.ticker])return n[k.ticker]},y=k=>{d===k?h==="asc"?m("desc"):h==="desc"?(f(null),m(null)):m("asc"):(f(k),m("asc"))},b=w.useMemo(()=>{let k=[...e];return c!=="All"&&(k=k.filter(_=>_.category===c)),d&&h&&k.sort((_,C)=>{let P,E;const A=x(_),R=x(C);switch(d){case"ticker":return h==="asc"?_.ticker.localeCompare(C.ticker):C.ticker.localeCompare(_.ticker);case"category":return h==="asc"?_.category.localeCompare(C.category):C.category.localeCompare(_.category);case"weight":P=v[_.ticker]??0,E=v[C.ticker]??0;break;case"mcapFdvRatio":P=A!=null&&A.rawFdv?A.rawMarketCap/A.rawFdv:0,E=R!=null&&R.rawFdv?R.rawMarketCap/R.rawFdv:0;break;case"circSupply":P=(A==null?void 0:A.circulatingSupply)??0,E=(R==null?void 0:R.circulatingSupply)??0;break;case"volume24h":P=(A==null?void 0:A.rawVolume24h)??0,E=(R==null?void 0:R.rawVolume24h)??0;break;case"price":P=(A==null?void 0:A.price)??0,E=(R==null?void 0:R.price)??0;break;case"percentChange24h":P=(A==null?void 0:A.percentChange24h)??0,E=(R==null?void 0:R.percentChange24h)??0;break;case"obDepth":P=(A==null?void 0:A.obDepth2PctTotal)??0,E=(R==null?void 0:R.obDepth2PctTotal)??0;break;case"athDrawdown":P=(A==null?void 0:A.athDrawdownPct)??-100,E=(R==null?void 0:R.athDrawdownPct)??-100;break;default:return 0}return h==="asc"?P-E:E-P}),k},[e,c,d,h,n,v]),S=({columnKey:k})=>d!==k?s.jsx(nb,{className:"ml-1 h-3 w-3 opacity-50"}):h==="asc"?s.jsx(ac,{className:"ml-1 h-3 w-3"}):s.jsx(ic,{className:"ml-1 h-3 w-3"});if(t)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex flex-wrap gap-2",children:RO.map(k=>s.jsx(be,{className:"h-8 w-20"},k))}),s.jsx("div",{className:"bg-card rounded-lg border border-border/60 p-8",children:s.jsx("div",{className:"space-y-3",children:[...Array(8)].map((k,_)=>s.jsx(be,{className:"h-12 w-full"},_))})})]});const j=({columnKey:k,children:_,className:C=""})=>s.jsx(J,{className:`text-primary font-medium ${C}`,children:s.jsxs("button",{onClick:()=>y(k),className:"flex items-center hover:text-foreground transition-colors",children:[_,s.jsx(S,{columnKey:k})]})}),N=k=>k>
547=1e3?`$${k.toLocaleString("en-US",{maximumFractionDigits:2})}`:k>=1?`$${k.toFixed(2)}`:k>=.01?`$${k.toFixed(4)}`:`$${k.toFixed(6)}`;return s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex flex-wrap gap-2",children:RO.map(k=>s.jsxs(pe,{variant:c===k?"default":"outline",size:"sm",onClick:()=>u(k),className:c===k?"bg-primary text-primary-foreground":"",children:[k,k!=="All"&&s.jsxs("span",{className:"ml-1.5 text-xs opacity-70",children:["(",e.filter(_=>_.category===k).length,")"]})]},k))}),s.jsx("div",{className:"bg-card rounded-lg border border-border/60 overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/30 hover:bg-muted/30",children:[s.jsx(j,{columnKey:"ticker",children:"Ticker"}),s.jsx(j,{columnKey:"category",children:"Category"}),s.jsx(j,{columnKey:"weight",className:"text-right",children:"Weight"}),s.jsx(j,{columnKey:"price",className:"text-right",children:"Price"}),s.jsx(j,{columnKey:"mcapFdvRatio",className:"text-right",children:"MCap/FDV"}),s.jsx(j,{columnKey:"circSupply",className:"text-right",children:"Circ. Supply"}),s.jsx(j,{columnKey:"volume24h",className:"text-right",children:"24h Volume"}),s.jsx(j,{columnKey:"obDepth",className:"text-right",children:"OB Depth ±2%"}),s.jsx(j,{columnKey:"athDrawdown",className:"text-right",children:"ATH Drawdown"}),s.jsx(j,{columnKey:"percentChange24h",className:"text-right",children:"24h Change"})]})}),s.jsx(qt,{children:b.map((k,_)=>{const C=x(k),P=v[k.ticker]??0,E=(C==null?void 0:C.percentChange24h)??0,A=E>=0?"text-green-500":"text-destructive/80";return s.jsxs(me,{className:"hover:bg-muted/20 cursor-pointer",style:{animationDelay:`${_*50}ms`},onClick:()=>p(k),children:[s.jsx(W,{className:"font-medium",children:s.jsxs("div",{children:[s.jsx("span",{className:"font-serif",children:k.ticker}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:k.name})]})}),s.jsx(W,{children:s.jsx(Me,{variant:"outline",className:`${aje[k.category]} text-xs`,children:k.category})}),s.jsx(W,{className:"text-right",children:l?s.jsx(be,{className:"h-4 w-14 ml-auto"}):s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx("div",{className:"w-16 h-1.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${Math.min(P*6,100)}%`}})}),s.jsxs("span",{className:"font-mono text-sm",children:[P.toFixed(1),"%"]})]})}),s.jsx(W,{className:"text-right font-mono text-sm",children:l?s.jsx(be,{className:"h-4 w-16 ml-auto"}):C?N(C.price):"â"}),s.jsx(W,{className:"text-right font-mono text-sm",children:l?s.jsx(be,{className:"h-4 w-10 ml-auto"}):(C==null?void 0:C.mcapFdvRatio)||"â"}),s.jsx(W,{className:"text-right font-mono text-sm",children:l?s.jsx(be,{className:"h-4 w-12 ml-auto"}):(C==null?void 0:C.circulatingSupplyFormatted)||"â"}),s.jsx(W,{className:"text-right font-mono text-sm",children:l?s.jsx(be,{className:"h-4 w-14 ml-auto"}):(C==null?void 0:C.volume24h)||"â"}),s.jsx(W,{className:"text-right font-mono text-sm",children:l?s.jsx(be,{className:"h-4 w-14 ml-auto"}):(C==null?void 0:C.obDepth2PctFormatted)||"â"}),s.jsx(W,{className:"text-right font-mono text-sm text-destructive/80",children:l?s.jsx(be,{className:"h-4 w-12 ml-auto"}):(C==null?void 0:C.athDrawdownPct)!=null?`${C.athDrawdownPct.toFixed(1)}%`:"â"}),s.jsx(W,{className:`text-right font-mono text-sm ${A}`,children:l?s.jsx(be,{className:"h-4 w-12 ml-auto"}):C?`${E>=0?"+":""}${E.toFixed(2)}%`:"â"})]},k.ticker)})})]})})}),s.jsxs("div",{className:"text-sm text-muted-foreground text-right",children:["Showing ",b.length," of ",e.length," constituents"]}),g&&s.jsx(su,{open:!!g,onOpenChange:k=>{k||p(null)},ticker:g.ticker,name:g.name,category:g.category,description:g.description,coingeckoId:g.coingeckoId})]})},r0=e=>e>=1?`$${e.toFixed(1)}M`:e>=.001?`$${(e*1e3).toFixed(0)}K`:`$${e.toFixed(2)}M`,oje=({volumeData:e,depthData:t,isLoading:r=!1})=>r?s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-card rounded-lg border border-border/60 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx(be,{className:"h-6 w-40"}),s.jsx(be,{className:"h-4 w-16"})]}),s.jsx(be,{className:"h-[300px] w-full"})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border/60 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx(be,{className:"h-6 w-40"}),s.jsx(be,{className:"h-4 w-16"})]}),s.jsx(be,{className:"h-[300px] w-full"})]})]}):s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-card rounded-lg border border-border/60 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h4",{className:"font-serif text-lg",children:"24h Trading Volume"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"$ Millions"})]}),s.jsx("div",{className:"h-[300px]",children:s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(Rf,{data:e,margin:{top:10,right:10,left:0,bottom:30},children:[s.jsx(Vn,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),s.jsx(fr,{dataKey:"name",tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}
547,angle:-45,textAnchor:"end",height:60,axisLine:{stroke:"hsl(var(--border))"}}),s.jsx(hr,{tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickFormatter:n=>`$${n.toFixed(0)}M`}),s.jsx(mt,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:"12px"},formatter:n=>[r0(n),"Volume"]}),s.jsx(Hr,{dataKey:"value",radius:[4,4,0,0],children:e.map((n,i)=>s.jsx(To,{fill:n.color},`cell-${i}`))})]})})})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border/60 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h4",{className:"font-serif text-lg",children:"Order Book Depth (±2%)"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Bid + Ask"})]}),s.jsx("div",{className:"h-[300px]",children:s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(Rf,{data:t,margin:{top:10,right:10,left:0,bottom:30},children:[s.jsx(Vn,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),s.jsx(fr,{dataKey:"name",tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},angle:-45,textAnchor:"end",height:60,axisLine:{stroke:"hsl(var(--border))"}}),s.jsx(hr,{tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickFormatter:n=>r0(n)}),s.jsx(mt,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:"12px"},formatter:(n,i)=>[r0(n),i==="bid"?"Bid Depth":"Ask Depth"]}),s.jsx(dn,{wrapperStyle:{fontSize:"11px"},formatter:n=>n==="bid"?"Bid (buy)":"Ask (sell)"}),s.jsx(Hr,{dataKey:"bid",stackId:"depth",fill:"hsl(142, 76%, 36%)",radius:[0,0,0,0]}),s.jsx(Hr,{dataKey:"ask",stackId:"depth",fill:"hsl(0, 84%, 60%)",radius:[4,4,0,0]})]})})})]})]}),ze=w.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:X("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ze.displayName="Card";const Wt=w.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:X("flex flex-col space-y-1.5 p-6",e),...t}));Wt.displayName="CardHeader";const Ut=w.forwardRef(({className:e,...t},r)=>s.jsx("h3",{ref:r,className:X("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ut.displayName="CardTitle";const q5=w.forwardRef(({className:e,...t},r)=>s.jsx("p",{ref:r,className:X("text-sm text-muted-foreground",e),...t}));q5.displayName="CardDescription";const xt=w.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:X("p-6 pt-0",e),...t}));xt.displayName="CardContent";const lje=w.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:X("flex items-center p-6 pt-0",e),...t}));lje.displayName="CardFooter";const G5=({config:e,lastUpdated:t})=>{const r=["Fetch circulating market caps from CoinGecko","Apply dampening (MCap^α reduces concentration)","Calculate proportional weights","Apply caps/floors constraints","Normalize to sum to 100%"];return s.jsx(ze,{className:"p-4 bg-muted/20 border-border/40 h-full",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"font-serif text-sm font-medium text-foreground",children:"Weighting Methodology"}),s.jsxs("div",{className:"bg-background/50 rounded-md p-3 border border-border/30",children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Formula"}),s.jsxs("p",{className:"font-mono text-sm text-foreground",children:["w",s.jsx("sub",{children:"i"})," = MCap",s.jsx("sub",{children:"i"}),s.jsx("sup",{children:"α"})," / Σ MCap",s.jsx("sub",{children:"j"}),s.jsx("sup",{children:"α"})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Dampening α"}),s.jsx("p",{className:"font-mono text-sm text-primary font-medium",children:e.dampingAlpha})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Max Cap"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.maxWeight*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Min Floor"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.minWeight*100).toFixed(0),"%"]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Process"}),s.jsx("div",{className:"space-y-1.5",children:r.map((n,i)=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"flex-shrink-0 w-4 h-4 rounded-full bg-primary/10 text-primary text-[10px] flex items-center justify-center font-medium",children:i+1}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:n})]},i))})]}),t&&s.jsx("div",{className:"pt-2 border-t border-border/30",children:s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Last updated: ",t.toLocaleTimeString()]})})]})})};var jy="Collapsible",[cje,KNe]=Yr(jy),[uje,kk]=cje(jy),K5=w.forwardRef((e,t)=>
547{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c,u]=bi({prop:n,defaultProp:i??!1,onChange:o,caller:jy});return s.jsx(uje,{scope:r,disabled:a,contentId:pi(),open:c,onOpenToggle:w.useCallback(()=>u(d=>!d),[u]),children:s.jsx(ce.div,{"data-state":_k(c),"data-disabled":a?"":void 0,...l,ref:t})})});K5.displayName=jy;var Y5="CollapsibleTrigger",X5=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,i=kk(Y5,r);return s.jsx(ce.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":_k(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:t,onClick:ne(e.onClick,i.onOpenToggle)})});X5.displayName=Y5;var Nk="CollapsibleContent",Q5=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=kk(Nk,e.__scopeCollapsible);return s.jsx(Xr,{present:r||i.open,children:({present:a})=>s.jsx(dje,{...n,ref:t,present:a})})});Q5.displayName=Nk;var dje=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:i,...a}=e,o=kk(Nk,r),[l,c]=w.useState(n),u=w.useRef(null),d=Ne(t,u),f=w.useRef(0),h=f.current,m=w.useRef(0),g=m.current,p=o.open||l,v=w.useRef(p),x=w.useRef(void 0);return w.useEffect(()=>{const y=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(y)},[]),Pt(()=>{const y=u.current;if(y){x.current=x.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const b=y.getBoundingClientRect();f.current=b.height,m.current=b.width,v.current||(y.style.transitionDuration=x.current.transitionDuration,y.style.animationName=x.current.animationName),c(n)}},[o.open,n]),s.jsx(ce.div,{"data-state":_k(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!p,...a,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:p&&i})});function _k(e){return e?"open":"closed"}var fje=K5;const ia=fje,aa=X5,sa=Q5,IO={GPU:"hsl(142, 76%, 36%)",Data:"hsl(199, 89%, 48%)",Agent:"hsl(262, 83%, 58%)",Protocol:"hsl(45, 93%, 47%)",General:"hsl(330, 81%, 60%)",Securities:"hsl(142, 76%, 36%)",Lending:"hsl(199, 89%, 48%)",Credit:"hsl(45, 93%, 47%)",Platform:"hsl(330, 81%, 60%)",Yield:"hsl(262, 83%, 58%)"},J5=({weights:e,config:t,defaultOpen:r=!0,onTokenClick:n})=>{const[i,a]=w.useState(r),[o,l]=w.useState("finalWeight"),[c,u]=w.useState("desc"),d=b=>{o===b?u(c==="asc"?"desc":"asc"):(l(b),u("desc"))},f=[...e].sort((b,S)=>{const j=c==="asc"?1:-1;return o==="ticker"?j*b.ticker.localeCompare(S.ticker):j*(b[o]-S[o])}),h=b=>b>=1e9?`$${(b/1e9).toFixed(2)}B`:b>=1e6?`$${(b/1e6).toFixed(1)}M`:b>=1e3?`$${(b/1e3).toFixed(1)}K`:`$${b.toFixed(0)}`,m=b=>`${(b*100).toFixed(2)}%`,g=({field:b})=>o!==b?null:c==="asc"?s.jsx(mi,{className:"h-3 w-3 inline ml-0.5"}):s.jsx(dr,{className:"h-3 w-3 inline ml-0.5"}),p=b=>{const S=b.rawWeight>t.maxWeight&&Math.abs(b.adjustedWeight-t.maxWeight)<.001,j=b.rawWeight<t.minWeight&&Math.abs(b.adjustedWeight-t.minWeight)<.001;return S?s.jsx("span",{className:"inline-flex items-center gap-0.5 text-amber-600",title:"Capped at maximum",children:s.jsx(Md,{className:"h-3 w-3"})}):j?s.jsx("span",{className:"inline-flex items-center gap-0.5 text-blue-600",title:"Raised to minimum",children:s.jsx(wi,{className:"h-3 w-3"})}):null},v=e.reduce((b,S)=>b+S.rawWeight,0),x=e.reduce((b,S)=>b+S.adjustedWeight,0),y=e.reduce((b,S)=>b+S.finalWeight,0);return s.jsxs(ia,{open:i,onOpenChange:a,className:"w-full",children:[s.jsxs(aa,{className:"flex items-center justify-between w-full py-2 px-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Weight Calculation Breakdown"}),s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsxs("span",{className:"text-xs",children:[e.length," constituents"]}),i?s.jsx(mi,{className:"h-4 w-4"}):s.jsx(dr,{className:"h-4 w-4"})]})]}),s.jsxs(sa,{className:"mt-2",children:[s.jsx("div",{className:"border border-border/50 rounded-lg overflow-hidden",children:s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/50 hover:bg-muted/50",children:[s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-xs",onClick:()=>d("ticker"),children:["Token ",s.jsx(g,{field:"ticker"})]}),s.jsx(J,{className:"text-xs",children:"Category"}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-right text-xs",onClick:()=>d("marketCap"),children:["Market Cap ",s.jsx(g,{field:"marketCap"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-right text-xs",onClick:()=>d("rawWeight"),children:["Raw Weight ",s.jsx(g,{field:"rawWeight"})]}),s.jsx(J,{className:"text-center text-xs w-8"}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-right text-xs",onClick:()=>d("adjustedWeight"),children:["Adjusted ",s.jsx(g,{field:"adjustedWeight"})]}),s.jsx(J,{className:"text-center text-xs w-8"}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-right text-xs",onClick:()=>d("finalWeight"),children:["Final Weight ",s.jsx(g,{field:"finalWeight"})]})]})}),s.jsxs(qt,{children:[f.map(b=>s.jsxs(me,{className:`hover:bg-muted/30 ${n?"cursor-pointer":""}`,onClick:()=>n==null?void 0:n(b.ticker),children:[s.jsxs(W,{className:"font-serif font-medium text-sm",children:[b.ticker,s.jsx("span",{className:"block text-[10px] text-muted-foreground font-sans",children:b.name})]}),s.jsx(W,{children:s.jsx(Me,{variant:"outline",className:"text-[10px] px-1.5 py-0",style:{borderColor:IO[b.category],color:IO[b.category]},children:b.category})}),s.jsx(W,{className:"text-right font-mono text-xs",children:h(b.marketCap)}),s.jsx(W,{className:"text-right font-mono text-xs",children:m(b.rawWeight)}),s.jsx(W,{className:"text-center",children:s.jsx(s_,{className:"h-3 w-3 text-muted-foreground
547/50"})}),s.jsx(W,{className:"text-right font-mono text-xs",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[m(b.adjustedWeight),p(b)]})}),s.jsx(W,{className:"text-center",children:s.jsx(s_,{className:"h-3 w-3 text-muted-foreground/50"})}),s.jsx(W,{className:"text-right font-mono text-xs font-medium text-primary",children:m(b.finalWeight)})]},b.ticker)),s.jsxs(me,{className:"bg-muted/30 font-medium border-t-2",children:[s.jsx(W,{colSpan:2,className:"text-xs",children:"Total"}),s.jsx(W,{className:"text-right font-mono text-xs",children:"â"}),s.jsx(W,{className:"text-right font-mono text-xs",children:m(v)}),s.jsx(W,{}),s.jsx(W,{className:"text-right font-mono text-xs",children:m(x)}),s.jsx(W,{}),s.jsx(W,{className:"text-right font-mono text-xs text-primary",children:m(y)})]})]})]})}),s.jsxs("div",{className:"flex items-center gap-4 mt-2 text-[10px] text-muted-foreground",children:[s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(Md,{className:"h-3 w-3 text-amber-600"})," Capped at max (",(t.maxWeight*100).toFixed(0),"%)"]}),s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(wi,{className:"h-3 w-3 text-blue-600"})," Raised to min (",(t.minWeight*100).toFixed(0),"%)"]})]})]})]})};function Ck(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Z5=["PageUp","PageDown"],eL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tL={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ou="Slider",[j1,hje,mje]=Jg(ou),[rL,YNe]=Yr(ou,[mje]),[pje,Sy]=rL(ou),nL=w.forwardRef((e,t)=>{const{name:r,min:n=0,max:i=100,step:a=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[n],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:m=!1,form:g,...p}=e,v=w.useRef(new Set),x=w.useRef(0),b=o==="horizontal"?gje:vje,[S=[],j]=bi({prop:d,defaultProp:u,onChange:E=>{var R;(R=[...v.current][x.current])==null||R.focus(),f(E)}}),N=w.useRef(S);function k(E){const A=jje(S,E);P(E,A)}function _(E){P(E,x.current)}function C(){const E=N.current[x.current];S[x.current]!==E&&h(S)}function P(E,A,{commit:R}={commit:!1}){const $=_je(a),D=Cje(Math.round((E-n)/a)*a+n,$),M=Qd(D,[n,i]);j((I=[])=>{const T=bje(I,M,A);if(Nje(T,c*a)){x.current=T.indexOf(M);const L=String(T)!==String(I);return L&&R&&h(T),L?T:I}else return I})}return s.jsx(pje,{scope:e.__scopeSlider,name:r,disabled:l,min:n,max:i,valueIndexToChangeRef:x,thumbs:v.current,values:S,orientation:o,form:g,children:s.jsx(j1.Provider,{scope:e.__scopeSlider,children:s.jsx(j1.Slot,{scope:e.__scopeSlider,children:s.jsx(b,{"aria-disabled":l,"data-disabled":l?"":void 0,...p,ref:t,onPointerDown:ne(p.onPointerDown,()=>{l||(N.current=S)}),min:n,max:i,inverted:m,onSlideStart:l?void 0:k,onSlideMove:l?void 0:_,onSlideEnd:l?void 0:C,onHomeKeyDown:()=>!l&&P(n,0,{commit:!0}),onEndKeyDown:()=>!l&&P(i,S.length-1,{commit:!0}),onStepKeyDown:({event:E,direction:A})=>{if(!l){const D=Z5.includes(E.key)||E.shiftKey&&eL.includes(E.key)?10:1,M=x.current,I=S[M],T=a*D*A;P(I+T,M,{commit:!0})}}})})})})});nL.displayName=ou;var[iL,aL]=rL(ou,{startEdge:"left",endEdge:"right",size:"width",direction:1}),gje=w.forwardRef((e,t)=>{const{min:r,max:n,dir:i,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[f,h]=w.useState(null),m=Ne(t,b=>h(b)),g=w.useRef(void 0),p=eh(i),v=p==="ltr",x=v&&!a||!v&&a;function y(b){const S=g.current||f.getBoundingClientRect(),j=[0,S.width],k=Ak(j,x?[r,n]:[n,r]);return g.current=S,k(b-S.left)}return s.jsx(iL,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:s.jsx(sL,{dir:p,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const S=y(b.clientX);o==null||o(S)},onSlideMove:b=>{const S=y(b.clientX);l==null||l(S)},onSlideEnd:()=>{g.current=void 0,c==null||c()},onStepKeyDown:b=>{const j=tL[x?"from-left":"from-right"].includes(b.key);u==null||u({event:b,direction:j?-1:1})}})})}),vje=w.forwardRef((e,t)=>
547{const{min:r,max:n,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=w.useRef(null),f=Ne(t,d),h=w.useRef(void 0),m=!i;function g(p){const v=h.current||d.current.getBoundingClientRect(),x=[0,v.height],b=Ak(x,m?[n,r]:[r,n]);return h.current=v,b(p-v.top)}return s.jsx(iL,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:s.jsx(sL,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const v=g(p.clientY);a==null||a(v)},onSlideMove:p=>{const v=g(p.clientY);o==null||o(v)},onSlideEnd:()=>{h.current=void 0,l==null||l()},onStepKeyDown:p=>{const x=tL[m?"from-bottom":"from-top"].includes(p.key);c==null||c({event:p,direction:x?-1:1})}})})}),sL=w.forwardRef((e,t)=>{const{__scopeSlider:r,onSlideStart:n,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=e,d=Sy(ou,r);return s.jsx(ce.span,{...u,ref:t,onKeyDown:ne(e.onKeyDown,f=>{f.key==="Home"?(o(f),f.preventDefault()):f.key==="End"?(l(f),f.preventDefault()):Z5.concat(eL).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:ne(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():n(f)}),onPointerMove:ne(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&i(f)}),onPointerUp:ne(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),a(f))})})}),oL="SliderTrack",lL=w.forwardRef((e,t)=>{const{__scopeSlider:r,...n}=e,i=Sy(oL,r);return s.jsx(ce.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...n,ref:t})});lL.displayName=oL;var S1="SliderRange",cL=w.forwardRef((e,t)=>{const{__scopeSlider:r,...n}=e,i=Sy(S1,r),a=aL(S1,r),o=w.useRef(null),l=Ne(t,o),c=i.values.length,u=i.values.map(h=>fL(h,i.min,i.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return s.jsx(ce.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...n,ref:l,style:{...e.style,[a.startEdge]:d+"%",[a.endEdge]:f+"%"}})});cL.displayName=S1;var k1="SliderThumb",uL=w.forwardRef((e,t)=>{const r=hje(e.__scopeSlider),[n,i]=w.useState(null),a=Ne(t,l=>i(l)),o=w.useMemo(()=>n?r().findIndex(l=>l.ref.current===n):-1,[r,n]);return s.jsx(yje,{...e,ref:a,index:o})}),yje=w.forwardRef((e,t)=>{const{__scopeSlider:r,index:n,name:i,...a}=e,o=Sy(k1,r),l=aL(k1,r),[c,u]=w.useState(null),d=Ne(t,y=>u(y)),f=c?o.form||!!c.closest("form"):!0,h=Uj(c),m=o.values[n],g=m===void 0?0:fL(m,o.min,o.max),p=wje(n,o.values.length),v=h==null?void 0:h[l.size],x=v?Sje(v,g,l.direction):0;return w.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${g}% + ${x}px)`},children:[s.jsx(j1.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(ce.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":o.min,"aria-valuenow":m,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...a,ref:d,style:m===void 0?{display:"none"}:e.style,onFocus:ne(e.onFocus,()=>{o.valueIndexToChangeRef.current=n})})}),f&&s.jsx(dL,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:m},n)]})});uL.displayName=k1;var xje="RadioBubbleInput",dL=w.forwardRef(({__scopeSlider:e,value:t,...r},n)=>{const i=w.useRef(null),a=Ne(i,n),o=Ck(t);return w.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const f=new Event("input",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[o,t]),s.jsx(ce.input,{style:{display:"none"},...r,ref:a,defaultValue:t})});dL.displayName=xje;function bje(e=[],t,r){const n=[...e];return n[r]=t,n.sort((i,a)=>i-a)}function fL(e,t,r){const a=100/(r-t)*(e-t);return Qd(a,[0,100])}function wje(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function jje(e,t){if(e.length===1)return 0;const r=e.map(i=>Math.abs(i-t)),n=Math.min(...r);return r.indexOf(n)}function Sje(e,t,r){const n=e/2,a=Ak([0,50],[0,n]);return(n-a(t)*r)*r}function kje(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function Nje(e,t){if(t>0){const r=kje(e);return Math.min(...r)>=t}return!0}function Ak(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function _je(e){return(String(e).split(".")[1]||"").length}function Cje(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}var hL=nL,Aje=lL,Eje=cL,Pje=uL;const Gt=w.forwardRef(({className:e,...t},r)=>s.jsxs(hL,{ref:r,className:X("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Aje,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Eje,{className:"absolute h-full bg-primary"})}),s.jsx(Pje,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Gt.displayName=hL.displayName;const mL=({defaultConfig:e,currentConfig:t,onConfigChange:r})=>{const[n,i]=w.useState(t);w.useEffect(()=>{i(t)},[t]);const a=n.dampingAlpha===0,o=n.dampingAlpha!==e.dampingAlpha||n.maxWeight!==e.maxWeight||n.minWeight!==e.minWeight,l=()=>{const h={...n,dampingAlpha:0};i(h),r(h)},c=h=>{const m={...n,dampingAlpha:h[0]};i(m),r(m)},u=h=>{const m={...n,maxWeight:h[0]/100};i(m),r(m)},d=h=>{const m={...n,minWeight:h[0]/100};i(m),r(m)},f=()=>{i(e),r(e)};return s.jsx(ze,{className:`p-4 h-full transition-colors ${o?"bg-amber-500/5 border-amber-500/30":"bg-muted/20 border-border/40"}`,children:s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h4",{className:"font-serif text-sm font-medium text-foreground",children:"Simulate Rebalance"}),s.jsxs("div",{className:"flex items-center gap-2",children:[o&&s.jsx(Me,{variant:"outline",className:"bg-amber-500/10 text-amber-600 border-amber-500/30 text-[10px] animate-pulse",children:"Simulating"}),s.jsxs(pe,{variant:"outline",size:"sm",onClick:l,className:`text-[10px] h-6 px-2 gap-1 ${a?"bg-primary/10 border-primary/30 text-primary":""}`,children:[s.jsx(g8,{className:"w-3 h-3"}),"Equal Weight"]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"Dampening Factor (α)"}),s.jsx("span",{className:`font-mono text-xs ${n.dampingAlpha!==e.dampingAlpha?"text-amber-600 font-medium":"text-foreground"}`,children:n.dampingAlpha.toFixed(2)})]}),s.jsx(Gt,{value:[n.dampingAlpha],onValueChange:c,min:0,max:1,step:.
54705,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"More Equal"}),s.jsx("span",{children:"Pure Cap-Weight"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"Maximum Weight Cap"}),s.jsxs("span",{className:`font-mono text-xs ${n.maxWeight!==e.maxWeight?"text-amber-600 font-medium":"text-foreground"}`,children:[(n.maxWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[n.maxWeight*100],onValueChange:u,min:10,max:50,step:5,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"10%"}),s.jsx("span",{children:"50%"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"Minimum Weight Floor"}),s.jsxs("span",{className:`font-mono text-xs ${n.minWeight!==e.minWeight?"text-amber-600 font-medium":"text-foreground"}`,children:[(n.minWeight*100).toFixed(1),"%"]})]}),s.jsx(Gt,{value:[n.minWeight*100],onValueChange:d,min:0,max:5,step:.5,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"0%"}),s.jsx("span",{children:"5%"})]})]}),o&&s.jsxs(pe,{variant:"outline",size:"sm",onClick:f,className:"w-full text-xs gap-2",children:[s.jsx(Bc,{className:"w-3 h-3"}),"Reset to Defaults"]})]})})},Oje=({config:e,lastUpdated:t})=>{const r=["Fetch live market data from CoinGecko","Calculate component scores (L, F, S)","Compute weighted composite score","Apply caps/floors constraints","Normalize to sum to 100%"];return s.jsx(ze,{className:"p-4 bg-muted/20 border-border/40 h-full",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"font-serif text-sm font-medium text-foreground",children:"Multi-Factor Methodology"}),s.jsxs("div",{className:"bg-background/50 rounded-md p-3 border border-border/30",children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Formula"}),s.jsxs("p",{className:"font-mono text-sm text-foreground",children:["Score = ",(e.liquidityWeight*100).toFixed(0),"%ÃL + ",(e.fundamentalWeight*100).toFixed(0),"%ÃF + ",(e.sustainabilityWeight*100).toFixed(0),"%ÃS"]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Liquidity (L)"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.liquidityWeight*100).toFixed(0),"%"]}),s.jsx("p",{className:"text-[9px] text-muted-foreground mt-1",children:"Vol/MCap ratio"})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Fundamental (F)"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.fundamentalWeight*100).toFixed(0),"%"]}),s.jsx("p",{className:"text-[9px] text-muted-foreground mt-1",children:"MCap/FDV + Rating"})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Sustainability (S)"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.sustainabilityWeight*100).toFixed(0),"%"]}),s.jsx("p",{className:"text-[9px] text-muted-foreground mt-1",children:"Manual assess."})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Max Cap"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.maxWeight*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Min Floor"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.minWeight*100).toFixed(0),"%"]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Process"}),s.jsx("div",{className:"space-y-1.5",children:r.map((n,i)=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"flex-shrink-0 w-4 h-4 rounded-full bg-primary/10 text-primary text-[10px] flex items-center justify-center font-medium",children:i+1}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:n})]},i))})]}),t&&s.jsx("div",{className:"pt-2 border-t border-border/30",children:s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Last updated: ",t.toLocaleTimeString()]})})]})})},Tje=({defaultConfig:e,currentConfig:t,onConfigChange:r})=>{const[n,i]=w.useState(t);w.useEffect(()=>{i(t)},[t]);const a=n.liquidityWeight!==e.liquidityWeight||n.fundamentalWeight!==e.fundamentalWeight||n.sustainabilityWeight!==e.sustainabilityWeight||n.maxWeight!==e.maxWeight||n.minWeight!==e.minWeight,o=(m,g)=>{const p={liquidityWeight:n.liquidityWeight,fundamentalWeight:n.fundamentalWeight,sustainabilityWeight:n.sustainabilityWeight};p[m]=g;const v=p.liquidityWeight+p.fundamentalWeight+p.sustainabilityWeight;if(v!==1){const x=1/v;
547p.liquidityWeight*=x,p.fundamentalWeight*=x,p.sustainabilityWeight*=x}return p},l=m=>{const g=o("liquidityWeight",m[0]/100),p={...n,...g};i(p),r(p)},c=m=>{const g=o("fundamentalWeight",m[0]/100),p={...n,...g};i(p),r(p)},u=m=>{const g=o("sustainabilityWeight",m[0]/100),p={...n,...g};i(p),r(p)},d=m=>{const g={...n,maxWeight:m[0]/100};i(g),r(g)},f=m=>{const g={...n,minWeight:m[0]/100};i(g),r(g)},h=()=>{i(e),r(e)};return s.jsx(ze,{className:`p-4 h-full transition-colors ${a?"bg-amber-500/5 border-amber-500/30":"bg-muted/20 border-border/40"}`,children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h4",{className:"font-serif text-sm font-medium text-foreground",children:"Simulate Factors"}),a&&s.jsx(Me,{variant:"outline",className:"bg-amber-500/10 text-amber-600 border-amber-500/30 text-[10px] animate-pulse",children:"Simulating"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Factor Weights"}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"Liquidity"}),s.jsxs("span",{className:`font-mono text-xs ${n.liquidityWeight!==e.liquidityWeight?"text-amber-600 font-medium":"text-foreground"}`,children:[(n.liquidityWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[n.liquidityWeight*100],onValueChange:l,min:20,max:60,step:5,className:"w-full"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"Fundamental"}),s.jsxs("span",{className:`font-mono text-xs ${n.fundamentalWeight!==e.fundamentalWeight?"text-amber-600 font-medium":"text-foreground"}`,children:[(n.fundamentalWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[n.fundamentalWeight*100],onValueChange:c,min:15,max:50,step:5,className:"w-full"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"Sustainability"}),s.jsxs("span",{className:`font-mono text-xs ${n.sustainabilityWeight!==e.sustainabilityWeight?"text-amber-600 font-medium":"text-foreground"}`,children:[(n.sustainabilityWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[n.sustainabilityWeight*100],onValueChange:u,min:15,max:50,step:5,className:"w-full"})]})]}),s.jsxs("div",{className:"space-y-3 pt-2 border-t border-border/30",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Constraints"}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"Max Cap"}),s.jsxs("span",{className:`font-mono text-xs ${n.maxWeight!==e.maxWeight?"text-amber-600 font-medium":"text-foreground"}`,children:[(n.maxWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[n.maxWeight*100],onValueChange:d,min:10,max:50,step:5,className:"w-full"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"Min Floor"}),s.jsxs("span",{className:`font-mono text-xs ${n.minWeight!==e.minWeight?"text-amber-600 font-medium":"text-foreground"}`,children:[(n.minWeight*100).toFixed(1),"%"]})]}),s.jsx(Gt,{value:[n.minWeight*100],onValueChange:f,min:0,max:5,step:.5,className:"w-full"})]})]}),a&&s.jsxs(pe,{variant:"outline",size:"sm",onClick:h,className:"w-full text-xs gap-2",children:[s.jsx(Bc,{className:"w-3 h-3"}),"Reset to Defaults"]})]})})};var Ek="Progress",Pk=100,[$je,XNe]=Yr(Ek),[Rje,Ije]=$je(Ek),pL=w.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:i,getValueLabel:a=Mje,...o}=e;(i||i===0)&&!MO(i)&&console.error(Dje(`${i}`,"Progress"));const l=MO(i)?i:Pk;n!==null&&!DO(n,l)&&console.error(Lje(`${n}`,"Progress"));const c=DO(n,l)?n:null,u=$g(c)?a(c,l):void 0;return s.jsx(Rje,{scope:r,value:c,max:l,children:s.jsx(ce.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":$g(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":yL(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});pL.displayName=Ek;var gL="ProgressIndicator",vL=w.forwardRef((e,t)=>
547{const{__scopeProgress:r,...n}=e,i=Ije(gL,r);return s.jsx(ce.div,{"data-state":yL(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...n,ref:t})});vL.displayName=gL;function Mje(e,t){return`${Math.round(e/t*100)}%`}function yL(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function $g(e){return typeof e=="number"}function MO(e){return $g(e)&&!isNaN(e)&&e>0}function DO(e,t){return $g(e)&&!isNaN(e)&&e<=t&&e>=0}function Dje(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Pk}\`.`}function Lje(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: 548 - a positive number 549 - less than the value passed to \`max\` (or ${Pk} if no \`max\` prop is set) 550 - \`null\` or \`undefined\` if the progress is indeterminate. 551 552Defaulting to \`null\`.`}var xL=pL,Fje=vL;const bL=w.forwardRef(({className:e,value:t,...r},n)=>s.jsx(xL,{ref:n,className:X("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:s.jsx(Fje,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));bL.displayName=xL.displayName;const LO={GPU:"hsl(142, 76%, 36%)",Data:"hsl(199, 89%, 48%)",Agent:"hsl(262, 83%, 58%)",Protocol:"hsl(45, 93%, 47%)",General:"hsl(330, 81%, 60%)"},Bje=({weights:e,config:t,defaultOpen:r=!0,onTokenClick:n})=>{const[i,a]=w.useState(r),[o,l]=w.useState("finalWeight"),[c,u]=w.useState("desc"),d=v=>{o===v?u(c==="asc"?"desc":"asc"):(l(v),u("desc"))},f=[...e].sort((v,x)=>{const y=c==="asc"?1:-1;return o==="ticker"?y*v.ticker.localeCompare(x.ticker):y*(v[o]-x[o])}),h=v=>`${(v*100).toFixed(2)}%`,m=({score:v,color:x})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(bL,{value:v,className:"h-1.5 w-12",style:{"--progress-color":x}}),s.jsx("span",{className:"font-mono text-xs w-6",children:v})]}),g=({field:v})=>o!==v?null:c==="asc"?s.jsx(mi,{className:"h-3 w-3 inline ml-0.5"}):s.jsx(dr,{className:"h-3 w-3 inline ml-0.5"}),p=v=>{const x=v.rawWeight>t.maxWeight&&Math.abs(v.adjustedWeight-t.maxWeight)<.001,y=v.rawWeight<t.minWeight&&Math.abs(v.adjustedWeight-t.minWeight)<.001;return x?s.jsx("span",{className:"inline-flex items-center gap-0.5 text-amber-600 ml-1",title:"Capped at maximum",children:s.jsx(Md,{className:"h-3 w-3"})}):y?s.jsx("span",{className:"inline-flex items-center gap-0.5 text-blue-600 ml-1",title:"Raised to minimum",children:s.jsx(wi,{className:"h-3 w-3"})}):null};return s.jsxs(ia,{open:i,onOpenChange:a,className:"w-full",children:[s.jsxs(aa,{className:"flex items-center justify-between w-full py-2 px-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Multi-Factor Score Breakdown"}),s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsxs("span",{className:"text-xs",children:[e.length," constituents"]}),i?s.jsx(mi,{className:"h-4 w-4"}):s.jsx(dr,{className:"h-4 w-4"})]})]}),s.jsxs(sa,{className:"mt-2",children:[s.jsx("div",{className:"border border-border/50 rounded-lg overflow-hidden",children:s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/50 hover:bg-muted/50",children:[s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-xs",onClick:()=>d("ticker"),children:["Token ",s.jsx(g,{field:"ticker"})]}),s.jsx(J,{className:"text-xs",children:"Category"}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-xs",onClick:()=>d("liquidityScore"),children:["Liquidity ",s.jsx(g,{field:"liquidityScore"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-xs",onClick:()=>d("fundamentalScore"),children:["Fundamental ",s.jsx(g,{field:"fundamentalScore"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-xs",onClick:()=>d("sustainabilityScore"),children:["Sustainability ",s.jsx(g,{field:"sustainabilityScore"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-right text-xs",onClick:()=>d("compositeScore"),children:["Score ",s.jsx(g,{field:"compositeScore"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground transition-colors text-right text-xs",onClick:()=>d("finalWeight"),children:["Weight ",s.jsx(g,{field:"finalWeight"})]})]})}),s.jsx(qt,{children:f.map(v=>s.jsxs(me,{className:`hover:bg-muted/30 ${n?"cursor-pointer":""}`,onClick:()=>n==null?void 0:n(v.ticker),children:[s.jsxs(W,{className:"font-serif font-medium text-sm",children:[v.ticker,s.jsx("span",{className:"block text-[10px] text-muted-foreground font-sans",children:v.name})]}),s.jsx(W,{children:s.jsx(Me,{variant:"outline",className:"text-[10px] px-1.5 py-0",style:{borderColor:LO[v.category],color:LO[v.category]},children:v.category})}),s.jsx(W,{children:s.jsx(m,{score:v.liquidityScore,color:"hsl(199, 89%, 48%)"})}),s.jsx(W,{children:s.jsx(m,{score:v.fundamentalScore,color:"hsl(142, 76%, 36%)"})}),s.jsx(W,{children:s.jsx(m,{score:v.sustainabilityScore,color:"hsl(45, 93%, 47%)"})}),s.jsx(W,{className:"text-right font-mono text-xs",children:v.compositeScore.toFixed(1)}),s.jsxs(W,{className:"text-right font-mono text-xs font-medium text-primary",children:[h(v.finalWeight),p(v)]})]}
552,v.ticker))})]})}),s.jsxs("div",{className:"flex items-center gap-4 mt-2 text-[10px] text-muted-foreground",children:[s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(Md,{className:"h-3 w-3 text-amber-600"})," Capped at max (",(t.maxWeight*100).toFixed(0),"%)"]}),s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(wi,{className:"h-3 w-3 text-blue-600"})," Raised to min (",(t.minWeight*100).toFixed(0),"%)"]})]})]})]})},wL=({config:e,lastUpdated:t})=>{const r=[`Fetch ${e.lookbackDays}-day price history`,"Calculate daily returns for each token","Compute volatility (Ï) as standard deviation","Calculate inverse volatility (1/Ï)","Weight = inverse vol / sum of inverse vols",`Apply max ${e.maxWeight}% cap & ${e.minWeight}% floor`,"Normalize to 100%"];return s.jsx(ze,{className:"p-4 bg-muted/20 border-border/40 h-full",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"font-serif text-sm font-medium text-foreground",children:"Risk-Controlled Methodology"}),s.jsxs("div",{className:"bg-background/50 rounded-md p-3 border border-border/30",children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Formula"}),s.jsx("p",{className:"font-mono text-sm text-foreground",children:"wáµ¢ = (1/Ïáµ¢) / Σ(1/Ïâ±¼)"}),s.jsx("p",{className:"text-[9px] text-muted-foreground mt-1",children:"Weights inversely proportional to volatility"})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Lookback"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[e.lookbackDays,"d"]})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Max Cap"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[e.maxWeight,"%"]})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Min Floor"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[e.minWeight,"%"]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Process"}),s.jsx("div",{className:"space-y-1.5",children:r.map((n,i)=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"flex-shrink-0 w-4 h-4 rounded-full bg-primary/10 text-primary text-[10px] flex items-center justify-center font-medium",children:i+1}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:n})]},i))})]}),t&&s.jsx("div",{className:"pt-2 border-t border-border/30",children:s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Last updated: ",t.toLocaleTimeString()]})})]})})},jL=({defaultConfig:e,currentConfig:t,onConfigChange:r})=>{const[n,i]=w.useState(t);w.useEffect(()=>{i(t)},[t]);const a=n.lookbackDays!==e.lookbackDays||n.maxWeight!==e.maxWeight||n.minWeight!==e.minWeight,o=d=>{const f={...n,lookbackDays:d[0]};i(f),r(f)},l=d=>{const f={...n,maxWeight:d[0]};i(f),r(f)},c=d=>{const f={...n,minWeight:d[0]};i(f),r(f)},u=()=>{i(e),r(e)};return s.jsx(ze,{className:`p-4 h-full transition-colors ${a?"bg-amber-500/5 border-amber-500/30":"bg-muted/20 border-border/40"}`,children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h4",{className:"font-serif text-sm font-medium text-foreground",children:"Risk Simulation"}),a&&s.jsx(Me,{className:"bg-amber-500/10 text-amber-600 hover:bg-amber-500/20 border border-amber-500/30 animate-pulse",children:"Simulating"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Lookback Period"}),s.jsxs("span",{className:"text-xs font-mono font-medium",children:[n.lookbackDays," days"]})]}),s.jsx(Gt,{value:[n.lookbackDays],onValueChange:o,min:7,max:60,step:1,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"7d (reactive)"}),s.jsx("span",{children:"60d (stable)"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Maximum Weight Cap"}),s.jsxs("span",{className:"text-xs font-mono font-medium",children:[n.maxWeight,"%"]})]}),s.jsx(Gt,{value:[n.maxWeight],onValueChange:l,min:10,max:50,step:1,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"10% (diversified)"}),s.jsx("span",{children:"50% (concentrated)"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Minimum Weight Floor"}),s.jsxs("span",{className:"text-xs font-mono font-medium",children:[n.minWeight,"%"]})]}),s.jsx(Gt,{value:[n.minWeight],onValueChange:c,min:0,max:5,step:.5,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"0% (no floor)"}),s.jsx("span",{children:"5% (high floor)"})]})]}),a&&s.jsxs(pe,{variant:"outline",size:"sm",onClick:u,className:"w-full gap-2",children:[s.jsx(Bc,{className:"w-3 h-3"}),"Reset to Defaults"]})]})})},FO={GPU:"hsl(142, 76%, 36%)",Data:"hsl(199, 89%, 48%)",Agent:"hsl(262, 83%, 58%)",Protocol:"hsl(45, 93%, 47%)",General:"hsl(330, 81%, 60%)"},SL=({weights:e,config:t,defaultOpen:r=!1,onTokenClick:n})=>{const[i,a]=w.useState(r),[o,l]=w.useState("finalWeight"),[c,u]=w.useState("desc"),d=y=>{o===y?u(c==="asc"?"desc":"asc"):(l(y),u("desc"))},f=w.useMemo(()=>[...e].sort((y,b)=>{let S,j;switch(o){case"ticker":return c==="asc"?y.ticker.localeCompare(b.ticker):b.ticker.localeCompare(y.ticker);case"volatility":S=y.volatility,j=b.volatility;break;case"inverseVolatility":S=y.inverseVolatility,j=b.inverseVolatility;break;case"rawWeight":S=y.rawWeight,j=b.rawWeight;break;case"finalWeight":default:S=y.finalWeight,j=b.finalWeight}return c==="asc"?S-j:j-S}),[e,o,c]),h=y=>`${(y*100).toFixed(2)}%`,m=y=>`${y.toFixed(2)}%`,g=({field:y})=>o!==y?null:c==="asc"?s.jsx(ac,{className:"w-3 h-3 inline ml-1"}):s.jsx(ic,{className:"w-3 h-3 inline ml-1"}),p=({volatility:y})=>{const b=Math.min(y/15,1)*100,S=y<5?"hsl(142 71% 45%)":y<10?"hsl(45 93% 47%)":"hsl(0 84% 60%)";return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${b}%`,backgroundColor:S}})}),s.jsx("span",{className:"font-mono text-xs w-14 text-right",children:m(y)})]})},v=y=>y.wasCapped?s.jsxs("span",{className:"text-amber-500 text-xs flex items-center gap-0.5",children:[s.jsx(Fs,{className:"w-3 h-3"}),"Capped"]}):y.wasFloored?s.jsxs("span",{className:"text-blue-500 text-xs flex items-center gap-0.5",children:[s.jsx(Fs,{className:"w-3 h-3"}),"Floored"]}):null,x=e.reduce((y,b)=>y+b.finalWeight,0);return s.jsxs(ia,{open:i,onOpenChange:a,children:[s.jsxs(aa,{className:"flex items-center justify-between w-full p-4 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-semibold text-sm",children:"Risk-Controlled Weight Breakdown"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",e.length," constituents)"]})]}),i?s.jsx(mi,{className:"w-4 h-4 text-muted-foreground"}):s.jsx(dr,{className:"w-4 h-4 text-muted-foreground"})]}),s.jsxs(sa,{className:"mt-2",children:[s.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/20 hover:bg-muted/20",children:[s.jsxs(J,{className:"text-xs cursor-pointer hover:text-foreground",onClick:()=>d("ticker"),children:["Token",s.jsx(g,{field:"ticker"})]}),s.jsx(J,{className:"text-xs",children:"Category"}),s.jsxs(J,{className:"text-xs cursor-pointer hover:text-foreground",onClick:()=>d("volatility"),children:["Volatility (Ï)",s.jsx(g,{field:"volatility"})]}),s.jsxs(J,{className:"text-xs cursor-pointer hover:text-foreground text-right",onClick:()=>d("rawWeight"),children:["Raw Weight",s.jsx(g,{field:"rawWeight"})]}),s.jsxs(J,{className:"text-xs cursor-pointer hover:text-foreground text-right",onClick:()=>d("finalWeight"),children:["Final Weight",s.jsx(g,{field:"finalWeight"})]}),s.jsx(J,{className:"text-xs text-right",children:"Status"})]})}),s.jsxs(qt,{children:[f.map(y=>s.jsxs(me,{className:`hover:bg-muted/30 ${n?"cursor-pointer":""}`,onClick:()=>n==null?void 0:n(y.ticker),children:[s.jsx(W,{className:"py-2",children:s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-sm",children:y.ticker}),s.jsx("div",{className:"text-xs text-muted-foreground truncate max-w-[120px]",children:y.name})]})}),s.jsx(W,{className:"py-2",children:s.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:`${FO[y.category]||"hsl(var(--muted))"}20`,color:FO[y.category]||"hsl(var(--muted-foreground))"},children:y.category})}),s.jsx(W,{className:"py-2 min-w-[150px]",children:s.jsx(p,{volatility:y.volatility})}),s.jsx(W,{className:"py-2 text-right font-mono text-xs",children:h(y.rawWeight)}),s.jsx(W,{className:"py-2 text-right font-mono text-xs font-medium",children:h(y.finalWeight)}),s.jsx(W,{className:"py-2 text-right",children:v(y)})]},y.ticker)),s.jsxs(me,{className:"bg-muted/30 font-medium hover:bg-muted/30",children:[s.jsx(W,{colSpan:4,className:"py-2 text-sm",children:"Total"}),s.jsx(W,{className:"py-2 text-right font-mono text-sm",children:h(x)}),s.jsx(W,{})]})]})]})}),s.jsxs("div",{className:"flex items-center gap-4 mt-3 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"w-3 h-2 rounded bg-green-500"}),s.jsxs("span",{children:["Low vol (","<","5%)"]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"w-3 h-2 rounded bg-yellow-500"}),s.jsx("span",{children:"Med vol (5-10%)"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"w-3 h-2 rounded bg-red-500"}),s.jsxs("span",{children:["High vol (",">","10%)"]})]}
552),s.jsx("span",{className:"text-muted-foreground/50",children:"|"}),s.jsxs("span",{className:"text-amber-500 flex items-center gap-1",children:[s.jsx(Fs,{className:"w-3 h-3"})," = Capped at ",t.maxWeight,"%"]}),s.jsxs("span",{className:"text-blue-500 flex items-center gap-1",children:[s.jsx(Fs,{className:"w-3 h-3"})," = Floored at ",t.minWeight,"%"]})]})]})]})},kL=({mode:e,onModeChange:t})=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs text-muted-foreground font-medium uppercase tracking-wider",children:"Weighting Mode"}),s.jsxs("div",{className:"flex items-center gap-1 bg-muted/50 rounded-lg p-1",children:[s.jsxs("button",{onClick:()=>t("market-cap"),className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center gap-1.5 ${e==="market-cap"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:["Market Cap",s.jsx(sd,{children:s.jsxs(Mm,{children:[s.jsx(Dm,{asChild:!0,children:s.jsx(Rm,{className:"w-3 h-3 opacity-50"})}),s.jsx(od,{side:"bottom",className:"max-w-xs",children:s.jsx("p",{className:"text-xs",children:"Traditional cap-weighted methodology with dampening factor to reduce concentration."})})]})})]}),s.jsxs("button",{onClick:()=>t("multi-factor"),className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center gap-1.5 ${e==="multi-factor"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:["Multi-Factor",s.jsx(sd,{children:s.jsxs(Mm,{children:[s.jsx(Dm,{asChild:!0,children:s.jsx(Rm,{className:"w-3 h-3 opacity-50"})}),s.jsx(od,{side:"bottom",className:"max-w-xs",children:s.jsx("p",{className:"text-xs",children:"Composite scoring using Liquidity (40%), Fundamental (30%), and Sustainability (30%) factors."})})]})})]}),s.jsxs("button",{onClick:()=>t("risk-controlled"),className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center gap-1.5 ${e==="risk-controlled"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:["Risk Controlled",s.jsx(sd,{children:s.jsxs(Mm,{children:[s.jsx(Dm,{asChild:!0,children:s.jsx(Rm,{className:"w-3 h-3 opacity-50"})}),s.jsx(od,{side:"bottom",className:"max-w-xs",children:s.jsx("p",{className:"text-xs",children:"Inverse volatility weighting â lower volatility assets receive higher weights for reduced portfolio risk."})})]})})]})]})]}),Wje={GPU:"hsl(142, 76%, 36%)",Data:"hsl(199, 89%, 48%)",Agent:"hsl(262, 83%, 58%)",Protocol:"hsl(45, 93%, 47%)",General:"hsl(330, 81%, 60%)"},Uje=({weights:e=[],categoryWeights:t=[],isLoading:r=!1,config:n,defaultConfig:i,lastUpdated:a,showBreakdown:o=!0,onConfigChange:l,weightingMode:c="market-cap",onWeightingModeChange:u,multiFactorWeights:d=[],multiFactorCategoryWeights:f=[],multiFactorConfig:h,defaultMultiFactorConfig:m,multiFactorLastUpdated:g,onMultiFactorConfigChange:p,riskControlledWeights:v=[],riskControlledCategoryWeights:x=[],riskControlledConfig:y,defaultRiskControlledConfig:b,riskControlledLastUpdated:S,onRiskControlledConfigChange:j,riskControlledLoading:N=!1,onTokenClick:k})=>{const _=c==="multi-factor",C=c==="risk-controlled",P=C?v:_?d:e;if((r||C&&N)&&!C)return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsx("div",{className:"h-[350px] flex items-center justify-center",children:s.jsxs("div",{className:"space-y-4 text-center",children:[s.jsx(be,{className:"h-[240px] w-[240px] rounded-full mx-auto"}),s.jsx(be,{className:"h-4 w-48 mx-auto"})]})}),s.jsx(be,{className:"h-[350px] rounded-lg"}),s.jsx(be,{className:"h-[350px] rounded-lg"})]}),s.jsx(be,{className:"h-[200px] rounded-lg"})]});const A=P.map(R=>({name:R.ticker,value:parseFloat((R.finalWeight*100).toFixed(1)),color:Wje[R.category]||"hsl(var(--muted))",category:R.category}));return s.jsxs("div",{className:"space-y-6",children:[u&&s.jsx(kL,{mode:c,onModeChange:u}),C&&N&&s.jsxs("div",{className:"bg-muted/30 rounded-lg p-8 flex flex-col items-center justify-center",children:[s.jsx(kr,{className:"w-6 h-6 text-primary animate-spin mb
552-3"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading historical volatility data..."}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"This may take a few seconds"})]}),!(C&&N)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsx("div",{className:"h-[350px]",children:s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(V5,{children:[s.jsx(Ai,{data:A,cx:"50%",cy:"45%",innerRadius:80,outerRadius:130,paddingAngle:2,dataKey:"value",label:({name:R,value:$,x:D,y:M,textAnchor:I})=>s.jsx("text",{x:D,y:M,textAnchor:I,fill:"hsl(var(--foreground))",fontSize:10,children:`${R}: ${$}%`}),labelLine:{stroke:"hsl(var(--muted-foreground))",strokeWidth:1},children:A.map((R,$)=>s.jsx(To,{fill:R.color,stroke:"hsl(var(--background))",strokeWidth:2},`cell-${$}`))}),s.jsx(mt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",color:"hsl(var(--foreground))"},formatter:R=>[`${R}%`,"Weight"]}),s.jsx(dn,{verticalAlign:"bottom",height:36,formatter:R=>s.jsx("span",{style:{fontSize:11},className:"text-foreground",children:R})})]})})}),C?y&&b&&j&&s.jsx(jL,{defaultConfig:b,currentConfig:y,onConfigChange:j}):_?h&&m&&p&&s.jsx(Tje,{defaultConfig:m,currentConfig:h,onConfigChange:p}):n&&i&&l&&s.jsx(mL,{defaultConfig:i,currentConfig:n,onConfigChange:l}),C?y&&s.jsx(wL,{config:y,lastUpdated:S}):_?h&&s.jsx(Oje,{config:h,lastUpdated:g}):n&&s.jsx(G5,{config:n,lastUpdated:a})]}),o&&(C?y&&v.length>0&&s.jsx(SL,{weights:v,config:y,defaultOpen:!1,onTokenClick:k}):_?h&&d.length>0&&s.jsx(Bje,{weights:d,config:h,defaultOpen:!1,onTokenClick:k}):n&&e.length>0&&s.jsx(J5,{weights:e,config:n,defaultOpen:!1,onTokenClick:k}))]})]})},NL=({report:e})=>{const[t,r]=w.useState(!1);return s.jsx(ia,{open:t,onOpenChange:r,children:s.jsxs("div",{className:"bg-muted/30 rounded-lg border border-border/50 overflow-hidden",children:[s.jsxs(aa,{className:"w-full text-left p-5 flex items-start justify-between gap-4 hover:bg-muted/50 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h4",{className:"font-serif text-lg text-foreground mb-1",children:e.title}),s.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[e.date,e.author&&s.jsxs("span",{children:[" · ",e.author]})]}),s.jsx("p",{className:"text-sm text-foreground/80 leading-relaxed",children:e.summary})]}),s.jsx(dr,{className:X("h-5 w-5 text-muted-foreground shrink-0 mt-1 transition-transform duration-200",t&&"rotate-180")})]}),s.jsx(sa,{children:s.jsx("div",{className:"px-5 pb-5 pt-2 border-t border-border/30",children:s.jsx("div",{className:"prose prose-sm max-w-none text-foreground/90 leading-relaxed whitespace-pre-line",children:e.content})})})]})})},gm=({icon:e,title:t})=>s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(e,{className:"h-4 w-4 text-primary"}),s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-widest text-primary",children:t})]}),zje=({report:e})=>{const[t,r]=w.useState(!1),[n,i]=w.useState(!1);return s.jsxs("div",{className:"rounded-xl border border-primary/30 bg-card overflow-hidden shadow-sm",children:[s.jsx("div",{className:"px-5 pt-4 pb-0",children:s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-semibold uppercase tracking-widest text-primary bg-primary/10 rounded-full px-3 py-1",children:[s.jsx(ab,{className:"h-3 w-3"}),"Featured Report"]})}),s.jsxs("div",{className:"px-5 pt-3 pb-4 flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"font-serif text-2xl text-foreground leading-tight mb-1",children:e.title}),s.jsxs("p",{className:"text-sm text-muted-foreground mb-1",children:[e.date," · ",e.author,", ",e.publisher]}),s.jsx("p",{className:"text-sm text-foreground/75 leading-relaxed max-w-2xl",children:e.summary})]}),s.jsx("a",{href:e.pdfPath,download:!0,className:"shrink-0 self-start",onClick:a=>a.stopPropagation(),children:s.jsxs(pe,{variant:"outline",size:"sm",className:"gap-1.5 text-xs",children:[s.jsx(l8,{className:"h-3.5 w-3.5"}),"Download PDF"]})})]}),s.jsxs(ia,{open:t,onOpenChange:r,children:[s.jsxs(aa,{className:"w-full px-5 py-3 border-t border-border/40 flex items-center justify-between hover:bg-muted/30 transition-colors text-sm text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:t?"Close report":"Read full report"}),s.jsx(dr,{className:X("h-4 w-4 transition-transform duration-200",t&&"rotate-180")}
552)]}),s.jsx(sa,{children:s.jsxs("div",{className:"px-5 pb-6 pt-5 border-t border-border/30 space-y-8",children:[s.jsxs("div",{children:[s.jsx(gm,{icon:hp,title:"Methodology"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"bg-muted/30 rounded-lg p-4",children:[s.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Quantitative Criteria"}),s.jsx("ul",{className:"space-y-1.5",children:e.methodology.quantitative.map((a,o)=>s.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground/85",children:[s.jsx("span",{className:"text-primary mt-0.5",children:"â¢"}),a]},o))})]}),s.jsxs("div",{className:"bg-muted/30 rounded-lg p-4",children:[s.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Qualitative Exceptions"}),s.jsx("ul",{className:"space-y-1.5",children:e.methodology.qualitative.map((a,o)=>s.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground/85",children:[s.jsx("span",{className:"text-primary mt-0.5",children:"â¢"}),a]},o))})]})]})]}),s.jsxs("div",{children:[s.jsx(gm,{icon:ab,title:"11 Equal-Weight Components"}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-border/40",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-muted/40 border-b border-border/40",children:[s.jsx("th",{className:"text-left px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground w-20",children:"Token"}),s.jsx("th",{className:"text-left px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Core Business"}),s.jsx("th",{className:"text-right px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground w-20",children:"MCap"}),s.jsx("th",{className:"text-right px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground w-20",children:"FDV"}),s.jsx("th",{className:"text-right px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground w-16",children:"Age"}),s.jsx("th",{className:"text-left px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground w-48",children:"Exception"})]})}),s.jsx("tbody",{children:e.components.map((a,o)=>s.jsxs("tr",{className:X("border-b border-border/20 last:border-0",o%2===0?"bg-background":"bg-muted/10"),children:[s.jsx("td",{className:"px-3 py-3",children:s.jsx("span",{className:"font-mono font-semibold text-foreground text-xs bg-primary/10 text-primary rounded px-1.5 py-0.5",children:a.ticker})}),s.jsx("td",{className:"px-3 py-3 text-foreground/80 leading-snug text-xs",children:a.business}),s.jsx("td",{className:"px-3 py-3 text-right font-mono text-xs text-foreground/70",children:a.mcap}),s.jsx("td",{className:"px-3 py-3 text-right font-mono text-xs text-foreground/70",children:a.fdv}),s.jsx("td",{className:"px-3 py-3 text-right text-xs text-foreground/60",children:a.age}),s.jsx("td",{className:"px-3 py-3",children:a.exception?s.jsx("span",{className:"text-xs text-muted-foreground leading-snug italic",children:a.exception}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"â"})})]},a.ticker))})]})}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2 italic",children:"Equal-weight: each constituent represents ~9.1% of index at inception."})]}),s.jsxs("div",{children:[s.jsx(gm,{icon:rv,title:"Performance â Past 12 Months"}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-4",children:[s.jsxs("div",{className:"bg-muted/30 rounded-lg p-3 text-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"dAI Total Return"}),s.jsx("p",{className:"font-mono font-bold text-xl text-destructive",children:e.performance.totalReturn})]}),s.jsxs("div",{className:"bg-muted/30 rounded-lg p-3 text-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Max Drawdown"}),s.jsx("p",{className:"font-mono font-bold text-xl text-destructive",children:e.performance.maxDrawdown})]}),s.jsxs("div",{className:"bg-muted/30 rounded-lg p-3 text-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Daily Volatility"}),s.jsx("p",{className:"font-mono font-bold text-xl text-foreground",children:e.performance.volatility})]}),s.jsxs("div",{className:"bg-muted/30 rounded-lg p-3 text-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"vs Benchmarks"}),s.jsx("div",{className:"space-y-0.5",children:e.performance.benchmarks.map(a=>s.jsxs("p",{className:"font-mono font-semibold text-sm text-destructive",children:[a.name," ",a.return]},a.name))})]})]}
552),s.jsxs("p",{className:"text-sm text-foreground/70 leading-relaxed bg-muted/20 rounded-lg p-3 italic",children:['"',e.performance.context,'"']})]}),s.jsxs("div",{children:[s.jsx(gm,{icon:Ej,title:"Appendix I â Public Equity Comparables"}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-border/40",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-muted/40 border-b border-border/40",children:[s.jsx("th",{className:"text-left px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground w-16",children:"Ticker"}),s.jsx("th",{className:"text-left px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground w-32",children:"Company"}),s.jsx("th",{className:"text-right px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground w-24",children:"Market Cap"}),s.jsx("th",{className:"text-right px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground w-24",children:"TTM Revenue"}),s.jsx("th",{className:"text-left px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Description"})]})}),s.jsx("tbody",{children:e.equityComparables.map((a,o)=>s.jsxs("tr",{className:X("border-b border-border/20 last:border-0",o%2===0?"bg-background":"bg-muted/10"),children:[s.jsx("td",{className:"px-3 py-3",children:s.jsx("span",{className:"font-mono font-semibold text-xs text-foreground",children:a.ticker})}),s.jsx("td",{className:"px-3 py-3 text-xs text-foreground/80",children:a.name}),s.jsx("td",{className:"px-3 py-3 text-right font-mono text-xs text-foreground/70",children:a.marketCap}),s.jsx("td",{className:"px-3 py-3 text-right font-mono text-xs text-foreground/70",children:a.ttmRevenue}),s.jsx("td",{className:"px-3 py-3 text-xs text-foreground/70 leading-snug",children:a.description})]},a.ticker))})]})})]}),s.jsx("p",{className:"text-xs text-muted-foreground italic",children:e.sources}),s.jsxs(ia,{open:n,onOpenChange:i,children:[s.jsxs(aa,{className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Fs,{className:"h-3 w-3"}),s.jsx("span",{children:"Disclaimer"}),s.jsx(dr,{className:X("h-3 w-3 transition-transform duration-200",n&&"rotate-180")})]}),s.jsx(sa,{children:s.jsx("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed bg-muted/20 rounded p-3",children:e.disclaimer})})]})]})})]})]})},Vje={id:"q1-2026-deai-index",title:"Q1 2026 Decentralized AI Index",subtitle:"Reasoning for the Initial 11 Equal-Weight Constituents",date:"February 2026",author:"Lex Sokolin",publisher:"Generative Ventures",summary:"The founding research document establishing the Q1 2026 dAI Index â covering the quantitative screening methodology, qualitative exceptions, and the business rationale for each of the 11 equal-weight constituents. Includes 12-month performance analysis and public equity comparables.",pdfPath:"/2026_02_DeAI_Index.pdf",methodology:{quantitative:["$100M+ in Market Capitalization","Market cap / FDV ratio close to 100%","Annual drawdown from peak less than 75%","Token age 24+ months for multi-cycle survival","24-hour trading volume $10M+"],qualitative:["Accept lower market caps for stable and growing projects with strong fundamentals","Align the index with active themes in the broader AI ecosystem","Prioritize revenue-generating projects with validated, recurring revenues","Aim for ~10 components with meaningful thematic differentiation across the AI stack","Use equal weighting unless extraordinary evidence suggests otherwise"]},components:[{ticker:"NEAR",name:"NEAR Protocol",business:"AI-native L1 blockchain using Nightshade sharding. Co-founded by a Transformer paper co-author. Focused on chain abstraction, AI agents, and user-owned AI with ~46M monthly active users.",mcap:"$1.4B",fdv:"$1.4B",age:"~6 yrs",exception:null},{ticker:"TAO",name:"Bittensor",business:"Decentralized ML network where AI models train collaboratively across subnets. Bitcoin-inspired tokenomics with 21M max supply and halving cycles.",mcap:"$1.9B",fdv:"$4.1B",age:"~4 yrs",exception:"FDV ratio exception â included based on ecosystem size and network effect"},{ticker:"RENDER",name:"Render Network",business:"Decentralized GPU rendering and AI compute network. Migrated from Ethereum to Solana. Burn-and-mint token model. ~1.5M frames rendered per month.",mcap:"$750M",fdv:"$930M",age:"~8 yrs",exception:null},{ticker:"FET",name:"Artificial Superintelligence Alliance",business:"Merger of Fetch.ai and
552SingularityNET forming the ASI Alliance. Autonomous AI agents, decentralized GPU compute marketplace, and data marketplace. Building the ASI Chain L1.",mcap:"$390M",fdv:"$460M",age:"~7 yrs",exception:null},{ticker:"GRT",name:"The Graph",business:'Decentralized indexing protocol â the "Google of blockchains." Processing 11.6B queries per quarter. Horizon upgrade extends to multi-service data infrastructure.',mcap:"$296M",fdv:"$300M",age:"~5 yrs",exception:null},{ticker:"VIRTUAL",name:"Virtuals Protocol",business:"AI agent launchpad on Base for autonomous gaming, trading, and social agents. Agent Coordination Protocol enables onchain agent-to-agent interactions.",mcap:"$420M",fdv:"$656M",age:"~1.5 yrs",exception:"FDV ratio exception â included based on rapid user adoption and usage metrics"},{ticker:"AR",name:"Arweave",business:'Permanent decentralized storage network ("permaweb"). One-time fee model backed by blockweave technology. Underpins AO Computer for autonomous on-chain processes.',mcap:"$133M",fdv:"$133M",age:"~7 yrs",exception:null},{ticker:"GRASS",name:"Grass",business:"DePIN network on Solana â users share unused bandwidth for AI web-crawling, building a user-owned internet knowledge graph. 2M+ active users.",mcap:"$95M",fdv:"$200M",age:"~1.5 yrs",exception:"FDV ratio & MCap exceptions â included based on strong usage and commercialization trajectory"},{ticker:"TRAC",name:"OriginTrail",business:"Decentralized Knowledge Graph for trusted AI data exchange. Enterprise adoption via BSI, Walmart, and Microsoft Copilot integration via MCP. Building dRAG as a decentralized AI memory layer.",mcap:"$166M",fdv:"$167M",age:"~8 yrs",exception:null},{ticker:"VVV",name:"Venice Token",business:"Utility token for Venice.ai â a private, uncensored generative AI platform. Stakers receive AI inference capacity (VCUs). Buy-and-burn mechanism funded by platform revenue.",mcap:"$188M",fdv:"$304M",age:"~1 yr",exception:null},{ticker:"CLANKER",name:"Clanker",business:"Autonomous agent for deploying ERC-20 tokens on Base via Farcaster social commands. Token creators earn a share of trading fees. ~507K token holders.",mcap:"$32M",fdv:"$32M",age:"<1 yr",exception:"MCap exception â included based on exceptional product/market fit and autonomous agent utility"}],performance:{totalReturn:"-43.12%",maxDrawdown:"-63.52%",volatility:"5.10%",benchmarks:[{name:"BTC",return:"-30%"},{name:"ETH",return:"-28%"}],context:"The current formulation is adjusted to remove severe underperformers on a quantitative basis, while capturing exposure to underlying operating themes from a qualitative perspective. The index reflects the inherent volatility of early-stage decentralized AI infrastructure."},equityComparables:[{ticker:"NVDA",name:"NVIDIA",marketCap:"$4.5T",ttmRevenue:"~$187B",description:"De facto AI infrastructure layer. CUDA moat entrenches developer ecosystems across training and inference workloads. Dominant GPU market share."},{ticker:"CRWV",name:"CoreWeave",marketCap:"$47B",ttmRevenue:"~$4.3B",description:"GPU-as-a-service provider with ~70% of revenue from Microsoft. Rapid growth in enterprise AI compute demand. Heavy capex model."},{ticker:"NBIS",name:"Nebius Group",marketCap:"$20B",ttmRevenue:"~$530M",description:"European AI compute alternative spun out of Yandex. Building GPU clusters and AI tooling for the European market."},{ticker:"GOOG",name:"Alphabet",marketCap:"$3.7T",ttmRevenue:"~$403B",description:"Search, cloud, and AI platform operator via DeepMind and Gemini. Broad AI surface area across consumer and enterprise segments."},{ticker:"PLTR",name:"Palantir",marketCap:"$313B",ttmRevenue:"~$4.5B",description:"Enterprise and government AI data platform. AIP platform drives commercial AI adoption. Strong U.S. government contract base."}],disclaimer:"This report is published by Generative Ventures and is intended for informational purposes only. It does not constitute investment advice, a solicitation, or an offer to buy or sell any security or digital asset. The information contained herein
552is based on sources believed to be reliable, but no representation or warranty is made as to its accuracy or completeness. Digital assets are speculative and involve significant risk, including the possible loss of principal. Past performance is not indicative of future results. Recipients should conduct their own due diligence and consult with qualified financial, legal, and tax advisors before making any investment decisions. Sources: CoinMarketCap, CoinGecko, Google Finance, Hiive and Forge. Qualitative data collated with assistance from Claude and ChatGPT.",sources:"Sources: CoinMarketCap, CoinGecko, Google Finance, Hiive and Forge. Qualitative data collated with assistance from Claude and ChatGPT."},Hje=[],Mc={liquidityWeight:.4,fundamentalWeight:.3,sustainabilityWeight:.3,maxWeight:.25,minWeight:.01};function qje(e){return!e||e==="â"||e==="-"?50:{"A+":95,A:90,"A-":85,"B+":75,B:70,"B-":65,"C+":55,C:50,"C-":45,D:30,F:10}[e]??50}function Gje(e){if(!e||e==="â"||e==="-")return 50;const t=e.match(/(\d+)/);return t?parseInt(t[1]):50}function Kje(e,t){if(t===0)return 0;const r=e/t*100,n=Math.min(100,Math.max(0,r*20));return Math.round(n)}function Yje(e,t){return Math.round((e+t)/2)}function _L(e,t){const r=e.map(o=>{const l=Kje(o.volume24h,o.marketCap),c=Yje(o.mcapFdvRatio,o.rating),u=o.sustainabilityScore,d=t.liquidityWeight*l+t.fundamentalWeight*c+t.sustainabilityWeight*u;return{ticker:o.ticker,name:o.name,category:o.category,marketCap:o.marketCap,liquidityScore:l,fundamentalScore:c,sustainabilityScore:u,compositeScore:d,rawWeight:0,adjustedWeight:0,finalWeight:0}}),n=r.reduce((o,l)=>o+l.compositeScore,0),i=r.map(o=>({...o,rawWeight:n>0?o.compositeScore/n:1/r.length})),a=Xje(i,t);return Qje(a)}function Xje(e,t){const r=e.map(a=>({...a,adjustedWeight:a.rawWeight}));let n=0;const i=10;for(;n<i;){let a=!1,o=0,l=0;if(r.forEach(c=>{c.adjustedWeight>t.maxWeight?(o+=c.adjustedWeight-t.maxWeight,c.adjustedWeight=t.maxWeight,a=!0):c.adjustedWeight<t.minWeight&&c.compositeScore>0&&(c.adjustedWeight=t.minWeight)}),r.forEach(c=>{c.adjustedWeight<t.maxWeight&&c.adjustedWeight>=t.minWeight&&l++}),a&&l>0&&o>0){const c=o/l;r.forEach(u=>{u.adjustedWeight<t.maxWeight&&u.adjustedWeight>=t.minWeight&&(u.adjustedWeight+=c)})}if(!a)break;n++}return r}function Qje(e){const t=e.reduce((r,n)=>r+n.adjustedWeight,0);if(t===0){const r=1/e.length;return e.map(n=>({...n,finalWeight:r}))}return e.map(r=>({...r,finalWeight:r.adjustedWeight/t})).sort((r,n)=>n.finalWeight-r.finalWeight)}function Jje(e){const t=new Map;return e.forEach(r=>{const n=t.get(r.category)||0;t.set(r.category,n+r.finalWeight)}),Array.from(t.entries()).map(([r,n])=>({category:r,weight:n})).sort((r,n)=>n.weight-r.weight)}function Zje(e,t=Mc){const r=e.map(l=>l.coingeckoId).filter(l=>!!l),{data:n,isLoading:i}=ys(r),a=w.useMemo(()=>{if(!n||i)return e.map(c=>({ticker:c.ticker,name:c.name,category:c.category,marketCap:0,liquidityScore:0,fundamentalScore:0,sustainabilityScore:c.metrics.sustainabilityScore??50,compositeScore:0,rawWeight:0,adjustedWeight:0,finalWeight:1/e.length}));const l=e.map(c=>{const u=(c.coingeckoId?n[c.coingeckoId]:void 0)??n[c.ticker],d=(u==null?void 0:u.rawMarketCap)??0,f=(u==null?void 0:u.rawVolume24h)??0,h=Gje((u==null?void 0:u.mcapFdvRatio)||c.metrics.mcapFdv),m=qje(c.metrics.rating),g=c.metrics.sustainabilityScore??50;return{ticker:c.ticker,name:c.name,category:c.category,marketCap:d,volume24h:f,mcapFdvRatio:h,rating:m,sustainabilityScore:g}});return _L(l,t)},[e,n,i,t]),o=w.useMemo(()=>Jje(a),[a]);return{weights:a,categoryWeights:o,isLoading:i,config:t,lastUpdated:new Date}}const Fn={lookbackDays:30,maxWeight:25,minWeight:1};function eSe(e){const t=[];for(let r=1;r<e.length;r++)e[r-1]>0&&t.push((e[r]-e[r-1])/e[r-1]);return t}function tSe(e){if(e.length<2)return 0;const t=e.reduce((i,a)=>
552i+a,0)/e.length,n=e.map(i=>Math.pow(i-t,2)).reduce((i,a)=>i+a,0)/e.length;return Math.sqrt(n)}function rSe(e,t,r){return e.slice(-r).map(i=>i.prices[t]).filter(i=>i!==void 0&&i>0)}function nSe(e,t){const r=t.maxWeight/100,n=t.minWeight/100;let i=e.map(l=>({...l})),a=0;const o=20;for(;a<o;){let l=!1,c=0,u=0,d=[],f=[];if(i.forEach(h=>{h.adjustedWeight>r?(c+=h.adjustedWeight-r,h.adjustedWeight=r,h.wasCapped=!0,l=!0):h.adjustedWeight<n&&h.adjustedWeight>0&&(u+=n-h.adjustedWeight,h.adjustedWeight=n,h.wasFloored=!0,l=!0),h.adjustedWeight<r&&!h.wasCapped&&f.push(h),h.adjustedWeight>n&&!h.wasFloored&&d.push(h)}),!l)break;if(c>0&&f.length>0){const h=c/f.length;f.forEach(m=>{m.adjustedWeight=Math.min(m.adjustedWeight+h,r)})}if(u>0&&d.length>0){const h=u/d.length;d.forEach(m=>{m.adjustedWeight=Math.max(m.adjustedWeight-h,n)})}a++}return i}function iSe(e){const t=e.reduce((r,n)=>r+n.adjustedWeight,0);return t===0?e:e.map(r=>({...r,finalWeight:r.adjustedWeight/t}))}function CL(e,t,r){if(t.length<2)return[];const n=[];if(e.forEach(l=>{if(!l.coingeckoId)return;const c=rSe(t,l.coingeckoId,r.lookbackDays);if(c.length<5)return;const u=eSe(c),d=tSe(u);d>0&&n.push({constituent:l,volatility:d})}),n.length===0)return[];const i=n.map(l=>({...l,inverseVolatility:1/l.volatility})),a=i.reduce((l,c)=>l+c.inverseVolatility,0);let o=i.map(l=>({ticker:l.constituent.ticker,name:l.constituent.name,category:l.constituent.category,coingeckoId:l.constituent.coingeckoId,volatility:l.volatility*100,inverseVolatility:l.inverseVolatility,rawWeight:l.inverseVolatility/a,adjustedWeight:l.inverseVolatility/a,finalWeight:0,wasCapped:!1,wasFloored:!1}));return o=nSe(o,r),o=iSe(o),o.sort((l,c)=>c.finalWeight-l.finalWeight)}function aSe(e){const t={};return e.forEach(r=>{t[r.category]=(t[r.category]||0)+r.finalWeight}),Object.entries(t).map(([r,n])=>({category:r,weight:n})).sort((r,n)=>n.weight-r.weight)}function AL(e,t,r=Fn){const n=w.useMemo(()=>!t||t.length===0?[]:CL(e,t,r),[e,t,r]),i=w.useMemo(()=>aSe(n),[n]),a=!t||t.length===0;return{weights:n,categoryWeights:i,isLoading:a,config:r,lastUpdated:a?void 0:new Date}}function dh(e,t=30){return gn({queryKey:["historicalMarketData",t],queryFn:async()=>await zK(t),staleTime:10*60*1e3,gcTime:30*60*1e3,enabled:e.length>0})}const vm=e=>e/1e6,Tu=(e,t)=>{if(t){if(e.coingeckoId&&t[e.coingeckoId])return t[e.coingeckoId];if(t[e.ticker])return t[e.ticker]}},sSe=e=>({GPU:"hsl(var(--chart-1))",Data:"hsl(var(--chart-2))",Agent:"hsl(var(--chart-3))",Protocol:"hsl(var(--chart-4))",General:"hsl(var(--chart-5))"})[e]||"hsl(var(--primary))",oSe=()=>{const[e,t]=w.useState("market-cap"),[r,n]=w.useState({...ls,dampingAlpha:0}),[i,a]=w.useState(Mc),[o,l]=w.useState(Fn),{data:c=Tg,isLoading:u}=by(),[d,f]=w.useState(null),h=w.useCallback(I=>{const T=c.find(L=>L.ticker===I);T&&f(T)},[c]),m=w.useMemo(()=>c.map(I=>I.coingeckoId).filter(I=>!!I),[c]),{data:g,isLoading:p}=ys(m),v=w.useMemo(()=>g?c.filter(I=>Tu(I,g)).map(I=>({name:I.ticker,value:vm(Tu(I,g).rawVolume24h),color:sSe(I.category)})).sort((I,T)=>T.value-I.value).slice(0,13):[],[g,c]),x=w.useMemo(()=>g?c.filter(I=>{var T;return(T=Tu(I,g))==null?void 0:T.obDepth2PctTotal}).map(I=>{const T=Tu(I,g);return{name:I.ticker,bid:vm(T.obDepth2PctBid??0),ask:vm(T.obDepth2PctAsk??0),depth:vm(T.obDepth2PctTotal??0)}}).sort((I,T)=>T.depth-I.depth):[],[g,c]),{data:y,isLoading:b}=dh(e==="risk-controlled"?m:[]),{weights:S,categoryWeights:j,isLoading:N,lastUpdated:k}=Sk(c,r),{weights:_,categoryWeights:C,isLoading:P,lastUpdated:E}=Zje(c,i),{weights:A,categoryWeights:R,isLoading:$,lastUpdated:D}=AL(c,y,o),M=e==="market-cap"?N:e==="multi-factor"?P:$||b;return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Vi,{}),s.jsxs("main",{className:"container py-8",children:[s.jsx("h1",{className:"font-serif text-4xl md:text-5xl mb-10",children:"Decentralized AI Index Dashboard"}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[280px_1fr] gap-8",children:[s.jsxs("aside",{className:"space-y-5",children:[s.jsxs("div",{className:"bg-card rounded-lg border border-border/40 p-5",children:[s.jsx("h3",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground mb-4",children:"Contents"}),s.jsx("div",{className:"border-t border-border/40 pt-4",children:s.jsx(nG,{})})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border/40 p-5",children:[s.jsx("h3",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground mb-4",children:"Token Categories"}),s.jsxs("div",{className:"border-t border-border/40 pt-4 space-y-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"badge-gpu text-xs px-2 py-0.5 rounded",children:"GPU"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"GPU Compute Networks"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"badge-data text-xs px-2 py-0.5 rounded",children:"Data"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Data Infrastru
552cture"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"badge-agent text-xs px-2 py-0.5 rounded",children:"Agent"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"AI Agent Platforms"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"badge-protocol text-xs px-2 py-0.5 rounded",children:"Protocol"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Base Layer Protocols"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"badge-general text-xs px-2 py-0.5 rounded",children:"General"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"General AI Infrastructure"})]})]})]})]}),s.jsx("div",{className:"space-y-0",children:s.jsxs("section",{id:"methodology",children:[s.jsx("h2",{className:"section-title",children:"Index Methodology"}),s.jsxs("div",{id:"ai-index",className:"mb-8",children:[s.jsx("h3",{className:"font-serif text-xl mb-3",children:"dAI Token Index"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed text-sm",children:"The Index tracks the performance of leading decentralized AI infrastructure tokens, providing comprehensive exposure to the emerging AI x Crypto ecosystem. The index evaluates constituents across GPU compute, data infrastructure, AI agents, and underlying protocols to capture the full value chain of decentralized artificial intelligence."})]}),s.jsx(BI,{indexType:"dai",criteriaId:"criteria",constraintsId:"risk-constraints"}),s.jsxs("div",{id:"weighting",className:"space-y-3",children:[s.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Factor-Based Portfolio Weighting"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"p-4 rounded-lg bg-muted/30 border border-border/50",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Market Cap Weighted"}),s.jsx("p",{className:"text-sm",children:"Dampened cap-weight (MCap^α) to reduce concentration"})]}),s.jsxs("div",{className:"p-4 rounded-lg bg-muted/30 border border-border/50",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Multi-Factor Scored"}),s.jsx("p",{className:"text-sm",children:"Composite of Liquidity (40%), Fundamental (30%), Sustainability (30%)"})]}),s.jsxs("div",{className:"p-4 rounded-lg bg-muted/30 border border-border/50",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Risk Controlled"}),s.jsx("p",{className:"text-sm",children:"Inverse volatility weighting (1/Ï) for lower portfolio risk"})]})]})]})]})})]}),s.jsxs("section",{id:"weight-distribution",className:"section-divider",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-primary/40 pb-3 mb-5",children:[s.jsx("h2",{className:"section-title !mb-0 !pb-0",children:"Index Weight Distribution"}),s.jsx(_e,{to:"/backtest/dai",children:s.jsx(pe,{variant:"default",size:"sm",className:"bg-foreground text-background hover:bg-foreground
552/90 font-medium text-xs tracking-wide px-4",children:"PERFORMANCE"})})]}),s.jsx("div",{className:"bg-card rounded-lg border border-border/40 p-5",children:s.jsx(Uje,{weights:S,categoryWeights:j,isLoading:M,config:r,defaultConfig:ls,lastUpdated:k,onConfigChange:n,weightingMode:e,onWeightingModeChange:t,multiFactorWeights:_,multiFactorCategoryWeights:C,multiFactorConfig:i,defaultMultiFactorConfig:Mc,multiFactorLastUpdated:E,onMultiFactorConfigChange:a,riskControlledWeights:A,riskControlledCategoryWeights:R,riskControlledConfig:o,defaultRiskControlledConfig:Fn,riskControlledLastUpdated:D,onRiskControlledConfigChange:l,riskControlledLoading:b,onTokenClick:h})})]}),s.jsxs("section",{id:"scorecards",className:"section-divider",children:[s.jsx("h2",{className:"section-title",children:"Constituent Scorecards & Research"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-5",children:c.map((I,T)=>s.jsx(q1e,{...I,index:T,marketData:Tu(I,g),isLoading:p},I.ticker))})]}),s.jsxs("section",{id:"constituents",className:"section-divider",children:[s.jsx("h2",{className:"section-title",children:"$dAI Index Constituents"}),s.jsx(sje,{})]}),s.jsxs("section",{id:"liquidity",className:"section-divider",children:[s.jsx("h2",{className:"section-title",children:"Liquidity Analysis"}),s.jsx(oje,{volumeData:v,depthData:x,isLoading:p})]}),s.jsxs("section",{id:"sustainability",className:"section-divider",children:[s.jsx("h2",{className:"section-title",children:"Research Report"}),s.jsx("div",{id:"reports",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(zje,{report:Vje}),Hje.map(I=>s.jsx(NL,{report:I},I.id))]})})]})]}),d&&s.jsx(su,{open:!!d,onOpenChange:I=>{I||f(null)},ticker:d.ticker,name:d.name,category:d.category,description:d.description,coingeckoId:d.coingeckoId}),s.jsx("footer",{className:"bg-foreground text-background mt-20",children:s.jsxs("div",{className:"container py-8",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("h4",{className:"text-xs font-medium uppercase tracking-wider text-background/60 mb-3",children:"Sitemap"}),s.jsxs("nav",{className:"flex gap-6",children:[s.jsx(_e,{to:"/",className:"text-sm text-background/70 hover:text-background transition-colors",children:"dAI Index"}),s.jsx(_e,{to:"/rwa",className:"text-sm text-background/70 hover:text-background transition-colors",children:"RWA Index"}),s.jsx(_e,{to:"/backtest",className:"text-sm text-background/70 hover:text-background transition-colors",children:"Backtest"}),s.jsx(_e,{to:"/methodology",className:"text-sm text-background/70 hover:text-background transition-colors",children:"Methodology"}),s.jsx(_e,{to:"/build",className:"text-sm text-background/70 hover:text-background transition-colors",children:"Build Index"})]})]}),s.jsxs("div",{className:"pt-4 border-t border-background/20 text-center text-sm text-background/60",children:[s.jsx("p",{children:"© 2026 Openw3b. All rights reserved."}),s.jsx("p",{className:"mt-2",children:"This index is for informational purposes only and does not constitute investment advice."})]})]})})]})},lSe=[{id:"methodology",label:"Index Methodology",children:[{id:"criteria",label:"Inclusion Criteria"},{id:"constraints",label:"Constraints"},{id:"weighting",label:"Portfolio Weighting"}]},{id:"weight-distribution",label:"Weight Distribution"},{id:"scorecards",label:"RWA Token Index"},{id:"constituents",label:"Index Constituents"},{id:"liquidity",label:"Liquidity Analysis"},{id:"sustainability",label:"Reports & Economic Sustainability"}],cSe=()=>{const e=t=>{const r=document.getElementById(t);r&&r.scrollIntoView({behavior:"smooth"})};return s.jsx("nav",{className:"space-y-1",children:lSe.map(t=>s.jsxs("div",{children:[s.jsx("button",{onClick:()=>e(t.id),className:"w-full text-left py-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors tracking-wide",children:t.label}),t.children&&s.jsx("div",{className:"ml-3 space-y-0.5",children:t.children.map(r=>s.jsx("button",{onClick:()=>e(r.id),className:"w-full text-left py-1 text-xs text-muted-foreground/80 hover:text-foreground transition-colors tracking-wide",children:r.label},r.id))})]},t.id))})},uSe={Securities:"badge-securities",Lending:"badge-lending",Credit:"badge-credit",Platform:"badge-platform",Yield:"badge-yield"},dSe=({ticker:e,name:t,category:r,description:n,coingeckoId:i,metrics:a,marketData:o,isLoading:l=!1,index:c=0})=>{const[u,d]=w.useState(!1),[f,h]=w.useState(!1),m=i&&xy[i];return s.jsxs(s.Fragment,{children:[s.jsx(ze,{className:"group cursor-pointer transition-all duration-300 hover:shadow-lg hover:-translate-y-1 hover:scale-[1.02] animate-fade-in-up",style:{animationDelay:`${c*100}ms`},onClick:()=>h(!0),children:s.jsxs(xt,{className:"p-5",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center flex-shrink-0 overflow-hidden",children:m&&!u?s.jsx("img",{src:m,alt:`${t} logo`,className:"w-full h-full object-cover",onError:()=>d(!0)}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:e.slice(0,2)})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("h3",{className:"font-serif text-base font-medium",children:e}),s.jsx(Me,{variant:"outline",className:`text-[10px] ${uSe[r]}`,children:r})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:t}
552),s.jsx("p",{className:"text-xs text-muted-foreground/80 line-clamp-2 leading-relaxed",children:n})]})]}),s.jsxs("div",{className:"mt-4 pt-3 border-t border-border/50 grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"MCap"}),l?s.jsx(be,{className:"h-4 w-14 mt-0.5"}):s.jsx("p",{className:"text-sm font-medium",children:(o==null?void 0:o.marketCap)||a.mcapFdv})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"24h Vol"}),l?s.jsx(be,{className:"h-4 w-12 mt-0.5"}):s.jsx("p",{className:"text-sm font-medium",children:(o==null?void 0:o.volume24h)||a.volume24h})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Rating"}),s.jsx("p",{className:"text-sm font-medium",children:a.rating})]})]})]})}),s.jsx(su,{open:f,onOpenChange:h,ticker:e,name:t,category:r,description:n,coingeckoId:i})]})},fSe={Securities:"badge-securities",Lending:"badge-lending",Credit:"badge-credit",Platform:"badge-platform",Yield:"badge-yield"},BO=["Tokens","Platforms"],hSe={"U.S. Treasuries":{className:"badge-treasuries",icon:Ej},Stablecoins:{className:"badge-stablecoins",icon:ab},"Private Credit":{className:"badge-private-credit",icon:tR},"Institutional Funds":{className:"badge-institutional-funds",icon:Oj},Commodities:{className:"badge-commodities",icon:rR},Stocks:{className:"badge-stocks",icon:wi},"Corporate Bonds":{className:"badge-corporate-bonds",icon:Q$},"Non-U.S. Gov Debt":{className:"badge-non-us-gov-debt",icon:aR},"Real Estate":{className:"badge-real-estate",icon:sR}},xa=e=>{if(e==="â"||e==="-")return 0;const t=e.replace(/[$%,BMK]/g,""),r=parseFloat(t);return e.includes("B")?r*1e9:e.includes("M")?r*1e6:e.includes("K")?r*1e3:r},WO=({change:e})=>e==="neutral"?null:e==="up"?s.jsx(ac,{className:"inline h-3 w-3 text-green-600 ml-1"}):s.jsx(ic,{className:"inline h-3 w-3 text-destructive ml-1"}),mSe=({assetClass:e})=>{const t=hSe[e],r=t.icon;return s.jsxs(Me,{variant:"outline",className:`${t.className} text-xs px-2 py-0.5 gap-1`,children:[s.jsx(r,{className:"h-3 w-3"}),e]})},pSe=()=>{const[e,t]=w.useState("Tokens"),[r,n]=w.useState(null),[i,a]=w.useState(null),[o,l]=w.useState(null),c=e==="Platforms",{data:u=[],isLoading:d}=wy(),f=w.useMemo(()=>u.map(k=>({ticker:k.ticker,name:k.name,category:k.category,coingeckoId:k.coingeckoId,supply:"â",orderBookDepth:"â",drawdown:"â"})),[u]),h=f.map(k=>k.coingeckoId).filter(k=>!!k),{data:m,isLoading:g}=ys(h),p=k=>{r===k?o==="asc"?l("desc"):o==="desc"?(n(null),l(null)):l("asc"):(n(k),l("asc"))},v=k=>{i===k?o==="asc"?l("desc"):o==="desc"?(a(null),l(null)):l("asc"):(a(k),l("asc"))},x=w.useMemo(()=>{let k=[...f];return r&&o&&k.sort((_,C)=>{let P,E;if(r==="mcapFdv"&&m){const A=m[_.coingeckoId||""],R=m[C.coingeckoId||""];P=A?xa(A.marketCap):0,E=R?xa(R.marketCap):0}else if(r==="volume24h"&&m){const A=m[_.coingeckoId||""],R=m[C.coingeckoId||""];P=A?xa(A.volume24h):0,E=R?xa(R.volume24h):0}else P=xa(_[r]),E=xa(C[r]);return o==="asc"?P-E:E-P}),k},[f,r,o,m]),y=w.useMemo(()=>{let k=[...tje];return i&&o&&k.sort((_,C)=>{let P,E;return i==="rwaTotalValue"?(P=xa(_.rwaTotalValue),E=xa(C.rwaTotalValue)):(P=_[i],E=C[i]),o==="asc"?P-E:E-P}),k},[i,o]),b=({columnKey:k})=>r!==k?s.jsx(nb,{className:"ml-1 h-3 w-3 opacity-50"}):o==="asc"?s.jsx(ac,{className:"ml-1 h-3 w-3"}):s.jsx(ic,{className:"ml-1 h-3 w-3"}),S=({columnKey:k})=>i!==k?s.jsx(nb,{className:"ml-1 h-3 w-3 opacity-50"}):o==="asc"?s.jsx(ac,{className:"ml-1 h-3 w-3"}):s.jsx(ic,{className:"ml-1 h-3 w-3"}),j=({columnKey:k,children:_,className:C=""})=>s.jsx(J,{className:`text-primary font-medium ${C}`,children:s.jsxs("button",{onClick:()=>p(k),className:"flex items-center hover:text-foreground transition-colors",children:[_,s.jsx(b,{columnKey:k})]})}),N=({columnKey:k,children:_,className:C=""})=>s.jsx(J,{className:`text-primary font-medium ${C}`,children:s.jsxs("button",{onClick:()=>v(k),className:"flex items-center hover:text-foreground transition-colors",children:[_,s.jsx(S,{columnKey:k})]})});return d?s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"inline-flex rounded-md border bg-muted/50 p-1",children:BO.map(k=>s.jsx(be,{className:"h-8 w-20"},k))}),s.jsx("div",{className:"bg-card rounded-lg border border-border/60 p-8",children:s.jsx("div",{className:"space-y-3",children:[...Array(8)].map((k,_)=>s.jsx(be,{className:"h-12 w-full"},_))})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"inline-flex rounded-md border bg-muted/50 p-1",children:BO.map(k=>s.jsx("button",{onClick:()=>t(k),className:`px-4 py-1.5 text-sm font-medium rounded transition-all ${e===k?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:k},k))}),s.jsx("div",{className:"bg-card rounded-lg border border-border/60 overflow-hidden",children:c?s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/30 hover:bg-muted/30",children:[s.jsx(N,{columnKey:"rank",className:"w-[60px]",children:"#"}),s.jsx(J,{className:"text-primary font-medium",children:"Name"}),s.jsx(N,{columnKey:"rwaCount",className:"text-right",children:"RWA Count"}),s.jsx(N,{columnKey:"rwaTotalValue",className:"text-right",children:"RWA Total Value"}),s.jsx(N,{columnKey:"rwaHolders",className:"text-right",children:"RWA Holders"}),s.jsx(J,{className:"text-primary font-medium",children:"Offered Asset Classes"})]})}),s.jsx(qt,{children:y.map(k=>s.jsxs(me,{className:"hover:bg-muted/20",children:[s.jsx(W,{className:"font-mono text-sm text-muted-foreground",children:k.rank}),s.jsx(W,{className:"font-medium",children:k.name}),s.jsx(W,{className:"text-right font-mono text-sm",children:k.rwaCount}),s.jsxs(W,{className:"text-right font-mono text-sm",children:[k.rwaTotalValue,s.jsx(WO,{change:k.rwaTotalValueChange})]}),s.jsxs(W,{className:"text-right font-mono text-sm",children:[k.rwaHolders.toLocaleStr
552ing(),s.jsx(WO,{change:k.rwaHoldersChange})]}),s.jsx(W,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[k.assetClasses.slice(0,2).map(_=>s.jsx(mSe,{assetClass:_},_)),k.assetClasses.length>2&&s.jsxs(Me,{variant:"outline",className:"text-xs px-2 py-0.5",children:["+",k.assetClasses.length-2," more"]})]})})]},k.name))})]}):s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/30 hover:bg-muted/30",children:[s.jsx(j,{columnKey:"ticker",children:"Ticker"}),s.jsx(J,{className:"text-primary font-medium",children:"Category"}),s.jsx(j,{columnKey:"mcapFdv",className:"text-right",children:"MCap"}),s.jsx(j,{columnKey:"volume24h",className:"text-right",children:"24h Vol"}),s.jsx(j,{columnKey:"supply",className:"text-right",children:"Circ. Supply"}),s.jsx(j,{columnKey:"orderBookDepth",className:"text-right",children:"OB Depth ±2%"}),s.jsx(j,{columnKey:"drawdown",className:"text-right",children:"Max DD"})]})}),s.jsx(qt,{children:x.map(k=>{const _=m==null?void 0:m[k.coingeckoId||""];return s.jsxs(me,{className:"hover:bg-muted/20",children:[s.jsx(W,{className:"font-medium",children:s.jsxs("div",{children:[s.jsx("span",{className:"font-serif",children:k.ticker}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:k.name})]})}),s.jsx(W,{children:s.jsx(Me,{variant:"outline",className:`text-xs ${fSe[k.category]||""}`,children:k.category})}),s.jsx(W,{className:"text-right font-mono text-sm",children:g?s.jsx(be,{className:"h-4 w-16 ml-auto"}):(_==null?void 0:_.marketCap)||"â"}),s.jsx(W,{className:"text-right font-mono text-sm",children:g?s.jsx(be,{className:"h-4 w-14 ml-auto"}):(_==null?void 0:_.volume24h)||"â"}),s.jsx(W,{className:"text-right font-mono text-sm",children:k.supply}),s.jsx(W,{className:"text-right font-mono text-sm",children:k.orderBookDepth}),s.jsx(W,{className:"text-right font-mono text-sm text-destructive/80",children:k.drawdown})]},k.ticker)})})]})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:c?`Showing ${y.length} platform issuers`:`Showing ${x.length} of ${f.length} constituents`})]})},gSe=({config:e,lastUpdated:t})=>{const r=["Fetch live market data from CoinGecko","Calculate component scores (L, TVT, S)","Compute weighted composite score","Apply caps/floors constraints","Normalize to sum to 100%"];return s.jsx(ze,{className:"p-4 bg-muted/20 border-border/40 h-full",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"font-serif text-sm font-medium text-foreground",children:"Multi-Factor Methodology"}),s.jsxs("div",{className:"bg-background/50 rounded-md p-3 border border-border/30",children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Composite Score"}),s.jsxs("p",{className:"font-mono text-sm text-foreground",children:["Score = ",(e.liquidityWeight*100).toFixed(0),"%ÃL + ",(e.fundamentalWeight*100).toFixed(0),"%ÃTVT + ",(e.sustainabilityWeight*100).toFixed(0),"%ÃS"]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Liquidity (L)"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.liquidityWeight*100).toFixed(0),"%"]}),s.jsx("p",{className:"text-[9px] text-muted-foreground mt-1",children:"Vol/MCap ratio"})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Total Value Tokenized"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.fundamentalWeight*100).toFixed(0),"%"]}),s.jsx("p",{className:"text-[9px] text-muted-foreground mt-1",children:"on-chain RWA value"})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Sustainability (S)"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.sustainabilityWeight*100).toFixed(0),"%"]}),s.jsx("p",{className:"text-[9px] text-muted-foreground mt-1",children:"Protocol health"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Max Cap"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.maxWeight*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"text-center p-2 bg-background/30 rounded-md border border-border/20",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Min Floor"}),s.jsxs("p",{className:"font-mono text-sm text-primary font-medium",children:[(e.minWeight*100).toFixed(0),"%"]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Process"}),s.jsx("div",{className:"space-y-1.5",children:r.map((n,i)=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"flex-shrink-0 w-4 h-4 rounded-full bg-primary/10 text-primary text-[10px] flex items-center justify-center font-medium",children:i+1}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:n})]},i))})]}),t&&s.jsx("div",{className:"pt-2 border-t border-border/30",children:s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Last updated: ",t.toLocaleTimeString()]})})]})})},vSe=({defaultConfig:e,currentConfig:t,onConfigChange:r})=>{const n=()=>{r(e)},i=(o,l)=>{const c=1-l,u=["liquidityWeight","fundamentalWeight","sustainabilityWeight"].filter(h=>h!==o),d=u.reduce((h,m)=>h+t[m],0),f={...t,[o]:l};d>0?u.forEach(h=>{f[h]=t[h]/d*c}):u.forEach(h=>{f[h]=c/u.length}),r(f)},a=JSON.stringify(t)!==JSON.stringify(e);return s.jsx(ze,{className:`p-4 h-full transition-colors ${a?"bg-amber-500/5 border-amber-500/30":"bg-muted/20 border-border/40"}`,children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h4",{className:"font-serif text-sm font-medium text-foreground",children:"Multi-Factor Simulation"}),a&&s.jsx(Me,{className:"bg-amber-500/10 text-amber-600 border-amber-500/30 animate-pulse",children:"Simulating"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Factor Weights"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Liquidity"}),s.jsxs("span",{className:"text-xs font-mono font-medium",children:[(t.liquidityWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[t.liquidityWeight*100],onValueChange:([o])=>i("liquidityWeight",o/100),min:10,max:60,step:5,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"10%"}),s.jsx("span",{children:"60%"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Total Value Tokenized"}),s.jsxs("span",{className:"text-xs font-mono font-medium",children:[(t.fundamentalWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[t.fundamentalWeight*100],onValueChange:([o])=>i("fundamentalWeight",o/100),min:10,max:60,step:5,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"10%"}),s.jsx("span",{children:"60%"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Sustainability"}),s.jsxs("span",{className:"text-xs font-mono font-medium",children:[(t.sustainabilityWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[t.sustainabilityWeight*100],onValueChange:([o])=>i("sustainabilityWeight",o/100),min:10,max:60,step:5,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"10%"}),s.jsx("span",{children:"60%"})]})]})]}),s.jsxs("div",{className:"space-y-3 pt-2 border-t border-border/30",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Constraints"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Max Weight Cap"}),s.jsxs("span",{className:"text-xs font-mono font-medium",children:[(t.maxWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[t.maxWeight*100],onValueChange:([o])=>r({...t,maxWeight:o/100}),min:10,max:40,step:5,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"10%"}),s.jsx("span",{children:"40%"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Min Weight Floor"}),s.jsxs("span",{className:"text-xs font-mono font-medium",children:[(t.minWeight*100).toFixed(0),"%"]})]}),s.jsx(Gt,{value:[t.minWeight*100],onValueChange:([o])=>r({...t,minWeight:o/100}),min:0,max:5,step:.5,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:"0%"}),s.jsx("span",{children:"5%"})]})]})]}),a&&s.jsxs(pe,{variant:"outline",size:"sm",onClick:n,className:"w-full gap-2",children:[s.jsx(Bc,{className:"w-3 h-3"}),"Reset to Defaults"]})]})})},ySe={Securities:"hsl(142, 76%, 36%)",Lending:"hsl(199, 89%, 48%)",Credit:"hsl(45, 93%, 47%)",Platform:"hsl(330, 81%, 60%)",Yield:"hsl(262, 83%, 58%)"},xSe=e=>e>=1e9?`$${(e/1e9).toFixed(2)}B`:e>=1e6?`$${(e/1e6).toFixed(0)}M`:e>=1e3?`$${(e/1e3).toFixed(0)}K`:e===0?"$0":`$${e.toFixed(0)}`,bSe=({weights:e,config:t,defaultOpen:r=!1,onTokenClick:n})=>{const[i,a]=w.useState(r),[o,l]=w.useState("finalWeight"),[c,u]=w.useState("desc"),d=v=>{o===v?u(c==="asc"?"desc":"asc"):(l(v),u("desc"))},f=w.useMemo(()=>[...e].sort((v,x)=>{const y=v[o],b=x[o];if(typeof y=="string"&&typeof b=="string")return c==="asc"?y.localeCompare(b):b.localeCompare(y);const S=typeof y=="number"?y:0,j=typeof b=="number"?b:0;return c==="asc"?S-j:j-S}),[e,o,c]),h=v=>`${(v*100).toFixed(1)}%`,m=({score:v,color:x})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-16 h-1.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full",style:{width:`${v}%`,backgroundColor:x}})}),s.jsx("span",{className:"text-xs font-mono w-8",children:v.toFixed(0)})]}),g=({field:v})=>o!==v?null:c==="asc"?s.jsx(ac,{className:"h-3 w-3 inline ml-1"}):s.jsx(ic,{className:"h-3 w-3 inline ml-1"}),p=v=>{const x=v.rawWeight>t.maxWeight,y=v.rawWeight<t.minWeight;return x?s.jsx("span",{className:"ml-1 text-amber-500",title:"Capped",children:s.jsx(dr,{className:"h-3 w-3 inline"})}):y?s.jsx("span",{className:"ml-1 text-blue-500",title:"Floored",children:s.jsx(mi,{className:"h-3 w-3 inline"})}):null};return s.jsxs(ia,{open:i,onOpenChange:a,children:[s.jsxs(aa,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors w-full justify-between py-2",children:[s.jsx("span",{children:"RWA Multi-Factor Weight Breakdown"}),i?s.jsx(mi,{className:"h-4 w-4"}):s.jsx(dr,{className:"h-4 w-4"})]}),s.jsxs(sa,{children:[s.jsx("div",{className:"mt-4 rounded-lg border border-border/40 overflow-hidden",children:s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/30",children:[s.jsxs(J,{className:"cursor-pointer hover:text-foreground",onClick:()=>d("ticker"),children:["Token ",s.jsx(g,{field:"ticker"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground",onClick:()=>d("totalValueTokenized"),children:["TVL ",s.jsx(g,{field:"totalValueTokenized"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground",onClick:()=>d("liquidityScore"),children:["Liquidity ",s.jsx(g,{field:"liquidityScore"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground",onClick:()=>d("fundamentalScore"),children:["TVL Score ",s.jsx(g,{field:"fundamentalScore"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground",onClick:()=>d("sustainabilityScore"),children:["Sustain. ",s.jsx(g,{field:"sustainabilityScore"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground",onClick:()=>d("compositeScore"),children:["Composite ",s.jsx(g,{field:"compositeScore"})]}),s.jsxs(J,{className:"cursor-pointer hover:text-foreground text-right",onClick:()=>d("finalWeight"),children:["Final Weight ",s.jsx(g,{field:"finalWeight"})]})]})}),s.jsx(qt,{children:f.map(v=>s.jsxs(me,{className:`${n?"cursor-pointer hover:bg-muted/30":""}`,onClick:()=>n==null?void 0:n(v.ticker),children:[s.jsx(W,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:ySe[v.category]}}),s.jsx("span",{className:"font-mono text-sm",children:v.ticker})]})}),s.jsx(W,{className:"font-mono text-xs",children:xSe(v.totalValueTokenized)}),s.jsx(W,{children:s.jsx(m,{score:v.liquidityScore,color:"hsl(199, 89%, 48%)"})}),s.jsx(W,{children:s.jsx(m,{score:v.fundamentalScore,color:"hsl(142, 76%, 36%)"})}),s.jsx(W,{children:s.jsx(m,{score:v.sustainabilityScore,color:"hsl(262, 83%, 58%)"})}),s.jsx(W,{children:s.jsx(m,{score:v.compositeScore,color:"hsl(var(--primary))"})}),s.jsxs(W,{className:"text-right font-mono text-sm",children:[h(v.finalWeight),p(v)]})]}
552,v.ticker))})]})}),s.jsxs("div",{className:"mt-3 flex items-center gap-4 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(dr,{className:"h-3 w-3 text-amber-500"}),s.jsxs("span",{children:["Capped at ",(t.maxWeight*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(mi,{className:"h-3 w-3 text-blue-500"}),s.jsxs("span",{children:["Floored at ",(t.minWeight*100).toFixed(0),"%"]})]})]})]})]})},wSe={Securities:"hsl(142, 76%, 36%)",Lending:"hsl(199, 89%, 48%)",Credit:"hsl(45, 93%, 47%)",Platform:"hsl(330, 81%, 60%)",Yield:"hsl(262, 83%, 58%)"},jSe=({weights:e=[],categoryWeights:t=[],isLoading:r=!1,config:n,defaultConfig:i,lastUpdated:a,showBreakdown:o=!0,onConfigChange:l,weightingMode:c="market-cap",onWeightingModeChange:u,multiFactorWeights:d=[],multiFactorCategoryWeights:f=[],multiFactorConfig:h,defaultMultiFactorConfig:m,multiFactorLastUpdated:g,onMultiFactorConfigChange:p,riskControlledWeights:v=[],riskControlledCategoryWeights:x=[],riskControlledConfig:y,defaultRiskControlledConfig:b,riskControlledLastUpdated:S,onRiskControlledConfigChange:j,riskControlledLoading:N=!1,onTokenClick:k})=>{const _=c==="multi-factor",C=c==="risk-controlled",P=C?v:_?d:e;if((r||C&&N)&&!C)return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsx("div",{className:"h-[350px] flex items-center justify-center",children:s.jsxs("div",{className:"space-y-4 text-center",children:[s.jsx(be,{className:"h-[240px] w-[240px] rounded-full mx-auto"}),s.jsx(be,{className:"h-4 w-48 mx-auto"})]})}),s.jsx(be,{className:"h-[350px] rounded-lg"}),s.jsx(be,{className:"h-[350px] rounded-lg"})]}),s.jsx(be,{className:"h-[200px] rounded-lg"})]});const A=P.map(R=>({name:R.ticker,value:parseFloat((R.finalWeight*100).toFixed(1)),color:wSe[R.category]||"hsl(var(--muted))",category:R.category}));return s.jsxs("div",{className:"space-y-6",children:[u&&s.jsx(kL,{mode:c,onModeChange:u}),C&&N&&s.jsxs("div",{className:"bg-muted/30 rounded-lg p-8 flex flex-col items-center justify-center",children:[s.jsx(kr,{className:"w-6 h-6 text-primary animate-spin mb-3"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading historical volatility data..."}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"This may take a few seconds"})]}),!(C&&N)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsx("div",{className:"h-[350px]",children:s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(V5,{children:[s.jsx(Ai,{data:A,cx:"50%",cy:"45%",innerRadius:80,outerRadius:130,paddingAngle:2,dataKey:"value",label:({name:R,value:$,x:D,y:M,textAnchor:I})=>s.jsx("text",{x:D,y:M,textAnchor:I,fill:"hsl(var(--foreground))",fontSize:10,children:`${R}: ${$}%`}),labelLine:{stroke:"hsl(var(--muted-foreground))",strokeWidth:1},children:A.map((R,$)=>s.jsx(To,{fill:R.color,stroke:"hsl(var(--background))",strokeWidth:2},`cell-${$}`))}),s.jsx(mt,{formatter:R=>[`${R}%`,"Weight"],contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",color:"hsl(var(--foreground))",fontSize:"12px"}}),s.jsx(dn,{layout:"horizontal",align:"center",verticalAlign:"bottom",formatter:R=>s.jsx("span",{style:{fontSize:9},className:"text-foreground",children:R})})]})})}),C?y&&b&&j&&s.jsx(jL,{defaultConfig:b,currentConfig:y,onConfigChange:j}):_?h&&m&&p&&s.jsx(vSe,{defaultConfig:m,currentConfig:h,onConfigChange:p}):n&&i&&l&&s.jsx(mL,{defaultConfig:i,currentConfig:n,onConfigChange:l}),C?y&&s.jsx(wL,{config:y,lastUpdated:S}):_?h&&s.jsx(gSe,{config:h,lastUpdated:g}):n&&s.jsx(G5,{config:n,lastUpdated:a})]}),o&&(C?y&&v.length>0&&s.jsx(SL,{weights:v,config:y,defaultOpen:!1,onTokenClick:k}):_?h&&d.length>0&&s.jsx(bSe,{weights:d,config:h,defaultOpen:!1,onTokenClick:k}):n&&e.length>0&&s.jsx(J5,{weights:e,config:n,defaultOpen:!1,onTokenClick:k}))]})]})},n0=e=>e>=1?`$${e.toFixed(1)}M`:e>=.001?`$${(e*1e3).toFixed(0)}K`:`$${e.toFixed(2)}M`,SSe=({volumeData:e,depthData:t,isLoading:r=!1})=>r?s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-card rounded-lg border border-border/60 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx(be,{className:"h-6 w-40"}),s.jsx(be,{className:"h-4 w-16"})]}),s.jsx(be,{className:"h-[300px] w-full"})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border/60 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx(be,{className:"h-6 w-40"}),s.jsx(be,{className:"h-4 w-16"})]}),s.jsx(be,{className:"h-[300px] w-full"})]})]}):s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-card rounded-lg border border-border/60 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h4",{className:"font-serif text-lg",children:"24h Trading Volume"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"$ Millions"})]}),s.jsx("div",{className:"h-[300px]",children:s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(Rf,{data:e,margin:{top:10,right:10,left:0,bottom:30},children:[s.jsx(Vn,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),s.jsx(fr,{dataKey:"name",tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}
552,angle:-45,textAnchor:"end",height:60,axisLine:{stroke:"hsl(var(--border))"}}),s.jsx(hr,{tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickFormatter:n=>`$${n.toFixed(0)}M`}),s.jsx(mt,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:"12px"},formatter:n=>[n0(n),"Volume"]}),s.jsx(Hr,{dataKey:"value",radius:[4,4,0,0],children:e.map((n,i)=>s.jsx(To,{fill:n.color},`cell-${i}`))})]})})})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border/60 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h4",{className:"font-serif text-lg",children:"Order Book Depth (±2%)"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Bid + Ask"})]}),s.jsx("div",{className:"h-[300px]",children:s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(Rf,{data:t,margin:{top:10,right:10,left:0,bottom:30},children:[s.jsx(Vn,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),s.jsx(fr,{dataKey:"name",tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},angle:-45,textAnchor:"end",height:60,axisLine:{stroke:"hsl(var(--border))"}}),s.jsx(hr,{tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"},axisLine:{stroke:"hsl(var(--border))"},tickFormatter:n=>n0(n)}),s.jsx(mt,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:"12px"},formatter:(n,i)=>[n0(n),i==="bid"?"Bid Depth":"Ask Depth"]}),s.jsx(dn,{wrapperStyle:{fontSize:"11px"},formatter:n=>n==="bid"?"Bid (buy)":"Ask (sell)"}),s.jsx(Hr,{dataKey:"bid",stackId:"depth",fill:"hsl(142, 76%, 36%)",radius:[0,0,0,0]}),s.jsx(Hr,{dataKey:"ask",stackId:"depth",fill:"hsl(0, 84%, 60%)",radius:[4,4,0,0]})]})})})]})]}),kSe={"U.S. Treasuries":{className:"badge-treasuries",icon:Ej},Stablecoins:{className:"badge-stablecoins",icon:eR},"Private Credit":{className:"badge-private-credit",icon:tR},"Institutional Funds":{className:"badge-institutional",icon:Oj},Commodities:{className:"badge-commodities",icon:rR},Stocks:{className:"badge-stocks",icon:wi},"Corporate Bonds":{className:"badge-corporate-bonds",icon:Q$},"Non-U.S. Gov Debt":{className:"badge-non-us-debt",icon:aR},"Real Estate":{className:"badge-real-estate",icon:sR}},NSe=({name:e,description:t,rwaCount:r,rwaTotalValue:n,assetClasses:i})=>s.jsx(ze,{className:"group relative overflow-hidden border-border/40 hover:border-border/60 transition-all duration-300 cursor-pointer hover:shadow-md bg-card",children:s.jsxs(xt,{className:"p-5",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("span",{className:"font-serif text-lg",children:e})}),s.jsx(Me,{variant:"outline",className:"badge-platform text-xs",children:"Platform"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-4 line-clamp-2 leading-relaxed",children:t}),s.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[s.jsxs("div",{className:"p-2 rounded bg-muted/30",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"RWA Count"}),s.jsx("p",{className:"font-mono text-sm",children:r})]}),s.jsxs("div",{className:"p-2 rounded bg-muted/30",children:[s.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Total Value"}),s.jsx("p",{className:"font-mono text-sm",children:n})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.slice(0,2).map(a=>{const o=kSe[a],l=o.icon;return s.jsxs(Me,{variant:"outline",className:`${o.className} text-[10px] gap-1`,children:[s.jsx(l,{className:"w-2.5 h-2.5"}),a]},a)}),i.length>2&&s.jsxs(Me,{variant:"outline",className:"text-[10px] bg-muted/50",children:["+",i.length-2," more"]})]})]})}),_Se=[{id:"q1-2026-rwa-outlook",title:"Q1 2026 RWA Index Outlook",date:"January 2026",summary:"Overview of real-world asset tokenization trends and protocol performance heading into Q1 2026.",content:`The real-world asset tokenization sector enters 2026 with unprecedented
552institutional momentum. Tokenized treasuries have crossed $10B in TVL, with ONDO and similar protocols capturing significant market share from traditional money market funds. 553 554Key observations: 555⢠MakerDAO's RWA collateral now exceeds 40% of total backing, validating the RWA thesis at scale 556⢠Credit protocols (CPOOL, MPL, GFI) are seeing improved default rates and institutional adoption 557⢠Infrastructure platforms (CFG, POLYX) are attracting enterprise partnerships for compliant tokenization 558 559Risk factors to monitor include regulatory clarity around tokenized securities, credit risk concentration in lending protocols, and the competitive landscape with TradFi incumbents launching competing products.`},{id:"tokenized-treasuries-analysis",title:"Tokenized Treasuries Deep Dive",date:"January 2026",summary:"Analysis of the tokenized treasury market and ONDO's dominant position.",content:`Tokenized US Treasuries represent the fastest-growing RWA category, offering crypto-native yield with minimal credit risk. ONDO Finance has emerged as the market leader with over 60% share of on-chain treasury products. 560 561The value proposition is clear: instant settlement, 24/7 liquidity, composability with DeFi protocols, and regulatory compliance. Institutional demand continues to outpace supply as asset managers seek efficient on-chain cash management. 562 563Competitive dynamics: BlackRock's BUIDL fund and Franklin Templeton's on-chain money market fund represent TradFi validation but also competition. ONDO's advantage lies in native DeFi integrations and a broader product suite including tokenized bonds and equities. 564 565Valuation framework: Treasury tokenization protocols should be evaluated on AUM growth, fee take rates, and the optionality around expanding into higher-margin products like structured credit.`},{id:"credit-protocol-landscape",title:"Credit Protocol Landscape",date:"January 2026",summary:"Comparative analysis of CPOOL, MPL, GFI, and TRU in institutional lending.",content:`The decentralized credit sector has matured significantly, with protocols demonstrating resilience through market cycles. Combined TVL across major credit protocols exceeds $2B, with improving unit economics. 566 567Clearpool (CPOOL) has differentiated through its permissionless pool model, allowing institutions to launch branded borrowing pools with customizable terms. Recent integration with real-world credit scoring data enhances underwriting quality. 568 569Maple Finance (MPL) maintains its institutional focus, with stringent borrower requirements and active risk management. The pivot toward RWA-backed loans reduces crypto correlation risk. 570 571Goldfinch (GFI) serves a unique niche in emerging market lending, though higher default rates in this segment require careful position sizing. 572 573TrueFi (TRU) has rebuilt after earlier challenges, focusing on shorter-duration loans with improved credit assessment frameworks. 574 575Key metrics to watch: default rates, utilization rates, and the spread between borrowing costs and yields offered to lenders.`}],If={liquidityWeight:.4,fundamentalWeight:.3,sustainabilityWeight:.3,maxWeight:.2,minWeight:.01};function UO(e){if(!e||e==="â"||e==="$0")return 0;const t=e.replace(/[$,]/g,"").trim().toUpperCase(),r={T:1e12,B:1e9,M:1e6,K:1e3};for(const[i,a]of Object.entries(r))if(t.endsWith(i)){const o=parseFloat(t.replace(i,""));return isNaN(o)?0:o*a}const n=parseFloat(t);return isNaN(n)?0:n}function CSe(e,t){if(t===0)return 0;const r=e/t;return Math.min(100,Math.round(r*1e3))}function ASe(e,t){if(t===0)return 0;const r=Math.log10(e+1),n=Math.log10(t+1);return Math.min(100,Math.round(r/n*100))}function ESe(e,t){const r=e.map(l=>({...l,parsedTotalValue:UO(l.totalValueTokenized)})),n=Math.max(...r.map(l=>l.parsedTotalValue)),i=r.map(l=>{const c=UO(l.metrics.volume24h),u=l.metrics.marketCap??0,d=CSe(c,u),f=ASe(l.parsedTotalValue,n),h=l.metrics.sustainabilityScore??50,m=d*t.liquidityWeight+f*t.fundamentalWeight+h*t.sustainabilityWeight;return{ticker:l.ticker,name:l.name,category:l.category,liquidityScore:d,fundamentalScore:f,sustainabilityScore:h,compositeScore:m,rawWeight:0,adjustedWeight:0,finalWeight:0,totalValueTokenized:l.parsedTotalValue}}),a=i.reduce((l,c)=>
575l+c.compositeScore,0);i.forEach(l=>{l.rawWeight=a>0?l.compositeScore/a:0});const o=PSe(i,t);return OSe(o)}function PSe(e,t){const r=e.map(a=>({...a,adjustedWeight:a.rawWeight}));let n=0;const i=20;for(;n<i;){let a=0,o=0;if(r.forEach(u=>{u.adjustedWeight>t.maxWeight?(a+=u.adjustedWeight-t.maxWeight,u.adjustedWeight=t.maxWeight):u.adjustedWeight<t.minWeight&&(o+=t.minWeight-u.adjustedWeight,u.adjustedWeight=t.minWeight)}),a===0&&o===0)break;const l=r.filter(u=>u.adjustedWeight>t.minWeight&&u.adjustedWeight<t.maxWeight);if(l.length===0)break;const c=(a-o)/l.length;l.forEach(u=>{u.adjustedWeight+=c}),n++}return r}function OSe(e){const t=e.reduce((r,n)=>r+n.adjustedWeight,0);return e.map(r=>({...r,finalWeight:t>0?r.adjustedWeight/t:0}))}function TSe(e){const t=new Map;return e.forEach(r=>{const n=t.get(r.category)||0;t.set(r.category,n+r.finalWeight)}),Array.from(t.entries()).map(([r,n])=>({category:r,weight:n})).sort((r,n)=>n.weight-r.weight)}function $Se(e,t=If){const r=w.useMemo(()=>e.map(c=>c.coingeckoId).filter(c=>!!c),[e]),{data:n,isLoading:i}=ys(r),a=w.useMemo(()=>n?e.map(c=>{const u=(c.coingeckoId?n[c.coingeckoId]:void 0)??n[c.ticker];return{...c,metrics:{...c.metrics,volume24h:(u==null?void 0:u.volume24h)??c.metrics.volume24h,marketCap:(u==null?void 0:u.rawMarketCap)??c.metrics.marketCap}}}):e,[e,n]),o=w.useMemo(()=>i?[]:ESe(a,t),[a,t,i]),l=w.useMemo(()=>
575TSe(o),[o]);return{weights:o,categoryWeights:l,isLoading:i,config:t,lastUpdated:new Date}}const ym=e=>e/1e6,$u=(e,t)=>{if(t){if(e.coingeckoId&&t[e.coingeckoId])return t[e.coingeckoId];if(t[e.ticker])return t[e.ticker]}},RSe=e=>({Lending:"hsl(var(--chart-1))",Credit:"hsl(var(--chart-2))",Securities:"hsl(var(--chart-3))",Platform:"hsl(var(--chart-4))",Yield:"hsl(var(--chart-5))"})[e]||"hsl(var(--primary))",ISe=()=>{const[e,t]=w.useState("market-cap"),[r,n]=w.useState(Og),[i,a]=w.useState(If),[o,l]=w.useState(Fn),{data:c=w1,isLoading:u}=wy(),[d,f]=w.useState(null),h=w.useCallback(I=>{const T=c.find(L=>L.ticker===I);T&&f(T)},[c]),m=c.map(I=>I.coingeckoId).filter(I=>!!I),{data:g,isLoading:p}=ys(m),v=w.useMemo(()=>g?c.filter(I=>$u(I,g)).map(I=>({name:I.ticker,value:ym($u(I,g).rawVolume24h),color:RSe(I.category)})).sort((I,T)=>T.value-I.value).slice(0,10):[],[g,c]),x=w.useMemo(()=>g?c.filter(I=>{var T;return(T=$u(I,g))==null?void 0:T.obDepth2PctTotal}).map(I=>{const T=$u(I,g);return{name:I.ticker,bid:ym(T.obDepth2PctBid??0),ask:ym(T.obDepth2PctAsk??0),depth:ym(T.obDepth2PctTotal??0)}}).sort((I,T)=>T.depth-I.depth):[],[g,c]),{weights:y,categoryWeights:b,isLoading:S,lastUpdated:j}=Sk(c,r),N=c.map(I=>({ticker:I.ticker,name:I.name,category:I.category,coingeckoId:I.coingeckoId,totalValueTokenized:I.totalValueTokenized??"$0",metrics:{volume24h:I.metrics.volume24h,rating:I.metrics.rating,sustainabilityScore:50}})),{weights:k,categoryWeights:_,isLoading:C,lastUpdated:P}=$Se(N,i),{data:E,isLoading:A}=dh(e==="risk-controlled"?m:[]),{weights:R,categoryWeights:$,isLoading:D,lastUpdated:M}=AL(c,E,o);return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Vi,{}),s.jsxs("main",{className:"container py-8",children:[s.jsx("h1",{className:"font-serif text-4xl md:text-5xl mb-10",children:"RWA Index Dashboard"}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[280px_1fr] gap-8",children:[s.jsxs("aside",{className:"space-y-5",children:[s.jsxs("div",{className:"bg-card rounded-lg border border-border/40 p-5",children:[s.jsx("h2",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground mb-4",children:"Contents"}),s.jsx("div",{className:"border-t border-border/40 pt-4",children:s.jsx(cSe,{})})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border/40 p-5",children:[s.jsx("h3",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground mb-3",children:"Token Categories"}),s.jsxs("div",{className:"border-t border-border/40 pt-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"badge-securities text-xs px-2 py-0.5 rounded",children:"Securities"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Tokenized Securities"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"badge-lending text-xs px-2 py-0.5 rounded",children:"Lending"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Institutional Lending"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"badge-credit text-xs px-2 py-0.5 rounded",children:"Credit"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Credit Protocols"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"badge-platform text-xs px-2 py-0.5 rounded",children:"Platform"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Tokenization Platforms"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"badge-yield text-xs px-2 py-0.5 rounded",children:"Yield"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Yield Infrastructure"})]})]})]})]}),s.jsx("div",{className:"space-y-12",children:s.jsxs("section",{id:"methodology",className:"space-y-6",children:[s.jsx("h2",{className:"section-title",children:"Index Methodology"}),s.jsxs("div",{id:"rwa-index",className:"mb-8",children:[s.jsx("h3",{className:"font-serif text-xl mb-3",children:"RWA Token Index"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed text-sm",children:"The Index provides systematic exposure to the real-world asset tokenization ecosystem. The index captures value across tokenized securities, institutional lending, credit protocols, and tokenization infrastru
575cture platforms that are bridging traditional finance with blockchain technology."})]}),s.jsx(BI,{indexType:"rwa",criteriaId:"criteria",constraintsId:"constraints"}),s.jsxs("div",{id:"weighting",className:"space-y-3",children:[s.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Factor-Based Portfolio Weighting"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"p-4 rounded-lg bg-muted/30 border border-border/50",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Market Cap Weighted"}),s.jsx("p",{className:"text-sm",children:"Dampened cap-weight (MCap^α) to reduce concentration"})]}),s.jsxs("div",{className:"p-4 rounded-lg bg-muted/30 border border-border/50",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Multi-Factor Scored"}),s.jsx("p",{className:"text-sm",children:"Liquidity (40%), Total Value Tokenized (30%), Sustainability (30%)"})]}),s.jsxs("div",{className:"p-4 rounded-lg bg-muted/30 border border-border/50",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Risk Controlled"}),s.jsx("p",{className:"text-sm",children:"Inverse volatility weighting (1/Ï) for lower portfolio risk"})]})]})]})]})})]}),s.jsxs("section",{id:"weight-distribution",className:"section-divider",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-primary/40 pb-3 mb-5",children:[s.jsx("h2",{className:"section-title !mb-0 !pb-0",children:"Index Weight Distribution"}),s.jsx(_e,{to:"/backtest/rwa",children:s.jsx(pe,{variant:"default",size:"sm",className:"bg-foreground text-background hover:bg-foreground
575/90 font-medium text-xs tracking-wide px-4",children:"PERFORMANCE"})})]}),s.jsx("div",{className:"bg-card rounded-lg border border-border/40 p-6",children:s.jsx(jSe,{weights:y,categoryWeights:b,isLoading:S,config:r,defaultConfig:Og,lastUpdated:j,onConfigChange:n,weightingMode:e,onWeightingModeChange:t,multiFactorWeights:k,multiFactorCategoryWeights:_,multiFactorConfig:i,defaultMultiFactorConfig:If,multiFactorLastUpdated:P,onMultiFactorConfigChange:a,riskControlledWeights:R,riskControlledCategoryWeights:$,riskControlledConfig:o,defaultRiskControlledConfig:Fn,riskControlledLastUpdated:M,onRiskControlledConfigChange:l,riskControlledLoading:A||D,onTokenClick:h})})]}),s.jsxs("section",{id:"scorecards",className:"section-divider",children:[s.jsx("h2",{className:"section-title",children:"Constituent Scorecards & Research"}),s.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground mb-4",children:"Token Constituents"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4 mb-8",children:c.map((I,T)=>s.jsx(dSe,{...I,marketData:$u(I,g),isLoading:p,index:T},I.ticker))}),s.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground mb-4",children:"Platform Issuers"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4",children:rje.map((I,T)=>s.jsx(NSe,{...I,index:T},I.name))})]}),s.jsxs("section",{id:"constituents",className:"section-divider",children:[s.jsx("h2",{className:"section-title",children:"Index Constituents"}),s.jsx(pSe,{})]}),s.jsxs("section",{id:"liquidity",className:"section-divider",children:[s.jsx("h2",{className:"section-title",children:"Liquidity Analysis"}),s.jsx(SSe,{volumeData:v,depthData:x,isLoading:p})]}),s.jsxs("section",{id:"sustainability",className:"section-divider space-y-8",children:[s.jsx("h2",{className:"section-title",children:"RWA Industry Overview & Reports"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"p-6 rounded-lg bg-card border border-border shadow-sm",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Total Assets Tokenized"}),s.jsxs("div",{className:"flex items-baseline gap-3",children:[s.jsx("p",{className:"text-3xl font-serif",children:"$22.25B"}),s.jsx("span",{className:"text-sm text-green-500 font-medium",children:"+6.25%"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"30-day change"})]}),s.jsxs("div",{className:"p-6 rounded-lg bg-card border border-border shadow-sm",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"YoY Growth Rate"}),s.jsx("p",{className:"text-3xl font-serif text-green-500",children:"~300%"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"2024-2025 trajectory"})]}),s.jsxs("div",{className:"p-6 rounded-lg bg-card border border-border shadow-sm",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-1",children:"Active RWA Protocols"}),s.jsx("p",{className:"text-3xl font-serif",children:"127"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Tracked protocols"})]})]}),s.jsxs("div",{className:"p-4 rounded-lg bg-card border border-border shadow-sm",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-3",children:"Top Asset Classes by Value"}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"US Treasury Debt"}),s.jsx("p",{className:"font-medium font-serif",children:"$9.28B"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"Commodities"}),s.jsx("p",{className:"font-medium font-serif",children:"$3.99B"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"Private Credit"}),s.jsx("p",{className:"font-medium font-serif",children:"$2.52B"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"Inst. Alt Fun
575ds"}),s.jsx("p",{className:"font-medium font-serif",children:"$2.18B"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"Corporate Bonds"}),s.jsx("p",{className:"font-medium font-serif",children:"$1.53B"})]})]})]}),s.jsxs("div",{className:"p-4 rounded-lg bg-card border border-border shadow-sm",children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-3",children:"Chain Distribution"}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"Ethereum"}),s.jsx("p",{className:"font-medium font-serif",children:"~60%"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"Polygon"}),s.jsx("p",{className:"font-medium font-serif",children:"~15%"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"Stellar"}),s.jsx("p",{className:"font-medium font-serif",children:"~10%"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"Solana"}),s.jsx("p",{className:"font-medium font-serif",children:"~5%"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"Others"}),s.jsx("p",{className:"font-medium font-serif",children:"~10%"})]})]})]}),s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Industry data sourced from"," ",s.jsx("a",{href:"https://app.rwa.xyz/",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground transition-colors",children:"rwa.xyz"})," ","⢠Last updated: January 2026"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Research Reports"}),s.jsx("div",{className:"space-y-4",children:_Se.map(I=>s.jsx(NL,{report:I},I.id))})]})]})]}),d&&s.jsx(su,{open:!!d,onOpenChange:I=>{I||f(null)},ticker:d.ticker,name:d.name,category:d.category,description:d.description,coingeckoId:d.coingeckoId}),s.jsx("footer",{className:"bg-foreground text-background mt-20",children:s.jsxs("div",{className:"container py-8",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("h4",{className:"text-xs font-medium uppercase tracking-wider text-background/60 mb-3",children:"Sitemap"}),s.jsxs("nav",{className:"flex gap-6",children:[s.jsx(_e,{to:"/",className:"text-sm text-background/70 hover:text-background transition-colors",children:"dAI Index"}),s.jsx(_e,{to:"/rwa",className:"text-sm text-background/70 hover:text-background transition-colors",children:"RWA Index"}),s.jsx(_e,{to:"/backtest",className:"text-sm text-background/70 hover:text-background transition-colors",children:"Backtest"}),s.jsx(_e,{to:"/methodology",className:"text-sm text-background/70 hover:text-background transition-colors",children:"Methodology"}),s.jsx(_e,{to:"/build",className:"text-sm text-background/70 hover:text-background transition-colors",children:"Build Index"})]})]}),s.jsxs("div",{className:"pt-4 border-t border-background/20 text-center text-sm text-background/60",children:[s.jsx("p",{children:"© 2026 Openw3b. All rights reserved."}),s.jsx("p",{className:"mt-2",children:"This index is for informational purposes only and does not constitute financial advice. Past performance is not indicative of future results."})]})]})})]})};function MSe(e=395,t=!0){return gn({queryKey:["benchmarkData",e],queryFn:()=>VK(e),staleTime:10*60*1e3,gcTime:30*60*1e3,enabled:t})}function zO(e,t,r){const n=e.filter(o=>o.coingeckoId&&t[o.coingeckoId]).map(o=>({ticker:o.ticker,name:o.name,category:o.category,marketCap:t[o.coingeckoId]}));if(n.length===0)return{};const i=H5(n,r),a={};return i.forEach(o=>{const l=e.find(c=>c.ticker===o.ticker);l!=null&&l.coingeckoId&&(a[l.coingeckoId]=o.finalWeight)}),a}function xm(e,t,r){let n=0;return Object.entries(e).forEach(([i,a])=>{const o=t[i],l=r[i];if(o&&l&&o>0){const c=(l-o)/o;n+=a*c}}),n*100}function Ru(e){if(e.length===0)return{totalReturn:0,maxDrawdown:0,volatility:0,sharpeRatio:0,bestDay:0,worstDay:0};const t=e.reduce((f,h)=>f*(1+h/100),1)-1;let r=1,n=0,i=1;e.forEach(f=>
575{i*=1+f/100,r=Math.max(r,i);const h=(r-i)/r;n=Math.max(n,h)});const a=e.reduce((f,h)=>f+h,0)/e.length,o=e.map(f=>Math.pow(f-a,2)),l=Math.sqrt(o.reduce((f,h)=>f+h,0)/e.length),c=t*(365/e.length),u=l*Math.sqrt(365),d=u>0?c/u:0;return{totalReturn:t*100,maxDrawdown:n*100,volatility:l,sharpeRatio:d,bestDay:Math.max(...e),worstDay:Math.min(...e)}}function VO(e,t,r,n){const i=t.slice(0,r+1);if(i.length<n.lookbackDays&&i.length<2)return{};const a=CL(e,i,n),o={};return a.forEach(l=>{o[l.coingeckoId]=l.finalWeight}),o}function Ok(e,t,r,n,i,a=0){if(e.length<a+2){const E=Ru([]);return{dailyReturns:[],cumulativeReturns:[],metrics:{marketCap:E,multiFactor:E,riskControlled:E,equalWeight:E},weights:{marketCap:{},multiFactor:{},riskControlled:{},equalWeight:{}}}}const o=a,l=e[o].marketCaps,c=zO(t,l,r),u={dampingAlpha:0,maxWeight:r.maxWeight,minWeight:r.minWeight},d=zO(t,l,u),f=t.filter(E=>E.coingeckoId&&l[E.coingeckoId]).map(E=>{var T,L,B;const A=l[E.coingeckoId],R=A*.05,$=parseFloat((((T=E.metrics)==null?void 0:T.mcapFdv)||"50%").replace("%",""))/100,M={"A+":95,A:85,"A-":80,"B+":75,B:65,"B-":60,"C+":55,C:45,"C-":40}[((L=E.metrics)==null?void 0:L.rating)||"B"]||65,I=((B=E.metrics)==null?void 0:B.sustainabilityScore)||50;return{ticker:E.ticker,name:E.name,category:E.category,marketCap:A,volume24h:R,mcapFdvRatio:$,rating:M,sustainabilityScore:I}}),h=_L(f,n),m={};h.forEach(E=>{const A=t.find(R=>R.ticker===E.ticker);A!=null&&A.coingeckoId&&(m[A.coingeckoId]=E.finalWeight)});const g=30;let p=VO(t,e,o,i),v=o;const x=[],y=[],b=[],S=[],j=[];for(let E=o+1;E<e.length;E++){const A=e[E-1],R=e[E];E-v>=g&&(p=VO(t,e,E-1,i),v=E);const $=xm(c,A.prices,R.prices),D=xm(m,A.prices,R.prices),M=xm(p,A.prices,R.prices),I=xm(d,A.prices,R.prices);x.push({date:R.date,returnMarketCap:$,returnMultiFactor:D,returnRiskControlled:M,returnEqualWeight:I}),y.push($),b.push(D),S.push(M),j.push(I)}const N=[];let k=100,_=100,C=100,P=100;return N.push({date:e[o].date,cumMarketCap:100,cumMultiFactor:100,cumRiskControlled:100,cumEqualWeight:100}),x.forEach(E=>{k*=1+E.returnMarketCap/100,_*=1+E.returnMultiFactor/100,C*=1+E.returnRiskControlled/100,P*=1+E.returnEqualWeight/100,N.push({date:E.date,cumMarketCap:k,cumMultiFactor:_,cumRiskControlled:C,cumEqualWeight:P})}),{dailyReturns:x,cumulativeReturns:N,metrics:{marketCap:Ru(y),multiFactor:Ru(b),riskControlled:Ru(S),equalWeight:Ru(j)},weights:{marketCap:c,multiFactor:m,riskControlled:p,equalWeight:d}}}var ky="Checkbox",[DSe,QNe]=Yr(ky),[LSe,Tk]=DSe(ky);function FSe(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:i,disabled:a,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=bi({prop:r,defaultProp:i??!1,onChange:c,caller:ky}),[g,p]=w.useState(null),[v,x]=w.useState(null),y=w.useRef(!1),b=g?!!o||!!g.closest("form"):!0,S={checked:h,disabled:a,setChecked:m,control:g,setControl:p,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:ns(i)?!1:i,isFormControl:b,bubbleInput:v,setBubbleInput:x};return s.jsx(LSe,{scope:t,...S,children:BSe(f)?f(S):n})}var EL="CheckboxTrigger",PL=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},i)=>{const{control:a,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:g}=Tk(EL,e),p=Ne(i,d),v=w.useRef(c);return w.useEffect(()=>{const x=a==null?void 0:a.form;if(x){const y=()=>f(v.current);return x.addEventListener("reset",y),()=>x.removeEventListener("reset",y)}},[a,f]),s.jsx(ce.button,{type:"button",role:"checkbox","aria-checked":ns(c)?"mixed":c,"aria-required":u,"data-state":IL(c),"data-disabled":l?"":void 0,disabled:l,value:o,...n,ref:p,onKeyDown:ne(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:ne(r,x=>{f(y=>ns(y)?!0:!y),g&&m&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});PL.displayName=EL;var $k=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:a,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return s.jsx(FSe,{__scopeCheckbox:r,checked:i,defaultChecked:a,disabled:l,required:o,onCheckedChange:u,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>s.jsxs(s.Fragment,{children:[s.jsx(PL,{...f,ref:t,__scopeCheckbox:r}),h&&s.jsx(RL,{__scopeCheckbox:r})]})})});$k.displayName=ky;var OL="CheckboxIndicator",TL=w.forwardRef((e,t)=>
575{const{__scopeCheckbox:r,forceMount:n,...i}=e,a=Tk(OL,r);return s.jsx(Xr,{present:n||ns(a.checked)||a.checked===!0,children:s.jsx(ce.span,{"data-state":IL(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});TL.displayName=OL;var $L="CheckboxBubbleInput",RL=w.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m}=Tk($L,e),g=Ne(r,m),p=Ck(a),v=Uj(n);w.useEffect(()=>{const y=h;if(!y)return;const b=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(b,"checked").set,N=!i.current;if(p!==a&&j){const k=new Event("click",{bubbles:N});y.indeterminate=ns(a),j.call(y,ns(a)?!1:a),y.dispatchEvent(k)}},[h,p,a,i]);const x=w.useRef(ns(a)?!1:a);return s.jsx(ce.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??x.current,required:l,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:g,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});RL.displayName=$L;function BSe(e){return typeof e=="function"}function ns(e){return e==="indeterminate"}function IL(e){return ns(e)?"indeterminate":e?"checked":"unchecked"}const N1=w.forwardRef(({className:e,...t},r)=>s.jsx($k,{ref:r,className:X("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(TL,{className:X("flex items-center justify-center text-current"),children:s.jsx(Kf,{className:"h-4 w-4"})})}));N1.displayName=$k.displayName;const Jt={marketCap:"hsl(221.2 83.2% 53.3%)",multiFactor:"hsl(280 70% 50%)",riskControlled:"hsl(142 71% 45%)",equalWeight:"hsl(25 95% 53%)",btc:"hsl(39 100% 50%)",sp500:"hsl(0 0% 55%)"},i0=30,HO=()=>{const{indexType:e}=vI(),t=e==="rwa"?"rwa":"dai",[r,n]=w.useState(!1),[i,a]=w.useState(!1),[o,l]=w.useState(!1),[c,u]=w.useState(null),{data:d=[],isLoading:f}=by(),{data:h=[],isLoading:m}=wy(),g=t==="dai"?f:m,p=t==="dai"?d:h,v=t==="dai"?ls:Og,x=t==="dai"?Mc:If,y=w.useMemo(()=>p.filter($=>$.coingeckoId).map($=>$.coingeckoId),[p]),{data:b,isLoading:S,error:j}=dh(y,365+i0),{data:N}=MSe(365+i0,i||o),k=w.useMemo(()=>!b||b.length===0?null:Ok(b,p,v,x,Fn,i0),[b,p,v,x]),_=w.useMemo(()=>{var B,H,z;if(!k)return[];const $=k.cumulativeReturns;if(!N&&!i&&!o)return $;const D={},M={};(B=N==null?void 0:N.btc)==null||B.forEach(q=>{D[q.date]=q.price}),(H=N==null?void 0:N.sp500)==null||H.forEach(q=>{M[q.date]=q.price});const I=(z=$[0])==null?void 0:z.date,T=D[I]||0,L=M[I]||0;return $.map(q=>({...q,...i&&T>0?{cumBTC:(D[q.date]||T)/T*100}:{},...o&&L>0?{cumSP500:(M[q.date]||L)/L*100}:{}}))},[k,N,i,o]),C=w.useMemo(()=>{const $=p.filter(D=>D.coingeckoId);return k?[...$].sort((D,M)=>{const I=k.weights.marketCap[D.coingeckoId]||0;return(k.weights.marketCap[M.coingeckoId]||0)-I}):$},[p,k]),P=r?C:C.slice(0,25),E=$=>new Date($).toLocaleDateString("en-US",{month:"short",day:"numeric"}),A=({active:$,payload:D,label:M})=>$&&D&&D.length?s.jsxs("div",{className:"bg-background border border-border rounded-lg p-3 shadow-lg",children:[s.jsx("p",{className:"font-medium text-sm mb-2",children:E(M)}),D.map((I,T)=>s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:I.color}}),s.jsxs("span",{className:"text-muted-foreground",children:[I.name,":"]}),s.jsxs("span",{className:`font-medium ${I.value>=100?"text-green-600":"text-red-600"}`,children:[I.value.toFixed(2)," (",I.value>=100?"+":"",(I.value-100).toFixed(2),"%)"]})]},T))]}):null,R=($,D,M)=>{const I={mc:$.marketCap[D],mf:$.multiFactor[D],rc:$.riskControlled[D],ew:$.equalWeight[D]},T=M?Math.max(I.mc,I.mf,I.rc,I.ew):Math.min(I.mc,I.mf,I.rc,I.ew);return I.mc===T?"mc":I.mf===T?"mf":I.rc===T?"rc":"ew"};return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Vi,{}),s.jsxs("main",{className:"container py-8",children:[s.jsxs(_e,{to:t==="dai"?"/":"/rwa",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-6 transition-colors",children:[s.jsx(fp,{className:"w-4 h-4"}),"Back to ",t==="dai"?"dAI":"RWA"," Index"]}),s.jsxs("div",{className:"mb-10",children:[s.jsxs("h1",{className:"font-serif text-4xl md:text-5xl mb-3",children:[t==="dai"?"$dAI":"RWA"," Index Performance"]}),s.jsxs("p",{className:"text-lg text-muted-foreground",children:["Compare Market Cap, Multi-Factor, Risk-Controlled, and Equal Weight strategies for the"," ",s.jsxs("span",{className:"font-semibold",children:[t==="dai"?"$dAI":"RWA"," Index"]})," ","over the past 365 days"]})]}),s.jsxs("div",{className:"grid md:grid-cols-4 gap-4 mb-8",children:[s.jsxs("div",{className:"bg-card rounded-lg border border-border p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:Jt.marketCap}}),s.jsx("h3",{className:"font-semibold text-sm",children:"Market Cap Weighted"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Weights assets by their market capitalization with dampening to reduce concentration in larger tokens."}),s.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Dampening α"}),s.jsx("span",{className:"font-mono",children:v.dampingAlpha})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Max Cap"}),s.jsxs("span",{className:"font-mono",children:[(v.maxWeight*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Min Floor"}),s.jsxs("span",{className:"font-mono",children:[(v.minWeight*100).toFixed(0),"%"]})]})]})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:Jt.multiFactor}}),s.jsx("h3",{className:"font-semibold text-sm",children:"Multi-Factor Scored"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Combines liquidity, fundamental strength, and sustainability metrics into a composite score for balanced allocation."}),s.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Liquidity"}),s.jsxs("span",{className:"font-mono",children:[(x.liquidityWeight*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Fundamental"}),s.jsxs("span",{className:"font-mono",children:[(x.fundamentalWeight*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Sustainability"}),s.jsxs("span",{className:"font-mono",children:[(x.sustainabilityWeight*100).toFixed(0),"%"]})]})]})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:Jt.riskControlled}}),s.jsx("h3",{className:"font-semibold text-sm",children:"Risk Controlled"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Allocates inversely to volatilityâlower
575-risk assets receive higher weights to stabilize portfolio performance."}),s.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Lookback"}),s.jsxs("span",{className:"font-mono",children:[Fn.lookbackDays,"d"]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Max Cap"}),s.jsxs("span",{className:"font-mono",children:[(Fn.maxWeight*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Min Floor"}),s.jsxs("span",{className:"font-mono",children:[(Fn.minWeight*100).toFixed(0),"%"]})]})]})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:Jt.equalWeight}}),s.jsx("h3",{className:"font-semibold text-sm",children:"Equal Weight"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Allocates equally across all constituents (1/N), providing a simple benchmark independent of market cap."}),s.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Strategy"}),s.jsx("span",{className:"font-mono",children:"1/N"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Max Cap"}),s.jsxs("span",{className:"font-mono",children:[(v.maxWeight*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Min Floor"}),s.jsxs("span",{className:"font-mono",children:[(v.minWeight*100).toFixed(0),"%"]})]})]})]})]}),(S||g)&&s.jsxs("div",{className:"bg-card rounded-lg border border-border p-12 flex flex-col items-center justify-center",children:[s.jsx(kr,{className:"w-8 h-8 text-primary animate-spin mb-4"}),s.jsx("h3",{className:"font-medium mb-1",children:g?"Loading Constituents":"Loading Historical Data"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:g?`Fetching ${t==="dai"?"dAI":"RWA"} constituent data...`:`Fetching 365-day market data for ${y.length} ${t==="dai"?"dAI":"RWA"} tokens...`})]}),j&&s.jsxs("div",{className:"bg-destructive/10 text-destructive rounded-lg border border-destructive/20 p-6 text-center",children:[s.jsx("h3",{className:"font-medium mb-1",children:"Failed to Load Data"}),s.jsx("p",{className:"text-sm",children:j.message})]}),k&&!S&&!g&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-card rounded-lg border border-border p-5",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"font-semibold text-sm",children:"Cumulative Performance (Starting value: 100)"}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer",children:[s.jsx(N1,{checked:i,onCheckedChange:$=>a(!!$),className:"h-3.5 w-3.5"}),s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:Jt.btc}}),"BTC"]})]}),s.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer",children:[s.jsx(N1,{checked:o,onCheckedChange:$=>l(!!$),className:"h-3.5 w-3.5"}),s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:Jt.sp500}}),"S&P 500"]})]})]})]}),s.jsx("div",{className:"h-[400px]",children:s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(jk,{data:_,margin:{top:20,right:30,left:20,bottom:20},children:[s.jsx(Vn,{strokeDasharray:"3 3",className:"stroke-border/50"}),s.jsx(fr,{dataKey:"date",tickFormatter:E,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12}}),s.jsx(hr,{tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},domain:["auto","auto"]}),s.jsx(mt,{content:s.jsx(A,{})}),s.jsx(dn,{}),s.jsx(uh,{y:100,stroke:"hsl(var(--muted-foreground))",strokeDasharray:"5 5",strokeOpacity:.5}),s.jsx(jr,{type:"monotone",dataKey:"cumMarketCap",name:"Market Cap",stroke:Jt.marketCap,strokeWidth:2,dot:!1}),s.jsx(jr,{type:"monotone",dataKey:"cumMultiFactor",name:"Multi-Factor",stroke:Jt.multiFactor,strokeWidth:2,dot:!1}),s.jsx(jr,{type:"monotone",dataKey:"cumRiskControlled",name:"Risk Controlled",stroke:Jt.riskControlled,strokeWidth:2,dot:!1}),s.jsx(jr,{type:"monotone",dataKey:"cumEqualWeight",name:"Equal Weight",stroke:Jt.equalWeight,strokeWidth:2,dot:!1}),i&&s.jsx(jr,{type:"monotone",dataKey:"cumBTC",name:"BTC",stroke:Jt.btc,strokeWidth:1.5,strokeDasharray:"6 3",dot:!1}),o&&s.jsx(jr,{type:"monotone",dataKey:"cumSP500",name:"S&P 500",
575stroke:Jt.sp500,strokeWidth:1.5,strokeDasharray:"6 3",dot:!1})]})})})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted/30",children:s.jsx("h3",{className:"font-semibold text-sm",children:"Performance Metrics Comparison"})}),s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/20",children:[s.jsx(J,{className:"text-xs",children:"Metric"}),s.jsx(J,{className:"text-xs text-center",children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:Jt.marketCap}}),"Market Cap"]})}),s.jsx(J,{className:"text-xs text-center",children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:Jt.multiFactor}}),"Multi-Factor"]})}),s.jsx(J,{className:"text-xs text-center",children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:Jt.riskControlled}}),"Risk Controlled"]})}),s.jsx(J,{className:"text-xs text-center",children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:Jt.equalWeight}}),"Equal Weight"]})})]})}),s.jsx(qt,{children:[{label:"Total Return",field:"totalReturn",format:$=>`${$>=0?"+":""}${$.toFixed(2)}%`,higher:!0},{label:"Max Drawdown",field:"maxDrawdown",format:$=>`-${$.toFixed(2)}%`,higher:!1},{label:"Volatility",field:"volatility",format:$=>`${$.toFixed(2)}%`,higher:!1},{label:"Sharpe Ratio",field:"sharpeRatio",format:$=>$.toFixed(2),higher:!0},{label:"Best Day",field:"bestDay",format:$=>`+${$.toFixed(2)}%`,higher:!0},{label:"Worst Day",field:"worstDay",format:$=>`${$.toFixed(2)}%`,higher:!1}].map(({label:$,field:D,format:M,higher:I})=>{const T=R(k.metrics,D,I);return s.jsxs(me,{children:[s.jsx(W,{className:"font-medium text-sm",children:$}),s.jsxs(W,{className:"text-center",children:[s.jsx("span",{className:`font-mono text-sm ${T==="mc"?"font-bold":""}`,children:M(k.metrics.marketCap[D])}),T==="mc"&&s.jsx(Fh,{className:"w-3 h-3 text-amber-500 inline ml-1"})]}),s.jsxs(W,{className:"text-center",children:[s.jsx("span",{className:`font-mono text-sm ${T==="mf"?"font-bold":""}`,children:M(k.metrics.multiFactor[D])}),T==="mf"&&s.jsx(Fh,{className:"w-3 h-3 text-amber-500 inline ml-1"})]}),s.jsxs(W,{className:"text-center",children:[s.jsx("span",{className:`font-mono text-sm ${T==="rc"?"font-bold":""}`,children:M(k.metrics.riskControlled[D])}),T==="rc"&&s.jsx(Fh,{className:"w-3 h-3 text-amber-500 inline ml-1"})]}),s.jsxs(W,{className:"text-center",children:[s.jsx("span",{className:`font-mono text-sm ${T==="ew"?"font-bold":""}`,children:M(k.metrics.equalWeight[D])}),T==="ew"&&s.jsx(Fh,{className:"w-3 h-3 text-amber-500 inline ml-1"})]})]},D)})})]})]}),s.jsxs("div",{className:"bg-card rounded-lg border border-border overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-sm",children:"Weight Distribution Comparison"}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Showing ",P.length," of ",C.length," constituents (sorted by Market Cap weight)"]})]}),C.length>25&&s.jsx("button",{onClick:()=>n(!r),className:"text-xs text-primary hover:underline",children:r?"Show Top 25":"Show All"})]}),s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/20",children:[s.jsx(J,{className:"text-xs",children:"Token"}),s.jsx(J,{className:"text-xs text-right",children:"Market Cap"}),s.jsx(J,{className:"text-xs text-right",children:"Multi-Factor"}),s.jsx(J,{className:"text-xs text-right",children:"Risk Controlled"}),s.jsx(J,{className:"text-xs text-right",children:"Equal Weight"})]})}),s.jsx(qt,{children:P.map($=>s.jsxs(me,{children:[s.jsx(W,{className:"font-medium text-sm cursor-pointer hover:text-primary transition-colors",onClick:()=>u({ticker:$.ticker,name:$.name,category:$.category,description:$.description,coingeckoId:$.coingeckoId}),children:$.ticker}),s.jsxs(W,{className:"text-right font-mono text-xs",children:[((k.weights.marketCap[$.coingeckoId]||0)*100).toFixed(2),"%"]}),s.jsxs(W,{className:"text-right font-mono text-xs",children:[((k.weights.multiFactor[$.coingeckoId]||0)*100).toFixed(2),"%"]}),s.jsxs(W,{className:"text-right font-mono text-xs",children:[((k.weights.riskControlled[$.coingeckoId]||0)*100).toFixed(2),"%"]}),s.jsxs(W,{className:"text-right font-mono text-xs",children:[((k.weights.equalWeight[$.coingeckoId]||0)*100).toFixed(2),"%"]})]},$.ticker))})]})]})]}),s.jsx("div",{className:"mt-8 p-4 bg-muted/30 rounded-lg border border-border",children:s.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:[s.jsx("strong",{children:"Disclaimer:"})," Past performance does not guarantee future results. This backtest uses historical market data and assumes daily rebalancing with no transaction costs."]})}),s.jsx(su,{open:c!==null,onOpenChange:$=>!$&&u(null),ticker:(c==null?void 0:c.ticker)??"",name:(c==null?void 0:c.name)??"",category:(c==null?void 0:c.category)??"N/A",description:(c==null?void 0:c.description)??"",coingeckoId:c==null?void 0:c.coingeckoId})]}),s.jsx("footer",{className:"bg-foreground text-background mt-20",children:s.jsxs("div",{className:"container py-8",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("h4",{className:"text-xs font-medium uppercase tracking-wider text-background/60 mb-3",children:"Sitemap"}),s.jsxs("nav",{className:"flex gap-6",children:[s.jsx(_e,{to:"/",className:"text-sm text-background/70 hover:text-background transition-colors",children:"dAI Index"}),s.jsx(_e,{to:"/rwa",className:"text-sm text-background/70 hover:text-background transition-colors",children:"RWA Index"}),s.jsx(_e,{to:"/backtest/dai",className:"text-sm text-background/70 hover:text-background transition-colors",children:"dAI Performance"}),s.jsx(_e,{to:"/backtest/rwa",className:"text-sm text-background/70 hover:text-background transition-colors",children:"RWA Performance"}),s.jsx(_e,{to:"/methodology",className:"text-sm text-background/70 hover:text-background transition-colors",children:"Methodology"})]})]}),s.jsxs("div",{className:"pt-4 border-t border-background/20 text-center text-sm text-background/60",children:[s.jsx("p",{children:"© 2026 Openw3b. All rights reserved."}),s.jsx("p",{className:"mt-2",children:"This index is for informational purposes only and does not constitute investment advice."})]})]})})]})},WSe=()=>s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"sticky top-0 z-50 bg-background/95 backdrop-blur-sm border-b border-border/40",children:s.jsxs("div",{className:"container flex items-center justify-between h-16",children:[s.jsx(_e,{to:"/",className:"flex items-center gap-2",children:s.jsx("span",{className:"font-serif text-xl font-medium",children:"Openw3b"})}),s.jsxs("nav",{className:"flex items-center gap-6",children:[s.jsx(_e,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"dAI Index"}),s.jsx(_e,{to:"/rwa",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"RWA Index"}),s.jsx(_e,{to:"/backtest",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Backtest"})]})]})}),s.jsxs("main",{className:"container py-12",children:[s.jsxs("div",{className:"mb-12 animate-fade-in-up",children:[s.jsx("h1",{className:"font-serif text-4xl md:text-5xl mb-4",children:"Index Methodology"}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-3xl",children:"A comprehensive guide to understanding how Openw3b indices calculate token weights. This page breaks down each methodology into simple steps with clear explanations of every component."})]}),s.jsxs(ze,{className:"mb-10",children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-xl",children:"How Index Weighting Works"})}),s.jsxs(xt,{className:"space-y-4 text-sm text-muted-foreground",children:[s.jsxs("p",{children:[s.jsx("strong",{className:"text-foreground",children:"What is index weighting?"}),` When you invest in an index, you're buying a basket of different assets. The "weight" of each asset determines what percentage of your investment goes to that asset. For example, if Token A has a 20% weight, then 20 cents of every dollar invested goes to Token A.`]}),s.jsx("p",{children:"Openw3b offers three different methodologies for calculating these weights, each with its own approach to balancing risk, liquidity, and opportunity. All methodologies apply the same constraints (caps and floors) to ensure diversification."})]})]}),s.jsxs("section",{className:"mb-12",children:[s.jsx("h2",{className:"section-title",children:"1. Dampened Market-Cap Weighting"}),s.jsxs(ze,{className:"mb-6",children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"Overview"})}),s.jsx(xt,{className:"text-sm text-muted-foreground",children:s.jsx("p",{children:`This method assigns weight based on each token's market size, with a special adjustment (called "dampening") to prevent the largest tokens from dominating the entire index. Think of it like a progressive tax: the bigger you are, the more your weight gets reduced proportionally.`})})]}),s.jsxs(ze,{className:"mb-6",children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"The Formula"})}),s.jsxs(xt,{children:[s.jsx("div",{className:"bg-muted/30 rounded-lg p-6 mb-6 text-center",children:s.jsxs("p",{className:"font-mono text-lg md:text-xl",children:["w",s.jsx("sub",{children:"i"})," = MCap",s.jsx("sub",{children:"i"}),s.jsx("sup",{children:"α"})," / Σ MCap",s.jsx("sub",{children:"j"}),s.jsx("sup",{children:"α"})]})}),s.jsx("h4",{className:"font-medium mb-3",children:"Component Legend"}),s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{children:[s.jsx(J,{className:"w-24",children:"Symbol"}),s.jsx(J,{children:"Meaning"}),s.jsx(J,{children:"Example"})]})}),s.jsxs(qt,{children:[s.jsxs(me,{children:[s.jsxs(W,{className:"font-mono",children:["w",s.jsx("sub",{children:"i"})]}),s.jsx(W,{children:"The final weight assigned to token i"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"Token A gets 15% weight"})]}),s.jsxs(me,{children:[s.jsxs(W,{className:"font-mono",children:["MCap",s.jsx("sub",{children:"i"})]}),s.jsx(W,{children:"Market capitalization (price à circulating supply) of token i"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"$2.5 billion market cap"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-mono",children:"α (alpha)"}),s.jsx(W,{children:"Dampening factor - a number between 0 and 1 that reduces concentration. Lower values = more equal weights"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"Default: 0.75"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-mono",children:"Σ"}),s.jsx(W,{children:"Sum of all tokens in the index"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"Add up all 10 tokens"})]})]})]})]})]}),s.jsxs(ze,{children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"Step-by-Step Process"})}),s.jsx(xt,{children:s.jsxs("ol",{className:"space-y-4 text-sm",children:[s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Gather Market Caps"}),s.jsx("p",{className:"text-muted-foreground",children:"Collect the current circulating market cap for each token in the index"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Apply Dampening"}),s.jsx("p",{className:"text-muted-foreground",children:"Raise each market cap to the power of alph
575a (0.75). This reduces the gap between large and small tokens."}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono",children:"Example: $10B^0.75 = $177M (dampened value)"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"3"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Sum All Dampened Values"}),s.jsx("p",{className:"text-muted-foreground",children:"Add up all the dampened market caps to get the total"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"4"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Calculate Raw Weight"}),s.jsx("p",{className:"text-muted-foreground",children:"Divide each token's dampened value by the total to get its percentage weight"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"5"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Apply Caps & Floors"}),s.jsx("p",{className:"text-muted-foreground",children:"Ensure no token exceeds the maximum (25%) or falls below the minimum (1%)"})]})]})]})})]})]}),s.jsxs("section",{className:"mb-12",children:[s.jsx("h2",{className:"section-title",children:"2. Multi-Factor Composite Scoring"}),s.jsxs(ze,{className:"mb-6",children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"Overview"})}),s.jsx(xt,{className:"text-sm text-muted-foreground",children:s.jsx("p",{children:'Instead of relying solely on market size, this method combines multiple quality indicators into a single "composite score." It rewards tokens that are liquid, fundamentally sound, and economically sustainable. Think of it as a report card with three subjects.'})})]}),s.jsxs(ze,{className:"mb-6",children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"The Formula"})}),s.jsxs(xt,{children:[s.jsx("div",{className:"bg-muted/30 rounded-lg p-6 mb-6 text-center",children:s.jsx("p",{className:"font-mono text-lg md:text-xl",children:"Score = 40% Ã L + 30% Ã F + 30% Ã S"})}),s.jsx("h4",{className:"font-medium mb-3",children:"Factor Breakdown"}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3 mb-6",children:[s.jsxs("div",{className:"p-4 bg-muted/20 rounded-lg",children:[s.jsx("p",{className:"font-mono text-primary font-medium mb-2",children:"L = Liquidity Score"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Measures how easily you can buy/sell. Calculated from 24-hour trading volume relative to market cap. Higher turnover = better liquidity = higher score."})]}),s.jsxs("div",{className:"p-4 bg-muted/20 rounded-lg",children:[s.jsx("p",{className:"font-mono text-primary font-medium mb-2",children:"F = Fundamental Score"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Evaluates token economics. Looks at the ratio of circulating supply to total supply (less dilution = better) and the project's quality rating."})]}),s.jsxs("div",{className:"p-4 bg-muted/20 rounded-lg",children:[s.jsx("p",{className:"font-mono text-primary font-medium mb-2",children:"S = Sustainability Score"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Manual assessment of long-term viability. Considers team track record, tokenomics design, ecosystem growth, and revenue model."})]})]}),s.jsx("h4",{className:"font-medium mb-3",children:"Component Legend"}),s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{children:[s.jsx(J,{className:"w-32",children:"Component"}),s.jsx(J,{children:"Formula / Meaning"}),s.jsx(J,{children:"Range"})]})}),s.jsxs(qt,{children:[s.jsxs(me,{children:[s.jsx(W,{className:"font-mono",children:"L (Liquidity)"}),s.jsx(W,{children:"(24h Volume / Market Cap) Ã 20, capped at 100"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"0
575- 100"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-mono",children:"F (Fundamental)"}),s.jsx(W,{children:"(MCap/FDV Ratio à 50) + (Rating Score à 50)"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"0 - 100"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-mono",children:"S (Sustainability)"}),s.jsx(W,{children:"Manual score based on qualitative analysis"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"0 - 100"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-mono",children:"MCap/FDV"}),s.jsx(W,{children:"Circulating Market Cap ÷ Fully Diluted Valuation. Higher = less future dilution"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"0 - 1"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-mono",children:"Rating"}),s.jsx(W,{children:"Letter grade (A+ to D) converted to numeric score"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"A+=100, B=70, C=50, D=30"})]})]})]})]})]}),s.jsxs(ze,{children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"Step-by-Step Process"})}),s.jsx(xt,{children:s.jsxs("ol",{className:"space-y-4 text-sm",children:[s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Calculate Liquidity Score"}),s.jsx("p",{className:"text-muted-foreground",children:"For each token, divide 24h volume by market cap, multiply by 20, and cap at 100"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Calculate Fundamental Score"}),s.jsx("p",{className:"text-muted-foreground",children:"Combine the MCap/FDV ratio score with the quality rating score"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"3"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Apply Sustainability Score"}),s.jsx("p",{className:"text-muted-foreground",children:"Use the pre-assigned sustainability score from qualitative research"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"4"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Compute Composite Score"}),s.jsx("p",{className:"text-muted-foreground",children:"Combine: (40% à L) + (30% à F) + (30% à S)"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"5"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Convert to Weights"}),s.jsx("p",{className:"text-muted-foreground",children:"Divide each token's composite score by the sum of all scores"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"6"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Apply Caps & Floors"}),s.jsx("p",{className:"text-muted-foreground",children:"Ensure no token exceeds 25% or falls below 1%"})]})]})]})})]})]}),s.jsxs("section",{className:"mb-12",children:[s.jsx("h2",{className:"section-title",children:"3. Inverse Volatility (Risk Controlled)"}),s.jsxs(ze,{className:"mb-6",children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"Overview"})}),s.jsx(xt,{className:"text-sm text-muted-foreground",children:s.jsx("p",{children:"This method prioritizes stability by giving higher weights to tokens with lower price volatility. If a token's price swings wildly up and down, it gets a smaller weight. If it's stable, it gets more. The result is a portfolio designed to have smoother overall returns."})})]}),s.jsxs(ze,{className:"mb-6",children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"The Formula"})}),s.jsxs(xt,{children:[s.jsx("div",{className:"bg-muted/30 rounded-lg p-6 mb-6 text-center",children:s.jsxs("p",{className:"font-mono text-lg md:text-xl",children:["w",s.jsx("sub",{children:"i"})," = (1/Ï",s.jsx("sub",{children:"i"}),") / Σ(1/Ï",s.jsx("sub",{children:"j"}),")"]})}),s.jsx("h4",{className:"font-medium mb-3",children:"Component Legend"}),s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{children:[s.jsx(J,{className:"w-24",children:"Symbol"}),s.jsx(J,{children:"Meaning"}),s.jsx(J,{children:"Example"})]})}),s.jsxs(qt,{children:[s.jsxs(me,{children:[s.jsxs(W,{className:"font-mono",children:["w",s.jsx("sub",{children:"i"})]}),s.jsx(W,{children:"The final weight assigned to token i"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"Token A gets 12% weight"})]}),s.jsxs(me,{children:[s.jsxs(W,{className:"font-mono",children:["Ï",s.jsx("sub",{children:"i"})," (sigma)"]}),s.jsx(W,{children:"Volatility - the standard deviation of daily returns over the lookback period"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"5% daily volatility"})]}),s.jsxs(me,{children:[s.jsxs(W,{className:"font-mono",children:["1/Ï",s.jsx("sub",{children:"i"})]}),s.jsx(W,{children:"Inverse volatility - lower volatility tokens get higher values"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"1/0.05 = 20"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-mono",children:"Σ"}),s.jsx(W,{children:"Sum of all inverse volatilities across the index"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"Add up all 10 tokens"})]})]})]}),s.jsxs("div",{className:"mt-6 p-4 bg-muted/20 rounded-lg",children:[s.jsx("h4",{className:"font-medium mb-2",children:"Understanding Volatility (Ï)"}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Volatility measures how much a token's price moves up and down. It's calculated as the standard deviation of daily percentage changes."}),s.jsxs("div",{className:"bg-muted/30 rounded p-3 font-mono text-xs",children:[s.jsx("p",{className:"mb-1",children:"Daily Return = (Today's Price - Yesterday's Price) / Yesterday's Price"}),s.jsx("p",{children:"Volatility (Ï) = Standard Deviation of Daily Returns over 30 days"})]})]})]})]}),s.jsxs(ze,{children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"Step-by-Step Process"})}),s.jsx(xt,{children:s.jsxs("ol",{className:"space-y-4 text-sm",children:[s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Collect Historical Price
575s"}),s.jsx("p",{className:"text-muted-foreground",children:"Get the last 30 days of daily closing prices for each token"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Calculate Daily Returns"}),s.jsx("p",{className:"text-muted-foreground",children:"For each day: (Today's Price - Yesterday's Price) ÷ Yesterday's Price"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"3"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Compute Volatility"}),s.jsx("p",{className:"text-muted-foreground",children:"Calculate the standard deviation of all the daily returns (this is Ï)"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"4"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Calculate Inverse Volatility"}),s.jsx("p",{className:"text-muted-foreground",children:"For each token: 1 ÷ Ï. Lower volatility = higher number"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"5"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Sum All Inverse Volatilities"}),s.jsx("p",{className:"text-muted-foreground",children:"Add up all the inverse volatility values"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"6"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Calculate Raw Weight"}),s.jsx("p",{className:"text-muted-foreground",children:"Each token's weight = its inverse volatility ÷ total of all inverse volatilities"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-medium",children:"7"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Apply Caps & Floors"}),s.jsx("p",{className:"text-muted-foreground",children:"Ensure no token exceeds 25% or falls below 1%"})]})]})]})})]})]}),s.jsxs("section",{className:"mb-12",children:[s.jsx("h2",{className:"section-title",children:"Weight Constraints"}),s.jsxs(ze,{children:[s.jsx(Wt,{children:s.jsx(Ut,{className:"font-serif text-lg",children:"Caps & Floors"})}),s.jsxs(xt,{children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"All three methodologies apply the same constraints to ensure diversification and prevent any single token from dominating the index."}),s.jsxs(Vt,{className:"mb-6",children:[s.jsx(Ht,{children:s.jsxs(me,{children:[s.jsx(J,{children:"Constraint"}),s.jsx(J,{children:"dAI Index"}),s.jsx(J,{children:"RWA Index"}),s.jsx(J,{children:"Purpose"})]})}),s.jsxs(qt,{children:[s.jsxs(me,{children:[s.jsx(W,{className:"font-medium",children:"Maximum Cap"}),s.jsx(W,{children:"25%"}),s.jsx(W,{children:"20%"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"Prevents single-token dominance"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-medium",children:"Minimum Floor"}),s.jsx(W,{children:"1%"}),s.jsx(W,{children:"1%"}),s.jsx(W,{className:"text-muted-foreground text-xs",children:"Ensures all constituents have meaningful exposure"})]})]})]}),s.jsxs("div",{className:"p-4 bg-muted/20 rounded-lg",children:[s.jsx("h4",{className:"font-medium mb-2",children:"How Redistribution Works"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"When a token's calculated weight exceeds the maximum cap, the excess weight is redistributed proportionally among all tokens that are still below the cap. This process repeats iteratively until all weights fall within the allowed range. Similarly, tokens below the minimum floor are bumped up, with the added weight taken proportionally from tokens above the floor."})]})]})]})]}),s.jsxs("section",{className:"mb-12",children:[s.jsx("h2",{className:"section-title",children:"Methodology Comparison"}),s.jsx(ze,{children:s.jsx(xt,{className:"pt-6",children:s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{children:[s.jsx(J,{children:"Aspect"}),s.jsx(J,{children:"Market-Cap"}),s.jsx(J,{children:"Multi-Factor"}),s.jsx(J,{children:"Risk Controlled"})]})}),s.jsxs(qt,{children:[s.jsxs(me,{children:[s.jsx(W,{className:"font-medium",children:"Primary Signal"}),s.jsx(W,{children:"Market size"}),s.jsx(W,{children:"Quality indicators"}),s.jsx(W,{children:"Price stability"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-medium",children:"Best For"}),s.jsx(W,{children:"Tracking the market"}),s.jsx(W,{children:"Quality-focused investing"}),s.jsx(W,{children:"Risk-averse portfolios"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-medium",children:"Updates"}),s.jsx(W,{children:"Real-time (market data)"}),s.jsx(W,{children:"Real-time + periodic research"}),s.jsx(W,{children:"Daily (30-day lookback)"})]}),s.jsxs(me,{children:[s.jsx(W,{className:"font-medium",children:"Complexity"}),s.jsx(W,{children:"Simple"}),s.jsx(W,{children:"Moderate"}),s.jsx(W,{children:"Moderate"})]})]})]})})})]})]}),s.jsx("footer",{className:"bg-foreground text-background mt-20",children:s.jsxs("div",{className:"container py-8",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("h4",{className:"text-xs font-medium uppercase tracking-wider text-background/60 mb-3",children:"Sitemap"}),s.jsxs("nav",{className:"flex gap-6",children:[s.jsx(_e,{to:"/",className:"text-sm text-background/70 hover:text-background transition-colors",children:"dAI Index"}),s.jsx(_e,{to:"/rwa",className:"text-sm text-background/70 hover:text-background transition-colors",children:"RWA Index"}),s.jsx(_e,{to:"/backtest",className:"text-sm text-background/70 hover:text-background transition-colors",children:"Backtest"}),s.jsx(_e,{to:"/methodology",className:"text-sm text-background/70 hover:text-background transition-colors",children:"Methodology"})]})]}),s.jsxs("div",{className:"pt-4 border-t border-background/20 text-center text-sm text-background/60",children:[s.jsx("p",{children:"© 2026 Openw3b. All rights reserved."}),s.jsx("p",{className:"mt-2",children:"This index is for informational purposes only and does not constitute investment advice."})]})]})})]}),USe=Gf("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),fh=w.forwardRef(({className:e,variant:t,...r},n)=>s.jsx("div",{ref:n,role:"alert",className:X(USe({variant:t}),e),...r}));fh.displayName="Alert";const zSe=w.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:X("mb-1 font-medium leading-none tracking-tight",e),...t}));
575zSe.displayName="AlertTitle";const hh=w.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:X("text-sm [&_p]:leading-relaxed",e),...t}));hh.displayName="AlertDescription";const Hn=w.forwardRef(({className:e,type:t,...r},n)=>s.jsx("input",{type:t,className:X("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));Hn.displayName="Input";function VSe({onLogin:e,isLoading:t,error:r}){const[n,i]=w.useState(""),[a,o]=w.useState(!1),l=async c=>{c.preventDefault(),n.trim()&&await e(n)};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsxs(ze,{className:"w-full max-w-md",children:[s.jsxs(Wt,{className:"text-center",children:[s.jsx("div",{className:"mx-auto mb-4 h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx(Tj,{className:"h-6 w-6 text-primary"})}),s.jsx(Ut,{className:"text-2xl",children:"Admin Access"}),s.jsx(q5,{children:"Enter the admin password to access the candidate screening dashboard."})]}),s.jsx(xt,{children:s.jsxs("form",{onSubmit:l,className:"space-y-4",children:[r&&s.jsxs(fh,{variant:"destructive",children:[s.jsx(Za,{className:"h-4 w-4"}),s.jsx(hh,{children:r})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Hn,{type:a?"text":"password",placeholder:"Enter admin password",value:n,onChange:c=>i(c.target.value),className:"pr-10",autoFocus:!0}),s.jsx("button",{type:"button",onClick:()=>o(!a),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:a?s.jsx(nR,{className:"h-4 w-4"}):s.jsx(iR,{className:"h-4 w-4"})})]}),s.jsx(pe,{type:"submit",className:"w-full",disabled:t||!n.trim(),children:t?"Verifying...":"Access Dashboard"})]})})]})})}function HSe(e){return e>=1e12?`$${(e/1e12).toFixed(2)}T`:e>=1e9?`$${(e/1e9).toFixed(2)}B`:e>=1e6?`$${(e/1e6).toFixed(2)}M`:`$${e.toLocaleString()}`}function qO({title:e,categoryType:t,stats:r,isLoading:n,onRefreshStats:i}){const a=((r==null?void 0:r.avgChange24h)??0)>=0;return s.jsxs(ze,{className:"relative overflow-hidden",children:[s.jsx("div",{className:`absolute inset-0 opacity-5 ${t==="ai"?"bg-gradient-to-br from-blue-500 to-purple-500":"bg-gradient-to-br from-emerald-500 to-teal-500"}`}),s.jsx(Wt,{className:"relative pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ut,{className:"text-lg font-semibold",children:e}),s.jsx(pe,{variant:"ghost",size:"icon",onClick:i,disabled:n,children:s.jsx($j,{className:`h-4 w-4 ${n?"animate-spin":""}`})})]})}),s.jsx(xt,{className:"relative space-y-4",children:r?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(eR,{className:"h-3 w-3"})," Total Market Cap"]}),s.jsx("p",{className:"text-xl font-bold",children:HSe(r.totalMarketCap)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(hp,{className:"h-3 w-3"})," 24h Change"]}),s.jsxs("p",{className:`text-xl font-bold flex items-center gap-1 ${a?"text-green-500":"text-red-500"}`,children:[a?s.jsx(wi,{className:"h-4 w-4"}):s.jsx(rv,{className:"h-4 w-4"}),r.avgChange24h.toFixed(2),"%"]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Categories Tracked"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:r.categories.map(o=>o.name).join(", ")})]})]}):s.jsx("div",{className:"py-8 text-center text-muted-foreground",children:n?s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx(kr,{className:"h-8 w-8 animate-spin"}
vendor: 18,994 bytes, line 575
575),s.jsx("p",{children:"Loading category data..."})]}):s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("p",{children:"No data available"}),s.jsx(pe,{variant:"outline",size:"sm",onClick:i,children:"Load Stats"})]})})})]})}var qSe="Label",ML=w.forwardRef((e,t)=>s.jsx(ce.label,{...e,ref:t,onMouseDown:r=>{var i;r.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));ML.displayName=qSe;var DL=ML;const GSe=Gf("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Oa=w.forwardRef(({className:e,...t},r)=>s.jsx(DL,{ref:r,className:X(GSe(),e),...t}));Oa.displayName=DL.displayName;var KSe=[" ","Enter","ArrowUp","ArrowDown"],YSe=[" ","Enter"],jo="Select",[Ny,_y,XSe]=Jg(jo),[lu,JNe]=Yr(jo,[XSe,sv]),Cy=sv(),[QSe,xs]=lu(jo),[JSe,ZSe]=lu(jo),LL=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:g}=e,p=Cy(t),[v,x]=w.useState(null),[y,b]=w.useState(null),[S,j]=w.useState(!1),N=eh(u),[k,_]=bi({prop:n,defaultProp:i??!1,onChange:a,caller:jo}),[C,P]=bi({prop:o,defaultProp:l,onChange:c,caller:jo}),E=w.useRef(null),A=v?g||!!v.closest("form"):!0,[R,$]=w.useState(new Set),D=Array.from(R).map(M=>M.props.value).join(";");return s.jsx(BR,{...p,children:s.jsxs(QSe,{required:m,scope:t,trigger:v,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:j,contentId:pi(),value:C,onValueChange:P,open:k,onOpenChange:_,dir:N,triggerPointerDownPosRef:E,disabled:h,children:[s.jsx(Ny.Provider,{scope:t,children:s.jsx(JSe,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(M=>{$(I=>new Set(I).add(M))},[]),onNativeOptionRemove:w.useCallback(M=>{$(I=>{const T=new Set(I);return T.delete(M),T})},[]),children:r})}),A?s.jsxs(lF,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:C,onChange:M=>P(M.target.value),disabled:h,form:g,children:[C===void 0?s.jsx("option",{value:""}):null,Array.from(R)]},D):null]})})};LL.displayName=jo;var FL="SelectTrigger",BL=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,a=Cy(r),o=xs(FL,r),l=o.disabled||n,c=Ne(t,o.onTriggerChange),u=_y(r),d=w.useRef("touch"),[f,h,m]=uF(p=>{const v=u().filter(b=>!b.disabled),x=v.find(b=>b.value===o.value),y=dF(v,p,x);y!==void 0&&o.onValueChange(y.value)}),g=p=>{l||(o.onOpenChange(!0),m()),p&&(o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return s.jsx(WR,{asChild:!0,...a,children:s.jsx(ce.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":cF(o.value)?"":void 0,...i,ref:c,onClick:ne(i.onClick,p=>{p.currentTarget.focus(),d.current!=="mouse"&&g(p)}),onPointerDown:ne(i.onPointerDown,p=>{d.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(g(p),p.preventDefault())}),onKeyDown:ne(i.onKeyDown,p=>{const v=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(v&&p.key===" ")&&KSe.includes(p.key)&&(g(),p.preventDefault())})})})});BL.displayName=FL;var WL="SelectValue",UL=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:a,placeholder:o="",...l}=e,c=xs(WL,r),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=Ne(t,c.onValueNodeChange);return Pt(()=>{u(d)},[u,d]),s.jsx(ce.span,{...l,ref:f,style:{pointerEvents:"none"},children:cF(c.value)?s.jsx(s.Fragment,{children:o}):a})});UL.displayName=WL;var eke="SelectIcon",zL=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return s.jsx(ce.span,{"aria-hidden":!0,...i,ref:t,children:n||"â¼"})});zL.displayName=eke;var tke="SelectPortal",VL=e=>s.jsx(Zg,{asChild:!0,...e});VL.displayName=tke;var So="SelectContent",HL=w.forwardRef((e,t)=>{const r=xs(So,e.__scopeSelect),[n,i]=w.useState();if(Pt(()=>{i(new DocumentFragment)},[]),!r.open){const a=n;return a?_o.createPortal(s.jsx(qL,{scope:e.__scopeSelect,children:s.jsx(Ny.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),a):null}return s.jsx(GL,{...e,ref:t})});HL.displayName=So;var En=10,[qL,bs]=lu(So),rke="SelectContentImpl",nke=nc("SelectContent.RemoveScroll"),GL=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:p,avoidCollisions:v,...x}=e,y=xs(So,r),[b,S]=w.useState(null),[j,N]=w.useState(null),k=Ne(t,Q=>S(Q)),[_,C]=w.useState(null),[P,E]=w.useState(null),A=_y(r),[R,$]=w.useState(!1),D=w.useRef(!1);w.useEffect(()=>{if(b)return QI(b)},[b]),zI();const M=w.useCallback(Q=>{const[je,...G]=A().map(U=>U.ref.current),[ee]=G.slice(-1),Z=document.activeElement;for(const U of Q)if(U===Z||(U==null||U.scrollIntoView({block:"nearest"}),U===je&&j&&(j.scrollTop=0),U===ee&&j&&(j.scrollTop=j.scrollHeight),U==null||U.focus(),document.activeElement!==Z))return},[A,j]),I=w.useCallback(()=>M([_,b]),[M,_,b]);w.useEffect(()=>{R&&I()},[R,I]);const{onOpenChange:T,triggerPointerDownPosRef:L}=y;w.useEffect(()=>{if(b){let Q={x:0,y:0};const je=ee=>{var Z,U;Q={x:Math.abs(Math.round(ee.pageX)-(((Z=L.current)==null?void 0:Z.x)??0)),y:Math.abs(Math.round(ee.pageY)-(((U=L.current)==null?void 0:U.y)??0))}},G=ee=>{Q.x<=10&&Q.y<=10?ee.preventDefault():b.contains(ee.target)||T(!1),document.removeEventListener("pointermove",je),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",je),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",je),document.removeEventListener("pointerup",G,{capture:!0})}}},[b,T,L]),w.useEffect(()=>{const Q=()=>T(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[T]);const[B,H]=uF(Q=>{const je=A().filter(Z=>!Z.disabled),G=je.find(Z=>Z.ref.current===document.activeElement),ee=dF(je,Q,G);ee&&setTimeout(()=>ee.ref.current.focus())}),z=w.useCallback((Q,je,G)=>{const ee=!D.current&&!G;(y.value!==void 0&&y.value===je||ee)&&(C(Q),ee&&(D.current=!0))},[y.value]),q=w.useCallback(()=>b==null?void 0:b.focus(),[b]),te=w.useCallback((Q,je,G)=>{const ee=!D.current&&!G;(y.value!==void 0&&y.value===je||ee)&&E(Q)},[y.value]),ve=n==="popper"?_1:KL,Pe=ve===_1?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:p,avoidCollisions:v}:{};return s.jsx(qL,{scope:r,content:b,viewport:j,onViewportChange:N,itemRefCallback:z,selectedItem:_,onItemLeave:q,itemTextRefCallback:te,focusSelectedItem:I,selectedItemText:P,position:n,isPositioned:R,searchRef:B,children:s.jsx(tS,{as:nke,allowPinchZoom:!0,children:s.jsx(eS,{asChild:!0,trapped:y.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:ne(i,Q=>{var je;(je=y.trigger)==null||je.focus({preventScroll:!0}),Q.preventDefault()}),children:s.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:s.jsx(ve,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:Q=>Q.preventDefault(),...x,...Pe,onPlaced:()=>$(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ne(x.onKeyDown,Q=>{const je=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!je&&Q.key.length===1&&H(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let ee=A().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Z=Q.target,U=ee.indexOf(Z);ee=ee.slice(U+1)}setTimeout(()=>M(ee)),Q.preventDefault()}})})})})})})});GL.displayName=rke;var ike="SelectItemAlignedPosition",KL=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,a=xs(So,r),o=bs(So,r),[l,c]=w.useState(null),[u,d]=w.useState(null),f=Ne(t,k=>d(k)),h=_y(r),m=w.useRef(!1),g=w.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:x,focusSelectedItem:y}=o,b=w.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&v&&x){const k=a.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),C=a.valueNode.getBoundingClientRect(),P=x.getBoundingClientRect();if(a.dir!=="rtl"){const Z=P.left-_.left,U=C.left-Z,Ce=k.left-U,ye=k.width+Ce,He=Math.max(ye,_.width),We=window.innerWidth-En,ct=Qd(U,[En,Math.max(En,We-He)]);l.style.minWidth=ye+"px",l.style.left=ct+"px"}else{const Z=_.right-P.right,U=window.innerWidth-C.right-Z,Ce=window.innerWidth-k.right-U,ye=k.width+Ce,He=Math.max(ye,_.width),We=window.innerWidth-En,ct=Qd(U,[En,Math.max(En,We-He)]);l.style.minWidth=ye+"px",l.style.right=ct+"px"}const E=h(),A=window.innerHeight-En*2,R=p.scrollHeight,$=window.getComputedStyle(u),D=parseInt($.borderTopWidth,10),M=parseInt($.paddingTop,10),I=parseInt($.borderBottomWidth,10),T=parseInt($.paddingBottom,10),L=D+M+R+T+I,B=Math.min(v.offsetHeight*5,L),H=window.getComputedStyle(p),z=parseInt(H.paddingTop,10),q=parseInt(H.paddingBottom,10),te=k.top+k.height/2-En,ve=A-te,Pe=v.offsetHeight/2,Q=v.offsetTop+Pe,je=D+M+Q,G=L-je;if(je<=te){const Z=E.length>0&&v===E[E.length-1].ref.current;l.style.bottom="0px";const U=u.clientHeight-p.offsetTop-p.offsetHeight,Ce=Math.max(ve,Pe+(Z?q:0)+U+I),ye=je+Ce;l.style.height=ye+"px"}else{const Z=E.length>0&&v===E[0].ref.current;l.style.top="0px";const Ce=Math.max(te,D+p.offsetTop+(Z?z:0)+Pe)+G;l.style.height=Ce+"px",p.scrollTop=je-te+p.offsetTop}l.style.margin=`${En}px 0`,l.style.minHeight=B+"px",l.style.maxHeight=A+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[h,a.trigger,a.valueNode,l,u,p,v,x,a.dir,n]);Pt(()=>b(),[b]);const[S,j]=w.useState();Pt(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const N=w.useCallback(k=>{k&&g.current===!0&&(b(),y==null||y(),g.current=!1)},[b,y]);return s.jsx(ske,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:s.jsx(ce.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});KL.displayName=ike;var ake="SelectPopperPosition",_1=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=En,...a}=e,o=Cy(r);return s.jsx(UR,{...o,...a,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_1.displayName=ake;var[ske,Rk]=lu(So,{}),C1="SelectViewport",YL=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,a=bs(C1,r),o=Rk(C1,r),l=Ne(t,a.onViewportChange),c=w.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),s.jsx(Ny.Slot,{scope:r,children:s.jsx(ce.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ne(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const g=window.innerHeight-En*2,p=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),x=Math.max(p,v);if(x<g){const y=x+m,b=Math.min(g,y),S=y-b;f.style.height=b+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});YL.displayName=C1;var XL="SelectGroup",[oke,lke]=lu(XL),cke=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=pi();return s.jsx(oke,{scope:r,id:i,children:s.jsx(ce.div,{role:"group","aria-labelledby":i,...n,ref:t})})});cke.displayName=XL;var QL="SelectLabel",JL=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=lke(QL,r);return s.jsx(ce.div,{id:i.id,...n,ref:t})});JL.displayName=QL;var Rg="SelectItem",[uke,ZL]=lu(Rg),eF=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:a,...o}=e,l=xs(Rg,r),c=bs(Rg,r),u=l.value===n,[d,f]=w.useState(a??""),[h,m]=w.useState(!1),g=Ne(t,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,n,i)}),p=pi(),v=w.useRef("touch"),x=()=>{i||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(uke,{scope:r,value:n,disabled:i,textId:p,isSelected:u,onItemTextChange:w.useCallback(y=>{f(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:s.jsx(Ny.ItemSlot,{scope:r,value:n,disabled:i,textValue:d,children:s.jsx(ce.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:ne(o.onFocus,()=>m(!0)),onBlur:ne(o.onBlur,()=>m(!1)),onClick:ne(o.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:ne(o.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:ne(o.onPointerDown,y=>{v.current=y.pointerType}),onPointerMove:ne(o.onPointerMove,y=>{var b;v.current=y.pointerType,i?(b=c.onItemLeave)==null||b.call(c):v.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ne(o.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:ne(o.onKeyDown,y=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&y.key===" "||(YSe.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});eF.displayName=Rg;var Gu="SelectItemText",tF=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...a}=e,o=xs(Gu,r),l=bs(Gu,r),c=ZL(Gu,r),u=ZSe(Gu,r),[d,f]=w.useState(null),h=Ne(t,x=>f(x),c.onItemTextChange,x=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,x,c.value,c.disabled)}),m=d==null?void 0:d.textContent,g=w.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return Pt(()=>(p(g),()=>v(g)),[p,v,g]),s.jsxs(s.Fragment,{children:[s.jsx(ce.span,{id:c.textId,...a,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?_o.createPortal(a.children,o.valueNode):null]})});tF.displayName=Gu;var rF="SelectItemIndicator",nF=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return ZL(rF,r).isSelected?s.jsx(ce.span,{"aria-hidden":!0,...n,ref:t}):null});nF.displayName=rF;var A1="SelectScrollUpButton",iF=w.forwardRef((e,t)=>{const r=bs(A1,e.__scopeSelect),n=Rk(A1,e.__scopeSelect),[i,a]=w.useState(!1),o=Ne(t,n.onScrollButtonChange);return Pt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),i?s.jsx(sF,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});iF.displayName=A1;var E1="SelectScrollDownButton",aF=w.forwardRef((e,t)=>{const r=bs(E1,e.__scopeSelect),n=Rk(E1,e.__scopeSelect),[i,a]=w.useState(!1),o=Ne(t,n.onScrollButtonChange);return Pt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;a(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),i?s.jsx(sF,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});aF.displayName=E1;var sF=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,a=bs("SelectScrollButton",r),o=w.useRef(null),l=_y(r),c=w.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return w.useEffect(()=>()=>c(),[c]),Pt(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),s.jsx(ce.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ne(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ne(i.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ne(i.onPointerLeave,()=>{c()})})}),dke="SelectSeparator",oF=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return s.jsx(ce.div,{"aria-hidden":!0,...n,ref:t})});oF.displayName=dke;var P1="SelectArrow",fke=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Cy(r),a=xs(P1,r),o=bs(P1,r);return a.open&&o.position==="popper"?s.jsx(zR,{...i,...n,ref:t}):null});fke.displayName=P1;var hke="SelectBubbleInput",lF=w.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const i=w.useRef(null),a=Ne(n,i),o=Ck(t);return w.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[o,t]),s.jsx(ce.select,{...r,style:{...E$,...r.style},ref:a,defaultValue:t})});lF.displayName=hke;function cF(e){return e===""||e===void 0}function uF(e){const t=Ct(e),r=w.useRef(""),n=w.useRef(0),i=w.useCallback(o=>{const l=r.current+o;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=w.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,a]}function dF(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let o=mke(e,Math.max(a,0));i.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function mke(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var pke=LL,fF=BL,gke=UL,vke=zL,yke=VL,hF=HL,xke=YL,mF=JL,pF=eF,bke=tF,wke=nF,gF=iF,vF=aF,yF=oF;const Iu=pke,Mu=gke,il=w.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(fF,{ref:n,className:X("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
575ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,s.jsx(vke,{asChild:!0,children:s.jsx(dr,{className:"h-4 w-4 opacity-50"})})]}));il.displayName=fF.displayName;const xF=w.forwardRef(({className:e,...t},r)=>s.jsx(gF,{ref:r,className:X("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(mi,{className:"h-4 w-4"})}));xF.displayName=gF.displayName;const bF=w.forwardRef(({className:e,...t},r)=>s.jsx(vF,{ref:r,className:X("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(dr,{className:"h-4 w-4"})}));bF.displayName=vF.displayName;const al=w.forwardRef(({className:e,children:t,position:r="popper",...n},i)=>s.jsx(yke,{children:s.jsxs(hF,{ref:i,className:X("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[s.jsx(xF,{}),s.jsx(xke,{className:X("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(bF,{})]})}));al.displayName=hF.displayName;const jke=w.forwardRef(({className:e,...t},r)=>s.jsx(mF,{ref:r,className:X("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));jke.displayName=mF.displayName;const sl=w.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(pF,{ref:n,className:X("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(wke,{children:s.jsx(Kf,{className:"h-4 w-4"})})}),s.jsx(bke,{children:t})]}));
575sl.displayName=pF.displayName;const Ske=w.forwardRef(({className:e,...t},r)=>s.jsx(yF,{ref:r,className:X("-mx-1 my-1 h-px bg-muted",e),...t}));Ske.displayName=yF.displayName;const GO={minFdv:0,minAge:0,minMcapFdvRatio:0,minVolume:0,maxDrawdown:0},kke=[{value:0,label:"Any"},{value:1e7,label:">$10M"},{value:25e6,label:">$25M"},{value:5e7,label:">$50M"},{value:1e8,label:">$100M"},{value:25e7,label:">$250M"},{value:5e8,label:">$500M"}],Nke=[{value:0,label:"Any"},{value:3,label:">3 months"},{value:6,label:">6 months"},{value:12,label:">12 months"},{value:24,label:">24 months"}],_ke=[{value:0,label:"Any"},{value:10,label:">10%"},{value:20,label:">20%"},{value:30,label:">30%"},{value:50,label:">50%"},{value:70,label:">70%"}],Cke=[{value:0,label:"Any"},{value:1e5,label:">$100K"},{value:5e5,label:">$500K"},{value:1e6,label:">$1M"},{value:5e6,label:">$5M"},{value:1e7,label:">$10M"}],Ake=[{value:0,label:"Any"},{value:-50,label:"<-50% from ATH"},{value:-70,label:"<-70% from ATH"},{value:-80,label:"<-80% from ATH"},{value:-90,label:"<-90% from ATH"},{value:-95,label:"<-95% from ATH"}],Eke=e=>e.minFdv>0||e.minAge>0||e.minMcapFdvRatio>0||e.minVolume>0||e.maxDrawdown<0;function Pke({filters:e,onChange:t,onReload:r,isLoading:n,totalFiltered:i,totalAll:a}){const[o,l]=w.useState(e);w.useEffect(()=>{l(e)},[e]);const c=(f,h)=>{const m={...o,[f]:h};l(m),t(m)},u=()=>{l(GO),t(GO)},d=Eke(o);return s.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(u8,{className:"h-4 w-4"}),"Filters",d&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i," of ",a," tokens)"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[d&&s.jsxs(pe,{variant:"ghost",size:"sm",onClick:u,children:[s.jsx(Yf,{className:"h-3 w-3 mr-1"}),"Clear"]}),s.jsxs(pe,{variant:"ghost",size:"sm",onClick:r,disabled:n,children:[s.jsx(Bc,{className:`h-3 w-3 mr-1 ${n?"animate-spin":""}`}),"Reload"]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oa,{className:"text-xs text-muted-foreground",children:"Min FDV"}),s.jsxs(Iu,{value:o.minFdv.toString(),onValueChange:f=>c("minFdv",parseInt(f)),children:[s.jsx(il,{className:"h-9",children:s.jsx(Mu,{})}),s.jsx(al,{children:kke.map(f=>s.jsx(sl,{value:f.value.toString(),children:f.label},f.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oa,{className:"text-xs text-muted-foreground",children:"Token Age"}),s.jsxs(Iu,{value:o.minAge.toString(),onValueChange:f=>c("minAge",parseInt(f)),children:[s.jsx(il,{className:"h-9",children:s.jsx(Mu,{})}),s.jsx(al,{children:Nke.map(f=>s.jsx(sl,{value:f.value.toString(),children:f.label},f.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oa,{className:"text-xs text-muted-foreground",children:"MCap/FDV Ratio"}),s.jsxs(Iu,{value:o.minMcapFdvRatio.toString(),onValueChange:f=>c("minMcapFdvRatio",parseInt(f)),children:[s.jsx(il,{className:"h-9",children:s.jsx(Mu,{})}),s.jsx(al,{children:_ke.map(f=>s.jsx(sl,{value:f.value.toString(),children:f.label},f.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oa,{className:"text-xs text-muted-foreground",children:"24h Volume"}),s.jsxs(Iu,{value:o.minVolume.toString(),onValueChange:f=>c("minVolume",parseInt(f)),children:[s.jsx(il,{className:"h-9",children:s.jsx(Mu,{})}),s.jsx(al,{children:Cke.map(f=>s.jsx(sl,{value:f.value.toString(),children:f.label},f.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oa,{className:"text-xs text-muted-foreground",children:"Max Drawdown (ATH)"}),s.jsxs(Iu,{value:o.maxDrawdown.toString(),onValueChange:f=>c("maxDrawdown",parseInt(f)),children:[s.jsx(il,{className:"h-9",children:s.jsx(Mu,{})}),s.jsx(al,{children:Ake.map(f=>s.jsx(sl,{value:f.value.toString(),children:f.label},f.value))})]})]})]})]})}const Ik=w.forwardRef(({className:e,...t},r)=>s.jsx("textarea",{className:X("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
575ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Ik.displayName="Textarea";const wF=({className:e,...t})=>s.jsx("nav",{role:"navigation","aria-label":"pagination",className:X("mx-auto flex w-full justify-center",e),...t});wF.displayName="Pagination";const jF=w.forwardRef(({className:e,...t},r)=>s.jsx("ul",{ref:r,className:X("flex flex-row items-center gap-1",e),...t}));jF.displayName="PaginationContent";const Ku=w.forwardRef(({className:e,...t},r)=>s.jsx("li",{ref:r,className:X("",e),...t}));Ku.displayName="PaginationItem";const Ay=({className:e,isActive:t,size:r="icon",...n})=>s.jsx("a",{"aria-current":t?"page":void 0,className:X(WI({variant:t?"outline":"ghost",size:r}),e),...n});Ay.displayName="PaginationLink";const SF=({className:e,...t})=>s.jsxs(Ay,{"aria-label":"Go to previous page",size:"default",className:X("gap-1 pl-2.5",e),...t,children:[s.jsx(J$,{className:"h-4 w-4"}),s.jsx("span",{children:"Previous"})]});SF.displayName="PaginationPrevious";const kF=({className:e,...t})=>s.jsxs(Ay,{"aria-label":"Go to next page",size:"default",className:X("gap-1 pr-2.5",e),...t,children:[s.jsx("span",{children:"Next"}),s.jsx(mp,{className:"h-4 w-4"})]});kF.displayName="PaginationNext";const NF=({className:e,...t})=>s.jsxs("span",{"aria-hidden":!0,className:X("flex h-9 w-9 items-center justify-center",e),...t,children:[s.jsx(c8,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"More pages"})]});NF.displayName="PaginationEllipsis";function Du(e){return e>=1e12?`$${(e/1e12).toFixed(2)}T`:e>=1e9?`$${(e/1e9).toFixed(2)}B`:e>=1e6?`$${(e/1e6).toFixed(2)}M`:e>=1e3?`$${(e/1e3).toFixed(2)}K`:`$${e.toFixed(2)}`}function Oke(e){return e==null?"â":`${e>=0?"+":""}${e.toFixed(2)}%`}function Tke(e){if(!e.trim())return!0;const t=e.trim().replace(/\/+$/,"");return!!(/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/.test(t)||/^https?:\/\/(www\.)?github\.com\/[a-zA-Z0-9_.-]+(\/[a-zA-Z0-9_.-]+)?$/.test(t))}function $ke(e){if(!e.trim())return!0;const t=e.trim().replace(/^@/,"");return/^[a-zA-Z0-9_]{1,15}$/.test(t)}function Rke(e,t){if(t<=7)return Array.from({length:t},(n,i)=>i+1);const r=[];if(e<=4){for(let n=1;n<=5;n++)r.push(n);r.push("ellipsis",t)}else if(e>
575=t-3){r.push(1,"ellipsis");for(let n=t-4;n<=t;n++)r.push(n)}else r.push(1,"ellipsis",e-1,e,e+1,"ellipsis",t);return r}function Ike({candidates:e,isScanning:t,activeCategory:r,password:n,onAddToIndex:i,page:a,totalPages:o,totalFiltered:l,totalAll:c,onPageChange:u}){const[d,f]=w.useState(null),[h,m]=w.useState(""),[g,p]=w.useState(""),[v,x]=w.useState(""),[y,b]=w.useState(!1),[S,j]=w.useState(!1);w.useEffect(()=>{if(!d||!n)return;let A=!1;return j(!0),XK(n,d.id).then(R=>{A||(R.twitterHandle&&p(R.twitterHandle),R.githubRepo&&x(R.githubRepo))}).catch(()=>{}).finally(()=>{A||j(!1)}),()=>{A=!0}},[d,n]);const N=A=>{f(A),m(`${A.name} is a decentralized protocol in the ${A.category} category.`),p(""),x("")},k=v.trim()&&!Tke(v)?"Must be owner/repo or https://github.com/owner/repo":null,_=g.trim()&&!$ke(g)?"Must be a valid handle (letters, numbers, underscores, max 15 chars)":null,C=!!k||!!_,P=async()=>{if(!d||C)return;b(!0);const A=await i(d,h,{twitterHandle:g.trim()||void 0,githubRepo:v.trim()||void 0});b(!1),A&&(f(null),m(""),p(""),x(""))};if(t)return s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[s.jsx(kr,{className:"h-8 w-8 animate-spin mb-4"}),s.jsx("p",{children:"Loading tokens from CoinGecko..."}),s.jsx("p",{className:"text-xs",children:"This may take a moment"})]});if(e.length===0&&c===0)return s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[s.jsx(Za,{className:"h-8 w-8 mb-4"}),s.jsx("p",{className:"font-medium",children:"No tokens found"}),s.jsx("p",{className:"text-xs",children:"Try reloading from CoinGecko"})]});if(e.length===0&&c>0)return s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[s.jsx(Za,{className:"h-8 w-8 mb-4"}),s.jsx("p",{className:"font-medium",children:"No tokens match current filters"}),s.jsx("p",{className:"text-xs",children:"Try relaxing the filter criteria"})]});const E=(a-1)*25;return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-lg border overflow-hidden",children:s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/50",children:[s.jsx(J,{className:"w-[50px]",children:"#"}),s.jsx(J,{children:"Token"}),s.jsx(J,{className:"text-right",children:"Market Cap"}),s.jsx(J,{className:"text-right",children:"FDV"}),s.jsx(J,{className:"text-right",children:"MCap/FDV"}),s.jsx(J,{className:"text-right",children:"24h Vol"}),s.jsx(J,{className:"text-right",children:"24h"}),s.jsx(J,{className:"text-right",children:"Age"}),s.jsx(J,{className:"w-[100px]"})]})}),s.jsx(qt,{children:e.map((A,R)=>s.jsxs(me,{className:A.inIndex?"opacity-60":"",children:[s.jsx(W,{className:"font-mono text-xs text-muted-foreground",children:E+R+1}),s.jsx(W,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[A.image&&s.jsx("img",{src:A.image,alt:A.name,className:"h-8 w-8 rounded-full"}),s.jsxs("div",{children:[s.jsxs("div",{className:"font-medium flex items-center gap-2",children:[A.name,A.inIndex&&s.jsxs(Me,{variant:"outline",className:"text-xs gap-1",children:[s.jsx(Kf,{className:"h-3 w-3"}),"In Index"]})]}),s.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[A.symbol,s.jsx("a",{href:`https://www.coingecko.com/en/coins/${A.id}`,target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground",children:s.jsx(Pj,{className:"h-3 w-3"})})]})]})]})}),s.jsx(W,{className:"text-right font-mono",children:Du(A.marketCap)}),s.jsx(W,{className:"text-right font-mono",children:Du(A.fdv)}),s.jsx(W,{className:"text-right",children:s.jsxs(Me,{variant:A.mcapFdvRatio>=50?"default":A.mcapFdvRatio>=30?"secondary":"outline",children:[A.mcapFdvRatio.toFixed(0),"%"]})}),s.jsx(W,{className:"text-right font-mono text-sm",children:Du(A.volume24h)}),s.jsx(W,{className:"text-right",children:s.jsxs("span",{className:`flex items-center justify-end gap-1 ${(A.priceChange24h??0)>=0?"text-green-500":"text-red-500"}`,children:[(A.priceChange24h??0)>=0?s.jsx(wi,{className:"h-3 w-3"}):s.jsx(rv,{className:"h-3 w-3"}),Oke(A.priceChange24h)]})}),s.jsx(W,{className:"text-right",children:s.jsxs("span",{className:"flex items-center justify-end gap-1 text-muted-foreground text-sm",children:[s.jsx(ib,{className:"h-3 w-3"}),A.ageInMonths,"mo"]})}),s.jsx(W,{children:A.inIndex?s.jsx(Me,{variant:"secondary",className:"text-xs",children:"Added"}):s.jsxs(pe,{size:"sm",onClick:()=>N(A),children:[s.jsx(sc,{className:"h-4 w-4 mr-1"}),"Add"]})})]},A.id))})]})}),o>1&&s.jsx(wF,{className:"mt-4",children:s.jsxs(jF,{children:[s.jsx(Ku,{children:s.jsx(SF,{onClick:()=>u(Math.max(1,a-1)),className:a<=1?"pointer-events-none opacity-50":"cursor-pointer"})}),Rke(a,o).map((A,R)=>A==="ellipsis"?s.jsx(Ku,{children:s.jsx(NF,{})},`e-${R}`):s.jsx(Ku,{children:s.jsx(Ay,{isActive:A===a,onClick:()=>u(A),className:"cursor-pointer",children:A})},A)),s.jsx(Ku,{children:s.jsx(kF,{onClick:()=>u(Math.min(o,a+1)),className:a>=o?"pointer-events-none opacity-50":"cursor-pointer"})})]})}),s.jsx(aS,{open:!!d,onOpenChange:()=>f(null),children:s.jsxs(yv,{children:[s.jsxs(xv,{children:[s.jsxs(bv,{children:["Add to ",d==null?void 0:d.targetIndex," Index"]}),s.jsxs(oS,{children:["You're about to add ",d==null?void 0:d.name,"
575(",d==null?void 0:d.symbol,") to the ",d==null?void 0:d.targetIndex," index."]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"FDV:"})," ",s.jsx("span",{className:"font-mono",children:Du((d==null?void 0:d.fdv)||0)})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"MCap/FDV:"})," ",s.jsxs("span",{children:[d==null?void 0:d.mcapFdvRatio.toFixed(1),"%"]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Volume:"})," ",s.jsx("span",{className:"font-mono",children:Du((d==null?void 0:d.volume24h)||0)})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Age:"})," ",s.jsxs("span",{children:[d==null?void 0:d.ageInMonths," months"]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Description"}),s.jsx(Ik,{value:h,onChange:A=>m(A.target.value),placeholder:"Enter a description for this constituent...",rows:3})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-sm font-medium flex items-center gap-2",children:[s.jsx(y8,{className:"h-4 w-4"}),"Twitter Handle"]}),s.jsxs("div",{className:"relative",children:[s.jsx(Hn,{value:g,onChange:A=>p(A.target.value),placeholder:S?"Loading...":"e.g. @projectname",disabled:S,className:_?"border-destructive":""}),S&&s.jsx(kr,{className:"h-4 w-4 animate-spin absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground"})]}),_&&s.jsx("p",{className:"text-xs text-destructive",children:_})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-sm font-medium flex items-center gap-2",children:[s.jsx(f8,{className:"h-4 w-4"}),"GitHub Repository"]}),s.jsxs("div",{className:"relative",children:[s.jsx(Hn,{value:v,onChange:A=>x(A.target.value),placeholder:S?"Loading...":"e.g. owner/repo or https://github.com/owner/repo",disabled:S,className:k?"border-destructive":""}),S&&s.jsx(kr,{className:"h-4 w-4 animate-spin absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground"})]}),k&&s.jsx("p",{className:"text-xs text-destructive",children:k})]}),s.jsxs(fh,{children:[s.jsx(Za,{className:"h-4 w-4"}),s.jsx(hh,{children:"This will immediately add the token to the public-facing index."})]})]}),s.jsxs(sS,{children:[s.jsx(pe,{variant:"outline",onClick:()=>f(null),children:"Cancel"}),s.jsx(pe,{onClick:P,disabled:y||!h.trim()||C||S,children:y?s.jsxs(s.Fragment,{children:[s.jsx(kr,{className:"h-4 w-4 mr-2 animate-spin"}),"Adding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(sc,{className:"h-4 w-4 mr-2"}),"Add to ",d==null?void 0:d.targetIndex]})})]})]})})]})}function Mke({daiConstituents:e,rwaConstituents:t,password:r,onRemove:n}){const[i,a]=w.useState(null),[o,l]=w.useState(!1),c=async()=>{if(i){l(!0);try{await KK(r,i.indexType,i.ticker),n()}catch(f){console.error("Failed to remove constituent:",f)}finally{l(!1),a(null)}}},u=e.filter(f=>f.is_active),d=t.filter(f=>f.is_active);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[s.jsxs(ze,{children:[s.jsx(Wt,{className:"pb-3",children:s.jsxs(Ut,{className:"text-lg flex items-center gap-2",children:[s.jsx(ob,{className:"h-5 w-5"}),"dAI Index",s.jsx(Me,{variant:"secondary",className:"ml-auto",children:u.length})]})}),s.jsx(xt,{children:s.jsx("div",{className:"space-y-2",children:u.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No constituents in dAI index"}):u.map(f=>s.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md hover:bg-muted/50 group",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:f.ticker}),s.jsx("span",{className:"text-muted-foreground ml-2 text-sm",children:f.name}),s.jsx(Me,{variant:"outline",className:"ml-2 text-xs",children:f.category})]}),s.jsx(pe,{variant:"ghost",size:"icon",className:"opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>a({ticker:f.ticker,indexType:"dai",name:f.name}
575),children:s.jsx(ad,{className:"h-4 w-4"})})]},f.id))})})]}),s.jsxs(ze,{children:[s.jsx(Wt,{className:"pb-3",children:s.jsxs(Ut,{className:"text-lg flex items-center gap-2",children:[s.jsx(ob,{className:"h-5 w-5"}),"RWA Index",s.jsx(Me,{variant:"secondary",className:"ml-auto",children:d.length})]})}),s.jsx(xt,{children:s.jsx("div",{className:"space-y-2",children:d.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No constituents in RWA index"}):d.map(f=>s.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md hover:bg-muted/50 group",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:f.ticker}),s.jsx("span",{className:"text-muted-foreground ml-2 text-sm",children:f.name}),s.jsx(Me,{variant:"outline",className:"ml-2 text-xs",children:f.category})]}),s.jsx(pe,{variant:"ghost",size:"icon",className:"opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>a({ticker:f.ticker,indexType:"rwa",name:f.name}
575),children:s.jsx(ad,{className:"h-4 w-4"})})]},f.id))})})]})]}),s.jsx(aS,{open:!!i,onOpenChange:()=>a(null),children:s.jsxs(yv,{children:[s.jsxs(xv,{children:[s.jsx(bv,{children:"Remove Constituent"}),s.jsxs(oS,{children:["Are you sure you want to remove ",s.jsx("strong",{children:i==null?void 0:i.name})," (",i==null?void 0:i.ticker,") from the ",(i==null?void 0:i.indexType)==="dai"?"dAI":"RWA"," index?"]})]}),s.jsxs("div",{className:"flex items-start gap-3 p-3 bg-muted rounded-lg",children:[s.jsx(Za,{className:"h-5 w-5 text-amber-500 mt-0.5"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This will mark the constituent as inactive. It won't be deleted from the database, but will no longer appear in the public index."})]}),s.jsxs(sS,{children:[s.jsx(pe,{variant:"outline",onClick:()=>a(null),children:"Cancel"}),s.jsx(pe,{variant:"destructive",onClick:c,disabled:o,children:o?s.jsxs(s.Fragment,{children:[s.jsx(kr,{className:"h-4 w-4 mr-2 animate-spin"}),"Removing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ad,{className:"h-4 w-4 mr-2"}),"Remove"]})})]})]})})]})}function Dke({password:e,categoryType:t,tokens:r,currentConstituents:n,onAddToIndex:i}){const[a,o]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(null),[f,h]=w.useState(null),[m,g]=w.useState(new Set),[p,v]=w.useState(new Set),x=async()=>{c(!0),h(null);try{const j=await JK(e,t,r,n);d(j),o(!0),g(new Set)}catch(j){h(j instanceof Error?j.message:"Analysis failed")}finally{c(!1)}},y=async j=>{const N=r.find(C=>C.id===j.coingeckoId);if(!N)return;v(C=>new Set(C).add(j.coingeckoId));const k={id:N.id,symbol:N.symbol,name:N.name,image:N.image,currentPrice:N.currentPrice,marketCap:N.marketCap,fdv:N.fdv,volume24h:N.volume24h,mcapFdvRatio:N.mcapFdvRatio,priceChange24h:N.priceChange24h,priceChange7d:N.priceChange7d,priceChange30d:N.priceChange30d,athDrawdownPct:N.athDrawdownPct??null,ageInMonths:N.ageInMonths,marketCapRank:N.marketCapRank,category:j.suggestedCategory||N.category,targetIndex:t==="ai"?"dAI":"RWA"};await i(k,j.reasoning)&&g(C=>new Set(C).add(j.coingeckoId)),v(C=>{const P=new Set(C);return P.delete(j.coingeckoId),P})},b=(u==null?void 0:u.recommendations.filter(j=>!m.has(j.coingeckoId)))||[],S=j=>j>=80?"text-emerald-400":j>=65?"text-amber-400":"text-red-400";return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(pe,{onClick:x,disabled:l||r.length===0,variant:"outline",className:"gap-2 border-primary/30 hover:border-primary/60",children:[l?s.jsx(kr,{className:"h-4 w-4 animate-spin"}):s.jsx(c_,{className:"h-4 w-4 text-primary"}),l?`Analyzing ${r.length} tokens...`:"AI Recommend"]}),f&&s.jsx("span",{className:"text-sm text-destructive",children:f})]}),u&&b.length>0&&s.jsx(ia,{open:a,onOpenChange:o,children:s.jsxs(ze,{className:"border-primary/20 bg-card/50",children:[s.jsx(aa,{asChild:!0,children:s.jsx(Wt,{className:"cursor-pointer py-3 px-4",children:s.jsxs(Ut,{className:"text-sm font-medium flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(c_,{className:"h-4 w-4 text-primary"}),"AI Recommendations (",b.length,")"]}),a?s.jsx(mi,{className:"h-4 w-4"}):s.jsx(dr,{className:"h-4 w-4"})]})})}),s.jsx(sa,{children:s.jsxs(xt,{className:"pt-0 space-y-4",children:[u.summary&&s.jsx("p",{className:"text-sm text-muted-foreground border-l-2 border-primary/30 pl-3",children:u.summary}),u.indexGaps&&s.jsxs("p",{className:"text-xs text-muted-foreground italic",children:[s.jsx("strong",{children:"Gaps:"})," ",u.indexGaps]}),s.jsx("div",{className:"grid gap-3",children:b.map((j,N)=>s.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-background/50 hover:bg-background/80 transition-colors",children:[s.jsxs("div",{className:"flex flex-col items-center min-w-[40px]",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["#",N+1]}),s.jsx("span",{className:`text-lg font-bold ${S(j.score)}`,children:j.score})]}),s.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-semibold text-sm",children:j.symbol}),s.jsx("span",{className:"text-xs text-muted-foreground truncate",children:j.name}),s.jsx(Me,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:j.suggestedCategory})]}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:j.reasoning}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[j.strengths.map(k=>s.jsxs(Me,{variant:"secondary",className:"text-[10px] gap-1 px-1.5 py-0",children:[s.jsx(wi,{className:"h-2.5 w-2.5"}),k]},k)),j.risks.map(k=>s.jsxs(Me,{variant:"destructive",className:"text-[10px] gap-1 px-1.5 py-0 bg-destructive/10 text-destructive",children:[s.jsx(Fs,{className:"h-2.5 w-2.5"}),k]},k))]})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(pe,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",disabled:p.has(j.coingeckoId),onClick:()=>y(j),children:[p.has(j.coingeckoId)?s.jsx(kr,{className:"h-3 w-3 animate-spin"}):s.jsx(sc,{className:"h-3 w-3"}),"Add"]}),s.jsx(pe,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>g(k=>new Set(k).add(j.coingeckoId)),children:s.jsx(Yf,{className:"h-3 w-3"})})]})]},j.coingeckoId))})]})})]})})]})}function Lke({password:e}){const[t,r]=w.useState(!1),[n,i]=w.useState(!1),[a,o]=w.useState(!1),[l,c]=w.useState(null),[u,d]=w.useState(null),f=async()=>{i(!0);try{const{data:m,error:g}=await hs.from("index_methodology").select("*");if(g)throw g;const p=m;c(p.find(v=>v.index_type==="dai")||null),d(p.find(v=>v.index_type==="rwa")||null)}catch{cx.error("Failed to load methodology data")}finally{i(!1)}};w.useEffect(()=>{t&&!l&&!u&&f()},[t]);const h=async m=>{o(!0);try{await ZK(e,m.id,m.criteria,m.constraints,m.index_description),cx.success(`${m.index_type.toUpperCase()} methodology updated`)}catch{cx.error("Failed to save")}finally{o(!1)}};return s.jsxs(ia,{open:t,onOpenChange:r,children:[s.jsx(aa,{asChild:!0,children:s.jsxs(pe,{variant:"ghost",className:"w-full justify-start gap-2 text-lg font-semibold p-0 h-auto hover:bg-transparent",children:[t?s.jsx(dr,{className:"h-5 w-5"}):s.jsx(mp,{className:"h-5 w-5"}),"Methodology Editor"]})}),s.jsx(sa,{className:"mt-4 space-y-6",children:n?s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(kr,{className:"h-4 w-4 animate-spin"})," Loading..."]}):s.jsxs(s.Fragment,{children:[l&&s.jsx(KO,{data:l,onChange:c,onSave:h,isSaving:a,label:"dAI Index"}),u&&s.jsx(KO,{data:u,onChange:d,onSave:h,isSaving:a,label:"RWA Index"})]})})]})}function KO({data:e,onChange:t,onSave:r,isSaving:n,label:i}){const a=(f,h)=>{const m=[...e.criteria];m[f]=h,t({...e,criteria:m})},o=()=>t({...e,criteria:[...e.criteria,""]}),l=f=>t({...e,criteria:e.criteria.filter((h,m)=>m!==f)}),c=(f,h,m)=>{const g=[...e.constraints];g[f]={...g[f],[h]:m},t({...e,constraints:g})},u=()=>t({...e,constraints:[...e.constraints,{label:"",text:""}]}),d=f=>t({...e,constraints:e.constraints.filter((h,m)=>m!==f)});return s.jsxs("div",{className:"border rounded-lg p-4 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"font-semibold",children:i}),s.jsxs(pe,{size:"sm",onClick:()=>r(e),disabled:n,children:[n?s.jsx(kr,{className:"h-4 w-4 animate-spin mr-1"}):s.jsx(p8,{className:"h-4 w-4 mr-1"}),"Save"]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium",children:"Description"}),s.jsx(Ik,{value:e.index_description,onChange:f=>t({...e,index_description:f.target.value}),className:"mt-1",rows:2})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Criteria for Inclusion"}),s.jsxs(pe,{variant:"ghost",size:"sm",onClick:o,children:[s.jsx(sc,{className:"h-3 w-3 mr-1"}),"Add"]})]}),s.jsx("div",{className:"space-y-2",children:e.criteria.map((f,h)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Hn,{value:f,onChange:m=>a(h,m.target.value),className:"flex-1"}),s.jsx(pe,{variant:"ghost",size:"icon",onClick:()=>
575l(h),children:s.jsx(ad,{className:"h-3 w-3"})})]},h))})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Constraints"}),s.jsxs(pe,{variant:"ghost",size:"sm",onClick:u,children:[s.jsx(sc,{className:"h-3 w-3 mr-1"}),"Add"]})]}),s.jsx("div",{className:"space-y-2",children:e.constraints.map((f,h)=>s.jsxs("div",{className:"flex gap-2 items-start",children:[s.jsx(Hn,{value:f.label,onChange:m=>c(h,"label",m.target.value),placeholder:"Label",className:"w-32"}),s.jsx(Hn,{value:f.text,onChange:m=>c(h,"text",m.target.value),placeholder:"Constraint text",className:"flex-1"}),s.jsx(pe,{variant:"ghost",size:"icon",onClick:()=>d(h),children:s.jsx(ad,{className:"h-3 w-3"})})]},h))})]})]})}const Lu="admin_password";function _F(){const[e,t]=w.useState(!1),[r,n]=w.useState(!1),[i,a]=w.useState(null),[o,l]=w.useState(null);w.useEffect(()=>{const d=sessionStorage.getItem(Lu);d&&(n(!0),_C(d).then(f=>{f!=null&&f.valid?(t(!0),l(d)):sessionStorage.removeItem(Lu)}).catch(()=>{sessionStorage.removeItem(Lu)}).finally(()=>{n(!1)}))},[]);const c=w.useCallback(async d=>{n(!0),a(null);try{const f=await _C(d);return f!=null&&f.valid?(t(!0),l(d),sessionStorage.setItem(Lu,d),!0):(a("Invalid password"),!1)}catch(f){const h=f instanceof Error?f.message:"Failed to verify password";return a(h),!1}finally{n(!1)}},[]),u=w.useCallback(()=>{t(!1),l(null),a(null),sessionStorage.removeItem(Lu)},[]);return{isAuthenticated:e,isLoading:r,error:i,storedPassword:o,verifyPassword:c,logout:u}}const a0=25;function Fke(e,t,r){var g,p;const n=uv(),[i,a]=w.useState(1),o=gn({queryKey:["admin-browse",t],queryFn:async()=>e?QK(e,t):{tokens:[],totalCount:0,fetchedAt:""},enabled:!!e,staleTime:10*60*1e3,refetchOnWindowFocus:!1}),l=((g=o.data)==null?void 0:g.tokens)||[],c=w.useMemo(()=>l.filter(v=>!(v.fdv<r.minFdv||v.volume24h<r.minVolume||v.mcapFdvRatio<r.minMcapFdvRatio||v.ageInMonths<r.minAge||r.maxDrawdown<0&&v.athDrawdownPct!=null&&v.athDrawdownPct<r.maxDrawdown)),[l,r]),u=Math.max(1,Math.ceil(c.length/a0)),d=Math.min(i,u),f=w.useMemo(()=>{const v=(d-1)*a0;return c.slice(v,v+a0)},[c,d]),h=w.useCallback(v=>{a(Math.max(1,v))},[]),m=w.useCallback(v=>{n.setQueryData(["admin-browse",t],x=>x&&{...x,tokens:x.tokens.map(y=>y.id===v?{...y,inIndex:!0}:y)})},[n,t]);return{tokens:f,allTokens:l,totalFiltered:c.length,totalAll:l.length,page:d,totalPages:u,setPage:h,isLoading:o.isLoading||o.isFetching,error:o.error?o.error.message:null,fetchedAt:((p=o.data)==null?void 0:p.fetchedAt)||"",refetch:o.refetch,removeToken:m,resetPage:()=>a(1)}}function Bke(e){const[t,r]=w.useState(null),n=uv(),i=w.useCallback(async c=>{if(e)try{const u=await HK(e,c);if(u!=null&&u.error)throw new Error(u.error);return u}catch(u){const d=u instanceof Error?u.message:"Failed to fetch category stats";return r(d),null}},[e]),a=w.useCallback(async(c,u)=>{if(!e)return[];try{const d=await qK(e,c,u);if(d!=null&&d.error)throw new Error(d.error);return n.setQueryData(["admin-candidates",c],{candidates:d.candidates||[],filters:d.filters,scannedAt:d.scannedAt}),d.candidates||[]}catch(d){const f=d instanceof Error?d.message:"Failed to scan for candidates";return r(f),[]}},[e,n]),o=w.useCallback(async(c,u,d)=>{if(!e)return!1;try{const f=await GK(e,c.targetIndex,{ticker:c.symbol,name:c.name,description:u,coingeckoId:c.id,category:c.category,rating:"N/A",twitterHandle:d==null?void 0:d.twitterHandle,githubRepo:d==null?void 0:d.githubRepo});if(f!=null&&f.error)throw new Error(f.error);return!0}catch(f){const h=f instanceof Error?f.message:"Failed to add constituent";return r(h),!1}},[e]),l=w.useCallback(()=>r(null),[]);return{error:t,fetchCategoryStats:i,forceRescan:a,addToIndex:o,clearError:l}}const Wke={minFdv:0,minAge:0,minMcapFdvRatio:0,minVolume:0,maxDrawdown:0};function Uke(){const e=uv(),[t,r]=Z9(),{isAuthenticated:n,isLoading:i,error:a,storedPassword:o,verifyPassword:l,logout:c}=_F(),u=t.get("candidate"),[d,f]=w.useState(u==="rwa"?"rwa":"ai"),[h,m]=w.useState(Wke),g=Fke(o,d,h),{error:p,fetchCategoryStats:v,addToIndex:x,clearError:y}=Bke(o),{data:b=[],refetch:S}=$O(o,"dai"),{data:j=[],refetch:N}=$O(o,"rwa"),[k,_]=w.useState(null),[C,P]=w.useState(null),[E,A]=w.useState(!1),R=g.error||p;w.useEffect(()=>{n&&o&&$()},[n,o]),w.useEffect(()=>
575{t.get("candidate")!==d&&r({candidate:d},{replace:!0})},[d]),w.useEffect(()=>{g.resetPage()},[h]);const $=async()=>{if(o){A(!0);try{const[T,L]=await Promise.all([v("ai"),v("rwa")]);_(T),P(L)}finally{A(!1)}}},D=T=>{m(T)},M=async(T,L,B)=>{const H=await x(T,L,B);return H&&(g.removeToken(T.id),T.targetIndex==="dAI"?(S(),e.invalidateQueries({queryKey:["dai-constituents"]})):(N(),e.invalidateQueries({queryKey:["rwa-constituents"]}))),H},I=()=>{S(),N(),e.invalidateQueries({queryKey:["dai-constituents"]}),e.invalidateQueries({queryKey:["rwa-constituents"]})};return n?s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"border-b bg-card",children:s.jsxs("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(_e,{to:"/",className:"text-xl font-bold",children:"Openw3b"}),s.jsx("span",{className:"text-muted-foreground",children:"/"}),s.jsx("span",{className:"text-lg font-semibold",children:"Admin Dashboard"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(pe,{variant:"ghost",size:"sm",onClick:$,disabled:E,children:[s.jsx($j,{className:`h-4 w-4 mr-2 ${E?"animate-spin":""}`}),"Refresh"]}),s.jsxs(pe,{variant:"outline",size:"sm",onClick:c,children:[s.jsx(h8,{className:"h-4 w-4 mr-2"}),"Logout"]})]})]})}),s.jsxs("main",{className:"container mx-auto px-4 py-8 space-y-8",children:[R&&s.jsxs(fh,{variant:"destructive",children:[s.jsx(Za,{className:"h-4 w-4"}),s.jsxs(hh,{className:"flex items-center justify-between",children:[R,s.jsx(pe,{variant:"ghost",size:"sm",onClick:y,children:"Dismiss"})]})]}),s.jsxs("section",{children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Sector Overview"}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[s.jsx(qO,{title:"AI Sector",categoryType:"ai",stats:k,isLoading:E,onRefreshStats:()=>v("ai").then(_)}),s.jsx(qO,{title:"RWA Sector",categoryType:"rwa",stats:C,isLoading:E,onRefreshStats:()=>v("rwa").then(P)})]})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Category Browser"}),s.jsx(hS,{value:d,onValueChange:T=>f(T),children:s.jsxs(kv,{children:[s.jsxs(Hi,{value:"ai",className:"gap-2",children:[s.jsx(o8,{className:"h-4 w-4"}),"AI Tokens"]}),s.jsxs(Hi,{value:"rwa",className:"gap-2",children:[s.jsx(Oj,{className:"h-4 w-4"}),"RWA Tokens"]})]})})]}),s.jsx(Pke,{filters:h,onChange:D,onReload:()=>g.refetch(),isLoading:g.isLoading,totalFiltered:g.totalFiltered,totalAll:g.totalAll}),s.jsx(Dke,{password:o||"",categoryType:d,tokens:g.allTokens,currentConstituents:d==="ai"?b.map(T=>T.ticker):j.map(T=>T.ticker),onAddToIndex:M}),s.jsx("div",{className:"text-sm text-muted-foreground",children:g.totalAll>0&&s.jsxs("span",{children:["Showing ",s.jsx("strong",{children:g.tokens.length})," of ",s.jsx("strong",{children:g.totalFiltered})," tokens",g.totalFiltered!==g.totalAll&&` (${g.totalAll} total)`,g.fetchedAt&&` · Last loaded ${new Date(g.fetchedAt).toLocaleTimeString()}`]})}),s.jsx(Ike,{candidates:g.tokens,isScanning:g.isLoading,activeCategory:d,password:o||"",onAddToIndex:M,page:g.page,totalPages:g.totalPages,totalFiltered:g.totalFiltered,totalAll:g.totalAll,onPageChange:g.setPage})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Current Index Constituents"}),s.jsx(Mke,{daiConstituents:b,rwaConstituents:j,password:o||"",onRemove:I})]}),s.jsx("section",{className:"space-y-4",children:s.jsx(Lke,{password:o||""})})]})]}):s.jsx(VSe,{onLogin:l,isLoading:i,error:a})}function CF(){return`sess_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function zke(){const e=localStorage.getItem("builder_session_id");if(e)return e;const t=CF();return localStorage.setItem("builder_session_id",t),t}function Vke(){const e=zke(),t=localStorage.getItem(`builder_state_${e}`);if(t)try{return JSON.parse(t)}catch{}return{sessionId:e,dbId:null,step:1,universe:null,constituents:[],weightingMode:"market-cap",aiAnalysis:null,aiPaid:!1,backtestPaid:!1,name:"",symbol
575:"",modelId:null,status:"draft"}}function Hke(e,t){switch(t.type){case"SET_UNIVERSE":return{...e,universe:t.universe,constituents:[],aiAnalysis:null,aiPaid:!1};case"SET_STEP":return{...e,step:t.step};case"TOGGLE_CONSTITUENT":return e.constituents.find(n=>n.ticker===t.constituent.ticker)?{...e,constituents:e.constituents.filter(n=>n.ticker!==t.constituent.ticker)}:e.constituents.length>=20?e:{...e,constituents:[...e.constituents,t.constituent]};case"SET_WEIGHTING_MODE":return{...e,weightingMode:t.mode};case"SET_AI_ANALYSIS":return{...e,aiAnalysis:t.analysis};case"SET_AI_PAID":return{...e,aiPaid:!0};case"SET_BACKTEST_PAID":return{...e,backtestPaid:!0};case"SET_NAME":return{...e,name:t.name};case"SET_SYMBOL":return{...e,symbol:t.symbol.toUpperCase().slice(0,5)};case"SET_MODEL_ID":return{...e,modelId:t.modelId};case"SET_DB_ID":return{...e,dbId:t.id};case"SET_STATUS":return{...e,status:t.status};case"RESET":{const r=CF();return localStorage.setItem("builder_session_id",r),{sessionId:r,dbId:null,step:1,universe:null,constituents:[],weightingMode:"market-cap",aiAnalysis:null,aiPaid:!1,backtestPaid:!1,name:"",symbol:"",modelId:null,status:"draft"}}default:return e}}function qke(){const[e,t]=w.useReducer(Hke,void 0,Vke);w.useEffect(()=>{localStorage.setItem(`builder_state_${e.sessionId}`,JSON.stringify(e))},[e]);const r=hs,n=w.useCallback(async v=>{try{const x={session_id:v.sessionId,name:v.name,symbol:v.symbol,universe:v.universe??"dai",constituents:v.constituents,weighting_mode:v.weightingMode,status:v.status,model_id:v.modelId??null};if(v.dbId)await r.from("user_custom_indexes").update(x).eq("id",v.dbId);else{const{data:y}=await r.from("user_custom_indexes").insert(x).select("id").single();y!=null&&y.id&&t({type:"SET_DB_ID",id:y.id})}}catch(x){console.error("Failed to save index to DB:",x)}},[]),i=w.useCallback(v=>{t({type:"SET_UNIVERSE",universe:v})},[]),a=w.useCallback(v=>{t({type:"SET_STEP",step:v})},[]),o=w.useCallback(v=>{t({type:"TOGGLE_CONSTITUENT",constituent:v})},[]),l=w.useCallback(v=>{t({type:"SET_WEIGHTING_MODE",mode:v})},[]),c=w.useCallback(v=>{t({type:"SET_AI_ANALYSIS",analysis:v})},[]),u=w.useCallback(()=>{t({type:"SET_AI_PAID"})},[]),d=w.useCallback(()=>{t({type:"SET_BACKTEST_PAID"})},[]),f=w.useCallback(v=>{t({type:"SET_NAME",name:v})},[]),h=w.useCallback(v=>{t({type:"SET_SYMBOL",symbol:v})},[]),m=w.useCallback(v=>{t({type:"SET_MODEL_ID",modelId:v})},[]),g=w.useCallback(async()=>{t({type:"SET_STATUS",status:"tokenized"}),t({type:"SET_STEP",step:7}),await n({...e,status:"tokenized"})},[e,n]),p=w.useCallback(()=>{t({type:"RESET"})},[]);return{state:e,setUniverse:i,setStep:a,toggleConstituent:o,setWeightingMode:l,setAIAnalysis:c,setAIPaid:u,setBacktestPaid:d,setName:f,setSymbol:h,setModelId:m,tokenize:g,saveToDb:n,reset:p}}const Gke=({constituents:e,weightingMode:t,name:r,symbol:n,className:i})=>{const a=e.length>0?(100/e.length).toFixed(1):"0";return s.jsxs("div",{className:X("bg-card border border-border/40 rounded-xl p-5 space-y-4",i),children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Index Preview"}),n&&s.jsxs("span",{className:"text-xs font-mono bg-primary/10 text-primary px-2 py-0.5 rounded",children:["$",n]})]}),r&&s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:r})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${Math.min(e.length/20*100,100)}%`}})}),s.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[e.length,s.jsx("span",{className:"text-muted-foreground/50",children:"/20"})]})]}),e.length<3&&s.jsxs("p",{className:"text-xs text-muted-foreground bg-muted/30 rounded-lg p-3",children:["Select at least ",s.jsx("strong",{children:"3 tokens"})," to continue. (",3-e.length," more needed)"]}),e.length>0&&s.jsx("div",{className:"space-y-2",children:e.map(o=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:"text-xs font-mono font-medium text-foreground bg-muted px-1.5 py-0.5 rounded shrink-0",children:o.ticker}),s.jsx("span",{className:"text-xs text-muted-foreground truncate",children:o.name})]}),s.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0 ml-2",children:[a,"%"]})]},o.ticker))}),s.jsx("div",{className:"pt-2 border-t border-border/40",children:s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Mode: ",s.jsx("span",{className:"text-foreground font-medium capitalize",children:t.replace("-"," ")})]})})]})}
575,Kke=[{id:"dai",title:"Decentralized AI",ticker:"$dAI",description:"GPU compute, data infrastructure, AI agents, and base layer protocols powering the decentralized AI economy.",categories:["GPU Compute","Data Infrastructure","AI Agents","Base Protocols"],accent:"hsl(var(--chart-1))"},{id:"rwa",title:"Real World Assets",ticker:"$RWA",description:"Tokenized securities, institutional lending, credit protocols, and yield infrastructure bridging TradFi with DeFi.",categories:["Tokenized Securities","Institutional Lending","Credit Protocols","Yield Infrastructure"],accent:"hsl(var(--chart-2))"}],Yke=({selected:e,onSelect:t})=>s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-serif text-2xl mb-1",children:"Choose Your Universe"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select the industry pool from which you'll build your custom index."})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:Kke.map(r=>{const n=e===r.id;return s.jsxs("button",{onClick:()=>t(r.id),className:X("text-left p-6 rounded-xl border-2 border-l-4 transition-all duration-200 focus:outline-none",n?"border-primary bg-primary/5":"border-border/50 bg-card hover:border-border hover:bg-card/80"),style:n?{borderLeftColor:r.accent}:{},children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("h3",{className:"font-medium text-foreground",children:r.title}),s.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:r.ticker})]}),s.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-4",children:r.description}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.categories.map(i=>s.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-muted/60 text-muted-foreground",children:i},i))}),n&&s.jsxs("div",{className:"mt-4 pt-4 border-t border-primary/20 flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"}),s.jsxs("span",{className:"text-xs text-primary font-medium",children:["Selected â ",r.title," universe"]})]})]},r.id)})})]}),Xke=({universe:e,selected:t,onToggle:r})=>{const[n,i]=w.useState(""),[a,o]=w.useState(null),{data:l=[]}=by(),{data:c=[]}=wy(),u=e==="dai"?l:c,d=w.useMemo(()=>{const m=new Set(u.map(g=>g.category));return Array.from(m).sort()},[u]),f=w.useMemo(()=>u.filter(m=>{const g=!n||m.ticker.toLowerCase().includes(n.toLowerCase())||m.name.toLowerCase().includes(n.toLowerCase()),p=!a||m.category===a;return g&&p}),[u,n,a]),h=new Set(t.map(m=>m.ticker));return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(v8,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),s.jsx(Hn,{placeholder:"Search tokens...",value:n,onChange:m=>i(m.target.value),className:"pl-9"})]}),s.jsxs("div",{className:"flex gap-2 flex-wrap",children:[s.jsx("button",{onClick:()=>o(null),className:X("text-xs px-3 py-1.5 rounded-lg border transition-colors",a?"border-border text-muted-foreground hover:border-foreground
575/40":"bg-foreground text-background border-foreground"),children:"All"}),d.map(m=>s.jsx("button",{onClick:()=>o(m===a?null:m),className:X("text-xs px-3 py-1.5 rounded-lg border transition-colors",a===m?"bg-foreground text-background border-foreground":"border-border text-muted-foreground hover:border-foreground/40"),children:m},m))]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 max-h-[480px] overflow-y-auto pr-1",children:[f.map(m=>{const g=h.has(m.ticker),p=t.length>=20&&!g;return s.jsx("button",{onClick:()=>!p&&r({ticker:m.ticker,name:m.name,category:m.category,coingeckoId:m.coingeckoId}),disabled:p,className:X("text-left p-4 rounded-xl border-2 transition-all group focus:outline-none",g?"border-primary bg-primary/5":p?"border-border/30 bg-muted/20 opacity-50 cursor-not-allowed":"border-border/50 bg-card hover:border-border"),children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"font-mono font-medium text-sm text-foreground",children:m.ticker}),s.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:m.category})]}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:m.name})]}),s.jsx("div",{className:X("w-5 h-5 rounded-full border-2 flex items-center justify-center shrink-0 transition-all",g?"border-primary bg-primary":"border-border"),children:g&&s.jsx(Kf,{className:"w-3 h-3 text-primary-foreground"})})]})},m.ticker)}),f.length===0&&s.jsx("div",{className:"col-span-full text-center py-8 text-muted-foreground text-sm",children:"No tokens match your search."})]}),t.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-border/40",children:t.map(m=>s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs bg-primary/10 text-primary px-2 py-1 rounded-lg",children:[m.ticker,s.jsx("button",{onClick:()=>r(m),className:"hover:text-primary/70",children:s.jsx(Yf,{className:"w-3 h-3"})})]},m.ticker))})]})},Qke=({universe:e,selected:t,onToggle:r})=>s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-serif text-2xl mb-1",children:"Build Your Constituent List"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Select 3â20 tokens from the ",e==="dai"?"Decentralized AI":"Real World Assets"," universe to form your custom index basket."]})]}),s.jsx(Xke,{universe:e,selected:t,onToggle:r})]}),Mk=({title:e,description:t,action:r,cost:n,onPay:i,isPaid:a,className:o})=>a?null:s.jsxs("div",{className:X("relative overflow-hidden rounded-xl border border-primary/30 bg-card p-6",o),children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-transparent to-transparent pointer-events-none"}),s.jsxs("div",{className:"relative space-y-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-9 h-9 rounded-lg bg-primary/10 border border-primary/20 flex items-center justify-center shrink-0",children:s.jsx(Tj,{className:"w-4 h-4 text-primary"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-foreground text-sm",children:e}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-3 py-3 border-y border-border/40",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Cost"}),s.jsxs("p",{className:"text-sm font-medium font-serif text-foreground mt-0.5",children:[n," USDC"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Action"}),s.jsx("p",{className:"text-sm font-medium text-foreground mt-0.5",children:r})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Network"}),s.jsx("p",{className:"text-sm font-medium text-foreground mt-0.5",children:"0G Mainnet"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[s.jsx(Md,{className:"w-3 h-3 text-primary"}),"Tolls fund 0G network validators and are partially burned on deployment."]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsxs(pe,{variant:"outline",size:"sm",className:"flex-1 text-xs",onClick:()=>{},children:["Connect Wallet",s.jsx("span",{className:"ml-1.5 text-[10px] text-muted-foreground",children:"(Phase 2)"})]}),s.jsx(pe,{size:"sm",className:"flex-1 text-xs bg-foreground text-background hover:bg-foreground
575/90",onClick:i,children:"Pay & Continue â"})]})]})]}),Jke=({score:e})=>{const t=e>=70?"bg-green-500":e>=50?"bg-yellow-500":"bg-red-500";return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:X("h-full rounded-full transition-all",t),style:{width:`${e}%`}})}),s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground w-7",children:e})]})},Zke=({constituents:e,universe:t,isPaid:r,onPay:n,aiAnalysis:i,onAnalysis:a})=>{const[o,l]=w.useState(!1),{toast:c}=Qg(),u=async()=>{n(),l(!0);try{const{data:d,error:f}=await hs.functions.invoke("ai-index-advisor",{body:{constituents:e.map(h=>({ticker:h.ticker,name:h.name,category:h.category})),universe:t}});if(f)throw f;a(d)}catch(d){console.error(d),c({title:"AI analysis failed",description:"Please try again.",variant:"destructive"})}finally{l(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-serif text-2xl mb-1",children:"AI-Assisted Analysis"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Let our AI score your basket, identify strengths and risks, and suggest optimizations."})]}),r?o?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4",children:[s.jsx(kr,{className:"w-8 h-8 animate-spin text-primary"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Analyzing your index basketâ¦"})]}):i?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"p-5 rounded-xl border border-border/40 bg-card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(lR,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Overall Score"})]}),s.jsx("p",{className:"font-serif text-4xl text-foreground",children:i.overallScore}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"out of 100"})]}),s.jsxs("div",{className:"p-5 rounded-xl border border-border/40 bg-card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Fs,{className:"w-4 h-4 text-yellow-500"}),s.jsx("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Risk Level"})]}),s.jsx("p",{className:"font-serif text-2xl text-foreground",children:i.riskLevel}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"portfolio risk assessment"})]})]}),s.jsxs("div",{className:"bg-card rounded-xl border border-border/40 p-5",children:[s.jsx("h3",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-4",children:"Token Scores"}),s.jsx("div",{className:"space-y-4",children:i.scores.map(d=>s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center justify-between mb-1",children:s.jsx("span",{className:"text-sm font-mono font-medium text-foreground",children:d.ticker})}),s.jsx(Jke,{score:d.score}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d.rationale})]},d.ticker))})]}),(i.suggestions.add.length>0||i.suggestions.remove.length>0)&&s.jsxs("div",{className:"bg-card rounded-xl border border-border/40 p-5 space-y-4",children:[s.jsx("h3",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"AI Suggestions"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.suggestions.add.map(d=>s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs bg-green-500/10 text-green-600 dark:text-green-400 px-2 py-1 rounded-lg",children:[s.jsx(sc,{className:"w-3 h-3"})," ",d]},d)),i.suggestions.remove.map(d=>s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs bg-red-500/10 text-red-600 dark:text-red-400 px-2 py-1 rounded-lg",children:[s.jsx(m8,{className:"w-3 h-3"})," ",d]},d))]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:i.suggestions.rationale})]})]}):s.jsx("div",{className:"py-8 text-center text-muted-foreground text-sm",children:"No analysis yet. Pay the toll to run AI scoring."}):s.jsx(Mk,{title:"AI Scoring requires a network toll",description:"Get per-token scores, portfolio risk assessment, and add/remove suggestions.",cost:"1.00",action:"AI constituent analysis",onPay:u})]})};function Ey(){return gn({queryKey:["model-deployments"],queryFn:async()=>{const{data:e,error:t}=await hs.from("model_deployments").select("*").eq("is_active",!0).order("total_calls",{ascending:!1});if(t)throw t;return e||[]},staleTime:60*1e3,gcTime:10*60*1e3})}function Dk(e){return e?`${e.slice(0,6)}â¦${e.slice(-3)}`:"â"}const Lk={daily:"Daily rebalance",weekly:"Weekly rebalance",monthly:"Monthly rebalance"},YO=({className:e="h-3 w-auto shrink-0"})=>s.jsx("svg",{viewBox:"0 0 24 24",className:e,fill:"#0082FB",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M6.915 4.03c-1.968 0-3.683 1.28-4.871 3.113C.704 9.208 0 11.883 0 14.449c0 .706.07 1.369.21 1.973a6.624 6.624 0 0 0 .265.86 5.297 5.297 0 0 0 .371.761c.696 1.159 1.818 1.927 3.593 1.927 1.497 0 2.633-.671 3.965-2.444.76-1.012 1.144-1.626 2.663-4.32l.756-1.339.186-.325c.061.1.121.196.183.3l2.152 3.595c.724 1.21 1.665 2.556 2.47 3.314 1.046.987 1.992 1.22 3.06 1.22 1.075 0 1.876-.355 2.455-.843a3.743 3.743 0 0 0 .81-.973c.542-.939.861-2.127.861-3.745 0-2.72-.681-5.357-2.084-7.45-1.282-1.912-2.957-2.93-4.716-2.93-1.047 0-2.088.467-3.053 1.308-.652.57-1.257 1.29-1.82 2.05-.69-.875-1.335-1.547-1.958-2.056-1.182-.966-2.315-1.303-3.454-1.303zm10.16 2.053c1.147 0 2.188.758 2.992 1.999 1.132 1.748 1.647 4.195 1.647 6.4 0 1.548-.368 2.9-1.839 2.9-.58 0-1.027-.23-1.664-1.004-.496-.601-1.343-1.878-2.832-4.358l-.617-1.028a44.908 44.908 0 0 0-1.255-1.98c.07-.109.141-.224.211-.327 1.12-1.66
5757 2.118-2.602 3.358-2.602zm-10.201.553c1.265 0 2.058.791 2.675 1.446.307.327.737.871 1.234 1.579l-1.02 1.566c-.757 1.163-1.882 3.017-2.837 4.338-1.191 1.649-1.81 1.817-2.486 1.817-.524 0-1.038-.237-1.383-.794-.263-.426-.464-1.13-.464-2.046 0-2.221.63-4.535 1.66-6.088.454-.687.964-1.226 1.533-1.533a2.264 2.264 0 0 1 1.088-.285z"})}),eNe=({className:e="h-3.5 w-auto shrink-0"})=>s.jsxs("svg",{viewBox:"0 0 24 24",className:e,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M23.748 12.298c-.174-.31-.56-.515-.98-.515-.287 0-.56.09-.784.258l-.09.07c-1.13.915-2.4 1.394-3.68 1.394-2.73 0-4.924-2.22-4.924-4.983 0-2.76 2.193-4.983 4.924-4.983 1.256 0 2.477.46 3.595 1.336.205.16.457.247.715.247.412 0 .789-.2.969-.514.14-.248.148-.55.02-.807-.127-.258-.38-.45-.678-.516C21.51 2.69 19.36 2 17.014 2 12.044 2 8 6.038 8 11s4.044 9 9.014 9c2.58 0 5.006-1.046 6.832-2.944.31-.323.41-.782.24-1.18a1.025 1.025 0 0 0-.338-.578z",fill:"#4D6BFE"}),s.jsx("path",{d:"M10.568 14.1c-.32-.247-.762-.29-1.128-.107-.367.183-.601.558-.601.97v.1c0 2.1-1.618 3.8-3.618 3.8-1.617 0-3.023-1.085-3.472-2.65-.062-.215-.053-.445.026-.655.08-.21.227-.387.42-.504.44-.263.607-.824.383-1.283-.224-.46-.77-.648-1.24-.43C.517 14.098 0 15.24 0 16.463 0 19.515 2.418 22 5.421 22c3.003 0 5.42-2.485 5.42-5.538v-.099c0-.48-.19-.928-.273-2.263z",fill:"#4D6BFE"}),s.jsx("circle",{cx:"10",cy:"7.5",r:"1.5",fill:"#4D6BFE"})]}),tNe=({className:e="h-3.5 w-auto shrink-0"})=>s.jsx("svg",{viewBox:"0 0 24 24",className:e,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-1 5h2v3.586l3.707-3.707 1.414 1.414L14.414 12l3.707 3.707-1.414 1.414L13 13.414V17h-2v-4.586l-2.293 2.293-1.414-1.414L9.586 11 7.293 8.707l1.414-1.414L11 9.586V7z",fill:"#00C4B4"})}),rNe=({className:e="h-3.5 w-auto shrink-0"})=>s.jsx("svg",{viewBox:"0 0 24 24",className:e,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10c2.09 0 4.03-.64 5.638-1.738l1.948 1.324-.614-2.386A9.952 9.952 0 0 0 22 12C22 6.477 17.523 2 12 2zm0 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16zm0 2a6 6 0 1 0 3.527 10.896l1.229.836-.36-1.398A5.97 5.97 0 0 0 18 12a6 6 0 0 0-6-6z",fill:"#6047E8"})}),nNe=({className:e="h-3.5 w-auto shrink-0"})=>
575s.jsx("svg",{viewBox:"0 0 24 24",className:e,fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.843-3.369 2.02-1.168a.076.076 0 0 1 .071 0l4.83 2.786a4.49 4.49 0 0 1-.676 8.099v-5.678a.786.786 0 0 0-.402-.67zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08-4.778 2.758a.795.795 0 0 0-.393.681zm1.097-2.365l2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z"})}),iNe={"llama-3.3-70b":{logo:s.jsx(YO,{}),label:"Llama 3.3 70B Instruct"},"llama-3.1-8b":{logo:s.jsx(YO,{}),label:"Llama 3.1 8B Instruct"},"deepseek-r1-70b":{logo:s.jsx(eNe,{}),label:"DeepSeek-R1 70B"},"kimi-k2":{logo:s.jsx(tNe,{}),label:"Kimi K2"},"qwen3-30b":{logo:s.jsx(rNe,{}),label:"Qwen3 30B"},"gpt-oss-120b":{logo:s.jsx(nNe,{}),label:"GPT-OSS 120B"}},mh=({llm:e,size:t="md"})=>{if(!e)return null;const r=iNe[e];if(!r)return s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:e});const n=t==="lg"?O.cloneElement(r.logo,{className:"h-6 w-auto shrink-0"}):t==="sm"?O.cloneElement(r.logo,{className:"h-2.5 w-auto shrink-0"}):r.logo,i=t==="lg"?"text-sm font-medium text-foreground":t==="sm"?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground";return s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n,s.jsx("span",{className:i,children:r.label})]})},aNe={momentum:"Momentum",volatility:"Volatility",sentiment:"Sentiment",fundamental:"Fundamental","mean-reversion":"Mean Reversion",custom:"Custom"},sNe=({model:e,selected:t,onSelect:r})=>{const n=((e.rebalance_frequency==="daily"?30:e.rebalance_frequency==="weekly"?4:1)*e.cost_per_call_0g).toFixed(4);return s.jsxs("button",{onClick:r,className:X("w-full text-left p-5 rounded-xl border transition-all","bg-card hover:bg-muted/20",t?"border-primary/60 border-l-4 border-l-primary":"border-border/50 border-l-4 border-l-transparent"),children:[s.jsxs("div",{className:"flex items-start justify-between gap-4 mb-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-medium text-foreground text-sm uppercase tracking-wide leading-tight",children:e.name}),s.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5 flex-wrap",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[aNe[e.strategy_type]??e.strategy_type," ·"," ",Lk[e.rebalance_frequency]??e.rebalance_frequency]}),e.llm_model&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-xs text-muted-foreground/40",children:"·"}),s.jsx(mh,{llm:e.llm_model})]})]})]}),s.jsxs("div",{className:"text-right shrink-0",children:[s.jsxs("p",{className:"font-mono text-sm text-foreground",children:[e.cost_per_call_0g," ",s.jsx("span",{className:"text-muted-foreground text-xs",children:"0G / call"})]}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["~",n," 0G / mo"]})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed mb-3",children:e.description}),s.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[s.jsxs("span",{className:"text-muted-foreground/70",children:["Creator ",Dk(e.creator_address)]}
575),s.jsxs("span",{className:"text-muted-foreground/70",children:[e.total_calls.toLocaleString()," calls"]})]})]})},oNe=({selectedModelId:e,onSelectModel:t})=>{const{data:r=[],isLoading:n}=Ey(),i=e===null,a=e!==null&&e!=="deploy-own";return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-serif text-2xl mb-1",children:"Rebalancing Model"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose the intelligence behind your index. A 0G inference model runs on-chain, paying per rebalance in 0G tokens. Static weighting incurs no inference fees."})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Option A"}),s.jsx("button",{onClick:()=>t(null),className:X("w-full text-left p-5 rounded-xl border transition-all","bg-card hover:bg-muted/20",i?"border-primary/60 border-l-4 border-l-primary":"border-border/50 border-l-4 border-l-transparent"),children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-foreground text-sm uppercase tracking-wide",children:"Static Weighting"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:"Uses the weighting mode you configure in Backtest (Market Cap, Multi-Factor, or Risk Controlled). No inference fees. Weights are fixed at tokenization."})]}),s.jsx("span",{className:"shrink-0 text-xs font-mono text-muted-foreground bg-muted/40 px-2 py-1 rounded",children:"0.0000 0G / call"})]})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Option B â 0G Community Models"}),a&&s.jsx("span",{className:"text-xs font-mono text-primary",children:"1 selected"})]}),n?s.jsx("div",{className:"text-sm text-muted-foreground py-6 text-center",children:"Loading modelsâ¦"}):s.jsx("div",{className:"space-y-3",children:r.map(o=>s.jsx(sNe,{model:o,selected:e===o.id,onSelect:()=>t(e===o.id?null:o.id)},o.id))}),s.jsx("div",{className:"flex items-center justify-end pt-1",children:s.jsx("a",{href:"/models",className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-4 decoration-border/50",onClick:o=>{o.preventDefault(),window.location.href="/models"},children:"Browse full model registry â"})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Option C"}),s.jsxs("div",{className:"w-full p-5 rounded-xl border border-dashed border-border/40 bg-muted/10 opacity-60",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-medium text-foreground text-sm uppercase tracking-wide",children:"Deploy Your Own Model"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:"Deploy a custom rebalancing model to the 0G inference network and earn fees every time another index calls your model. Create a creator economy around your strategy."})]}),s.jsx("span",{className:"shrink-0 text-xs font-mono text-muted-foreground bg-muted/30 px-2 py-1 rounded border border-border/30",children:"Phase 2"})]}),s.jsx("div",{className:"mt-4 pt-4 border-t border-border/30",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Model deployment to Zero-Gravity Mainnet â including endpoint registration, inference billing, and creator earnings â launches in Phase 2."})})]})]})]})},lNe=({constituents:e,weightingMode:t,onWeightingModeChange:r,isPaid:n,onPay:i})=>{const a=e.map(m=>m.coingeckoId).filter(m=>!!m);ys(a);const{data:o,isLoading:l}=dh(a),c=(()=>{if(!o||o.length===0)return null;try{return Ok(o,e,ls,Mc,Fn)}catch{return null}})(),u=(c==null?void 0:c.cumulativeReturns.slice(-365))??[],d=c==null?void 0:c.metrics,h=d?d[{"market-cap":"marketCap","multi-factor":"multiFactor","risk-controlled":"riskControlled"}[t]]:null;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-serif text-2xl mb-1",children:"Configure & Backtest"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a weighting method and preview how y
575our index would have performed historically."})]}),s.jsxs(hS,{value:t,onValueChange:m=>r(m),children:[s.jsxs(kv,{className:"w-full",children:[s.jsx(Hi,{value:"market-cap",className:"flex-1 text-xs",children:"Market Cap"}),s.jsx(Hi,{value:"multi-factor",className:"flex-1 text-xs",children:"Multi-Factor"}),s.jsx(Hi,{value:"risk-controlled",className:"flex-1 text-xs",children:"Risk Controlled"})]}),["market-cap","multi-factor","risk-controlled"].map(m=>s.jsx(dd,{value:m,className:"space-y-4 mt-4",children:s.jsxs("div",{className:"p-3 rounded-lg bg-muted/30 border border-border/40 text-sm text-muted-foreground",children:[m==="market-cap"&&"Weights proportional to market cap, dampened (MCap^α) to reduce concentration.",m==="multi-factor"&&"Composite score of Liquidity (40%), Fundamental (30%), and Sustainability (30%).",m==="risk-controlled"&&"Inverse volatility weighting (1/Ï) â lower-risk assets get higher weight."]})},m))]}),l?s.jsx("div",{className:"h-64 flex items-center justify-center text-muted-foreground text-sm",children:"Loading historical dataâ¦"}):c?s.jsxs("div",{className:"bg-card rounded-xl border border-border/40 p-5",children:[s.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-4",children:"Cumulative Performance (1Y)"}),s.jsx(fn,{width:"100%",height:240,children:s.jsxs(jk,{data:u,children:[s.jsx(Vn,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",opacity:.4}),s.jsx(fr,{dataKey:"date",tick:{fontSize:10},stroke:"hsl(var(--muted-foreground))",tickLine:!1}),s.jsx(hr,{tickFormatter:m=>`${m.toFixed(0)}%`,tick:{fontSize:10},stroke:"hsl(var(--muted-foreground))",tickLine:!1}),s.jsx(mt,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:8,fontSize:12},formatter:m=>[`${m.toFixed(2)}%`]}),s.jsx(dn,{wrapperStyle:{fontSize:11}}),s.jsx(jr,{type:"monotone",dataKey:"cumMarketCap",name:"Market Cap",stroke:"hsl(var(--chart-1))",dot:!1,strokeWidth:1.5}),s.jsx(jr,{type:"monotone",dataKey:"cumMultiFactor",name:"Multi-Factor",stroke:"hsl(var(--chart-2))",dot:!1,strokeWidth:1.5}),s.jsx(jr,{type:"monotone",dataKey:"cumRiskControlled",name:"Risk Controlled",stroke:"hsl(var(--chart-3))",dot:!1,strokeWidth:1.5})]})})]}):s.jsx("div",{className:"h-64 flex items-center justify-center text-muted-foreground text-sm bg-card rounded-xl border border-border/40",children:"Not enough data to run backtest for selected tokens."}),h&&s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[{label:"Total Return",value:`${h.totalReturn>=0?"+":""}${(h.totalReturn*100).toFixed(1)}%`},{label:"Max Drawdown",value:`${(h.maxDrawdown*100).toFixed(1)}%`},{label:"Volatility",value:`${(h.volatility*100).toFixed(1)}%`},{label:"Sharpe Ratio",value:h.sharpeRatio.toFixed(2)},{label:"Best Day",value:`+${h.bestDay.toFixed(2)}%`},{label:"Worst Day",value:`${h.worstDay.toFixed(2)}%`}].map(m=>s.jsxs("div",{className:"p-3 rounded-lg bg-card border border-border/40",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:m.label}),s.jsx("p",{className:"font-serif text-lg text-foreground mt-0.5",children:m.value})]},m.label))}),!n&&s.jsx(Mk,{title:"Advanced Backtest â 2-Year Lookback",description:"Extended historical analysis with deeper drawdown analysis and Sharpe optimization.",cost:"2.00",action:"Extended backtesting",onPay:i})]})},cNe=1.85,uNe=({constituents:e,weightingMode:t,name:r,symbol:n,onNameChange:i,onSymbolChange:a,onTokenize:o})=>{const[l,c]=w.useState(!1),u=r.trim().length>2&&n.trim().length>=2,d=(.0142*cNe).toFixed(4);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-serif text-2xl mb-1",children:"Name & Tokenize Your Index"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Give your index a name and ticker symbol. Once confirmed, it will be saved and a shareable link generated."})]}),s.jsxs("div",{className:"bg-card rounded-xl border border-border/40 p-5 space-y-5",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oa,{htmlFor:"index-name",children:"Index Name"}
575),s.jsx(Hn,{id:"index-name",placeholder:"e.g. My AI Infrastructure Index",value:r,onChange:f=>i(f.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oa,{htmlFor:"index-symbol",children:"Ticker Symbol (2â5 chars)"}),s.jsx(Hn,{id:"index-symbol",placeholder:"e.g. MAII",value:n,maxLength:5,onChange:f=>a(f.target.value),className:"font-mono uppercase"})]})]}),s.jsxs("div",{className:"bg-card rounded-xl border border-border/40 p-5 space-y-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Deployment Summary"}),s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Token Standard"}),s.jsx("p",{className:"font-medium text-foreground mt-0.5",children:"ERC-4626 Vault"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Network"}),s.jsx("p",{className:"font-medium text-foreground mt-0.5",children:"Zero-Gravity Mainnet"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Constituents"}),s.jsxs("p",{className:"font-medium text-foreground mt-0.5",children:[e.length," tokens"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Weighting Mode"}),s.jsx("p",{className:"font-medium text-foreground mt-0.5 capitalize",children:t.replace("-"," ")})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Est. 0G Burn"}),s.jsxs("p",{className:"font-medium text-foreground mt-0.5",children:["~",d," 0G"]})]})]})]}),!l&&s.jsx(Mk,{title:"Tokenization requires a network toll",description:"Deploy your index configuration to the Zero-Gravity network and mint your ERC-4626 vault token.",cost:"5.00",action:"Index tokenization",onPay:()=>{c(!0),u&&o()}}),l&&!u&&s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Fill in the index name and symbol above to complete tokenization."})]})},dNe=({dbId:e,name:t,symbol:r,constituents:n,weightingMode:i,onReset:a})=>{const{toast:o}=Qg(),l=e?`${window.location.origin}/index/${e}`:window.location.href,c=(58e4*25e-9*1.85).toFixed(6),u=()=>{navigator.clipboard.writeText(l),o({title:"Link copied!",description:"Share your index with anyone."})};return s.jsxs("div",{className:"space-y-6 text-center",children:[s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 border border-primary/20 flex items-center justify-center",children:s.jsx(Z$,{className:"w-8 h-8 text-primary"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"font-serif text-2xl mb-1",children:"Index Tokenized!"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your custom index has been saved and is ready to deploy."})]})]}),s.jsxs("div",{className:"max-w-xs mx-auto bg-card rounded-2xl border border-border/40 p-6 space-y-4",children:[s.jsx("div",{className:"w-14 h-14 rounded-xl bg-foreground flex items-center justify-center mx-auto",children:s.jsx("span",{className:"text-background font-serif text-lg font-bold",children:(r==null?void 0:r.slice(0,2))||"IX"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-foreground",children:t||"Custom Index"}),s.jsxs("p",{className:"text-xs font-mono text-muted-foreground",children:["$",r||"IDX"," · ERC-4626 Vault"]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs text-left",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground",children:"Constituents"}),s.jsxs("p",{className:"font-medium text-foreground",children:[n.length," tokens"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground",children:"Weighting"}),s.jsx("p",{className:"font-medium text-foreground capitalize",children:i.replace("-"," ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground bg-muted/30 rounded-lg px-3 py-2",children:"Zero-Gravity Mainnet · Phase 2 deployment"})]}),s.jsxs("div",{className:"max-w-sm mx-auto bg-card rounded-xl border border-border/40 p-4 flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:s.jsx(sb,{className:"w-4 h-4 text-primary"})}),s.jsxs("div",{className:"text-left",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Estimated 0G Network Fee Burn"}),s.jsxs("p",{className:"text-sm font-medium text-foreground",children:[c," 0G ",s.jsx("span",{className:"text-muted-foreground font-normal",children:"â $0.027"})]})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 max-w-sm mx-auto",children:[s.jsxs(pe,{variant:"outline",size:"sm",className:"flex-1 gap-2",onClick:u,children:[s.jsx(oR,{className:"w-4 h-4"}),"Copy Share Link"]}),s.jsxs(pe,{variant:"outline",size:"sm",className:"flex-1 gap-2",onClick:()=>window.open("https://0gscan.ai","_blank"),children:[s.jsx(Pj,{className:"w-4 h-4"}),"View on Explorer"]})]}),s.jsxs(pe,{variant:"ghost",size:"sm",className:"gap-2 text-muted-foreground",onClick:a,children:[s.jsx(Bc,{className:"w-4 h-4"}),"Build Another Index"]})]})},XO=[{id:1,label:"Universe"},{id:2,label:"Constituents"},{id:3,label:"AI Analysis"},{id:4,label:"Model"},{id:5,label:"Backtest"},{id:6,label:"Tokenize"},{id:7,label:"Deploy"}],fNe=()=>
575{const e=fv(),{state:t,setUniverse:r,setStep:n,toggleConstituent:i,setWeightingMode:a,setAIAnalysis:o,setAIPaid:l,setBacktestPaid:c,setName:u,setSymbol:d,setModelId:f,tokenize:h,reset:m}=qke(),{step:g,universe:p,constituents:v,weightingMode:x,aiAnalysis:y,aiPaid:b,backtestPaid:S,name:j,symbol:N,dbId:k,modelId:_}=t,C=()=>g===1?p!==null:g===2?v.length>=3:g===3||g===4||g===5,P=()=>{g<7&&n(g+1)},E=()=>{g>1&&n(g-1)};return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Vi,{}),s.jsxs("main",{className:"container py-8 max-w-6xl",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"font-serif text-3xl md:text-4xl mb-1",children:"Build Your Index"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Create, validate, and tokenize your own custom crypto index â powered by Zero-Gravity Mainnet."})]}),s.jsx("div",{className:"flex items-center gap-1 mb-10 overflow-x-auto pb-2",children:XO.map((A,R)=>s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsxs("button",{onClick:()=>A.id<g&&n(A.id),disabled:A.id>g,className:X("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium transition-all",A.id===g?"bg-foreground text-background":A.id<g?"bg-muted text-muted-foreground hover:bg-muted/70 cursor-pointer":"text-muted-foreground/40 cursor-not-allowed"),children:[s.jsx("span",{className:X("w-5 h-5 rounded-full flex items-center justify-center text-[10px]",A.id===g?"bg-background/20":A.id<g?"bg-primary/20":"bg-muted"),children:A.id<g?s.jsx(Kf,{className:"w-3 h-3"}):A.id}),A.label]}),R<XO.length-1&&s.jsx(mp,{className:"w-3 h-3 text-muted-foreground/30 shrink-0"})]},A.id))}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_280px] gap-8",children:[s.jsxs("div",{className:"min-w-0",children:[g===1&&s.jsx(Yke,{selected:p,onSelect:r}),g===2&&p&&s.jsx(Qke,{universe:p,selected:v,onToggle:i}),g===3&&p&&s.jsx(Zke,{constituents:v,universe:p,isPaid:b,onPay:l,aiAnalysis:y,onAnalysis:o}),g===4&&s.jsx(oNe,{selectedModelId:_,onSelectModel:f}),g===5&&s.jsx(lNe,{constituents:v,weightingMode:x,onWeightingModeChange:a,isPaid:S,onPay:c}),g===6&&s.jsx(uNe,{constituents:v,weightingMode:x,name:j,symbol:N,onNameChange:u,onSymbolChange:d,onTokenize:h}),g===7&&s.jsx(dNe,{dbId:k,name:j,symbol:N,constituents:v,weightingMode:x,onReset:m}),g<7&&s.jsxs("div",{className:"flex items-center justify-between mt-8 pt-6 border-t border-border/40",children:[s.jsxs(pe,{variant:"outline",size:"sm",onClick:g===1?()=>e("/"):E,className:"gap-2",children:[s.jsx(J$,{className:"w-4 h-4"}),g===1?"Back to Dashboard":"Back"]}),g<6&&s.jsxs(pe,{size:"sm",onClick:P,disabled:!C(),className:"gap-2 bg-foreground text-background hover:bg-foreground
575/90",children:[g===5?"Continue to Tokenize":"Continue",s.jsx(mp,{className:"w-4 h-4"})]})]})]}),g<7&&s.jsx("aside",{className:"lg:sticky lg:top-6 h-fit",children:s.jsx(Gke,{constituents:v,weightingMode:x,name:j,symbol:N})})]})]}),s.jsx("footer",{className:"bg-foreground text-background mt-20",children:s.jsx("div",{className:"container py-8 text-center text-sm text-background/60",children:s.jsx("p",{children:"© 2026 Openw3b. All rights reserved."})})})]})},hNe={"market-cap":"Market Cap","multi-factor":"Multi-Factor","risk-controlled":"Risk Controlled"},mNe={dai:"dAI â Decentralized AI",rwa:"RWA â Real World Assets"},pNe={momentum:"Momentum",sentiment:"Sentiment",volatility:"Volatility","ml-ensemble":"ML Ensemble",custom:"Custom"};function QO(e,t){return e.weight!=null?e.weight.toFixed(2):(100/t).toFixed(2)}const gNe=({coingeckoId:e,ticker:t})=>{const[r,n]=w.useState(!1),i=e?xy[e]:null;return s.jsx("div",{className:"w-7 h-7 rounded-md bg-foreground/8 border border-border/40 flex items-center justify-center shrink-0 overflow-hidden",children:i&&!r?s.jsx("img",{src:i,alt:t,className:"w-full h-full object-cover",onError:()=>n(!0)}):s.jsx("span",{className:"text-[10px] font-mono font-bold text-foreground",children:t==null?void 0:t.slice(0,2)})})},vNe=()=>{var k,_;const{id:e}=vI(),t=fv(),{toast:r}=Qg(),[n,i]=w.useState(null),[a,o]=w.useState(!0),[l,c]=w.useState(null),{data:u=[]}=Ey();w.useEffect(()=>{if(!e)return;(async()=>{o(!0);const{data:P,error:E}=await hs.from("user_custom_indexes").select("*").eq("id",e).single();E||!P?c("Index not found or has been removed."):i(P),o(!1)})()},[e]);const d=()=>{navigator.clipboard.writeText(window.location.href),r({title:"Link copied!",description:"Share this index with anyone."})},f=(58e4*25e-9*1.85).toFixed(6),[h,m]=w.useState(0),g={daily:1/86400,weekly:1/604800,monthly:1/2592e3},p=n!=null&&n.model_id?u.find(C=>C.id===n.model_id)??null:null;if(w.useEffect(()=>{if(!p)return;m(p.total_calls);const C=g[p.rebalance_frequency]??g.weekly,P=setInterval(()=>{m(E=>E+C*.5*100)},500);return()=>clearInterval(P)},[p==null?void 0:p.id,p==null?void 0:p.total_calls,p==null?void 0:p.rebalance_frequency]),a)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Vi,{}),s.jsxs("main",{className:"container py-20 max-w-3xl flex flex-col items-center gap-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-primary border-t-transparent animate-spin"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading indexâ¦"})]})]});if(l||!n)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Vi,{}),s.jsxs("main",{className:"container py-20 max-w-3xl flex flex-col items-center gap-4 text-center",children:[s.jsx("div",{className:"w-14 h-14 rounded-full bg-destructive/10 flex items-center justify-center",children:s.jsx(Za,{className:"w-7 h-7 text-destructive"})}),s.jsx("h2",{className:"font-serif text-2xl",children:"Index Not Found"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:l}),s.jsxs(pe,{variant:"outline",size:"sm",onClick:()=>t("/build"),className:"gap-2 mt-2",children:[s.jsx(fp,{className:"w-4 h-4"}),"Build Your Own Index"]})]})]});const v=Array.isArray(n.constituents)?n.constituents:[],x=n.status==="tokenized",y=new Date(n.created_at).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),b={};v.forEach(C=>{const P=C.category||"Other";b[P]||(b[P]=[]),b[P].push(C)});const S=p,j=S?h*S.cost_per_call_0g:0,N=(j*.027).toFixed(3);return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Vi,{}),s.jsxs("main",{className:"container py-8 max-w-4xl",children:[s.jsxs(_e,{to:"/build",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors mb-6",children:[s.jsx(fp,{className:"w-3.5 h-3.5"}),"Back to Builder"]}),s.jsx("div",{className:"bg-card border border-border/40 rounded-2xl p-8 mb-6",children:s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-6",children:[s.jsx("div",{className:"w-16 h-16 rounded-2xl bg-foreground flex items-center justify-center shrink-0",children:s.jsx("span",{className:"text-background font-serif text-xl font-bold",children:((k=n.symbol)==null?void 0:k.slice(0,2))||"IX"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[s.jsx("h1",{className:"font-serif text-2xl md:text-3xl text-foreground",children:n.name||"Untitled Index"}),x?s.jsxs(Me,{className:"bg-primary/10 text-primary border-primary/20 ga
575p-1",children:[s.jsx(Z$,{className:"w-3 h-3"}),"Tokenized"]}):s.jsxs(Me,{variant:"outline",className:"gap-1 text-muted-foreground",children:[s.jsx(ib,{className:"w-3 h-3"}),"Draft"]})]}),s.jsxs("p",{className:"text-sm font-mono text-muted-foreground mb-3",children:["$",n.symbol||"IDX"," · ERC-4626 Vault · Zero-Gravity Mainnet"]}),s.jsxs("div",{className:"flex flex-wrap gap-3",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground bg-muted/30 rounded-lg px-3 py-1.5",children:[s.jsx(l_,{className:"w-3.5 h-3.5"}),s.jsx("span",{children:mNe[n.universe]||n.universe})]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground bg-muted/30 rounded-lg px-3 py-1.5",children:[s.jsx(hp,{className:"w-3.5 h-3.5"}),s.jsxs("span",{className:"capitalize",children:[hNe[n.weighting_mode]||n.weighting_mode," Weighting"]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground bg-muted/30 rounded-lg px-3 py-1.5",children:[s.jsx(ib,{className:"w-3.5 h-3.5"}),s.jsxs("span",{children:["Created ",y]})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-2 shrink-0",children:[s.jsxs(pe,{size:"sm",className:"gap-2 bg-foreground text-background hover:bg-foreground
575/90",onClick:d,children:[s.jsx(oR,{className:"w-4 h-4"}),"Share Index"]}),s.jsxs(pe,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>window.open("https://0gscan.ai","_blank"),children:[s.jsx(Pj,{className:"w-4 h-4"}),"View on Explorer"]})]})]})}),S&&s.jsxs("div",{className:"bg-card border border-border/40 rounded-xl overflow-hidden mb-6",children:[s.jsxs("div",{className:"px-5 py-3 border-b border-border/40 flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-medium text-foreground",children:"AI Rebalancing Model"}),s.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold bg-primary/10 text-primary border border-primary/20 leading-none",children:"0G"})]}),s.jsxs("div",{className:"px-5 py-4 grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"space-y-2",children:[S.llm_model&&s.jsx(mh,{llm:S.llm_model,size:"lg"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:S.name}),S.description&&s.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed italic",children:['"',S.description,'"']}),s.jsx(_e,{to:"/models",className:"inline-flex items-center gap-1.5 text-xs text-primary hover:text-primary/80 font-medium transition-colors pt-1",children:"View model registry â"})]}),s.jsxs("div",{className:"bg-muted/30 rounded-lg divide-y divide-border/30 self-start",children:[s.jsxs("div",{className:"flex justify-between items-center px-3 py-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[s.jsx(hp,{className:"w-3 h-3"}),"Strategy"]}),s.jsx("span",{className:"text-xs font-medium text-foreground",children:pNe[S.strategy_type]||S.strategy_type})]}),s.jsxs("div",{className:"flex justify-between items-center px-3 py-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[s.jsx($j,{className:"w-3 h-3"}),"Rebalances"]}),s.jsx("span",{className:"text-xs font-medium text-foreground capitalize",children:((_=Lk[S.rebalance_frequency])==null?void 0:_.replace(" rebalance",""))||S.rebalance_frequency})]}),s.jsxs("div",{className:"flex justify-between items-center px-3 py-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[s.jsx(sb,{className:"w-3 h-3"}),"Cost / call"]}),s.jsxs("span",{className:"text-xs font-medium text-foreground",children:[S.cost_per_call_0g," 0G"]})]}),s.jsxs("div",{className:"flex justify-between items-center px-3 py-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[s.jsx(l_,{className:"w-3 h-3"}),"Total calls"]}),s.jsx("span",{className:"text-xs font-medium text-foreground tabular-nums",children:S.total_calls.toLocaleString()})]}),S.creator_address&&s.jsxs("div",{className:"flex justify-between items-center px-3 py-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[s.jsx(x8,{className:"w-3 h-3"}),"Creator"]}),s.jsx("span",{className:"text-xs font-mono text-foreground",children:Dk(S.creator_address)})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_300px] gap-6",children:[s.jsxs("div",{className:"bg-card border border-border/40 rounded-xl overflow-hidden",children:[s.jsx("div",{className:"px-6 py-4 border-b border-border/40",children:s.jsxs("h2",{className:"font-medium text-sm text-foreground",children:["Constituents",s.jsxs("span",{className:"ml-2 text-xs text-muted-foreground font-normal",children:[v.length," tokens"]})]})}),v.length===0?s.jsx("p",{className:"px-6 py-8 text-sm text-muted-foreground text-center",children:"No constituents recorded."}):s.jsx("div",{className:"divide-y divide-border/30",children:v.map((C,P)=>s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-muted/20 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums w-5 shrink-0",children:P+1}),s.jsx(gNe,{coingeckoId:C.coingeckoId,ticker:C.ticker}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-medium text-foreground font-mono",children:C.ticker}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.name})]})]}),s.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[s.jsx("span",{className:"text-xs text-muted-foreground hidden sm:block",children:C.category}),s.jsxs("span",{className:"text-xs font-medium text-foreground tabular-nums",children:[QO(C,v.length),"%"]}),s.jsx("div",{className:"hidden sm:block w-20 h-1.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${QO(C,v.length)}%`}})})]})]},C.ticker))})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-card border border-border/40 rounded-xl p-5 space-y-4",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Mint This Index"})}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Deploy this exact basket as an ERC-4626 vault token on Zero-Gravity Mainnet. Wallet connection and on-chain deployment are coming in Phase 2."}),s.jsxs("div",{className:"bg-muted/30 rounded-lg px-4 py-3 space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Network"}),s.jsx("span",{className:"text-foreground font-medium",children:"0G Mainnet"})]}),s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Standard"}),s.jsx("span",{className:"text-foreground font-medium",children:"ERC-4626"})]}),s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Est. toll"}),s.jsx("span",{className:"text-foreground font-medium",children:"5.00 USDC"})]})]}),s.jsxs(pe,{size:"sm",className:"w-full bg-foreground text-background hover:bg-foreground
575/90 gap-2",onClick:()=>r({title:"Coming in Phase 2",description:"Wallet connection and on-chain minting will be available soon."}),children:[s.jsx(b8,{className:"w-4 h-4"}),"Connect Wallet to Mint"]})]}),s.jsxs("div",{className:"bg-card border border-border/40 rounded-xl p-4 relative",children:[s.jsx(sd,{children:s.jsxs(Mm,{children:[s.jsx(Dm,{asChild:!0,children:s.jsx("button",{className:"absolute top-3 right-3 text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(Rm,{className:"w-3.5 h-3.5"})})}),s.jsx(od,{side:"left",className:"max-w-[220px] text-xs leading-relaxed",children:"Each rebalancing call executed by the AI model burns 0G tokens on the Zero-Gravity network. This counter updates in real time as new rebalances are processed."})]})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-orange-500/10 flex items-center justify-center shrink-0",children:s.jsx(sb,{className:"w-4 h-4 text-orange-400"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:S?"0G Network Fees Burned":"Est. 0G Network Fee Burn"}),s.jsx("p",{className:"text-sm font-medium text-foreground tabular-nums",children:S?s.jsxs(s.Fragment,{children:[j.toFixed(4)," 0G"," ",s.jsxs("span",{className:"text-muted-foreground font-normal text-xs",children:["â $",N]})]}):s.jsxs(s.Fragment,{children:[f," 0G"," ",s.jsx("span",{className:"text-muted-foreground font-normal",children:"â $0.027"})]})})]})]})]}),Object.keys(b).length>0&&s.jsxs("div",{className:"bg-card border border-border/40 rounded-xl p-5 space-y-3",children:[s.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Category Breakdown"}),Object.entries(b).map(([C,P])=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[s.jsx("span",{className:"text-muted-foreground",children:C}),s.jsxs("span",{className:"text-foreground font-medium",children:[(P.length/v.length*100).toFixed(0),"%"]})]}),s.jsx("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:X("h-full bg-primary rounded-full"),style:{width:`${P.length/v.length*100}%`}})})]},C))]}),s.jsxs("div",{className:"bg-muted/20 border border-border/40 rounded-xl p-5 text-center space-y-3",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Want your own custom index?"}),s.jsx(pe,{variant:"outline",size:"sm",className:"w-full gap-2",onClick:()=>t("/build"),children:"Build Your Own Index â"})]})]})]})]}),s.jsx("footer",{className:"bg-foreground text-background mt-20",children:s.jsx("div",{className:"container py-8 text-center text-sm text-background/60",children:s.jsx("p",{children:"© 2026 Openw3b. All rights reserved."})})})]})},yNe=({totalIndexes:e,bestPerformer:t,latestEntry:r,totalInferenceCalls:n})=>{const[i,a]=w.useState(0);w.useEffect(()=>{if(n<=0)return;const c=1200,u=performance.now(),d=f=>{const h=f-u,m=Math.min(h/c,1),g=1-Math.pow(1-m,3);a(Math.round(g*n)),m<1&&requestAnimationFrame(d)};requestAnimationFrame(d)},[n]);const o=c=>`${c>=0?"+":""}${c.toFixed(2)}%`,l=c=>{const u=Date.now()-new Date(c).getTime(),d=Math.floor(u/864e5);return d===0?"Today":d===1?"Yesterday":`${d}d ago`};return s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[s.jsxs("div",{className:"bg-card border border-border/50 border-l-2 border-l-border/30 rounded-xl p-5",children:[s.jsx("p",{className:"text-xs text-muted-foreground/70 tracking-widest uppercase mb-1.5 font-medium",children:"Live Indexes"}),s.jsx("p",{className:"font-mono text-3xl font-light tabular-nums text-foreground leading-none",children:e})]}),s.jsxs("div",{className:"bg-card border border-border/50 border-l-2 border-l-border/30 rounded-xl p-5",children:[s.jsx("p",{className:"text-xs text-muted-foreground/70 tracking-widest uppercase mb-1.5 font-medium",children:"Top Performer"}),t?s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"font-mono text-xl font-semibold text-foreground",children:["$",t.index.symbol]}),s.jsx("span",{className:X("text-base font-medium tabular-nums",t.sevenDayReturn>=0?"text-[hsl(142,71%,45%)]":"text-destructive"),children:o(t.sevenDayReturn)}
575),s.jsx("span",{className:"text-[10px] text-muted-foreground/50 font-mono",children:"7d"})]}):s.jsx("p",{className:"text-sm text-muted-foreground",children:"â"})]}),s.jsxs("div",{className:"bg-card border border-border/50 border-l-2 border-l-border/30 rounded-xl p-5",children:[s.jsx("p",{className:"text-xs text-muted-foreground/70 tracking-widest uppercase mb-1.5 font-medium",children:"Latest Deploy"}),r?s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"font-mono text-xl font-semibold text-foreground",children:["$",r.symbol]}),s.jsx("span",{className:"text-xs text-muted-foreground/60",children:l(r.created_at)})]}):s.jsx("p",{className:"text-sm text-muted-foreground",children:"â"})]}),s.jsxs("div",{className:"bg-card border border-border/50 border-l-2 border-l-primary/60 rounded-xl p-5",children:[s.jsx("p",{className:"text-xs text-muted-foreground/70 tracking-widest uppercase mb-1.5 font-medium",children:"0G Inference Calls"}),s.jsx("p",{className:"font-mono text-3xl font-light tabular-nums tracking-tight text-foreground leading-none",children:i>0?i.toLocaleString():"â"}),i>0&&s.jsx("p",{className:"text-[10px] text-primary/60 mt-1 font-mono",children:"AI-powered indexes"})]})]})},AF=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),xNe=({active:e,payload:t,label:r,entries:n})=>{if(!e||!(t!=null&&t.length))return null;const i=[...t].sort((a,o)=>o.value-a.value);return s.jsxs("div",{className:"bg-card border border-border rounded-xl p-3 shadow-xl min-w-[200px]",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2 pb-2 border-b border-border",children:r?AF(r):""}),i.map(a=>{const o=n.find(c=>c.index.id===a.dataKey);if(!o)return null;const l=a.value-100;return s.jsxs("div",{className:"flex items-center justify-between gap-4 py-0.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:o.color}}),s.jsxs("span",{className:"text-xs font-mono text-foreground",children:["$",o.index.symbol]})]}),s.jsxs("span",{className:`text-xs font-medium tabular-nums ${l>=0?"text-[hsl(142,71%,45%)]":"text-destructive"}`,children:[l>=0?"+":"",l.toFixed(2),"%"]})]},a.dataKey)})]})},bNe=e=>{const{cx:t,cy:r,index:n,data:i,entry:a,value:o}=e;if(!t||!r||!i||!a||o===void 0||n!==i.length-1)return null;const l=o-100,c=`${l>=0?"+":""}${l.toFixed(1)}%`,u=58,d=20,f=a.color;return s.jsxs("g",{children:[s.jsxs("circle",{cx:t,cy:r,r:4.5,fill:f,opacity:.6,children:[s.jsx("animate",{attributeName:"r",from:"4.5",to:"16",dur:"1.6s",repeatCount:"indefinite"}),s.jsx("animate",{attributeName:"opacity",from:"0.6",to:"0",dur:"1.6s",repeatCount:"indefinite"})]}),s.jsxs("circle",{cx:t,cy:r,r:4.5,fill:f,opacity:.35,children:[s.jsx("animate",{attributeName:"r",from:"4.5",to:"16",dur:"1.6s",begin:"0.7s",repeatCount:"indefinite"}),s.jsx("animate",{attributeName:"opacity",from:"0.35",to:"0",dur:"1.6s",begin:"0.7s",repeatCount:"indefinite"})]}),s.jsx("circle",{cx:t,cy:r,r:4.5,fill:f}),s.jsx("rect",{x:t+8,y:r-d/2,width:u,height:d,rx:4,fill:f,opacity:.92}),s.jsxs("text",{x:t+8+u/2,y:r+4,textAnchor:"middle",fill:"white",fontSize:9,fontFamily:"monospace",fontWeight:"600",children:["$",a.index.symbol," ",c]})]})},wNe=({chartData:e,entries:t,timeRange:r})=>{const n=(()=>{if(r==="all")return e;const i=r==="30d"?30:90,a=new Date;return a.setDate(a.getDate()-i),e.filter(o=>new Date(o.date)>=a)})();return n.length===0||t.length===0?s.jsxs("div",{className:"h-[420px] flex flex-col items-center justify-center gap-3 text-muted-foreground",children:[s.jsx("div",{className:"w-16 h-16 rounded-2xl border-2 border-dashed border-border flex items-center justify-center",children:s.jsx("span",{className:"text-2xl",children:"ð"})}),s.jsx("p",{className:"text-sm font-medium",children:"No performance data yet"}),s.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Deploy an index to see it compete here"})]}):s.jsx("div",{className:"h-[420px] w-full",children:s.jsx(fn,{width:"100%",height:"100%",children:s.jsxs(jk,{data:n,margin:{top:20,right:90,left:10,bottom:10},children:[s.jsx(Vn,{strokeDasharray:"3 3",className:"stroke-border/40"}
575),s.jsx(fr,{dataKey:"date",tickFormatter:AF,tick:{fill:"hsl(var(--muted-foreground))",fontSize:11},interval:"preserveStartEnd",tickLine:!1}),s.jsx(hr,{tick:{fill:"hsl(var(--muted-foreground))",fontSize:11},domain:["auto","auto"],tickLine:!1,axisLine:!1,tickFormatter:i=>`${i.toFixed(0)}`}),s.jsx(mt,{content:({active:i,payload:a,label:o})=>s.jsx(xNe,{active:i,payload:a,label:o,entries:t})}),s.jsx(uh,{y:100,stroke:"hsl(var(--muted-foreground))",strokeDasharray:"5 5",strokeOpacity:.4,label:{value:"Baseline",position:"insideTopLeft",fontSize:10,fill:"hsl(var(--muted-foreground))"}}),t.map(i=>s.jsx(jr,{type:"monotone",dataKey:i.index.id,stroke:i.color,strokeWidth:2,dot:a=>s.jsx(bNe,{...a,data:n,entry:i},a.index),activeDot:{r:4,strokeWidth:0},connectNulls:!0},i.index.id))]})})})},jNe={"market-cap":"Market Cap","multi-factor":"Multi-Factor","risk-controlled":"Risk Ctrl"},SNe=({rank:e})=>e===1?s.jsx("span",{className:"font-mono text-sm font-bold text-[hsl(39,100%,50%)] tabular-nums",children:"#1"}):e===2?s.jsx("span",{className:"font-mono text-sm font-semibold text-[hsl(220,14%,65%)] tabular-nums",children:"#2"}):e===3?s.jsx("span",{className:"font-mono text-sm font-semibold text-[hsl(15,60%,55%)] tabular-nums",children:"#3"}):s.jsxs("span",{className:"text-xs text-muted-foreground font-mono tabular-nums w-4 text-center",children:["#",e]}),JO=({value:e,className:t})=>{const r=e>=0;return s.jsxs("span",{className:X("font-mono font-medium tabular-nums text-sm",r?"text-[hsl(142,71%,45%)]":"text-destructive",t),children:[r?"+":"",e.toFixed(2),"%"]})},kNe=({entry:e})=>e.index.model_id&&e.modelName?s.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold bg-primary/10 text-primary border border-primary/20 leading-none",children:"0G"}),s.jsx("span",{className:"text-xs text-foreground truncate max-w-[100px]",children:e.modelName})]}),s.jsx(mh,{llm:e.modelLlm})]}):s.jsx("span",{className:"text-xs text-muted-foreground",children:jNe[e.index.weighting_mode]||e.index.weighting_mode}),NNe=({entries:e})=>e.length===0?null:s.jsxs("div",{className:"bg-card border border-border/50 rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"px-5 py-4 border-b border-border/40 flex items-center justify-between",children:[s.jsx("h2",{className:"font-medium text-sm text-foreground tracking-wide",children:"Live Leaderboard"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Ranked by total return since deployment"})]}),s.jsxs(Vt,{children:[s.jsx(Ht,{children:s.jsxs(me,{className:"bg-muted/20 hover:bg-muted/20",children:[s.jsx(J,{className:"text-xs w-10 text-center pl-4",children:"#"}),s.jsx(J,{className:"text-xs",children:"Index"}),s.jsx(J,{className:"text-xs",children:"Universe"}),s.jsx(J,{className:"text-xs hidden sm:table-cell",children:"Weighting / Model"}),s.jsx(J,{className:"text-xs text-center hidden md:table-cell",children:"Tokens"}),s.jsx(J,{className:"text-xs text-right hidden lg:table-cell",children:"7d Return"}),s.jsx(J,{className:"text-xs text-right",children:"Total Return"}),s.jsx(J,{className:"text-xs text-right pr-4"})]})}),s.jsx(qt,{children:e.map(t=>s.jsxs(me,{className:"group hover:bg-muted/20 transition-colors",children:[s.jsx(W,{className:"pl-4 pr-2 py-3 w-10",children:s.jsx("div",{className:"flex justify-center",children:s.jsx(SNe,{rank:t.rank})})}),s.jsx(W,{className:"py-3",children:s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:t.color}}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate max-w-[140px]",children:t.index.name||"Untitled"}),s.jsxs("p",{className:"text-xs font-mono text-muted-foreground",children:["$",t.index.symbol]})]})]})}),s.jsx(W,{className:"py-3",children:s.jsx(Me,{variant:"outline",className:X("text-[10px] px-2 py-0.5 font-medium tracking-wide",t.index.universe==="dai"?"bg-primary/8 text-primary border-primary/20":"bg-[hsl(142,71%,45%,0.08)] text-[hsl(142,71%,45%)] border-[hsl(142,71%,45%,0.2)]"),children:t.index.universe==="dai"?"dAI":"RWA"})}),s.jsx(W,{className:"py-3 hidden sm:table-cell",children:s.jsx(kNe,{entry:t})}),s.jsx(W,{className:"py-3 text-center hidden md:table-cell",children:s.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 bg-muted/40 rounded-md text-xs font-mono text-muted-foreground",children:t.constituentCount})}),s.jsx(W,{className:"py-3 text-right hidden lg:table-cell",children:s.jsx(JO,{value:t.sevenDayReturn})}),s.jsx(W,{className:"py-3 text-right",children:s.jsx(JO,{value:t.totalReturn})}),s.jsx(W,{className:"py-3 pr-4 text-right",children:s.jsx(_e,{to:`/index/${t.index.id}`,className:"text-xs text-primary hover:text-primary/80 font-medium transition-colors opacity-0 group-hover:opacity-100",children:"View â"})})]},t.index.id))})]})]}),_Ne=({rank:e})=>e===1?s.jsx("span",{className:"font-mono text-sm font-bold text-[hsl(39,100%,50%)]",children:"#1"}):e===2?s.jsx("span",{className:"font-mono text-sm font-semibold text-[hsl(220,14%,65%)]",children:"#2"}):e===3?s.jsx("span",{className:"font-mono text-sm font-semibold text-[hsl(15,60%,55%)]",children:"#3"}):s.jsxs("span",{className:"text-sm font-mono text-muted-foreground",children:["#",e]}),CNe=({entry:e})=>{const t=e.totalReturn>=0;return s.jsx(_e,{to:`/index/${e.index.id}`,className:"block bg-card border border-border/40 rounded-xl p-4 hover:border-border/70 transition-colors",style:{borderLeftColor:e.color,borderLeftWidth:3},children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"flex items-center justify-center w-8 h-8 shrink-0",children:s.jsx(_Ne,{rank:e.rank})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.index.name||"Untitled"}),s.jsx(Me,{variant:"outline",className:X("text-[10px] px-1.5 py-0 font-medium shrink-0",e.index.universe==="dai"?"bg-primary/8 text-primary border-primary/20":"bg-[hsl(142,71%,45%,0.08)] text-[hsl(142,71%,45%)] border-[hsl(142,71%,45%,0.2)]"),children:e.index.universe==="dai"?"dAI":"RWA"}),e.index.model_id&&s.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold bg-primary/10 text-primary border border-primary/20 leading-none shrink-0",children:"0G"})]}),s.jsxs("p",{className:"text-xs font-mono text-muted-foreground",children:["$",e.index.symbol]})]}),s.jsxs("span",{className:X("text-sm font-semibold tabular-nums shrink-0",t?"text-[hsl(142,71%,45%)]":"text-destructive"),children:[t?"+":"",e.totalReturn.toFixed(2),"%"]})]})})};function ANe(){return gn({queryKey:["arena-model-deployments"],queryFn:async()=>{const{data:e,error:t}=await hs.from("model_deployments").select("*");if(t)throw t;const r={};
575return(e||[]).forEach(n=>{r[n.id]=n}),r},staleTime:60*1e3,gcTime:10*60*1e3})}const ZO=["hsl(221 83% 53%)","hsl(142 71% 45%)","hsl(25 95% 53%)","hsl(280 70% 50%)","hsl(0 65% 55%)","hsl(39 100% 50%)","hsl(195 85% 45%)","hsl(340 80% 55%)","hsl(80 55% 42%)","hsl(260 60% 55%)","hsl(15 80% 50%)","hsl(175 40% 38%)"];function ENe(){return gn({queryKey:["arena-tokenized-indexes"],queryFn:async()=>{const{data:e,error:t}=await hs.from("user_custom_indexes").select("*").eq("status","tokenized").order("created_at",{ascending:!0});if(t)throw t;return e||[]},staleTime:10*1e3,refetchInterval:15*1e3,gcTime:10*60*1e3})}function PNe(e="all"){const t=ENe(),{data:r=[],isLoading:n}=t,{data:i={}}=ANe(),a=w.useMemo(()=>{const h=new Set;return r.forEach(m=>{var g;(g=m.constituents)==null||g.forEach(p=>{p.coingeckoId&&h.add(p.coingeckoId)})}),Array.from(h)},[r]),{data:o,isLoading:l}=dh(a,365),c=w.useMemo(()=>!o||o.length===0||r.length===0?[]:[...r.map((g,p)=>{var R,$,D,M,I,T,L;const v=ZO[p%ZO.length],x=(g.constituents||[]).map(B=>({ticker:B.ticker,name:B.name,category:B.category||"General",coingeckoId:B.coingeckoId,metrics:B.metrics})),y=g.universe==="rwa"?Og:ls,b=g.universe==="rwa"?If:Mc;let S;try{S=Ok(o,x,y,b,Fn,0)}catch{return{index:g,color:v,performanceSeries:[],totalReturn:0,sevenDayReturn:0,constituentCount:((R=g.constituents)==null?void 0:R.length)??0,modelName:g.model_id?(($=i[g.model_id])==null?void 0:$.name)??null:null,modelLlm:g.model_id?((D=i[g.model_id])==null?void 0:D.llm_model)??null:null}}const N=S.cumulativeReturns.map(B=>{let H;switch(g.weighting_mode){case"multi-factor":H=B.cumMultiFactor;break;case"risk-controlled":H=B.cumRiskControlled;break;default:H=B.cumMarketCap}return{date:B.date,value:H}}),k=((M=N[N.length-1])==null?void 0:M.value)??100,_=k-100,C=N.length>7?((I=N[N.length-8])==null?void 0:I.value)??100:100,P=C>0?(k-C)/C*100:0,E=g.model_id?((T=i[g.model_id])==null?void 0:T.name)??null:null,A=g.model_id?((L=i[g.model_id])==null?void 0:L.llm_model)??null:null;return{index:g,color:v,performanceSeries:N,totalReturn:_,sevenDayReturn:P,constituentCount:x.length,modelName:E,modelLlm:A}})].sort((g,p)=>p.totalReturn-g.totalReturn).map((g,p)=>({...g,rank:p+1})),[o,r,i]),u=w.useMemo(()=>e==="all"?c:c.filter(h=>h.index.universe===e),[c,e]),d=w.useMemo(()=>{if(u.length===0)return[];const h=new Set;return u.forEach(g=>g.performanceSeries.forEach(p=>h.add(p.date))),Array.from(h).sort().map(g=>{const p={date:g};return u.forEach(v=>{const x=v.performanceSeries.find(y=>y.date===g);x&&(p[v.index.id]=x.value)}),p})},[u]),f=w.useMemo(()=>{const h=new Set;c.forEach(g=>{g.index.model_id&&h.add(g.index.model_id)});let m=0;return h.forEach(g=>{i[g]&&(m+=i[g].total_calls)}),m},[c,i]);return{arenaEntries:u,allArenaEntries:c,chartData:d,isLoading:n||a.length>0&&l,isFetching:t.isFetching,dataUpdatedAt:t.dataUpdatedAt,isEmpty:!n&&r.length===0,totalIndexes:r.length,totalInferenceCalls:f,bestPerformer:c[0]??null,latestEntry:[...r].sort((h,m)=>new Date(m.created_at).getTime()-new Date(h.created_at).getTime())[0]??null}}const s0=768;function ONe(){const[e,t]=w.useState(void 0);return w.useEffect(()=>{const r=window.matchMedia(`(max-width: ${s0-1}px)`),n=()=>{t(window.innerWidth<s0)};return r.addEventListener("change",n),t(window.innerWidth<s0),()=>r.removeEventListener("change",n)},[]),!!e}const TNe=()=>{const[e,t]=w.useState("all"),[r,n]=w.useState("all"),[i,a]=w.useState(0),o=ONe(),l=w.useRef(0),{data:c=[]}=Ey(),{arenaEntries:u,allArenaEntries:d,chartData:f,isLoading:h,isFetching:m,dataUpdatedAt:g,isEmpty:p,totalIndexes:v,totalInferenceCalls:x,bestPerformer:y,latestEntry:b}=PNe(e);w.useEffect(()=>{g&&g!==l.current&&(l.current=g,a(0))},[g]),w.useEffect(()=>{const j=setInterval(()=>{a(N=>N+1)},1e3);return()=>clearInterval(j)},[]);const S=m?"Updatingâ¦":i<5?"Updated just now":`Updated ${i}s ago`;return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Vi,{}),s.jsxs("main",{className:"container py-8 max-w-6xl",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 mb-8",children:[s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center gap-2.5 mb-2",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[s.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-[hsl(142,71%,45%)] opacity-60"}),s.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-[hsl(142,71%,45%)]"})]}),s.jsx("span",{className:"text-xs font-medium text-[hsl(142,71%,45%)] tracking-widest uppercase",children:"Live"})]})}),s.jsx("h1",{className:"font-serif text-4xl md:text-5xl text-foreground mb-2",children:"Index Arena"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Deployed indexes competing live · Performance normalized to 100 at deployment"})]}),s.jsxs("div",{className:"flex flex-col gap-2 shrink-0",children:[s.jsx("div",{className:"flex items-center gap-1 p-1 bg-muted/30 rounded-lg border border-border/40",children:["all","dai","rwa"].map(j=>s.jsx("button",{onClick:()=>t(j),className:X("px-3 py-1 text-xs font-medium rounded-md transition-all",e===j?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:text-foreground"),children:j==="all"?"All":j==="dai"?"dAI":"RWA"},j))}),s.jsx("div",{className:"flex items-center gap-1 p-1 bg-muted/30 rounded-lg border border-border/40",children:["30d","90d","all"].map(j=>s.jsx("button",{onClick:()=>n(j),className:X("px-3 py-1 text-xs font-medium rounded-md transition-all",r===j?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:text-foreground"),children:j==="all"?"ALL":j.toUpperCase()},j))})]})]}),h&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-32 gap-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground tracking-wide",children:"Loading arena dataâ¦"}),s.jsx("div",{className:"w-40 h-px bg-border/40 overflow-hidden rounded-full",children:s.jsx("div",{className:"h-full bg-primary/50 animate-[shimmer_1.4s_ease-in-out_infinite]",style:{width:"40%",animation:"slide 1.4s ease-in-out infinite"}})})]}),!h&&p&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-32 gap-6 text-center",children:[s.jsx("p",{className:"font-serif text-6xl text-muted-foreground
575/30 select-none",children:"â"}),s.jsxs("div",{children:[s.jsx("h2",{className:"font-serif text-2xl text-foreground mb-2",children:"Arena awaiting competitors"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto leading-relaxed",children:"No indexes deployed yet. Be the first to build and tokenize your custom index â then watch it compete live here."})]}),s.jsx(pe,{asChild:!0,className:"bg-foreground text-background hover:bg-foreground/90",children:s.jsx(_e,{to:"/build",children:"Build & Deploy First Index â"})})]}),!h&&!p&&s.jsxs("div",{className:"space-y-6",children:[s.jsx(yNe,{totalIndexes:v,bestPerformer:d[0]??null,latestEntry:b,totalInferenceCalls:x}),s.jsxs("div",{className:"bg-card border border-border/50 rounded-2xl p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-5",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-medium text-sm text-foreground mb-0.5",children:"Cumulative Performance"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Each index normalized to 100 at deployment date"})]}),s.jsx("div",{className:"hidden sm:flex flex-wrap gap-3 justify-end max-w-xs",children:u.map(j=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:j.color}}),s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["$",j.index.symbol]})]},j.index.id))})]}),s.jsx(wNe,{chartData:f,entries:u,timeRange:r}),s.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-3 pt-3 border-t border-border/30",children:[s.jsx("span",{className:"text-[11px] text-muted-foreground/60 tabular-nums",children:S}),s.jsx("span",{className:"text-[11px] text-muted-foreground/40",children:"·"}),s.jsx("span",{className:"text-[11px] text-muted-foreground/40",children:"auto-refreshes every 15s"})]})]}),o?s.jsxs("div",{className:"space-y-3",children:[s.jsx("h2",{className:"font-medium text-sm text-foreground px-1",children:"Live Leaderboard"}),u.map(j=>s.jsx(CNe,{entry:j},j.index.id))]}):s.jsx(NNe,{entries:u}),c.length>0&&s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-[#3b1a6e]/50",style:{background:"linear-gradient(135deg, #0a0015 0%, #1a0040 60%, #0d001a 100%)"},children:[s.jsx("div",{className:"absolute inset-0 opacity-[0.04] pointer-events-none",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E")`,backgroundRepeat:"repeat",backgroundSize:"128px 128px"}}),s.jsx("div",{className:"absolute top-0 left-1/4 w-64 h-32 bg-[#6030c0] opacity-[0.12] rounded-full blur-3xl pointer-events-none"}),s.jsxs("div",{className:"relative p-5 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-mono font-bold bg-[#7c3aed]/20 text-[#c4b5fd] border border-[#7c3aed]/40 leading-none tracking-wider",children:"0G"}),s.jsx("p",{className:"text-xs uppercase tracking-widest text-white/50 font-medium",children:"Inference Models · Used by indexes in this Arena"})]}),s.jsx("div",{className:"flex items-center gap-3 shrink-0",children:s.jsx("span",{className:"hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium text-[#c4b5fd]/70 bg-[#7c3aed]/10 border border-[#7c3aed]/25",children:"TeeML verified"})})]}),s.jsx("div",{className:"flex gap-3 overflow-x-auto pb-1 scrollbar-none",children:c.slice(0,5).map(j=>s.jsxs("div",{className:"flex-none flex items-center gap-2.5 bg-white/5 border border-white/10 rounded-lg px-3 py-2.5 min-w-0",children:[j.llm_model&&s.jsx(mh,{llm:j.llm_model}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-medium text-white/85 whitespace-nowrap",children:j.name}),s.jsxs("p",{className:"text-[10px] text-white/40 whitespace-nowrap",children:[j.total_calls.toLocaleStr
575ing()," calls · ",j.cost_per_call_0g," 0G/call"]})]})]},j.id))}),s.jsxs("div",{className:"pt-4 border-t border-white/[0.08] flex flex-col sm:flex-row sm:items-center gap-5 justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative flex items-center justify-center shrink-0",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-[#7c3aed] blur-md animate-[0g-glow_2.8s_ease-in-out_infinite]"}),s.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"Zero-Gravity Network",className:"relative",style:{filter:"drop-shadow(0 0 6px rgba(124,58,237,0.55))"},children:[s.jsx("rect",{width:"40",height:"40",rx:"10",fill:"white",fillOpacity:"0.08"}),s.jsx("rect",{width:"40",height:"40",rx:"10",stroke:"white",strokeOpacity:"0.15",strokeWidth:"1"}),s.jsx("text",{x:"4",y:"27",fontFamily:"serif",fontSize:"20",fontWeight:"700",fill:"white",fillOpacity:"0.95",children:"Ã"}),s.jsx("text",{x:"21",y:"27",fontFamily:"serif",fontSize:"20",fontWeight:"700",fill:"#c4b5fd",children:"G"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold text-white/90 leading-tight tracking-wide",children:"Zero-Gravity Network"}),s.jsx("p",{className:"text-[11px] text-white/45 leading-snug mt-0.5",children:"The Largest AI L1 · Powering this Arena"})]})]}),s.jsxs("div",{className:"sm:text-right max-w-sm",children:[s.jsx("p",{className:"text-[11px] text-white/50 leading-relaxed",children:"Every rebalancing decision in this Arena is executed via decentralized AI inference on 0G â verifiable on-chain, TeeML-attested, and pay-per-call."}),s.jsx("a",{href:"https://0g.ai",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#c4b5fd] hover:text-[#c4b5fd]/80 transition-colors mt-1.5 inline-block font-medium",children:"Learn more about 0G â"})]})]})]})]}),s.jsxs("div",{className:"bg-card border border-border/50 rounded-2xl p-8 flex flex-col sm:flex-row items-center justify-between gap-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-serif text-xl text-foreground mb-1",children:"Ready to compete?"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Build your own index, deploy it, and watch it trade live against others."})]}),s.jsx(pe,{asChild:!0,className:"shrink-0 bg-foreground text-background hover:bg-foreground
575/90 px-6",children:s.jsx(_e,{to:"/build",children:"Build Your Index â"})})]})]})]}),s.jsx("footer",{className:"bg-foreground text-background mt-20",children:s.jsx("div",{className:"container py-8 text-center text-sm text-background/60",children:s.jsx("p",{children:"© 2026 Openw3b. All rights reserved."})})})]})};function $Ne({page:e,children:t}){const{isAuthenticated:r,isLoading:n,error:i,verifyPassword:a}=_F(),[o,l]=w.useState(""),[c,u]=w.useState(!1);if(n)return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"})});if(r)return s.jsx(s.Fragment,{children:t});const d=async f=>{f.preventDefault(),o.trim()&&await a(o)};return s.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background p-4",children:[s.jsx("div",{className:"absolute top-6 left-6",children:s.jsxs(_e,{to:"/",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(fp,{className:"w-3.5 h-3.5"}),"Back to dAI Index"]})}),s.jsxs("div",{className:"w-full max-w-sm space-y-8",children:[s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 border border-primary/20 flex items-center justify-center",children:s.jsx(Tj,{className:"w-7 h-7 text-primary"})}),s.jsx("span",{className:"absolute -top-2 -right-2 text-[9px] font-bold bg-primary text-primary-foreground rounded-full px-2 py-0.5 leading-tight tracking-wide uppercase",children:"Phase 2"})]}),s.jsxs("div",{className:"text-center space-y-1.5",children:[s.jsx("h1",{className:"font-serif text-2xl text-foreground tracking-tight",children:e}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-xs leading-relaxed",children:"This feature is part of the next release. Enter the preview password to access it early."})]})]}),s.jsxs("form",{onSubmit:d,className:"space-y-3",children:[i&&s.jsxs(fh,{variant:"destructive",children:[s.jsx(Za,{className:"h-4 w-4"}),s.jsx(hh,{children:i})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Hn,{type:c?"text":"password",placeholder:"Preview password",value:o,onChange:f=>l(f.target.value),className:"pr-10",autoFocus:!0}),s.jsx("button",{type:"button",onClick:()=>u(!c),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:c?s.jsx(nR,{className:"h-4 w-4"}):s.jsx(iR,{className:"h-4 w-4"})})]}),s.jsx(pe,{type:"submit",className:"w-full",disabled:n||!o.trim(),children:n?"Verifyingâ¦":"Unlock Preview"})]}),s.jsx("p",{className:"text-center text-xs text-muted-foreground/60",children:"Coming in Phase 2 · Openw3b Tokenized Intelligence"})]})]})}const RNe={momentum:"Momentum",volatility:"Volatility",sentiment:"Sentiment",fundamental:"Fundamental","mean-reversion":"Mean Reversion",custom:"Custom"},INe=({model:e})=>{const t=((e.rebalance_frequency==="daily"?30:e.rebalance_frequency==="weekly"?4:1)*e.cost_per_call_0g).toFixed(4);return s.jsxs("div",{className:"rounded-xl border border-border/50 border-l-4 border-l-primary/50 bg-card p-5 flex flex-col gap-3 transition-colors hover:bg-muted/10",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-medium text-sm uppercase tracking-wide text-foreground leading-tight",children:e.name}),s.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[s.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground bg-muted/40 px-1.5 py-0.5 rounded",children:RNe[e.strategy_type]??e.strategy_type}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:Lk[e.rebalance_frequency]??e.rebalance_frequency})]})]}),s.jsxs("div",{className:"text-right shrink-0",children:[s.jsxs("p",{className:"font-mono text-sm text-foreground",children:[e.cost_per_call_0g," ",s.jsx("span",{className:"text-muted-foreground text-xs",children:"0G / call"})]}),s.jsxs("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["~",t," 0G / mo"]})]})]}),e.llm_model&&s.jsx("div",{children:s.jsx(mh,{llm:e.llm_model})}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:e.description}),s.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/30",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground
575/70",children:["Creator ",Dk(e.creator_address)]}),s.jsxs("span",{className:"text-[10px] text-muted-foreground/70 flex items-center gap-1",children:[s.jsx("span",{className:"text-[hsl(142,71%,45%)] text-xs",children:"â"}),e.total_calls.toLocaleString()," calls"]})]}),s.jsx(_e,{to:"/build",className:"text-xs text-primary font-medium hover:text-primary/80 transition-colors flex items-center gap-0.5",children:"Use in Index â"})]})]})},MNe=()=>{const{data:e=[],isLoading:t}=Ey();return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Vi,{}),s.jsxs("main",{className:"container py-12 space-y-16 max-w-5xl",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx(_e,{to:"/build",className:"hover:text-foreground transition-colors",children:"â Build Index"}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx(_e,{to:"/arena",className:"hover:text-foreground transition-colors",children:"Arena"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-[10px] font-mono font-semibold bg-primary/10 text-primary border border-primary/20 leading-none tracking-wider",children:"0G"}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:"Zero-Gravity Inference Network"})]}),s.jsx("h1",{className:"font-serif text-4xl text-foreground",children:"The 0G Inference Layer"}),s.jsx("p",{className:"text-muted-foreground text-sm max-w-xl leading-relaxed",children:"AI models powering on-chain index rebalancing. Choose a model when building your index, and it will execute autonomous rebalancing decisions â verifiable on Zero-Gravity Mainnet."})]}),s.jsxs("section",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xs uppercase tracking-widest text-muted-foreground font-medium mb-1",children:"Index Rebalancing Models"}),s.jsx("p",{className:"text-foreground font-medium",children:"Community models powering index strategies"}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["These models are available in the"," ",s.jsx(_e,{to:"/build",className:"text-primary hover:text-primary/80",children:"Build Index"})," ","wizard. Each call costs 0G tokens and is recorded on-chain."]})]}),t?s.jsx("div",{className:"text-sm text-muted-foreground py-10 text-center",children:"Loading modelsâ¦"}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.map(r=>s.jsx(INe,{model:r},r.id))})]}),s.jsx("section",{children:s.jsxs("div",{className:"rounded-xl border border-dashed border-border/50 bg-muted/10 p-8 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Deploy Your Own Model"}),s.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-mono font-medium bg-muted/50 text-muted-foreground border border-border/40 leading-none",children:"Phase 2"})]}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed max-w-md",children:"Register your rebalancing strategy on the 0G inference network and earn 0G tokens every time another index uses your model. Join the creator economy."}),s.jsxs("div",{className:"flex items-center gap-4 pt-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/70",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-muted-foreground/40"}),"Endpoint registration"]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/70",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-muted-foreground/40"}),"Inference billing"]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/70",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-muted-foreground/40"}),"Creator earnings"]})]})]}),s.jsx("div",{className:"shrink-0",children:s.jsx("a",{href:"https://docs.
5750g.ai",target:"_blank",rel:"noopener noreferrer",className:X("inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-xs font-medium","bg-muted/30 text-muted-foreground border border-border/40 cursor-not-allowed opacity-60"),children:"Coming in Phase 2"})})]})})]})]})},DNe=()=>{const e=Ao();return w.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},LNe=new D7,FNe=()=>s.jsx(W7,{client:LNe,children:s.jsxs(sd,{children:[s.jsx(rU,{}),s.jsx(RU,{}),s.jsx(Y9,{children:s.jsxs(W9,{children:[s.jsx(tn,{path:"/",element:s.jsx(oSe,{})}),s.jsx(tn,{path:"/rwa",element:s.jsx(ISe,{})}),s.jsx(tn,{path:"/build",element:s.jsx($Ne,{page:"Build Index",children:s.jsx(fNe,{})})}),s.jsx(tn,{path:"/backtest/:indexType",element:s.jsx(HO,{})}),s.jsx(tn,{path:"/backtest",element:s.jsx(HO,{})}),s.jsx(tn,{path:"/methodology",element:s.jsx(WSe,{})}),s.jsx(tn,{path:"/admin",element:s.jsx(Uke,{})}),s.jsx(tn,{path:"/index/:id",element:s.jsx(vNe,{})}),s.jsx(tn,{path:"/arena",element:s.jsx(TNe,{})}),s.jsx(tn,{path:"/models",element:s.jsx(MNe,{})}),s.jsx(tn,{path:"*",element:s.jsx(DNe,{})})]})})]})});j$(document.getElementById("root")).render(s.jsx(FNe,{}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.