aicodeswitch 6.0.1 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1190 @@
1
+ var hD=Object.defineProperty;var mD=(e,t,n)=>t in e?hD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Be=(e,t,n)=>mD(e,typeof t!="symbol"?t+"":t,n);import{E as gD,V as rt,M as Ps,T as As,S as Cw,Q as Xc,a as Ln,R as yD,P as vD,b as S2,c as Ix,O as k2,I as xD,F as Pw,d as xy,e as Fs,W as bD,B as Ox,f as C2,g as wD,h as pp,U as P2,i as fp,j as Ra,k as Iu,L as jD,l as SD,C as kD,m as CD,A as PD,n as Aw,o as AD,p as ED,q as TD,r as ID,D as OD,s as ND,t as Ew,u as Tw,v as Es,w as tc,x as MD,y as RD,z as _D,G as LD,H as DD,J as Iw,K as Ow,N as zD,X as $D,Y as BD,Z as FD}from"./three-CFpmPosW.js";function UD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[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"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var ml=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A2={exports:{}},uh={},E2={exports:{}},it={};/**
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 Ou=Symbol.for("react.element"),WD=Symbol.for("react.portal"),KD=Symbol.for("react.fragment"),HD=Symbol.for("react.strict_mode"),VD=Symbol.for("react.profiler"),qD=Symbol.for("react.provider"),YD=Symbol.for("react.context"),GD=Symbol.for("react.forward_ref"),XD=Symbol.for("react.suspense"),QD=Symbol.for("react.memo"),ZD=Symbol.for("react.lazy"),Nw=Symbol.iterator;function JD(e){return e===null||typeof e!="object"?null:(e=Nw&&e[Nw]||e["@@iterator"],typeof e=="function"?e:null)}var T2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I2=Object.assign,O2={};function _l(e,t,n){this.props=e,this.context=t,this.refs=O2,this.updater=n||T2}_l.prototype.isReactComponent={};_l.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")};_l.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function N2(){}N2.prototype=_l.prototype;function Nx(e,t,n){this.props=e,this.context=t,this.refs=O2,this.updater=n||T2}var Mx=Nx.prototype=new N2;Mx.constructor=Nx;I2(Mx,_l.prototype);Mx.isPureReactComponent=!0;var Mw=Array.isArray,M2=Object.prototype.hasOwnProperty,Rx={current:null},R2={key:!0,ref:!0,__self:!0,__source:!0};function _2(e,t,n){var r,i={},a=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(a=""+t.key),t)M2.call(t,r)&&!R2.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;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(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Ou,type:e,key:a,ref:s,props:i,_owner:Rx.current}}function ez(e,t){return{$$typeof:Ou,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _x(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ou}function tz(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Rw=/\/+/g;function Ym(e,t){return typeof e=="object"&&e!==null&&e.key!=null?tz(""+e.key):t.toString(36)}function hp(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Ou:case WD:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Ym(s,0):r,Mw(i)?(n="",e!=null&&(n=e.replace(Rw,"$&/")+"/"),hp(i,t,n,"",function(u){return u})):i!=null&&(_x(i)&&(i=ez(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(Rw,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Mw(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+Ym(a,l);s+=hp(a,t,n,c,i)}else if(c=JD(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+Ym(a,l++),s+=hp(a,t,n,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 s}function xd(e,t,n){if(e==null)return e;var r=[],i=0;return hp(e,r,"","",function(a){return t.call(n,a,i++)}),r}function nz(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var or={current:null},mp={transition:null},rz={ReactCurrentDispatcher:or,ReactCurrentBatchConfig:mp,ReactCurrentOwner:Rx};function L2(){throw Error("act(...) is not supported in production builds of React.")}it.Children={map:xd,forEach:function(e,t,n){xd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return xd(e,function(){t++}),t},toArray:function(e){return xd(e,function(t){return t})||[]},only:function(e){if(!_x(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};it.Component=_l;it.Fragment=KD;it.Profiler=VD;it.PureComponent=Nx;it.StrictMode=HD;it.Suspense=XD;it.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rz;it.act=L2;it.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=I2({},e.props),i=e.key,a=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,s=Rx.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)M2.call(t,c)&&!R2.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Ou,type:e.type,key:i,ref:a,props:r,_owner:s}};it.createContext=function(e){return e={$$typeof:YD,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:qD,_context:e},e.Consumer=e};it.createElement=_2;it.createFactory=function(e){var t=_2.bind(null,e);return t.type=e,t};it.createRef=function(){return{current:null}};it.forwardRef=function(e){return{$$typeof:GD,render:e}};it.isValidElement=_x;it.lazy=function(e){return{$$typeof:ZD,_payload:{_status:-1,_result:e},_init:nz}};it.memo=function(e,t){return{$$typeof:QD,type:e,compare:t===void 0?null:t}};it.startTransition=function(e){var t=mp.transition;mp.transition={};try{e()}finally{mp.transition=t}};it.unstable_act=L2;it.useCallback=function(e,t){return or.current.useCallback(e,t)};it.useContext=function(e){return or.current.useContext(e)};it.useDebugValue=function(){};it.useDeferredValue=function(e){return or.current.useDeferredValue(e)};it.useEffect=function(e,t){return or.current.useEffect(e,t)};it.useId=function(){return or.current.useId()};it.useImperativeHandle=function(e,t,n){return or.current.useImperativeHandle(e,t,n)};it.useInsertionEffect=function(e,t){return or.current.useInsertionEffect(e,t)};it.useLayoutEffect=function(e,t){return or.current.useLayoutEffect(e,t)};it.useMemo=function(e,t){return or.current.useMemo(e,t)};it.useReducer=function(e,t,n){return or.current.useReducer(e,t,n)};it.useRef=function(e){return or.current.useRef(e)};it.useState=function(e){return or.current.useState(e)};it.useSyncExternalStore=function(e,t,n){return or.current.useSyncExternalStore(e,t,n)};it.useTransition=function(){return or.current.useTransition()};it.version="18.3.1";E2.exports=it;var f=E2.exports;const D2=Rl(f),z2=UD({__proto__:null,default:D2},[f]);/**
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 iz=f,az=Symbol.for("react.element"),oz=Symbol.for("react.fragment"),sz=Object.prototype.hasOwnProperty,lz=iz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,cz={key:!0,ref:!0,__self:!0,__source:!0};function $2(e,t,n){var r,i={},a=null,s=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)sz.call(t,r)&&!cz.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:az,type:e,key:a,ref:s,props:i,_owner:lz.current}}uh.Fragment=oz;uh.jsx=$2;uh.jsxs=$2;A2.exports=uh;var o=A2.exports,by={},B2={exports:{}},Or={},F2={exports:{}},U2={};/**
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(N,W){var P=N.length;N.push(W);e:for(;0<P;){var U=P-1>>>1,le=N[U];if(0<i(le,W))N[U]=W,N[P]=le,P=U;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var W=N[0],P=N.pop();if(P!==W){N[0]=P;e:for(var U=0,le=N.length,E=le>>>1;U<E;){var me=2*(U+1)-1,ye=N[me],Q=me+1,ie=N[Q];if(0>i(ye,P))Q<le&&0>i(ie,ye)?(N[U]=ie,N[Q]=P,U=Q):(N[U]=ye,N[me]=P,U=me);else if(Q<le&&0>i(ie,P))N[U]=ie,N[Q]=P,U=Q;else break e}}return W}function i(N,W){var P=N.sortIndex-W.sortIndex;return P!==0?P:N.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],p=1,d=null,h=3,m=!1,g=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(N){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=N)r(u),W.sortIndex=W.expirationTime,t(c,W);else break;W=n(u)}}function j(N){if(v=!1,w(N),!g)if(n(c)!==null)g=!0,$(k);else{var W=n(u);W!==null&&H(j,W.startTime-N)}}function k(N,W){g=!1,v&&(v=!1,y(T),T=-1),m=!0;var P=h;try{for(w(W),d=n(c);d!==null&&(!(d.expirationTime>W)||N&&!R());){var U=d.callback;if(typeof U=="function"){d.callback=null,h=d.priorityLevel;var le=U(d.expirationTime<=W);W=e.unstable_now(),typeof le=="function"?d.callback=le:d===n(c)&&r(c),w(W)}else r(c);d=n(c)}if(d!==null)var E=!0;else{var me=n(u);me!==null&&H(j,me.startTime-W),E=!1}return E}finally{d=null,h=P,m=!1}}var S=!1,A=null,T=-1,L=5,O=-1;function R(){return!(e.unstable_now()-O<L)}function _(){if(A!==null){var N=e.unstable_now();O=N;var W=!0;try{W=A(!0,N)}finally{W?X():(S=!1,A=null)}}else S=!1}var X;if(typeof b=="function")X=function(){b(_)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,I=q.port2;q.port1.onmessage=_,X=function(){I.postMessage(null)}}else X=function(){x(_,0)};function $(N){A=N,S||(S=!0,X())}function H(N,W){T=x(function(){N(e.unstable_now())},W)}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(N){N.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,$(k))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(N){switch(h){case 1:case 2:case 3:var W=3;break;default:W=h}var P=h;h=W;try{return N()}finally{h=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,W){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var P=h;h=N;try{return W()}finally{h=P}},e.unstable_scheduleCallback=function(N,W,P){var U=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?U+P:U):P=U,N){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=P+le,N={id:p++,callback:W,priorityLevel:N,startTime:P,expirationTime:le,sortIndex:-1},P>U?(N.sortIndex=P,t(u,N),n(c)===null&&N===n(u)&&(v?(y(T),T=-1):v=!0,H(j,P-U))):(N.sortIndex=le,t(c,N),g||m||(g=!0,$(k))),N},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(N){var W=h;return function(){var P=h;h=W;try{return N.apply(this,arguments)}finally{h=P}}}})(U2);F2.exports=U2;var uz=F2.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 dz=f,Tr=uz;function be(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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 W2=new Set,Qc={};function fs(e,t){gl(e,t),gl(e+"Capture",t)}function gl(e,t){for(Qc[e]=t,e=0;e<t.length;e++)W2.add(t[e])}var da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wy=Object.prototype.hasOwnProperty,pz=/^[: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]*$/,_w={},Lw={};function fz(e){return wy.call(Lw,e)?!0:wy.call(_w,e)?!1:pz.test(e)?Lw[e]=!0:(_w[e]=!0,!1)}function hz(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function mz(e,t,n,r){if(t===null||typeof t>"u"||hz(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 sr(e,t,n,r,i,a,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var Bn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Bn[e]=new sr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Bn[t]=new sr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Bn[e]=new sr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Bn[e]=new sr(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){Bn[e]=new sr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Bn[e]=new sr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Bn[e]=new sr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Bn[e]=new sr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Bn[e]=new sr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lx=/[\-:]([a-z])/g;function Dx(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(Lx,Dx);Bn[t]=new sr(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(Lx,Dx);Bn[t]=new sr(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(Lx,Dx);Bn[t]=new sr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Bn[e]=new sr(e,1,!1,e.toLowerCase(),null,!1,!1)});Bn.xlinkHref=new sr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Bn[e]=new sr(e,1,!1,e.toLowerCase(),null,!0,!0)});function zx(e,t,n,r){var i=Bn.hasOwnProperty(t)?Bn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(mz(t,n,i,r)&&(n=null),r||i===null?fz(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var xa=dz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,bd=Symbol.for("react.element"),Us=Symbol.for("react.portal"),Ws=Symbol.for("react.fragment"),$x=Symbol.for("react.strict_mode"),jy=Symbol.for("react.profiler"),K2=Symbol.for("react.provider"),H2=Symbol.for("react.context"),Bx=Symbol.for("react.forward_ref"),Sy=Symbol.for("react.suspense"),ky=Symbol.for("react.suspense_list"),Fx=Symbol.for("react.memo"),_a=Symbol.for("react.lazy"),V2=Symbol.for("react.offscreen"),Dw=Symbol.iterator;function nc(e){return e===null||typeof e!="object"?null:(e=Dw&&e[Dw]||e["@@iterator"],typeof e=="function"?e:null)}var Gt=Object.assign,Gm;function Cc(e){if(Gm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Gm=t&&t[1]||""}return`
34
+ `+Gm+e}var Xm=!1;function Qm(e,t){if(!e||Xm)return"";Xm=!0;var n=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 r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
+ `),a=r.stack.split(`
36
+ `),s=i.length-1,l=a.length-1;1<=s&&0<=l&&i[s]!==a[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==a[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==a[l]){var c=`
37
+ `+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{Xm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cc(e):""}function gz(e){switch(e.tag){case 5:return Cc(e.type);case 16:return Cc("Lazy");case 13:return Cc("Suspense");case 19:return Cc("SuspenseList");case 0:case 2:case 15:return e=Qm(e.type,!1),e;case 11:return e=Qm(e.type.render,!1),e;case 1:return e=Qm(e.type,!0),e;default:return""}}function Cy(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 Ws:return"Fragment";case Us:return"Portal";case jy:return"Profiler";case $x:return"StrictMode";case Sy:return"Suspense";case ky:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case H2:return(e.displayName||"Context")+".Consumer";case K2:return(e._context.displayName||"Context")+".Provider";case Bx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Fx:return t=e.displayName||null,t!==null?t:Cy(e.type)||"Memo";case _a:t=e._payload,e=e._init;try{return Cy(e(t))}catch{}}return null}function yz(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 Cy(t);case 8:return t===$x?"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 no(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function q2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vz(e){var t=q2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wd(e){e._valueTracker||(e._valueTracker=vz(e))}function Y2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=q2(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Rp(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 Py(e,t){var n=t.checked;return Gt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function zw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=no(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function G2(e,t){t=t.checked,t!=null&&zx(e,"checked",t,!1)}function Ay(e,t){G2(e,t);var n=no(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ey(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ey(e,t.type,no(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $w(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ey(e,t,n){(t!=="number"||Rp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Pc=Array.isArray;function il(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+no(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ty(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(be(91));return Gt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Bw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(be(92));if(Pc(n)){if(1<n.length)throw Error(be(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:no(n)}}function X2(e,t){var n=no(t.value),r=no(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Fw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Q2(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 Iy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Q2(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var jd,Z2=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(jd=jd||document.createElement("div"),jd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=jd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Nc={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},xz=["Webkit","ms","Moz","O"];Object.keys(Nc).forEach(function(e){xz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Nc[t]=Nc[e]})});function J2(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Nc.hasOwnProperty(e)&&Nc[e]?(""+t).trim():t+"px"}function eE(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=J2(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var bz=Gt({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 Oy(e,t){if(t){if(bz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(be(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(be(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(be(61))}if(t.style!=null&&typeof t.style!="object")throw Error(be(62))}}function Ny(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 My=null;function Ux(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ry=null,al=null,ol=null;function Uw(e){if(e=Ru(e)){if(typeof Ry!="function")throw Error(be(280));var t=e.stateNode;t&&(t=mh(t),Ry(e.stateNode,e.type,t))}}function tE(e){al?ol?ol.push(e):ol=[e]:al=e}function nE(){if(al){var e=al,t=ol;if(ol=al=null,Uw(e),t)for(e=0;e<t.length;e++)Uw(t[e])}}function rE(e,t){return e(t)}function iE(){}var Zm=!1;function aE(e,t,n){if(Zm)return e(t,n);Zm=!0;try{return rE(e,t,n)}finally{Zm=!1,(al!==null||ol!==null)&&(iE(),nE())}}function Jc(e,t){var n=e.stateNode;if(n===null)return null;var r=mh(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(be(231,t,typeof n));return n}var _y=!1;if(da)try{var rc={};Object.defineProperty(rc,"passive",{get:function(){_y=!0}}),window.addEventListener("test",rc,rc),window.removeEventListener("test",rc,rc)}catch{_y=!1}function wz(e,t,n,r,i,a,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var Mc=!1,_p=null,Lp=!1,Ly=null,jz={onError:function(e){Mc=!0,_p=e}};function Sz(e,t,n,r,i,a,s,l,c){Mc=!1,_p=null,wz.apply(jz,arguments)}function kz(e,t,n,r,i,a,s,l,c){if(Sz.apply(this,arguments),Mc){if(Mc){var u=_p;Mc=!1,_p=null}else throw Error(be(198));Lp||(Lp=!0,Ly=u)}}function hs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function oE(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 Ww(e){if(hs(e)!==e)throw Error(be(188))}function Cz(e){var t=e.alternate;if(!t){if(t=hs(e),t===null)throw Error(be(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Ww(i),e;if(a===r)return Ww(i),t;a=a.sibling}throw Error(be(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(be(189))}}if(n.alternate!==r)throw Error(be(190))}if(n.tag!==3)throw Error(be(188));return n.stateNode.current===n?e:t}function sE(e){return e=Cz(e),e!==null?lE(e):null}function lE(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=lE(e);if(t!==null)return t;e=e.sibling}return null}var cE=Tr.unstable_scheduleCallback,Kw=Tr.unstable_cancelCallback,Pz=Tr.unstable_shouldYield,Az=Tr.unstable_requestPaint,an=Tr.unstable_now,Ez=Tr.unstable_getCurrentPriorityLevel,Wx=Tr.unstable_ImmediatePriority,uE=Tr.unstable_UserBlockingPriority,Dp=Tr.unstable_NormalPriority,Tz=Tr.unstable_LowPriority,dE=Tr.unstable_IdlePriority,dh=null,Li=null;function Iz(e){if(Li&&typeof Li.onCommitFiberRoot=="function")try{Li.onCommitFiberRoot(dh,e,void 0,(e.current.flags&128)===128)}catch{}}var si=Math.clz32?Math.clz32:Mz,Oz=Math.log,Nz=Math.LN2;function Mz(e){return e>>>=0,e===0?32:31-(Oz(e)/Nz|0)|0}var Sd=64,kd=4194304;function Ac(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 zp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Ac(l):(a&=s,a!==0&&(r=Ac(a)))}else s=n&~i,s!==0?r=Ac(s):a!==0&&(r=Ac(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-si(t),i=1<<n,r|=e[n],t&=~i;return r}function Rz(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 _z(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-si(a),l=1<<s,c=i[s];c===-1?(!(l&n)||l&r)&&(i[s]=Rz(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Dy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function pE(){var e=Sd;return Sd<<=1,!(Sd&4194240)&&(Sd=64),e}function Jm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Nu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-si(t),e[t]=n}function Lz(e,t){var n=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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-si(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Kx(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-si(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var jt=0;function fE(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var hE,Hx,mE,gE,yE,zy=!1,Cd=[],Ha=null,Va=null,qa=null,eu=new Map,tu=new Map,$a=[],Dz="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 Hw(e,t){switch(e){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":Va=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":eu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":tu.delete(t.pointerId)}}function ic(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ru(t),t!==null&&Hx(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zz(e,t,n,r,i){switch(t){case"focusin":return Ha=ic(Ha,e,t,n,r,i),!0;case"dragenter":return Va=ic(Va,e,t,n,r,i),!0;case"mouseover":return qa=ic(qa,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return eu.set(a,ic(eu.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,tu.set(a,ic(tu.get(a)||null,e,t,n,r,i)),!0}return!1}function vE(e){var t=Mo(e.target);if(t!==null){var n=hs(t);if(n!==null){if(t=n.tag,t===13){if(t=oE(n),t!==null){e.blockedOn=t,yE(e.priority,function(){mE(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$y(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);My=r,n.target.dispatchEvent(r),My=null}else return t=Ru(n),t!==null&&Hx(t),e.blockedOn=n,!1;t.shift()}return!0}function Vw(e,t,n){gp(e)&&n.delete(t)}function $z(){zy=!1,Ha!==null&&gp(Ha)&&(Ha=null),Va!==null&&gp(Va)&&(Va=null),qa!==null&&gp(qa)&&(qa=null),eu.forEach(Vw),tu.forEach(Vw)}function ac(e,t){e.blockedOn===t&&(e.blockedOn=null,zy||(zy=!0,Tr.unstable_scheduleCallback(Tr.unstable_NormalPriority,$z)))}function nu(e){function t(i){return ac(i,e)}if(0<Cd.length){ac(Cd[0],e);for(var n=1;n<Cd.length;n++){var r=Cd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ha!==null&&ac(Ha,e),Va!==null&&ac(Va,e),qa!==null&&ac(qa,e),eu.forEach(t),tu.forEach(t),n=0;n<$a.length;n++)r=$a[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<$a.length&&(n=$a[0],n.blockedOn===null);)vE(n),n.blockedOn===null&&$a.shift()}var sl=xa.ReactCurrentBatchConfig,$p=!0;function Bz(e,t,n,r){var i=jt,a=sl.transition;sl.transition=null;try{jt=1,Vx(e,t,n,r)}finally{jt=i,sl.transition=a}}function Fz(e,t,n,r){var i=jt,a=sl.transition;sl.transition=null;try{jt=4,Vx(e,t,n,r)}finally{jt=i,sl.transition=a}}function Vx(e,t,n,r){if($p){var i=$y(e,t,n,r);if(i===null)cg(e,t,r,Bp,n),Hw(e,r);else if(zz(i,e,t,n,r))r.stopPropagation();else if(Hw(e,r),t&4&&-1<Dz.indexOf(e)){for(;i!==null;){var a=Ru(i);if(a!==null&&hE(a),a=$y(e,t,n,r),a===null&&cg(e,t,r,Bp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else cg(e,t,r,null,n)}}var Bp=null;function $y(e,t,n,r){if(Bp=null,e=Ux(r),e=Mo(e),e!==null)if(t=hs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=oE(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Bp=e,null}function xE(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(Ez()){case Wx:return 1;case uE:return 4;case Dp:case Tz:return 16;case dE:return 536870912;default:return 16}default:return 16}}var Ua=null,qx=null,yp=null;function bE(){if(yp)return yp;var e,t=qx,n=t.length,r,i="value"in Ua?Ua.value:Ua.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[a-r];r++);return yp=i.slice(e,1<r?1-r:void 0)}function vp(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 Pd(){return!0}function qw(){return!1}function Nr(e){function t(n,r,i,a,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Pd:qw,this.isPropagationStopped=qw,this}return Gt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Pd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Pd)},persist:function(){},isPersistent:Pd}),t}var Ll={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yx=Nr(Ll),Mu=Gt({},Ll,{view:0,detail:0}),Uz=Nr(Mu),eg,tg,oc,ph=Gt({},Mu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gx,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!==oc&&(oc&&e.type==="mousemove"?(eg=e.screenX-oc.screenX,tg=e.screenY-oc.screenY):tg=eg=0,oc=e),eg)},movementY:function(e){return"movementY"in e?e.movementY:tg}}),Yw=Nr(ph),Wz=Gt({},ph,{dataTransfer:0}),Kz=Nr(Wz),Hz=Gt({},Mu,{relatedTarget:0}),ng=Nr(Hz),Vz=Gt({},Ll,{animationName:0,elapsedTime:0,pseudoElement:0}),qz=Nr(Vz),Yz=Gt({},Ll,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gz=Nr(Yz),Xz=Gt({},Ll,{data:0}),Gw=Nr(Xz),Qz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zz={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"},Jz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e4(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jz[e])?!!t[e]:!1}function Gx(){return e4}var t4=Gt({},Mu,{key:function(e){if(e.key){var t=Qz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Zz[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gx,charCode:function(e){return e.type==="keypress"?vp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),n4=Nr(t4),r4=Gt({},ph,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xw=Nr(r4),i4=Gt({},Mu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gx}),a4=Nr(i4),o4=Gt({},Ll,{propertyName:0,elapsedTime:0,pseudoElement:0}),s4=Nr(o4),l4=Gt({},ph,{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}),c4=Nr(l4),u4=[9,13,27,32],Xx=da&&"CompositionEvent"in window,Rc=null;da&&"documentMode"in document&&(Rc=document.documentMode);var d4=da&&"TextEvent"in window&&!Rc,wE=da&&(!Xx||Rc&&8<Rc&&11>=Rc),Qw=" ",Zw=!1;function jE(e,t){switch(e){case"keyup":return u4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function SE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function p4(e,t){switch(e){case"compositionend":return SE(t);case"keypress":return t.which!==32?null:(Zw=!0,Qw);case"textInput":return e=t.data,e===Qw&&Zw?null:e;default:return null}}function f4(e,t){if(Ks)return e==="compositionend"||!Xx&&jE(e,t)?(e=bE(),yp=qx=Ua=null,Ks=!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 wE&&t.locale!=="ko"?null:t.data;default:return null}}var h4={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 Jw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!h4[e.type]:t==="textarea"}function kE(e,t,n,r){tE(r),t=Fp(t,"onChange"),0<t.length&&(n=new Yx("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var _c=null,ru=null;function m4(e){_E(e,0)}function fh(e){var t=qs(e);if(Y2(t))return e}function g4(e,t){if(e==="change")return t}var CE=!1;if(da){var rg;if(da){var ig="oninput"in document;if(!ig){var ej=document.createElement("div");ej.setAttribute("oninput","return;"),ig=typeof ej.oninput=="function"}rg=ig}else rg=!1;CE=rg&&(!document.documentMode||9<document.documentMode)}function tj(){_c&&(_c.detachEvent("onpropertychange",PE),ru=_c=null)}function PE(e){if(e.propertyName==="value"&&fh(ru)){var t=[];kE(t,ru,e,Ux(e)),aE(m4,t)}}function y4(e,t,n){e==="focusin"?(tj(),_c=t,ru=n,_c.attachEvent("onpropertychange",PE)):e==="focusout"&&tj()}function v4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fh(ru)}function x4(e,t){if(e==="click")return fh(t)}function b4(e,t){if(e==="input"||e==="change")return fh(t)}function w4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ci=typeof Object.is=="function"?Object.is:w4;function iu(e,t){if(ci(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!wy.call(t,i)||!ci(e[i],t[i]))return!1}return!0}function nj(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rj(e,t){var n=nj(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=nj(n)}}function AE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?AE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function EE(){for(var e=window,t=Rp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rp(e.document)}return t}function Qx(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 j4(e){var t=EE(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&AE(n.ownerDocument.documentElement,n)){if(r!==null&&Qx(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=rj(n,a);var s=rj(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var S4=da&&"documentMode"in document&&11>=document.documentMode,Hs=null,By=null,Lc=null,Fy=!1;function ij(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fy||Hs==null||Hs!==Rp(r)||(r=Hs,"selectionStart"in r&&Qx(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Lc&&iu(Lc,r)||(Lc=r,r=Fp(By,"onSelect"),0<r.length&&(t=new Yx("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Hs)))}function Ad(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Vs={animationend:Ad("Animation","AnimationEnd"),animationiteration:Ad("Animation","AnimationIteration"),animationstart:Ad("Animation","AnimationStart"),transitionend:Ad("Transition","TransitionEnd")},ag={},TE={};da&&(TE=document.createElement("div").style,"AnimationEvent"in window||(delete Vs.animationend.animation,delete Vs.animationiteration.animation,delete Vs.animationstart.animation),"TransitionEvent"in window||delete Vs.transitionend.transition);function hh(e){if(ag[e])return ag[e];if(!Vs[e])return e;var t=Vs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in TE)return ag[e]=t[n];return e}var IE=hh("animationend"),OE=hh("animationiteration"),NE=hh("animationstart"),ME=hh("transitionend"),RE=new Map,aj="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 so(e,t){RE.set(e,t),fs(t,[e])}for(var og=0;og<aj.length;og++){var sg=aj[og],k4=sg.toLowerCase(),C4=sg[0].toUpperCase()+sg.slice(1);so(k4,"on"+C4)}so(IE,"onAnimationEnd");so(OE,"onAnimationIteration");so(NE,"onAnimationStart");so("dblclick","onDoubleClick");so("focusin","onFocus");so("focusout","onBlur");so(ME,"onTransitionEnd");gl("onMouseEnter",["mouseout","mouseover"]);gl("onMouseLeave",["mouseout","mouseover"]);gl("onPointerEnter",["pointerout","pointerover"]);gl("onPointerLeave",["pointerout","pointerover"]);fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fs("onBeforeInput",["compositionend","keypress","textInput","paste"]);fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ec="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(" "),P4=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ec));function oj(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,kz(r,t,void 0,e),e.currentTarget=null}function _E(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;oj(i,l,u),a=c}else for(s=0;s<r.length;s++){if(l=r[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;oj(i,l,u),a=c}}}if(Lp)throw e=Ly,Lp=!1,Ly=null,e}function Lt(e,t){var n=t[Vy];n===void 0&&(n=t[Vy]=new Set);var r=e+"__bubble";n.has(r)||(LE(t,e,2,!1),n.add(r))}function lg(e,t,n){var r=0;t&&(r|=4),LE(n,e,r,t)}var Ed="_reactListening"+Math.random().toString(36).slice(2);function au(e){if(!e[Ed]){e[Ed]=!0,W2.forEach(function(n){n!=="selectionchange"&&(P4.has(n)||lg(n,!1,e),lg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,lg("selectionchange",!1,t))}}function LE(e,t,n,r){switch(xE(t)){case 1:var i=Bz;break;case 4:i=Fz;break;default:i=Vx}n=i.bind(null,t,n,e),i=void 0,!_y||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function cg(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;l!==null;){if(s=Mo(l),s===null)return;if(c=s.tag,c===5||c===6){r=a=s;continue e}l=l.parentNode}}r=r.return}aE(function(){var u=a,p=Ux(n),d=[];e:{var h=RE.get(e);if(h!==void 0){var m=Yx,g=e;switch(e){case"keypress":if(vp(n)===0)break e;case"keydown":case"keyup":m=n4;break;case"focusin":g="focus",m=ng;break;case"focusout":g="blur",m=ng;break;case"beforeblur":case"afterblur":m=ng;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Yw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Kz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=a4;break;case IE:case OE:case NE:m=qz;break;case ME:m=s4;break;case"scroll":m=Uz;break;case"wheel":m=c4;break;case"copy":case"cut":case"paste":m=Gz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Xw}var v=(t&4)!==0,x=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var b=u,w;b!==null;){w=b;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,y!==null&&(j=Jc(b,y),j!=null&&v.push(ou(b,j,w)))),x)break;b=b.return}0<v.length&&(h=new m(h,g,null,n,p),d.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==My&&(g=n.relatedTarget||n.fromElement)&&(Mo(g)||g[pa]))break e;if((m||h)&&(h=p.window===p?p:(h=p.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?Mo(g):null,g!==null&&(x=hs(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=Yw,j="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(v=Xw,j="onPointerLeave",y="onPointerEnter",b="pointer"),x=m==null?h:qs(m),w=g==null?h:qs(g),h=new v(j,b+"leave",m,n,p),h.target=x,h.relatedTarget=w,j=null,Mo(p)===u&&(v=new v(y,b+"enter",g,n,p),v.target=w,v.relatedTarget=x,j=v),x=j,m&&g)t:{for(v=m,y=g,b=0,w=v;w;w=Ts(w))b++;for(w=0,j=y;j;j=Ts(j))w++;for(;0<b-w;)v=Ts(v),b--;for(;0<w-b;)y=Ts(y),w--;for(;b--;){if(v===y||y!==null&&v===y.alternate)break t;v=Ts(v),y=Ts(y)}v=null}else v=null;m!==null&&sj(d,h,m,v,!1),g!==null&&x!==null&&sj(d,x,g,v,!0)}}e:{if(h=u?qs(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var k=g4;else if(Jw(h))if(CE)k=b4;else{k=v4;var S=y4}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=x4);if(k&&(k=k(e,u))){kE(d,k,n,p);break e}S&&S(e,h,u),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&Ey(h,"number",h.value)}switch(S=u?qs(u):window,e){case"focusin":(Jw(S)||S.contentEditable==="true")&&(Hs=S,By=u,Lc=null);break;case"focusout":Lc=By=Hs=null;break;case"mousedown":Fy=!0;break;case"contextmenu":case"mouseup":case"dragend":Fy=!1,ij(d,n,p);break;case"selectionchange":if(S4)break;case"keydown":case"keyup":ij(d,n,p)}var A;if(Xx)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Ks?jE(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(wE&&n.locale!=="ko"&&(Ks||T!=="onCompositionStart"?T==="onCompositionEnd"&&Ks&&(A=bE()):(Ua=p,qx="value"in Ua?Ua.value:Ua.textContent,Ks=!0)),S=Fp(u,T),0<S.length&&(T=new Gw(T,e,null,n,p),d.push({event:T,listeners:S}),A?T.data=A:(A=SE(n),A!==null&&(T.data=A)))),(A=d4?p4(e,n):f4(e,n))&&(u=Fp(u,"onBeforeInput"),0<u.length&&(p=new Gw("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=A))}_E(d,t)})}function ou(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fp(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Jc(e,n),a!=null&&r.unshift(ou(e,a,i)),a=Jc(e,t),a!=null&&r.push(ou(e,a,i))),e=e.return}return r}function Ts(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function sj(e,t,n,r,i){for(var a=t._reactName,s=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,i?(c=Jc(n,a),c!=null&&s.unshift(ou(n,c,l))):i||(c=Jc(n,a),c!=null&&s.push(ou(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var A4=/\r\n?/g,E4=/\u0000|\uFFFD/g;function lj(e){return(typeof e=="string"?e:""+e).replace(A4,`
38
+ `).replace(E4,"")}function Td(e,t,n){if(t=lj(t),lj(e)!==t&&n)throw Error(be(425))}function Up(){}var Uy=null,Wy=null;function Ky(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 Hy=typeof setTimeout=="function"?setTimeout:void 0,T4=typeof clearTimeout=="function"?clearTimeout:void 0,cj=typeof Promise=="function"?Promise:void 0,I4=typeof queueMicrotask=="function"?queueMicrotask:typeof cj<"u"?function(e){return cj.resolve(null).then(e).catch(O4)}:Hy;function O4(e){setTimeout(function(){throw e})}function ug(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),nu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);nu(t)}function Ya(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 uj(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Dl=Math.random().toString(36).slice(2),Oi="__reactFiber$"+Dl,su="__reactProps$"+Dl,pa="__reactContainer$"+Dl,Vy="__reactEvents$"+Dl,N4="__reactListeners$"+Dl,M4="__reactHandles$"+Dl;function Mo(e){var t=e[Oi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pa]||n[Oi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=uj(e);e!==null;){if(n=e[Oi])return n;e=uj(e)}return t}e=n,n=e.parentNode}return null}function Ru(e){return e=e[Oi]||e[pa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(be(33))}function mh(e){return e[su]||null}var qy=[],Ys=-1;function lo(e){return{current:e}}function $t(e){0>Ys||(e.current=qy[Ys],qy[Ys]=null,Ys--)}function Mt(e,t){Ys++,qy[Ys]=e.current,e.current=t}var ro={},Yn=lo(ro),mr=lo(!1),es=ro;function yl(e,t){var n=e.type.contextTypes;if(!n)return ro;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function gr(e){return e=e.childContextTypes,e!=null}function Wp(){$t(mr),$t(Yn)}function dj(e,t,n){if(Yn.current!==ro)throw Error(be(168));Mt(Yn,t),Mt(mr,n)}function DE(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(be(108,yz(e)||"Unknown",i));return Gt({},n,r)}function Kp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ro,es=Yn.current,Mt(Yn,e),Mt(mr,mr.current),!0}function pj(e,t,n){var r=e.stateNode;if(!r)throw Error(be(169));n?(e=DE(e,t,es),r.__reactInternalMemoizedMergedChildContext=e,$t(mr),$t(Yn),Mt(Yn,e)):$t(mr),Mt(mr,n)}var ta=null,gh=!1,dg=!1;function zE(e){ta===null?ta=[e]:ta.push(e)}function R4(e){gh=!0,zE(e)}function co(){if(!dg&&ta!==null){dg=!0;var e=0,t=jt;try{var n=ta;for(jt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ta=null,gh=!1}catch(i){throw ta!==null&&(ta=ta.slice(e+1)),cE(Wx,co),i}finally{jt=t,dg=!1}}return null}var Gs=[],Xs=0,Hp=null,Vp=0,$r=[],Br=0,ts=null,ra=1,ia="";function Co(e,t){Gs[Xs++]=Vp,Gs[Xs++]=Hp,Hp=e,Vp=t}function $E(e,t,n){$r[Br++]=ra,$r[Br++]=ia,$r[Br++]=ts,ts=e;var r=ra;e=ia;var i=32-si(r)-1;r&=~(1<<i),n+=1;var a=32-si(t)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,ra=1<<32-si(t)+i|n<<i|r,ia=a+e}else ra=1<<a|n<<i|r,ia=e}function Zx(e){e.return!==null&&(Co(e,1),$E(e,1,0))}function Jx(e){for(;e===Hp;)Hp=Gs[--Xs],Gs[Xs]=null,Vp=Gs[--Xs],Gs[Xs]=null;for(;e===ts;)ts=$r[--Br],$r[Br]=null,ia=$r[--Br],$r[Br]=null,ra=$r[--Br],$r[Br]=null}var Ar=null,kr=null,Ut=!1,ii=null;function BE(e,t){var n=Ur(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function fj(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ar=e,kr=Ya(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ar=e,kr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ts!==null?{id:ra,overflow:ia}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ur(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ar=e,kr=null,!0):!1;default:return!1}}function Yy(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gy(e){if(Ut){var t=kr;if(t){var n=t;if(!fj(e,t)){if(Yy(e))throw Error(be(418));t=Ya(n.nextSibling);var r=Ar;t&&fj(e,t)?BE(r,n):(e.flags=e.flags&-4097|2,Ut=!1,Ar=e)}}else{if(Yy(e))throw Error(be(418));e.flags=e.flags&-4097|2,Ut=!1,Ar=e}}}function hj(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ar=e}function Id(e){if(e!==Ar)return!1;if(!Ut)return hj(e),Ut=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ky(e.type,e.memoizedProps)),t&&(t=kr)){if(Yy(e))throw FE(),Error(be(418));for(;t;)BE(e,t),t=Ya(t.nextSibling)}if(hj(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(be(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kr=Ya(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kr=null}}else kr=Ar?Ya(e.stateNode.nextSibling):null;return!0}function FE(){for(var e=kr;e;)e=Ya(e.nextSibling)}function vl(){kr=Ar=null,Ut=!1}function e0(e){ii===null?ii=[e]:ii.push(e)}var _4=xa.ReactCurrentBatchConfig;function sc(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(be(309));var r=n.stateNode}if(!r)throw Error(be(147,e));var i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(s){var l=i.refs;s===null?delete l[a]:l[a]=s},t._stringRef=a,t)}if(typeof e!="string")throw Error(be(284));if(!n._owner)throw Error(be(290,e))}return e}function Od(e,t){throw e=Object.prototype.toString.call(t),Error(be(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mj(e){var t=e._init;return t(e._payload)}function UE(e){function t(y,b){if(e){var w=y.deletions;w===null?(y.deletions=[b],y.flags|=16):w.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function i(y,b){return y=Za(y,b),y.index=0,y.sibling=null,y}function a(y,b,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<b?(y.flags|=2,b):w):(y.flags|=2,b)):(y.flags|=1048576,b)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,w,j){return b===null||b.tag!==6?(b=vg(w,y.mode,j),b.return=y,b):(b=i(b,w),b.return=y,b)}function c(y,b,w,j){var k=w.type;return k===Ws?p(y,b,w.props.children,j,w.key):b!==null&&(b.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_a&&mj(k)===b.type)?(j=i(b,w.props),j.ref=sc(y,b,w),j.return=y,j):(j=Cp(w.type,w.key,w.props,null,y.mode,j),j.ref=sc(y,b,w),j.return=y,j)}function u(y,b,w,j){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=xg(w,y.mode,j),b.return=y,b):(b=i(b,w.children||[]),b.return=y,b)}function p(y,b,w,j,k){return b===null||b.tag!==7?(b=Vo(w,y.mode,j,k),b.return=y,b):(b=i(b,w),b.return=y,b)}function d(y,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=vg(""+b,y.mode,w),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case bd:return w=Cp(b.type,b.key,b.props,null,y.mode,w),w.ref=sc(y,null,b),w.return=y,w;case Us:return b=xg(b,y.mode,w),b.return=y,b;case _a:var j=b._init;return d(y,j(b._payload),w)}if(Pc(b)||nc(b))return b=Vo(b,y.mode,w,null),b.return=y,b;Od(y,b)}return null}function h(y,b,w,j){var k=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return k!==null?null:l(y,b,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case bd:return w.key===k?c(y,b,w,j):null;case Us:return w.key===k?u(y,b,w,j):null;case _a:return k=w._init,h(y,b,k(w._payload),j)}if(Pc(w)||nc(w))return k!==null?null:p(y,b,w,j,null);Od(y,w)}return null}function m(y,b,w,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return y=y.get(w)||null,l(b,y,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case bd:return y=y.get(j.key===null?w:j.key)||null,c(b,y,j,k);case Us:return y=y.get(j.key===null?w:j.key)||null,u(b,y,j,k);case _a:var S=j._init;return m(y,b,w,S(j._payload),k)}if(Pc(j)||nc(j))return y=y.get(w)||null,p(b,y,j,k,null);Od(b,j)}return null}function g(y,b,w,j){for(var k=null,S=null,A=b,T=b=0,L=null;A!==null&&T<w.length;T++){A.index>T?(L=A,A=null):L=A.sibling;var O=h(y,A,w[T],j);if(O===null){A===null&&(A=L);break}e&&A&&O.alternate===null&&t(y,A),b=a(O,b,T),S===null?k=O:S.sibling=O,S=O,A=L}if(T===w.length)return n(y,A),Ut&&Co(y,T),k;if(A===null){for(;T<w.length;T++)A=d(y,w[T],j),A!==null&&(b=a(A,b,T),S===null?k=A:S.sibling=A,S=A);return Ut&&Co(y,T),k}for(A=r(y,A);T<w.length;T++)L=m(A,y,T,w[T],j),L!==null&&(e&&L.alternate!==null&&A.delete(L.key===null?T:L.key),b=a(L,b,T),S===null?k=L:S.sibling=L,S=L);return e&&A.forEach(function(R){return t(y,R)}),Ut&&Co(y,T),k}function v(y,b,w,j){var k=nc(w);if(typeof k!="function")throw Error(be(150));if(w=k.call(w),w==null)throw Error(be(151));for(var S=k=null,A=b,T=b=0,L=null,O=w.next();A!==null&&!O.done;T++,O=w.next()){A.index>T?(L=A,A=null):L=A.sibling;var R=h(y,A,O.value,j);if(R===null){A===null&&(A=L);break}e&&A&&R.alternate===null&&t(y,A),b=a(R,b,T),S===null?k=R:S.sibling=R,S=R,A=L}if(O.done)return n(y,A),Ut&&Co(y,T),k;if(A===null){for(;!O.done;T++,O=w.next())O=d(y,O.value,j),O!==null&&(b=a(O,b,T),S===null?k=O:S.sibling=O,S=O);return Ut&&Co(y,T),k}for(A=r(y,A);!O.done;T++,O=w.next())O=m(A,y,T,O.value,j),O!==null&&(e&&O.alternate!==null&&A.delete(O.key===null?T:O.key),b=a(O,b,T),S===null?k=O:S.sibling=O,S=O);return e&&A.forEach(function(_){return t(y,_)}),Ut&&Co(y,T),k}function x(y,b,w,j){if(typeof w=="object"&&w!==null&&w.type===Ws&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case bd:e:{for(var k=w.key,S=b;S!==null;){if(S.key===k){if(k=w.type,k===Ws){if(S.tag===7){n(y,S.sibling),b=i(S,w.props.children),b.return=y,y=b;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_a&&mj(k)===S.type){n(y,S.sibling),b=i(S,w.props),b.ref=sc(y,S,w),b.return=y,y=b;break e}n(y,S);break}else t(y,S);S=S.sibling}w.type===Ws?(b=Vo(w.props.children,y.mode,j,w.key),b.return=y,y=b):(j=Cp(w.type,w.key,w.props,null,y.mode,j),j.ref=sc(y,b,w),j.return=y,y=j)}return s(y);case Us:e:{for(S=w.key;b!==null;){if(b.key===S)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(y,b.sibling),b=i(b,w.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=xg(w,y.mode,j),b.return=y,y=b}return s(y);case _a:return S=w._init,x(y,b,S(w._payload),j)}if(Pc(w))return g(y,b,w,j);if(nc(w))return v(y,b,w,j);Od(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(y,b.sibling),b=i(b,w),b.return=y,y=b):(n(y,b),b=vg(w,y.mode,j),b.return=y,y=b),s(y)):n(y,b)}return x}var xl=UE(!0),WE=UE(!1),qp=lo(null),Yp=null,Qs=null,t0=null;function n0(){t0=Qs=Yp=null}function r0(e){var t=qp.current;$t(qp),e._currentValue=t}function Xy(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ll(e,t){Yp=e,t0=Qs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pr=!0),e.firstContext=null)}function Vr(e){var t=e._currentValue;if(t0!==e)if(e={context:e,memoizedValue:t,next:null},Qs===null){if(Yp===null)throw Error(be(308));Qs=e,Yp.dependencies={lanes:0,firstContext:e}}else Qs=Qs.next=e;return t}var Ro=null;function i0(e){Ro===null?Ro=[e]:Ro.push(e)}function KE(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,i0(t)):(n.next=i.next,i.next=n),t.interleaved=n,fa(e,r)}function fa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var La=!1;function a0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function HE(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 la(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ft&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,fa(e,n)}return i=r.interleaved,i===null?(t.next=t,i0(r)):(t.next=i.next,i.next=t),r.interleaved=t,fa(e,n)}function xp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kx(e,n)}}function gj(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Gp(e,t,n,r){var i=e.updateQueue;La=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?a=u:s.next=u,s=c;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==s&&(l===null?p.firstBaseUpdate=u:l.next=u,p.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;s=0,p=u=c=null,l=a;do{var h=l.lane,m=l.eventTime;if((r&h)===h){p!==null&&(p=p.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(h=t,m=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){d=g.call(m,d,h);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(m,d,h):g,h==null)break e;d=Gt({},d,h);break e;case 2:La=!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},p===null?(u=p=m,c=d):p=p.next=m,s|=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(p===null&&(c=d),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);rs|=s,e.lanes=s,e.memoizedState=d}}function yj(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(be(191,i));i.call(r)}}}var _u={},Di=lo(_u),lu=lo(_u),cu=lo(_u);function _o(e){if(e===_u)throw Error(be(174));return e}function o0(e,t){switch(Mt(cu,t),Mt(lu,e),Mt(Di,_u),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Iy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Iy(t,e)}$t(Di),Mt(Di,t)}function bl(){$t(Di),$t(lu),$t(cu)}function VE(e){_o(cu.current);var t=_o(Di.current),n=Iy(t,e.type);t!==n&&(Mt(lu,e),Mt(Di,n))}function s0(e){lu.current===e&&($t(Di),$t(lu))}var Vt=lo(0);function Xp(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 pg=[];function l0(){for(var e=0;e<pg.length;e++)pg[e]._workInProgressVersionPrimary=null;pg.length=0}var bp=xa.ReactCurrentDispatcher,fg=xa.ReactCurrentBatchConfig,ns=0,qt=null,yn=null,Sn=null,Qp=!1,Dc=!1,uu=0,L4=0;function Fn(){throw Error(be(321))}function c0(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ci(e[n],t[n]))return!1;return!0}function u0(e,t,n,r,i,a){if(ns=a,qt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bp.current=e===null||e.memoizedState===null?B4:F4,e=n(r,i),Dc){a=0;do{if(Dc=!1,uu=0,25<=a)throw Error(be(301));a+=1,Sn=yn=null,t.updateQueue=null,bp.current=U4,e=n(r,i)}while(Dc)}if(bp.current=Zp,t=yn!==null&&yn.next!==null,ns=0,Sn=yn=qt=null,Qp=!1,t)throw Error(be(300));return e}function d0(){var e=uu!==0;return uu=0,e}function Pi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?qt.memoizedState=Sn=e:Sn=Sn.next=e,Sn}function qr(){if(yn===null){var e=qt.alternate;e=e!==null?e.memoizedState:null}else e=yn.next;var t=Sn===null?qt.memoizedState:Sn.next;if(t!==null)Sn=t,yn=e;else{if(e===null)throw Error(be(310));yn=e,e={memoizedState:yn.memoizedState,baseState:yn.baseState,baseQueue:yn.baseQueue,queue:yn.queue,next:null},Sn===null?qt.memoizedState=Sn=e:Sn=Sn.next=e}return Sn}function du(e,t){return typeof t=="function"?t(e):t}function hg(e){var t=qr(),n=t.queue;if(n===null)throw Error(be(311));n.lastRenderedReducer=e;var r=yn,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var l=s=null,c=null,u=a;do{var p=u.lane;if((ns&p)===p)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:p,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,s=r):c=c.next=d,qt.lanes|=p,rs|=p}u=u.next}while(u!==null&&u!==a);c===null?s=r:c.next=l,ci(r,t.memoizedState)||(pr=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,qt.lanes|=a,rs|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function mg(e){var t=qr(),n=t.queue;if(n===null)throw Error(be(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);ci(a,t.memoizedState)||(pr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function qE(){}function YE(e,t){var n=qt,r=qr(),i=t(),a=!ci(r.memoizedState,i);if(a&&(r.memoizedState=i,pr=!0),r=r.queue,p0(QE.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Sn!==null&&Sn.memoizedState.tag&1){if(n.flags|=2048,pu(9,XE.bind(null,n,r,i,t),void 0,null),Cn===null)throw Error(be(349));ns&30||GE(n,t,i)}return i}function GE(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=qt.updateQueue,t===null?(t={lastEffect:null,stores:null},qt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function XE(e,t,n,r){t.value=n,t.getSnapshot=r,ZE(t)&&JE(e)}function QE(e,t,n){return n(function(){ZE(t)&&JE(e)})}function ZE(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ci(e,n)}catch{return!0}}function JE(e){var t=fa(e,1);t!==null&&li(t,e,1,-1)}function vj(e){var t=Pi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:du,lastRenderedState:e},t.queue=e,e=e.dispatch=$4.bind(null,qt,e),[t.memoizedState,e]}function pu(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=qt.updateQueue,t===null?(t={lastEffect:null,stores:null},qt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function eT(){return qr().memoizedState}function wp(e,t,n,r){var i=Pi();qt.flags|=e,i.memoizedState=pu(1|t,n,void 0,r===void 0?null:r)}function yh(e,t,n,r){var i=qr();r=r===void 0?null:r;var a=void 0;if(yn!==null){var s=yn.memoizedState;if(a=s.destroy,r!==null&&c0(r,s.deps)){i.memoizedState=pu(t,n,a,r);return}}qt.flags|=e,i.memoizedState=pu(1|t,n,a,r)}function xj(e,t){return wp(8390656,8,e,t)}function p0(e,t){return yh(2048,8,e,t)}function tT(e,t){return yh(4,2,e,t)}function nT(e,t){return yh(4,4,e,t)}function rT(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 iT(e,t,n){return n=n!=null?n.concat([e]):null,yh(4,4,rT.bind(null,t,e),n)}function f0(){}function aT(e,t){var n=qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&c0(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function oT(e,t){var n=qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&c0(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function sT(e,t,n){return ns&21?(ci(n,t)||(n=pE(),qt.lanes|=n,rs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,pr=!0),e.memoizedState=n)}function D4(e,t){var n=jt;jt=n!==0&&4>n?n:4,e(!0);var r=fg.transition;fg.transition={};try{e(!1),t()}finally{jt=n,fg.transition=r}}function lT(){return qr().memoizedState}function z4(e,t,n){var r=Qa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cT(e))uT(t,n);else if(n=KE(e,t,n,r),n!==null){var i=rr();li(n,e,r,i),dT(n,t,r)}}function $4(e,t,n){var r=Qa(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cT(e))uT(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,l=a(s,n);if(i.hasEagerState=!0,i.eagerState=l,ci(l,s)){var c=t.interleaved;c===null?(i.next=i,i0(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=KE(e,t,i,r),n!==null&&(i=rr(),li(n,e,r,i),dT(n,t,r))}}function cT(e){var t=e.alternate;return e===qt||t!==null&&t===qt}function uT(e,t){Dc=Qp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kx(e,n)}}var Zp={readContext:Vr,useCallback:Fn,useContext:Fn,useEffect:Fn,useImperativeHandle:Fn,useInsertionEffect:Fn,useLayoutEffect:Fn,useMemo:Fn,useReducer:Fn,useRef:Fn,useState:Fn,useDebugValue:Fn,useDeferredValue:Fn,useTransition:Fn,useMutableSource:Fn,useSyncExternalStore:Fn,useId:Fn,unstable_isNewReconciler:!1},B4={readContext:Vr,useCallback:function(e,t){return Pi().memoizedState=[e,t===void 0?null:t],e},useContext:Vr,useEffect:xj,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wp(4194308,4,rT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wp(4194308,4,e,t)},useInsertionEffect:function(e,t){return wp(4,2,e,t)},useMemo:function(e,t){var n=Pi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=z4.bind(null,qt,e),[r.memoizedState,e]},useRef:function(e){var t=Pi();return e={current:e},t.memoizedState=e},useState:vj,useDebugValue:f0,useDeferredValue:function(e){return Pi().memoizedState=e},useTransition:function(){var e=vj(!1),t=e[0];return e=D4.bind(null,e[1]),Pi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=qt,i=Pi();if(Ut){if(n===void 0)throw Error(be(407));n=n()}else{if(n=t(),Cn===null)throw Error(be(349));ns&30||GE(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,xj(QE.bind(null,r,a,e),[e]),r.flags|=2048,pu(9,XE.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Pi(),t=Cn.identifierPrefix;if(Ut){var n=ia,r=ra;n=(r&~(1<<32-si(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=uu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=L4++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},F4={readContext:Vr,useCallback:aT,useContext:Vr,useEffect:p0,useImperativeHandle:iT,useInsertionEffect:tT,useLayoutEffect:nT,useMemo:oT,useReducer:hg,useRef:eT,useState:function(){return hg(du)},useDebugValue:f0,useDeferredValue:function(e){var t=qr();return sT(t,yn.memoizedState,e)},useTransition:function(){var e=hg(du)[0],t=qr().memoizedState;return[e,t]},useMutableSource:qE,useSyncExternalStore:YE,useId:lT,unstable_isNewReconciler:!1},U4={readContext:Vr,useCallback:aT,useContext:Vr,useEffect:p0,useImperativeHandle:iT,useInsertionEffect:tT,useLayoutEffect:nT,useMemo:oT,useReducer:mg,useRef:eT,useState:function(){return mg(du)},useDebugValue:f0,useDeferredValue:function(e){var t=qr();return yn===null?t.memoizedState=e:sT(t,yn.memoizedState,e)},useTransition:function(){var e=mg(du)[0],t=qr().memoizedState;return[e,t]},useMutableSource:qE,useSyncExternalStore:YE,useId:lT,unstable_isNewReconciler:!1};function ti(e,t){if(e&&e.defaultProps){t=Gt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Qy(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Gt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vh={isMounted:function(e){return(e=e._reactInternals)?hs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=rr(),i=Qa(e),a=la(r,i);a.payload=t,n!=null&&(a.callback=n),t=Ga(e,a,i),t!==null&&(li(t,e,i,r),xp(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=rr(),i=Qa(e),a=la(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Ga(e,a,i),t!==null&&(li(t,e,i,r),xp(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=rr(),r=Qa(e),i=la(n,r);i.tag=2,t!=null&&(i.callback=t),t=Ga(e,i,r),t!==null&&(li(t,e,r,n),xp(t,e,r))}};function bj(e,t,n,r,i,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,s):t.prototype&&t.prototype.isPureReactComponent?!iu(n,r)||!iu(i,a):!0}function pT(e,t,n){var r=!1,i=ro,a=t.contextType;return typeof a=="object"&&a!==null?a=Vr(a):(i=gr(t)?es:Yn.current,r=t.contextTypes,a=(r=r!=null)?yl(e,i):ro),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=vh,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function wj(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&vh.enqueueReplaceState(t,t.state,null)}function Zy(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},a0(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Vr(a):(a=gr(t)?es:Yn.current,i.context=yl(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Qy(e,t,a,n),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&&vh.enqueueReplaceState(i,i.state,null),Gp(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function wl(e,t){try{var n="",r=t;do n+=gz(r),r=r.return;while(r);var i=n}catch(a){i=`
39
+ Error generating stack: `+a.message+`
40
+ `+a.stack}return{value:e,source:t,stack:i,digest:null}}function gg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Jy(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var W4=typeof WeakMap=="function"?WeakMap:Map;function fT(e,t,n){n=la(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ef||(ef=!0,cv=r),Jy(e,t)},n}function hT(e,t,n){n=la(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Jy(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Jy(e,t),typeof r!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function jj(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new W4;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=r$.bind(null,e,t,n),t.then(e,e))}function Sj(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 kj(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=la(-1,1),t.tag=2,Ga(n,t,1))),n.lanes|=1),e)}var K4=xa.ReactCurrentOwner,pr=!1;function tr(e,t,n,r){t.child=e===null?WE(t,null,n,r):xl(t,e.child,n,r)}function Cj(e,t,n,r,i){n=n.render;var a=t.ref;return ll(t,i),r=u0(e,t,n,r,a,i),n=d0(),e!==null&&!pr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ha(e,t,i)):(Ut&&n&&Zx(t),t.flags|=1,tr(e,t,r,i),t.child)}function Pj(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!w0(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,mT(e,t,a,r,i)):(e=Cp(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:iu,n(s,r)&&e.ref===t.ref)return ha(e,t,i)}return t.flags|=1,e=Za(a,r),e.ref=t.ref,e.return=t,t.child=e}function mT(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(iu(a,r)&&e.ref===t.ref)if(pr=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(pr=!0);else return t.lanes=e.lanes,ha(e,t,i)}return ev(e,t,n,r,i)}function gT(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mt(Js,jr),jr|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Mt(Js,jr),jr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Mt(Js,jr),jr|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Mt(Js,jr),jr|=r;return tr(e,t,i,n),t.child}function yT(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ev(e,t,n,r,i){var a=gr(n)?es:Yn.current;return a=yl(t,a),ll(t,i),n=u0(e,t,n,r,a,i),r=d0(),e!==null&&!pr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ha(e,t,i)):(Ut&&r&&Zx(t),t.flags|=1,tr(e,t,n,i),t.child)}function Aj(e,t,n,r,i){if(gr(n)){var a=!0;Kp(t)}else a=!1;if(ll(t,i),t.stateNode===null)jp(e,t),pT(t,n,r),Zy(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Vr(u):(u=gr(n)?es:Yn.current,u=yl(t,u));var p=n.getDerivedStateFromProps,d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||c!==u)&&wj(t,s,r,u),La=!1;var h=t.memoizedState;s.state=h,Gp(t,r,s,i),c=t.memoizedState,l!==r||h!==c||mr.current||La?(typeof p=="function"&&(Qy(t,n,p,r),c=t.memoizedState),(l=La||bj(t,n,l,r,h,c,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,HE(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ti(t.type,l),s.props=u,d=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=Vr(c):(c=gr(n)?es:Yn.current,c=yl(t,c));var m=n.getDerivedStateFromProps;(p=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||h!==c)&&wj(t,s,r,c),La=!1,h=t.memoizedState,s.state=h,Gp(t,r,s,i);var g=t.memoizedState;l!==d||h!==g||mr.current||La?(typeof m=="function"&&(Qy(t,n,m,r),g=t.memoizedState),(u=La||bj(t,n,u,r,h,g,c)||!1)?(p||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return tv(e,t,n,r,a,i)}function tv(e,t,n,r,i,a){yT(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&pj(t,n,!1),ha(e,t,a);r=t.stateNode,K4.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=xl(t,e.child,null,a),t.child=xl(t,null,l,a)):tr(e,t,l,a),t.memoizedState=r.state,i&&pj(t,n,!0),t.child}function vT(e){var t=e.stateNode;t.pendingContext?dj(e,t.pendingContext,t.pendingContext!==t.context):t.context&&dj(e,t.context,!1),o0(e,t.containerInfo)}function Ej(e,t,n,r,i){return vl(),e0(i),t.flags|=256,tr(e,t,n,r),t.child}var nv={dehydrated:null,treeContext:null,retryLane:0};function rv(e){return{baseLanes:e,cachePool:null,transitions:null}}function xT(e,t,n){var r=t.pendingProps,i=Vt.current,a=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Mt(Vt,i&1),e===null)return Gy(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):(s=r.children,e=r.fallback,a?(r=t.mode,a=t.child,s={mode:"hidden",children:s},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=wh(s,r,0,null),e=Vo(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=rv(n),t.memoizedState=nv,e):h0(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return H4(e,t,s,r,l,i,n);if(a){a=r.fallback,s=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Za(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Za(l,a):(a=Vo(a,s,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,s=e.child.memoizedState,s=s===null?rv(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=nv,r}return a=e.child,e=a.sibling,r=Za(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function h0(e,t){return t=wh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Nd(e,t,n,r){return r!==null&&e0(r),xl(t,e.child,null,n),e=h0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function H4(e,t,n,r,i,a,s){if(n)return t.flags&256?(t.flags&=-257,r=gg(Error(be(422))),Nd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=wh({mode:"visible",children:r.children},i,0,null),a=Vo(a,i,s,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&xl(t,e.child,null,s),t.child.memoizedState=rv(s),t.memoizedState=nv,a);if(!(t.mode&1))return Nd(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(be(419)),r=gg(a,r,void 0),Nd(e,t,s,r)}if(l=(s&e.childLanes)!==0,pr||l){if(r=Cn,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,fa(e,i),li(r,e,i,-1))}return b0(),r=gg(Error(be(421))),Nd(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=i$.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,kr=Ya(i.nextSibling),Ar=t,Ut=!0,ii=null,e!==null&&($r[Br++]=ra,$r[Br++]=ia,$r[Br++]=ts,ra=e.id,ia=e.overflow,ts=t),t=h0(t,r.children),t.flags|=4096,t)}function Tj(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xy(e.return,t,n)}function yg(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function bT(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(tr(e,t,r.children,n),r=Vt.current,r&2)r=r&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&&Tj(e,n,t);else if(e.tag===19)Tj(e,n,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}r&=1}if(Mt(Vt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Xp(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),yg(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Xp(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}yg(t,!0,n,null,a);break;case"together":yg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function jp(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ha(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),rs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(be(153));if(t.child!==null){for(e=t.child,n=Za(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Za(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function V4(e,t,n){switch(t.tag){case 3:vT(t),vl();break;case 5:VE(t);break;case 1:gr(t.type)&&Kp(t);break;case 4:o0(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Mt(qp,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Mt(Vt,Vt.current&1),t.flags|=128,null):n&t.child.childLanes?xT(e,t,n):(Mt(Vt,Vt.current&1),e=ha(e,t,n),e!==null?e.sibling:null);Mt(Vt,Vt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return bT(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Mt(Vt,Vt.current),r)break;return null;case 22:case 23:return t.lanes=0,gT(e,t,n)}return ha(e,t,n)}var wT,iv,jT,ST;wT=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};iv=function(){};jT=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_o(Di.current);var a=null;switch(n){case"input":i=Py(e,i),r=Py(e,r),a=[];break;case"select":i=Gt({},i,{value:void 0}),r=Gt({},r,{value:void 0}),a=[];break;case"textarea":i=Ty(e,i),r=Ty(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Up)}Oy(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Qc.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(l=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(a||(a=[]),a.push(u,n)),n=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"&&(Qc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Lt("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};ST=function(e,t,n,r){n!==r&&(t.flags|=4)};function lc(e,t){if(!Ut)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Un(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function q4(e,t,n){var r=t.pendingProps;switch(Jx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Un(t),null;case 1:return gr(t.type)&&Wp(),Un(t),null;case 3:return r=t.stateNode,bl(),$t(mr),$t(Yn),l0(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Id(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ii!==null&&(pv(ii),ii=null))),iv(e,t),Un(t),null;case 5:s0(t);var i=_o(cu.current);if(n=t.type,e!==null&&t.stateNode!=null)jT(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(be(166));return Un(t),null}if(e=_o(Di.current),Id(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Oi]=t,r[su]=a,e=(t.mode&1)!==0,n){case"dialog":Lt("cancel",r),Lt("close",r);break;case"iframe":case"object":case"embed":Lt("load",r);break;case"video":case"audio":for(i=0;i<Ec.length;i++)Lt(Ec[i],r);break;case"source":Lt("error",r);break;case"img":case"image":case"link":Lt("error",r),Lt("load",r);break;case"details":Lt("toggle",r);break;case"input":zw(r,a),Lt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Lt("invalid",r);break;case"textarea":Bw(r,a),Lt("invalid",r)}Oy(n,a),i=null;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="children"?typeof l=="string"?r.textContent!==l&&(a.suppressHydrationWarning!==!0&&Td(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Td(r.textContent,l,e),i=["children",""+l]):Qc.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&Lt("scroll",r)}switch(n){case"input":wd(r),$w(r,a,!0);break;case"textarea":wd(r),Fw(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Up)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Q2(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Oi]=t,e[su]=r,wT(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ny(n,r),n){case"dialog":Lt("cancel",e),Lt("close",e),i=r;break;case"iframe":case"object":case"embed":Lt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ec.length;i++)Lt(Ec[i],e);i=r;break;case"source":Lt("error",e),i=r;break;case"img":case"image":case"link":Lt("error",e),Lt("load",e),i=r;break;case"details":Lt("toggle",e),i=r;break;case"input":zw(e,r),i=Py(e,r),Lt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Gt({},r,{value:void 0}),Lt("invalid",e);break;case"textarea":Bw(e,r),i=Ty(e,r),Lt("invalid",e);break;default:i=r}Oy(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?eE(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Z2(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Zc(e,c):typeof c=="number"&&Zc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Qc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&Lt("scroll",e):c!=null&&zx(e,a,c,s))}switch(n){case"input":wd(e),$w(e,r,!1);break;case"textarea":wd(e),Fw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+no(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?il(e,!!r.multiple,a,!1):r.defaultValue!=null&&il(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Up)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Un(t),null;case 6:if(e&&t.stateNode!=null)ST(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(be(166));if(n=_o(cu.current),_o(Di.current),Id(t)){if(r=t.stateNode,n=t.memoizedProps,r[Oi]=t,(a=r.nodeValue!==n)&&(e=Ar,e!==null))switch(e.tag){case 3:Td(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Td(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Oi]=t,t.stateNode=r}return Un(t),null;case 13:if($t(Vt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ut&&kr!==null&&t.mode&1&&!(t.flags&128))FE(),vl(),t.flags|=98560,a=!1;else if(a=Id(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(be(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(be(317));a[Oi]=t}else vl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Un(t),a=!1}else ii!==null&&(pv(ii),ii=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Vt.current&1?vn===0&&(vn=3):b0())),t.updateQueue!==null&&(t.flags|=4),Un(t),null);case 4:return bl(),iv(e,t),e===null&&au(t.stateNode.containerInfo),Un(t),null;case 10:return r0(t.type._context),Un(t),null;case 17:return gr(t.type)&&Wp(),Un(t),null;case 19:if($t(Vt),a=t.memoizedState,a===null)return Un(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)lc(a,!1);else{if(vn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Xp(e),s!==null){for(t.flags|=128,lc(a,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,s=a.alternate,s===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=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,e=s.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Mt(Vt,Vt.current&1|2),t.child}e=e.sibling}a.tail!==null&&an()>jl&&(t.flags|=128,r=!0,lc(a,!1),t.lanes=4194304)}else{if(!r)if(e=Xp(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lc(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Ut)return Un(t),null}else 2*an()-a.renderingStartTime>jl&&n!==1073741824&&(t.flags|=128,r=!0,lc(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(n=a.last,n!==null?n.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=an(),t.sibling=null,n=Vt.current,Mt(Vt,r?n&1|2:n&1),t):(Un(t),null);case 22:case 23:return x0(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?jr&1073741824&&(Un(t),t.subtreeFlags&6&&(t.flags|=8192)):Un(t),null;case 24:return null;case 25:return null}throw Error(be(156,t.tag))}function Y4(e,t){switch(Jx(t),t.tag){case 1:return gr(t.type)&&Wp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bl(),$t(mr),$t(Yn),l0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return s0(t),null;case 13:if($t(Vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(be(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $t(Vt),null;case 4:return bl(),null;case 10:return r0(t.type._context),null;case 22:case 23:return x0(),null;case 24:return null;default:return null}}var Md=!1,Hn=!1,G4=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Zs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){tn(e,t,r)}else n.current=null}function av(e,t,n){try{n()}catch(r){tn(e,t,r)}}var Ij=!1;function X4(e,t){if(Uy=$p,e=EE(),Qx(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,l=-1,c=-1,u=0,p=0,d=e,h=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==a||r!==0&&d.nodeType!==3||(c=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(m=d.firstChild)!==null;)h=d,d=m;for(;;){if(d===e)break t;if(h===n&&++u===i&&(l=s),h===a&&++p===r&&(c=s),(m=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wy={focusedElem:e,selectionRange:n},$p=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;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 v=g.memoizedProps,x=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:ti(t.type,v),x);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(be(163))}}catch(j){tn(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return g=Ij,Ij=!1,g}function zc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&av(t,n,a)}i=i.next}while(i!==r)}}function xh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ov(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function kT(e){var t=e.alternate;t!==null&&(e.alternate=null,kT(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Oi],delete t[su],delete t[Vy],delete t[N4],delete t[M4])),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 CT(e){return e.tag===5||e.tag===3||e.tag===4}function Oj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||CT(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 sv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Up));else if(r!==4&&(e=e.child,e!==null))for(sv(e,t,n),e=e.sibling;e!==null;)sv(e,t,n),e=e.sibling}function lv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(lv(e,t,n),e=e.sibling;e!==null;)lv(e,t,n),e=e.sibling}var Rn=null,ri=!1;function Ta(e,t,n){for(n=n.child;n!==null;)PT(e,t,n),n=n.sibling}function PT(e,t,n){if(Li&&typeof Li.onCommitFiberUnmount=="function")try{Li.onCommitFiberUnmount(dh,n)}catch{}switch(n.tag){case 5:Hn||Zs(n,t);case 6:var r=Rn,i=ri;Rn=null,Ta(e,t,n),Rn=r,ri=i,Rn!==null&&(ri?(e=Rn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Rn.removeChild(n.stateNode));break;case 18:Rn!==null&&(ri?(e=Rn,n=n.stateNode,e.nodeType===8?ug(e.parentNode,n):e.nodeType===1&&ug(e,n),nu(e)):ug(Rn,n.stateNode));break;case 4:r=Rn,i=ri,Rn=n.stateNode.containerInfo,ri=!0,Ta(e,t,n),Rn=r,ri=i;break;case 0:case 11:case 14:case 15:if(!Hn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&av(n,t,s),i=i.next}while(i!==r)}Ta(e,t,n);break;case 1:if(!Hn&&(Zs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){tn(n,t,l)}Ta(e,t,n);break;case 21:Ta(e,t,n);break;case 22:n.mode&1?(Hn=(r=Hn)||n.memoizedState!==null,Ta(e,t,n),Hn=r):Ta(e,t,n);break;default:Ta(e,t,n)}}function Nj(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new G4),t.forEach(function(r){var i=a$.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Zr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Rn=l.stateNode,ri=!1;break e;case 3:Rn=l.stateNode.containerInfo,ri=!0;break e;case 4:Rn=l.stateNode.containerInfo,ri=!0;break e}l=l.return}if(Rn===null)throw Error(be(160));PT(a,s,i),Rn=null,ri=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){tn(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)AT(t,e),t=t.sibling}function AT(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Zr(t,e),xi(e),r&4){try{zc(3,e,e.return),xh(3,e)}catch(v){tn(e,e.return,v)}try{zc(5,e,e.return)}catch(v){tn(e,e.return,v)}}break;case 1:Zr(t,e),xi(e),r&512&&n!==null&&Zs(n,n.return);break;case 5:if(Zr(t,e),xi(e),r&512&&n!==null&&Zs(n,n.return),e.flags&32){var i=e.stateNode;try{Zc(i,"")}catch(v){tn(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,s=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&G2(i,a),Ny(l,s);var u=Ny(l,a);for(s=0;s<c.length;s+=2){var p=c[s],d=c[s+1];p==="style"?eE(i,d):p==="dangerouslySetInnerHTML"?Z2(i,d):p==="children"?Zc(i,d):zx(i,p,d,u)}switch(l){case"input":Ay(i,a);break;case"textarea":X2(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?il(i,!!a.multiple,m,!1):h!==!!a.multiple&&(a.defaultValue!=null?il(i,!!a.multiple,a.defaultValue,!0):il(i,!!a.multiple,a.multiple?[]:"",!1))}i[su]=a}catch(v){tn(e,e.return,v)}}break;case 6:if(Zr(t,e),xi(e),r&4){if(e.stateNode===null)throw Error(be(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(v){tn(e,e.return,v)}}break;case 3:if(Zr(t,e),xi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{nu(t.containerInfo)}catch(v){tn(e,e.return,v)}break;case 4:Zr(t,e),xi(e);break;case 13:Zr(t,e),xi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(y0=an())),r&4&&Nj(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Hn=(u=Hn)||p,Zr(t,e),Hn=u):Zr(t,e),xi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!p&&e.mode&1)for(Ne=e,p=e.child;p!==null;){for(d=Ne=p;Ne!==null;){switch(h=Ne,m=h.child,h.tag){case 0:case 11:case 14:case 15:zc(4,h,h.return);break;case 1:Zs(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){tn(r,n,v)}}break;case 5:Zs(h,h.return);break;case 22:if(h.memoizedState!==null){Rj(d);continue}}m!==null?(m.return=h,Ne=m):Rj(d)}p=p.sibling}e:for(p=null,d=e;;){if(d.tag===5){if(p===null){p=d;try{i=d.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=d.stateNode,c=d.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=J2("display",s))}catch(v){tn(e,e.return,v)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){tn(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;p===d&&(p=null),d=d.return}p===d&&(p=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Zr(t,e),xi(e),r&4&&Nj(e);break;case 21:break;default:Zr(t,e),xi(e)}}function xi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(CT(n)){var r=n;break e}n=n.return}throw Error(be(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Zc(i,""),r.flags&=-33);var a=Oj(e);lv(e,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Oj(e);sv(e,l,s);break;default:throw Error(be(161))}}catch(c){tn(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Q4(e,t,n){Ne=e,ET(e)}function ET(e,t,n){for(var r=(e.mode&1)!==0;Ne!==null;){var i=Ne,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Md;if(!s){var l=i.alternate,c=l!==null&&l.memoizedState!==null||Hn;l=Md;var u=Hn;if(Md=s,(Hn=c)&&!u)for(Ne=i;Ne!==null;)s=Ne,c=s.child,s.tag===22&&s.memoizedState!==null?_j(i):c!==null?(c.return=s,Ne=c):_j(i);for(;a!==null;)Ne=a,ET(a),a=a.sibling;Ne=i,Md=l,Hn=u}Mj(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Ne=a):Mj(e)}}function Mj(e){for(;Ne!==null;){var t=Ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Hn||xh(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Hn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ti(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&yj(t,a,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}yj(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.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 p=u.memoizedState;if(p!==null){var d=p.dehydrated;d!==null&&nu(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(be(163))}Hn||t.flags&512&&ov(t)}catch(h){tn(t,t.return,h)}}if(t===e){Ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function Rj(e){for(;Ne!==null;){var t=Ne;if(t===e){Ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function _j(e){for(;Ne!==null;){var t=Ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{xh(4,t)}catch(c){tn(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){tn(t,i,c)}}var a=t.return;try{ov(t)}catch(c){tn(t,a,c)}break;case 5:var s=t.return;try{ov(t)}catch(c){tn(t,s,c)}}}catch(c){tn(t,t.return,c)}if(t===e){Ne=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Ne=l;break}Ne=t.return}}var Z4=Math.ceil,Jp=xa.ReactCurrentDispatcher,m0=xa.ReactCurrentOwner,Hr=xa.ReactCurrentBatchConfig,ft=0,Cn=null,cn=null,$n=0,jr=0,Js=lo(0),vn=0,fu=null,rs=0,bh=0,g0=0,$c=null,dr=null,y0=0,jl=1/0,Zi=null,ef=!1,cv=null,Xa=null,Rd=!1,Wa=null,tf=0,Bc=0,uv=null,Sp=-1,kp=0;function rr(){return ft&6?an():Sp!==-1?Sp:Sp=an()}function Qa(e){return e.mode&1?ft&2&&$n!==0?$n&-$n:_4.transition!==null?(kp===0&&(kp=pE()),kp):(e=jt,e!==0||(e=window.event,e=e===void 0?16:xE(e.type)),e):1}function li(e,t,n,r){if(50<Bc)throw Bc=0,uv=null,Error(be(185));Nu(e,n,r),(!(ft&2)||e!==Cn)&&(e===Cn&&(!(ft&2)&&(bh|=n),vn===4&&Ba(e,$n)),yr(e,r),n===1&&ft===0&&!(t.mode&1)&&(jl=an()+500,gh&&co()))}function yr(e,t){var n=e.callbackNode;_z(e,t);var r=zp(e,e===Cn?$n:0);if(r===0)n!==null&&Kw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Kw(n),t===1)e.tag===0?R4(Lj.bind(null,e)):zE(Lj.bind(null,e)),I4(function(){!(ft&6)&&co()}),n=null;else{switch(fE(r)){case 1:n=Wx;break;case 4:n=uE;break;case 16:n=Dp;break;case 536870912:n=dE;break;default:n=Dp}n=LT(n,TT.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function TT(e,t){if(Sp=-1,kp=0,ft&6)throw Error(be(327));var n=e.callbackNode;if(cl()&&e.callbackNode!==n)return null;var r=zp(e,e===Cn?$n:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=nf(e,r);else{t=r;var i=ft;ft|=2;var a=OT();(Cn!==e||$n!==t)&&(Zi=null,jl=an()+500,Ho(e,t));do try{t$();break}catch(l){IT(e,l)}while(!0);n0(),Jp.current=a,ft=i,cn!==null?t=0:(Cn=null,$n=0,t=vn)}if(t!==0){if(t===2&&(i=Dy(e),i!==0&&(r=i,t=dv(e,i))),t===1)throw n=fu,Ho(e,0),Ba(e,r),yr(e,an()),n;if(t===6)Ba(e,r);else{if(i=e.current.alternate,!(r&30)&&!J4(i)&&(t=nf(e,r),t===2&&(a=Dy(e),a!==0&&(r=a,t=dv(e,a))),t===1))throw n=fu,Ho(e,0),Ba(e,r),yr(e,an()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(be(345));case 2:Po(e,dr,Zi);break;case 3:if(Ba(e,r),(r&130023424)===r&&(t=y0+500-an(),10<t)){if(zp(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){rr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Hy(Po.bind(null,e,dr,Zi),t);break}Po(e,dr,Zi);break;case 4:if(Ba(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-si(r);a=1<<s,s=t[s],s>i&&(i=s),r&=~a}if(r=i,r=an()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Z4(r/1960))-r,10<r){e.timeoutHandle=Hy(Po.bind(null,e,dr,Zi),r);break}Po(e,dr,Zi);break;case 5:Po(e,dr,Zi);break;default:throw Error(be(329))}}}return yr(e,an()),e.callbackNode===n?TT.bind(null,e):null}function dv(e,t){var n=$c;return e.current.memoizedState.isDehydrated&&(Ho(e,t).flags|=256),e=nf(e,t),e!==2&&(t=dr,dr=n,t!==null&&pv(t)),e}function pv(e){dr===null?dr=e:dr.push.apply(dr,e)}function J4(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!ci(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Ba(e,t){for(t&=~g0,t&=~bh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-si(t),r=1<<n;e[n]=-1,t&=~r}}function Lj(e){if(ft&6)throw Error(be(327));cl();var t=zp(e,0);if(!(t&1))return yr(e,an()),null;var n=nf(e,t);if(e.tag!==0&&n===2){var r=Dy(e);r!==0&&(t=r,n=dv(e,r))}if(n===1)throw n=fu,Ho(e,0),Ba(e,t),yr(e,an()),n;if(n===6)throw Error(be(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Po(e,dr,Zi),yr(e,an()),null}function v0(e,t){var n=ft;ft|=1;try{return e(t)}finally{ft=n,ft===0&&(jl=an()+500,gh&&co())}}function is(e){Wa!==null&&Wa.tag===0&&!(ft&6)&&cl();var t=ft;ft|=1;var n=Hr.transition,r=jt;try{if(Hr.transition=null,jt=1,e)return e()}finally{jt=r,Hr.transition=n,ft=t,!(ft&6)&&co()}}function x0(){jr=Js.current,$t(Js)}function Ho(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,T4(n)),cn!==null)for(n=cn.return;n!==null;){var r=n;switch(Jx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Wp();break;case 3:bl(),$t(mr),$t(Yn),l0();break;case 5:s0(r);break;case 4:bl();break;case 13:$t(Vt);break;case 19:$t(Vt);break;case 10:r0(r.type._context);break;case 22:case 23:x0()}n=n.return}if(Cn=e,cn=e=Za(e.current,null),$n=jr=t,vn=0,fu=null,g0=bh=rs=0,dr=$c=null,Ro!==null){for(t=0;t<Ro.length;t++)if(n=Ro[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var s=a.next;a.next=i,r.next=s}n.pending=r}Ro=null}return e}function IT(e,t){do{var n=cn;try{if(n0(),bp.current=Zp,Qp){for(var r=qt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Qp=!1}if(ns=0,Sn=yn=qt=null,Dc=!1,uu=0,m0.current=null,n===null||n.return===null){vn=1,fu=t,cn=null;break}e:{var a=e,s=n.return,l=n,c=t;if(t=$n,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,p=l,d=p.tag;if(!(p.mode&1)&&(d===0||d===11||d===15)){var h=p.alternate;h?(p.updateQueue=h.updateQueue,p.memoizedState=h.memoizedState,p.lanes=h.lanes):(p.updateQueue=null,p.memoizedState=null)}var m=Sj(s);if(m!==null){m.flags&=-257,kj(m,s,l,a,t),m.mode&1&&jj(a,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){jj(a,u,t),b0();break e}c=Error(be(426))}}else if(Ut&&l.mode&1){var x=Sj(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),kj(x,s,l,a,t),e0(wl(c,l));break e}}a=c=wl(c,l),vn!==4&&(vn=2),$c===null?$c=[a]:$c.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=fT(a,c,t);gj(a,y);break e;case 1:l=c;var b=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Xa===null||!Xa.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=hT(a,l,t);gj(a,j);break e}}a=a.return}while(a!==null)}MT(n)}catch(k){t=k,cn===n&&n!==null&&(cn=n=n.return);continue}break}while(!0)}function OT(){var e=Jp.current;return Jp.current=Zp,e===null?Zp:e}function b0(){(vn===0||vn===3||vn===2)&&(vn=4),Cn===null||!(rs&268435455)&&!(bh&268435455)||Ba(Cn,$n)}function nf(e,t){var n=ft;ft|=2;var r=OT();(Cn!==e||$n!==t)&&(Zi=null,Ho(e,t));do try{e$();break}catch(i){IT(e,i)}while(!0);if(n0(),ft=n,Jp.current=r,cn!==null)throw Error(be(261));return Cn=null,$n=0,vn}function e$(){for(;cn!==null;)NT(cn)}function t$(){for(;cn!==null&&!Pz();)NT(cn)}function NT(e){var t=_T(e.alternate,e,jr);e.memoizedProps=e.pendingProps,t===null?MT(e):cn=t,m0.current=null}function MT(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Y4(n,t),n!==null){n.flags&=32767,cn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{vn=6,cn=null;return}}else if(n=q4(n,t,jr),n!==null){cn=n;return}if(t=t.sibling,t!==null){cn=t;return}cn=t=e}while(t!==null);vn===0&&(vn=5)}function Po(e,t,n){var r=jt,i=Hr.transition;try{Hr.transition=null,jt=1,n$(e,t,n,r)}finally{Hr.transition=i,jt=r}return null}function n$(e,t,n,r){do cl();while(Wa!==null);if(ft&6)throw Error(be(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(be(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(Lz(e,a),e===Cn&&(cn=Cn=null,$n=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Rd||(Rd=!0,LT(Dp,function(){return cl(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Hr.transition,Hr.transition=null;var s=jt;jt=1;var l=ft;ft|=4,m0.current=null,X4(e,n),AT(n,e),j4(Wy),$p=!!Uy,Wy=Uy=null,e.current=n,Q4(n),Az(),ft=l,jt=s,Hr.transition=a}else e.current=n;if(Rd&&(Rd=!1,Wa=e,tf=i),a=e.pendingLanes,a===0&&(Xa=null),Iz(n.stateNode),yr(e,an()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(ef)throw ef=!1,e=cv,cv=null,e;return tf&1&&e.tag!==0&&cl(),a=e.pendingLanes,a&1?e===uv?Bc++:(Bc=0,uv=e):Bc=0,co(),null}function cl(){if(Wa!==null){var e=fE(tf),t=Hr.transition,n=jt;try{if(Hr.transition=null,jt=16>e?16:e,Wa===null)var r=!1;else{if(e=Wa,Wa=null,tf=0,ft&6)throw Error(be(331));var i=ft;for(ft|=4,Ne=e.current;Ne!==null;){var a=Ne,s=a.child;if(Ne.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(Ne=u;Ne!==null;){var p=Ne;switch(p.tag){case 0:case 11:case 15:zc(8,p,a)}var d=p.child;if(d!==null)d.return=p,Ne=d;else for(;Ne!==null;){p=Ne;var h=p.sibling,m=p.return;if(kT(p),p===u){Ne=null;break}if(h!==null){h.return=m,Ne=h;break}Ne=m}}}var g=a.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var x=v.sibling;v.sibling=null,v=x}while(v!==null)}}Ne=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,Ne=s;else e:for(;Ne!==null;){if(a=Ne,a.flags&2048)switch(a.tag){case 0:case 11:case 15:zc(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,Ne=y;break e}Ne=a.return}}var b=e.current;for(Ne=b;Ne!==null;){s=Ne;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,Ne=w;else e:for(s=b;Ne!==null;){if(l=Ne,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:xh(9,l)}}catch(k){tn(l,l.return,k)}if(l===s){Ne=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,Ne=j;break e}Ne=l.return}}if(ft=i,co(),Li&&typeof Li.onPostCommitFiberRoot=="function")try{Li.onPostCommitFiberRoot(dh,e)}catch{}r=!0}return r}finally{jt=n,Hr.transition=t}}return!1}function Dj(e,t,n){t=wl(n,t),t=fT(e,t,1),e=Ga(e,t,1),t=rr(),e!==null&&(Nu(e,1,t),yr(e,t))}function tn(e,t,n){if(e.tag===3)Dj(e,e,n);else for(;t!==null;){if(t.tag===3){Dj(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Xa===null||!Xa.has(r))){e=wl(n,e),e=hT(t,e,1),t=Ga(t,e,1),e=rr(),t!==null&&(Nu(t,1,e),yr(t,e));break}}t=t.return}}function r$(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=rr(),e.pingedLanes|=e.suspendedLanes&n,Cn===e&&($n&n)===n&&(vn===4||vn===3&&($n&130023424)===$n&&500>an()-y0?Ho(e,0):g0|=n),yr(e,t)}function RT(e,t){t===0&&(e.mode&1?(t=kd,kd<<=1,!(kd&130023424)&&(kd=4194304)):t=1);var n=rr();e=fa(e,t),e!==null&&(Nu(e,t,n),yr(e,n))}function i$(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),RT(e,n)}function a$(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(be(314))}r!==null&&r.delete(t),RT(e,n)}var _T;_T=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mr.current)pr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pr=!1,V4(e,t,n);pr=!!(e.flags&131072)}else pr=!1,Ut&&t.flags&1048576&&$E(t,Vp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;jp(e,t),e=t.pendingProps;var i=yl(t,Yn.current);ll(t,n),i=u0(null,t,r,e,i,n);var a=d0();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,gr(r)?(a=!0,Kp(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,a0(t),i.updater=vh,t.stateNode=i,i._reactInternals=t,Zy(t,r,e,n),t=tv(null,t,r,!0,a,n)):(t.tag=0,Ut&&a&&Zx(t),tr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(jp(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=s$(r),e=ti(r,e),i){case 0:t=ev(null,t,r,e,n);break e;case 1:t=Aj(null,t,r,e,n);break e;case 11:t=Cj(null,t,r,e,n);break e;case 14:t=Pj(null,t,r,ti(r.type,e),n);break e}throw Error(be(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),ev(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),Aj(e,t,r,i,n);case 3:e:{if(vT(t),e===null)throw Error(be(387));r=t.pendingProps,a=t.memoizedState,i=a.element,HE(e,t),Gp(t,r,null,n);var s=t.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=wl(Error(be(423)),t),t=Ej(e,t,r,n,i);break e}else if(r!==i){i=wl(Error(be(424)),t),t=Ej(e,t,r,n,i);break e}else for(kr=Ya(t.stateNode.containerInfo.firstChild),Ar=t,Ut=!0,ii=null,n=WE(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vl(),r===i){t=ha(e,t,n);break e}tr(e,t,r,n)}t=t.child}return t;case 5:return VE(t),e===null&&Gy(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,Ky(r,i)?s=null:a!==null&&Ky(r,a)&&(t.flags|=32),yT(e,t),tr(e,t,s,n),t.child;case 6:return e===null&&Gy(t),null;case 13:return xT(e,t,n);case 4:return o0(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xl(t,null,r,n):tr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),Cj(e,t,r,i,n);case 7:return tr(e,t,t.pendingProps,n),t.child;case 8:return tr(e,t,t.pendingProps.children,n),t.child;case 12:return tr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,Mt(qp,r._currentValue),r._currentValue=s,a!==null)if(ci(a.value,s)){if(a.children===i.children&&!mr.current){t=ha(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=la(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?c.next=c:(c.next=p.next,p.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Xy(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)s=a.type===t.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(be(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Xy(s,n,t),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}tr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ll(t,n),i=Vr(i),r=r(i),t.flags|=1,tr(e,t,r,n),t.child;case 14:return r=t.type,i=ti(r,t.pendingProps),i=ti(r.type,i),Pj(e,t,r,i,n);case 15:return mT(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),jp(e,t),t.tag=1,gr(r)?(e=!0,Kp(t)):e=!1,ll(t,n),pT(t,r,i),Zy(t,r,i,n),tv(null,t,r,!0,e,n);case 19:return bT(e,t,n);case 22:return gT(e,t,n)}throw Error(be(156,t.tag))};function LT(e,t){return cE(e,t)}function o$(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ur(e,t,n,r){return new o$(e,t,n,r)}function w0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function s$(e){if(typeof e=="function")return w0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Bx)return 11;if(e===Fx)return 14}return 2}function Za(e,t){var n=e.alternate;return n===null?(n=Ur(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Cp(e,t,n,r,i,a){var s=2;if(r=e,typeof e=="function")w0(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ws:return Vo(n.children,i,a,t);case $x:s=8,i|=8;break;case jy:return e=Ur(12,n,t,i|2),e.elementType=jy,e.lanes=a,e;case Sy:return e=Ur(13,n,t,i),e.elementType=Sy,e.lanes=a,e;case ky:return e=Ur(19,n,t,i),e.elementType=ky,e.lanes=a,e;case V2:return wh(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K2:s=10;break e;case H2:s=9;break e;case Bx:s=11;break e;case Fx:s=14;break e;case _a:s=16,r=null;break e}throw Error(be(130,e==null?e:typeof e,""))}return t=Ur(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Vo(e,t,n,r){return e=Ur(7,e,r,t),e.lanes=n,e}function wh(e,t,n,r){return e=Ur(22,e,r,t),e.elementType=V2,e.lanes=n,e.stateNode={isHidden:!1},e}function vg(e,t,n){return e=Ur(6,e,null,t),e.lanes=n,e}function xg(e,t,n){return t=Ur(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function l$(e,t,n,r,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=Jm(0),this.expirationTimes=Jm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jm(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function j0(e,t,n,r,i,a,s,l,c){return e=new l$(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ur(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},a0(a),e}function c$(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Us,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function DT(e){if(!e)return ro;e=e._reactInternals;e:{if(hs(e)!==e||e.tag!==1)throw Error(be(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(gr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(be(171))}if(e.tag===1){var n=e.type;if(gr(n))return DE(e,n,t)}return t}function zT(e,t,n,r,i,a,s,l,c){return e=j0(n,r,!0,e,i,a,s,l,c),e.context=DT(null),n=e.current,r=rr(),i=Qa(n),a=la(r,i),a.callback=t??null,Ga(n,a,i),e.current.lanes=i,Nu(e,i,r),yr(e,r),e}function jh(e,t,n,r){var i=t.current,a=rr(),s=Qa(i);return n=DT(n),t.context===null?t.context=n:t.pendingContext=n,t=la(a,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ga(i,t,s),e!==null&&(li(e,i,s,a),xp(e,i,s)),s}function rf(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 zj(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function S0(e,t){zj(e,t),(e=e.alternate)&&zj(e,t)}function u$(){return null}var $T=typeof reportError=="function"?reportError:function(e){console.error(e)};function k0(e){this._internalRoot=e}Sh.prototype.render=k0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(be(409));jh(e,t,null,null)};Sh.prototype.unmount=k0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;is(function(){jh(null,e,null,null)}),t[pa]=null}};function Sh(e){this._internalRoot=e}Sh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gE();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$a.length&&t!==0&&t<$a[n].priority;n++);$a.splice(n,0,e),n===0&&vE(e)}};function C0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function $j(){}function d$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=rf(s);a.call(u)}}var s=zT(t,r,e,0,null,!1,!1,"",$j);return e._reactRootContainer=s,e[pa]=s.current,au(e.nodeType===8?e.parentNode:e),is(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=rf(c);l.call(u)}}var c=j0(e,0,!1,null,null,!1,!1,"",$j);return e._reactRootContainer=c,e[pa]=c.current,au(e.nodeType===8?e.parentNode:e),is(function(){jh(t,c,n,r)}),c}function Ch(e,t,n,r,i){var a=n._reactRootContainer;if(a){var s=a;if(typeof i=="function"){var l=i;i=function(){var c=rf(s);l.call(c)}}jh(t,s,e,i)}else s=d$(n,t,e,i,r);return rf(s)}hE=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ac(t.pendingLanes);n!==0&&(Kx(t,n|1),yr(t,an()),!(ft&6)&&(jl=an()+500,co()))}break;case 13:is(function(){var r=fa(e,1);if(r!==null){var i=rr();li(r,e,1,i)}}),S0(e,1)}};Hx=function(e){if(e.tag===13){var t=fa(e,134217728);if(t!==null){var n=rr();li(t,e,134217728,n)}S0(e,134217728)}};mE=function(e){if(e.tag===13){var t=Qa(e),n=fa(e,t);if(n!==null){var r=rr();li(n,e,t,r)}S0(e,t)}};gE=function(){return jt};yE=function(e,t){var n=jt;try{return jt=e,t()}finally{jt=n}};Ry=function(e,t,n){switch(t){case"input":if(Ay(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=mh(r);if(!i)throw Error(be(90));Y2(r),Ay(r,i)}}}break;case"textarea":X2(e,n);break;case"select":t=n.value,t!=null&&il(e,!!n.multiple,t,!1)}};rE=v0;iE=is;var p$={usingClientEntryPoint:!1,Events:[Ru,qs,mh,tE,nE,v0]},cc={findFiberByHostInstance:Mo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},f$={bundleType:cc.bundleType,version:cc.version,rendererPackageName:cc.rendererPackageName,rendererConfig:cc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=sE(e),e===null?null:e.stateNode},findFiberByHostInstance:cc.findFiberByHostInstance||u$,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 _d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_d.isDisabled&&_d.supportsFiber)try{dh=_d.inject(f$),Li=_d}catch{}}Or.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=p$;Or.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!C0(t))throw Error(be(200));return c$(e,t,null,n)};Or.createRoot=function(e,t){if(!C0(e))throw Error(be(299));var n=!1,r="",i=$T;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=j0(e,1,!1,null,null,n,!1,r,i),e[pa]=t.current,au(e.nodeType===8?e.parentNode:e),new k0(t)};Or.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(be(188)):(e=Object.keys(e).join(","),Error(be(268,e)));return e=sE(t),e=e===null?null:e.stateNode,e};Or.flushSync=function(e){return is(e)};Or.hydrate=function(e,t,n){if(!kh(t))throw Error(be(200));return Ch(null,e,t,!0,n)};Or.hydrateRoot=function(e,t,n){if(!C0(e))throw Error(be(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=$T;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=zT(t,null,e,1,n??null,i,!1,a,s),e[pa]=t.current,au(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Sh(t)};Or.render=function(e,t,n){if(!kh(t))throw Error(be(200));return Ch(null,e,t,!1,n)};Or.unmountComponentAtNode=function(e){if(!kh(e))throw Error(be(40));return e._reactRootContainer?(is(function(){Ch(null,null,e,!1,function(){e._reactRootContainer=null,e[pa]=null})}),!0):!1};Or.unstable_batchedUpdates=v0;Or.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!kh(n))throw Error(be(200));if(e==null||e._reactInternals===void 0)throw Error(be(38));return Ch(e,t,n,!1,r)};Or.version="18.3.1-next-f1338f8080-20240426";function BT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(BT)}catch(e){console.error(e)}}BT(),B2.exports=Or;var Lu=B2.exports,Bj=Lu;by.createRoot=Bj.createRoot,by.hydrateRoot=Bj.hydrateRoot;/**
41
+ * @remix-run/router v1.23.3
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function hu(){return hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hu.apply(null,arguments)}var Ka;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ka||(Ka={}));const Fj="popstate";function h$(e){e===void 0&&(e={});function t(i,a){let{pathname:s="/",search:l="",hash:c=""}=ms(i.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),fv("",{pathname:s,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(i,a){let s=i.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=i.location.href,u=c.indexOf("#");l=u===-1?c:c.slice(0,u)}return l+"#"+(typeof a=="string"?a:af(a))}function r(i,a){Ph(i.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")")}return g$(t,n,r,e)}function Yt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ph(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function m$(){return Math.random().toString(36).substr(2,8)}function Uj(e,t){return{usr:e.state,key:e.key,idx:t}}function fv(e,t,n,r){return n===void 0&&(n=null),hu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ms(t):t,{state:n,key:t&&t.key||r||m$()})}function af(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ms(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function g$(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,l=Ka.Pop,c=null,u=p();u==null&&(u=0,s.replaceState(hu({},s.state,{idx:u}),""));function p(){return(s.state||{idx:null}).idx}function d(){l=Ka.Pop;let x=p(),y=x==null?null:x-u;u=x,c&&c({action:l,location:v.location,delta:y})}function h(x,y){l=Ka.Push;let b=fv(v.location,x,y);n&&n(b,x),u=p()+1;let w=Uj(b,u),j=v.createHref(b);try{s.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(j)}a&&c&&c({action:l,location:v.location,delta:1})}function m(x,y){l=Ka.Replace;let b=fv(v.location,x,y);n&&n(b,x),u=p();let w=Uj(b,u),j=v.createHref(b);s.replaceState(w,"",j),a&&c&&c({action:l,location:v.location,delta:0})}function g(x){let y=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof x=="string"?x:af(x);return b=b.replace(/ $/,"%20"),Yt(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let v={get action(){return l},get location(){return e(i,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Fj,d),c=x,()=>{i.removeEventListener(Fj,d),c=null}},createHref(x){return t(i,x)},createURL:g,encodeLocation(x){let y=g(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:m,go(x){return s.go(x)}};return v}var Wj;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Wj||(Wj={}));function y$(e,t,n){return n===void 0&&(n="/"),v$(e,t,n)}function v$(e,t,n,r){let i=typeof t=="string"?ms(t):t,a=Sl(i.pathname||"/",n);if(a==null)return null;let s=FT(e);x$(s);let l=null,c=I$(a);for(let u=0;l==null&&u<s.length;++u)l=E$(s[u],c);return l}function FT(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,s,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};c.relativePath.startsWith("/")&&(Yt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Ja([r,c.relativePath]),p=n.concat(c);a.children&&a.children.length>0&&(Yt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),FT(a.children,t,p,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:P$(u,a.index),routesMeta:p})};return e.forEach((a,s)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,s);else for(let c of UT(a.path))i(a,s,c)}),t}function UT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let s=UT(r.join("/")),l=[];return l.push(...s.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function x$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:A$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const b$=/^:[\w-]+$/,w$=3,j$=2,S$=1,k$=10,C$=-2,Kj=e=>e==="*";function P$(e,t){let n=e.split("/"),r=n.length;return n.some(Kj)&&(r+=C$),t&&(r+=j$),n.filter(i=>!Kj(i)).reduce((i,a)=>i+(b$.test(a)?w$:a===""?S$:k$),r)}function A$(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function E$(e,t,n){let{routesMeta:r}=e,i={},a="/",s=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",d=hv({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},p),h=c.route;if(!d)return null;Object.assign(i,d.params),s.push({params:i,pathname:Ja([a,d.pathname]),pathnameBase:_$(Ja([a,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(a=Ja([a,d.pathnameBase]))}return s}function hv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=T$(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((u,p,d)=>{let{paramName:h,isOptional:m}=p;if(h==="*"){let v=l[d]||"";s=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[d];return m&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function T$(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ph(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 r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function I$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ph(!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 Sl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const O$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,N$=e=>O$.test(e);function M$(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ms(e):e,a;if(n)if(N$(n))a=n;else{if(n.includes("//")){let s=n;n=WT(n),Ph(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?a=Hj(n.substring(1),"/"):a=Hj(n,t)}else a=t;return{pathname:a,search:L$(r),hash:D$(i)}}function Hj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function bg(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function R$(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function P0(e,t){let n=R$(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function A0(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=ms(e):(i=hu({},e),Yt(!i.pathname||!i.pathname.includes("?"),bg("?","pathname","search",i)),Yt(!i.pathname||!i.pathname.includes("#"),bg("#","pathname","hash",i)),Yt(!i.search||!i.search.includes("#"),bg("#","search","hash",i)));let a=e===""||i.pathname==="",s=a?"/":i.pathname,l;if(s==null)l=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}l=d>=0?t[d]:"/"}let c=M$(i,l),u=s&&s!=="/"&&s.endsWith("/"),p=(a||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const WT=e=>e.replace(/\/\/+/g,"/"),Ja=e=>WT(e.join("/")),_$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),L$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,D$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function z$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const KT=["post","put","patch","delete"];new Set(KT);const $$=["get",...KT];new Set($$);/**
50
+ * React Router v6.30.4
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mu.apply(null,arguments)}const Ah=f.createContext(null),HT=f.createContext(null),ba=f.createContext(null),Eh=f.createContext(null),wa=f.createContext({outlet:null,matches:[],isDataRoute:!1}),VT=f.createContext(null);function B$(e,t){let{relative:n}=t===void 0?{}:t;zl()||Yt(!1);let{basename:r,navigator:i}=f.useContext(ba),{hash:a,pathname:s,search:l}=Ih(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:Ja([r,s])),i.createHref({pathname:c,search:l,hash:a})}function zl(){return f.useContext(Eh)!=null}function $l(){return zl()||Yt(!1),f.useContext(Eh).location}function qT(e){f.useContext(ba).static||f.useLayoutEffect(e)}function Th(){let{isDataRoute:e}=f.useContext(wa);return e?e3():F$()}function F$(){zl()||Yt(!1);let e=f.useContext(Ah),{basename:t,future:n,navigator:r}=f.useContext(ba),{matches:i}=f.useContext(wa),{pathname:a}=$l(),s=JSON.stringify(P0(i,n.v7_relativeSplatPath)),l=f.useRef(!1);return qT(()=>{l.current=!0}),f.useCallback(function(u,p){if(p===void 0&&(p={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let d=A0(u,JSON.parse(s),a,p.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Ja([t,d.pathname])),(p.replace?r.replace:r.push)(d,p.state,p)},[t,r,s,a,e])}function U$(){let{matches:e}=f.useContext(wa),t=e[e.length-1];return t?t.params:{}}function Ih(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=f.useContext(ba),{matches:i}=f.useContext(wa),{pathname:a}=$l(),s=JSON.stringify(P0(i,r.v7_relativeSplatPath));return f.useMemo(()=>A0(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}function W$(e,t){return K$(e,t)}function K$(e,t,n,r){zl()||Yt(!1);let{navigator:i}=f.useContext(ba),{matches:a}=f.useContext(wa),s=a[a.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=$l(),p;if(t){var d;let x=typeof t=="string"?ms(t):t;c==="/"||(d=x.pathname)!=null&&d.startsWith(c)||Yt(!1),p=x}else p=u;let h=p.pathname||"/",m=h;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=y$(e,{pathname:m}),v=G$(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Ja([c,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Ja([c,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,n,r);return t&&v?f.createElement(Eh.Provider,{value:{location:mu({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Ka.Pop}},v):v}function H$(){let e=J$(),t=z$(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:i},n):null,null)}const V$=f.createElement(H$,null);class q$ extends f.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(wa.Provider,{value:this.props.routeContext},f.createElement(VT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Y$(e){let{routeContext:t,match:n,children:r}=e,i=f.useContext(Ah);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(wa.Provider,{value:t},r)}function G$(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let p=s.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);p>=0||Yt(!1),s=s.slice(0,Math.min(s.length,p+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p<s.length;p++){let d=s[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=p),d.route.id){let{loaderData:h,errors:m}=n,g=d.route.loader&&h[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((p,d,h)=>{let m,g=!1,v=null,x=null;n&&(m=l&&d.route.id?l[d.route.id]:void 0,v=d.route.errorElement||V$,c&&(u<0&&h===0?(t3("route-fallback"),g=!0,x=null):u===h&&(g=!0,x=d.route.hydrateFallbackElement||null)));let y=t.concat(s.slice(0,h+1)),b=()=>{let w;return m?w=v:g?w=x:d.route.Component?w=f.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=p,f.createElement(Y$,{match:d,routeContext:{outlet:p,matches:y,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?f.createElement(q$,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var YT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(YT||{}),GT=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}(GT||{});function X$(e){let t=f.useContext(Ah);return t||Yt(!1),t}function Q$(e){let t=f.useContext(HT);return t||Yt(!1),t}function Z$(e){let t=f.useContext(wa);return t||Yt(!1),t}function XT(e){let t=Z$(),n=t.matches[t.matches.length-1];return n.route.id||Yt(!1),n.route.id}function J$(){var e;let t=f.useContext(VT),n=Q$(),r=XT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function e3(){let{router:e}=X$(YT.UseNavigateStable),t=XT(GT.UseNavigateStable),n=f.useRef(!1);return qT(()=>{n.current=!0}),f.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,mu({fromRouteId:t},a)))},[e,t])}const Vj={};function t3(e,t,n){Vj[e]||(Vj[e]=!0)}function n3(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function uc(e){let{to:t,replace:n,state:r,relative:i}=e;zl()||Yt(!1);let{future:a,static:s}=f.useContext(ba),{matches:l}=f.useContext(wa),{pathname:c}=$l(),u=Th(),p=A0(t,P0(l,a.v7_relativeSplatPath),c,i==="path"),d=JSON.stringify(p);return f.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function er(e){Yt(!1)}function r3(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ka.Pop,navigator:a,static:s=!1,future:l}=e;zl()&&Yt(!1);let c=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:c,navigator:a,static:s,future:mu({v7_relativeSplatPath:!1},l)}),[c,l,a,s]);typeof r=="string"&&(r=ms(r));let{pathname:p="/",search:d="",hash:h="",state:m=null,key:g="default"}=r,v=f.useMemo(()=>{let x=Sl(p,c);return x==null?null:{location:{pathname:x,search:d,hash:h,state:m,key:g},navigationType:i}},[c,p,d,h,m,g,i]);return v==null?null:f.createElement(ba.Provider,{value:u},f.createElement(Eh.Provider,{children:n,value:v}))}function i3(e){let{children:t,location:n}=e;return W$(mv(t),n)}new Promise(()=>{});function mv(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,i)=>{if(!f.isValidElement(r))return;let a=[...t,i];if(r.type===f.Fragment){n.push.apply(n,mv(r.props.children,a));return}r.type!==er&&Yt(!1),!r.props.index||!r.props.children||Yt(!1);let s={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=mv(r.props.children,a)),n.push(s)}),n}/**
59
+ * React Router DOM v6.30.4
60
+ *
61
+ * Copyright (c) Remix Software Inc.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE.md file in the root directory of this source tree.
65
+ *
66
+ * @license MIT
67
+ */function of(){return of=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},of.apply(null,arguments)}function QT(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function a3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function o3(e,t){return e.button===0&&(!t||t==="_self")&&!a3(e)}const s3=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],l3=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],c3="6";try{window.__reactRouterVersion=c3}catch{}const u3=f.createContext({isTransitioning:!1}),d3="startTransition",qj=z2[d3];function p3(e){let{basename:t,children:n,future:r,window:i}=e,a=f.useRef();a.current==null&&(a.current=h$({window:i,v5Compat:!0}));let s=a.current,[l,c]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},p=f.useCallback(d=>{u&&qj?qj(()=>c(d)):c(d)},[c,u]);return f.useLayoutEffect(()=>s.listen(p),[s,p]),f.useEffect(()=>n3(r),[r]),f.createElement(r3,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const f3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",h3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,m3=f.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,h=QT(t,s3),{basename:m}=f.useContext(ba),g,v=!1;if(typeof u=="string"&&h3.test(u)&&(g=u,f3))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=Sl(j.pathname,m);j.origin===w.origin&&k!=null?u=k+j.search+j.hash:v=!0}catch{}let x=B$(u,{relative:i}),y=y3(u,{replace:s,state:l,target:c,preventScrollReset:p,relative:i,viewTransition:d});function b(w){r&&r(w),w.defaultPrevented||y(w)}return f.createElement("a",of({},h,{href:g||x,onClick:v||a?r:b,ref:n,target:c}))}),Jr=f.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:s=!1,style:l,to:c,viewTransition:u,children:p}=t,d=QT(t,l3),h=Ih(c,{relative:d.relative}),m=$l(),g=f.useContext(HT),{navigator:v,basename:x}=f.useContext(ba),y=g!=null&&v3(h)&&u===!0,b=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,w=m.pathname,j=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(w=w.toLowerCase(),j=j?j.toLowerCase():null,b=b.toLowerCase()),j&&x&&(j=Sl(j,x)||j);const k=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let S=w===b||!s&&w.startsWith(b)&&w.charAt(k)==="/",A=j!=null&&(j===b||!s&&j.startsWith(b)&&j.charAt(b.length)==="/"),T={isActive:S,isPending:A,isTransitioning:y},L=S?r:void 0,O;typeof a=="function"?O=a(T):O=[a,S?"active":null,A?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let R=typeof l=="function"?l(T):l;return f.createElement(m3,of({},d,{"aria-current":L,className:O,ref:n,style:R,to:c,viewTransition:u}),typeof p=="function"?p(T):p)});var gv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gv||(gv={}));var Yj;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Yj||(Yj={}));function g3(e){let t=f.useContext(Ah);return t||Yt(!1),t}function y3(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:l}=t===void 0?{}:t,c=Th(),u=$l(),p=Ih(e,{relative:s});return f.useCallback(d=>{if(o3(d,n)){d.preventDefault();let h=r!==void 0?r:af(u)===af(p);c(e,{replace:h,state:i,preventScrollReset:a,relative:s,viewTransition:l})}},[u,c,p,r,i,n,e,a,s,l])}function v3(e,t){t===void 0&&(t={});let n=f.useContext(u3);n==null&&Yt(!1);let{basename:r}=g3(gv.useViewTransitionState),i=Ih(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Sl(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Sl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hv(i.pathname,s)!=null||hv(i.pathname,a)!=null}function x3(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const b3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j3={};function Gj(e,t){return(j3.jsx?w3:b3).test(e)}const S3=/[ \t\n\f\r]/g;function k3(e){return typeof e=="object"?e.type==="text"?Xj(e.value):!1:Xj(e)}function Xj(e){return e.replace(S3,"")===""}class Du{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Du.prototype.normal={};Du.prototype.property={};Du.prototype.space=void 0;function ZT(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Du(n,r,t)}function yv(e){return e.toLowerCase()}class br{constructor(t,n){this.attribute=n,this.property=t}}br.prototype.attribute="";br.prototype.booleanish=!1;br.prototype.boolean=!1;br.prototype.commaOrSpaceSeparated=!1;br.prototype.commaSeparated=!1;br.prototype.defined=!1;br.prototype.mustUseProperty=!1;br.prototype.number=!1;br.prototype.overloadedBoolean=!1;br.prototype.property="";br.prototype.spaceSeparated=!1;br.prototype.space=void 0;let C3=0;const Ve=gs(),ln=gs(),vv=gs(),we=gs(),At=gs(),qo=gs(),wr=gs();function gs(){return 2**++C3}const xv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:ln,commaOrSpaceSeparated:wr,commaSeparated:qo,number:we,overloadedBoolean:vv,spaceSeparated:At},Symbol.toStringTag,{value:"Module"})),wg=Object.keys(xv);class E0 extends br{constructor(t,n,r,i){let a=-1;if(super(t,n),Qj(this,"space",i),typeof r=="number")for(;++a<wg.length;){const s=wg[a];Qj(this,wg[a],(r&xv[s])===xv[s])}}}E0.prototype.defined=!0;function Qj(e,t,n){n&&(e[t]=n)}function Bl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new E0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[yv(r)]=r,n[yv(a.attribute)]=r}return new Du(t,n,e.space)}const JT=Bl({properties:{ariaActiveDescendant:null,ariaAtomic:ln,ariaAutoComplete:null,ariaBusy:ln,ariaChecked:ln,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:At,ariaCurrent:null,ariaDescribedBy:At,ariaDetails:null,ariaDisabled:ln,ariaDropEffect:At,ariaErrorMessage:null,ariaExpanded:ln,ariaFlowTo:At,ariaGrabbed:ln,ariaHasPopup:null,ariaHidden:ln,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:At,ariaLevel:we,ariaLive:null,ariaModal:ln,ariaMultiLine:ln,ariaMultiSelectable:ln,ariaOrientation:null,ariaOwns:At,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:ln,ariaReadOnly:ln,ariaRelevant:null,ariaRequired:ln,ariaRoleDescription:At,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:ln,ariaSetSize:we,ariaSort:null,ariaValueMax:we,ariaValueMin:we,ariaValueNow:we,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function eI(e,t){return t in e?e[t]:t}function tI(e,t){return eI(e,t.toLowerCase())}const P3=Bl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qo,acceptCharset:At,accessKey:At,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alpha:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:At,autoFocus:Ve,autoPlay:Ve,blocking:At,capture:null,charSet:null,checked:Ve,cite:null,className:At,closedBy:null,colorSpace:null,cols:we,colSpan:we,command:null,commandFor:null,content:null,contentEditable:ln,controls:Ve,controlsList:At,coords:we|qo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:vv,draggable:ln,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:At,height:we,hidden:vv,high:we,href:null,hrefLang:null,htmlFor:At,httpEquiv:At,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:At,itemRef:At,itemScope:Ve,itemType:At,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ve,optimum:we,pattern:null,ping:At,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:At,required:Ve,reversed:Ve,rows:we,rowSpan:we,sandbox:At,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootCustomElementRegistry:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shadowRootSerializable:Ve,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:ln,src:null,srcDoc:null,srcLang:null,srcSet:null,start:we,step:null,style:null,tabIndex:we,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:ln,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:At,axis:null,background:null,bgColor:null,border:we,borderColor:null,bottomMargin:we,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:ln,standby:null,summary:null,text:null,topMargin:we,valueType:null,version:null,vAlign:null,vLink:null,vSpace:we,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ve,disablePictureInPicture:Ve,disableRemotePlayback:Ve,exportParts:qo,part:At,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:tI}),A3=Bl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:wr,accentHeight:we,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:we,amplitude:we,arabicForm:null,ascent:we,attributeName:null,attributeType:null,azimuth:we,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:we,by:null,calcMode:null,capHeight:we,className:At,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:we,diffuseConstant:we,direction:null,display:null,dur:null,divisor:we,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:we,enableBackground:null,end:null,event:null,exponent:we,externalResourcesRequired:null,fill:null,fillOpacity:we,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:qo,g2:qo,glyphName:qo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:we,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:we,horizOriginX:we,horizOriginY:we,id:null,ideographic:we,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:we,k:we,k1:we,k2:we,k3:we,k4:we,kernelMatrix:wr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:we,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:we,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:we,overlineThickness:we,paintOrder:null,panose1:null,path:null,pathLength:we,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:At,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wr,rev:wr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wr,requiredFeatures:wr,requiredFonts:wr,requiredFormats:wr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:we,specularExponent:we,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:we,strikethroughThickness:we,string:null,stroke:null,strokeDashArray:wr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:we,strokeOpacity:we,strokeWidth:null,style:null,surfaceScale:we,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wr,tabIndex:we,tableValues:null,target:null,targetX:we,targetY:we,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:we,underlineThickness:we,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:we,values:null,vAlphabetic:we,vMathematical:we,vectorEffect:null,vHanging:we,vIdeographic:we,version:null,vertAdvY:we,vertOriginX:we,vertOriginY:we,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:we,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:eI}),nI=Bl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),rI=Bl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tI}),iI=Bl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),E3={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},T3=/[A-Z]/g,Zj=/-[a-z]/g,I3=/^data[-\w.:]+$/i;function O3(e,t){const n=yv(t);let r=t,i=br;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&I3.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Zj,M3);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Zj.test(a)){let s=a.replace(T3,N3);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=E0}return new i(r,t)}function N3(e){return"-"+e.toLowerCase()}function M3(e){return e.charAt(1).toUpperCase()}const R3=ZT([JT,P3,nI,rI,iI],"html"),T0=ZT([JT,A3,nI,rI,iI],"svg");function _3(e){return e.join(" ").trim()}var I0={},Jj=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,L3=/\n/g,D3=/^\s*/,z3=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$3=/^:\s*/,B3=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,F3=/^[;\s]*/,U3=/^\s+|\s+$/g,W3=`
68
+ `,eS="/",tS="*",Oo="",K3="comment",H3="declaration";function V3(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var v=g.match(L3);v&&(n+=v.length);var x=g.lastIndexOf(W3);r=~x?g.length-x:r+g.length}function a(){var g={line:n,column:r};return function(v){return v.position=new s(g),u(),v}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(g){var v=new Error(t.source+":"+n+":"+r+": "+g);if(v.reason=g,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function c(g){var v=g.exec(e);if(v){var x=v[0];return i(x),e=e.slice(x.length),v}}function u(){c(D3)}function p(g){var v;for(g=g||[];v=d();)v!==!1&&g.push(v);return g}function d(){var g=a();if(!(eS!=e.charAt(0)||tS!=e.charAt(1))){for(var v=2;Oo!=e.charAt(v)&&(tS!=e.charAt(v)||eS!=e.charAt(v+1));)++v;if(v+=2,Oo===e.charAt(v-1))return l("End of comment missing");var x=e.slice(2,v-2);return r+=2,i(x),e=e.slice(v),r+=2,g({type:K3,comment:x})}}function h(){var g=a(),v=c(z3);if(v){if(d(),!c($3))return l("property missing ':'");var x=c(B3),y=g({type:H3,property:nS(v[0].replace(Jj,Oo)),value:x?nS(x[0].replace(Jj,Oo)):Oo});return c(F3),y}}function m(){var g=[];p(g);for(var v;v=h();)v!==!1&&(g.push(v),p(g));return g}return u(),m()}function nS(e){return e?e.replace(U3,Oo):Oo}var q3=V3,Y3=ml&&ml.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I0,"__esModule",{value:!0});I0.default=X3;const G3=Y3(q3);function X3(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,G3.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:s,value:l}=a;i?t(s,l,a):l&&(n=n||{},n[s]=l)}),n}var Oh={};Object.defineProperty(Oh,"__esModule",{value:!0});Oh.camelCase=void 0;var Q3=/^--[a-zA-Z0-9_-]+$/,Z3=/-([a-z])/g,J3=/^[^-]+$/,e6=/^-(webkit|moz|ms|o|khtml)-/,t6=/^-(ms)-/,n6=function(e){return!e||J3.test(e)||Q3.test(e)},r6=function(e,t){return t.toUpperCase()},rS=function(e,t){return"".concat(t,"-")},i6=function(e,t){return t===void 0&&(t={}),n6(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(t6,rS):e=e.replace(e6,rS),e.replace(Z3,r6))};Oh.camelCase=i6;var a6=ml&&ml.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o6=a6(I0),s6=Oh;function bv(e,t){var n={};return!e||typeof e!="string"||(0,o6.default)(e,function(r,i){r&&i&&(n[(0,s6.camelCase)(r,t)]=i)}),n}bv.default=bv;var l6=bv;const c6=Rl(l6),aI=oI("end"),O0=oI("start");function oI(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function u6(e){const t=O0(e),n=aI(e);if(t&&n)return{start:t,end:n}}function Fc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?iS(e.position):"start"in e||"end"in e?iS(e):"line"in e||"column"in e?wv(e):""}function wv(e){return aS(e&&e.line)+":"+aS(e&&e.column)}function iS(e){return wv(e&&e.start)+"-"+wv(e&&e.end)}function aS(e){return e&&typeof e=="number"?e:1}class Gn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Fc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Gn.prototype.file="";Gn.prototype.name="";Gn.prototype.reason="";Gn.prototype.message="";Gn.prototype.stack="";Gn.prototype.column=void 0;Gn.prototype.line=void 0;Gn.prototype.ancestors=void 0;Gn.prototype.cause=void 0;Gn.prototype.fatal=void 0;Gn.prototype.place=void 0;Gn.prototype.ruleId=void 0;Gn.prototype.source=void 0;const N0={}.hasOwnProperty,d6=new Map,p6=/[A-Z]/g,f6=new Set(["table","tbody","thead","tfoot","tr"]),h6=new Set(["td","th"]),sI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function m6(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=S6(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=j6(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?T0:R3,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=lI(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function lI(e,t,n){if(t.type==="element")return g6(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return y6(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return x6(e,t,n);if(t.type==="mdxjsEsm")return v6(e,t);if(t.type==="root")return b6(e,t,n);if(t.type==="text")return w6(e,t)}function g6(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=T0,e.schema=i),e.ancestors.push(t);const a=uI(e,t.tagName,!1),s=k6(e,t);let l=R0(e,t);return f6.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!k3(c):!0})),cI(e,s,a,t),M0(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function y6(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}gu(e,t.position)}function v6(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);gu(e,t.position)}function x6(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=T0,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:uI(e,t.name,!0),s=C6(e,t),l=R0(e,t);return cI(e,s,a,t),M0(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function b6(e,t,n){const r={};return M0(r,R0(e,t)),e.create(t,e.Fragment,r,n)}function w6(e,t){return t.value}function cI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function M0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function j6(e,t,n){return r;function r(i,a,s,l){const u=Array.isArray(s.children)?n:t;return l?u(a,s,l):u(a,s)}}function S6(e,t){return n;function n(r,i,a,s){const l=Array.isArray(a.children),c=O0(r);return t(i,a,s,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function k6(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&N0.call(t.properties,i)){const a=P6(e,i,t.properties[i]);if(a){const[s,l]=a;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&h6.has(t.tagName)?r=l:n[s]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function C6(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else gu(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else gu(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function R0(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:d6;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=i.get(c)||0;s=c+"-"+u,i.set(c,u+1)}}const l=lI(e,a,s);l!==void 0&&n.push(l)}return n}function P6(e,t,n){const r=O3(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?x3(n):_3(n)),r.property==="style"){let i=typeof n=="object"?n:A6(e,String(n));return e.stylePropertyNameCase==="css"&&(i=E6(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?E3[r.property]||r.property:r.attribute,n]}}function A6(e,t){try{return c6(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Gn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=sI+"#cannot-parse-style-attribute",i}}function uI(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const l=Gj(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=s}else r=Gj(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return N0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);gu(e)}function gu(e,t){const n=new Gn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=sI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function E6(e){const t={};let n;for(n in e)N0.call(e,n)&&(t[T6(n)]=e[n]);return t}function T6(e){let t=e.replace(p6,I6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function I6(e){return"-"+e.toLowerCase()}const jg={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},O6={};function N6(e,t){const n=O6,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return dI(e,r,i)}function dI(e,t,n){if(M6(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return oS(e.children,t,n)}return Array.isArray(e)?oS(e,t,n):""}function oS(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=dI(e[i],t,n);return r.join("")}function M6(e){return!!(e&&typeof e=="object")}const sS=document.createElement("i");function _0(e){const t="&"+e+";";sS.innerHTML=t;const n=sS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Bi(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function Fr(e,t){return e.length>0?(Bi(e,e.length,0,t),e):t}const lS={}.hasOwnProperty;function R6(e){const t={};let n=-1;for(;++n<e.length;)_6(t,e[n]);return t}function _6(e,t){let n;for(n in t){const i=(lS.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){lS.call(i,s)||(i[s]=[]);const l=a[s];L6(i[s],Array.isArray(l)?l:l?[l]:[])}}}function L6(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Bi(e,0,0,r)}function pI(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ul(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ni=uo(/[A-Za-z]/),Cr=uo(/[\dA-Za-z]/),D6=uo(/[#-'*+\--9=?A-Z^-~]/);function jv(e){return e!==null&&(e<32||e===127)}const Sv=uo(/\d/),z6=uo(/[\dA-Fa-f]/),$6=uo(/[!-/:-@[-`{-~]/);function We(e){return e!==null&&e<-2}function vr(e){return e!==null&&(e<0||e===32)}function bt(e){return e===-2||e===-1||e===32}const B6=uo(new RegExp("\\p{P}|\\p{S}","u")),F6=uo(/\s/);function uo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&Cr(e.charCodeAt(n+1))&&Cr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(s=String.fromCharCode(a,l),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Rt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(c){return bt(c)?(e.enter(n),l(c)):t(c)}function l(c){return bt(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const U6={tokenize:W6};function W6(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Rt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return We(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),s)}}const K6={tokenize:H6},cS={tokenize:V6};function H6(e){const t=this,n=[];let r=0,i,a,s;return l;function l(w){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const j=t.events.length;let k=j,S;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){S=t.events[k][1].end;break}y(r);let A=j;for(;A<t.events.length;)t.events[A][1].end={...S},A++;return Bi(t.events,k+1,0,t.events.slice(j)),t.events.length=A,u(w)}return l(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(cS,p,d)(w)}function p(w){return i&&b(),y(r),h(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(w)}function h(w){return t.containerState={},e.attempt(cS,m,g)(w)}function m(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function g(w){if(w===null){i&&b(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),v(w)}function v(w){if(w===null){x(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return We(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),v)}function x(w,j){const k=t.sliceStream(w);if(j&&k.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const A=t.events.length;let T=A,L,O;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(L){O=t.events[T][1].end;break}L=!0}for(y(r),S=A;S<t.events.length;)t.events[S][1].end={...O},S++;Bi(t.events,T+1,0,t.events.slice(A)),t.events.length=S}}function y(w){let j=n.length;for(;j-- >w;){const k=n[j];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function V6(e,t,n){return Rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function uS(e){if(e===null||vr(e)||F6(e))return 1;if(B6(e))return 2}function L0(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const kv={name:"attention",resolveAll:q6,tokenize:Y6};function q6(e,t){let n=-1,r,i,a,s,l,c,u,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};dS(d,-c),dS(h,c),s={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Fr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Fr(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),u=Fr(u,L0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Fr(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=Fr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Bi(e,r-1,n-r+3,u),n=r+u.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Y6(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=uS(r);let a;return s;function s(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const u=e.exit("attentionSequence"),p=uS(c),d=!p||p===2&&i||n.includes(c),h=!i||i===2&&p||n.includes(r);return u._open=!!(a===42?d:d&&(i||!h)),u._close=!!(a===42?h:h&&(p||!d)),t(c)}}function dS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const G6={name:"autolink",tokenize:X6};function X6(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return Ni(m)?(e.consume(m),s):m===64?n(m):u(m)}function s(m){return m===43||m===45||m===46||Cr(m)?(r=1,l(m)):u(m)}function l(m){return m===58?(e.consume(m),r=0,c):(m===43||m===45||m===46||Cr(m))&&r++<32?(e.consume(m),l):(r=0,u(m))}function c(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||jv(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),p):D6(m)?(e.consume(m),u):n(m)}function p(m){return Cr(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,p):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||Cr(m))&&r++<63){const g=m===45?h:d;return e.consume(m),g}return n(m)}}const Nh={partial:!0,tokenize:Q6};function Q6(e,t,n){return r;function r(a){return bt(a)?Rt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||We(a)?t(a):n(a)}}const fI={continuation:{tokenize:J6},exit:e8,name:"blockQuote",tokenize:Z6};function Z6(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return bt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function J6(e,t,n){const r=this;return i;function i(s){return bt(s)?Rt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(fI,t,n)(s)}}function e8(e){e.exit("blockQuote")}const hI={name:"characterEscape",tokenize:t8};function t8(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return $6(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const mI={name:"characterReference",tokenize:n8};function n8(e,t,n){const r=this;let i=0,a,s;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,s=Cr,p(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=z6,p):(e.enter("characterReferenceValue"),a=7,s=Sv,p(d))}function p(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return s===Cr&&!_0(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<a?(e.consume(d),p):n(d)}}const pS={partial:!0,tokenize:i8},fS={concrete:!0,name:"codeFenced",tokenize:r8};function r8(e,t,n){const r=this,i={partial:!0,tokenize:k};let a=0,s=0,l;return c;function c(S){return u(S)}function u(S){const A=r.events[r.events.length-1];return a=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(S)}function p(S){return S===l?(s++,e.consume(S),p):s<3?n(S):(e.exit("codeFencedFenceSequence"),bt(S)?Rt(e,d,"whitespace")(S):d(S))}function d(S){return S===null||We(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(pS,v,j)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||We(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):bt(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Rt(e,m,"whitespace")(S)):S===96&&S===l?n(S):(e.consume(S),h)}function m(S){return S===null||We(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||We(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===l?n(S):(e.consume(S),g)}function v(S){return e.attempt(i,j,x)(S)}function x(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return a>0&&bt(S)?Rt(e,b,"linePrefix",a+1)(S):b(S)}function b(S){return S===null||We(S)?e.check(pS,v,j)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||We(S)?(e.exit("codeFlowValue"),b(S)):(e.consume(S),w)}function j(S){return e.exit("codeFenced"),t(S)}function k(S,A,T){let L=0;return O;function O(I){return S.enter("lineEnding"),S.consume(I),S.exit("lineEnding"),R}function R(I){return S.enter("codeFencedFence"),bt(I)?Rt(S,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):_(I)}function _(I){return I===l?(S.enter("codeFencedFenceSequence"),X(I)):T(I)}function X(I){return I===l?(L++,S.consume(I),X):L>=s?(S.exit("codeFencedFenceSequence"),bt(I)?Rt(S,q,"whitespace")(I):q(I)):T(I)}function q(I){return I===null||We(I)?(S.exit("codeFencedFence"),A(I)):T(I)}}}function i8(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Sg={name:"codeIndented",tokenize:o8},a8={partial:!0,tokenize:s8};function o8(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Rt(e,a,"linePrefix",5)(u)}function a(u){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?c(u):We(u)?e.attempt(a8,s,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||We(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function s8(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):We(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Rt(e,a,"linePrefix",5)(s)}function a(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):We(s)?i(s):n(s)}}const l8={name:"codeText",previous:u8,resolve:c8,tokenize:d8};function c8(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function u8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function d8(e,t,n){let r=0,i,a;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(a=e.enter("codeTextSequence"),i=0,p(d)):We(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||We(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function p(d){return d===96?(e.consume(d),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",u(d))}}class p8{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&dc(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),dc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),dc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);dc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);dc(this.left,n.reverse())}}}function dc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function gI(e){const t={};let n=-1,r,i,a,s,l,c,u;const p=new p8(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,f8(p,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=p.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},l=p.slice(i,n),l.unshift(r),p.splice(i,n-i+1,l))}}return Bi(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!u}function f8(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,c=[],u={};let p,d,h=-1,m=n,g=0,v=0;const x=[v];for(;m;){for(;e.get(++i)[1]!==m;);a.push(i),m._tokenizer||(p=r.sliceStream(m),m.next||p.push(null),d&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(p),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(v=h+1,x.push(v),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):x.pop(),h=x.length;h--;){const y=l.slice(x[h],x[h+1]),b=a.pop();c.push([b,b+y.length-1]),e.splice(b,2,y)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const h8={resolve:g8,tokenize:y8},m8={partial:!0,tokenize:v8};function g8(e){return gI(e),e}function y8(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):We(l)?e.check(m8,s,a)(l):(e.consume(l),i)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function v8(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Rt(e,a,"linePrefix")}function a(s){if(s===null||We(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function yI(e,t,n,r,i,a,s,l,c){const u=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(y),e.exit(a),h):y===null||y===32||y===41||jv(y)?n(y):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(y))}function h(y){return y===62?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||We(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function v(y){return!p&&(y===null||y===41||vr(y))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(y)):p<u&&y===40?(e.consume(y),p++,v):y===41?(e.consume(y),p--,v):y===null||y===32||y===40||jv(y)?n(y):(e.consume(y),y===92?x:v)}function x(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}function vI(e,t,n,r,i,a){const s=this;let l=0,c;return u;function u(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(a),p}function p(m){return l>999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(a),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):We(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||We(m)||l++>999?(e.exit("chunkString"),p(m)):(e.consume(m),c||(c=!bt(m)),m===92?h:d)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,d):d(m)}}function xI(e,t,n,r,i,a){let s;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,c):n(h)}function c(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(a),u(h))}function u(h){return h===s?(e.exit(a),c(s)):h===null?n(h):We(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Rt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===s||h===null||We(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?d:p)}function d(h){return h===s||h===92?(e.consume(h),p):p(h)}}function Uc(e,t){let n;return r;function r(i){return We(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):bt(i)?Rt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const x8={name:"definition",tokenize:w8},b8={partial:!0,tokenize:j8};function w8(e,t,n){const r=this;let i;return a;function a(m){return e.enter("definition"),s(m)}function s(m){return vI.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return i=ul(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return vr(m)?Uc(e,u)(m):u(m)}function u(m){return yI(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function p(m){return e.attempt(b8,d,d)(m)}function d(m){return bt(m)?Rt(e,h,"whitespace")(m):h(m)}function h(m){return m===null||We(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function j8(e,t,n){return r;function r(l){return vr(l)?Uc(e,i)(l):n(l)}function i(l){return xI(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return bt(l)?Rt(e,s,"whitespace")(l):s(l)}function s(l){return l===null||We(l)?t(l):n(l)}}const S8={name:"hardBreakEscape",tokenize:k8};function k8(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return We(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const C8={name:"headingAtx",resolve:P8,tokenize:A8};function P8(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Bi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function A8(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||vr(p)?(e.exit("atxHeadingSequence"),l(p)):n(p)}function l(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||We(p)?(e.exit("atxHeading"),t(p)):bt(p)?Rt(e,l,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),l(p))}function u(p){return p===null||p===35||vr(p)?(e.exit("atxHeadingText"),l(p)):(e.consume(p),u)}}const E8=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],hS=["pre","script","style","textarea"],T8={concrete:!0,name:"htmlFlow",resolveTo:N8,tokenize:M8},I8={partial:!0,tokenize:_8},O8={partial:!0,tokenize:R8};function N8(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function M8(e,t,n){const r=this;let i,a,s,l,c;return u;function u(E){return p(E)}function p(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),a=!0,v):E===63?(e.consume(E),i=3,r.interrupt?t:P):Ni(E)?(e.consume(E),s=String.fromCharCode(E),x):n(E)}function h(E){return E===45?(e.consume(E),i=2,m):E===91?(e.consume(E),i=5,l=0,g):Ni(E)?(e.consume(E),i=4,r.interrupt?t:P):n(E)}function m(E){return E===45?(e.consume(E),r.interrupt?t:P):n(E)}function g(E){const me="CDATA[";return E===me.charCodeAt(l++)?(e.consume(E),l===me.length?r.interrupt?t:_:g):n(E)}function v(E){return Ni(E)?(e.consume(E),s=String.fromCharCode(E),x):n(E)}function x(E){if(E===null||E===47||E===62||vr(E)){const me=E===47,ye=s.toLowerCase();return!me&&!a&&hS.includes(ye)?(i=1,r.interrupt?t(E):_(E)):E8.includes(s.toLowerCase())?(i=6,me?(e.consume(E),y):r.interrupt?t(E):_(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):a?b(E):w(E))}return E===45||Cr(E)?(e.consume(E),s+=String.fromCharCode(E),x):n(E)}function y(E){return E===62?(e.consume(E),r.interrupt?t:_):n(E)}function b(E){return bt(E)?(e.consume(E),b):O(E)}function w(E){return E===47?(e.consume(E),O):E===58||E===95||Ni(E)?(e.consume(E),j):bt(E)?(e.consume(E),w):O(E)}function j(E){return E===45||E===46||E===58||E===95||Cr(E)?(e.consume(E),j):k(E)}function k(E){return E===61?(e.consume(E),S):bt(E)?(e.consume(E),k):w(E)}function S(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),c=E,A):bt(E)?(e.consume(E),S):T(E)}function A(E){return E===c?(e.consume(E),c=null,L):E===null||We(E)?n(E):(e.consume(E),A)}function T(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||vr(E)?k(E):(e.consume(E),T)}function L(E){return E===47||E===62||bt(E)?w(E):n(E)}function O(E){return E===62?(e.consume(E),R):n(E)}function R(E){return E===null||We(E)?_(E):bt(E)?(e.consume(E),R):n(E)}function _(E){return E===45&&i===2?(e.consume(E),$):E===60&&i===1?(e.consume(E),H):E===62&&i===4?(e.consume(E),U):E===63&&i===3?(e.consume(E),P):E===93&&i===5?(e.consume(E),W):We(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(I8,le,X)(E)):E===null||We(E)?(e.exit("htmlFlowData"),X(E)):(e.consume(E),_)}function X(E){return e.check(O8,q,le)(E)}function q(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),I}function I(E){return E===null||We(E)?X(E):(e.enter("htmlFlowData"),_(E))}function $(E){return E===45?(e.consume(E),P):_(E)}function H(E){return E===47?(e.consume(E),s="",N):_(E)}function N(E){if(E===62){const me=s.toLowerCase();return hS.includes(me)?(e.consume(E),U):_(E)}return Ni(E)&&s.length<8?(e.consume(E),s+=String.fromCharCode(E),N):_(E)}function W(E){return E===93?(e.consume(E),P):_(E)}function P(E){return E===62?(e.consume(E),U):E===45&&i===2?(e.consume(E),P):_(E)}function U(E){return E===null||We(E)?(e.exit("htmlFlowData"),le(E)):(e.consume(E),U)}function le(E){return e.exit("htmlFlow"),t(E)}}function R8(e,t,n){const r=this;return i;function i(s){return We(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function _8(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Nh,t,n)}}const L8={name:"htmlText",tokenize:D8};function D8(e,t,n){const r=this;let i,a,s;return l;function l(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),c}function c(P){return P===33?(e.consume(P),u):P===47?(e.consume(P),k):P===63?(e.consume(P),w):Ni(P)?(e.consume(P),T):n(P)}function u(P){return P===45?(e.consume(P),p):P===91?(e.consume(P),a=0,g):Ni(P)?(e.consume(P),b):n(P)}function p(P){return P===45?(e.consume(P),m):n(P)}function d(P){return P===null?n(P):P===45?(e.consume(P),h):We(P)?(s=d,H(P)):(e.consume(P),d)}function h(P){return P===45?(e.consume(P),m):d(P)}function m(P){return P===62?$(P):P===45?h(P):d(P)}function g(P){const U="CDATA[";return P===U.charCodeAt(a++)?(e.consume(P),a===U.length?v:g):n(P)}function v(P){return P===null?n(P):P===93?(e.consume(P),x):We(P)?(s=v,H(P)):(e.consume(P),v)}function x(P){return P===93?(e.consume(P),y):v(P)}function y(P){return P===62?$(P):P===93?(e.consume(P),y):v(P)}function b(P){return P===null||P===62?$(P):We(P)?(s=b,H(P)):(e.consume(P),b)}function w(P){return P===null?n(P):P===63?(e.consume(P),j):We(P)?(s=w,H(P)):(e.consume(P),w)}function j(P){return P===62?$(P):w(P)}function k(P){return Ni(P)?(e.consume(P),S):n(P)}function S(P){return P===45||Cr(P)?(e.consume(P),S):A(P)}function A(P){return We(P)?(s=A,H(P)):bt(P)?(e.consume(P),A):$(P)}function T(P){return P===45||Cr(P)?(e.consume(P),T):P===47||P===62||vr(P)?L(P):n(P)}function L(P){return P===47?(e.consume(P),$):P===58||P===95||Ni(P)?(e.consume(P),O):We(P)?(s=L,H(P)):bt(P)?(e.consume(P),L):$(P)}function O(P){return P===45||P===46||P===58||P===95||Cr(P)?(e.consume(P),O):R(P)}function R(P){return P===61?(e.consume(P),_):We(P)?(s=R,H(P)):bt(P)?(e.consume(P),R):L(P)}function _(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),i=P,X):We(P)?(s=_,H(P)):bt(P)?(e.consume(P),_):(e.consume(P),q)}function X(P){return P===i?(e.consume(P),i=void 0,I):P===null?n(P):We(P)?(s=X,H(P)):(e.consume(P),X)}function q(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||vr(P)?L(P):(e.consume(P),q)}function I(P){return P===47||P===62||vr(P)?L(P):n(P)}function $(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function H(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),N}function N(P){return bt(P)?Rt(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):W(P)}function W(P){return e.enter("htmlTextData"),s(P)}}const D0={name:"labelEnd",resolveAll:F8,resolveTo:U8,tokenize:W8},z8={tokenize:K8},$8={tokenize:H8},B8={tokenize:V8};function F8(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Bi(e,0,e.length,n),e}function U8(e,t){let n=e.length,r=0,i,a,s,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[s][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=Fr(l,e.slice(a+1,a+r+3)),l=Fr(l,[["enter",p,t]]),l=Fr(l,L0(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),l=Fr(l,[["exit",p,t],e[s-2],e[s-1],["exit",u,t]]),l=Fr(l,e.slice(s+1)),l=Fr(l,[["exit",c,t]]),Bi(e,a,e.length,l),e}function W8(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(h){return a?a._inactive?d(h):(s=r.parser.defined.includes(ul(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(z8,p,s?p:d)(h):h===91?e.attempt($8,p,s?u:d)(h):s?p(h):d(h)}function u(h){return e.attempt(B8,p,d)(h)}function p(h){return t(h)}function d(h){return a._balanced=!0,n(h)}}function K8(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return vr(d)?Uc(e,a)(d):a(d)}function a(d){return d===41?p(d):yI(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return vr(d)?Uc(e,c)(d):p(d)}function l(d){return n(d)}function c(d){return d===34||d===39||d===40?xI(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):p(d)}function u(d){return vr(d)?Uc(e,p)(d):p(d)}function p(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function H8(e,t,n){const r=this;return i;function i(l){return vI.call(r,e,a,s,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(ul(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function V8(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const q8={name:"labelStartImage",resolveAll:D0.resolveAll,tokenize:Y8};function Y8(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const G8={name:"labelStartLink",resolveAll:D0.resolveAll,tokenize:X8};function X8(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const kg={name:"lineEnding",tokenize:Q8};function Q8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Rt(e,t,"linePrefix")}}const Pp={name:"thematicBreak",tokenize:Z8};function Z8(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||We(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),bt(u)?Rt(e,l,"whitespace")(u):l(u))}}const ur={continuation:{tokenize:nB},exit:iB,name:"list",tokenize:tB},J8={partial:!0,tokenize:aB},eB={partial:!0,tokenize:rB};function tB(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Sv(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Pp,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return Sv(m)&&++s<10?(e.consume(m),c):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Nh,r.interrupt?n:p,e.attempt(J8,h,d))}function p(m){return r.containerState.initialBlankLine=!0,a++,h(m)}function d(m){return bt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function nB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Nh,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Rt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!bt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(eB,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Rt(e,e.attempt(ur,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function rB(e,t,n){const r=this;return Rt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function iB(e){e.exit(this.containerState.type)}function aB(e,t,n){const r=this;return Rt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!bt(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const mS={name:"setextUnderline",resolveTo:oB,tokenize:sB};function oB(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function sB(e,t,n){const r=this;let i;return a;function a(u){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),bt(u)?Rt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||We(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const lB={tokenize:cB};function cB(e){const t=this,n=e.attempt(Nh,r,e.attempt(this.parser.constructs.flowInitial,i,Rt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(h8,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const uB={resolveAll:wI()},dB=bI("string"),pB=bI("text");function bI(e){return{resolveAll:wI(e==="text"?fB:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,l);return s;function s(p){return u(p)?a(p):l(p)}function l(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return u(p)?(n.exit("data"),a(p)):(n.consume(p),c)}function u(p){if(p===null)return!0;const d=i[p];let h=-1;if(d)for(;++h<d.length;){const m=d[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function wI(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function fB(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,s=-1,l=0,c;for(;a--;){const u=i[a];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(u===-2)c=!0,l++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const hB={42:ur,43:ur,45:ur,48:ur,49:ur,50:ur,51:ur,52:ur,53:ur,54:ur,55:ur,56:ur,57:ur,62:fI},mB={91:x8},gB={[-2]:Sg,[-1]:Sg,32:Sg},yB={35:C8,42:Pp,45:[mS,Pp],60:T8,61:mS,95:Pp,96:fS,126:fS},vB={38:mI,92:hI},xB={[-5]:kg,[-4]:kg,[-3]:kg,33:q8,38:mI,42:kv,60:[G6,L8],91:G8,92:[S8,hI],93:D0,95:kv,96:l8},bB={null:[kv,uB]},wB={null:[42,95]},jB={null:[]},SB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:wB,contentInitial:mB,disable:jB,document:hB,flow:yB,flowInitial:gB,insideSpan:bB,string:vB,text:xB},Symbol.toStringTag,{value:"Module"}));function kB(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],l=[];const c={attempt:A(k),check:A(S),consume:b,enter:w,exit:j,interrupt:A(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:d};let p=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function d(R){return s=Fr(s,R),x(),s[s.length-1]!==null?[]:(T(t,0),u.events=L0(a,u.events,u),u.events)}function h(R,_){return PB(m(R),_)}function m(R){return CB(s,R)}function g(){const{_bufferIndex:R,_index:_,line:X,column:q,offset:I}=r;return{_bufferIndex:R,_index:_,line:X,column:q,offset:I}}function v(R){i[R.line]=R.column,O()}function x(){let R;for(;r._index<s.length;){const _=s[r._index];if(typeof _=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<_.length;)y(_.charCodeAt(r._bufferIndex));else y(_)}}function y(R){p=p(R)}function b(R){We(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,O()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=R}function w(R,_){const X=_||{};return X.type=R,X.start=g(),u.events.push(["enter",X,u]),l.push(X),X}function j(R){const _=l.pop();return _.end=g(),u.events.push(["exit",_,u]),_}function k(R,_){T(R,_.from)}function S(R,_){_.restore()}function A(R,_){return X;function X(q,I,$){let H,N,W,P;return Array.isArray(q)?le(q):"tokenize"in q?le([q]):U(q);function U(Q){return ie;function ie(je){const Z=je!==null&&Q[je],re=je!==null&&Q.null,pe=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(re)?re:re?[re]:[]];return le(pe)(je)}}function le(Q){return H=Q,N=0,Q.length===0?$:E(Q[N])}function E(Q){return ie;function ie(je){return P=L(),W=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?ye():Q.tokenize.call(_?Object.assign(Object.create(u),_):u,c,me,ye)(je)}}function me(Q){return R(W,P),I}function ye(Q){return P.restore(),++N<H.length?E(H[N]):$}}}function T(R,_){R.resolveAll&&!a.includes(R)&&a.push(R),R.resolve&&Bi(u.events,_,u.events.length-_,R.resolve(u.events.slice(_),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function L(){const R=g(),_=u.previous,X=u.currentConstruct,q=u.events.length,I=Array.from(l);return{from:q,restore:$};function $(){r=R,u.previous=_,u.currentConstruct=X,u.events.length=q,l=I,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function CB(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function PB(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
69
+ `;break}case-3:{s=`\r
70
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function AB(e){const r={constructs:R6([SB,...(e||{}).extensions||[]]),content:i(U6),defined:[],document:i(K6),flow:i(lB),lazy:{},string:i(dB),text:i(pB)};return r;function i(a){return s;function s(l){return kB(r,a,l)}}}function EB(e){for(;!gI(e););return e}const gS=/[\0\t\n\r]/g;function TB(){let e=1,t="",n=!0,r;return i;function i(a,s,l){const c=[];let u,p,d,h,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(gS.lastIndex=d,u=gS.exec(a),h=u&&u.index!==void 0?u.index:a.length,m=a.charCodeAt(h),!u){t=a.slice(d);break}if(m===10&&d===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<h&&(c.push(a.slice(d,h)),e+=h-d),m){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const IB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function OB(e){return e.replace(IB,NB)}function NB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return pI(n.slice(a?2:1),a?16:10)}return _0(n)||e}const jI={}.hasOwnProperty;function MB(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),RB(n)(EB(AB(n).document().write(TB()(e,t,!0))))}function RB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ke),autolinkProtocol:L,autolinkEmail:L,atxHeading:a(ne),blockQuote:a(re),characterEscape:L,characterReference:L,codeFenced:a(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(pe,s),codeText:a(se,s),codeTextData:L,data:L,codeFlowValue:L,definition:a(Re),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(ke),hardBreakEscape:a(De),hardBreakTrailing:a(De),htmlFlow:a(qe,s),htmlFlowData:L,htmlText:a(qe,s),htmlTextData:L,image:a(ze),label:s,link:a(Ke),listItem:a(Ye),listItemValue:h,listOrdered:a(pt,d),listUnordered:a(pt),paragraph:a(Qe),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(ne),strong:a(Ze),thematicBreak:a(J)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:Z,autolinkProtocol:je,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:Q,characterReference:ie,codeFenced:c(x),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:O,codeIndented:c(y),codeText:c(I),codeTextData:O,data:O,definition:c(),definitionDestinationString:j,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(_),hardBreakTrailing:c(_),htmlFlow:c(X),htmlFlowData:O,htmlText:c(q),htmlTextData:O,image:c(H),label:W,labelText:N,lineEnding:R,link:c($),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:me,resourceDestinationString:P,resourceTitleString:U,resource:le,setextHeading:c(T),setextHeadingLineSequence:A,setextHeadingText:S,strong:c(),thematicBreak:c()}};SI(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let ue={type:"root",children:[]};const M={stack:[ue],tokenStack:[],config:t,enter:l,exit:u,buffer:s,resume:p,data:n},fe=[];let ee=-1;for(;++ee<Y.length;)if(Y[ee][1].type==="listOrdered"||Y[ee][1].type==="listUnordered")if(Y[ee][0]==="enter")fe.push(ee);else{const xe=fe.pop();ee=i(Y,xe,ee)}for(ee=-1;++ee<Y.length;){const xe=t[Y[ee][0]];jI.call(xe,Y[ee][1].type)&&xe[Y[ee][1].type].call(Object.assign({sliceSerialize:Y[ee][2].sliceSerialize},M),Y[ee][1])}if(M.tokenStack.length>0){const xe=M.tokenStack[M.tokenStack.length-1];(xe[1]||yS).call(M,void 0,xe[0])}for(ue.position={start:Ia(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:Ia(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},ee=-1;++ee<t.transforms.length;)ue=t.transforms[ee](ue)||ue;return ue}function i(Y,ue,M){let fe=ue-1,ee=-1,xe=!1,Se,Le,$e,He;for(;++fe<=M;){const Oe=Y[fe];switch(Oe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Oe[0]==="enter"?ee++:ee--,He=void 0;break}case"lineEndingBlank":{Oe[0]==="enter"&&(Se&&!He&&!ee&&!$e&&($e=fe),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!ee&&Oe[0]==="enter"&&Oe[1].type==="listItemPrefix"||ee===-1&&Oe[0]==="exit"&&(Oe[1].type==="listUnordered"||Oe[1].type==="listOrdered")){if(Se){let Xe=fe;for(Le=void 0;Xe--;){const D=Y[Xe];if(D[1].type==="lineEnding"||D[1].type==="lineEndingBlank"){if(D[0]==="exit")continue;Le&&(Y[Le][1].type="lineEndingBlank",xe=!0),D[1].type="lineEnding",Le=Xe}else if(!(D[1].type==="linePrefix"||D[1].type==="blockQuotePrefix"||D[1].type==="blockQuotePrefixWhitespace"||D[1].type==="blockQuoteMarker"||D[1].type==="listItemIndent"))break}$e&&(!Le||$e<Le)&&(Se._spread=!0),Se.end=Object.assign({},Le?Y[Le][1].start:Oe[1].end),Y.splice(Le||fe,0,["exit",Se,Oe[2]]),fe++,M++}if(Oe[1].type==="listItemPrefix"){const Xe={type:"listItem",_spread:!1,start:Object.assign({},Oe[1].start),end:void 0};Se=Xe,Y.splice(fe,0,["enter",Xe,Oe[2]]),fe++,M++,$e=void 0,He=!0}}}return Y[ue][1]._spread=xe,M}function a(Y,ue){return M;function M(fe){l.call(this,Y(fe),fe),ue&&ue.call(this,fe)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(Y,ue,M){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([ue,M||void 0]),Y.position={start:Ia(ue.start),end:void 0}}function c(Y){return ue;function ue(M){Y&&Y.call(this,M),u.call(this,M)}}function u(Y,ue){const M=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==Y.type&&(ue?ue.call(this,Y,fe[0]):(fe[1]||yS).call(this,Y,fe[0]));else throw new Error("Cannot close `"+Y.type+"` ("+Fc({start:Y.start,end:Y.end})+"): it’s not open");M.position.end=Ia(Y.end)}function p(){return N6(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(Y){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function m(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=Y}function g(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=Y}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y.replace(/(\r?\n|\r)$/g,"")}function b(Y){const ue=this.resume(),M=this.stack[this.stack.length-1];M.label=ue,M.identifier=ul(this.sliceSerialize(Y)).toLowerCase()}function w(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.title=Y}function j(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.url=Y}function k(Y){const ue=this.stack[this.stack.length-1];if(!ue.depth){const M=this.sliceSerialize(Y).length;ue.depth=M}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(Y){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function L(Y){const M=this.stack[this.stack.length-1].children;let fe=M[M.length-1];(!fe||fe.type!=="text")&&(fe=tt(),fe.position={start:Ia(Y.start),end:void 0},M.push(fe)),this.stack.push(fe)}function O(Y){const ue=this.stack.pop();ue.value+=this.sliceSerialize(Y),ue.position.end=Ia(Y.end)}function R(Y){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const M=ue.children[ue.children.length-1];M.position.end=Ia(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ue.type)&&(L.call(this,Y),O.call(this,Y))}function _(){this.data.atHardBreak=!0}function X(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y}function q(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y}function I(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y}function $(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ue,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function H(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ue,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function N(Y){const ue=this.sliceSerialize(Y),M=this.stack[this.stack.length-2];M.label=OB(ue),M.identifier=ul(ue).toLowerCase()}function W(){const Y=this.stack[this.stack.length-1],ue=this.resume(),M=this.stack[this.stack.length-1];if(this.data.inReference=!0,M.type==="link"){const fe=Y.children;M.children=fe}else M.alt=ue}function P(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.url=Y}function U(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.title=Y}function le(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function me(Y){const ue=this.resume(),M=this.stack[this.stack.length-1];M.label=ue,M.identifier=ul(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function ye(Y){this.data.characterReferenceType=Y.type}function Q(Y){const ue=this.sliceSerialize(Y),M=this.data.characterReferenceType;let fe;M?(fe=pI(ue,M==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=_0(ue);const ee=this.stack[this.stack.length-1];ee.value+=fe}function ie(Y){const ue=this.stack.pop();ue.position.end=Ia(Y.end)}function je(Y){O.call(this,Y);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(Y)}function Z(Y){O.call(this,Y);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(Y)}function re(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function ne(){return{type:"heading",depth:0,children:[]}}function De(){return{type:"break"}}function qe(){return{type:"html",value:""}}function ze(){return{type:"image",title:null,url:"",alt:null}}function Ke(){return{type:"link",title:null,url:"",children:[]}}function pt(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function Ye(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function Ze(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function J(){return{type:"thematicBreak"}}}function Ia(e){return{line:e.line,column:e.column,offset:e.offset}}function SI(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?SI(e,r):_B(e,r)}}function _B(e,t){let n;for(n in t)if(jI.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function yS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fc({start:t.start,end:t.end})+") is still open")}function LB(e){const t=this;t.parser=n;function n(r){return MB(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function DB(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function zB(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
71
+ `}]}function $B(e,t){const n=t.value?t.value+`
72
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function BB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Fl(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function WB(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function kI(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function HB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kI(e,t);const i={src:Fl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function VB(e,t){const n={src:Fl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function qB(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function YB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kI(e,t);const i={href:Fl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function GB(e,t){const n={href:Fl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function XB(e,t,n){const r=e.all(t),i=n?QB(n):CI(t),a={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const p=r[l];(i||l!==0||p.type!=="element"||p.tagName!=="p")&&s.push({type:"text",value:`
73
+ `}),p.type==="element"&&p.tagName==="p"&&!i?s.push(...p.children):s.push(p)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
74
+ `});const u={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,u),e.applyData(t,u)}function QB(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=CI(n[r])}return t}function CI(e){const t=e.spread;return t??e.children.length>1}function ZB(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function JB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function e5(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function t5(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function n5(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=O0(t.children[1]),c=aI(t.children[t.children.length-1]);l&&c&&(s.position={start:l,end:c}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function r5(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const d=t.children[c],h={},m=s?s[c]:void 0;m&&(h.align=m);let g={type:"element",tagName:a,properties:h,children:[]};d&&(g.children=e.all(d),e.patch(d,g),g=e.applyData(d,g)),u.push(g)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,p),e.applyData(t,p)}function i5(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const vS=9,xS=32;function a5(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(bS(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(bS(t.slice(i),i>0,!1)),a.join("")}function bS(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===vS||a===xS;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===vS||a===xS;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function o5(e,t){const n={type:"text",value:a5(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function s5(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const l5={blockquote:DB,break:zB,code:$B,delete:BB,emphasis:FB,footnoteReference:UB,heading:WB,html:KB,imageReference:HB,image:VB,inlineCode:qB,linkReference:YB,link:GB,listItem:XB,list:ZB,paragraph:JB,root:e5,strong:t5,table:n5,tableCell:i5,tableRow:r5,text:o5,thematicBreak:s5,toml:Ld,yaml:Ld,definition:Ld,footnoteDefinition:Ld};function Ld(){}const PI=-1,Mh=0,Wc=1,sf=2,z0=3,$0=4,B0=5,F0=6,AI=7,EI=8,c5=typeof self=="object"?self:globalThis,wS=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new c5[e](t)},u5=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case Mh:case PI:return n(s,i);case Wc:{const l=n([],i);for(const c of s)l.push(r(c));return l}case sf:{const l=n({},i);for(const[c,u]of s)l[r(c)]=r(u);return l}case z0:return n(new Date(s),i);case $0:{const{source:l,flags:c}=s;return n(new RegExp(l,c),i)}case B0:{const l=n(new Map,i);for(const[c,u]of s)l.set(r(c),r(u));return l}case F0:{const l=n(new Set,i);for(const c of s)l.add(r(c));return l}case AI:{const{name:l,message:c}=s;return n(wS(l,c),i)}case EI:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(wS(a,s),i)};return r},jS=e=>u5(new Map,e)(0),Ao="",{toString:d5}={},{keys:p5}=Object,pc=e=>{const t=typeof e;if(t!=="object"||!e)return[Mh,t];const n=d5.call(e).slice(8,-1);switch(n){case"Array":return[Wc,Ao];case"Object":return[sf,Ao];case"Date":return[z0,Ao];case"RegExp":return[$0,Ao];case"Map":return[B0,Ao];case"Set":return[F0,Ao];case"DataView":return[Wc,n]}return n.includes("Array")?[Wc,n]:n.includes("Error")?[AI,n]:[sf,n]},Dd=([e,t])=>e===Mh&&(t==="function"||t==="symbol"),f5=(e,t,n,r)=>{const i=(s,l)=>{const c=r.push(s)-1;return n.set(l,c),c},a=s=>{if(n.has(s))return n.get(s);let[l,c]=pc(s);switch(l){case Mh:{let p=s;switch(c){case"bigint":l=EI,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return i([PI],s)}return i([l,p],s)}case Wc:{if(c){let h=s;return c==="DataView"?h=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(s)),i([c,[...h]],s)}const p=[],d=i([l,p],s);for(const h of s)p.push(a(h));return d}case sf:{if(c)switch(c){case"BigInt":return i([c,s.toString()],s);case"Boolean":case"Number":case"String":return i([c,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const p=[],d=i([l,p],s);for(const h of p5(s))(e||!Dd(pc(s[h])))&&p.push([a(h),a(s[h])]);return d}case z0:return i([l,isNaN(s.getTime())?Ao:s.toISOString()],s);case $0:{const{source:p,flags:d}=s;return i([l,{source:p,flags:d}],s)}case B0:{const p=[],d=i([l,p],s);for(const[h,m]of s)(e||!(Dd(pc(h))||Dd(pc(m))))&&p.push([a(h),a(m)]);return d}case F0:{const p=[],d=i([l,p],s);for(const h of s)(e||!Dd(pc(h)))&&p.push(a(h));return d}}const{message:u}=s;return i([l,{name:c,message:u}],s)};return a},SS=(e,{json:t,lossy:n}={})=>{const r=[];return f5(!(t||n),!!t,new Map,r)(e),r},lf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?jS(SS(e,t)):structuredClone(e):(e,t)=>jS(SS(e,t));function h5(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function m5(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function g5(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||h5,r=e.options.footnoteBackLabel||m5,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const p=e.all(u),d=String(u.identifier).toUpperCase(),h=Fl(d.toLowerCase());let m=0;const g=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++m<=v;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,m);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const x=p[p.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const b=x.children[x.children.length-1];b&&b.type==="text"?b.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else p.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(p,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...lf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
75
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
76
+ `}]}}const TI=function(e){if(e==null)return b5;if(typeof e=="function")return Rh(e);if(typeof e=="object")return Array.isArray(e)?y5(e):v5(e);if(typeof e=="string")return x5(e);throw new Error("Expected function, string, or object as test")};function y5(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=TI(e[n]);return Rh(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function v5(e){const t=e;return Rh(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function x5(e){return Rh(t);function t(n){return n&&n.type===e}}function Rh(e){return t;function t(n,r,i){return!!(w5(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function b5(){return!0}function w5(e){return e!==null&&typeof e=="object"&&"type"in e}const II=[],j5=!0,kS=!1,S5="skip";function k5(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=TI(i),s=r?-1:1;l(e,void 0,[])();function l(c,u,p){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=II,g,v,x;if((!t||a(c,u,p[p.length-1]||void 0))&&(m=C5(n(c,p)),m[0]===kS))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==S5)for(v=(r?y.children.length:-1)+s,x=p.concat(y);v>-1&&v<y.children.length;){const b=y.children[v];if(g=l(b,v,x)(),g[0]===kS)return g;v=typeof g[1]=="number"?g[1]:v+s}}return m}}}function C5(e){return Array.isArray(e)?e:typeof e=="number"?[j5,e]:e==null?II:[e]}function OI(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),k5(e,a,l,i);function l(c,u){const p=u[u.length-1],d=p?p.children.indexOf(c):void 0;return s(c,d,p)}}const Cv={}.hasOwnProperty,P5={};function A5(e,t){const n=t||P5,r=new Map,i=new Map,a=new Map,s={...l5,...n.handlers},l={all:u,applyData:T5,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:c,options:n,patch:E5,wrap:O5};return OI(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const d=p.type==="definition"?r:i,h=String(p.identifier).toUpperCase();d.has(h)||d.set(h,p)}}),l;function c(p,d){const h=p.type,m=l.handlers[h];if(Cv.call(l.handlers,h)&&m)return m(l,p,d);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in p){const{children:v,...x}=p,y=lf(x);return y.children=l.all(p),y}return lf(p)}return(l.options.unknownHandler||I5)(l,p,d)}function u(p){const d=[];if("children"in p){const h=p.children;let m=-1;for(;++m<h.length;){const g=l.one(h[m],p);if(g){if(m&&h[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=CS(g.value)),!Array.isArray(g)&&g.type==="element")){const v=g.children[0];v&&v.type==="text"&&(v.value=CS(v.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function E5(e,t){e.position&&(t.position=u6(e))}function T5(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,lf(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function I5(e,t){const n=t.data||{},r="value"in t&&!(Cv.call(n,"hProperties")||Cv.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function O5(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
77
+ `});++r<e.length;)r&&n.push({type:"text",value:`
78
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
79
+ `}),n}function CS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function PS(e,t){const n=A5(e,t),r=n.one(e,void 0),i=g5(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
80
+ `},i),a}function N5(e,t){return e&&"run"in e?async function(n,r){const i=PS(n,{file:r,...t});await e.run(i,r)}:function(n,r){return PS(n,{file:r,...e||t})}}function AS(e){if(e)throw e}var Ap=Object.prototype.hasOwnProperty,NI=Object.prototype.toString,ES=Object.defineProperty,TS=Object.getOwnPropertyDescriptor,IS=function(t){return typeof Array.isArray=="function"?Array.isArray(t):NI.call(t)==="[object Array]"},OS=function(t){if(!t||NI.call(t)!=="[object Object]")return!1;var n=Ap.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ap.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ap.call(t,i)},NS=function(t,n){ES&&n.name==="__proto__"?ES(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},MS=function(t,n){if(n==="__proto__")if(Ap.call(t,n)){if(TS)return TS(t,n).value}else return;return t[n]},M5=function e(){var t,n,r,i,a,s,l=arguments[0],c=1,u=arguments.length,p=!1;for(typeof l=="boolean"&&(p=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=MS(l,n),i=MS(t,n),l!==i&&(p&&i&&(OS(i)||(a=IS(i)))?(a?(a=!1,s=r&&IS(r)?r:[]):s=r&&OS(r)?r:{},NS(l,{name:n,newValue:e(p,s,i)})):typeof i<"u"&&NS(l,{name:n,newValue:i}));return l};const Cg=Rl(M5);function Pv(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)}function R5(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(c,...u){const p=e[++a];let d=-1;if(c){s(c);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,p?_5(p,l)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function _5(e,t){let n;return r;function r(...s){const l=e.length>s.length;let c;l&&s.push(i);try{c=e.apply(this,s)}catch(u){const p=u;if(l&&n)throw p;return i(p)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(s,...l){n||(n=!0,t(s,...l))}function a(s){i(null,s)}}const Ai={basename:L5,dirname:D5,extname:z5,join:$5,sep:"/"};function L5(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');zu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function D5(e){if(zu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function z5(e){zu(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function $5(...e){let t=-1,n;for(;++t<e.length;)zu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":B5(n)}function B5(e){zu(e);const t=e.codePointAt(0)===47;let n=F5(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function F5(e,t){let n="",r=0,i=-1,a=0,s=-1,l,c;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else l===46&&a>-1?a++:a=-1}return n}function zu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const U5={cwd:W5};function W5(){return"/"}function Av(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function K5(e){if(typeof e=="string")e=new URL(e);else if(!Av(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return H5(e)}function H5(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Pg=["history","path","basename","stem","extname","dirname"];class MI{constructor(t){let n;t?Av(t)?n={path:t}:typeof t=="string"||V5(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":U5.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Pg.length;){const a=Pg[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Pg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ai.basename(this.path):void 0}set basename(t){Eg(t,"basename"),Ag(t,"basename"),this.path=Ai.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ai.dirname(this.path):void 0}set dirname(t){RS(this.basename,"dirname"),this.path=Ai.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ai.extname(this.path):void 0}set extname(t){if(Ag(t,"extname"),RS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ai.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Av(t)&&(t=K5(t)),Eg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ai.basename(this.path,this.extname):void 0}set stem(t){Eg(t,"stem"),Ag(t,"stem"),this.path=Ai.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Gn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ag(e,t){if(e&&e.includes(Ai.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ai.sep+"`")}function Eg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function RS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function V5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const q5=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},Y5={}.hasOwnProperty;class U0 extends q5{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=R5()}copy(){const t=new U0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Cg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Og("data",this.frozen),this.namespace[t]=n,this):Y5.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Og("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=zd(t),r=this.parser||this.Parser;return Tg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Tg("process",this.parser||this.Parser),Ig("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const l=zd(t),c=r.parse(l);r.run(c,l,function(p,d,h){if(p||!d||!h)return u(p);const m=d,g=r.stringify(m,h);Q5(g)?h.value=g:h.result=g,u(p,h)});function u(p,d){p||!d?s(p):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Tg("processSync",this.parser||this.Parser),Ig("processSync",this.compiler||this.Compiler),this.process(t,i),LS("processSync","process",n),r;function i(a,s){n=!0,AS(a),r=s}}run(t,n,r){_S(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,l){const c=zd(n);i.run(t,c,u);function u(p,d,h){const m=d||t;p?l(p):s?s(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),LS("runSync","run",r),i;function a(s,l){AS(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=zd(n),i=this.compiler||this.Compiler;return Ig("stringify",i),_S(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Og("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[p,...d]=u;c(p,d)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(i.settings=Cg(!0,i.settings,u.settings))}function l(u){let p=-1;if(u!=null)if(Array.isArray(u))for(;++p<u.length;){const d=u[p];a(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,p){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===u){h=d;break}if(h===-1)r.push([u,...p]);else if(p.length>0){let[m,...g]=p;const v=r[h][1];Pv(v)&&Pv(m)&&(m=Cg(!0,v,m)),r[h]=[u,m,...g]}}}}const G5=new U0().freeze();function Tg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ig(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Og(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _S(e){if(!Pv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function LS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function zd(e){return X5(e)?e:new MI(e)}function X5(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Q5(e){return typeof e=="string"||Z5(e)}function Z5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const J5="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",DS=[],zS={allowDangerousHtml:!0},eF=/^(https?|ircs?|mailto|xmpp)$/i,tF=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Kc(e){const t=nF(e),n=rF(e);return iF(t.runSync(t.parse(n),n),e)}function nF(e){const t=e.rehypePlugins||DS,n=e.remarkPlugins||DS,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...zS}:zS;return G5().use(LB).use(n).use(N5,r).use(t)}function rF(e){const t=e.children||"",n=new MI;return typeof t=="string"&&(n.value=t),n}function iF(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||aF;for(const p of tF)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+J5+p.id,void 0);return OI(e,u),m6(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(p,d,h){if(p.type==="raw"&&h&&typeof d=="number")return s?h.children.splice(d,1):h.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let m;for(m in jg)if(Object.hasOwn(jg,m)&&Object.hasOwn(p.properties,m)){const g=p.properties[m],v=jg[m];(v===null||v.includes(p.tagName))&&(p.properties[m]=c(String(g||""),m,p))}}if(p.type==="element"){let m=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(p,d,h)),m&&h&&typeof d=="number")return l&&p.children?h.children.splice(d,1,...p.children):h.children.splice(d,1),d}}}function aF(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||eF.test(e.slice(0,t))?e:""}const ae=(e,t)=>{if(!t)return e;const n=new URLSearchParams;Object.entries(t).forEach(([i,a])=>{a!=null&&a!==""&&n.set(i,String(a))});const r=n.toString();return r?`${e}?${r}`:e},oe=async(e,t={})=>{const n=localStorage.getItem("auth_token"),r=await fetch(e,{...t,headers:{"Content-Type":"application/json",...n?{"Access-Token":n}:{},...t.headers||{}}});if(!r.ok){if(r.status===401){localStorage.removeItem("auth_token");const l=await r.text(),c=new Error(l||r.statusText);throw c.status=401,c}const a=await r.text();let s=null;try{const l=JSON.parse(a);l.error&&(s=l.error)}catch{}throw new Error(s||a||r.statusText)}return r.status===204?void 0:(r.headers.get("content-type")||"").includes("application/json")?r.json():r.text()},V={getAuthStatus:()=>oe(ae("/api/auth/status")),login:e=>oe(ae("/api/auth/login"),{method:"POST",body:JSON.stringify({authCode:e})}),checkVersion:()=>oe(ae("/api/version/check")),getVendors:()=>oe(ae("/api/vendors")),createVendor:e=>oe(ae("/api/vendors"),{method:"POST",body:JSON.stringify(e)}),updateVendor:(e,t)=>oe(ae(`/api/vendors/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteVendor:e=>oe(ae(`/api/vendors/${e}`),{method:"DELETE"}),getAPIServices:e=>oe(ae("/api/services",e?{vendorId:e}:void 0)),createAPIService:e=>oe(ae("/api/services"),{method:"POST",body:JSON.stringify(e)}),updateAPIService:(e,t)=>oe(ae(`/api/services/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAPIService:e=>oe(ae(`/api/services/${e}`),{method:"DELETE"}),getRoutes:()=>oe(ae("/api/routes")),createRoute:e=>oe(ae("/api/routes"),{method:"POST",body:JSON.stringify(e)}),updateRoute:(e,t)=>oe(ae(`/api/routes/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRoute:e=>oe(ae(`/api/routes/${e}`),{method:"DELETE"}),getToolBindings:()=>oe(ae("/api/tool-bindings")),activateToolRoute:(e,t)=>oe(ae("/api/tool-bindings/activate"),{method:"POST",body:JSON.stringify({tool:e,routeId:t})}),deactivateToolRoute:e=>oe(ae("/api/tool-bindings/deactivate"),{method:"POST",body:JSON.stringify({tool:e})}),getRules:e=>oe(ae("/api/rules",e?{routeId:e}:void 0)),createRule:e=>oe(ae("/api/rules"),{method:"POST",body:JSON.stringify(e)}),updateRule:(e,t)=>oe(ae(`/api/rules/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRule:e=>oe(ae(`/api/rules/${e}`),{method:"DELETE"}),resetRuleTokens:e=>oe(ae(`/api/rules/${e}/reset-tokens`),{method:"PUT"}),resetRuleRequests:e=>oe(ae(`/api/rules/${e}/reset-requests`),{method:"PUT"}),clearRuleBlacklist:e=>oe(ae(`/api/rules/${e}/clear-blacklist`),{method:"PUT"}),toggleRuleDisable:e=>oe(ae(`/api/rules/${e}/toggle-disable`),{method:"PUT"}),clearRuleStatus:e=>oe(ae(`/api/rules/${e}/clear-status`),{method:"POST"}),getRuleStatuses:()=>oe(ae("/api/rules/status")),getRulesBlacklistStatus:e=>oe(ae(`/api/rules/${e}/blacklist-status`)),getLogs:(e,t)=>oe(ae("/api/logs",{limit:e,offset:t})),clearLogs:()=>oe(ae("/api/logs"),{method:"DELETE"}),getErrorLogs:(e,t)=>oe(ae("/api/error-logs",{limit:e,offset:t})),clearErrorLogs:()=>oe(ae("/api/error-logs"),{method:"DELETE"}),getLogsCount:()=>oe(ae("/api/logs/count")),getErrorLogsCount:()=>oe(ae("/api/error-logs/count")),searchLogs:(e,t,n)=>oe(ae("/api/logs/search",{query:e,limit:t,offset:n})),searchLogsCount:e=>oe(ae("/api/logs/search/count",{query:e})),queryLogs:async({filters:e,keyword:t,limit:n,offset:r})=>{const i=await oe(ae("/api/logs",{targetType:e==null?void 0:e.targetType,vendorId:e==null?void 0:e.vendorId,serviceId:e==null?void 0:e.serviceId,model:e==null?void 0:e.model,routeId:e==null?void 0:e.routeId,keyword:t,limit:n,offset:r}));if(!Array.isArray(i)){const l=i;return{logs:l.logs??[],total:l.total??0}}const a=i;let s=a.length;try{!!(e&&(e.targetType||e.vendorId||e.serviceId||e.model||e.routeId))||(s=(await oe(ae("/api/logs/count"))).count)}catch{}return{logs:a,total:s}},queryErrorLogs:async({filters:e,keyword:t,limit:n,offset:r})=>{const i=await oe(ae("/api/error-logs",{targetType:e==null?void 0:e.targetType,vendorId:e==null?void 0:e.vendorId,serviceId:e==null?void 0:e.serviceId,model:e==null?void 0:e.model,routeId:e==null?void 0:e.routeId,keyword:t,limit:n,offset:r}));if(!Array.isArray(i)){const l=i;return{logs:l.logs??[],total:l.total??0}}const a=i;let s=a.length;try{!!(e&&(e.targetType||e.vendorId||e.serviceId||e.model||e.routeId))||!!t||(s=(await oe(ae("/api/error-logs/count"))).count)}catch{}return{logs:a,total:s}},searchErrorLogs:(e,t,n)=>oe(ae("/api/error-logs/search",{query:e,limit:t,offset:n})),searchErrorLogsCount:e=>oe(ae("/api/error-logs/search/count",{query:e})),getStatistics:(e=30)=>oe(ae("/api/statistics",{days:e})),resetStatistics:()=>oe(ae("/api/statistics"),{method:"DELETE"}),getPerformanceServicesOverview:()=>oe(ae("/api/performance/services-overview")),getPerformanceVendors:()=>oe(ae("/api/performance/vendors")),getPerformanceVendor:e=>oe(ae(`/api/performance/vendors/${e}`)),getPerformanceService:e=>oe(ae(`/api/performance/services/${e}`)),getPerformanceModel:(e,t)=>oe(ae(`/api/performance/services/${e}/models/${encodeURIComponent(t)}`)),getConfig:()=>oe(ae("/api/config")),updateConfig:e=>oe(ae("/api/config"),{method:"PUT",body:JSON.stringify(e)}),exportData:async e=>(await oe(ae("/api/export"),{method:"POST",body:JSON.stringify({password:e})})).data,previewImportData:(e,t)=>oe(ae("/api/import/preview"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),importData:(e,t)=>oe(ae("/api/import"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),writeClaudeConfig:(e,t,n)=>oe(ae("/api/write-config/claude"),{method:"POST",body:JSON.stringify({enableAgentTeams:e,enableBypassPermissionsSupport:t,permissionsDefaultMode:n})}),writeCodexConfig:(e,t)=>oe(ae("/api/write-config/codex"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e,enableMemories:t})}),writeOpencodeConfig:e=>oe(ae("/api/write-config/opencode"),{method:"POST",body:JSON.stringify({defaultModel:e})}),restoreClaudeConfig:()=>oe(ae("/api/restore-config/claude"),{method:"POST"}),restoreCodexConfig:()=>oe(ae("/api/restore-config/codex"),{method:"POST"}),restoreOpencodeConfig:()=>oe(ae("/api/restore-config/opencode"),{method:"POST"}),updateClaudeAgentTeams:e=>oe(ae("/api/update-claude-agent-teams"),{method:"POST",body:JSON.stringify({enableAgentTeams:e})}),updateClaudeBypassPermissionsSupport:e=>oe(ae("/api/update-claude-bypass-permissions-support"),{method:"POST",body:JSON.stringify({enableBypassPermissionsSupport:e})}),updateCodexReasoningEffort:e=>oe(ae("/api/update-codex-reasoning-effort"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e})}),checkClaudeBackup:()=>oe(ae("/api/check-backup/claude")),checkCodexBackup:()=>oe(ae("/api/check-backup/codex")),getClaudeConfigStatus:()=>oe(ae("/api/config-status/claude")),getCodexConfigStatus:()=>oe(ae("/api/config-status/codex")),getSessions:async({filters:e,keyword:t,limit:n,offset:r}={})=>{const i=await oe(ae("/api/sessions",{targetType:e==null?void 0:e.targetType,vendorId:e==null?void 0:e.vendorId,serviceId:e==null?void 0:e.serviceId,model:e==null?void 0:e.model,routeId:e==null?void 0:e.routeId,keyword:t,limit:n,offset:r}));if(!Array.isArray(i)){const l=i;return{sessions:l.sessions??[],total:l.total??0}}const a=i;let s=a.length;try{!!(e&&(e.targetType||e.vendorId||e.serviceId||e.model||e.routeId))||!!t||(s=(await oe(ae("/api/sessions/count"))).count)}catch{}return{sessions:a,total:s}},getSessionsCount:()=>oe(ae("/api/sessions/count")),getSession:e=>oe(ae(`/api/sessions/${e}`)),getSessionLogs:(e,t)=>oe(ae(`/api/sessions/${e}/logs`,{limit:t})),deleteSession:e=>oe(ae(`/api/sessions/${e}`),{method:"DELETE"}),clearSessions:()=>oe(ae("/api/sessions"),{method:"DELETE"}),cleanupSessions:(e,t)=>oe(ae("/api/sessions/cleanup"),{method:"POST",body:JSON.stringify({beforeDays:e,onlyLogs:t})}),getRecommendVendorsMarkdown:()=>oe(ae("/api/docs/recommend-vendors")),getReadmeMarkdown:()=>oe(ae("/api/docs/readme")),getInstalledSkills:()=>oe(ae("/api/skills/installed")),searchSkills:e=>oe(ae("/api/skills/search"),{method:"POST",body:JSON.stringify({query:e})}),getSkillDetails:e=>oe(ae(`/api/skills/${e}/details`)),installSkill:(e,t)=>oe(ae("/api/skills/install"),{method:"POST",body:JSON.stringify({skillId:e.id,name:e.name,description:e.description,tags:e.tags,...t?{targetType:t}:{},githubUrl:e.url})}),enableSkill:(e,t)=>oe(ae(`/api/skills/${e}/enable`),{method:"POST",body:JSON.stringify({targetType:t})}),disableSkill:(e,t)=>oe(ae(`/api/skills/${e}/disable`),{method:"POST",body:JSON.stringify({targetType:t})}),deleteSkill:e=>oe(ae(`/api/skills/${e}`),{method:"DELETE"}),createLocalSkill:e=>oe(ae("/api/skills/create-local"),{method:"POST",body:JSON.stringify(e)}),getUpgradeMarkdown:()=>oe(ae("/api/docs/upgrade")),getUpgrade:()=>oe(ae("/api/upgrade")),acknowledgeUpgrade:()=>oe(ae("/api/upgrade/ack"),{method:"POST"}),getMCPs:()=>oe(ae("/api/mcps")),getMCP:e=>oe(ae(`/api/mcps/${e}`)),createMCP:e=>oe(ae("/api/mcps"),{method:"POST",body:JSON.stringify(e)}),updateMCP:(e,t)=>oe(ae(`/api/mcps/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteMCP:e=>oe(ae(`/api/mcps/${e}`),{method:"DELETE"}),bindSessionRoute:(e,t)=>oe(ae(`/api/sessions/${e}/bind-route`),{method:"PUT",body:JSON.stringify({routeId:t})}),unbindSessionRoute:e=>oe(ae(`/api/sessions/${e}/bind-route`),{method:"DELETE"}),getBoundSessions:e=>oe(ae(`/api/routes/${e}/bound-sessions`)),migrationPreview:(e,t)=>oe(ae(`/api/sessions/${e}/migration-preview`),{method:"POST",body:JSON.stringify(t)}),migrateSession:(e,t)=>oe(ae(`/api/sessions/${e}/migrate`),{method:"POST",body:JSON.stringify(t)}),migrateLaunch:(e,t)=>oe(ae(`/api/sessions/${e}/migrate-launch`),{method:"POST",body:JSON.stringify(t)}),getApiPathBindings:()=>oe(ae("/api/api-path-bindings")),updateApiPathBindings:(e,t)=>oe(ae("/api/api-path-bindings"),{method:"PUT",body:JSON.stringify({bindings:e,models:t})}),getAccessKeys:e=>oe(ae("/api/access-keys",e)),createAccessKey:e=>oe(ae("/api/access-keys"),{method:"POST",body:JSON.stringify(e)}),getAccessKey:e=>oe(ae(`/api/access-keys/${e}`)),updateAccessKey:(e,t)=>oe(ae(`/api/access-keys/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAccessKey:e=>oe(ae(`/api/access-keys/${e}`),{method:"DELETE"}),regenerateAccessKey:e=>oe(ae(`/api/access-keys/${e}/regenerate`),{method:"POST"}),batchUpdateAccessKeyStatus:(e,t)=>oe(ae("/api/access-keys/batch/status"),{method:"PUT",body:JSON.stringify({keyIds:e,status:t})}),batchBindAccessKeyPolicy:(e,t)=>oe(ae("/api/access-keys/batch/policy"),{method:"PUT",body:JSON.stringify({keyIds:e,policyId:t})}),batchDeleteAccessKeys:e=>oe(ae("/api/access-keys/batch"),{method:"DELETE",body:JSON.stringify({keyIds:e})}),getAccessKeyUsage:e=>oe(ae(`/api/access-keys/${e}/usage`)),getAccessKeyUsageTrend:(e,t)=>oe(ae(`/api/access-keys/${e}/usage/trend`,{days:t})),getAccessKeyLogs:(e,t)=>oe(ae(`/api/access-keys/${e}/logs`,t)),getAccessKeySessions:(e,t)=>oe(ae(`/api/access-keys/${e}/sessions`,t)),getAccessKeySession:(e,t)=>oe(ae(`/api/access-keys/${e}/sessions/${t}`)),getAccessKeySessionLogs:(e,t,n)=>oe(ae(`/api/access-keys/${e}/sessions/${t}/logs`,{limit:n})),deleteAccessKeySession:(e,t)=>oe(ae(`/api/access-keys/${e}/sessions/${t}`),{method:"DELETE"}),clearAccessKeySessions:e=>oe(ae(`/api/access-keys/${e}/sessions`),{method:"DELETE"}),getAccessKeyGuide:(e,t,n)=>oe(ae(`/api/access-keys/${e}/guide`,{host:t,port:n})),writeAccessKeyToLocal:(e,t)=>oe(ae(`/api/access-keys/${e}/write-local`),{method:"POST",body:JSON.stringify({targets:t})}),getWriteLocalRecords:()=>oe(ae("/api/write-local-records")),getPolicies:()=>oe(ae("/api/policies")),createPolicy:e=>oe(ae("/api/policies"),{method:"POST",body:JSON.stringify(e)}),getPolicy:e=>oe(ae(`/api/policies/${e}`)),updatePolicy:(e,t)=>oe(ae(`/api/policies/${e}`),{method:"PUT",body:JSON.stringify(t)}),deletePolicy:e=>oe(ae(`/api/policies/${e}`),{method:"DELETE"}),duplicatePolicy:e=>oe(ae(`/api/policies/${e}/duplicate`),{method:"POST"}),getPolicyKeys:e=>oe(ae(`/api/policies/${e}/keys`)),getPolicyTemplates:()=>oe(ae("/api/policies/templates")),getAccessKeyRanking:e=>oe(ae("/api/statistics/access-keys",e)),getQuotaAlerts:()=>oe(ae("/api/statistics/quota-alerts")),lanScan:()=>oe(ae("/api/lan/scan")),lanDiscover:(e,t)=>{const n=`http://${e}:${t}/api/lan/discover`;return fetch(n,{signal:AbortSignal.timeout(3e3)}).then(r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()})},lanSync:e=>oe(ae("/api/lan/sync"),{method:"POST",body:JSON.stringify(e)}),getAgentMapSessions:()=>oe(ae("/api/agent-map/sessions")),getAgentMapSessionEvents:(e,t)=>oe(ae(`/api/agent-map/sessions/${e}/events`,t!=null?{since:t}:void 0)),getAgentMapStats:()=>oe(ae("/api/agent-map/stats")),getAgentMapSessionMeta:e=>oe(ae(`/api/agent-map/sessions/${e}/meta`)),getAgentMapNotify:()=>oe(ae("/api/agent-map/notify")),setAgentMapNotify:e=>oe(ae("/api/agent-map/notify"),{method:"POST",body:JSON.stringify({enabled:e})}),setAgentMapNotifyFocus:e=>oe(ae("/api/agent-map/notify-focus"),{method:"POST",body:JSON.stringify({hidden:e})}),testAgentMapNotify:()=>oe(ae("/api/agent-map/notify-test"),{method:"POST"}),streamAgentMap:e=>{const t=new AbortController,n=localStorage.getItem("auth_token");let r=!1,i=0;const a=async()=>{var p,d,h,m;const s=await fetch("/api/agent-map/stream",{method:"GET",signal:t.signal,headers:{Accept:"text/event-stream",...n?{"Access-Token":n}:{}}});if(!s.ok||!s.body)throw new Error(`HTTP ${s.status}`);const l=s.body.getReader(),c=new TextDecoder;let u="";for(;;){const{value:g,done:v}=await l.read();if(v)break;u+=c.decode(g,{stream:!0});let x;for(;(x=u.indexOf(`
81
+
82
+ `))!==-1;){const y=u.slice(0,x);u=u.slice(x+2);const b=y.split(`
83
+ `).find(k=>k.startsWith("data:"));if(!b)continue;const w=b.slice(5).trim();if(!w)continue;let j;try{j=JSON.parse(w)}catch{continue}switch(j.type){case"init":(p=e.onInit)==null||p.call(e,{type:"init",sessions:j.sessions||[],events:j.events||[],stats:j.stats,serverTime:j.serverTime});break;case"session-update":(d=e.onSessionUpdate)==null||d.call(e,j.session);break;case"activity":(h=e.onActivity)==null||h.call(e,j.event);break;case"stats":(m=e.onStats)==null||m.call(e,j.stats);break}}}};return(async()=>{var s;for(;!r;){try{await a(),i=0}catch(c){if((c==null?void 0:c.name)==="AbortError")return;(s=e.onError)==null||s.call(e,c)}if(r)break;i=Math.min(i+1,5);const l=Math.min(1e3*2**(i-1),15e3);await new Promise(c=>setTimeout(c,l))}})(),{abort:()=>{r=!0,t.abort()}}}};var dt=(e=>(e.AUTH_TOKEN="authorization",e.API_KEY="x-api-key",e.G_API_KEY="x-goog-api-key",e))(dt||{});const Wn={aicodingbus:{name:"AICodingBus",description:"AICodingBus 是一个Token共享平台,用户可以在平台上分享和交换Token。",tags:["官方推荐"],link:"https://aicodingbus.24x7.to/",apiBaseUrl:"https://aicodingbus.24x7.to",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口",sourceType:"claude",apiUrl:"https://aicodingbus.24x7.to",models:""},{name:"Chat Completions 标准接口",sourceType:"openai-chat",apiUrl:"https://aicodingbus.24x7.to/v1/chat/completions",models:""},{name:"Responses 标准接口",sourceType:"openai",apiUrl:"https://aicodingbus.24x7.to",models:""}],sortedGroup:-1},minimax:{name:"Minimax",description:"国内优秀的大模型",link:"https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://api.minimaxi.com/anthropic",models:"MiniMax-M2.5, MiniMax-M2.7"},{name:"Chat Completions 标准接口(支持Coding Plan的API Key)",sourceType:"openai-chat",apiUrl:"https://api.minimaxi.com/v1/chat/completions",models:"MiniMax-M2.5, MiniMax-M2.7"}]},glm:{name:"GLM",description:"国内优秀的大模型",link:"https://www.bigmodel.cn/invite?icode=kgOTGFRH%2Ftc5Xkyu5N0wHOnfet45IvM%2BqDogImfeLyI%3D",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://open.bigmodel.cn/api/anthropic",models:"glm-5.1, glm-5, glm-4.7, glm-4.5-air",modelLimits:{"glm-5.1":131072,"glm-5":131072,"glm-4.7":131072,"glm-4.5-air":98304}},{name:"Chat Completions 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",models:"glm-5.1, glm-5, glm-4.7, glm-4.5-air",modelLimits:{"glm-5.1":131072,"glm-5":131072,"glm-4.7":131072,"glm-4.5-air":98304}}]},kimi:{name:"Kimi",description:"国内优秀大模型",link:"https://www.kimi.ai/",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://api.kimi.com/coding"},{name:"Chat Completions 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://api.kimi.com/coding/v1/chat/completions",models:"kimi-for-coding",modelLimits:{"kimi-for-coding":32768}}]},doubao:{name:"火山方舟(豆包)",description:"字节旗下大模型平台。Coding Plan一次性支持GLM、Kimi-K2、Deepseek多个国产模型 邀请码:Y58X463P",link:"https://volcengine.com/L/RcHlm6yxj0w/",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://ark.cn-beijing.volces.com/api/coding",models:"ark-code-latest"},{name:"Responses 标准接口 | Coding Plan",sourceType:"openai",apiUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",models:"ark-code-latest"},{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://ark.cn-beijing.volces.com/api/compatible",models:"doubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028"},{name:"Responses 标准接口(付费API)",sourceType:"openai",apiUrl:"https://ark.cn-beijing.volces.com/api/v3",models:"doubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028"},{name:"Chat Completions 标准接口(付费API)",sourceType:"openai-chat",apiUrl:"https://ark.cn-beijing.volces.com/api/v3/chat/completions",models:"doubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028"}]},qwen:{name:"阿里云百炼(千问)",description:"国内优秀大模型",link:"https://help.aliyun.com/zh/model-studio/coding-plan",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://coding.dashscope.aliyuncs.com/apps/anthropic",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"Responses 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://coding.dashscope.aliyuncs.com/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"Responses 标准接口(付费API)",sourceType:"openai",apiUrl:"https://dashscope.aliyuncs.com/api/v2/apps/protocols/compatible-mode/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus, kimi-k2.5, glm-4.7, MiniMax-M2.1"},{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://dashscope.aliyuncs.com/apps/anthropic",models:"qwen3-max-2026-01-23, qwen3-coder-plus, kimi-k2.5, glm-4.7, MiniMax-M2.1"}]},deepseek:{name:"DeepSeek",description:"DeepSeek 官方 API",link:"https://platform.deepseek.com",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://api.deepseek.com/anthropic",models:"deepseek-v4-flash, deepseek-v4-pro"},{name:"DeepSeek Reasoning Chat 接口(付费API)",sourceType:"openai-chat",apiUrl:"https://api.deepseek.com/v1/chat/completions",models:"deepseek-v4-flash, deepseek-v4-pro"}]},mimo:{name:"Mimo",description:"小米 Mimo 国产大模型",link:"https://platform.xiaomimimo.com?ref=M8BFP3",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://token-plan-cn.xiaomimimo.com/anthropic",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"},{name:"Chat Completions 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://token-plan-cn.xiaomimimo.com/v1/chat/completions",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"},{name:"Chat Completions 标准接口(付费API)",sourceType:"openai-chat",apiUrl:"https://api.xiaomimimo.com/v1/chat/completions",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"},{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://api.xiaomimimo.com/anthropic",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"}]},openai:{name:"OpenAI",description:"OpenAI 官方 API",link:"https://platform.openai.com",authType:dt.AUTH_TOKEN,services:[{name:"GPT官方接口",sourceType:"openai",apiUrl:"https://api.openai.com"}],sortedGroup:3},anthropic:{name:"Anthropic",description:"Anthropic 官方 API",link:"https://www.anthropic.com",authType:dt.API_KEY,services:[{name:"Claude官方接口",sourceType:"claude",apiUrl:"https://api.anthropic.com"}],sortedGroup:3},google:{name:"Google AI",description:"Gemini官方接口",authType:dt.G_API_KEY,services:[{name:"Gemini",sourceType:"gemini",apiUrl:"https://generativelanguage.googleapis.com"}],sortedGroup:3},openrouter:{name:"OpenRouter",description:"一站式 AI 模型路由平台",link:"https://openrouter.ai",authType:dt.AUTH_TOKEN,apiBaseUrl:"https://openrouter.ai/api",services:[{name:"Claude Code专属接口",sourceType:"claude",apiUrl:"https://openrouter.ai/api",models:"anthropic/claude-fable-5, anthropic/claude-opus-4.8, anthropic/claude-opus-4.6, anthropic/claude-opus-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4.5, anthropic/claude-haiku-4.5"},{name:"Responses 标准接口 (Beta)",sourceType:"openai",apiUrl:"https://openrouter.ai/api/v1",models:"openai/gpt-5.3-codex, openai/gpt-5.4, openai/gpt-5.5, openai/gpt-5.4-mini"},{name:"Chat Completions 标准接口",sourceType:"openai-chat",apiUrl:"https://openrouter.ai/api/v1/chat/completions",models:"openai/gpt-5.5, openai/gpt-5.4, openai/gpt-5.4-mini, openai/gpt-5.3-codex, google/gemini-3-flash-preview, google/gemini-3-pro-preview"},{name:"Claude 标准接口",sourceType:"claude",apiUrl:"https://openrouter.ai/api",models:"anthropic/claude-fable-5, anthropic/claude-opus-4.8, anthropic/claude-opus-4.6, anthropic/claude-sonnet-4.6, anthropic/claude-haiku-4.6",authType:dt.AUTH_TOKEN}],sortedGroup:3},agnes:{name:"Agnes",description:"优秀的模型厂商,拥有多种模型,提供免费 API 使用",tags:["永久免费"],link:"https://platform.agnes-ai.com",authType:dt.AUTH_TOKEN,services:[{name:"Chat Completions 标准接口(免费)",sourceType:"openai-chat",apiUrl:"https://apihub.agnes-ai.com/v1/chat/completions",models:"agnes-2.0-flash",authType:dt.AUTH_TOKEN}],sortedGroup:-1}},kl={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"},$d={claude:"Claude","claude-chat":"Claude Chat",openai:"OpenAI","openai-chat":"OpenAI Chat",gemini:"Gemini","gemini-chat":"Gemini Chat"},oF={"openai-chat":"填写完整的接口地址,如:https://api.openai.com/v1/chat/completions",openai:"填写接口Base URL地址,如:https://api.openai.com,(注,有的服务商需要带/v1)","claude-chat":"填写完整的接口地址,如:https://api.anthropic.com/v1/messages",claude:"只填写 base 地址,如:https://api.anthropic.com",gemini:"只填写 base 地址,如:https://generativelanguage.googleapis.com","gemini-chat":"填写完整的接口地址,如:https://generativelanguage.googleapis.com/v1beta/models/{modelName}:{endPoint} 注意,{modelName}和{endPoint}会在实际运行时被替换,你只需要按此处的格式填写即可"},Bd={[dt.AUTH_TOKEN]:"AUTH_TOKEN",[dt.API_KEY]:"API_KEY",[dt.G_API_KEY]:"GOOGLE_API_KEY"},Ng={[dt.AUTH_TOKEN]:"使用 Authorization: Bearer <token> 进行认证",[dt.API_KEY]:"使用 x-api-key: <token> 进行认证",[dt.G_API_KEY]:"使用 x-goog-api-key: <token> 进行认证"},sF=`#### 🚀 智谱 GLM Coding Plan
84
+
85
+ > 价格便宜,国内速度快,支持多工具(Claude Code等 20+ 大编程工具),而且其中的GLM-4.7是目前国内最强编程模型。适合对模型有一定要求,同时又无法获取国外模型的朋友入手。
86
+ >
87
+ > 链接:[https://www.bigmodel.cn](https://www.bigmodel.cn/invite?icode=kgOTGFRH%2Ftc5Xkyu5N0wHOnfet45IvM%2BqDogImfeLyI%3D) | [一键配置](# "glm")
88
+
89
+ #### 🌌 MiniMax Coding Plan
90
+
91
+ > 国内优秀的大模型,支持Claude Code和Codex等编程工具,其中 M2.1 模型在大模型评测中获得非常高的分数。可作为国内大模型的备选方案。
92
+ > 链接:[https://platform.minimaxi.com/subscribe/coding-plan](https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link) | [一键配置](# "minimax")
93
+
94
+ #### 🧠 Mimo Coding Plan
95
+
96
+ > 小米旗下 Mimo 国产大模型,支持 Claude Code 和 Codex 等编程工具,提供 Coding Plan 和付费 API 两种模式,涵盖 mimo-v2.5-pro、mimo-v2-pro、mimo-v2.5、mimo-v2-omni、mimo-v2-flash 等多个模型,性价比出色。
97
+ > 链接:[https://platform.xiaomimimo.com](https://platform.xiaomimimo.com?ref=M8BFP3) | [一键配置](# "mimo")
98
+ `;function RI(e,t){let n,r;const i=a=>a.replace(/!\[.*?\]\(.*?\)/g,s=>{var c;const l=(c=s.match(/\((.*?)\)/))==null?void 0:c[1];if((l==null?void 0:l.indexOf("public/"))===0){const u=l.replace("public/","/");return s.replace(l,u)}else return s});return function(){const[a,s]=f.useState(i(e));return f.useEffect(()=>{if(r){s(i(r));return}const l=c=>{c&&(r=c,s(i(c)))};n?n.then(l).catch(()=>{}):n=t().then(l).catch(()=>{})},[]),a}}const lF=RI(sF,V.getRecommendVendorsMarkdown),cF=RI("",V.getUpgradeMarkdown),_I=f.createContext(void 0);function $u(){const e=f.useContext(_I);if(!e)throw new Error("useConfirm must be used within ConfirmProvider");return e}let xo=null;function uF({children:e}){const[t,n]=f.useState(!1),[r,i]=f.useState({message:""}),a=p=>(i(p),n(!0),new Promise(d=>{xo=d})),s=()=>{n(!1),xo&&(xo(!0),xo=null)},l=()=>{n(!1),xo&&(xo(!1),xo=null)},u=(()=>{switch(r.type){case"danger":return{icon:"⚠️",iconColor:"#dc3545",buttonClass:"btn-danger"};case"warning":return{icon:"⚠",iconColor:"#ffc107",buttonClass:"btn-warning"};default:return{icon:"ℹ️",iconColor:"#17a2b8",buttonClass:"btn-primary"}}})();return o.jsxs(_I.Provider,{value:{confirm:a},children:[e,t&&o.jsx("div",{className:"modal-overlay",style:{zIndex:1e6},children:o.jsx("div",{className:"modal",style:{maxWidth:"500px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:r.title||"确认操作"})}),o.jsx("div",{style:{padding:"20px"},children:o.jsxs("div",{style:{display:"flex",gap:"15px",alignItems:"flex-start"},children:[o.jsx("span",{style:{fontSize:"32px",flexShrink:0},children:u.icon}),o.jsx("div",{style:{flex:1,whiteSpace:"pre-wrap",lineHeight:"1.6"},children:r.message})]})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:l,children:r.cancelText||"取消"}),o.jsx("button",{className:`btn ${u.buttonClass}`,onClick:s,children:r.confirmText||"确认"})]})]})})})]})}let dF=0;const Ev=new Set;let cf=[];function LI(){Ev.forEach(e=>e([...cf]))}function Fd(e,t,n=3e3){const r=++dF,i={id:r,message:e,type:t,duration:n};return cf.push(i),LI(),n>0&&setTimeout(()=>{DI(r)},n),r}function DI(e){cf=cf.filter(t=>t.id!==e),LI()}const K={success(e,t){Fd(e,"success",t)},error(e,t){Fd(e,"error",t)},warning(e,t){Fd(e,"warning",t)},info(e,t){Fd(e,"info",t)}};function pF(){const[e,t]=f.useState([]);f.useEffect(()=>(Ev.add(t),()=>{Ev.delete(t)}),[]);const n=i=>({...{padding:"12px 20px",borderRadius:"8px",marginBottom:"10px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",minWidth:"300px",maxWidth:"500px",animation:"slideIn 0.2s ease-out"},...{success:{backgroundColor:"#d4edda",color:"#155724",border:"1px solid #c3e6cb"},error:{backgroundColor:"#f8d7da",color:"#721c24",border:"1px solid #f5c6cb"},warning:{backgroundColor:"#fff3cd",color:"#856404",border:"1px solid #ffeaa7"},info:{backgroundColor:"#d1ecf1",color:"#0c5460",border:"1px solid #bee5eb"}}[i]}),r=i=>({success:"✓",error:"✕",warning:"⚠",info:"ℹ"})[i];return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:`
99
+ @keyframes slideIn {
100
+ from {
101
+ transform: translateX(50px);
102
+ opacity: 0;
103
+ }
104
+ to {
105
+ transform: translateX(0);
106
+ opacity: 1;
107
+ }
108
+ }
109
+ `}),o.jsx("div",{style:{position:"fixed",top:"20px",right:"20px",zIndex:1000001},children:e.map(i=>o.jsxs("div",{style:n(i.type),children:[o.jsx("span",{style:{fontSize:"18px",fontWeight:"bold"},children:r(i.type)}),o.jsx("span",{style:{flex:1},children:i.message}),o.jsx("button",{onClick:()=>DI(i.id),style:{background:"none",border:"none",color:"inherit",cursor:"pointer",fontSize:"18px",padding:"0",marginLeft:"10px",opacity:.6},onMouseEnter:a=>a.currentTarget.style.opacity="1",onMouseLeave:a=>a.currentTarget.style.opacity="0.6",children:"×"})]},i.id))})]})}function zI({value:e,onChange:t,existingVendors:n=[],disabled:r=!1}){const[i,a]=f.useState(!1),s=f.useRef(null);f.useEffect(()=>{if(!i)return;const u=p=>{s.current&&!s.current.contains(p.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[i]);const l=f.useMemo(()=>{const u=Object.entries(Wn).map(([h,m])=>({key:h,name:m.name,sortedGroup:m.sortedGroup??0}));u.sort((h,m)=>h.sortedGroup-m.sortedGroup);const p=[];let d=null;for(const h of u)d!==null&&h.sortedGroup!==d&&p.push(null),p.push(h),d=h.sortedGroup;return p},[]),c=e?Wn[e]:null;return o.jsxs("div",{ref:s,style:{position:"relative"},children:[o.jsxs("div",{onClick:()=>!r&&a(!i),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",border:`1px solid ${i?"var(--accent-primary)":"var(--border-primary)"}`,borderRadius:"8px",background:"var(--input-bg, var(--bg-primary))",cursor:r?"not-allowed":"pointer",opacity:r?.6:1,transition:"border-color 0.2s",userSelect:"none"},children:[c?o.jsx("span",{style:{fontSize:"14px",color:"var(--text-primary)"},children:c.name}):o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:"请选择供应商"}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",transform:i?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s"},children:"▼"})]}),i&&o.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:999,marginTop:"4px",maxHeight:"320px",overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-primary)",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"},children:l.map((u,p)=>{var g;if(!u)return o.jsx("div",{style:{height:"1px",background:"var(--border-primary)"}},`sep-${p}`);const d=Wn[u.key],h=n.some(v=>v.name===u.name),m=e===u.key;return o.jsxs("div",{onClick:()=>{t(u.key),a(!1)},style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 14px",cursor:"pointer",background:m?"var(--accent-light)":h?"rgba(255, 167, 38, 0.08)":"rgba(76, 175, 80, 0.08)",borderLeft:m?"3px solid var(--accent-primary)":"3px solid transparent",transition:"background 0.15s"},onMouseEnter:v=>{m||(v.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:v=>{m||(v.currentTarget.style.background=h?"rgba(255, 167, 38, 0.08)":"rgba(76, 175, 80, 0.08)")},children:[o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:m?600:400,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[u.name,(g=d==null?void 0:d.tags)==null?void 0:g.map((v,x)=>o.jsx("span",{style:{fontSize:"11px",marginLeft:"6px",padding:"1px 6px",borderRadius:"8px",background:"rgba(229, 57, 53, 0.1)",color:"#e53935",fontWeight:500,verticalAlign:"middle"},children:v},x))]}),(d==null?void 0:d.description)&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.description})]}),o.jsx("span",{style:{fontSize:"11px",padding:"2px 8px",borderRadius:"10px",fontWeight:500,whiteSpace:"nowrap",background:h?"rgba(255, 167, 38, 0.15)":"rgba(76, 175, 80, 0.15)",color:h?"#e67e22":"#4caf50"},children:h?"已配置":"可用"})]},u.key)})})]})}function $S(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0");return`${t}-${n}-${r}T${i}:${a}`}function fF({value:e=[],onChange:t,placeholder:n,inputValue:r,onInputChange:i}){const a=l=>{if(l.key==="Enter"||l.key===","){l.preventDefault();const c=r.trim();c&&!e.includes(c)&&(t([...e,c]),i(""))}else l.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1))},s=l=>{t(e.filter((c,u)=>u!==l))};return o.jsx("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"4px",padding:"8px",minHeight:"40px",background:"var(--bg-secondary)"},children:o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",alignItems:"center"},children:[e.map((l,c)=>o.jsxs("span",{style:{backgroundColor:"var(--accent-light)",color:"var(--text-primary)",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[l,o.jsx("button",{type:"button",onClick:()=>s(c),style:{background:"none",border:"none",color:"var(--text-primary)",cursor:"pointer",fontSize:"16px",lineHeight:"1",padding:"0",marginLeft:"4px"},onMouseOver:u=>u.currentTarget.style.color="var(--accent-danger)",onMouseOut:u=>u.currentTarget.style.color="var(--text-primary)",children:"×"})]},c)),o.jsx("input",{type:"text",value:r,onChange:l=>i(l.target.value),onKeyDown:a,placeholder:n,style:{border:"none",outline:"none",flex:"1",minWidth:"120px",fontSize:"14px"}})]})})}function hF(){var D,ge;const{confirm:e}=$u(),t=f.useRef(null),[n,r]=f.useState([]),[i,a]=f.useState(null),[s,l]=f.useState(!1),[c,u]=f.useState(!1),[p,d]=f.useState(!1),[h,m]=f.useState(!1),[g,v]=f.useState(null),[x,y]=f.useState(null),[b,w]=f.useState([]),[j,k]=f.useState(""),[S,A]=f.useState({}),[T,L]=f.useState(!1),[O,R]=f.useState(void 0),[_,X]=f.useState(void 0),[q,I]=f.useState(void 0),[$,H]=f.useState(!1),[N,W]=f.useState(void 0),[P,U]=f.useState(void 0),[le,E]=f.useState(void 0),[me,ye]=f.useState("openai-chat"),[Q,ie]=f.useState(!1),[je,Z]=f.useState(dt.AUTH_TOKEN),[re,pe]=f.useState(""),[se,Re]=f.useState(!0),[ke,ne]=f.useState(!0),[De,qe]=f.useState(!0),ze=F=>{if(ye(F),De)return;let de;F==="gemini"||F==="gemini-chat"?de=dt.G_API_KEY:F==="claude-chat"||F==="claude"?de=dt.API_KEY:de=dt.AUTH_TOKEN,Z(de),t.current&&(t.current.value=de)},[Ke,pt]=f.useState(""),[Ye,Qe]=f.useState([]),[Ze,tt]=f.useState(""),J=lF();f.useEffect(()=>{Y()},[]),f.useEffect(()=>{const F=new Set(b),de={};Object.entries(S).forEach(([Ae,Ee])=>{F.has(Ae)&&(de[Ae]=Ee)}),Object.keys(de).length!==Object.keys(S).length&&A(de)},[b]);const Y=async()=>{const F=await V.getVendors();return r(F),F.length>0&&!i&&a(F[0]),F},ue=()=>{v(null),pe(""),l(!0)},M=()=>{d(!0)},fe=F=>{v(F),pe(F.authType||""),l(!0)},ee=async F=>{if(await e({message:"确定要删除此供应商吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const ve=await V.getRules(),Ae=(F.services||[]).map(nt=>nt.id),Ee=ve.filter(nt=>Ae.includes(nt.targetServiceId)).length;if(!await e({message:`二次确认:删除供应商“${F.name}”后,将同时删除关联的 ${Ee} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await V.deleteVendor(F.id),Y(),i&&i.id===F.id&&a(null),K.success(`供应商已删除,关联规则清理 ${Ee} 条`)}catch(ve){const Ae=ve instanceof Error?ve.message:"删除失败";K.error(Ae)}},xe=async F=>{F.preventDefault();const de=new FormData(F.currentTarget),ve={name:de.get("name"),description:de.get("description"),apiKey:de.get("apiKey")||"",apiBaseUrl:de.get("apiBaseUrl")||"",authType:de.get("authType")||void 0,sortOrder:parseInt(de.get("sortOrder"))||0};g?await V.updateVendor(g.id,ve):await V.createVendor({...ve,services:[]}),l(!1);const Ae=await Y();if(i){const Ee=Ae.find(Ge=>Ge.id===i.id);Ee&&a(Ee)}},Se=()=>{y(null),w([]),k(""),A({}),L(!1),R(void 0),X(void 0),I(void 0),H(!1),W(void 0),U(void 0),E(void 0),ye("openai-chat"),Z((i==null?void 0:i.authType)||dt.AUTH_TOKEN),Re(!!(i!=null&&i.apiKey)),ne(!!(i!=null&&i.apiBaseUrl)),qe(!!(i!=null&&i.authType)),ie(!1),u(!0)},Le=F=>{y(F),w(F.supportedModels||[]),k(""),A(F.modelLimits||{}),L(F.enableTokenLimit||!1),R(F.tokenLimit),X(F.tokenResetInterval),I(F.tokenResetBaseTime?new Date(F.tokenResetBaseTime):void 0),H(F.enableRequestLimit||!1),W(F.requestCountLimit),U(F.requestResetInterval),E(F.requestResetBaseTime?new Date(F.requestResetBaseTime):void 0);const de=F.sourceType||"openai-chat";if(ye(de),Re(F.inheritVendorApiKey===!0),ne(F.inheritVendorApiBaseUrl===!0),qe(F.inheritVendorAuthType===!0),F.inheritVendorAuthType===!0){const ve=(i==null?void 0:i.authType)||dt.AUTH_TOKEN;Z(ve)}else if(F.authType)Z(F.authType);else{let ve;de==="gemini"||de==="gemini-chat"?ve=dt.G_API_KEY:de==="claude-chat"||de==="claude"?ve=dt.API_KEY:ve=dt.AUTH_TOKEN,Z(ve)}ie(F.isDowngradeCompatibility===!0),u(!0)},$e=async F=>{if(await e({message:"确定要删除此API服务吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const Ae=(await V.getRules()).filter(nt=>nt.targetServiceId===F).length;if(!await e({message:`二次确认:删除该 API 服务后,将同时删除关联的 ${Ae} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await V.deleteAPIService(F);const Ge=await Y();if(i){const nt=Ge.find(at=>at.id===i.id);nt&&a(nt)}K.success(`API服务已删除,关联规则清理 ${Ae} 条`)}catch(ve){const Ae=ve instanceof Error?ve.message:"删除失败";K.error(Ae)}},He=async F=>{F.preventDefault();let de=[...b];if(j.trim()){const It=j.split(",").map(Pt=>Pt.trim()).filter(Pt=>Pt&&!de.includes(Pt));de=[...de,...It]}const ve=new FormData(F.currentTarget),Ae=ve.get("sourceType"),Ee=ve.get("inheritVendorApiBaseUrl")==="on",Ge=(ve.get("apiUrl")||"").trim(),nt=Ee?(x==null?void 0:x.apiUrl)||"":Ge,at=ve.get("inheritVendorApiKey")==="on",Je=ve.get("apiKey")||"",nn=at?(x==null?void 0:x.apiKey)||"":Je,Kt=ve.get("inheritVendorAuthType")==="on",ut={};Object.entries(S).forEach(([It,Pt])=>{It&&Pt&&Pt>0&&(ut[It]=Pt)});const Ht={vendorId:i.id,name:ve.get("name"),apiUrl:nt,apiKey:nn,inheritVendorApiKey:at,inheritVendorApiBaseUrl:Ee,inheritVendorAuthType:Kt,sourceType:Ae,authType:Kt?(x==null?void 0:x.authType)||void 0:ve.get("authType")||void 0,supportedModels:de.length>0?de:void 0,modelLimits:Object.keys(ut).length>0?ut:void 0,enableProxy:ve.get("enableProxy")==="on",enableCodingPlan:ve.get("enableCodingPlan")==="on",isDowngradeCompatibility:me==="openai"?Q:void 0,enableTokenLimit:T,tokenLimit:O,tokenResetInterval:_,tokenResetBaseTime:q?q.getTime():void 0,enableRequestLimit:$,requestCountLimit:N,requestResetInterval:P,requestResetBaseTime:le?le.getTime():void 0};x?await V.updateAPIService(x.id,Ht):await V.createAPIService(Ht),u(!1),w([]),k(""),A({}),L(!1),R(void 0),X(void 0),I(void 0),H(!1),W(void 0),U(void 0),E(void 0),Re(!0),ne(!0),ie(!1);const Jt=await Y();if(i){const It=Jt.find(Pt=>Pt.id===i.id);It&&a(It)}},Oe=F=>{if(F){pt(F);const de=Wn[F];de&&de.services.length>0&&Qe(de.services.map((ve,Ae)=>Ae))}else pt(""),Qe([]);tt(""),m(!0)},Xe=async F=>{F.preventDefault();const de=Ke,ve=Ze;if(!de||!ve){K.warning("请填写完整信息");return}if(Ye.length===0){K.warning("请至少选择一个源类型");return}const Ae=Wn[de];if(!Ae){K.error("未找到对应的供应商配置");return}try{const Ee=await V.createVendor({name:Ae.name,description:Ae.description,apiKey:ve,authType:Ae.authType??dt.AUTH_TOKEN,...Ae.apiBaseUrl?{apiBaseUrl:Ae.apiBaseUrl}:{},sortOrder:0,services:[]});if(console.log("[一键配置] 供应商创建成功:",Ee),console.log("[一键配置] 供应商 ID:",Ee==null?void 0:Ee.id),!Ee||!Ee.id)throw console.error("[一键配置] 供应商创建失败或缺少 ID:",Ee),new Error("供应商创建失败,缺少 ID");const Ge=Ae.services.filter((ut,Ht)=>Ye.includes(Ht));if(console.log("[一键配置] 准备创建服务:",Ge.length,"个"),console.log("[一键配置] vendorId:",Ee.id),Ge.length===0)throw new Error("没有选择任何服务");const nt=Ge.map(async(ut,Ht)=>{const Jt={vendorId:Ee.id,name:ut.name,apiUrl:ut.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:ut.sourceType,authType:ut.authType,supportedModels:ut.models?ut.models.split(",").map(Pt=>Pt.trim()):void 0,modelLimits:ut.modelLimits||{},enableCodingPlan:!0};console.log(`[一键配置] 创建服务 ${Ht+1}/${Ge.length}:`,{...Jt,apiKey:"***"});const It=await V.createAPIService(Jt);return console.log(`[一键配置] 服务 ${Ht+1} 创建成功,ID:`,It.id),It.vendorId||console.error(`[一键配置] 警告:服务 ${It.id} 缺少 vendorId!`),It}),at=await Promise.all(nt);console.log("[一键配置] 所有服务创建完成,数量:",at.length);const Je=at.filter(ut=>!ut.vendorId);if(Je.length>0)throw console.error("[一键配置] 发现缺少 vendorId 的服务:",Je),new Error(`有 ${Je.length} 个服务缺少 vendorId`);const Kt=(await Y()).find(ut=>ut.id===Ee.id);a(Kt||{...Ee,services:at}),m(!1),K.success(`配置成功! 已创建 ${Ye.length} 个API服务`)}catch(Ee){console.error("一键配置失败:",Ee),K.error(`配置失败: ${Ee instanceof Error?Ee.message:"未知错误"}`)}};return o.jsxs("div",{className:"vendors-page",children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"供应商管理"}),o.jsx("p",{children:"管理API供应商和服务配置"})]}),o.jsxs("div",{style:{display:"flex",gap:"20px"},children:[o.jsxs("div",{className:"card",style:{flex:"0 0 25%",minWidth:400},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"供应商列表"}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-secondary",style:{background:"#2563EB",color:"#FFFFFF",border:"none",cursor:"pointer"},onClick:M,children:"推荐"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>Oe(),children:"一键配置"}),o.jsx("button",{className:"btn btn-primary",onClick:ue,children:"新增"})]})]}),n.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无供应商"})}):o.jsx("div",{style:{marginTop:"10px"},children:n.map(F=>o.jsx("div",{onClick:()=>a(F),style:{padding:"12px",marginBottom:"8px",backgroundColor:i&&i.id===F.id?"var(--accent-light)":"var(--bg-secondary)",borderRadius:"4px",cursor:"pointer",border:"1px solid var(--border-secondary)",color:"var(--text-primary)"},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[o.jsxs("div",{style:{flex:1,minWidth:0,overflow:"hidden"},children:[o.jsx("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.name}),F.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.description})]}),o.jsxs("div",{className:"action-buttons",style:{flexShrink:0},children:[o.jsx("button",{className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:de=>{de.stopPropagation(),fe(F)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:de=>{de.stopPropagation(),ee(F)},children:"删除"})]})]})},F.id))})]}),o.jsxs("div",{className:"card",style:{flex:1},children:[o.jsxs("div",{className:"toolbar",children:[o.jsxs("h3",{children:["供应商",i?`(${i.name})`:null,"API服务"]}),i&&o.jsx("button",{className:"btn btn-primary",onClick:Se,children:"新增服务"})]}),i?!i.services||i.services.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无API服务"})}):o.jsxs("table",{style:{fontSize:"smaller"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{whiteSpace:"nowrap"},children:"服务名称"}),o.jsx("th",{children:"源类型"}),o.jsx("th",{children:"API地址"}),o.jsx("th",{children:"模型"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:i.services.map(F=>{var de;return o.jsxs("tr",{children:[o.jsx("td",{children:F.name}),o.jsx("td",{children:F.sourceType?$d[F.sourceType]:"-"}),o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:F.apiUrl,children:F.apiUrl}),o.jsx("td",{children:(de=F.supportedModels)!=null&&de.length?`${F.supportedModels.length}个`:"*"}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>Le(F),children:"编辑"}),o.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>$e(F.id),children:"删除"})]})})]},F.id)})})]}):o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"请先选择一个供应商"})})]})]}),s&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>l(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:g?"编辑供应商":"新增供应商"})}),o.jsxs("form",{onSubmit:xe,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:g?g.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"描述"}),o.jsx("textarea",{name:"description",rows:3,defaultValue:g?g.description:""})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API密钥"}),o.jsx("input",{type:"password",name:"apiKey",defaultValue:g&&g.apiKey||"",placeholder:"可选:供应商默认API密钥"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["API认证方式 ",o.jsx("small",{children:"新增服务时默认使用此方式"})]}),o.jsxs("select",{name:"authType",defaultValue:(g==null?void 0:g.authType)||"",onChange:F=>pe(F.target.value),children:[o.jsx("option",{value:"",disabled:!0,children:"无"}),Object.keys(Bd).map(F=>o.jsx("option",{value:F,children:Bd[F]},F))]}),re&&Ng[re]&&o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Ng[re]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Base URL"}),o.jsx("input",{type:"text",name:"apiBaseUrl",defaultValue:g&&g.apiBaseUrl||"",placeholder:"可选:供应商默认API Base URL"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["排序 ",o.jsx("small",{children:"数值越大越靠前"})]}),o.jsx("input",{type:"number",name:"sortOrder",defaultValue:g&&g.sortOrder||0,min:"0"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>l(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),c&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>u(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{width:800},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:x?"编辑供应商API服务":"新增供应商API服务"})}),o.jsxs("form",{onSubmit:He,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"服务名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:x?x.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["数据源类型 ",o.jsx("small",{children:"供应商接口返回的数据格式标准类型"})]}),o.jsxs("select",{name:"sourceType",defaultValue:x&&x.sourceType||"",onChange:F=>ze(F.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择源类型"}),Object.keys($d).map(F=>o.jsx("option",{value:F,children:$d[F]},F))]}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:oF[me]||""}),me==="openai"&&o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",marginTop:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:Q,onChange:F=>ie(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px",marginTop:"2px"}}),o.jsxs("span",{children:[o.jsx("span",{style:{fontWeight:500},children:"降级兼容"}),o.jsx("br",{}),o.jsx("small",{style:{color:"var(--text-muted)"},children:"通过降级请求格式来确保非 OpenAI 官方的 Responses 接口可以被 Codex 正确使用。"})]})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API地址"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorApiBaseUrl",checked:ke,onChange:F=>ne(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API地址"})]}),!ke&&o.jsx("input",{type:"url",name:"apiUrl",defaultValue:x?x.apiUrl:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API密钥"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorApiKey",checked:se,onChange:F=>Re(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API密钥"})]}),!se&&o.jsx("input",{type:"password",name:"apiKey",defaultValue:x?x.apiKey:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API认证方式"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorAuthType",checked:De,onChange:F=>qe(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API认证方式"})]}),!De&&o.jsxs(o.Fragment,{children:[o.jsx("select",{ref:t,name:"authType",defaultValue:x?x.authType||dt.AUTH_TOKEN:je,onChange:F=>Z(F.target.value),children:Object.keys(Bd).map(F=>o.jsx("option",{value:F,children:Bd[F]},F))}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Ng[je]||""})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"支持的模型列表"}),o.jsx(fF,{value:b,onChange:w,inputValue:j,onInputChange:k,placeholder:"输入模型名,按Enter或逗号添加"},(x==null?void 0:x.id)||"new"),o.jsx("div",{style:{display:"block",width:"100%"},children:o.jsx("small",{style:{fontSize:"10px"},children:"留空表示支持所有模型,路由配置中,可直接将模型透传给该供应商服务接口。"})})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["模型输出限制 ",o.jsx("small",{children:"为支持的模型配置最大输出tokens"})]}),o.jsxs("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"16px",background:"var(--bg-secondary)",maxHeight:"300px",overflowY:"auto"},children:[Object.keys(S).length===0&&b.length===0?o.jsx("div",{style:{color:"var(--text-muted)",textAlign:"center",padding:"20px",fontSize:"14px"},children:"暂无模型限制配置,可点击下方按钮添加"}):o.jsxs("div",{children:[b.length>0&&o.jsxs("div",{style:{marginBottom:"12px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginBottom:"8px",fontWeight:500},children:'来自"支持的模型列表"(自动同步)'}),b.map(F=>o.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px",alignItems:"center",padding:"8px",background:"var(--bg-primary)",borderRadius:"4px",border:"1px solid var(--accent-light)"},children:[o.jsxs("div",{style:{flex:2,fontSize:"14px",color:"var(--text-primary)",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"},children:[F,o.jsx("span",{style:{fontSize:"10px",padding:"2px 6px",borderRadius:"3px",background:"var(--accent-light)",color:"var(--accent-primary)"},children:"已同步"})]}),o.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("input",{type:"number",value:S[F]||"",onChange:de=>{const ve=de.target.value;if(ve===""){const Ae={...S};delete Ae[F],A(Ae)}else A({...S,[F]:parseInt(ve)||0})},placeholder:"留空不限",min:"1",style:{width:"100%",padding:"6px 8px",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"14px"}}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",whiteSpace:"nowrap"},children:"tokens"})]}),o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>{const de={...S};delete de[F],A(de)},style:{padding:"4px 8px",fontSize:"12px"},title:"移除此限制(模型仍在支持列表中)",children:"移除限制"})]},`sync-${F}`))]}),Object.keys(S).length>0&&o.jsx("div",{children:Object.entries(S).filter(([F])=>!b.includes(F)).map(([F,de])=>o.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px",alignItems:"center",padding:"8px",background:"var(--bg-primary)",borderRadius:"4px",border:"1px solid var(--border-secondary)"},children:[o.jsx("input",{type:"text",value:F,onChange:ve=>{const Ae={...S},Ee=ve.target.value;delete Ae[F],Ae[Ee]=de,A(Ae)},placeholder:"模型名 (如: gpt-4)",style:{flex:2,padding:"6px 8px",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"14px"}}),o.jsx("input",{type:"number",value:de,onChange:ve=>{A({...S,[F]:parseInt(ve.target.value)||0})},placeholder:"最大tokens",min:"1",style:{flex:1,padding:"6px 8px",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"14px"}}),o.jsx("button",{type:"button",className:"btn btn-sm btn-danger",onClick:()=>{const ve={...S};delete ve[F],A(ve)},style:{padding:"4px 8px",fontSize:"12px"},children:"删除"})]},`custom-${F}`))})]}),o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>{const F=`model-${Date.now()}`;A({...S,[F]:4096})},style:{marginTop:"8px",width:"100%"},children:"+ 添加模型限制"})]}),o.jsx("div",{style:{display:"block",width:"100%",marginTop:"8px"},children:o.jsxs("small",{style:{fontSize:"10px"},children:[o.jsx("strong",{children:"自动同步:"}),"上方添加的模型会自动在此创建限制配置(默认4096),删除模型会同步移除限制。",o.jsx("strong",{children:"手动添加:"}),"可点击下方按钮为特定模型(如 gpt-4)或前缀(如 gpt-4-*)添加限制。 留空则透传前端工具发送的值。支持精确匹配和前缀匹配。 对于o1等新模型,将自动映射到max_completion_tokens字段。"]})})]}),o.jsx("div",{className:"form-group",children:o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:T,onChange:F=>L(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Token超量限制"})]})}),T&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token超量值(单位:k)"}),o.jsx("input",{type:"number",value:O||"",onChange:F=>R(F.target.value?parseInt(F.target.value):void 0),min:"1",placeholder:"例如:1000表示1000k tokens"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:_||"",onChange:F=>X(F.target.value?parseInt(F.target.value):void 0),min:"1",placeholder:"例如:720表示30天,168表示7天"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:q?$S(q):"",onChange:F=>{F.target.value?I(new Date(F.target.value)):I(void 0)},className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置下一次重置的精确时间点"})]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:$,onChange:F=>H(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"})]})}),$&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量值"}),o.jsx("input",{type:"number",value:N||"",onChange:F=>W(F.target.value?parseInt(F.target.value):void 0),min:"1",placeholder:"例如:100"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:P||"",onChange:F=>U(F.target.value?parseInt(F.target.value):void 0),min:"1",placeholder:"例如:720表示30天,168表示7天"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:le?$S(le):"",onChange:F=>{F.target.value?E(new Date(F.target.value)):E(void 0)},className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置下一次重置的精确时间点"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"enableProxy",defaultChecked:(x==null?void 0:x.enableProxy)||!1,style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用代理"})]}),o.jsx("small",{style:{display:"block",marginTop:"6px",color:"#666",fontSize:"12px",marginLeft:"24px"},children:'勾选后,此 API 服务的请求将通过设置的代理转发。请在"设置"页面配置代理。'})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"enableCodingPlan",defaultChecked:x?!!x.enableCodingPlan:!0,style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用编程套餐限制"})]}),o.jsx("small",{style:{display:"block",marginTop:"6px",color:"#666",fontSize:"12px",marginLeft:"24px"},children:"启用后,此 API 服务仅允许编程工具(如 Claude Code、Codex、Cursor 等)发起的请求通过,普通对话请求将被拒绝。"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>u(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),p&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>d(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"800px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"供应商推荐"})}),o.jsx("div",{className:"modal-body",children:o.jsx("div",{className:"markdown-content",children:o.jsx(Kc,{components:{a:({href:F,children:de,title:ve})=>ve&&Wn[ve]?o.jsx("a",{href:"#",style:{color:"#2563EB",borderBottom:"solid 1px #2563EB",cursor:"pointer"},onClick:Ae=>{Ae.preventDefault(),d(!1),Oe(ve)},children:de}):o.jsx("a",{href:F,style:{color:"#2563EB",borderBottom:"solid 1px #2563EB"},target:"_blank",rel:"noopener noreferrer",children:de})},children:J})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>d(!1),children:"关闭"})})]})})]}),h&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>m(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"一键配置供应商"})}),o.jsxs("form",{onSubmit:Xe,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(zI,{value:Ke,onChange:F=>{if(pt(F),F){const de=Wn[F];de&&de.services.length>0&&Qe(de.services.map((ve,Ae)=>Ae))}else Qe([])},existingVendors:n})]}),(D=Wn[Ke])!=null&&D.description?o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[Wn[Ke].description,Wn[Ke].link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:Wn[Ke].link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const F=new URL(Wn[Ke].link);return F.protocol+"//"+F.hostname}catch{return Wn[Ke].link}})()})]})]}):null,o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["源类型 ",o.jsx("small",{style:{color:"var(--text-muted)",fontWeight:"normal"},children:"可选择多个"})]}),o.jsx("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"16px",background:"var(--bg-secondary)",minHeight:"100px",display:"flex",flexDirection:"column",gap:"8px"},children:Ke?(ge=Wn[Ke])==null?void 0:ge.services.map((F,de)=>{const ve=Ye.includes(de);return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:ve?"var(--accent-light)":"transparent",border:`2px solid ${ve?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease",position:"relative",overflow:"hidden"},onMouseEnter:Ae=>{ve||(Ae.currentTarget.style.background="var(--bg-hover)",Ae.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:Ae=>{ve||(Ae.currentTarget.style.background="transparent",Ae.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"checkbox",checked:ve,onChange:Ae=>{Ae.target.checked?Qe([...Ye,de]):Qe(Ye.filter(Ee=>Ee!==de))},style:{width:"18px",height:"18px",marginRight:"12px",cursor:"pointer",accentColor:"var(--accent-primary)"}}),o.jsxs("span",{style:{fontSize:"14px",fontWeight:ve?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[F.name," - ",$d[F.sourceType]]}),ve&&o.jsx("span",{style:{marginLeft:"auto",fontSize:"16px",color:"var(--text-primary)"},children:"✓"})]},de)}):o.jsx("div",{style:{color:"var(--text-muted)",textAlign:"center",padding:"30px 20px",fontSize:"14px"},children:"请先选择供应商"})})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Key"}),o.jsx("input",{type:"password",name:"apiKey",value:Ze,onChange:F=>tt(F.target.value),placeholder:"请输入API密钥",required:!0})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>m(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"确认配置"})]})]})]})})]})]})}function mF({value:e,options:t,onChange:n,disabled:r=!1,placeholder:i="请选择"}){const[a,s]=f.useState(!1),l=f.useRef(null);f.useEffect(()=>{if(!a)return;const u=p=>{l.current&&!l.current.contains(p.target)&&s(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]);const c=t.find(u=>u.value===e);return o.jsxs("div",{ref:l,style:{position:"relative"},children:[o.jsxs("div",{onClick:()=>!r&&s(!a),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:`1px solid ${a?"var(--accent-primary)":"var(--border-primary)"}`,borderRadius:"8px",background:"var(--input-bg, var(--bg-primary))",cursor:r?"not-allowed":"pointer",opacity:r?.6:1,transition:"border-color 0.2s",userSelect:"none",minWidth:0},children:[c?o.jsx("span",{style:{fontSize:"14px",color:"var(--text-primary)"},children:c.label}):o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:i}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",marginLeft:"8px",flexShrink:0,transform:a?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s"},children:"▼"})]}),a&&o.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:999,marginTop:"4px",maxHeight:"360px",overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-primary)",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"},children:t.map(u=>{const p=e===u.value;return o.jsxs("div",{onClick:()=>{n(u.value),s(!1)},style:{padding:"10px 14px",cursor:"pointer",background:p?"var(--accent-light)":"transparent",borderLeft:p?"3px solid var(--accent-primary)":"3px solid transparent",transition:"background 0.15s"},onMouseEnter:d=>{p||(d.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:d=>{p||(d.currentTarget.style.background="transparent")},children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:p?600:400,color:"var(--text-primary)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"},children:[o.jsx("span",{children:u.label}),p&&o.jsx("span",{style:{fontSize:"13px",color:"var(--accent-primary)",flexShrink:0},children:"✓"})]}),u.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px",lineHeight:"1.5"},children:u.description})]},u.value)})})]})}const gF={1:"选择节点",2:"Skills",3:"MCP",4:"供应商",5:"确认同步"};function yF({show:e,onClose:t,onComplete:n}){const[r,i]=f.useState(1),[a,s]=f.useState(!1),[l,c]=f.useState({current:0,total:0}),[u,p]=f.useState([]),[d,h]=f.useState(null),[m,g]=f.useState(""),[v,x]=f.useState("4567"),[y,b]=f.useState(!1),[w,j]=f.useState([]),[k,S]=f.useState(""),[A,T]=f.useState(4567),[L,O]=f.useState("scan"),[R,_]=f.useState([]),[X,q]=f.useState(new Set),[I,$]=f.useState([]),[H,N]=f.useState(new Set),[W,P]=f.useState({}),[U,le]=f.useState(!1),[E,me]=f.useState(""),[ye,Q]=f.useState(!1),[ie,je]=f.useState(!1),[Z,re]=f.useState(!1),pe=f.useCallback(()=>{i(1),s(!1),c({current:0,total:0}),p([]),h(null),g(""),x("4567"),b(!1),_([]),q(new Set),$([]),N(new Set),P({}),le(!1),me(""),Q(!1),je(!1),re(!1),j([]),S(""),T(4567),O("scan")},[]);f.useEffect(()=>{e&&(pe(),se())},[e]);const se=async()=>{try{const M=await V.lanScan();j(M.networkInterfaces||[]),T(M.port),M.networkInterfaces.length<=1,S(M.subnet),Re(M.subnet,M.port,M.localIp)}catch(M){console.error("[LAN Scan] 获取网络信息失败:",M)}},Re=async(M,fe,ee)=>{s(!0),p([]),c({current:0,total:0});const xe=Date.now();try{const Se=[];for(let He=1;He<=254;He++){const Oe=`${M}.${He}`;Oe!==ee&&Se.push(Oe)}c({current:0,total:Se.length});const Le=30,$e=[];for(let He=0;He<Se.length;He+=Le){const Oe=Se.slice(He,He+Le),Xe=await Promise.allSettled(Oe.map(async D=>{const ge=await V.lanDiscover(D,fe);return{ip:D,port:fe,data:ge}}));for(const D of Xe)D.status==="fulfilled"&&$e.push(D.value);p([...$e]),c({current:Math.min(He+Le,Se.length),total:Se.length})}c({current:Se.length,total:Se.length})}catch(Se){console.error("[LAN Scan] 扫描失败:",Se)}finally{const Se=Date.now()-xe;Se<1e3&&await new Promise(Le=>setTimeout(Le,1e3-Se)),s(!1),je(!0)}},ke=M=>{S(M);const fe=w.find(ee=>ee.subnet===M);fe&&Re(fe.subnet,A,fe.address)},ne=()=>{const M=w.find(fe=>fe.subnet===k);M&&(h(null),Re(M.subnet,A,M.address))},De=async()=>{if(m.trim()){b(!0);try{const M=parseInt(v)||4567,fe=await V.lanDiscover(m.trim(),M),ee={ip:m.trim(),port:M,data:fe};p(xe=>xe.some(Se=>Se.ip===m.trim()&&Se.port===M)?xe:[...xe,ee]),h(ee),K.success("连接成功")}catch{K.error("无法连接,请检查 IP 和端口")}finally{b(!1)}}},qe=async()=>{if(d){re(!0);try{let M=[],fe=[];try{M=await V.getInstalledSkills()}catch{}try{fe=await V.getMCPs()}catch($e){console.error("[LAN Sync] 获取本地 MCPs 失败,重复检测可能不准确:",$e)}const ee=new Set(M.map($e=>$e.name)),xe=new Set(fe.map($e=>$e.name)),Se=(d.data.skills||[]).map($e=>({...$e,isDuplicate:ee.has($e.name)}));_(Se);const Le=(d.data.mcps||[]).map($e=>({...$e,isDuplicate:xe.has($e.name)}));$(Le),i(2)}finally{re(!1)}}},ze=async()=>{if(!d)return;const M=X.size>0,fe=H.size>0;if(!(!M&&!fe&&!U)){Q(!0);try{const ee=await V.lanSync({remoteNode:{ip:d.ip,port:d.port,name:d.data.node.name},skills:R.filter(xe=>X.has(xe.name)&&!xe.isDuplicate).map(({isDuplicate:xe,...Se})=>Se),mcps:I.filter(xe=>H.has(xe.name)&&!xe.isDuplicate).map(({isDuplicate:xe,...Se})=>{const Le=W[Se.name];return Le&&Se.env?{...Se,env:{...Se.env,...Le}}:Se}),vendor:{enabled:U,apiKey:E||void 0}});ee.success?(K.success("同步完成"),n(),setTimeout(()=>t(),500)):K.error("同步失败: "+(ee.error||"未知错误"))}catch(ee){K.error("同步失败: "+ee.message)}finally{Q(!1)}}},Ke=M=>M.env?Object.entries(M.env).filter(([,fe])=>fe==="***").map(([fe])=>fe):[],pt=(M,fe,ee)=>{P(xe=>({...xe,[M]:{...xe[M]||{},[fe]:ee}}))},Ye=M=>{const fe=R.find(ee=>ee.name===M);fe!=null&&fe.isDuplicate||q(ee=>{const xe=new Set(ee);return xe.has(M)?xe.delete(M):xe.add(M),xe})},Qe=()=>{const M=R.filter(ee=>!ee.isDuplicate),fe=M.every(ee=>X.has(ee.name));q(fe?new Set:new Set(M.map(ee=>ee.name)))},Ze=M=>{const fe=I.find(ee=>ee.name===M);fe!=null&&fe.isDuplicate||N(ee=>{const xe=new Set(ee);return xe.has(M)?xe.delete(M):xe.add(M),xe})},tt=()=>{const M=I.filter(ee=>!ee.isDuplicate),fe=M.every(ee=>H.has(ee.name));N(fe?new Set:new Set(M.map(ee=>ee.name)))},J=X.size>0||H.size>0||U,Y=R.filter(M=>!M.isDuplicate),ue=I.filter(M=>!M.isDuplicate);return e?o.jsxs("div",{className:"modal-overlay",onClick:M=>{M.target===M.currentTarget&&!ye&&t()},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>{ye||t()},"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{width:"720px",maxWidth:"90%"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"局域网内同步配置"})}),o.jsx("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 24px",marginBottom:"20px",borderBottom:"1px solid var(--border-secondary)",paddingBottom:"12px"},children:[1,2,3,4,5].map(M=>o.jsxs("span",{style:{fontSize:"13px",color:r===M?"var(--primary-color)":M<r?"var(--text-secondary)":"var(--text-muted)",fontWeight:r===M?600:400,borderBottom:r===M?"2px solid var(--primary-color)":"2px solid transparent",paddingBottom:"10px",cursor:"default",whiteSpace:"nowrap"},children:[M<r?"✓ ":`${M} `,gF[M]]},M))}),o.jsxs("div",{style:{padding:"0 24px",minHeight:"300px",position:"relative"},children:[r===1&&o.jsxs("div",{children:[o.jsx("div",{style:{display:"flex",gap:"24px",marginBottom:"20px"},children:["scan","manual"].map(M=>o.jsx("button",{type:"button",onClick:()=>O(M),style:{padding:"8px 4px",background:"none",border:"none",borderBottom:L===M?"2px solid var(--primary-color)":"none",color:L===M?"var(--primary-color)":"var(--text-muted)",fontWeight:L===M?500:400,fontSize:"14px",cursor:"pointer",transition:"all 0.2s"},children:M==="scan"?"局域网扫描":"手动添加"},M))}),L==="scan"&&o.jsxs(o.Fragment,{children:[w.length>0&&o.jsxs("div",{style:{marginBottom:"16px",padding:"10px 14px",background:"var(--accent-light)",borderRadius:"8px",fontSize:"13px",color:"var(--text-secondary)"},children:[o.jsx("span",{style:{fontWeight:500,color:"var(--accent-primary)"},children:"本机"})," · ",w.map(M=>M.address).join("、")," · ","端口 ",A,w.length>1&&o.jsxs(o.Fragment,{children:[" · ",w.map((M,fe)=>o.jsxs("span",{children:[fe>0?" / ":"",o.jsxs("button",{type:"button",onClick:()=>ke(M.subnet),disabled:a,style:{padding:0,border:"none",background:"none",color:k===M.subnet?"var(--primary-color)":"var(--text-muted)",fontSize:"12px",fontWeight:k===M.subnet?600:400,cursor:a?"not-allowed":"pointer",textDecoration:k===M.subnet?"underline":"none"},children:[M.subnet,".0/",M.netmask]})]},M.subnet))]})]}),a&&o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["正在扫描 ",k,".0 网段... ",l.current,"/",l.total]}),o.jsx("div",{style:{width:"100%",height:"6px",background:"var(--bg-secondary)",borderRadius:"3px",overflow:"hidden"},children:o.jsx("div",{style:{width:l.total>0?`${l.current/l.total*100}%`:"0%",height:"100%",background:"var(--primary-color)",borderRadius:"3px",transition:"width 0.3s ease"}})})]}),!a&&ie&&u.length===0&&o.jsxs("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:[o.jsx("p",{style:{fontSize:"16px",marginBottom:"8px"},children:"未发现可用节点"}),o.jsx("p",{style:{fontSize:"14px",marginBottom:"12px"},children:'请确认远端节点已开启"允许局域网拉取配置"'}),o.jsx("button",{type:"button",className:"btn btn-secondary",style:{fontSize:"13px",padding:"6px 16px"},onClick:ne,children:"重新扫描"})]}),u.length>0&&o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666"},children:["已发现 ",u.length," 个节点:"]}),!a&&ie&&o.jsx("button",{type:"button",className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:ne,children:"重新扫描"})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(M=>{var fe,ee;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>h(M),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port,onChange:()=>h(M),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:M.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[M.ip,":",M.port,((fe=M.data.skills)==null?void 0:fe.length)>0&&` · ${M.data.skills.length} Skills`,((ee=M.data.mcps)==null?void 0:ee.length)>0&&` · ${M.data.mcps.length} MCP`]})]})]},`${M.ip}-${M.port}`)})})]})]}),Z&&o.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(255, 255, 255, 0.7)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"8px",zIndex:10},children:[o.jsx("div",{style:{width:"32px",height:"32px",border:"3px solid var(--border-secondary)",borderTop:"3px solid var(--primary-color)",borderRadius:"50%",animation:"spin 1s linear infinite",marginBottom:"12px"}}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"正在准备数据..."}),o.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}),L==="manual"&&o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center",marginBottom:"16px"},children:[o.jsx("input",{type:"text",value:m,onChange:M=>g(M.target.value),placeholder:"IP 地址,如 192.168.1.100",style:{flex:1,padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, var(--bg-card))",color:"var(--text-primary)",fontSize:"14px"}}),o.jsx("input",{type:"text",value:v,onChange:M=>x(M.target.value),placeholder:"端口",style:{width:"80px",padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, var(--bg-card))",color:"var(--text-primary)",fontSize:"14px"}}),o.jsx("button",{className:"btn btn-primary",onClick:De,disabled:y||!m.trim(),children:y?"连接中...":"连接"})]}),u.length>0&&o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:"已发现的节点:"}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(M=>{var fe,ee;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>h(M),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port,onChange:()=>h(M),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:M.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[M.ip,":",M.port,((fe=M.data.skills)==null?void 0:fe.length)>0&&` · ${M.data.skills.length} Skills`,((ee=M.data.mcps)==null?void 0:ee.length)>0&&` · ${M.data.mcps.length} MCP`]})]})]},`${M.ip}-${M.port}`)})})]})]})]}),r===2&&o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666"},children:["远端节点:",d==null?void 0:d.data.node.name," (",d==null?void 0:d.ip,")"]}),Y.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:Qe,children:Y.every(M=>X.has(M.name))?"取消全选":"全选"})]}),o.jsx("p",{style:{fontSize:"15px",fontWeight:500,marginBottom:"12px"},children:"选择需要同步的 Skills:"}),R.length===0?o.jsx("div",{style:{textAlign:"center",padding:"30px 0",color:"#999"},children:o.jsx("p",{children:"远端无可用 Skills"})}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"360px",overflowY:"auto"},children:R.map(M=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",border:`1px solid ${M.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",cursor:M.isDuplicate?"not-allowed":"pointer",opacity:M.isDuplicate?.7:1,background:M.isDuplicate?"var(--bg-secondary)":"transparent"},children:[o.jsx("input",{type:"checkbox",checked:X.has(M.name),onChange:()=>Ye(M.name),disabled:M.isDuplicate,style:{accentColor:"var(--primary-color)",marginTop:"2px"}}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{fontWeight:500},children:M.name}),M.targets&&M.targets.length>0&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:M.targets.join(", ")})]}),M.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:M.description}),M.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]},M.name))})]}),r===3&&o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[o.jsx("p",{style:{fontSize:"15px",fontWeight:500},children:"选择需要同步的 MCP:"}),ue.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:tt,children:ue.every(M=>H.has(M.name))?"取消全选":"全选"})]}),I.length===0?o.jsx("div",{style:{textAlign:"center",padding:"30px 0",color:"#999"},children:o.jsx("p",{children:"远端无可用 MCP"})}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"360px",overflowY:"auto"},children:I.map(M=>{const fe=Ke(M),ee=H.has(M.name),xe=ee&&fe.length>0;return o.jsxs("div",{style:{border:`1px solid ${M.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",opacity:M.isDuplicate?.7:1,background:M.isDuplicate?"var(--bg-secondary)":"transparent",overflow:"hidden"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",cursor:M.isDuplicate?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:ee,onChange:()=>Ze(M.name),disabled:M.isDuplicate,style:{accentColor:"var(--primary-color)",marginTop:"2px"}}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{fontWeight:500},children:M.name}),o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:M.type}),fe.length>0&&!M.isDuplicate&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"#fff3e0",color:"#e67e22"},children:"含敏感变量"})]}),M.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:M.description}),M.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]}),xe&&o.jsxs("div",{style:{padding:"8px 12px 12px 36px",borderTop:"1px dashed var(--border-secondary)",background:"var(--bg-secondary)"},children:[o.jsx("p",{style:{fontSize:"12px",color:"#e67e22",marginBottom:"8px"},children:"以下环境变量需要手动填写:"}),fe.map(Se=>{var Le;return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"6px"},children:[o.jsx("span",{style:{fontSize:"12px",color:"#666",minWidth:"120px",fontFamily:"monospace"},children:Se}),o.jsx("input",{type:"text",value:((Le=W[M.name])==null?void 0:Le[Se])||"",onChange:$e=>pt(M.name,Se,$e.target.value),placeholder:`请输入 ${Se}`,style:{flex:1,padding:"4px 8px",borderRadius:"4px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, #fff)",color:"var(--text-primary)",fontSize:"12px"}})]},Se)})]})]},M.name)})})]}),r===4&&o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:"15px",fontWeight:500,marginBottom:"16px"},children:"是否将该节点作为本地供应商?"}),o.jsxs("div",{style:{display:"flex",gap:"24px",marginBottom:"16px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},children:[o.jsx("input",{type:"radio",name:"createVendor",checked:U,onChange:()=>le(!0),style:{accentColor:"var(--primary-color)"}}),o.jsx("span",{children:"是"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},children:[o.jsx("input",{type:"radio",name:"createVendor",checked:!U,onChange:()=>le(!1),style:{accentColor:"var(--primary-color)"}}),o.jsx("span",{children:"否"})]})]}),U&&o.jsxs("div",{style:{padding:"16px",border:"1px solid var(--border-secondary)",borderRadius:"8px",marginBottom:"12px"},children:[o.jsx("label",{style:{fontSize:"14px",fontWeight:500,display:"block",marginBottom:"6px"},children:"API Key(选填)"}),o.jsx("input",{type:"text",value:E,onChange:M=>me(M.target.value),placeholder:"如果远端节点开启了认证,请填写其接入密钥",style:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, var(--bg-secondary))",color:"var(--text-primary)",boxSizing:"border-box"}}),o.jsx("p",{style:{fontSize:"12px",color:"#999",marginTop:"6px"},children:"不填写则使用空密钥连接。"})]}),U&&o.jsxs("p",{style:{fontSize:"13px",color:"#666"},children:["将创建供应商 ",o.jsxs("strong",{children:[d==null?void 0:d.data.node.name,"@",d==null?void 0:d.ip]}),", 包含 6 个 API 服务(Claude Code、Codex、Claude、Responses、Chat Completions、Gemini)。"]}),!U&&o.jsx("p",{style:{fontSize:"13px",color:"#999"},children:"跳过供应商创建,仅同步 Skills 和 MCP 配置。"})]}),r===5&&!ye&&o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:"16px",fontWeight:600,marginBottom:"16px"},children:"同步预览"}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["Skills(",X.size," 项)"]}),X.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:R.filter(M=>X.has(M.name)).map(M=>{var fe;return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",M.name," ",(fe=M.targets)!=null&&fe.length?`(${M.targets.join(", ")})`:""]},M.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["MCP(",H.size," 项)"]}),H.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:I.filter(M=>H.has(M.name)).map(M=>{const fe=Ke(M),ee=fe.some(xe=>{var Se,Le;return!((Le=(Se=W[M.name])==null?void 0:Se[xe])!=null&&Le.trim())});return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",M.name," (",M.type,")",fe.length>0&&o.jsx("span",{style:{fontSize:"12px",color:ee?"#e74c3c":"#e67e22",marginLeft:"6px"},children:ee?`⚠ ${fe.length} 个敏感变量未填写`:"✓ 敏感变量已填写"})]},M.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:"供应商"}),U?o.jsxs("div",{style:{paddingLeft:"8px"},children:[o.jsxs("div",{style:{fontSize:"14px"},children:["名称:",d==null?void 0:d.data.node.name,"@",d==null?void 0:d.ip]}),o.jsxs("div",{style:{fontSize:"14px"},children:["API Key:",E?"已填写":"未填写"]}),o.jsx("div",{style:{fontSize:"14px"},children:"API 服务:6 个(Claude Code、Codex、Claude、Responses、Chat Completions、Gemini)"})]}):o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"不创建"})]}),!J&&o.jsx("p",{style:{fontSize:"13px",color:"#e74c3c",textAlign:"center"},children:"未选择任何同步内容"})]}),r===5&&ye&&o.jsxs("div",{style:{textAlign:"center",padding:"60px 0"},children:[o.jsx("div",{style:{width:"40px",height:"40px",border:"3px solid var(--border-secondary)",borderTop:"3px solid var(--primary-color)",borderRadius:"50%",animation:"spin 1s linear infinite",margin:"0 auto 16px"}}),o.jsx("p",{style:{fontSize:"16px",color:"#666"},children:"正在同步..."}),o.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]})]}),o.jsxs("div",{className:"modal-footer",style:{marginTop:"20px"},children:[r>1&&(r<5||!ye)&&o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>i(r-1),disabled:ye,children:"← 上一步"}),o.jsx("div",{style:{flex:1}}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,disabled:ye,children:"取消"}),r===1&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:qe,disabled:!d||Z,children:Z?"加载中...":"下一步 →"}),r===2&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>i(3),children:"下一步 →"}),r===3&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>i(4),children:"下一步 →"}),r===4&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>i(5),children:"下一步 →"}),r===5&&!ye&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:ze,disabled:!J,children:"同步"})]})]})})]}):null}const $I=f.createContext(null),vF=async e=>{try{await V.clearRuleStatus(e)}catch(t){throw console.error("[RulesStatus] 清除规则状态失败:",t),t}};function xF(e){const t={};return e.forEach(n=>{t[n.ruleId]={status:n.status,totalTokensUsed:n.totalTokensUsed,totalRequestsUsed:n.totalRequestsUsed,errorMessage:n.errorMessage,errorType:n.errorType,lastUpdate:n.timestamp}}),t}function bF({children:e}){const[t,n]=f.useState({}),r=f.useRef(null),i=f.useRef(null),a=f.useRef(Date.now());f.useEffect(()=>{let p=!0;const d=()=>{r.current&&(r.current.close(),r.current=null);const h=localStorage.getItem("auth_token"),m=h?`/api/rules/status/stream?token=${encodeURIComponent(h)}`:"/api/rules/status/stream",g=new EventSource(m);r.current=g,a.current=Date.now(),g.onmessage=v=>{a.current=Date.now();try{const x=JSON.parse(v.data);if(x.type==="init")n(xF(x.statuses));else if(x.type==="update"){const y=x.status;n(b=>({...b,[y.ruleId]:{status:y.status,totalTokensUsed:y.totalTokensUsed,totalRequestsUsed:y.totalRequestsUsed,errorMessage:y.errorMessage,errorType:y.errorType,lastUpdate:y.timestamp}}))}}catch(x){console.error("[RulesStatus] SSE 数据解析错误:",x)}},g.onerror=()=>{console.warn("[RulesStatus] SSE 连接错误,准备重连..."),g.close(),r.current=null,a.current=0}};return d(),i.current=setInterval(()=>{if(!p)return;const m=Date.now()-a.current;m>=15e3&&(console.warn(`[RulesStatus] 心跳超时(${Math.round(m/1e3)}秒无响应),重新连接 SSE...`),d())},3e3),()=>{p=!1,r.current&&(r.current.close(),r.current=null),i.current&&(clearInterval(i.current),i.current=null)}},[]),f.useEffect(()=>{},[]);const l={ruleStatuses:t,getRuleStatus:c=>t[c],clearRuleStatus:vF};return o.jsx($I.Provider,{value:l,children:e})}function wF(){const e=f.useContext($I);return e||{ruleStatuses:{},getRuleStatus:t=>{},clearRuleStatus:async t=>{}}}const jF=[{value:"codex",label:"Codex",icon:"🤖"},{value:"claude-code",label:"Claude Code",icon:"⚡"},{value:"api",label:"所有 API",icon:"🔗"}],SF={codex:" [Codex]","claude-code":" [Claude Code]",api:" [API]"},kF={"claude-code":{claude:0,"claude-chat":1,"openai-chat":2,openai:3,gemini:4,"gemini-chat":5},codex:{openai:0,"openai-chat":1,claude:2,"claude-chat":3,gemini:4,"gemini-chat":5},api:{"openai-chat":0,claude:1,"claude-chat":2,openai:3,gemini:4,"gemini-chat":5}};function BI({show:e,onClose:t,onComplete:n}){const[r,i]=f.useState(""),[a,s]=f.useState(""),[l,c]=f.useState("codex"),[u,p]=f.useState(!1),[d,h]=f.useState([]),[m,g]=f.useState([]);f.useEffect(()=>{e&&(V.getVendors().then(h).catch(()=>{}),V.getRoutes().then(g).catch(()=>{}))},[e]);const v=r?Wn[r]:null,x=v?d.find(S=>S.name===v.name):null,y=!!(x!=null&&x.apiKey),b=!x||!y;if(!e)return null;const w=()=>{u||(i(""),s(""),c("codex"),t())},j=(S,A)=>V.createAPIService({vendorId:S,name:A.name,apiUrl:A.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:A.sourceType,authType:A.authType,supportedModels:A.models?A.models.split(",").map(T=>T.trim()):void 0,modelLimits:A.modelLimits||{},enableCodingPlan:!1}),k=async S=>{var T,L;if(S.preventDefault(),!r){K.warning("请选择供应商");return}if(b&&!a){K.warning("请填写 API Key");return}const A=Wn[r];if(!A){K.error("未找到对应的供应商配置");return}p(!0);try{let O,R;if(x){O=x.id,!y&&a&&await V.updateVendor(O,{...x,apiKey:a});const N=new Set((x.services||[]).map(U=>U.sourceType)),W=A.services.filter(U=>!N.has(U.sourceType)),P=W.length>0?await Promise.all(W.map(U=>j(O,U))):[];R=[...x.services||[],...P]}else{const N=await V.createVendor({name:A.name,description:A.description,apiKey:a,authType:A.authType??dt.AUTH_TOKEN,...A.apiBaseUrl?{apiBaseUrl:A.apiBaseUrl}:{},sortOrder:0,services:[]});if(!(N!=null&&N.id))throw new Error("供应商创建失败");O=N.id,R=await Promise.all(A.services.map(W=>j(O,W)))}const _=A.name+SF[l],X=new Set(m.map(N=>N.name));let q=_;if(X.has(q)){let N=2;for(;X.has(`${_}-${N}`);)N++;q=`${_}-${N}`}const I=await V.createRoute({name:q,description:"由一键配置自动创建"});if(!(I!=null&&I.id))throw new Error("路由创建失败");const $=kF[l],H=(T=[...R].filter(N=>N.sourceType).map(N=>({service:N,priority:$[N.sourceType]??99})).sort((N,W)=>N.priority-W.priority)[0])==null?void 0:T.service;if(H){const N=(L=H.supportedModels)!=null&&L.length?H.supportedModels[0]:void 0;await V.createRule({routeId:I.id,contentType:"default",targetServiceId:H.id,targetModel:N,sortOrder:0})}if(l==="codex"||l==="claude-code")try{await V.activateToolRoute(l,I.id)}catch{}if(l==="api"){let N=null;try{N=await V.getApiPathBindings()}catch{}if(N!=null&&N.bindings){const W=N.bindings.map(P=>P.apiPath==="/v1/models"?P:{...P,routeId:I.id});try{await V.updateApiPathBindings(W,N.models||"")}catch{}}}K.success("一键配置完成!路由已激活,可以开始使用"),n==null||n(),w(),setTimeout(()=>{window.location.reload()},300)}catch(O){console.error("一键配置失败:",O),K.error(`配置失败: ${O instanceof Error?O.message:"未知错误"}`)}finally{p(!1)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:w,"aria-label":"关闭",disabled:u,children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"🚀 一键配置"})}),o.jsxs("form",{onSubmit:k,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(zI,{value:r,onChange:S=>i(S),existingVendors:d,disabled:u})]}),(v==null?void 0:v.description)&&o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[v.description,v.link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:v.link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const S=new URL(v.link);return S.protocol+"//"+S.hostname}catch{return v.link}})()})]})]}),b&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Key"}),o.jsx("input",{type:"password",value:a,onChange:S=>s(S.target.value),placeholder:"请输入API密钥",required:!0,disabled:u})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"目标"}),o.jsx("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"12px",background:"var(--bg-secondary)",display:"flex",flexDirection:"column",gap:"8px"},children:jF.map(S=>{const A=l===S.value;return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:A?"var(--accent-light)":"transparent",border:`2px solid ${A?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease"},onMouseEnter:T=>{A||(T.currentTarget.style.background="var(--bg-hover)",T.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:T=>{A||(T.currentTarget.style.background="transparent",T.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"radio",name:"setupTarget",value:S.value,checked:A,onChange:()=>c(S.value),style:{width:"18px",height:"18px",marginRight:"12px",cursor:"pointer",accentColor:"var(--accent-primary)"},disabled:u}),o.jsxs("span",{style:{fontSize:"14px",fontWeight:A?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[S.icon," ",S.label]}),A&&o.jsx("span",{style:{marginLeft:"auto",fontSize:"16px",color:"var(--text-primary)"},children:"✓"})]},S.value)})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:w,disabled:u,children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",disabled:u,children:u?"配置中...":"确认配置"})]})]})]})})]})}const CF=""+new URL("openai-CPEiZpaN.webp",import.meta.url).href,PF=""+new URL("claude-XtpLmGtF.webp",import.meta.url).href;function W0({size:e=16,x:t,y:n,style:r,className:i,title:a}){return o.jsxs("svg",{viewBox:"0 0 24 24",width:e,height:e,x:t,y:n,style:r,className:i,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":a??"Claude Code",children:[o.jsx("title",{children:a??"Claude Code"}),o.jsx("path",{clipRule:"evenodd",d:"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z",fill:"#D97757",fillRule:"evenodd"})]})}function K0({size:e=16,x:t,y:n,style:r,className:i,title:a}){const l=`codex-grad-${f.useId().replace(/[:]/g,"")}`;return o.jsxs("svg",{viewBox:"0 0 24 24",width:e,height:e,x:t,y:n,style:r,className:i,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":a??"Codex",children:[o.jsx("title",{children:a??"Codex"}),o.jsx("path",{d:"M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z",fill:`url(#${l})`}),o.jsx("defs",{children:o.jsxs("linearGradient",{id:l,gradientUnits:"userSpaceOnUse",x1:"12",x2:"12",y1:"3",y2:"21",children:[o.jsx("stop",{stopColor:"#B1A7FF"}),o.jsx("stop",{offset:".5",stopColor:"#7A9DFF"}),o.jsx("stop",{offset:"1",stopColor:"#3941FF"})]})})]})}function H0({size:e=16,x:t,y:n,style:r,className:i,title:a}){return o.jsxs("svg",{viewBox:"0 0 24 24",width:e,height:e,x:t,y:n,style:r,className:i,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":a??"OpenCode",children:[o.jsx("title",{children:a??"OpenCode"}),o.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z",fillRule:"evenodd",fill:"currentColor"})]})}function FI({agent:e,...t}){return e==="codex"?o.jsx(K0,{...t}):e==="opencode"?o.jsx(H0,{...t}):o.jsx(W0,{...t})}const BS=[{value:"compact",label:"压缩对话",icon:"📦"},{value:"image-understanding",label:"图像理解",icon:"🖼"},{value:"high-iq",label:"高智商",icon:"🧠"},{value:"long-context",label:"长上下文",icon:"📄"},{value:"thinking",label:"思考",icon:"💭"},{value:"background",label:"后台",icon:"⚙"},{value:"model-mapping",label:"模型顶替",icon:"🔄"},{value:"default",label:"默认"}],FS={compact:0,"image-understanding":1,"high-iq":2,"long-context":3,thinking:4,background:5,"model-mapping":6,default:7},US={compact:"📦",background:"🧱",thinking:"💭","high-iq":"🧠","long-context":"📄","image-understanding":"🖼️","model-mapping":"🔄"},UI=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],WI=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"max",label:"Max"}],Tv=[{value:"default",label:"default",desc:"每次编辑前都会请求批准。适合入门或处理敏感代码。"},{value:"acceptEdits",label:"acceptEdits",desc:"自动编辑选中文本或整个文件;读取、文件编辑及常见文件系统命令(mkdir、touch、mv、cp 等)免询问。"},{value:"plan",label:"plan",desc:"先探索代码并给出方案,确认后再编辑;仅读取免询问。"},{value:"auto",label:"auto",desc:"自动为每个任务选择最佳权限模式;所有操作免询问,带后台安全检查。"},{value:"dontAsk",label:"dontAsk",desc:"仅预先批准的工具免询问。适合锁定的 CI 与脚本。"},{value:"bypassPermissions",label:"bypassPermissions",desc:"运行潜在危险命令前不请求批准;所有操作免询问,带后台安全检查。仅建议在隔离容器与 VM 中使用。"}],AF=e=>UI.some(t=>t.value===e),EF=e=>WI.some(t=>t.value===e),TF=e=>Tv.some(t=>t.value===e),IF=e=>AF(e==null?void 0:e.codexModelReasoningEffort)?e.codexModelReasoningEffort:"high",OF=e=>EF(e==null?void 0:e.claudeEffortLevel)?e.claudeEffortLevel:"medium",Mg=e=>{const t=TF(e==null?void 0:e.claudePermissionsDefaultMode)?e.claudePermissionsDefaultMode:"default";return t==="bypassPermissions"&&!(e!=null&&e.enableBypassPermissionsSupport)?"default":t};function WS(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0");return`${t}-${n}-${r}T${i}:${a}`}function NF(){var dw,pw,fw,hw,mw,gw,yw,vw,xw,bw;const{confirm:e}=$u(),{ruleStatuses:t,clearRuleStatus:n}=wF(),[r,i]=f.useState([]),[a,s]=f.useState([]),[l,c]=f.useState([]),[u,p]=f.useState([]),[d,h]=f.useState([]),[m,g]=f.useState([]),[v,x]=f.useState([]),[y,b]=f.useState(null),[w,j]=f.useState([]),[k,S]=f.useState(""),[A,T]=f.useState(null),[L,O]=f.useState(!1),[R,_]=f.useState(!1),[X,q]=f.useState(null),[I,$]=f.useState(null),[H,N]=f.useState(""),[W,P]=f.useState(""),[U,le]=f.useState(""),[E,me]=f.useState(""),[ye,Q]=f.useState(0),[ie,je]=f.useState((I==null?void 0:I.contentType)||""),[Z,re]=f.useState(void 0),[pe,se]=f.useState(void 0),[Re,ke]=f.useState(void 0),[ne,De]=f.useState(void 0),[qe,ze]=f.useState(""),[Ke,pt]=f.useState(void 0),[Ye,Qe]=f.useState(void 0),[Ze,tt]=f.useState(void 0),[J,Y]=f.useState(void 0),[ue,M]=f.useState(void 0),[fe,ee]=f.useState(null),[xe,Se]=f.useState(!1),[Le,$e]=f.useState(!1),[He,Oe]=f.useState(void 0),[Xe,D]=f.useState(void 0),[ge,F]=f.useState({}),[de,ve]=f.useState(!1),[Ae,Ee]=f.useState(""),[Ge,nt]=f.useState(1e3),[at,Je]=f.useState(!1),[nn,Kt]=f.useState(!1),[ut,Ht]=f.useState(!1),[Jt,It]=f.useState(!1),[Pt,gi]=f.useState(!1),[Xi,Ea]=f.useState(!1),[ce,_t]=f.useState(""),[Tn,cr]=f.useState(!1),[Qi,sn]=f.useState(""),[B,z]=f.useState(!1),[Pe,ot]=f.useState(""),[Ue,St]=f.useState(""),[rn,yi]=f.useState(""),[Zl,Jl]=f.useState(""),[hd,ws]=f.useState(!1),[st,fn]=f.useState(""),[_L,Km]=f.useState(!1),[md,nw]=f.useState({}),[gd,rw]=f.useState(null),[js,ec]=f.useState([]),[LL,iw]=f.useState(!1),[aw,ow]=f.useState(null);f.useEffect(()=>{Ss(),Hm(),Vm(),FL(),Zn(),vd(),sw(),uw()},[]);const sw=async()=>{try{const C=await V.getApiPathBindings();j(C.bindings||[]),S(C.models||"")}catch(C){console.error("Failed to load API path bindings:",C)}},lw=async(C,te)=>{try{const he=await V.updateApiPathBindings(C,te);j(he.bindings),K.success("路由映射已保存")}catch(he){K.error(he.message||"保存失败")}},DL=(C,te)=>{const he=w.map(Te=>Te.apiPath===C?{...Te,routeId:te}:Te);j(he),lw(he,k)},zL=()=>{lw(w,k)};f.useEffect(()=>{A&&vo(A.id)},[A]),f.useEffect(()=>{g(H?d.filter(C=>C.vendorId===H):[]),P(""),le("")},[H]);const Ss=async()=>{const C=await V.getRoutes();i(C),C.length>0&&!A&&T(C[0]);const te={};for(const he of C)try{const Te=await V.getBoundSessions(he.id);te[he.id]=Te.sessions.length}catch{te[he.id]=0}nw(te)},$L=async C=>{rw(C),iw(!0),ec([]);try{const te=await V.getBoundSessions(C);ec(te.sessions)}catch{ec([])}finally{iw(!1)}},cw=()=>{rw(null),ec([])},BL=async C=>{if(await e({title:"确认解绑会话",message:"确定要解除该会话的路由绑定吗?解绑后,该会话的后续请求将不再使用此路由。",type:"danger",confirmText:"解绑",cancelText:"取消"})){ow(C);try{const he=await V.unbindSessionRoute(C);he.success?(K.success("已解除绑定"),ec(Te=>Te.filter(ht=>ht.id!==C)),nw(Te=>{const ht=gd;return!ht||!Te[ht]?Te:{...Te,[ht]:Math.max(0,Te[ht]-1)}})):K.error(he.error||"解绑失败")}catch(he){K.error(he.message||"解绑失败")}finally{ow(null)}}},vo=async C=>{const te=await V.getRules(C);if(s(te),uw(),C)try{const Te=(await V.getRulesBlacklistStatus(C)).reduce((ht,kt)=>(ht[kt.ruleId]=kt,ht),{});F(Te)}catch(he){console.error("Failed to load blacklist status:",he)}},uw=async()=>{try{const C=await V.getRules();c(C)}catch(C){console.error("Failed to load all rules:",C)}},Hm=async()=>{const C=await V.getVendors();p(C)},Vm=async()=>{const C=await V.getAPIServices();h(C)},FL=async()=>{const C=await V.getMCPs();x(C)},[Fe,UL]=f.useState(null),[Qn,yd]=f.useState(null),Zn=async()=>{try{const C=await V.getConfig();b(C),_t(C.claudeDefaultModel||""),cr(!1),sn(C.autocompactPctOverride!=null?String(C.autocompactPctOverride):""),z(!1),ot(C.claudeMaxRetries!=null?String(C.claudeMaxRetries):""),St(C.codexMaxRetries!=null?String(C.codexMaxRetries):""),yi(C.opencodeMaxRetries!=null?String(C.opencodeMaxRetries):""),Jl(C.codexDefaultModel||""),ws(!1),fn(C.opencodeDefaultModel||""),Km(!1),ze(typeof C.ruleGlobalTimeout=="number"&&C.ruleGlobalTimeout>0?String(C.ruleGlobalTimeout):"")}catch(C){console.error("Failed to load app config:",C)}},vd=async()=>{try{const C=await V.getToolBindings();UL(C)}catch(C){console.error("Failed to load tool bindings:",C)}},ks=async(C,te)=>{yd(C);try{(await V.activateToolRoute(C,te)).success?(await vd(),await Ss(),K.success("路由已激活")):K.error("激活失败")}catch(he){K.error(`激活失败: ${he.message||"未知错误"}`)}finally{yd(null)}},Cs=async C=>{yd(C);try{(await V.deactivateToolRoute(C)).success?(await vd(),await Ss(),K.success("路由已停用")):K.error("停用失败")}catch(te){K.error(`停用失败: ${te.message||"未知错误"}`)}finally{yd(null)}},WL=async C=>{C.preventDefault();const te=new FormData(C.currentTarget),he={name:te.get("name"),description:te.get("description")};X?await V.updateRoute(X.id,he):await V.createRoute(he),O(!1),Ss()},KL=async C=>{if(await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{await V.deleteRoute(C),Ss(),A&&A.id===C&&(T(null),s([])),K.success("路由已删除")}catch(he){K.error(he.message||"删除失败")}},HL=async C=>{if(C.preventDefault(),ie==="image-understanding"&&de&&!Ae){K.warning("请选择一个MCP工具");return}if(!de&&!W){K.warning("请选择供应商API服务");return}if(!de&&Z!==void 0&&He!==void 0&&Z>He){K.warning(`Token超量值 (${Z}k) 不能超过API服务的限制 (${He}k)`);return}if(!de&&Ke!==void 0&&Xe!==void 0&&Ke>Xe){K.warning(`请求次数超量值 (${Ke}) 不能超过API服务的限制 (${Xe})`);return}const te=new FormData(C.currentTarget),he={routeId:A.id,contentType:te.get("contentType"),targetServiceId:de?"":W,targetModel:de?void 0:U||"",replacedModel:E||"",sortOrder:ye,timeout:ne?ne*1e3:void 0,tokenLimit:de?void 0:Z||void 0,resetInterval:de?void 0:pe,tokenResetBaseTime:de?void 0:Re?Re.getTime():void 0,requestCountLimit:de?void 0:Ke,requestResetInterval:de?void 0:Ye,requestResetBaseTime:de?void 0:Ze?Ze.getTime():void 0,frequencyLimit:J,frequencyWindow:ue,useMCP:ie==="image-understanding"?de:!1,mcpId:ie==="image-understanding"&&de?Ae:void 0,sessionTokenThreshold:ie==="long-context"?Ge:void 0};I?await V.updateRule(I.id,he):await V.createRule(he),_(!1),A&&vo(A.id)},VL=async C=>{await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"})&&(await V.deleteRule(C),A&&vo(A.id),K.success("规则已删除"))},qL=async C=>{try{const te=await V.toggleRuleDisable(C);A&&vo(A.id),K.success(te.isDisabled?"规则已屏蔽":"规则已启用")}catch(te){K.error("操作失败: "+te.message)}},YL=async C=>{var te,he;try{const Te=[];(te=ge[C])!=null&&te.isBlacklisted&&Te.push(V.clearRuleBlacklist(C));const ht=(he=t[C])==null?void 0:he.status;(ht==="error"||ht==="suspended")&&Te.push(n(C)),await Promise.all(Te),A&&vo(A.id),K.success("已恢复")}catch(Te){K.error("恢复失败: "+Te.message)}},GL=async C=>{try{const te=a.find(kt=>kt.id===C);if(!te)return;const he=a.filter(kt=>kt.contentType===te.contentType),ht=Math.max(...he.map(kt=>kt.sortOrder||0))+1;await V.updateRule(C,{sortOrder:ht}),A&&vo(A.id),K.success("优先级已提升至最高")}catch(te){K.error("操作失败: "+te.message)}},XL=async C=>{try{if(!a.find(Te=>Te.id===C))return;await V.updateRule(C,{sortOrder:0}),A&&vo(A.id),K.success("优先级已降至最低")}catch(te){K.error("操作失败: "+te.message)}},QL=async C=>{try{const te=y||{};await V.updateConfig({...te,enableAgentTeams:C}),K.success(C?"Agent Teams 设置已保存(重启 Claude Code 后生效)":"Agent Teams 设置已取消(重启 Claude Code 后生效)"),await Zn()}catch(te){K.error("更新失败: "+te.message)}},ZL=async C=>{try{const te=y||{},he=Mg(y),Te=!C&&he==="bypassPermissions"?"default":he;await V.updateConfig({...te,enableBypassPermissionsSupport:C,claudePermissionsDefaultMode:Te}),K.success(C?"对 bypassPermissions 的支持设置已保存(重启 Claude Code 后生效)":"对 bypassPermissions 的支持设置已取消(重启 Claude Code 后生效)"),await Zn()}catch(te){K.error("更新失败: "+te.message)}},JL=async C=>{try{const te=y||{};await V.updateConfig({...te,claudePermissionsDefaultMode:C}),K.success("默认权限模式已保存(重启 Claude Code 后生效)"),await Zn()}catch(te){K.error("更新失败: "+te.message)}},eD=async C=>{try{gi(!0);const te=y||{};await V.updateConfig({...te,codexModelReasoningEffort:C}),K.success("Reasoning Effort 设置已保存(重启 Codex 后生效)"),await Zn()}catch(te){K.error("更新失败: "+te.message)}finally{gi(!1)}},tD=async C=>{try{Ea(!0);const te=y||{};await V.updateConfig({...te,claudeEffortLevel:C}),K.success("Effort Level 设置已保存(重启 Claude Code 后生效)"),await Zn()}catch(te){K.error("更新失败: "+te.message)}finally{Ea(!1)}},nD=async()=>{try{const C=y||{};await V.updateConfig({...C,claudeDefaultModel:ce.trim()||void 0}),K.success("默认模型已保存(重启 Claude Code 后生效)"),cr(!1),await Zn()}catch(C){K.error("保存失败: "+C.message)}},rD=async()=>{const C=Qi.trim();if(C===""){try{const he=y||{};await V.updateConfig({...he,autocompactPctOverride:void 0}),K.success("自动压缩百分比已清除(重启 Claude Code 后生效)"),z(!1),await Zn()}catch(he){K.error("保存失败: "+he.message)}return}const te=Number(C);if(!Number.isInteger(te)||te<1||te>100){K.error("自动压缩百分比必须为 1-100 的整数");return}try{const he=y||{};await V.updateConfig({...he,autocompactPctOverride:te}),K.success("自动压缩百分比已保存(重启 Claude Code 后生效)"),z(!1),await Zn()}catch(he){K.error("保存失败: "+he.message)}},qm=async(C,te,he)=>{const Te=te.trim();if(Te===""){try{const kt=y||{};await V.updateConfig({...kt,[C]:void 0}),K.success(`最大重试次数已清除,恢复默认 5(重启 ${he} 后生效)`),await Zn()}catch(kt){K.error("保存失败: "+kt.message)}return}const ht=Number(Te);if(!Number.isInteger(ht)||ht<1||ht>20){K.error("最大重试次数必须为 1-20 的整数");return}try{const kt=y||{};await V.updateConfig({...kt,[C]:ht}),K.success(`最大重试次数已保存(重启 ${he} 后生效)`),await Zn()}catch(kt){K.error("保存失败: "+kt.message)}},iD=async()=>{try{const C=y||{};await V.updateConfig({...C,codexDefaultModel:Zl.trim()||void 0}),K.success("默认模型已保存(重启 Codex 后生效)"),ws(!1),await Zn()}catch(C){K.error("保存失败: "+C.message)}},aD=async()=>{try{const C=y||{};await V.updateConfig({...C,opencodeDefaultModel:st.trim()||void 0}),K.success("默认模型已保存(重启 OpenCode 后生效)"),Km(!1),await Zn()}catch(C){K.error("保存失败: "+C.message)}},oD=async()=>{try{const C=y||{},te=Number(qe),he=Number.isFinite(te)&&te>0?te:void 0;await V.updateConfig({...C,ruleGlobalTimeout:he}),K.success(he?`规则全局超时时间已设置为 ${he} 秒`:"规则全局超时时间已恢复为默认值(300秒)"),await Zn()}catch(C){K.error("更新失败: "+C.message)}},sD=()=>BS,lD=C=>{$(C),je(C.contentType),ve(C.useMCP||!1),Ee(C.mcpId||"");const te=d.find(he=>he.id===C.targetServiceId);te?(te.vendorId&&(N(te.vendorId),g(d.filter(he=>he.vendorId===te.vendorId))),setTimeout(()=>{if(P(te.id),le(C.targetModel||""),me(C.replacedModel||""),Q(C.sortOrder||0),De(C.timeout?C.timeout/1e3:void 0),re(C.tokenLimit||void 0),se(C.resetInterval),ke(C.tokenResetBaseTime?new Date(C.tokenResetBaseTime):void 0),pt(C.requestCountLimit),Qe(C.requestResetInterval),tt(C.requestResetBaseTime?new Date(C.requestResetBaseTime):void 0),Y(C.frequencyLimit),M(C.frequencyWindow),te.enableTokenLimit&&te.tokenLimit){Oe(te.tokenLimit);const he=C.tokenLimit===te.tokenLimit&&C.resetInterval===(te.tokenResetInterval||void 0)&&C.tokenLimit!==null&&C.resetInterval!==null;Se(he)}else Oe(void 0),Se(!1);if(te.enableRequestLimit&&te.requestCountLimit){D(te.requestCountLimit);const he=C.requestCountLimit===te.requestCountLimit&&C.requestResetInterval===(te.requestResetInterval||void 0)&&C.requestCountLimit!==null&&C.requestResetInterval!==null;$e(he)}else D(void 0),$e(!1);Je(!!C.tokenLimit),Kt(!!C.requestCountLimit),nt(C.sessionTokenThreshold??1e3)},0)):(C.useMCP&&(N(""),P(""),le(""),me(""),Q(C.sortOrder||0),De(C.timeout?C.timeout/1e3:void 0),Je(!1),Kt(!1)),nt(C.sessionTokenThreshold??1e3)),_(!0)},cD=C=>l.some(te=>{var he;return te.routeId===C&&((he=t[te.id])==null?void 0:he.status)==="in_use"}),uD=C=>{var In;const te=ge[C.id],he=[],Te=t[C.id];if((Te==null?void 0:Te.status)==="in_use")return{status:"in_use",label:"使用中",reason:"正在处理请求"};if((Te==null?void 0:Te.status)==="suspended"){const _e=Te.errorType==="timeout"?"超时":Te.errorType==="http"?"HTTP错误":"错误";return{status:"suspended",label:"已挂起",reason:Te.errorMessage||`${_e}导致服务暂时不可用`}}if((Te==null?void 0:Te.status)==="error")return{status:"error",label:"请求失败",reason:Te.errorMessage||"请求处理失败"};if(te!=null&&te.isBlacklisted){const _e=te.blacklistEntry;(_e==null?void 0:_e.errorType)==="timeout"?he.push("请求超时"):_e!=null&&_e.lastStatusCode&&he.push(`HTTP ${_e.lastStatusCode}错误`)}const ht=(Te==null?void 0:Te.totalTokensUsed)!==void 0?Te.totalTokensUsed:C.totalTokensUsed;C.tokenLimit&&ht!==void 0&&ht>=C.tokenLimit*1e3&&he.push("Token超限");const kt=(Te==null?void 0:Te.totalRequestsUsed)!==void 0?Te.totalRequestsUsed:C.totalRequestsUsed;if(C.requestCountLimit&&kt!==void 0&&kt>=C.requestCountLimit&&he.push("次数超限"),he.length>0)return{status:"error",label:te!=null&&te.isBlacklisted?((In=te.blacklistEntry)==null?void 0:In.errorType)==="timeout"?"超时":"服务错误":he[0],reason:he.join(", ")};const vi=[];if(C.tokenLimit&&ht!==void 0){const _e=ht/(C.tokenLimit*1e3)*100;_e>=80&&vi.push(`Token ${_e.toFixed(0)}%`)}if(C.requestCountLimit&&kt!==void 0){const _e=kt/C.requestCountLimit*100;_e>=80&&vi.push(`次数 ${_e.toFixed(0)}%`)}return vi.length>0?{status:"warning",label:"接近限制",reason:vi.join(", ")}:{status:"success",label:"正常",reason:""}},dD=()=>{$(null),je("default"),N(""),P(""),le(""),me(""),Q(0),De(void 0),re(void 0),se(void 0),ke(void 0),pt(void 0),Qe(void 0),tt(void 0),Se(!1),$e(!1),Oe(void 0),D(void 0),Je(!1),Kt(!1),ve(!1),Ee(""),nt(1e3),_(!0)};return o.jsxs("div",{className:"routes-page",children:[o.jsxs("div",{className:"page-header",style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[o.jsxs("div",{children:[o.jsx("h1",{children:"路由管理"}),o.jsx("p",{children:"管理API路由和路由配置"})]}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>It(!0),style:{whiteSpace:"nowrap"},children:"局域网内同步配置"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>Ht(!0),style:{whiteSpace:"nowrap"},children:"一键配置"})]})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column"},children:o.jsxs("div",{style:{display:"flex",gap:"20px"},children:[o.jsxs("div",{className:"card",style:{flex:"0 0 25%",minWidth:300},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"路由"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>O(!0),children:"新建"})]}),r.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无路由规则"})}):o.jsx("div",{style:{marginTop:"10px"},children:r.map(C=>{var te,he,Te,ht,kt,vi;return o.jsx("div",{className:cD(C.id)?"route-active-glow":void 0,onClick:()=>T(C),style:{padding:"12px",marginBottom:"8px",backgroundColor:A&&A.id===C.id?"var(--bg-route-item-selected)":"var(--bg-route-item)",borderRadius:"8px",cursor:"pointer",border:"1px solid var(--border-primary)",position:"relative"},children:o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[o.jsx("div",{style:{fontWeight:500,flex:1,minWidth:0},children:C.name}),o.jsxs("div",{style:{display:"flex",gap:"3px",alignItems:"center",flexShrink:0,marginLeft:"8px"},children:[md[C.id]>0&&o.jsxs("div",{style:{position:"relative"},children:[o.jsx("div",{onClick:In=>{In.stopPropagation(),$L(C.id)},style:{width:"18px",height:"18px",borderRadius:"50%",border:"2px solid var(--color-primary, #2980b9)",boxSizing:"border-box",backgroundColor:"transparent",color:"var(--color-primary, #2980b9)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:700,cursor:"pointer",flexShrink:0},children:md[C.id]>99?"99+":md[C.id]}),o.jsxs("span",{className:"route-icon-popover",children:[md[C.id]," 个会话绑定此路由,点击查看"]})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:CF,alt:"Codex",onClick:In=>{var _e;In.stopPropagation(),!Qn&&(((_e=Fe==null?void 0:Fe.codex)==null?void 0:_e.routeId)===C.id?Cs("codex"):ks("codex",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:Qn?"wait":"pointer",opacity:((te=Fe==null?void 0:Fe.codex)==null?void 0:te.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((he=Fe==null?void 0:Fe.codex)==null?void 0:he.routeId)===C.id?"Codex 已绑定此路由,点击解绑":"点击将 Codex 绑定到此路由"})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:PF,alt:"Claude Code",onClick:In=>{var _e;In.stopPropagation(),!Qn&&(((_e=Fe==null?void 0:Fe["claude-code"])==null?void 0:_e.routeId)===C.id?Cs("claude-code"):ks("claude-code",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:Qn?"wait":"pointer",opacity:((Te=Fe==null?void 0:Fe["claude-code"])==null?void 0:Te.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((ht=Fe==null?void 0:Fe["claude-code"])==null?void 0:ht.routeId)===C.id?"Claude Code 已绑定此路由,点击解绑":"点击将 Claude Code 绑定到此路由"})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("div",{onClick:In=>{var _e;In.stopPropagation(),!Qn&&(((_e=Fe==null?void 0:Fe.opencode)==null?void 0:_e.routeId)===C.id?Cs("opencode"):ks("opencode",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:Qn?"wait":"pointer",opacity:((kt=Fe==null?void 0:Fe.opencode)==null?void 0:kt.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#10B981"},children:o.jsx(H0,{size:18})}),o.jsx("span",{className:"route-icon-popover",children:((vi=Fe==null?void 0:Fe.opencode)==null?void 0:vi.routeId)===C.id?"OpenCode 已绑定此路由,点击解绑":"点击将 OpenCode 绑定到此路由"})]})]})]}),C.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-route-muted)",marginTop:"2px"},children:C.description}),o.jsxs("div",{className:"action-buttons",style:{marginTop:"8px"},children:[o.jsx("button",{className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:In=>{In.stopPropagation(),q(C),O(!0)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:In=>{In.stopPropagation(),KL(C.id)},children:"删除"})]})]})},C.id)})})]}),o.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:o.jsxs("div",{className:"card",style:{flex:1},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"规则列表"}),A&&o.jsx("button",{className:"btn btn-primary",onClick:dD,children:"新建规则"})]}),A?a.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无路由规则"})}):o.jsxs("table",{className:"rules-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"col-priority",children:"优先级"}),o.jsx("th",{children:"类型"}),o.jsx("th",{children:"API服务"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"用量情况"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:[...a].sort((C,te)=>{const he=FS[C.contentType]??999,Te=FS[te.contentType]??999;if(he!==Te)return he-Te;const ht=C.sortOrder||0;return(te.sortOrder||0)-ht}).map(C=>{var ht,kt,vi,In;const te=d.find(_e=>_e.id===C.targetServiceId),he=u.find(_e=>_e.id===(te==null?void 0:te.vendorId)),Te=(ht=BS.find(_e=>_e.value===C.contentType))==null?void 0:ht.label;return o.jsxs("tr",{children:[o.jsx("td",{className:"col-priority",style:C.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{className:"col-priority-box",children:[o.jsx("span",{children:C.sortOrder||0}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>XL(C.id),title:"降至最低优先级",children:"↓"}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>GL(C.id),title:"升至最高优先级",children:"↑"})]})}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{style:{fontSize:"12px",whiteSpace:"nowrap"},children:[C.contentType!=="default"&&US[C.contentType]&&o.jsx("span",{style:{fontSize:"14px"},children:US[C.contentType]}),o.jsx("span",{children:Te}),C.contentType==="model-mapping"&&C.replacedModel&&o.jsxs("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:()=>ee(C.id),onMouseLeave:()=>ee(null),children:[o.jsx("span",{style:{cursor:"help",fontSize:"14px",color:"var(--text-info)",fontWeight:"bold"},children:"ⓘ"}),fe===C.id&&o.jsxs("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"calc(100% + 8px)",backgroundColor:"var(--bg-popover, #333)",color:"var(--text-popover, #fff)",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:["被顶替的模型是: ",C.replacedModel,o.jsx("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"-4px",width:"0",height:"0",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid var(--bg-popover, #333)"}})]})]})]})}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:o.jsx("div",{className:"vendor-sevices-col",style:{fontSize:"0.6em"},children:C.useMCP?o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["MCP:",((kt=v.find(_e=>_e.id===C.mcpId))==null?void 0:kt.name)||"Unknown"]}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"使用MCP工具"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["供应商:",he?he.name:"Unknown"]}),o.jsxs("div",{children:["服务:",te?te.name:"Unknown"]}),o.jsxs("div",{children:["模型:",C.targetModel||"透传模型"]})]})})}),o.jsx("td",{style:{whiteSpace:"nowrap",...C.isDisabled?{opacity:.4}:{}},children:(()=>{var ww,jw,Sw,kw;const _e=uD(C),Jn=ge[C.id],pD=(Jn==null?void 0:Jn.isBlacklisted)&&!((ww=_e.reason)!=null&&ww.includes("Token超限"))&&!((jw=_e.reason)!=null&&jw.includes("次数超限"));if(C.isDisabled)return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("span",{style:{color:"#6c757d",fontWeight:"bold",fontSize:"14px"},children:"⊘"}),o.jsx("span",{style:{fontSize:"13px",color:"#6c757d",fontWeight:"bold"},children:"已屏蔽"})]});const fD=pD||((Sw=t[C.id])==null?void 0:Sw.status)==="error"||((kw=t[C.id])==null?void 0:kw.status)==="suspended";return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[_e.status==="success"&&o.jsx("span",{style:{color:"#28a745",fontWeight:"bold",fontSize:"14px"},children:"✓"}),_e.status==="warning"&&o.jsx("span",{style:{color:"#ffc107",fontWeight:"bold",fontSize:"14px"},children:"⚠"}),_e.status==="error"&&o.jsx("span",{style:{color:"#dc3545",fontWeight:"bold",fontSize:"14px"},children:"✗"}),_e.status==="suspended"&&o.jsx("span",{style:{color:"#6f42c1",fontWeight:"bold",fontSize:"14px"},children:"⏸"}),_e.status==="in_use"&&o.jsx(o.Fragment,{children:o.jsx("span",{style:{color:"#007bff",fontWeight:"bold",fontSize:"14px",animation:"pulse 1.5s ease-in-out infinite"},children:"●"})}),o.jsx("span",{style:{fontSize:"13px",color:_e.status==="success"?"#28a745":_e.status==="warning"?"#ffc107":_e.status==="in_use"?"#007bff":_e.status==="suspended"?"#6f42c1":"#dc3545",fontWeight:_e.status!=="success"?"bold":"normal"},children:_e.label}),_e.reason&&o.jsxs("div",{style:{position:"relative",display:"inline-block",cursor:"help"},onMouseEnter:()=>ee(C.id+"-status"),onMouseLeave:()=>ee(null),children:[o.jsx("span",{style:{fontSize:"12px",color:"#999",marginLeft:"4px"},children:" ⓘ"}),fe===C.id+"-status"&&o.jsxs("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"calc(100% + 8px)",backgroundColor:"var(--bg-popover, #333)",color:"var(--text-popover, #fff)",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:[_e.reason,o.jsx("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"-4px",width:"0",height:"0",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid var(--bg-popover, #333)"}})]})]})]}),fD&&o.jsx("button",{className:"btn btn-info",style:{padding:"2px 8px",fontSize:"11px"},onClick:()=>YL(C.id),children:"恢复"})]})})()}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:C.tokenLimit||C.requestCountLimit?o.jsxs("div",{style:{fontSize:"13px"},children:[C.tokenLimit&&o.jsxs("div",{style:{whiteSpace:"nowrap"},children:[o.jsx("span",{style:{fontWeight:"bold",fontSize:"12px"},children:"Tokens:"}),o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{color:(()=>{var Jn;const _e=((Jn=t[C.id])==null?void 0:Jn.totalTokensUsed)??C.totalTokensUsed;return _e&&C.tokenLimit&&_e>=C.tokenLimit*1e3?"red":"inherit"})()},children:[(((((vi=t[C.id])==null?void 0:vi.totalTokensUsed)??C.totalTokensUsed)||0)/1e3).toFixed(1),"K/",C.tokenLimit.toFixed(0),"K"]}),(()=>{var Jn;const _e=((Jn=t[C.id])==null?void 0:Jn.totalTokensUsed)??C.totalTokensUsed;return _e&&C.tokenLimit&&_e>=C.tokenLimit*1e3?o.jsx("span",{style:{color:"red",marginLeft:"4px",fontWeight:"bold",fontSize:"11px"},children:"超限"}):null})()]})]}),C.requestCountLimit&&o.jsxs("div",{style:{marginTop:C.tokenLimit?"6px":0},children:[o.jsx("span",{style:{fontWeight:"bold",fontSize:"12px"},children:"次数:"}),o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{color:(()=>{var Jn;const _e=((Jn=t[C.id])==null?void 0:Jn.totalRequestsUsed)??C.totalRequestsUsed;return _e&&C.requestCountLimit&&_e>=C.requestCountLimit?"red":"inherit"})()},children:[(((In=t[C.id])==null?void 0:In.totalRequestsUsed)??C.totalTokensUsed)||0,"/",C.requestCountLimit]}),(()=>{var Jn;const _e=((Jn=t[C.id])==null?void 0:Jn.totalRequestsUsed)??C.totalRequestsUsed;return _e&&C.requestCountLimit&&_e>=C.requestCountLimit?o.jsx("span",{style:{color:"red",marginLeft:"4px",fontWeight:"bold",fontSize:"11px"},children:"超限"}):null})()]})]})]}):o.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"不限制"})}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",style:{justifyContent:"flex-end"},children:[o.jsx("button",{className:`btn ${C.isDisabled?"btn-success":"btn-warning"}`,onClick:()=>qL(C.id),title:C.isDisabled?"启用规则":"临时屏蔽规则",children:C.isDisabled?"启用":"屏蔽"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>lD(C),children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>VL(C.id),children:"删除"})]})})]},C.id)})})]}):o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"请先选择一个路由"})}),A&&a.length>0&&o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-info-box)",marginTop:"16px",padding:"12px",backgroundColor:"var(--bg-info-box)",borderRadius:"6px",border:"1px solid var(--border-info-box)",lineHeight:"1.6"},children:[o.jsx("strong",{children:"📌 如何配置规则(推荐)"}),o.jsxs("div",{style:{marginTop:"6px"},children:["• 先创建一条 ",o.jsx("strong",{children:"默认"})," 规则作为兜底,避免请求无规则可走",o.jsx("br",{}),"• 再按你的实际场景增加规则:如图像理解、长上下文、思考、高智商等",o.jsx("br",{}),"• 按类型匹配顺序:",o.jsx("strong",{children:"压缩对话 → 图像理解 → 高智商 → 长上下文 → 思考 → 后台 → 模型顶替 → 默认"}),o.jsx("br",{}),"• 如果要“指定模型走指定服务”,再加 ",o.jsx("strong",{children:"模型顶替"})," 规则",o.jsx("br",{}),"• 同一类型可配多条:",o.jsx("strong",{children:"把主力服务放上面(优先级更大),备用服务放下面"}),o.jsx("br",{}),"• 开启智能故障切换后,系统会在主力不可用时自动切到下一个可用规则",o.jsx("br",{}),"• 你只需要记住:",o.jsx("strong",{children:"先分类型,再排顺序,上主下备"})]})]}),A&&a.length>0&&o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-info-box)",marginTop:"12px",padding:"12px",backgroundColor:"var(--bg-info-box)",borderRadius:"6px",border:"1px solid var(--border-info-box)",lineHeight:"1.6"},children:[o.jsx("strong",{children:"💡 智能故障切换机制"}),o.jsxs("div",{style:{marginTop:"6px"},children:["• 当同一请求类型配置多个规则时,系统会按排序优先使用第一个",o.jsx("br",{}),"• 如果某个服务报错(4xx/5xx)或请求超时,将自动切换到下一个可用服务",o.jsx("br",{}),"• 报错或超时的服务会被标记为不可用(默认10秒),可在设置页面修改“故障自动恢复时间”",o.jsx("br",{}),"• 到达恢复时间后自动解除标记,如果再次报错或超时则重新标记",o.jsx("br",{}),"• 确保您的请求始终路由到稳定可用的服务",o.jsx("br",{}),"• 规则状态列会实时显示每个规则的可用性状态",o.jsx("br",{}),"• 如不需要此功能,可在",o.jsx("strong",{children:"设置"}),'页面关闭"启用智能故障切换"选项']})]})]})})]})}),o.jsxs("div",{className:"card",children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"规则配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"rule-global-timeout",style:{marginBottom:0,minWidth:"140px",whiteSpace:"nowrap"},children:"超时时间(秒)"}),o.jsx("input",{id:"rule-global-timeout",type:"number",value:qe,onChange:C=>ze(C.target.value),onBlur:()=>oD(),min:"1",placeholder:"默认300秒",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置规则的全局超时时间。当单个规则未配置超时时间时,将使用此值作为超时上限。 不设置则默认为300秒(5分钟)。超时后会自动触发故障切换到下一个可用规则。"})]})]}),o.jsxs("div",{className:"card api-binding-card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"api-binding-header",children:o.jsx("h3",{children:"API 路径路由映射"})}),o.jsx("p",{className:"api-binding-desc",children:"将标准 API 路径绑定到路由,使任何兼容该 API 的编程工具都可以通过对应路径使用服务。"}),o.jsxs("div",{className:"api-binding-baseurl-row",children:[o.jsx("span",{className:"api-binding-baseurl-prefix",children:"Base URL"}),o.jsx("span",{className:"api-binding-baseurl-value",children:window.location.origin})]}),o.jsx("div",{className:"api-binding-list",children:w.map(C=>{const te=C.apiPath==="/v1/models",he=te?!!k.trim():!!C.routeId;return o.jsxs("div",{className:"api-binding-row",children:[o.jsx("span",{className:`api-binding-status ${he?"api-binding-status--bound":""}`}),o.jsx("span",{className:"api-binding-path",children:C.apiPath==="/v1beta/models"?"/v1beta/models/{model}:{action}":C.apiPath}),o.jsx("span",{className:"api-binding-arrow",children:"→"}),o.jsx("div",{className:"api-binding-control",children:te?o.jsx("input",{type:"text",value:k,onChange:Te=>S(Te.target.value),onBlur:zL,placeholder:"自定义模型列表,英文逗号分隔,留空使用默认列表"}):o.jsxs("select",{value:C.routeId||"",onChange:Te=>DL(C.apiPath,Te.target.value||null),children:[o.jsx("option",{value:"",children:"无"}),r.map(Te=>o.jsx("option",{value:Te.id,children:Te.name},Te.id))]})})]},C.apiPath)})})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"Claude Code 全局配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"tool-binding-block",children:[o.jsxs("div",{className:"tool-binding-label",children:[o.jsx("span",{className:"tool-binding-label-icon",children:"⚡"}),"激活路由"]}),o.jsxs("div",{className:"tool-binding-row",children:[o.jsxs("select",{id:"claude-route-binding",value:((dw=Fe==null?void 0:Fe["claude-code"])==null?void 0:dw.routeId)||"",onChange:C=>{const te=C.target.value||null;te&&ks("claude-code",te)},disabled:Qn==="claude-code",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var te;return o.jsxs("option",{value:C.id,children:[C.name,((te=Fe==null?void 0:Fe["claude-code"])==null?void 0:te.routeId)===C.id?" (已激活)":""]},C.id)})]}),((pw=Fe==null?void 0:Fe["claude-code"])==null?void 0:pw.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Cs("claude-code"),disabled:Qn==="claude-code",children:Qn==="claude-code"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 Claude Code 代理请求。激活后,/claude-code/ 路径的请求将使用该路由的规则。"})]}),o.jsxs("div",{style:{marginTop:"20px",marginBottom:"20px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"agent-teams-toggle",checked:(y==null?void 0:y.enableAgentTeams)||!1,onChange:C=>QL(C.target.checked),style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"agent-teams-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启 Agent Teams 功能"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后将启用 Agent Teams 实验性功能,并实时写入配置;重启 Claude Code 后生效。"})]}),o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"bypass-permissions-support-toggle",checked:(y==null?void 0:y.enableBypassPermissionsSupport)||!1,onChange:C=>ZL(C.target.checked),style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"bypass-permissions-support-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启对 bypassPermissions 的支持"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后默认编辑跳过危险模式权限提示,你可以切换到其他模式。该设置会实时写入配置文件,重启 Claude Code 后生效。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认权限模式"}),o.jsx("div",{style:{flex:1,minWidth:0},children:o.jsx(mF,{value:Mg(y),options:Tv.filter(C=>C.value!=="bypassPermissions"||(y==null?void 0:y.enableBypassPermissionsSupport)).map(C=>({value:C.value,label:C.label,description:C.desc})),onChange:C=>JL(C)})})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:[(fw=Tv.find(C=>C.value===Mg(y)))==null?void 0:fw.desc,y!=null&&y.enableBypassPermissionsSupport?"":" 需先开启上方的 bypassPermissions 支持,才能切换到 bypassPermissions 模式。"," 该设置会实时写入 ~/.claude/settings.json,重启 Claude Code 后生效。"]})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-effort-level",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"Effort Level"}),o.jsx("select",{id:"claude-effort-level",value:OF(y),onChange:C=>tD(C.target.value),disabled:Xi,style:{flex:1,minWidth:0},children:WI.map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"该设置会实时写入 ~/.claude/settings.json,重启 Claude Code 后生效。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"claude-default-model",type:"text",value:ce,onChange:C=>{_t(C.target.value),cr(C.target.value!==((y==null?void 0:y.claudeDefaultModel)||""))},onBlur:()=>{Tn&&nD()},placeholder:"例如:claude-3-5-sonnet-20241022",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置后写入 ~/.claude/settings.json 的 model 字段,重启 Claude Code 后生效。留空则不写入。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-autocompact-pct",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"Autocompact PCT"}),o.jsx("input",{id:"claude-autocompact-pct",type:"number",min:"1",max:"100",value:Qi,onChange:C=>{sn(C.target.value),z(C.target.value!==((y==null?void 0:y.autocompactPctOverride)!=null?String(y.autocompactPctOverride):""))},onBlur:()=>{B&&rD()},placeholder:"1-100",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置自动压缩百分比阈值(1-100),写入 ~/.claude/settings.json 的 env 字段,重启 Claude Code 后生效。留空则不写入。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-max-retries",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"最大重试次数"}),o.jsx("input",{id:"claude-max-retries",type:"number",min:"1",max:"20",value:Pe,onChange:C=>ot(C.target.value),onBlur:C=>qm("claudeMaxRetries",C.target.value,"Claude Code"),placeholder:"默认 5",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置 Claude Code 请求失败时的最大重试次数(1-20),写入 ~/.claude/settings.json 的 env.CLAUDE_CODE_MAX_RETRIES 字段,重启 Claude Code 后生效。留空则使用默认值 5。"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"Codex 全局配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"tool-binding-block",children:[o.jsxs("div",{className:"tool-binding-label",children:[o.jsx("span",{className:"tool-binding-label-icon",children:"⚡"}),"激活路由"]}),o.jsxs("div",{className:"tool-binding-row",children:[o.jsxs("select",{id:"codex-route-binding",value:((hw=Fe==null?void 0:Fe.codex)==null?void 0:hw.routeId)||"",onChange:C=>{const te=C.target.value||null;te&&ks("codex",te)},disabled:Qn==="codex",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var te;return o.jsxs("option",{value:C.id,children:[C.name,((te=Fe==null?void 0:Fe.codex)==null?void 0:te.routeId)===C.id?" (已激活)":""]},C.id)})]}),((mw=Fe==null?void 0:Fe.codex)==null?void 0:mw.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Cs("codex"),disabled:Qn==="codex",children:Qn==="codex"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 Codex 代理请求。激活后,/codex/ 路径的请求将使用该路由的规则。"})]}),o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"codex-reasoning-effort",style:{marginBottom:0,minWidth:"120px",whiteSpace:"nowrap"},children:"Reasoning Effort"}),o.jsx("select",{id:"codex-reasoning-effort",value:IF(y),onChange:C=>eD(C.target.value),disabled:Pt,style:{flex:1,minWidth:0},children:UI.map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"该设置会实时写入 ~/.codex/config.toml,重启 Codex 后生效。"}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"codex-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"codex-default-model",type:"text",value:Zl,onChange:C=>{Jl(C.target.value),ws(C.target.value!==((y==null?void 0:y.codexDefaultModel)||""))},onBlur:()=>{hd&&iD()},placeholder:"例如:o1",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置后写入 ~/.codex/config.toml 的 model 字段,重启 Codex 后生效。留空则使用默认值 gpt-5.3-codex。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"codex-max-retries",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"最大重试次数"}),o.jsx("input",{id:"codex-max-retries",type:"number",min:"1",max:"20",value:Ue,onChange:C=>St(C.target.value),onBlur:C=>qm("codexMaxRetries",C.target.value,"Codex"),placeholder:"默认 5",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置 Codex 流式请求的最大重试次数(1-20),写入 ~/.codex/config.toml 的 model_providers.aicodeswitch.stream_max_retries 字段,重启 Codex 后生效。留空则使用默认值 5。"})]}),o.jsxs("div",{style:{marginTop:"20px",marginBottom:"20px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"codex-enable-memories-toggle",checked:!!(y!=null&&y.codexEnableMemories),onChange:async C=>{try{const te=y||{};await V.updateConfig({...te,codexEnableMemories:C.target.checked}),await Zn(),await V.writeCodexConfig(void 0,C.target.checked),K.success("记忆功能设置已保存(重启 Codex 后生效)")}catch(te){K.error("更新失败: "+te.message)}},style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"codex-enable-memories-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启记忆功能"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后会在 ~/.codex/config.toml 中添加 features.memories 和 memories 配置段。"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"OpenCode 全局配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"tool-binding-block",children:[o.jsxs("div",{className:"tool-binding-label",children:[o.jsx("span",{className:"tool-binding-label-icon",children:"⚡"}),"激活路由"]}),o.jsxs("div",{className:"tool-binding-row",children:[o.jsxs("select",{id:"opencode-route-binding",value:((gw=Fe==null?void 0:Fe.opencode)==null?void 0:gw.routeId)||"",onChange:C=>{const te=C.target.value||null;te&&ks("opencode",te)},disabled:Qn==="opencode",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var te;return o.jsxs("option",{value:C.id,children:[C.name,((te=Fe==null?void 0:Fe.opencode)==null?void 0:te.routeId)===C.id?" (已激活)":""]},C.id)})]}),((yw=Fe==null?void 0:Fe.opencode)==null?void 0:yw.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Cs("opencode"),disabled:Qn==="opencode",children:Qn==="opencode"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 OpenCode 代理请求。激活后,/opencode/ 路径的请求将使用该路由的规则。"})]}),o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"opencode-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"opencode-default-model",type:"text",value:st,onChange:C=>{fn(C.target.value),Km(C.target.value!==((y==null?void 0:y.opencodeDefaultModel)||""))},onBlur:()=>{_L&&aD()},placeholder:"例如:claude-sonnet-4-20250514",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置后写入 ~/.config/opencode/opencode.json 的 provider.aicodeswitch 模型映射,重启 OpenCode 后生效。留空则使用默认模型。"}),o.jsxs("div",{className:"form-group",style:{marginTop:"20px",marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"opencode-max-retries",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"最大重试次数"}),o.jsx("input",{id:"opencode-max-retries",type:"number",min:"1",max:"20",value:rn,onChange:C=>yi(C.target.value),onBlur:C=>qm("opencodeMaxRetries",C.target.value,"OpenCode"),placeholder:"默认 5",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置 OpenCode 请求失败时的最大重试次数(1-20),写入 ~/.config/opencode/opencode.json 的 provider.aicodeswitch.options.maxRetries 字段,重启 OpenCode 后生效。留空则使用默认值 5。"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"📝 配置文件自动管理"})}),o.jsxs("div",{style:{padding:"20px",lineHeight:"1.8"},children:[o.jsxs("div",{style:{background:"var(--bg-info-blue)",padding:"15px",borderRadius:"8px",marginBottom:"15px",borderLeft:"4px solid var(--border-info-blue)"},children:[o.jsx("strong",{children:"💡 工作原理"}),o.jsx("p",{style:{marginTop:"8px",marginBottom:"0"},children:"配置文件由服务生命周期统一管理:服务启动时自动写入代理配置,服务停止时自动恢复原始配置;运行中修改全局工具配置会实时写入配置文件。"})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"15px"},children:[o.jsxs("div",{style:{background:"var(--bg-info-green)",padding:"15px",borderRadius:"8px",borderLeft:"4px solid var(--border-info-green)"},children:[o.jsx("strong",{children:"✓ 服务启动"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",marginBottom:"0"},children:[o.jsx("li",{children:"自动备份并覆盖配置文件"}),o.jsx("li",{children:"按全局工具设置写入 Claude/Codex 配置"})]})]}),o.jsxs("div",{style:{background:"var(--bg-info-orange)",padding:"15px",borderRadius:"8px",borderLeft:"4px solid var(--border-info-orange)"},children:[o.jsx("strong",{children:"○ 服务停止"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",marginBottom:"0"},children:[o.jsx("li",{children:"自动恢复原始配置文件"}),o.jsx("li",{children:"删除备份文件"})]})]})]}),o.jsxs("div",{style:{marginTop:"15px",padding:"12px 15px",background:"var(--bg-info-yellow)",borderRadius:"8px",borderLeft:"4px solid var(--border-info-yellow)"},children:[o.jsx("strong",{children:"⚠️ 重要提示"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",marginBottom:"0"},children:[o.jsx("li",{children:"修改路由规则后立即生效;修改全局工具配置后仅需重启对应编程工具(无需重启服务)"}),o.jsx("li",{children:"操作前建议关闭编程工具,避免配置冲突"})]})]}),o.jsxs("details",{style:{marginTop:"15px",cursor:"pointer"},children:[o.jsx("summary",{style:{fontWeight:"bold",color:"#666"},children:"📂 配置文件位置(点击展开)"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",color:"#666"},children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Claude Code:"})," ~/.claude/settings.json, ~/.claude.json"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Codex:"})," ~/.codex/config.toml, ~/.codex/auth.json"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"OpenCode:"})," ~/.config/opencode/opencode.json(写入 provider.aicodeswitch 段,经 @ai-sdk/openai-compatible 指向 /opencode/v1,使用 OpenAI Chat Completions 格式)"]})]})]})]})]}),L&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>O(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:X?"编辑路由":"新建路由"})}),o.jsxs("form",{onSubmit:WL,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"路由名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:X?X.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"描述"}),o.jsx("textarea",{name:"description",rows:3,defaultValue:X?X.description:""})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>O(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),R&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>_(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:I?"编辑规则":"新建规则"})}),o.jsxs("form",{onSubmit:HL,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"对象请求类型"}),o.jsx("select",{name:"contentType",value:ie,required:!0,onChange:C=>{je(C.target.value)},children:sD().map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),ie==="high-iq"&&o.jsxs("div",{style:{background:"var(--bg-info-blue)",padding:"12px",borderRadius:"6px",borderLeft:"4px solid var(--border-info-blue)",marginBottom:"16px"},children:[o.jsx("div",{style:{fontSize:"13px",fontWeight:"bold",marginBottom:"6px"},children:"💡 高智商请求使用方法"}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",lineHeight:"1.6"},children:["在编程工具中输入提示词时:",o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",lineHeight:"1.8"},children:[o.jsxs("li",{children:["使用 ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[!]"})," 标记高智商请求(仅在”最近一条真实用户输入”生效)"]}),o.jsxs("li",{children:["使用 ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[x]"})," 标记退出高智商模式,继续走普通模式"]})]})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"8px",lineHeight:"1.6"},children:[o.jsx("strong",{children:"示例:"}),o.jsx("br",{}),"• ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[!] 重构A模块"}),o.jsx("br",{}),"• ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"继续正常对话(不加 [!])"}),o.jsx("br",{}),"• ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[x] 接下来帮我解决一个简单的问题"})]})]}),ie==="model-mapping"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["被顶替模型 ",o.jsx("small",{children:"(可在日志中找出想要顶替的模型名)"})]}),o.jsx("input",{type:"text",value:E,onChange:C=>me(C.target.value),placeholder:"例如:gpt-4"})]}),ie==="long-context"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["Session累积Tokens阈值 (单位: k) ",o.jsx("small",{children:"默认1000k (1M tokens)"})]}),o.jsx("input",{type:"number",value:Ge??1e3,onChange:C=>nt(Number(C.target.value)),placeholder:"1000",min:"1"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["当前对话(session)的累积tokens数量超过 ",Ge??1e3,"k 时,该对话的新请求将走此规则"]})]}),ie==="image-understanding"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:de,onChange:C=>ve(C.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用MCP"})]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"开启后,将使用MCP工具处理图像理解请求,而不是直接调用API服务"})]}),ie==="image-understanding"&&de&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["选择MCP工具 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("div",{style:{maxHeight:"300px",overflowY:"auto",border:"1px solid var(--border-primary)",borderRadius:"6px",padding:"8px"},children:v.length===0?o.jsx("div",{style:{padding:"12px",textAlign:"center",color:"var(--text-muted)"},children:"暂无MCP工具,请先在MCP管理页面添加"}):v.map(C=>o.jsxs("div",{onClick:()=>Ee(C.id),style:{padding:"12px",marginBottom:"8px",border:`2px solid ${Ae===C.id?"var(--primary-color)":"var(--border-primary)"}`,borderRadius:"6px",cursor:"pointer",backgroundColor:Ae===C.id?"var(--bg-info-blue)":"var(--bg-card)",transition:"all 0.2s ease"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:C.name}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"11px"},children:C.type==="stdio"?"命令行":C.type.toUpperCase()})]}),C.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px"},children:C.description})]},C.id))})]}),!de&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsxs("select",{value:H,onChange:C=>N(C.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择供应商"}),u.map(C=>o.jsx("option",{value:C.id,children:C.name},C.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsxs("select",{value:W,onChange:C=>{const te=C.target.value;P(te),le("");const he=d.find(Te=>Te.id===te);he&&(he.enableTokenLimit&&he.tokenLimit?(re(he.tokenLimit),se(he.tokenResetInterval),ke(he.tokenResetBaseTime?new Date(he.tokenResetBaseTime):void 0),Oe(he.tokenLimit),Se(!0),Je(!0)):(Oe(void 0),Se(!1),Je(!1)),he.enableRequestLimit&&he.requestCountLimit?(pt(he.requestCountLimit),Qe(he.requestResetInterval),tt(he.requestResetBaseTime?new Date(he.requestResetBaseTime):void 0),D(he.requestCountLimit),$e(!0),Kt(!0)):(D(void 0),$e(!1),Kt(!1)))},required:!0,disabled:!H,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择API服务"}),m.map(C=>o.jsx("option",{value:C.id,children:C.name},C.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsxs("select",{value:U,onChange:C=>le(C.target.value),disabled:!W,children:[o.jsx("option",{value:"",children:"透传模型名"}),(xw=(vw=d.find(C=>C.id===W))==null?void 0:vw.supportedModels)==null?void 0:xw.map(C=>o.jsx("option",{value:C,children:C},C))]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:xe?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:at,onChange:C=>Je(C.target.checked),disabled:xe,style:{marginRight:"8px",cursor:xe?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Tokens超量限制"}),xe&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),xe&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>Se(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),at&&!xe&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Tokens超量(单位:k)"}),o.jsx("input",{type:"number",value:Z||"",onChange:C=>{const te=C.target.value?parseInt(C.target.value):void 0;if(te!==void 0&&He!==void 0&&te>He){K.warning(`Token超量值不能超过API服务的限制 (${He}k)`);return}re(te),xe&&te!==He&&Se(!1)},min:"0",max:He,placeholder:He?`最大 ${He}k`:"不限制",disabled:xe}),He&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",He,"k,当前值不能超过此限制"]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"当编程工具的请求tokens达到这个量时,在配置了其他规则的情况下,本条规则将失效,从而保护你的余额。例如:输入100表示100k即100,000个tokens"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Tokens超量自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:pe||"",onChange:C=>{se(C.target.value?parseInt(C.target.value):void 0),xe&&Se(!1)},min:"1",placeholder:"不自动重置",disabled:xe}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置后,系统将每隔指定小时数自动重置token计数。例如设置5小时,则每5小时重置一次"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:Re?WS(Re):"",onChange:C=>{C.target.value?ke(new Date(C.target.value)):ke(void 0),xe&&Se(!1)},disabled:!pe||xe,className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:'配合"Tokens超量自动重置间隔"使用,设置下一次重置的精确时间点。例如,每月1日0点重置(间隔720小时),或每周一0点重置(间隔168小时)。设置后,系统会基于此时间点自动计算后续重置周期'})]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:Le?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:nn,onChange:C=>Kt(C.target.checked),disabled:Le,style:{marginRight:"8px",cursor:Le?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"}),Le&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),Le&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>$e(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),nn&&!Le&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量"}),o.jsx("input",{type:"number",value:Ke||"",onChange:C=>{const te=C.target.value?parseInt(C.target.value):void 0;if(te!==void 0&&Xe!==void 0&&te>Xe){K.warning(`请求次数超量值不能超过API服务的限制 (${Xe})`);return}pt(te),Le&&te!==Xe&&$e(!1)},min:"0",max:Xe,placeholder:Xe?`最大 ${Xe}`:"不限制",disabled:Le}),Xe&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",Xe,",当前值不能超过此限制"]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"当请求次数达到这个量时,在配置了其他规则的情况下,本条规则将失效"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:Ye||"",onChange:C=>{Qe(C.target.value?parseInt(C.target.value):void 0),Le&&$e(!1)},min:"1",placeholder:"不自动重置",disabled:Le}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置后,系统将每隔指定小时数自动重置请求次数计数。例如设置24小时,则每24小时重置一次"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:Ze?WS(Ze):"",onChange:C=>{C.target.value?tt(new Date(C.target.value)):tt(void 0),Le&&$e(!1)},disabled:!Ye||Le,className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:'配合"请求次数自动重置间隔"使用,设置下一次重置的精确时间点。例如,每月1日0点重置(间隔720小时),或每周一0点重置(间隔168小时)。设置后,系统会基于此时间点自动计算后续重置周期'})]})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:!!J,onChange:C=>{C.target.checked?(Y(10),M(0)):(Y(void 0),M(void 0))},style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求频率限制"})]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"启用后,当同一内容类型的请求频率超过限制时,系统会自动切换到其他同类型规则"})]}),J&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制次数(并发数)"}),o.jsx("input",{type:"number",value:J||"",onChange:C=>Y(C.target.value?parseInt(C.target.value):void 0),min:"1",placeholder:"例如: 10"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"在指定时间窗口内允许的最大请求次数"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制时间窗口(秒,0=同一时刻)"}),o.jsx("input",{type:"number",value:ue===0?0:ue||"",onChange:C=>{const te=C.target.value?parseInt(C.target.value):void 0;M(te===0?0:te)},min:"0",placeholder:"0 表示同一时刻"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"时间窗口大小。0 表示同一时刻(并发数),持续累积;设置为 60 则在 60 秒内最多允许 N 次请求"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"超时时间(秒)"}),o.jsx("input",{type:"number",value:ne||"",onChange:C=>De(C.target.value?parseInt(C.target.value):void 0),min:"1",placeholder:y!=null&&y.ruleGlobalTimeout?`全局${y.ruleGlobalTimeout}秒`:"默认300秒"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["设置此规则的API请求超时时间。不设置则使用全局超时配置(当前为",y!=null&&y.ruleGlobalTimeout?`${y.ruleGlobalTimeout}秒`:"默认300秒","),超时后自动触发故障切换"]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"排序(值越大优先级越高)"}),o.jsx("input",{type:"number",value:ye,onChange:C=>Q(parseInt(C.target.value)||0),min:"0",max:"1000"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>_(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),o.jsx(BI,{show:ut,onClose:()=>Ht(!1),onComplete:()=>{Ss(),Hm(),Vm(),vd(),sw()}}),o.jsx(yF,{show:Jt,onClose:()=>It(!1),onComplete:()=>{Hm(),Vm()}}),gd&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:cw,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout",style:{width:"500px",maxWidth:"90vw"},children:[o.jsx("div",{className:"modal-header",children:o.jsxs("h2",{children:["绑定会话 - ",((bw=r.find(C=>C.id===gd))==null?void 0:bw.name)||gd]})}),o.jsxs("div",{className:"modal-body-scrollable",style:{maxHeight:"460px"},children:[LL?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"加载中..."}):js.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:o.jsx("p",{children:"暂无绑定会话"})}):o.jsxs("div",{style:{marginBottom:"12px",fontSize:"13px",color:"var(--text-tertiary)"},children:["以下 ",js.length," 个会话绑定了此路由:"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[js.slice(0,50).map((C,te)=>{var he;return o.jsxs("div",{style:{padding:"12px 0",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",borderBottom:te===Math.min(js.length,50)-1?"none":"1px solid var(--border-color)"},children:[o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("div",{style:{fontWeight:500,fontSize:"14px",marginBottom:"4px"},children:((he=C.title)==null?void 0:he.replace(/<\/?session>/g,"").trim())||C.id.slice(0,8)}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{className:`badge ${C.targetType==="claude-code"?"badge-claude-code":C.targetType==="opencode"?"badge-opencode":"badge-codex"}`,style:{fontSize:"11px"},children:C.targetType==="claude-code"?"Claude Code":C.targetType==="opencode"?"OpenCode":"Codex"}),o.jsxs("span",{children:[C.requestCount," 次请求"]}),o.jsxs("span",{children:[C.totalTokens.toLocaleString()," tokens"]})]})]}),o.jsx("button",{type:"button",className:"btn btn-danger",style:{flexShrink:0,padding:"4px 12px",fontSize:"12px"},disabled:aw===C.id,onClick:Te=>{Te.stopPropagation(),BL(C.id)},children:aw===C.id?"解绑中...":"解绑"})]},C.id)}),js.length>50&&o.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:"var(--text-tertiary)",padding:"8px"},children:["等共 ",js.length," 个会话"]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:cw,children:"关闭"})]})]})]})]})}var KI={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ml,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",s="second",l="minute",c="hour",u="day",p="week",d="month",h="quarter",m="year",g="date",v="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(q){var I=["th","st","nd","rd"],$=q%100;return"["+q+(I[($-20)%10]||I[$]||I[0])+"]"}},w=function(q,I,$){var H=String(q);return!H||H.length>=I?q:""+Array(I+1-H.length).join($)+q},j={s:w,z:function(q){var I=-q.utcOffset(),$=Math.abs(I),H=Math.floor($/60),N=$%60;return(I<=0?"+":"-")+w(H,2,"0")+":"+w(N,2,"0")},m:function q(I,$){if(I.date()<$.date())return-q($,I);var H=12*($.year()-I.year())+($.month()-I.month()),N=I.clone().add(H,d),W=$-N<0,P=I.clone().add(H+(W?-1:1),d);return+(-(H+($-N)/(W?N-P:P-N))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:d,y:m,w:p,d:u,D:g,h:c,m:l,s,ms:a,Q:h}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},k="en",S={};S[k]=b;var A="$isDayjsObject",T=function(q){return q instanceof _||!(!q||!q[A])},L=function q(I,$,H){var N;if(!I)return k;if(typeof I=="string"){var W=I.toLowerCase();S[W]&&(N=W),$&&(S[W]=$,N=W);var P=I.split("-");if(!N&&P.length>1)return q(P[0])}else{var U=I.name;S[U]=I,N=U}return!H&&N&&(k=N),N||!H&&k},O=function(q,I){if(T(q))return q.clone();var $=typeof I=="object"?I:{};return $.date=q,$.args=arguments,new _($)},R=j;R.l=L,R.i=T,R.w=function(q,I){return O(q,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var _=function(){function q($){this.$L=L($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[A]=!0}var I=q.prototype;return I.parse=function($){this.$d=function(H){var N=H.date,W=H.utc;if(N===null)return new Date(NaN);if(R.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var P=N.match(x);if(P){var U=P[2]-1||0,le=(P[7]||"0").substring(0,3);return W?new Date(Date.UTC(P[1],U,P[3]||1,P[4]||0,P[5]||0,P[6]||0,le)):new Date(P[1],U,P[3]||1,P[4]||0,P[5]||0,P[6]||0,le)}}return new Date(N)}($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return R},I.isValid=function(){return this.$d.toString()!==v},I.isSame=function($,H){var N=O($);return this.startOf(H)<=N&&N<=this.endOf(H)},I.isAfter=function($,H){return O($)<this.startOf(H)},I.isBefore=function($,H){return this.endOf(H)<O($)},I.$g=function($,H,N){return R.u($)?this[H]:this.set(N,$)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function($,H){var N=this,W=!!R.u(H)||H,P=R.p($),U=function(Z,re){var pe=R.w(N.$u?Date.UTC(N.$y,re,Z):new Date(N.$y,re,Z),N);return W?pe:pe.endOf(u)},le=function(Z,re){return R.w(N.toDate()[Z].apply(N.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(re)),N)},E=this.$W,me=this.$M,ye=this.$D,Q="set"+(this.$u?"UTC":"");switch(P){case m:return W?U(1,0):U(31,11);case d:return W?U(1,me):U(0,me+1);case p:var ie=this.$locale().weekStart||0,je=(E<ie?E+7:E)-ie;return U(W?ye-je:ye+(6-je),me);case u:case g:return le(Q+"Hours",0);case c:return le(Q+"Minutes",1);case l:return le(Q+"Seconds",2);case s:return le(Q+"Milliseconds",3);default:return this.clone()}},I.endOf=function($){return this.startOf($,!1)},I.$set=function($,H){var N,W=R.p($),P="set"+(this.$u?"UTC":""),U=(N={},N[u]=P+"Date",N[g]=P+"Date",N[d]=P+"Month",N[m]=P+"FullYear",N[c]=P+"Hours",N[l]=P+"Minutes",N[s]=P+"Seconds",N[a]=P+"Milliseconds",N)[W],le=W===u?this.$D+(H-this.$W):H;if(W===d||W===m){var E=this.clone().set(g,1);E.$d[U](le),E.init(),this.$d=E.set(g,Math.min(this.$D,E.daysInMonth())).$d}else U&&this.$d[U](le);return this.init(),this},I.set=function($,H){return this.clone().$set($,H)},I.get=function($){return this[R.p($)]()},I.add=function($,H){var N,W=this;$=Number($);var P=R.p(H),U=function(me){var ye=O(W);return R.w(ye.date(ye.date()+Math.round(me*$)),W)};if(P===d)return this.set(d,this.$M+$);if(P===m)return this.set(m,this.$y+$);if(P===u)return U(1);if(P===p)return U(7);var le=(N={},N[l]=r,N[c]=i,N[s]=n,N)[P]||1,E=this.$d.getTime()+$*le;return R.w(E,this)},I.subtract=function($,H){return this.add(-1*$,H)},I.format=function($){var H=this,N=this.$locale();if(!this.isValid())return N.invalidDate||v;var W=$||"YYYY-MM-DDTHH:mm:ssZ",P=R.z(this),U=this.$H,le=this.$m,E=this.$M,me=N.weekdays,ye=N.months,Q=N.meridiem,ie=function(re,pe,se,Re){return re&&(re[pe]||re(H,W))||se[pe].slice(0,Re)},je=function(re){return R.s(U%12||12,re,"0")},Z=Q||function(re,pe,se){var Re=re<12?"AM":"PM";return se?Re.toLowerCase():Re};return W.replace(y,function(re,pe){return pe||function(se){switch(se){case"YY":return String(H.$y).slice(-2);case"YYYY":return R.s(H.$y,4,"0");case"M":return E+1;case"MM":return R.s(E+1,2,"0");case"MMM":return ie(N.monthsShort,E,ye,3);case"MMMM":return ie(ye,E);case"D":return H.$D;case"DD":return R.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return ie(N.weekdaysMin,H.$W,me,2);case"ddd":return ie(N.weekdaysShort,H.$W,me,3);case"dddd":return me[H.$W];case"H":return String(U);case"HH":return R.s(U,2,"0");case"h":return je(1);case"hh":return je(2);case"a":return Z(U,le,!0);case"A":return Z(U,le,!1);case"m":return String(le);case"mm":return R.s(le,2,"0");case"s":return String(H.$s);case"ss":return R.s(H.$s,2,"0");case"SSS":return R.s(H.$ms,3,"0");case"Z":return P}return null}(re)||P.replace(":","")})},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function($,H,N){var W,P=this,U=R.p(H),le=O($),E=(le.utcOffset()-this.utcOffset())*r,me=this-le,ye=function(){return R.m(P,le)};switch(U){case m:W=ye()/12;break;case d:W=ye();break;case h:W=ye()/3;break;case p:W=(me-E)/6048e5;break;case u:W=(me-E)/864e5;break;case c:W=me/i;break;case l:W=me/r;break;case s:W=me/n;break;default:W=me}return N?W:R.a(W)},I.daysInMonth=function(){return this.endOf(d).$D},I.$locale=function(){return S[this.$L]},I.locale=function($,H){if(!$)return this.$L;var N=this.clone(),W=L($,H,!0);return W&&(N.$L=W),N},I.clone=function(){return R.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},q}(),X=_.prototype;return O.prototype=X,[["$ms",a],["$s",s],["$m",l],["$H",c],["$W",u],["$M",d],["$y",m],["$D",g]].forEach(function(q){X[q[1]]=function(I){return this.$g(I,q[0],q[1])}}),O.extend=function(q,I){return q.$i||(q(I,_,O),q.$i=!0),O},O.locale=L,O.isDayjs=T,O.unix=function(q){return O(1e3*q)},O.en=S[k],O.Ls=S,O.p={},O})})(KI);var MF=KI.exports;const wt=Rl(MF);var HI={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ml,function(){return function(n,r,i){n=n||{};var a=r.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(u,p,d,h){return a.fromToBase(u,p,d,h)}i.en.relativeTime=s,a.fromToBase=function(u,p,d,h,m){for(var g,v,x,y=d.$locale().relativeTime||s,b=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],w=b.length,j=0;j<w;j+=1){var k=b[j];k.d&&(g=h?i(u).diff(d,k.d,!0):d.diff(u,k.d,!0));var S=(n.rounding||Math.round)(Math.abs(g));if(x=g>0,S<=k.r||!k.r){S<=1&&j>0&&(k=b[j-1]);var A=y[k.l];m&&(S=m(""+S)),v=typeof A=="string"?A.replace("%d",S):A(S,p,k.l,x);break}}if(p)return v;var T=x?y.future:y.past;return typeof T=="function"?T(v):T.replace("%s",v)},a.to=function(u,p){return l(u,p,this,!0)},a.from=function(u,p){return l(u,p,this)};var c=function(u){return u.$u?i.utc():i()};a.toNow=function(u){return this.to(c(this),u)},a.fromNow=function(u){return this.from(c(this),u)}}})})(HI);var RF=HI.exports;const V0=Rl(RF),yu=({currentPage:e,totalItems:t,pageSize:n,onPageChange:r,onPageSizeChange:i,pageSizeOptions:a=[10,20,50,100]})=>{const s=Math.max(1,Math.ceil(t/n)),l=e===1,c=e>=s,u=()=>{l||r(1)},p=()=>{l||r(e-1)},d=()=>{c||r(e+1)},h=()=>{c||r(s)},m=g=>{const v=parseInt(g.target.value,10);i(v)};return o.jsxs("div",{className:"pagination",children:[o.jsxs("div",{className:"pagination-info",children:["共 ",t," 条"]}),o.jsxs("div",{className:"pagination-controls",children:[o.jsx("button",{className:"pagination-btn",onClick:u,disabled:l,children:"首页"}),o.jsx("button",{className:"pagination-btn",onClick:p,disabled:l,children:"上一页"}),o.jsxs("span",{className:"pagination-info",children:["第 ",e," / ",s," 页"]}),o.jsx("button",{className:"pagination-btn",onClick:d,disabled:c,children:"下一页"}),o.jsx("button",{className:"pagination-btn",onClick:h,disabled:c,children:"尾页"})]}),o.jsx("div",{className:"pagination-size",children:o.jsxs("label",{children:["每页显示",o.jsx("select",{className:"pagination-select",value:n,onChange:m,children:a.map(g=>o.jsx("option",{value:g,children:g},g))}),"条"]})})]})},_F=["authorization","x-api-key","api-key","apikey","x-auth-token","auth-token","secret","password","api_secret","jwt","csrf_token","xsrf_token","auth_token","session_token","private_key","client_secret"],LF=e=>{const t=e.toLowerCase();return!!(_F.some(n=>t===n)||t.startsWith("api_")&&(t.endsWith("_key")||t.endsWith("_secret"))||(t.endsWith("_token")||t.endsWith("_key")||t.endsWith("_secret"))&&!["max_tokens","input_tokens","output_tokens","completion_tokens","prompt_tokens","cachereadinputtokens","totaltokens"].some(r=>t.replace(/_/g,"").includes(r.replace(/_/g,""))))},DF=e=>!e||e.length<=8?"***":`${e.slice(0,4)}${"*".repeat(Math.min(e.length-8,20))}${e.slice(-4)}`,Iv=e=>{if(e==null)return e;if(Array.isArray(e))return e.map(t=>Iv(t));if(typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))LF(n)?t[n]=typeof r=="string"?DF(r):"***":typeof r=="object"?t[n]=Iv(r):t[n]=r;return t}return e},zr=({data:e,title:t,collapsed:n=!1})=>{const[r,i]=f.useState(!n),[a,s]=f.useState(!1),l=p=>{try{let d;typeof p=="string"?d=JSON.parse(p):d=p;const h=Iv(d);return JSON.stringify(h,null,2)}catch{return typeof p=="string"?p:String(p)}},c=()=>{const p=l(e);navigator.clipboard.writeText(p).then(()=>{s(!0),setTimeout(()=>s(!1),2e3)}).catch(d=>{console.error("Failed to copy JSON:",d)})},u=l(e);return o.jsxs("div",{className:"json-viewer",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[t&&o.jsx("h4",{style:{margin:0,fontSize:"14px",color:"var(--text-primary)"},children:t}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[o.jsx("button",{onClick:()=>i(!r),className:"btn btn-sm btn-secondary",style:{fontSize:"12px",padding:"2px 8px"},children:r?"折叠":"展开"}),o.jsx("button",{onClick:c,className:"btn btn-sm btn-primary",style:{fontSize:"12px",padding:"2px 8px"},children:a?"已复制":"复制"})]})]}),r&&o.jsx("pre",{style:{background:"var(--bg-code)",border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"12px",overflowX:"auto",fontSize:"12px",lineHeight:"1.4",color:"var(--text-primary)",maxHeight:"400px",overflowY:"auto",margin:0},children:o.jsx("code",{children:u})})]})};function Bu(e){const t=e.split(`
110
+ `).map(r=>r.trim()).join(`
111
+ `).split(`
112
+
113
+ `).filter(r=>r.trim()),n=[];for(const r of t){let i="",a=[],s=0;r.split(`
114
+ `).forEach(p=>{if(/^[a-z]+:/.test(p)){const d=p.indexOf(":"),h=p.slice(0,d).trim(),m=p.slice(d+1).trim();h==="event"?i=m:h==="data"?(a.push(m),s=1):a.length&&(s=-1)}else s===1&&a.push(p)});const c=a.length>0?a.join(`
115
+ `).trim():void 0;let u;if(c)try{u=JSON.parse(c)}catch{u=c}n.push({event:i,data:u,raw:r})}return n}function Fu(e,t){var l,c;let n="",r="",i=!1,a=!1,s=!1;for(const u of e){const p=u.data;if(p){if(u.event==="content_block_start"&&p.content_block){const d=p.content_block.type;d==="thinking"?i=!0:d==="text"&&(a=!0);continue}if(u.event==="content_block_stop"){i=!1,a=!1;continue}if(u.event==="content_block_delta"&&p.delta){p.delta.type==="text_delta"&&a?n+=p.delta.text||"":p.delta.type==="thinking_delta"&&i&&(r+=p.delta.thinking||"");continue}if(u.event==="response.reasoning_text.delta"&&p.delta!==void 0){r+=p.delta||"",s=!0;continue}if(u.event==="response.content_part.done"&&p.part){const d=p.part;d.type==="reasoning_text"&&d.text?s||(r=d.text):d.type==="output_text"&&d.text&&(n+=d.text);continue}if(!u.event&&p.choices){const d=(c=(l=p.choices)==null?void 0:l[0])==null?void 0:c.delta;d&&(typeof d.content=="string"&&(n+=d.content),d.thinking&&typeof d.thinking.content=="string"&&(r+=d.thinking.content));continue}(p.reasoning_content||p.thinking)&&(r+=p.reasoning_content||p.thinking||"")}}return{text:n,thinking:r}}function zF(e,t){if(!e||e.length===0)return{text:"",thinking:""};const n=Bu(e);return Fu(n)}function VI(e){var t,n;if(console.log("[assembleResponseBody] log:",{id:e.id,hasResponseBody:!!e.responseBody,responseBodyLength:(t=e.responseBody)==null?void 0:t.length,hasStreamChunks:!!e.streamChunks,streamChunksLength:(n=e.streamChunks)==null?void 0:n.length,targetType:e.targetType}),e.responseBody)try{const r=JSON.parse(e.responseBody);return console.log("[assembleResponseBody] returning parsed responseBody"),r}catch{return console.log("[assembleResponseBody] returning raw responseBody (parse failed)"),e.responseBody}if(e.streamChunks&&e.streamChunks.length>0){console.log("[assembleResponseBody] processing streamChunks:",e.streamChunks.length);const{text:r,thinking:i}=zF(e.downstreamResponseBody,e.targetType);if(console.log("[assembleResponseBody] assembled text:",{textLength:r.length,thinkingLength:i.length}),e.targetType==="claude-code"){const s=[];i&&s.push({type:"thinking",thinking:i}),r&&s.push({type:"text",text:r}),s.length===0&&s.push({type:"text",text:"(空内容 - 可能响应未完成或解析失败)"});const l={type:"message",role:"assistant",content:s,model:e.targetModel||e.requestModel,usage:e.usage};return console.log("[assembleResponseBody] returning claude-code format with",s.length,"content blocks"),l}else if(e.targetType==="codex"){const s={id:e.id,object:"chat.completion",created:Math.floor(e.timestamp/1e3),model:e.targetModel||e.requestModel,choices:[{index:0,message:{role:"assistant",content:r||i||"(空内容 - 可能响应未完成或解析失败)"},finish_reason:"stop"}],usage:e.usage};return console.log("[assembleResponseBody] returning codex format"),s}const a={content:r||i||"(空内容 - 可能响应未完成或解析失败)",usage:e.usage};return console.log("[assembleResponseBody] returning generic format"),a}return console.log("[assembleResponseBody] no responseBody or streamChunks, returning null"),null}function $F(e){const t=[];t.push(`# 请求日志详情
116
+ `),t.push("## 基本信息"),t.push(`- **日志ID**: ${e.id}`),t.push(`- **时间**: ${wt(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${kl[e.targetType]||"-"}`),e.tags&&e.tags.length>0&&t.push(`- **标签**: ${e.tags.join(", ")}`),t.push(""),t.push("## 模型信息"),e.requestModel&&t.push(`- **请求模型**: ${e.requestModel}`),e.vendorName&&t.push(`- **供应商**: ${e.vendorName}`),e.targetServiceName&&t.push(`- **供应商API服务**: ${e.targetServiceName}`),e.targetModel&&t.push(`- **供应商模型**: ${e.targetModel}`),t.push(""),t.push("## 请求信息"),t.push(`- **请求方法**: ${e.method}`),t.push(`- **请求路径**: ${e.path}`),t.push(""),e.headers&&(t.push("## 请求头"),t.push("```json"),t.push(JSON.stringify(e.headers,null,2)),t.push("```\n")),e.body&&(t.push("## 请求体"),t.push("```json"),t.push(JSON.stringify(e.body,null,2)),t.push("```\n")),e.upstreamRequest&&(t.push("## 实际转发的请求信息"),t.push("```json"),t.push(JSON.stringify(e.upstreamRequest,null,2)),t.push("```\n")),t.push("## 响应信息"),t.push(`- **状态码**: ${e.statusCode||"Error"}`),t.push(`- **响应时间**: ${e.responseTime?`${e.responseTime}ms`:"-"}`),t.push(""),e.responseHeaders&&(t.push("## 响应头"),t.push("```json"),t.push(JSON.stringify(e.responseHeaders,null,2)),t.push("```\n"));const n=VI(e);if(n&&(t.push("## 响应体"),t.push("```json"),t.push(JSON.stringify(n,null,2)),t.push("```\n")),e.usage&&(t.push("## Token 使用"),t.push(`- **输入**: ${e.usage.inputTokens}`),t.push(`- **输出**: ${e.usage.outputTokens}`),e.usage.totalTokens!==void 0&&t.push(`- **总计**: ${e.usage.totalTokens}`),e.usage.cacheReadInputTokens!==void 0&&t.push(`- **缓存读取**: ${e.usage.cacheReadInputTokens}`),t.push("")),e.error&&(t.push("## 错误信息"),t.push("```"),t.push(e.error),t.push("```\n")),e.downstreamResponseBody&&(t.push("## 实际转发的响应体"),t.push("```json"),t.push(typeof e.downstreamResponseBody=="string"?e.downstreamResponseBody:JSON.stringify(e.downstreamResponseBody,null,2)),t.push("```\n"),typeof e.downstreamResponseBody=="string"&&(e.downstreamResponseBody.includes("event:")||e.downstreamResponseBody.includes("data:")))){const r=Bu(e.downstreamResponseBody),{text:i,thinking:a}=Fu(r);a&&(t.push(`## 思考内容 (${a.length} 字符)`),t.push("```"),t.push(a),t.push("```\n")),i&&(t.push(`## 回复内容 (${i.length} 字符)`),t.push("```"),t.push(i),t.push("```\n"))}return t.join(`
117
+ `)}function BF(e){const t=[];return t.push(`# 错误日志详情
118
+ `),t.push("## 基本信息"),t.push(`- **ID**: ${e.id}`),t.push(`- **时间**: ${wt(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${kl[e.targetType]||"-"}`),e.tags&&e.tags.length>0&&t.push(`- **标签**: ${e.tags.join(", ")}`),t.push(""),t.push("## 模型信息"),e.requestModel&&t.push(`- **请求模型**: ${e.requestModel}`),e.vendorName&&t.push(`- **供应商**: ${e.vendorName}`),e.targetServiceName&&t.push(`- **供应商API服务**: ${e.targetServiceName}`),e.targetModel&&t.push(`- **供应商模型**: ${e.targetModel}`),t.push(""),t.push("## 请求信息"),t.push(`- **请求方法**: ${e.method}`),t.push(`- **请求路径**: ${e.path}`),t.push(""),e.requestHeaders&&(t.push("## 请求头"),t.push("```json"),t.push(JSON.stringify(e.requestHeaders,null,2)),t.push("```\n")),e.requestBody&&(t.push("## 请求体"),t.push("```json"),t.push(JSON.stringify(e.requestBody,null,2)),t.push("```\n")),e.upstreamRequest&&(t.push("## 实际转发的请求信息"),t.push("```json"),t.push(JSON.stringify(e.upstreamRequest,null,2)),t.push("```\n")),t.push("## 错误信息"),t.push("```"),t.push(e.errorMessage),t.push("```\n"),e.errorStack&&(t.push("## 错误堆栈"),t.push("```"),t.push(e.errorStack),t.push("```\n")),t.push("## 响应信息"),t.push(`- **状态码**: ${e.statusCode||"-"}`),t.push(`- **响应时间**: ${e.responseTime?`${e.responseTime}ms`:"-"}`),t.push(""),e.responseHeaders&&(t.push("## 响应头"),t.push("```json"),t.push(JSON.stringify(e.responseHeaders,null,2)),t.push("```\n")),e.responseBody&&(t.push("## 响应体"),t.push("```json"),t.push(JSON.stringify(e.responseBody,null,2)),t.push("```\n")),t.join(`
119
+ `)}const FF=1e6;function UF(e){return"errorMessage"in e}function WF({events:e}){const{text:t,thinking:n}=Fu(e);return console.log("AssembledTextViewFromDownstream",{text:t,thinking:n}),!t&&!n?o.jsx("div",{style:{color:"#7f8c8d",fontStyle:"italic"},children:"无法解析出文本内容"}):o.jsxs("div",{className:"assembled-text-view",children:[n&&o.jsxs("details",{style:{marginBottom:"15px",border:"1px solid var(--border-thinking-box)",borderRadius:"8px",padding:"10px",backgroundColor:"var(--bg-thinking-box)"},open:!0,children:[o.jsxs("summary",{style:{cursor:"pointer",fontWeight:"bold",color:"var(--text-thinking-title)",userSelect:"none"},children:["思考内容 (",n.length," 字符)"]}),o.jsx("pre",{style:{marginTop:"10px",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"monospace",fontSize:"13px",color:"var(--text-thinking-content)",backgroundColor:"var(--bg-thinking-content)",padding:"10px",borderRadius:"4px",border:"1px solid var(--border-thinking-content)"},children:n})]}),t&&o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:"bold",marginBottom:"8px",color:"var(--text-reply-title)"},children:["回复内容 (",t.length," 字符)"]}),o.jsx("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"monospace",fontSize:"13px",color:"var(--text-reply-content)",backgroundColor:"var(--bg-reply-content)",padding:"10px",borderRadius:"4px",border:"1px solid var(--border-reply-content)"},children:t})]})]})}function KF({log:e}){const[t,n]=f.useState(!1),[r,i]=f.useState(!0);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"日志ID"}),o.jsx("input",{type:"text",value:e.id,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"时间"}),o.jsx("input",{type:"text",value:wt(e.timestamp).format("YYYY-MM-DD HH:mm:ss"),readOnly:!0})]}),e.targetType&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"客户端类型"}),o.jsx("input",{type:"text",value:kl[e.targetType]||"-",readOnly:!0})]}),e.tags&&e.tags.length>0&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"标签"}),o.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginTop:"8px"},children:e.tags.map((a,s)=>o.jsx("span",{style:{padding:"4px 12px",backgroundColor:"#3498db",color:"white",borderRadius:"12px",fontSize:"13px",fontWeight:"500"},children:a},s))})]}),e.requestModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求模型"}),o.jsx("input",{type:"text",value:e.requestModel,readOnly:!0})]}),e.vendorName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx("input",{type:"text",value:e.vendorName,readOnly:!0})]}),e.targetServiceName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsx("input",{type:"text",value:e.targetServiceName,readOnly:!0})]}),e.targetModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsx("input",{type:"text",value:e.targetModel,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求方法"}),o.jsx("input",{type:"text",value:e.method,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求路径"}),o.jsx("input",{type:"text",value:e.path,readOnly:!0})]}),e.headers&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求头"}),o.jsx(zr,{data:e.headers,collapsed:!0})]}),e.body&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(zr,{data:e.body,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(zr,{data:e.upstreamRequest})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"状态码"}),o.jsx("input",{type:"text",value:e.statusCode||"Error",readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应时间"}),o.jsx("input",{type:"text",value:e.responseTime?`${e.responseTime}ms`:"-",readOnly:!0})]}),e.responseHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应头"}),o.jsx(zr,{data:e.responseHeaders,collapsed:!0})]}),(()=>{const a=VI(e);return a?o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(zr,{data:a})]}):o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsxs("div",{style:{padding:"10px",color:"#7f8c8d",fontStyle:"italic"},children:["无响应体数据",e.streamChunks===void 0&&e.responseBody===void 0&&o.jsx("div",{style:{marginTop:"5px",fontSize:"12px",color:"#e74c3c"},children:"⚠️ 该日志不包含响应数据(可能是旧版本记录)"})]})]})})(),e.usage&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token 使用"}),o.jsx("textarea",{rows:4,value:`输入: ${e.usage.inputTokens}
120
+ 输出: ${e.usage.outputTokens}
121
+ `+(e.usage.totalTokens!==void 0?`总计: ${e.usage.totalTokens}
122
+ `:"")+(e.usage.cacheReadInputTokens!==void 0?`缓存读取: ${e.usage.cacheReadInputTokens}`:""),readOnly:!0})]}),e.error&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"错误信息"}),o.jsx("textarea",{rows:4,value:e.error,readOnly:!0,style:{color:"red"}})]}),e.downstreamResponseBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的响应体"}),o.jsx(zr,{data:e.downstreamResponseBody,collapsed:!0})]}),(()=>{const a=e.downstreamResponseBody;if(!a||!(typeof a=="string"&&(a.includes("event:")||a.includes("data:"))))return null;const l=Bu(a);return o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["Stream Events (",l.length,"个)",o.jsx("button",{onClick:()=>n(!t),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},className:"btn btn-sm btn-secondary",children:t?"折叠":"展开"}),o.jsx("button",{onClick:()=>i(!r),style:{marginLeft:"5px",padding:"2px 8px",fontSize:"12px"},className:"btn btn-sm btn-primary",children:r?"隐藏拼装结果":"查看拼装结果"})]}),t&&o.jsx("div",{style:{maxHeight:"400px",overflowY:"auto",border:"1px solid #ddd",padding:"10px",borderRadius:"4px"},children:l.map((c,u)=>o.jsxs("div",{style:{marginBottom:"10px"},children:[o.jsxs("div",{style:{fontWeight:"bold",fontSize:"12px",color:"#7f8c8d",marginBottom:"4px"},children:["Event #",u+1," ",c.event&&`[${c.event}]`]}),o.jsx(zr,{data:c.data||c.raw,collapsed:!0})]},u))}),r&&o.jsx("div",{style:{marginTop:"10px",maxHeight:"400px",overflowY:"auto",border:"1px solid var(--border-secondary)",padding:"10px",borderRadius:"4px",backgroundColor:"var(--bg-assembled-text)"},children:o.jsx(WF,{events:l})})]})})()]})}function HF({log:e}){return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"ID"}),o.jsx("input",{type:"text",value:e.id,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"时间"}),o.jsx("input",{type:"text",value:wt(e.timestamp).format("YYYY-MM-DD HH:mm:ss"),readOnly:!0})]}),e.targetType&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"客户端类型"}),o.jsx("input",{type:"text",value:kl[e.targetType]||"-",readOnly:!0})]}),e.tags&&e.tags.length>0&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"标签"}),o.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginTop:"8px"},children:e.tags.map((t,n)=>o.jsx("span",{style:{padding:"4px 12px",backgroundColor:"#3498db",color:"white",borderRadius:"12px",fontSize:"13px",fontWeight:"500"},children:t},n))})]}),e.requestModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求模型"}),o.jsx("input",{type:"text",value:e.requestModel,readOnly:!0})]}),e.vendorName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx("input",{type:"text",value:e.vendorName,readOnly:!0})]}),e.targetServiceName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsx("input",{type:"text",value:e.targetServiceName,readOnly:!0})]}),e.targetModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsx("input",{type:"text",value:e.targetModel,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求方法"}),o.jsx("input",{type:"text",value:e.method,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求路径"}),o.jsx("input",{type:"text",value:e.path,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"状态码"}),o.jsx("input",{type:"text",value:e.statusCode||"-",readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应时间"}),o.jsx("input",{type:"text",value:e.responseTime?`${e.responseTime}ms`:"-",readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"错误信息"}),o.jsx("textarea",{rows:4,value:e.errorMessage,readOnly:!0,style:{color:"#e74c3c"}})]}),e.errorStack&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"错误堆栈"}),o.jsx("textarea",{rows:8,value:e.errorStack,readOnly:!0,style:{fontSize:"12px",color:"#7f8c8d"}})]}),e.requestHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求头"}),o.jsx(zr,{data:e.requestHeaders,collapsed:!0})]}),e.requestBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(zr,{data:e.requestBody,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(zr,{data:e.upstreamRequest})]}),e.responseHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应头"}),o.jsx(zr,{data:e.responseHeaders,collapsed:!0})]}),e.responseBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(zr,{data:e.responseBody})]})]})}function uf({log:e,onClose:t,zIndex:n}){const r=n??FF,i=UF(e),a=()=>{const s=i?BF(e):$F(e);navigator.clipboard.writeText(s).then(()=>{K.success("复制成功")}).catch(()=>{K.error("复制失败")})};return o.jsxs("div",{className:"modal-overlay",style:{zIndex:r},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",style:{zIndex:r+1},children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout",style:{width:"800px",zIndex:r},children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:i?"错误日志详情":"请求详情"})}),o.jsx("div",{className:"modal-body-scrollable",children:i?o.jsx(HF,{log:e}):o.jsx(KF,{log:e})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:a,children:"复制"}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"关闭"})]})]})]})}const VF=!1;wt.extend(V0);function qF(){const{confirm:e}=$u(),[t,n]=f.useState("request"),[r,i]=f.useState([]),[a,s]=f.useState([]),[l,c]=f.useState(null),[u,p]=f.useState(null),[d,h]=f.useState(1),[m,g]=f.useState(20),[v,x]=f.useState(0),[y,b]=f.useState(1),[w,j]=f.useState(20),[k,S]=f.useState(0),[A,T]=f.useState(0),[L,O]=f.useState(0),[R,_]=f.useState(!1),[X,q]=f.useState(!1),[I,$]=f.useState(10),[H,N]=f.useState([]),[W,P]=f.useState([]),[U,le]=f.useState([]),[E,me]=f.useState(""),[ye,Q]=f.useState(""),[ie,je]=f.useState(""),[Z,re]=f.useState(""),[pe,se]=f.useState(""),[Re,ke]=f.useState(""),[ne,De]=f.useState(""),[qe,ze]=f.useState(""),[Ke,pt]=f.useState(""),Ye=f.useRef({activeTab:t,requestLogsPage:d,requestLogsPageSize:m,errorLogsPage:y,errorLogsPageSize:w,appliedSearchQuery:ne,appliedErrorSearchQuery:Ke,filterTargetType:E,filterVendorId:ye,filterServiceId:ie,filterModel:Z,filterRouteId:pe});Ye.current={activeTab:t,requestLogsPage:d,requestLogsPageSize:m,errorLogsPage:y,errorLogsPageSize:w,appliedSearchQuery:ne,appliedErrorSearchQuery:Ke,filterTargetType:E,filterVendorId:ye,filterServiceId:ie,filterModel:Z,filterRouteId:pe},f.useEffect(()=>{tt()},[t,d,m,y,w,ne,Ke,E,ye,ie,Z,pe]),f.useEffect(()=>{Qe(),Ze()},[]),f.useEffect(()=>{let ce=null,_t=null;return X&&(_t=setInterval(()=>{$(Tn=>Tn<=1?10:Tn-1)},1e3),ce=setInterval(()=>{tt(),Ze()},1e4)),()=>{ce&&clearInterval(ce),_t&&clearInterval(_t)}},[X,t,d,m,y,w]);const Qe=async()=>{try{const[ce,_t,Tn]=await Promise.all([V.getVendors(),V.getAPIServices(),V.getRoutes()]);N(ce),P(_t),le(Tn)}catch(ce){console.error("Failed to load filter options:",ce)}},Ze=async()=>{try{const[ce,_t]=await Promise.all([V.getLogsCount(),V.getErrorLogsCount()]);T(ce.count),O(_t.count)}catch(ce){console.error("Failed to load badge counts:",ce)}},tt=async()=>{const ce=Ye.current,_t={targetType:ce.filterTargetType||void 0,vendorId:ce.filterVendorId||void 0,serviceId:ce.filterServiceId||void 0,model:ce.filterModel||void 0,routeId:ce.filterRouteId||void 0};_(!0);try{if(ce.activeTab==="request"){const Tn=(ce.requestLogsPage-1)*ce.requestLogsPageSize,cr=await V.queryLogs({filters:_t,keyword:ce.appliedSearchQuery.trim()||void 0,limit:ce.requestLogsPageSize,offset:Tn});i(cr.logs),x(cr.total)}else if(ce.activeTab==="error"){const Tn=(ce.errorLogsPage-1)*ce.errorLogsPageSize,cr=await V.queryErrorLogs({filters:_t,keyword:ce.appliedErrorSearchQuery.trim()||void 0,limit:ce.errorLogsPageSize,offset:Tn});s(cr.logs),S(cr.total)}}catch(Tn){console.error("Failed to load logs:",Tn)}finally{_(!1)}},J=ce=>ce?ce>=200&&ce<300?"badge-success":ce>=400&&ce<500?"badge-warning":"badge-danger":"badge-danger",Y=ce=>{Q(ce),je(""),re(""),h(1),b(1)},ue=ce=>{je(ce),re(""),h(1),b(1)},M=()=>{h(1),b(1)},fe=ce=>{me(ce),M()},ee=ce=>{re(ce),M()},xe=ce=>{se(ce),M()},Se=()=>{me(""),Q(""),je(""),re(""),se(""),ke(""),De(""),ze(""),pt(""),M()},Le=()=>{ke(""),De(""),h(1)},$e=()=>{ze(""),pt(""),b(1)},He=()=>ye?W.filter(ce=>ce.vendorId===ye):[],Oe=()=>{var ce;return ie?((ce=W.find(_t=>_t.id===ie))==null?void 0:ce.supportedModels)||[]:[]},Xe=!!(E||ye||ie||Z||pe||ne||Ke),D=ce=>h(ce),ge=ce=>{g(ce),h(1)},F=ce=>b(ce),de=ce=>{j(ce),b(1)},ve=()=>r.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无请求日志"})}):o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"客户端类型"}),o.jsx("th",{children:"路径"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"响应时间"}),o.jsx("th",{children:"Tokens信息"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:r.map(ce=>o.jsxs("tr",{children:[o.jsx("td",{children:wt(ce.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:kl[ce.targetType]?o.jsx("span",{className:`badge ${ce.targetType==="claude-code"?"badge-claude-code":ce.targetType==="codex"?"badge-codex":ce.targetType==="opencode"?"badge-opencode":"badge-info"}`,children:kl[ce.targetType]}):"-"}),o.jsx("td",{children:ce.path}),o.jsx("td",{children:o.jsx("span",{className:`badge ${J(ce.statusCode)}`,children:ce.statusCode||"Error"})}),o.jsx("td",{children:ce.responseTime?`${ce.responseTime}ms`:"-"}),o.jsx("td",{children:ce.usage?o.jsxs("span",{children:[ce.usage.totalTokens?ce.usage.totalTokens:ce.usage.inputTokens+ce.usage.outputTokens," tokens"]}):"-"}),o.jsx("td",{children:o.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[(()=>{const _t=ce.downstreamResponseBody;return typeof _t=="string"&&(_t.includes("event:")||_t.includes("data:"))&&o.jsx("span",{style:{position:"absolute",top:"-4px",right:"-4px",width:"6px",height:"6px",backgroundColor:"#f39c12",borderRadius:"50%",boxShadow:"0 0 0 2px rgba(243, 156, 18, 0.5)"}})})(),o.jsx("button",{className:"btn btn-secondary",onClick:()=>c(ce),children:"详情"})]})})]},ce.id))})]}),Ae=()=>a.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无错误日志"})}):o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"方法"}),o.jsx("th",{children:"路径"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"错误信息"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:a.map(ce=>o.jsxs("tr",{children:[o.jsx("td",{children:wt(ce.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:ce.method})}),o.jsx("td",{children:ce.path}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:ce.statusCode||"-"})}),o.jsx("td",{style:{maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#e74c3c"},children:ce.errorMessage}),o.jsx("td",{children:o.jsx("button",{className:"btn btn-secondary",onClick:()=>p(ce),children:"详情"})})]},ce.id))})]}),Ee={padding:"15px",background:"var(--bg-secondary)",borderRadius:"12px",marginBottom:"20px",display:"flex",gap:"15px",alignItems:"center",flexWrap:"wrap",border:"1px solid var(--border-primary)"},Ge={display:"flex",alignItems:"center",gap:"8px"},nt={fontWeight:"bold",color:"var(--text-primary)"},at={padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},Je={...at,minWidth:"150px"},nn={padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"1px solid var(--accent-danger)",background:"var(--accent-danger)",color:"white"},Kt={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",width:"320px",fontSize:"14px"},ut={padding:"6px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"none",background:"var(--accent-primary, #3498db)",color:"white"},Ht={padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},Jt=t==="request",It=Jt?Re:qe,Pt=ce=>Jt?ke(ce):ze(ce),gi=()=>{Jt?(De(Re),h(1)):(pt(qe),b(1))},Xi=Jt?ne:Ke,Ea=Jt?Le:$e;return o.jsxs("div",{className:"logs-page",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-content",children:[o.jsxs("div",{className:"page-header-text",children:[o.jsx("h1",{children:"日志"}),o.jsx("p",{children:"查看所有API请求日志"})]}),VF]})}),o.jsxs("div",{className:"card",children:[o.jsx("div",{style:{borderBottom:"1px solid #ecf0f1",marginBottom:"20px"},children:o.jsxs("div",{style:{display:"flex",gap:"0"},children:[o.jsxs("button",{onClick:()=>n("request"),style:{padding:"12px 24px",border:"none",background:t==="request"?"#3498db":"transparent",color:t==="request"?"white":"#7f8c8d",cursor:"pointer",borderBottom:t==="request"?"2px solid #2980b9":"2px solid transparent",fontWeight:t==="request"?"bold":"normal"},children:["请求日志 (",A,")"]}),o.jsxs("button",{onClick:()=>n("error"),style:{padding:"12px 24px",border:"none",background:t==="error"?"#e74c3c":"transparent",color:t==="error"?"white":"#7f8c8d",cursor:"pointer",borderBottom:t==="error"?"2px solid #c0392b":"2px solid transparent",fontWeight:t==="error"?"bold":"normal"},children:["错误日志 (",L,")"]})]})}),o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:t==="error"?"错误日志列表":"请求日志列表"}),o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"0 12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("input",{type:"checkbox",id:"auto-refresh",checked:X,onChange:ce=>{q(ce.target.checked),ce.target.checked&&$(10)},style:{cursor:"pointer"}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",X&&`(⏱ ${I}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{tt(),Ze(),$(10)},children:"刷新"})]})]}),o.jsxs("div",{style:Ee,children:[o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"来源类型:"}),o.jsxs("select",{value:E,onChange:ce=>fe(ce.target.value),style:at,children:[o.jsx("option",{value:"",children:"全部"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"}),o.jsx("option",{value:"opencode",children:"OpenCode"})]})]}),o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"供应商:"}),o.jsxs("select",{value:ye,onChange:ce=>Y(ce.target.value),style:Je,children:[o.jsx("option",{value:"",children:"全部供应商"}),H.map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})]}),o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"API服务:"}),o.jsxs("select",{value:ie,onChange:ce=>ue(ce.target.value),disabled:!ye,style:{...Je,background:ye?"var(--bg-card)":"var(--bg-secondary)",cursor:ye?"pointer":"not-allowed",opacity:ye?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),He().map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})]}),o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"模型:"}),o.jsxs("select",{value:Z,onChange:ce=>ee(ce.target.value),disabled:!ie,style:{...Je,background:ie?"var(--bg-card)":"var(--bg-secondary)",cursor:ie?"pointer":"not-allowed",opacity:ie?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),Oe().map(ce=>o.jsx("option",{value:ce,children:ce},ce))]})]}),o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"路由:"}),o.jsxs("select",{value:pe,onChange:ce=>xe(ce.target.value),style:Je,children:[o.jsx("option",{value:"",children:"全部路由"}),U.map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})]}),Xe&&o.jsx("button",{style:nn,onClick:Se,children:"清除筛选"}),o.jsxs("div",{style:Ge,children:[o.jsx("input",{type:"text",placeholder:Jt?"搜索日志内容...":"搜索错误日志...",value:It,onChange:ce=>Pt(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&gi()},style:Kt}),o.jsx("button",{style:ut,onClick:gi,children:"搜索"}),(It||Xi)&&o.jsx("button",{style:Ht,onClick:Ea,children:"清空"})]})]}),t==="request"&&o.jsxs(o.Fragment,{children:[R?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):ve(),!R&&o.jsx(yu,{currentPage:d,totalItems:v,pageSize:m,onPageChange:D,onPageSizeChange:ge})]}),t==="error"&&o.jsxs(o.Fragment,{children:[R?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):Ae(),!R&&o.jsx(yu,{currentPage:y,totalItems:k,pageSize:w,onPageChange:F,onPageSizeChange:de})]})]}),l&&o.jsx(uf,{log:l,onClose:()=>c(null)}),u&&o.jsx(uf,{log:u,onClose:()=>p(null)})]})}function YF({session:e,onClose:t}){var R;const[n,r]=f.useState(e.targetType==="claude-code"?"codex":"claude-code"),[i,a]=f.useState(!1),[s,l]=f.useState(!0),[c,u]=f.useState(0),[p,d]=f.useState(!1),[h,m]=f.useState(null),[g,v]=f.useState(""),[x,y]=f.useState(null),[b,w]=f.useState(!1),j=e.targetType==="claude-code"?"Claude Code":"Codex",k=n==="claude-code"?"Claude Code":"Codex",S=(()=>{const _=e.lastRequestAt-e.firstRequestAt,X=Math.floor(_/6e4);return X<1?`${Math.max(1,Math.floor(_/1e3))}秒`:X<60?`${X}分钟`:`${Math.floor(X/60)}小时${X%60}分钟`})(),A=async()=>{d(!0),m(null),y(null);try{const _={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:s,maxRounds:c},X=await V.migrationPreview(e.id,_);m(X),v(X.generatedPrompt)}catch(_){K.error(_.message||"预览失败")}finally{d(!1)}},T=async()=>{const _=g||(h==null?void 0:h.generatedPrompt)||"";try{await navigator.clipboard.writeText(_),K.success("已复制到剪贴板!请打开 "+k+",粘贴为第一条消息")}catch{const X=document.querySelector(".migration-prompt-textarea");X?(X.select(),document.execCommand("copy"),K.success("已复制到剪贴板!")):K.error("复制失败,请手动选择内容复制")}},L=async()=>{if(x!=null&&x.command)try{await navigator.clipboard.writeText(x.command),K.success("命令已复制!请在终端中执行")}catch{K.error("复制失败")}},O=async()=>{w(!0),y(null);try{const _={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:s,maxRounds:c},X=await V.migrateLaunch(e.id,_);y(X),X.success&&K.success(`已在新的终端窗口中启动 ${k}`)}catch(_){K.error(_.message||"启动失败")}finally{w(!1)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout migration-modal",style:{width:"900px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"会话迁移"}),o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:["将 ",j," 会话迁移到 ",k]})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{className:"migration-source-info",children:[o.jsx("div",{className:"migration-source-title",children:((R=e.title)==null?void 0:R.replace(/<\/?session>/g,"").trim())||e.id.slice(0,8)}),o.jsxs("div",{className:"migration-source-meta",children:[o.jsx("span",{className:`badge migration-source-badge ${e.targetType==="claude-code"?"migration-badge-claude":"migration-badge-codex"}`,children:e.targetType==="claude-code"?"Claude Code":"Codex"}),o.jsxs("span",{children:[e.requestCount," 轮对话"]}),o.jsxs("span",{children:[e.totalTokens.toLocaleString()," tokens"]}),o.jsx("span",{children:S})]})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"12px",fontWeight:500,color:"var(--text-secondary)",fontSize:"13px"},children:"迁移方向"}),o.jsxs("div",{className:"migration-tool-cards",children:[o.jsxs("div",{className:"migration-tool-card is-source",style:{cursor:"default"},children:[o.jsx("div",{className:"migration-tool-card-icon",children:e.targetType==="claude-code"?o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M8.5 8.5h7v7h-7z"}),o.jsx("path",{d:"M5 12h2"}),o.jsx("path",{d:"M17 12h2"}),o.jsx("path",{d:"M12 5v2"}),o.jsx("path",{d:"M12 17v2"})]}):o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M12 6v4l3 2"}),o.jsx("path",{d:"M9 18h6"}),o.jsx("path",{d:"M9 14h3"})]})}),o.jsx("div",{className:"migration-tool-card-name",children:j}),o.jsx("span",{className:"migration-tool-card-badge",children:"来源"})]}),o.jsx("div",{className:"migration-arrow",children:o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M5 12h14"}),o.jsx("path",{d:"m12 5 7 7-7 7"})]})}),o.jsxs("button",{type:"button",className:`migration-tool-card${n==="claude-code"?" active":""}`,onClick:()=>{r("claude-code"),y(null)},children:[o.jsx("div",{className:"migration-tool-card-icon",children:o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M8.5 8.5h7v7h-7z"}),o.jsx("path",{d:"M5 12h2"}),o.jsx("path",{d:"M17 12h2"}),o.jsx("path",{d:"M12 5v2"}),o.jsx("path",{d:"M12 17v2"})]})}),o.jsx("div",{className:"migration-tool-card-name",children:"Claude Code"}),o.jsx("div",{className:"migration-tool-card-desc",children:e.targetType==="claude-code"&&n==="claude-code"?"同工具新会话":"Anthropic 编程助手"})]}),o.jsxs("button",{type:"button",className:`migration-tool-card${n==="codex"?" active":""}`,onClick:()=>{r("codex"),y(null)},children:[o.jsx("div",{className:"migration-tool-card-icon",children:o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M12 6v4l3 2"}),o.jsx("path",{d:"M9 18h6"}),o.jsx("path",{d:"M9 14h3"})]})}),o.jsx("div",{className:"migration-tool-card-name",children:"Codex"}),o.jsx("div",{className:"migration-tool-card-desc",children:e.targetType==="codex"&&n==="codex"?"同工具新会话":"OpenAI 编程助手"})]})]})]}),o.jsxs("div",{className:"migration-options",style:{marginTop:"12px",display:"flex",gap:"16px",alignItems:"center",flexWrap:"wrap"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:s,onChange:_=>l(_.target.checked)}),"包含工具调用摘要"]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:i,onChange:_=>a(_.target.checked)}),"包含思考过程"]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:{fontSize:"14px",whiteSpace:"nowrap"},children:"最大轮数:"}),o.jsxs("select",{value:c,onChange:_=>u(Number(_.target.value)),style:{padding:"4px 8px",border:"1px solid var(--border-primary)",borderRadius:"6px",fontSize:"14px",backgroundColor:"var(--input-bg)",color:"var(--text-primary)"},children:[o.jsx("option",{value:0,children:"全部"}),o.jsx("option",{value:5,children:"最近 5 轮"}),o.jsx("option",{value:10,children:"最近 10 轮"}),o.jsx("option",{value:20,children:"最近 20 轮"}),o.jsx("option",{value:30,children:"最近 30 轮"})]})]})]}),o.jsx("div",{style:{marginTop:"16px"},children:o.jsx("button",{className:"btn btn-primary",onClick:A,disabled:p,children:p?"加载中...":"预览迁移内容"})}),!h&&!p&&o.jsxs("div",{className:"migration-empty-hint",children:[o.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 20h9"}),o.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 1 1 3 3L7 19l-4 1 1-4Z"})]}),o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:500,color:"var(--text-secondary)",marginBottom:"4px"},children:"请先预览迁移内容"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:"点击上方「预览迁移内容」按钮,确认迁移 Prompt 后即可启动目标工具或复制到剪贴板"})]})]}),h&&o.jsxs("div",{className:"migration-preview-section",style:{marginTop:"16px"},children:[o.jsx("textarea",{className:"migration-prompt-textarea",value:g,onChange:_=>v(_.target.value),style:{width:"100%",minHeight:"400px",padding:"12px",border:"1px solid var(--border-primary)",borderRadius:"8px",fontSize:"13px",fontFamily:"monospace",backgroundColor:"var(--input-bg)",color:"var(--text-primary)",resize:"vertical",lineHeight:1.5}}),o.jsx("div",{className:"migration-preview-footer",style:{marginTop:"10px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:["预估 Tokens: ",h.estimatedTokens.toLocaleString(),h.warnings.map((_,X)=>o.jsxs("span",{style:{color:"#e67e22",marginLeft:"12px"},children:["⚠ ",_]},X)),h.content.extractedRounds>0&&o.jsxs("span",{style:{color:"var(--text-tertiary)",marginLeft:"12px"},children:[h.content.extractedRounds,"/",h.content.totalRounds," 轮"]})]})})]}),x&&o.jsx("div",{className:`migration-launch-result ${x.success?"migration-launch-success":"migration-launch-fallback"}`,style:{marginTop:"16px",padding:"16px",borderRadius:"8px",backgroundColor:x.success?"#27ae6010":"#e67e2210",border:`1px solid ${x.success?"#27ae6040":"#e67e2240"}`},children:x.success?o.jsxs("div",{children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:600,color:"#27ae60",marginBottom:"8px"},children:["✅ 已在新终端窗口中启动 ",k]}),o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:["请在新终端窗口中继续与 ",k," 交互"]})]}):o.jsxs("div",{children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:600,color:"#e67e22",marginBottom:"8px"},children:["⚠️ ",x.reason||"无法自动启动"]}),x.command&&o.jsxs("div",{style:{marginTop:"8px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"请在终端中执行以下命令:"}),o.jsx("pre",{style:{marginTop:"6px",padding:"10px",backgroundColor:"var(--bg-secondary)",borderRadius:"6px",fontSize:"12px",fontFamily:"monospace",overflow:"auto"},children:x.command}),o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:L,style:{marginTop:"6px"},children:"复制命令"})]}),x.fallbackSuggestions&&x.fallbackSuggestions.length>0&&o.jsx("div",{style:{marginTop:"8px",fontSize:"13px",color:"var(--text-tertiary)"},children:x.fallbackSuggestions.map((_,X)=>o.jsxs("div",{children:["• ",_]},X))})]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:O,disabled:b||!h,title:h?"":"请先预览迁移内容",children:b?"启动中...":`🚀 启动 ${k}`}),o.jsx("button",{className:"btn btn-secondary",onClick:T,disabled:!h,title:h?"":"请先预览迁移内容",children:"📋 复制到剪贴板"}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"关闭"})]})]})]})}function GF({session:e,onClose:t,onBound:n}){var y;const[r,i]=f.useState([]),[a,s]=f.useState({}),[l,c]=f.useState(e.routeId||null),[u,p]=f.useState(!1),[d,h]=f.useState(!0),m=e.targetType==="claude-code"?"Claude Code":"Codex";f.useEffect(()=>{(async()=>{try{const w=await V.getRoutes();i(w);const j={};for(const k of w)try{const S=await V.getRules(k.id);j[k.id]=S.length}catch{j[k.id]=0}s(j)}catch{K.error("加载路由列表失败")}finally{h(!1)}})()},[]);const g=async()=>{if(l){p(!0);try{const b=await V.bindSessionRoute(e.id,l);b.success?(K.success("路由绑定成功"),n(),t()):K.error(b.error||"绑定失败")}catch(b){K.error(b.message||"绑定失败")}finally{p(!1)}}},v=async()=>{p(!0);try{const b=await V.unbindSessionRoute(e.id);b.success?(K.success("已解除路由绑定"),n(),t()):K.error(b.error||"解绑失败")}catch(b){K.error(b.message||"解绑失败")}finally{p(!1)}},x=l!==(e.routeId||null);return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal",style:{width:"500px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"路由绑定"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:"为会话指定专用的路由"})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{style:{padding:"12px 16px",backgroundColor:"var(--bg-secondary)",borderRadius:"8px",marginBottom:"20px"},children:[o.jsx("div",{style:{fontWeight:500,marginBottom:"6px"},children:((y=e.title)==null?void 0:y.replace(/<\/?session>/g,"").trim())||e.id.slice(0,8)}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{className:`badge ${e.targetType==="claude-code"?"badge-claude-code":"badge-codex"}`,style:{fontSize:"11px"},children:m}),o.jsxs("span",{children:[e.requestCount," 次请求"]}),o.jsxs("span",{children:[e.totalTokens.toLocaleString()," tokens"]})]})]}),e.routeId&&o.jsx("div",{style:{padding:"10px 14px",backgroundColor:"var(--bg-info, rgba(41, 128, 185, 0.1))",borderRadius:"6px",marginBottom:"16px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"13px"},children:o.jsxs("span",{style:{color:"var(--text-secondary)"},children:["当前绑定:",o.jsx("strong",{children:e.routeName||e.routeId})]})}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"10px",fontWeight:500,color:"var(--text-secondary)",fontSize:"13px"},children:"选择路由"}),d?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"加载中..."}):r.length===0?o.jsxs("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:[o.jsx("p",{children:"暂无可用路由"}),o.jsx("p",{style:{fontSize:"12px",marginTop:"8px"},children:"请先在路由管理页面创建路由"})]}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"300px",overflowY:"auto"},children:r.map(b=>{const w=l===b.id,j=e.routeId===b.id;return o.jsx("div",{onClick:()=>c(b.id),style:{padding:"12px 14px",border:`2px solid ${w?"var(--color-primary, #2980b9)":"var(--border-primary, #e0e0e0)"}`,borderRadius:"8px",cursor:"pointer",backgroundColor:w?"var(--bg-route-item-selected, rgba(41, 128, 185, 0.08))":"var(--bg-primary)",transition:"all 0.15s ease",position:"relative"},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:500,fontSize:"14px",display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{width:"16px",height:"16px",borderRadius:"50%",border:`2px solid ${w?"var(--color-primary, #2980b9)":"var(--border-secondary, #ccc)"}`,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:w&&o.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--color-primary, #2980b9)"}})}),b.name,j&&o.jsx("span",{style:{fontSize:"10px",padding:"1px 6px",borderRadius:"4px",backgroundColor:"var(--color-primary, #2980b9)",color:"white"},children:"当前"})]}),b.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"4px",marginLeft:"24px"},children:b.description})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",flexShrink:0},children:[a[b.id]||0," 条规则"]})]})},b.id)})})]})]}),o.jsxs("div",{className:"modal-footer",children:[e.routeId&&o.jsx("button",{className:"btn btn-danger",onClick:v,disabled:u,children:"解绑"}),o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"取消"}),o.jsx("button",{className:"btn btn-primary",onClick:g,disabled:u||!l||!x,children:u?"处理中...":"确认绑定"})]})]})]})}const XF=Array.from({length:15},(e,t)=>t+1);function QF({onClose:e,onCleared:t}){const[n,r]=f.useState(7),[i,a]=f.useState(!1),[s,l]=f.useState(!1),c=async()=>{l(!0);try{const p=await V.cleanupSessions(n,i);p.sessionsAffected===0?K.info("没有符合条件的会话需要清除"):i?K.success(`已清除 ${p.sessionsAffected} 个会话的日志(共 ${p.logsDeleted} 条),会话记录已保留`):K.success(`已清除 ${p.sessionsAffected} 个会话及其关联日志(共 ${p.logsDeleted} 条)`),t(),e()}catch(p){K.error(p.message||"清除会话失败")}finally{l(!1)}},u=i?`将删除最后请求在 ${n} 天以前的会话所关联的日志,会话记录本身将被保留。`:`将永久删除最后请求在 ${n} 天以前的会话,及其所有关联日志。此操作不可撤销。`;return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:e,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal",style:{width:"480px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"清除会话"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:"按最后请求时间清理过期会话"})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{style:{marginBottom:"20px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"10px",fontWeight:500,color:"var(--text-secondary)",fontSize:"13px"},children:"清除范围"}),o.jsxs("div",{style:{padding:"14px 16px",backgroundColor:"var(--bg-secondary)",borderRadius:"8px",display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[o.jsx("span",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"最后请求在"}),o.jsx("select",{value:n,onChange:p=>r(Number(p.target.value)),disabled:s,style:{padding:"6px 10px",borderRadius:"6px",border:"1px solid var(--border-primary)",backgroundColor:"var(--bg-primary)",color:"var(--text-primary)",fontSize:"14px",cursor:"pointer"},children:XF.map(p=>o.jsx("option",{value:p,children:p},p))}),o.jsx("span",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"天以前的会话"})]})]}),o.jsxs("div",{onClick:()=>!s&&a(p=>!p),style:{padding:"14px 16px",borderRadius:"8px",border:`2px solid ${i?"var(--color-primary, #2980b9)":"var(--border-primary, #e0e0e0)"}`,backgroundColor:i?"var(--bg-route-item-selected, rgba(41, 128, 185, 0.08))":"var(--bg-primary)",cursor:s?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",opacity:s?.6:1},children:[o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:500,fontSize:"14px",color:"var(--text-primary)"},children:"仅清空日志"}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"4px"},children:"开启后保留会话记录,仅删除这些会话的关联日志"})]}),o.jsx("div",{style:{width:"40px",height:"22px",borderRadius:"11px",backgroundColor:i?"var(--color-primary, #2980b9)":"var(--border-secondary, #ccc)",position:"relative",transition:"background-color 0.15s ease",flexShrink:0},children:o.jsx("div",{style:{position:"absolute",top:"2px",left:i?"20px":"2px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#fff",transition:"left 0.15s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})})]}),o.jsxs("div",{style:{marginTop:"20px",padding:"12px 14px",backgroundColor:"rgba(231, 76, 60, 0.08)",border:"1px solid rgba(231, 76, 60, 0.3)",borderRadius:"6px",fontSize:"13px",color:"#c0392b",lineHeight:1.5},children:[o.jsx("strong",{children:"⚠️ 警告:"}),u]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:e,disabled:s,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:c,disabled:s,children:s?"处理中...":"确认清除"})]})]})]})}wt.extend(V0);function ZF(e,t,n,r){if(!e)return[];const i=[];if(e.role==="user"){const a=e.content;if(typeof a=="string")i.push({role:"user",content:a,timestamp:t,model:n});else if(Array.isArray(a)){let s=[];const l=()=>{s.length>0&&(i.push({role:"user",content:s.join(`
123
+ `),timestamp:t,model:n}),s=[])};for(const c of a)if((c==null?void 0:c.type)==="text"&&(c!=null&&c.text))s.push(c.text);else if((c==null?void 0:c.type)==="image"||(c==null?void 0:c.type)==="image_url")s.push("[图片]");else if((c==null?void 0:c.type)==="tool_result"){l();let u="";c.content&&(typeof c.content=="string"?u=c.content:Array.isArray(c.content)?u=c.content.map(m=>typeof m=="string"?m:(m==null?void 0:m.type)==="text"&&(m!=null&&m.text)?m.text:(m==null?void 0:m.type)==="image"||(m==null?void 0:m.type)==="image_url"?"[图片]":JSON.stringify(m)).join(`
124
+ `):u=JSON.stringify(c.content));const p=c.tool_use_id&&(r==null?void 0:r.get(c.tool_use_id))||c.name||"",d=c.tool_use_id?c.tool_use_id.slice(-8):"",h=p?`[工具结果: ${p}${d?` · ...${d}`:""}]`:d?`[工具结果: ...${d}]`:"[工具结果]";i.push({role:"user",type:"tool_result",header:h,content:u||h,timestamp:t,model:n})}l()}}else if(e.role==="assistant"){const a=e.content;if(typeof a=="string")a&&i.push({role:"assistant",content:a,timestamp:t,model:n});else if(Array.isArray(a)){let s="",l="";for(const c of a)if(c.type==="text"&&c.text&&(s+=c.text),c.type==="thinking"&&c.thinking&&(l+=c.thinking),c.type==="tool_use"){(s||l)&&(i.push({role:"assistant",content:s,thinking:l||void 0,timestamp:t,model:n}),s="",l="");const u=c.name||"",p=c.id?c.id.slice(-8):"",d=u+(p?` · ...${p}`:""),h=c.input?JSON.stringify(c.input,null,2):"";i.push({role:"assistant",type:"tool_use",header:`[工具调用: ${d}]`,content:h||`[工具调用: ${d}]`,timestamp:t,model:n})}(s||l)&&i.push({role:"assistant",content:s||"",thinking:l||void 0,timestamp:t,model:n})}}return i}function JF(e){var i,a,s,l,c;const t=[],n={timestamp:e.timestamp,model:e.targetModel,tokens:((i=e.usage)==null?void 0:i.totalTokens)||(e.usage?e.usage.inputTokens+e.usage.outputTokens:void 0)},r=e.downstreamResponseBody;if(typeof r=="string"&&(r.includes("event:")||r.includes("data:"))){const u=Bu(r),{text:p,thinking:d}=Fu(u);if(p||d)return t.push({role:"assistant",content:p||"",thinking:d||void 0,...n}),t}if(e.responseBody)try{const u=typeof e.responseBody=="string"?JSON.parse(e.responseBody):e.responseBody;if(u.content&&Array.isArray(u.content)){let p="",d="";for(const h of u.content)if(h.type==="text"&&h.text&&(p+=h.text),h.type==="thinking"&&h.thinking&&(d+=h.thinking),h.type==="tool_use"){(p||d)&&(t.push({role:"assistant",content:p,thinking:d||void 0,...n}),p="",d="");const m=h.name||"",g=h.id?h.id.slice(-8):"",v=m+(g?` · ...${g}`:""),x=h.input?JSON.stringify(h.input,null,2):"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${v}]`,content:x||`[工具调用: ${v}]`,...n})}if((p||d)&&t.push({role:"assistant",content:p||"",thinking:d||void 0,...n}),t.length>0)return t}if((s=(a=u.choices)==null?void 0:a[0])!=null&&s.message){const p=u.choices[0].message;if(p.content&&t.push({role:"assistant",content:p.content,...n}),p.tool_calls&&Array.isArray(p.tool_calls))for(const d of p.tool_calls){const h=((l=d.function)==null?void 0:l.name)||"",m=d.id?d.id.slice(-8):"",g=h+(m?` · ...${m}`:""),v=((c=d.function)==null?void 0:c.arguments)||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${g}]`,content:v||`[工具调用: ${g}]`,...n})}if(t.length>0)return t}if(u.output){let p="";const d=Array.isArray(u.output)?u.output:[u.output];for(const h of d){if(h.type==="message"&&h.content){const m=Array.isArray(h.content)?h.content:[h.content];for(const g of m)g.type==="output_text"&&g.text?p+=g.text:typeof g=="string"&&(p+=g)}if(h.type==="function_call"){p&&(t.push({role:"assistant",content:p,...n}),p="");const m=h.name||"",g=h.call_id?h.call_id.slice(-8):"",v=m+(g?` · ...${g}`:""),x=h.arguments||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${v}]`,content:x||`[工具调用: ${v}]`,...n})}}if(p&&t.push({role:"assistant",content:p,...n}),t.length>0)return t}}catch{}return t}function q0(e){var i,a;const t=[];let n=0;const r=new Map;for(const s of e){const l=((i=s.body)==null?void 0:i.messages)||[];for(const c of l)if(c.role==="assistant"&&Array.isArray(c.content))for(const u of c.content)u.type==="tool_use"&&u.id&&u.name&&r.set(u.id,u.name)}for(const s of e){const l=((a=s.body)==null?void 0:a.messages)||[],c=l.slice(n);n=l.length;for(const p of c){const d=ZF(p,s.timestamp,s.requestModel,r);t.push(...d)}const u=JF(s);t.push(...u)}return eU(t)}function eU(e){const t=[];for(const n of e){if(n.role!=="assistant"){t.push(n);continue}const r=t.findIndex(i=>i.role==="assistant"&&i.type===n.type&&i.content===n.content);if(r===-1)t.push(n);else{const i=t[r],a=!!n.tokens,s=!!i.tokens;a&&!s&&(t[r]=n)}}return t}function Lo(e){return(e||"").replace("<session>","").replace("</session>","").trim()||"(无标题)"}function tU({content:e,header:t,forceCollapsible:n,hideContentWhenCollapsed:r}){const i=e.split(`
125
+ `),a=10,s=3,l=f.useRef(null),c=!!n,u=n||i.length>a,p=c?s:a,[d,h]=f.useState(!u),m=()=>{d?(requestAnimationFrame(()=>{const g=l.current,v=g==null?void 0:g.closest(".modal-body-scrollable");if(g&&v){const x=g.getBoundingClientRect(),y=v.getBoundingClientRect();(x.top<y.top||x.top>y.bottom)&&g.scrollIntoView({block:"start"})}}),h(!1)):h(!0)};return u?!d&&r?o.jsx("div",{className:"chat-collapsible-wrapper",ref:l,style:{width:"400px"},children:o.jsxs("div",{className:"chat-collapse-top-bar",children:[t&&o.jsx("div",{className:"chat-tool-header",children:t}),o.jsx("div",{className:"chat-collapse-btn-sticky",children:o.jsxs("button",{className:"chat-collapse-btn",onClick:m,children:["展开 (",i.length," 行)"]})})]})}):o.jsxs("div",{className:"chat-collapsible-wrapper",ref:l,style:!d&&c?{width:"400px"}:void 0,children:[o.jsxs("div",{className:"chat-collapse-top-bar",children:[t&&o.jsx("div",{className:"chat-tool-header",children:t}),o.jsx("div",{className:"chat-collapse-btn-sticky",children:o.jsx("button",{className:"chat-collapse-btn",onClick:m,children:d?"收起":`展开全部 (${i.length} 行)`})})]}),o.jsx("div",{className:"chat-content-text",children:d?e:i.slice(0,p).join(`
126
+ `)}),!d&&o.jsx("div",{className:"chat-collapse-fade",onClick:m,children:o.jsxs("span",{className:"chat-collapse-fade-btn",children:["展开全部 (",i.length," 行)"]})})]}):o.jsxs(o.Fragment,{children:[t&&o.jsx("div",{className:"chat-tool-header",children:t}),o.jsx("div",{className:"chat-content-text",children:e})]})}function nU({logs:e,onFetchNew:t}){const n=[...e].sort((m,g)=>m.timestamp-g.timestamp),[r,i]=f.useState(n),a=q0(r),s=f.useRef(null),[l,c]=f.useState(!1),[u,p]=f.useState(!1);f.useEffect(()=>{i([...e].sort((m,g)=>m.timestamp-g.timestamp))},[e]),f.useEffect(()=>{var v;const m=(v=s.current)==null?void 0:v.parentElement;if(!m)return;const g=()=>{const x=m.scrollHeight-m.scrollTop-m.clientHeight<60;c(x)};return m.addEventListener("scroll",g),g(),()=>m.removeEventListener("scroll",g)},[r]);const d=()=>{var g;const m=(g=s.current)==null?void 0:g.parentElement;m&&m.scrollTo({top:m.scrollHeight,behavior:"smooth"})},h=async()=>{if(l&&t){p(!0);try{const m=await t(),g=new Set(r.map(y=>y.id)),x=[...m].sort((y,b)=>y.timestamp-b.timestamp).filter(y=>!g.has(y.id));x.length>0&&(i(y=>[...y,...x]),requestAnimationFrame(()=>d()))}finally{p(!1)}}else d()};return a.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无对话内容"}):o.jsxs("div",{className:"chat-view-container",ref:s,children:[a.map((m,g)=>o.jsxs("div",{className:`chat-message chat-message--${m.role}${m.type?` chat-message--${m.type}`:""}`,children:[o.jsxs("div",{className:"chat-bubble",children:[m.role==="assistant"&&m.thinking&&o.jsxs("details",{className:"chat-thinking",children:[o.jsxs("summary",{children:["思考内容 (",m.thinking.length," 字符)"]}),o.jsx("pre",{children:m.thinking})]}),m.content&&o.jsx(tU,{content:m.content,header:m.header,forceCollapsible:!!m.type,hideContentWhenCollapsed:m.type==="tool_use"})]}),!m.type&&o.jsxs("div",{className:"chat-meta",children:[wt(m.timestamp).format("HH:mm:ss"),m.model&&` · ${m.model}`,m.tokens&&` · ${m.tokens.toLocaleString()} tokens`]})]},g)),o.jsx("div",{className:"chat-scroll-bottom",children:o.jsx("button",{className:"chat-scroll-bottom-btn",onClick:h,disabled:u,children:u?o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"spin-icon",children:o.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})}):o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})})})})]})}function Y0({session:e,logs:t,logsLoading:n,onRefreshLogs:r,onFetchNewLogs:i,onClose:a,onExport:s}){const[l,c]=f.useState("logs"),[u,p]=f.useState(null),d=(g,v)=>{const x=v-g;return x<6e4?`${Math.floor(x/1e3)}秒`:x<36e5?`${Math.floor(x/6e4)}分钟`:`${Math.floor(x/36e5)}小时`},h=g=>g>=1e6?(g/1e6).toFixed(1)+"M":g>=1e3?(g/1e3).toFixed(1)+"k":String(g),m=()=>{if(s){s(e,t,l);return}const v=`${Lo(e.title)}.json`;if(l==="chat"){const x=q0(t),y={session:{id:e.id,targetType:e.targetType,title:e.title,firstRequestAt:e.firstRequestAt,lastRequestAt:e.lastRequestAt,requestCount:e.requestCount,totalTokens:e.totalTokens},messages:x.map(k=>({role:k.role,type:k.type,header:k.header,content:k.content,thinking:k.thinking,timestamp:k.timestamp,model:k.model,tokens:k.tokens}))},b=new Blob([JSON.stringify(y,null,2)],{type:"application/json"}),w=URL.createObjectURL(b),j=document.createElement("a");j.href=w,j.download=v,j.click(),URL.revokeObjectURL(w)}else{const x={session:{id:e.id,targetType:e.targetType,title:e.title,firstRequestAt:e.firstRequestAt,lastRequestAt:e.lastRequestAt,requestCount:e.requestCount,totalTokens:e.totalTokens},logs:t},y=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),b=URL.createObjectURL(y),w=document.createElement("a");w.href=b,w.download=v,w.click(),URL.revokeObjectURL(b)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:a,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout",style:{width:"900px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("h2",{children:"会话详情"}),o.jsx("button",{className:"session-refresh-btn",onClick:r,disabled:n,title:"刷新",children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n?"spin-icon":"",children:o.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})})})]}),o.jsxs("div",{className:"session-view-toggle",children:[o.jsx("button",{className:l==="logs"?"active":"",onClick:()=>c("logs"),children:"日志"}),o.jsx("button",{className:l==="chat"?"active":"",onClick:()=>c("chat"),children:"对话"})]})]}),o.jsx("div",{className:"modal-body-scrollable",children:l==="logs"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginBottom:"12px",padding:"10px 12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("div",{style:{fontSize:"15px",fontWeight:500,marginBottom:"8px"},children:Lo(e.title)}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px 20px",fontSize:"13px",color:"var(--text-secondary)"},children:[o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"类型"})," ",o.jsx("span",{style:{display:"inline-block",padding:"1px 6px",borderRadius:"4px",fontSize:"12px",background:e.targetType==="claude-code"?"rgba(59,130,246,0.1)":"rgba(34,197,94,0.1)",color:e.targetType==="claude-code"?"var(--color-primary, #3b82f6)":"var(--color-success, #22c55e)"},children:e.targetType==="claude-code"?"Claude Code":"Codex"})]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"请求数"})," ",e.requestCount]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Tokens"})," ",h(e.totalTokens)]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"时长"})," ",d(e.firstRequestAt,e.lastRequestAt)]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"首次请求"})," ",wt(e.firstRequestAt).format("YYYY-MM-DD HH:mm:ss")]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"最后请求"})," ",wt(e.lastRequestAt).format("YYYY-MM-DD HH:mm:ss")]})]})]}),o.jsxs("h3",{style:{marginTop:"0",marginBottom:"10px"},children:["会话日志 (",t.length,")"]}),n?o.jsx("div",{style:{textAlign:"center",padding:"20px"},children:"加载中..."}):t.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"#7f8c8d"},children:"暂无日志"}):o.jsx("div",{style:{border:"1px solid var(--border-color)",borderRadius:"8px",overflow:"hidden"},children:o.jsxs("table",{style:{fontSize:"14px"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"响应时间"}),o.jsx("th",{children:"Tokens"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:[...t].sort((g,v)=>g.timestamp-v.timestamp).map(g=>o.jsxs("tr",{children:[o.jsx("td",{children:wt(g.timestamp).format("HH:mm:ss")}),o.jsx("td",{children:o.jsx("span",{className:`badge ${g.statusCode&&g.statusCode>=200&&g.statusCode<300?"badge-success":g.statusCode&&g.statusCode>=400?"badge-danger":"badge-warning"}`,children:g.statusCode||"Error"})}),o.jsx("td",{children:g.responseTime?`${g.responseTime}ms`:"-"}),o.jsx("td",{children:g.usage?o.jsx("span",{children:g.usage.totalTokens||g.usage.inputTokens+g.usage.outputTokens}):"-"}),o.jsx("td",{children:o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>p(g),children:"详情"})})]},g.id))})]})})]}):o.jsx(o.Fragment,{children:n?o.jsx("div",{style:{textAlign:"center",padding:"20px"},children:"加载中..."}):o.jsx(nU,{logs:t,onFetchNew:i})})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:m,disabled:t.length===0,children:"导出"}),o.jsx("button",{className:"btn btn-secondary",onClick:a,children:"关闭"})]})]}),u&&o.jsx(uf,{log:u,onClose:()=>p(null)})]})}wt.extend(V0);function rU(){const[e,t]=f.useState([]),[n,r]=f.useState(0),[i,a]=f.useState(1),[s,l]=f.useState(20),[c,u]=f.useState(null),[p,d]=f.useState([]),[h,m]=f.useState(!1),[g,v]=f.useState(""),[x,y]=f.useState(""),[b,w]=f.useState(""),[j,k]=f.useState(""),[S,A]=f.useState(""),[T,L]=f.useState(""),[O,R]=f.useState(""),[_,X]=f.useState([]),[q,I]=f.useState([]),[$,H]=f.useState([]),[N,W]=f.useState(!1),[P,U]=f.useState(10),[le,E]=f.useState(null),[me,ye]=f.useState(null),[Q,ie]=f.useState(!1),je=f.useRef({sessionsPage:i,sessionsPageSize:s,appliedSearchQuery:x,filterTargetType:b,filterVendorId:j,filterServiceId:S,filterModel:T,filterRouteId:O});je.current={sessionsPage:i,sessionsPageSize:s,appliedSearchQuery:x,filterTargetType:b,filterVendorId:j,filterServiceId:S,filterModel:T,filterRouteId:O},f.useEffect(()=>{re()},[i,s,x,b,j,S,T,O]),f.useEffect(()=>{Z()},[]),f.useEffect(()=>{let J=null,Y=null;return N&&(Y=setInterval(()=>{U(ue=>ue<=1?10:ue-1)},1e3),J=setInterval(()=>{re()},1e4)),()=>{J&&clearInterval(J),Y&&clearInterval(Y)}},[N,i,s]);const Z=async()=>{try{const[J,Y,ue]=await Promise.all([V.getVendors(),V.getAPIServices(),V.getRoutes()]);X(J),I(Y),H(ue)}catch(J){console.error("Failed to load filter options:",J)}},re=async()=>{const J=je.current;try{const Y=(J.sessionsPage-1)*J.sessionsPageSize,ue=await V.getSessions({filters:{targetType:J.filterTargetType||void 0,vendorId:J.filterVendorId||void 0,serviceId:J.filterServiceId||void 0,model:J.filterModel||void 0,routeId:J.filterRouteId||void 0},keyword:J.appliedSearchQuery.trim()||void 0,limit:J.sessionsPageSize,offset:Y});t(ue.sessions),r(ue.total)}catch(Y){console.error("Failed to load sessions:",Y)}},pe=async J=>{u(J),m(!0);try{const Y=await V.getSessionLogs(J.id,1e4);d(Y)}catch(Y){console.error("Failed to load session logs:",Y)}finally{m(!1)}},se=(J,Y)=>{const ue=Y-J;return ue<6e4?`${Math.floor(ue/1e3)}秒`:ue<36e5?`${Math.floor(ue/6e4)}分钟`:`${Math.floor(ue/36e5)}小时`},Re=J=>J==="claude-code"?o.jsx("span",{className:"badge badge-claude-code",children:"Claude Code"}):J==="codex"?o.jsx("span",{className:"badge badge-codex",children:"Codex"}):J==="opencode"?o.jsx("span",{className:"badge badge-opencode",children:"OpenCode"}):o.jsx("span",{className:"badge",children:J}),ke=J=>{k(J),A(""),L(""),a(1)},ne=J=>{A(J),L(""),a(1)},De=()=>j?q.filter(J=>J.vendorId===j):[],qe=()=>{if(!S)return[];const J=q.find(Y=>Y.id===S);return(J==null?void 0:J.supportedModels)||[]},ze=!!(x||b||j||S||T||O),Ke=()=>{v(""),y(""),w(""),k(""),A(""),L(""),R(""),a(1)},pt=(J,Y,ue)=>{const M=J;if(ue==="chat"){const Xe=q0(Y).map((Ee,Ge)=>({index:Ge+1,role:Ee.role,type:Ee.type||null,header:Ee.header||null,content:Ee.content,thinking:Ee.thinking||null,timestamp:wt(Ee.timestamp).format("YYYY-MM-DD HH:mm:ss"),model:Ee.model||null,tokens:Ee.tokens||null})),D={session:{id:M.id,title:Lo(M.title),targetType:M.targetType,requestCount:M.requestCount,totalTokens:M.totalTokens,firstRequestAt:wt(M.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:wt(M.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:se(M.firstRequestAt,M.lastRequestAt)},messages:Xe,exportedAt:wt().format("YYYY-MM-DD HH:mm:ss")},ge=JSON.stringify(D,null,2),F=new Blob([ge],{type:"application/json;charset=utf-8"}),de=URL.createObjectURL(F),ve=document.createElement("a");ve.href=de;const Ae=Lo(M.title).replace(/[\\/:*?"<>|]/g,"_");ve.download=`${Ae}_对话.json`,document.body.appendChild(ve),ve.click(),document.body.removeChild(ve),URL.revokeObjectURL(de),K.success("对话数据已导出");return}const fe=Y.map((Oe,Xe)=>{var de,ve,Ae,Ee;const D=((de=Oe.body)==null?void 0:de.messages)||[];let ge="";const F=Oe.downstreamResponseBody;if(typeof F=="string"&&(F.includes("event:")||F.includes("data:"))){const Ge=Bu(F),{text:nt,thinking:at}=Fu(Ge),Je=[];at&&Je.push(`<details><summary>思考过程</summary>
127
+
128
+ ${at}
129
+
130
+ </details>`),nt&&Je.push(nt),ge=Je.join(`
131
+
132
+ `)}if(!ge&&Oe.responseBody)try{const Ge=typeof Oe.responseBody=="string"?JSON.parse(Oe.responseBody):Oe.responseBody;if(Ge.content){if(Array.isArray(Ge.content)){const nt=[];for(const at of Ge.content)at.type==="text"&&at.text?nt.push(at.text):at.type==="thinking"&&at.thinking&&nt.push(`<details><summary>思考过程</summary>
133
+
134
+ ${at.thinking}
135
+
136
+ </details>`);ge=nt.join(`
137
+
138
+ `)}typeof Ge.content=="string"&&(ge=Ge.content)}!ge&&((Ee=(Ae=(ve=Ge.choices)==null?void 0:ve[0])==null?void 0:Ae.message)!=null&&Ee.content)&&(ge=Ge.choices[0].message.content)}catch{}return{index:Xe+1,timestamp:wt(Oe.timestamp).format("YYYY-MM-DD HH:mm:ss"),statusCode:Oe.statusCode||null,responseTime:Oe.responseTime||null,requestModel:Oe.requestModel||null,targetModel:Oe.targetModel||null,vendorName:Oe.vendorName||null,serviceName:Oe.targetServiceName||null,contentType:Oe.contentType||null,tags:Oe.tags||[],usage:Oe.usage||null,messages:D,response:ge||null}}),ee={session:{id:M.id,title:M.title||null,targetType:M.targetType,requestCount:M.requestCount,totalTokens:M.totalTokens,model:M.model||null,vendorName:M.vendorName||null,serviceName:M.serviceName||null,firstRequestAt:wt(M.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:wt(M.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:se(M.firstRequestAt,M.lastRequestAt)},logs:fe,exportedAt:wt().format("YYYY-MM-DD HH:mm:ss")},xe=JSON.stringify(ee,null,2),Se=new Blob([xe],{type:"application/json;charset=utf-8"}),Le=URL.createObjectURL(Se),$e=document.createElement("a");$e.href=Le;const He=Lo(M.title).replace(/[\\/:*?"<>|]/g,"_");$e.download=`${He}.json`,document.body.appendChild($e),$e.click(),document.body.removeChild($e),URL.revokeObjectURL(Le),K.success("导出成功")},Ye=J=>a(J),Qe=J=>{l(J),a(1)},Ze={padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",minWidth:"140px"},tt={fontWeight:"bold",color:"var(--text-primary)"};return o.jsxs("div",{className:"sessions-page",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-content",children:[o.jsxs("div",{className:"page-header-text",children:[o.jsx("h1",{children:"会话"}),o.jsx("p",{children:"查看和管理所有会话记录"})]}),o.jsx("button",{className:"btn btn-danger",onClick:()=>ie(!0),children:"清除会话"})]})}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"会话列表"}),o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("input",{type:"checkbox",id:"auto-refresh",checked:N,onChange:J=>{W(J.target.checked),U(10)}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",N&&`(⏱ ${P}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{re(),U(10)},children:"刷新"})]})]}),o.jsxs("div",{style:{padding:"15px",background:"var(--bg-secondary)",borderRadius:"12px",marginBottom:"20px",display:"flex",gap:"15px",alignItems:"center",flexWrap:"wrap",border:"1px solid var(--border-primary)"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:tt,children:"来源类型:"}),o.jsxs("select",{value:b,onChange:J=>{w(J.target.value),a(1)},style:Ze,children:[o.jsx("option",{value:"",children:"全部"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"}),o.jsx("option",{value:"opencode",children:"OpenCode"})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:tt,children:"供应商:"}),o.jsxs("select",{value:j,onChange:J=>ke(J.target.value),style:Ze,children:[o.jsx("option",{value:"",children:"全部供应商"}),_.map(J=>o.jsx("option",{value:J.id,children:J.name},J.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:tt,children:"API服务:"}),o.jsxs("select",{value:S,onChange:J=>ne(J.target.value),disabled:!j,style:{...Ze,background:j?"var(--bg-card)":"var(--bg-secondary)",cursor:j?"pointer":"not-allowed",opacity:j?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),De().map(J=>o.jsx("option",{value:J.id,children:J.name},J.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:tt,children:"模型:"}),o.jsxs("select",{value:T,onChange:J=>{L(J.target.value),a(1)},disabled:!S,style:{...Ze,background:S?"var(--bg-card)":"var(--bg-secondary)",cursor:S?"pointer":"not-allowed",opacity:S?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),qe().map(J=>o.jsx("option",{value:J,children:J},J))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:tt,children:"路由:"}),o.jsxs("select",{value:O,onChange:J=>{R(J.target.value),a(1)},style:Ze,children:[o.jsx("option",{value:"",children:"全部路由"}),$.map(J=>o.jsx("option",{value:J.id,children:J.name},J.id))]})]}),ze&&o.jsx("button",{onClick:Ke,style:{padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"1px solid var(--accent-danger)",background:"var(--accent-danger)",color:"white"},children:"清除筛选"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("input",{type:"text",placeholder:"搜索标题或ID...",value:g,onChange:J=>v(J.target.value),onKeyDown:J=>{J.key==="Enter"&&(y(g),a(1))},style:{padding:"6px 12px",border:"1px solid var(--border-primary)",borderRadius:"8px",fontSize:"14px",width:"320px",background:"var(--bg-card)",color:"var(--text-primary)"}}),o.jsx("button",{onClick:()=>{y(g),a(1)},style:{padding:"6px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"none",background:"var(--accent-primary, #3498db)",color:"white"},children:"搜索"}),(g||x)&&o.jsx("button",{onClick:()=>{v(""),y(""),a(1)},style:{padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},children:"清空"})]})]}),e.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:ze?"没有匹配的会话":"暂无会话记录"})}):o.jsxs(o.Fragment,{children:[o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"标题"}),o.jsx("th",{children:"客户端类型"}),o.jsx("th",{children:"请求数"}),o.jsx("th",{children:"Tokens"}),o.jsx("th",{children:"首次请求"}),o.jsx("th",{children:"最后请求"}),o.jsx("th",{children:"时长"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:e.map(J=>o.jsxs("tr",{onClick:()=>pe(J),style:{cursor:"pointer",backgroundColor:(c==null?void 0:c.id)===J.id?"var(--bg-selected)":void 0},children:[o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Lo(J.title)}),o.jsx("td",{children:Re(J.targetType)}),o.jsx("td",{children:J.requestCount}),o.jsx("td",{children:J.totalTokens.toLocaleString()}),o.jsx("td",{children:wt(J.firstRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:wt(J.lastRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:se(J.firstRequestAt,J.lastRequestAt)}),o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",gap:"6px"},children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:Y=>{Y.stopPropagation(),pe(J)},children:"查看"}),o.jsx("button",{className:"btn btn-sm btn-primary",onClick:Y=>{Y.stopPropagation(),u(J),m(!0),V.getSessionLogs(J.id,1e4).then(ue=>d(ue)).catch(console.error).finally(()=>m(!1))},children:"对话"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:"#8e44ad",color:"white",border:"none"},onClick:Y=>{Y.stopPropagation(),E(J)},title:"迁移到另一个工具",children:"迁移"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:J.routeId?"#27ae60":"#2980b9",color:"white",border:"none",minWidth:(J.routeId,void 0)},onClick:Y=>{Y.stopPropagation(),ye(J)},title:J.routeId?`已绑定: ${J.routeName||J.routeId}`:"绑定路由",children:J.routeName?J.routeName.length>8?J.routeName.slice(0,8)+"…":J.routeName:"路由"})]})})]},J.id))})]}),o.jsx(yu,{currentPage:i,pageSize:s,totalItems:n,onPageChange:Ye,onPageSizeChange:Qe})]})]}),c&&o.jsx(Y0,{session:c,logs:p,logsLoading:h,onRefreshLogs:async()=>{if(c){m(!0);try{const J=await V.getSessionLogs(c.id,1e4);d(J)}catch(J){console.error("Failed to refresh session logs:",J)}finally{m(!1)}}},onFetchNewLogs:async()=>{if(!c)return[];const J=await V.getSessionLogs(c.id,1e4);return d(J),J},onClose:()=>{u(null),d([])},onExport:pt}),le&&o.jsx(YF,{session:le,onClose:()=>E(null)}),me&&o.jsx(GF,{session:me,onClose:()=>ye(null),onBound:()=>{re()}}),Q&&o.jsx(QF,{onClose:()=>ie(!1),onCleared:()=>{a(1),re()}})]})}function Yo({checked:e,onChange:t,disabled:n,label:r,labelPosition:i="right"}){const a=o.jsx("button",{type:"button",role:"switch","aria-checked":e,className:`switch ${e?"active":""}`,onClick:()=>!n&&t(!e),disabled:n,children:o.jsx("span",{className:"switch-thumb",style:{position:"absolute",top:"2px",left:e?"22px":"2px",width:"20px",height:"20px",borderRadius:"10px",backgroundColor:"#fff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})});return r?i==="left"?o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:n?"not-allowed":"pointer"},children:[o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:r}),a]}):o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:n?"not-allowed":"pointer"},children:[a,o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:r})]}):a}function Rg({skillId:e,targetType:t,enabled:n,onChange:r,disabled:i}){const a=t==="claude-code"?"Claude Code":t==="opencode"?"OpenCode":"Codex";return o.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:o.jsx(Yo,{checked:n,onChange:s=>r(e,t,s),disabled:i,label:a,labelPosition:"right"})})}function iU(){var I,$,H,N,W,P;const[e,t]=f.useState(null),[n,r]=f.useState(!0),[i,a]=f.useState("10"),[s,l]=f.useState(""),[c,u]=f.useState(""),[p,d]=f.useState(""),[h,m]=f.useState({proxyEnabled:!1,proxyUrl:"",proxyUsername:"",proxyPassword:""}),[g,v]=f.useState(!1),[x,y]=f.useState(null),[b,w]=f.useState(!1),[j,k]=f.useState(!1);f.useEffect(()=>{S()},[]);const S=async()=>{const U=await V.getConfig();t(U),r(U.enableFailover!==!1),a(typeof U.failoverRecoverySeconds=="number"&&U.failoverRecoverySeconds>0?String(Math.floor(U.failoverRecoverySeconds)):"10"),m({proxyEnabled:U.proxyEnabled||!1,proxyUrl:U.proxyUrl||"",proxyUsername:U.proxyUsername||"",proxyPassword:U.proxyPassword||""}),v(U.enableLanDiscovery||!1)},A=async U=>{U.preventDefault();const le=Number(i),E=Number.isFinite(le)&&le>0?Math.floor(le):10,me={...e,enableFailover:n,failoverRecoverySeconds:E};await V.updateConfig(me)?(K.success("配置保存成功"),S()):K.error("配置保存失败")},T=async U=>{U.preventDefault();const le=new FormData(U.currentTarget),E={...e,enableLogging:le.get("enableLogging")==="true",logRetentionDays:parseInt(le.get("logRetentionDays")),maxLogSize:parseInt(le.get("maxLogSize"))};await V.updateConfig(E)?(K.success("日志配置保存成功"),S()):K.error("日志配置保存失败")},L=async U=>{U.preventDefault();const le=new FormData(U.currentTarget),E={...e,proxyEnabled:le.get("proxyEnabled")==="true",proxyUrl:le.get("proxyUrl"),proxyUsername:le.get("proxyUsername"),proxyPassword:le.get("proxyPassword")};await V.updateConfig(E)?(K.success("代理配置保存成功"),S()):K.error("代理配置保存失败")},O=async U=>{v(U);const le={...e,enableLanDiscovery:U};await V.updateConfig(le)?(K.success(U?"已开启局域网同步":"已关闭局域网同步"),S()):(v(!U),K.error("配置保存失败"))},R=async()=>{if(!s){K.warning("请输入密码");return}try{const U=await V.exportData(s);d(U),K.success("导出成功,请复制下方数据")}catch(U){K.error("导出失败: "+U.message)}},_=async()=>{if(!s||!c){K.warning("请输入密码和导入数据");return}w(!0);try{const U=await V.previewImportData(c,s);y(U),U.success||K.error(U.message||"预览失败")}catch(U){K.error("预览失败: "+U.message),y({success:!1,message:U.message})}finally{w(!1)}},X=async()=>{if(!s||!c||!(x!=null&&x.success)){K.warning("请先预览数据并确认无误");return}k(!0);try{const U=await V.importData(c,s);U.success?(K.success(U.message+(U.details?` (${U.details})`:"")),u(""),l(""),y(null)):K.error(U.message+(U.details?`: ${U.details}`:""))}catch(U){K.error("导入失败: "+U.message)}finally{k(!1)}},q=()=>{y(null),u(""),l("")};return e?o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"设置"}),o.jsx("p",{children:"管理应用配置和数据导入导出"})]}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{children:"应用配置"}),o.jsxs("form",{onSubmit:A,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用智能故障切换"}),o.jsxs("select",{name:"enableFailover",value:n?"true":"false",onChange:U=>r(U.target.value==="true"),children:[o.jsx("option",{value:"true",children:"是"}),o.jsx("option",{value:"false",children:"否"})]}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"#666",fontSize:"12px"},children:"启用后,当某个服务报错时会自动切换到备用服务,并按下方“故障自动恢复时间”自动恢复"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"故障自动恢复时间(秒)"}),o.jsx("input",{type:"number",name:"failoverRecoverySeconds",min:1,step:1,value:i,onChange:U=>a(U.target.value),disabled:!n}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"#666",fontSize:"12px"},children:"默认 10 秒。仅在“启用智能故障切换”为“是”时可修改"})]}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存配置"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"日志设置"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"配置请求日志的记录和保留策略。"}),o.jsxs("form",{onSubmit:T,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用日志"}),o.jsxs("select",{name:"enableLogging",defaultValue:e.enableLogging?"true":"false",children:[o.jsx("option",{value:"true",children:"是"}),o.jsx("option",{value:"false",children:"否"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"日志保留天数"}),o.jsx("input",{type:"number",name:"logRetentionDays",defaultValue:e.logRetentionDays,required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"最大日志数量"}),o.jsx("input",{type:"number",name:"maxLogSize",defaultValue:e.maxLogSize,required:!0})]}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存日志配置"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"代理设置"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"配置代理服务器,API 服务可选择是否通过代理转发请求。"}),o.jsxs("form",{onSubmit:L,children:[o.jsx("input",{type:"hidden",name:"proxyEnabled",value:h.proxyEnabled?"true":"false"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用代理"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[o.jsx(Yo,{checked:h.proxyEnabled,onChange:U=>m(le=>({...le,proxyEnabled:U}))}),o.jsx("span",{style:{fontSize:"14px",color:"#666"},children:h.proxyEnabled?"已启用":"未启用"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理地址"}),o.jsx("input",{type:"text",name:"proxyUrl",value:h.proxyUrl,onChange:U=>m(le=>({...le,proxyUrl:U.target.value})),placeholder:"例如: proxy.example.com:8080 或 http://proxy.example.com:8080"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理用户名(可选)"}),o.jsx("input",{type:"text",name:"proxyUsername",value:h.proxyUsername,onChange:U=>m(le=>({...le,proxyUsername:U.target.value})),placeholder:"如果代理需要认证"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理密码(可选)"}),o.jsx("input",{type:"password",name:"proxyPassword",value:h.proxyPassword,onChange:U=>m(le=>({...le,proxyPassword:U.target.value})),placeholder:"如果代理需要认证"})]}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存代理配置"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"局域网同步"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"开启后,同一局域网内的其他 AICodeSwitch 节点可以发现并拉取本节点的 Skills、MCP 配置信息。上游 API Key 等敏感信息不会被传输。"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"允许局域网拉取配置"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[o.jsx(Yo,{checked:g,onChange:O}),o.jsx("span",{style:{fontSize:"14px",color:"#666"},children:g?"已启用":"未启用"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"数据导出"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"导出所有配置数据,包括供应商、API服务、路由等。数据将使用密码加密。"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"加密密码"}),o.jsx("input",{type:"password",value:s,onChange:U=>l(U.target.value),placeholder:"用于加密导出数据"})]}),o.jsx("button",{className:"btn btn-primary",onClick:R,children:"导出数据"}),p&&o.jsxs("div",{className:"form-group",style:{marginTop:"20px"},children:[o.jsx("label",{children:"导出的数据(请复制保存)"}),o.jsx("textarea",{rows:6,value:p,readOnly:!0,style:{fontFamily:"monospace",fontSize:"12px"}}),o.jsx("button",{className:"btn btn-secondary",style:{marginTop:"10px"},onClick:()=>{navigator.clipboard.writeText(p),K.success("已复制到剪贴板")},children:"复制到剪贴板"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"数据导入"}),o.jsx("p",{style:{color:"#e74c3c",fontSize:"14px",fontWeight:500},children:"警告:导入数据将覆盖所有现有配置!请确保已备份重要数据。"}),x!=null&&x.success?o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginTop:"15px",padding:"15px",backgroundColor:"#e8f4fd",borderRadius:"6px",border:"1px solid #bee5eb"},children:[o.jsx("h4",{style:{margin:"0 0 12px 0",color:"#0c5460",fontSize:"16px"},children:"数据预览"}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"10px",marginBottom:"12px"},children:[o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"供应商"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((I=x.data)==null?void 0:I.vendors)||0})]}),o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"API服务"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:(($=x.data)==null?void 0:$.services)||0})]}),o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"路由"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((H=x.data)==null?void 0:H.routes)||0})]}),o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"规则"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((N=x.data)==null?void 0:N.rules)||0})]})]}),o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:[o.jsxs("div",{children:["数据版本: ",(W=x.data)==null?void 0:W.version]}),o.jsxs("div",{children:["导出时间: ",(P=x.data)!=null&&P.exportDate?new Date(x.data.exportDate).toLocaleString("zh-CN"):"-"]})]})]}),o.jsxs("div",{style:{marginTop:"15px",padding:"12px",backgroundColor:"#fff3cd",borderRadius:"4px",border:"1px solid #ffeaa7",color:"#856404"},children:[o.jsx("strong",{children:"确认导入?"})," 此操作将覆盖所有现有的供应商、服务、路由和规则配置,且无法撤销。"]}),o.jsxs("div",{style:{marginTop:"15px",display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-danger",onClick:X,disabled:j,children:j?"导入中...":"确认导入"}),o.jsx("button",{className:"btn btn-secondary",onClick:q,disabled:j,children:"取消"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"解密密码"}),o.jsx("input",{type:"password",value:s,onChange:U=>l(U.target.value),placeholder:"用于解密导入数据"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"导入数据"}),o.jsx("textarea",{rows:6,value:c,onChange:U=>u(U.target.value),placeholder:"粘贴导出的加密数据",style:{fontFamily:"monospace",fontSize:"12px"}})]}),o.jsx("button",{className:"btn btn-primary",onClick:_,disabled:b||!s||!c,children:b?"预览中...":"预览数据"}),(x==null?void 0:x.success)===!1&&o.jsxs("div",{style:{marginTop:"10px",padding:"10px",backgroundColor:"#fdeaea",borderRadius:"4px",color:"#e74c3c"},children:[o.jsx("strong",{children:"预览失败:"}),x.message]})]})]})]}):o.jsx("div",{children:"加载中..."})}function aU(){var h,m,g,v,x,y,b,w;const[e,t]=f.useState({claude:!1,codex:!1}),[n,r]=f.useState({claude:!1,codex:!1}),[i,a]=f.useState({claude:null,codex:null}),[s,l]=f.useState("");f.useEffect(()=>{c()},[]);const c=async()=>{try{const[j,k]=await Promise.all([V.getClaudeConfigStatus(),V.getCodexConfigStatus()]);a({claude:j,codex:k})}catch(j){console.error("Failed to check config status:",j)}},u=async j=>{t(k=>({...k,[j]:!0})),l("");try{(j==="claude"?await V.writeClaudeConfig():await V.writeCodexConfig())?(l(`${j==="claude"?"Claude Code":"Codex"}配置文件写入成功!原始文件已备份为 .aicodeswitch_backup 文件。`),await c()):l("写入失败: 操作未成功")}catch(k){l(`写入失败: ${k.message}`)}finally{t(k=>({...k,[j]:!1}))}},p=async j=>{r(k=>({...k,[j]:!0})),l("");try{(j==="claude"?await V.restoreClaudeConfig():await V.restoreCodexConfig())?(l(`${j==="claude"?"Claude Code":"Codex"}配置文件已从备份恢复!`),await c()):l("恢复失败: 操作未成功")}catch(k){l(`恢复失败: ${k.message}`)}finally{r(k=>({...k,[j]:!1}))}},d=j=>{const k=i[j];if(!k)return null;const S=j==="claude"?"Claude Code":"Codex";return k.isOverwritten&&k.isModified?o.jsxs("p",{style:{color:"#f39c12",fontSize:"12px",marginTop:"10px"},children:["⚠️ 检测到",S,"配置已被修改,但备份文件仍然存在。建议先恢复原始配置,再重新写入以确保配置正确。"]}):k.isOverwritten&&!k.isModified?o.jsxs("p",{style:{color:"#27ae60",fontSize:"12px",marginTop:"10px"},children:["✓ ",S,"配置已正确设置为代理模式,且未被修改。"]}):!k.isOverwritten&&k.hasBackup?o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 检测到配置状态不一致。备份文件存在但当前配置不是代理配置,请先恢复或手动删除备份文件。"}):null};return o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"写入配置"}),o.jsx("p",{children:"将Claude Code和Codex的配置文件写入到用户目录"})]}),o.jsxs("div",{className:"card",style:{marginBottom:"20px"},children:[o.jsx("h3",{children:"Claude Code配置"}),o.jsx("p",{style:{color:"#7f8c8d",marginBottom:"15px"},children:"为Claude Code工具写入配置文件。原始文件将被备份为.aicodeswitch_backup文件。"}),o.jsxs("div",{style:{marginBottom:"15px"},children:[o.jsx("h4",{children:"配置文件:"}),o.jsxs("ul",{style:{color:"#7f8c8d",lineHeight:"1.6"},children:[o.jsxs("li",{children:[o.jsx("code",{children:"~/.claude/settings.json"})," - Claude Code设置"]}),o.jsxs("li",{children:[o.jsx("code",{children:"~/.claude.json"})," - Claude Code初始化设置"]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>u("claude"),disabled:e.claude||(((h=i.claude)==null?void 0:h.isOverwritten)??!1),children:e.claude?"写入中...":"写入Claude Code配置"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>p("claude"),disabled:n.claude||!(((m=i.claude)==null?void 0:m.hasBackup)??!1),children:n.claude?"恢复中...":"恢复Claude Code配置"})]}),d("claude"),((g=i.claude)==null?void 0:g.isOverwritten)&&!((v=i.claude)!=null&&v.isModified)&&o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 配置已被覆盖,如需重新写入请先恢复原始配置"})]}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{children:"Codex配置"}),o.jsx("p",{style:{color:"#7f8c8d",marginBottom:"15px"},children:"为Codex工具写入配置文件。原始文件将被备份为.aicodeswitch_backup文件。"}),o.jsxs("div",{style:{marginBottom:"15px"},children:[o.jsx("h4",{children:"配置文件:"}),o.jsxs("ul",{style:{color:"#7f8c8d",lineHeight:"1.6"},children:[o.jsxs("li",{children:[o.jsx("code",{children:"~/.codex/config.toml"})," - Codex配置"]}),o.jsxs("li",{children:[o.jsx("code",{children:"~/.codex/auth.json"})," - Codex认证信息"]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>u("codex"),disabled:e.codex||(((x=i.codex)==null?void 0:x.isOverwritten)??!1),children:e.codex?"写入中...":"写入Codex配置"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>p("codex"),disabled:n.codex||!(((y=i.codex)==null?void 0:y.hasBackup)??!1),children:n.codex?"恢复中...":"恢复Codex配置"})]}),d("codex"),((b=i.codex)==null?void 0:b.isOverwritten)&&!((w=i.codex)!=null&&w.isModified)&&o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 配置已被覆盖,如需重新写入请先恢复原始配置"})]}),s&&o.jsx("div",{style:{marginTop:"20px",padding:"10px",borderRadius:"4px",backgroundColor:s.includes("成功")?"#d4edda":"#f8d7da",color:s.includes("成功")?"#155724":"#721c24",border:`1px solid ${s.includes("成功")?"#c3e6cb":"#f5c6cb"}`},children:s})]})}const oU=`# AI Code Switch
139
+
140
+ ## 简介
141
+
142
+ AI Code Switch 是帮助你在本地管理 AI 编程工具接入大模型的工具。
143
+ 它可以让你的 Claude Code、Codex 等工具不再局限于官方模型。
144
+ 为所有编程工具提供本地API驱动,自动智能的切换不同场景下的模型。
145
+
146
+ **而且它尽可能简单的帮你解决这件事。**
147
+
148
+ - 视频演示:[https://www.bilibili.com/video/BV1uEznBuEJd/](https://www.bilibili.com/video/BV1uEznBuEJd/?from=github)
149
+ - 1分钟让Claude Code接入GLM国产模型:[https://www.bilibili.com/video/BV1a865B8ErA/](https://www.bilibili.com/video/BV1a865B8ErA/)
150
+ - 1分钟让Codex接入免费模型Agnes:[https://www.bilibili.com/video/BV1tQ7Q63Eva/](https://www.bilibili.com/video/BV1tQ7Q63Eva/) Codex接入Deepseek可参考该方法实现
151
+ - 在线教程:[https://space.bilibili.com/37442719/lists/8333248](https://space.bilibili.com/37442719/lists/8333248)
152
+
153
+ ## 功能要点
154
+
155
+ * 可登记任意的大模型API接口服务,让你可以在一个面板管理你的大模型厂商
156
+ * 一键切换模型:可以注册多个供应商的多个API接口,当想要切换模型时,只需要点击一个按钮就可以立即切换
157
+ * 自动配置:无需你手动去修改claude code或codex的系统配置文件,aicodeswitch自动帮你修改,你只要启动它,无需配置claude code或codex就可以让它们正常工作
158
+ * 一键配置供应商,省去复杂的供应商配置流程
159
+ * 启动所有已知大模型接口标准,可接入任意客户端,包括但不限于openclaw、hermes、trae等,根据不同需要自主配置接口对应的大模型服务
160
+ * API转流:将兼容openai接口标准的模型,轻松接入到claude code中,支持将符合openai、anthropic、gemini的数据格式转发给claude code或codex
161
+ * 按需中转请求:根据请求类型,让不同的模型来处理不同的任务,节省成本,基于该特性,可以让glm等原生非多模态模型支持图像识别
162
+ * 智能故障切换:当API服务发生故障时,智能切换到其他API服务进行尝试,无需手动切换,特别适用于中转服务商
163
+ * 代理:针对无法直接访问的模型服务,例如地区被ban,支持设置代理来解决
164
+ * tokens超量限制:避免其中一个服务商的用量超过限制,浪费了钱,适合有免费额度的服务商
165
+ * 次数超量限制:次数到达一定量后,切换其他服务商,适合coding plan的服务商
166
+ * 日志:超精细的日志记录和会话记录,帮助你发现编程工具本身的问题,以及专研工具的agent逻辑
167
+ * 统计:丰富且详细的统计数据,用量信息快速掌握,发掘自己的编程习惯
168
+ * Skills管理:一键搜索和安装Skills,一键启用skill到claude code或codex
169
+ * MCP管理:一键安装预设MCP,一键启用MCP
170
+ * 导入和导出:一键备份数据,在多太电脑间共享aicodeswitch配置
171
+ * 服务端部署,自定义API Key,支持B/S架构,让aicodeswitch成为在线服务,提供给团队使用
172
+ * 数据完全本地,自主可控
173
+ * 特殊语法:在发送的提示词最前面添加\`[!]\`来直接切换为高智商模型服务(\`[x]\`关闭),简单快捷
174
+
175
+ ![](public/aicodeswitch-flow.svg)
176
+
177
+ ## 桌面客户端
178
+
179
+ 桌面版基于 Electron,内置了 Node 运行时,**无需另外安装 Node.js**。
180
+
181
+ - 下载安装包:[进入下载](https://github.com/tangshuang/aicodeswitch/releases)(提供 Windows \`.exe\`/\`.msi\`、macOS \`.dmg\`(arm64 与 x64)、Linux \`.AppImage\`/\`.deb\`)
182
+ - 本地构建:\`npm install\` 后执行 \`npm run electron:build\`,产物输出到 \`release/\` 目录
183
+
184
+ ## 命令行工具
185
+
186
+ \`\`\`
187
+ # 安装
188
+ npm install -g aicodeswitch
189
+ # 启动服务
190
+ aicos start
191
+ # http://127.0.0.1:4567
192
+ # 启动服务并打开管理界面
193
+ aicos ui
194
+ # 停止服务
195
+ aicos stop
196
+ \`\`\`
197
+
198
+ ## 管理界面
199
+
200
+ **配置供应商**
201
+
202
+ * 什么是供应商?
203
+ * 供应商配置有什么用?
204
+
205
+ 具体请看下方文档。
206
+
207
+ **路由配置**
208
+
209
+ * 什么是路由?
210
+ * 什么是路由规则?
211
+
212
+ 具体请看下方文档。
213
+
214
+ **覆盖配置文件**
215
+
216
+ 在aicodeswitch中,点击“写入Claude Code配置”按钮,它会修改Claude Code的配置文件,让Claude Code开始使用aicocdeswitch提供的模型API,而非直接连到官网的模型API。
217
+
218
+ 你不用太担心,你可以在写入后,点击“恢复Claude Code配置”按钮,将Claude Code的配置文件恢复到原始状态。
219
+
220
+ Codex的配置覆盖逻辑一模一样。
221
+
222
+ **设置**
223
+
224
+ 你可以在设置页面,对aicodedeswitch进行配置。
225
+
226
+ 也可以导出配置数据,转移到其他电脑上导入。
227
+
228
+ ## 配置供应商
229
+
230
+ ### 什么是供应商?
231
+
232
+ 所谓供应商,就是提供AI服务的上游服务商。可以是OpenAI、Claude、DeepSeek、GLM 官方服务,也可以是其他中转服务商。
233
+
234
+ ### 供应商配置有什么用?
235
+
236
+ 通过将你所有的AI服务商统一起来管理,可以帮你:
237
+
238
+ 1. 避免频繁修改配置文件,通过aicodeswitch,可以一键切换到不同的供应商的AI服务API
239
+ 2. 通过aicodeswitch,将不同供应商的接口数据,转换为工具可以正确使用的接口数据格式,也就是说,你可以将Claude Code接入遵循openai的接口数据协议的其他接口
240
+ 3. 避免你忘记曾经注册过那些供应商
241
+ 4. 充分榨干不怎么用的供应商的服务,避免充值后不怎么用浪费了
242
+
243
+ ### 什么是API服务的“源类型”
244
+
245
+ 供应商接口返回的数据格式标准类型,目前支持以下几种:
246
+
247
+ * OpenAI(Responses API标准)
248
+ * OpenAI Chat (Chat Completions API标准)
249
+ * DeepSeek Chat(reasoning_content标准)
250
+ * Claude
251
+ * Claude Chat
252
+ * Gemini
253
+ * Gemini Chat
254
+
255
+ **有什么用?**
256
+
257
+ aicodeswitch内部,会根据“源类型”来转换数据。例如,你的供应商API服务接口是OpenAI Chat的数据格式,而你在路由中配置的“客户端工具“是Claude Code,那么就意味着,这个供应商API的数据,需要经过转换之后才能被Claude Code正确使用。
258
+
259
+ ## 路由管理
260
+
261
+ ### 什么是路由?
262
+
263
+ 路由是aicodeswitch的核心功能,它负责将不同的对象工具(目前指Claude Code和Codex)的请求,路由到不同的供应商API服务上。
264
+
265
+ ### 什么是“客户端工具”?
266
+
267
+ 目前指Claude Code或Codex。
268
+
269
+ ### 什么是“路由规则”?
270
+
271
+ 以Claude Code为例,它的请求实际上并非铁板一块,可以被分为多种。比如它的深度思考、长文对话、图片理解等等,都是可以独立对待的。
272
+
273
+ 路由规则的目的,就是让你的工具发出的请求,可以根据这个区分,发送给不同的服务商来处理。例如,你默认使用glm-4.7作为写代码的模型,但是,你可以把图片识别的请求发给doubao-code来进行,因为doubao-code的图片识别平均价格可以更低。同样的道理,不同目标的请求可以通过不同的规则来处理,以提升编程的质量和效果。
274
+
275
+ 目前,我仅提供了几个比较容易区分的规则,以后,还会添加更多的规则。
276
+
277
+ ### 激活路由
278
+
279
+ 我们可以为Claude Code添加多个路由,但是,我们必须激活一个路由,才能开始使用。
280
+ 而且,所有以Claude Code为对象的路由,在同一时间,只有一个可以被激活。
281
+
282
+ ### 切换路由
283
+
284
+ 你可以根据你的实际情况来实时切换路由,比如,你可以在发现自己的某个服务商处的余额较少时,立即切换到另外一个服务商。
285
+
286
+ **智能故障切换机制**
287
+
288
+ 当同一请求类型配置多个规则时,系统会按排序优先使用第一个,如果某个服务报错(4xx/5xx)或请求超时,将自动切换到下一个可用规则,确保你可以正常使用coding工具。
289
+
290
+ ### 数据转流
291
+
292
+ 支持将openai的流式响应数据转换成Claude Code的流式数据,并支持实时转换,从而可以让你使用支持openAI的API服务来在Claude Code中使用。
293
+
294
+ *不过,需要注意,如果你的API服务商不支持tools,或者所支持的max_tokens太小,是无法在Claude Code中使用的。*
295
+
296
+ ## Skills管理
297
+
298
+ 你可以在 aicodeswitch 中集中统一管理 skills,把skills分发给claude code和codex,随时启用和停用skills。
299
+ 另外,你可以基于自然语言搜索skills,找到skill之后,支持一键安装。
300
+
301
+ ## MCP管理
302
+
303
+ 你可以在 aicodeswitch 中集中统一管理 MCP,把MCP分发给claude code和codex,随时启用和停用MCP。
304
+ 并且,你还可以通过MCP来实现图像理解。
305
+
306
+ ## 日志
307
+
308
+ 在**日志**页面,您可以查看:
309
+
310
+ **请求日志**:所有 API 请求的详细记录
311
+
312
+ * 请求来源和目标
313
+ * 请求内容和响应
314
+ * 耗时和状态码
315
+ * 错误信息(如有)
316
+
317
+ **错误日志**:错误和异常记录
318
+
319
+ * 错误类型
320
+ * 错误详情
321
+ * 发生时间
322
+
323
+ **会话日志**:按照会话session来汇集日志
324
+
325
+ **日志筛选**
326
+
327
+ 根据提供的选项进行筛选。
328
+
329
+ ## 配置文件
330
+
331
+ 作为 CLI 工具,你可以在 ~/.aicodeswitch/ 目录下找到工具的相关文件。里面有一个 aicodeswitch.conf 文件,可以进行配置。
332
+ 目前仅支持以下配置:
333
+
334
+ \`\`\`
335
+ # aicodeswitch的服务端口
336
+ PORT=4567
337
+
338
+ # 如果提供AUTH,你无法直接登录用户界面,必须输入AUTH的值才能进入,相当于是一个登陆鉴权
339
+ # 如果你在自己的服务器上使用,通过远程接入接口时,就必须提供这个值
340
+ # AUTH=
341
+ \`\`\`
342
+
343
+ > 服务监听地址由 AUTH 模式自动决定,无需也无法通过配置修改:
344
+ > - AUTH 关闭:仅监听 \`127.0.0.1\`(本机访问)
345
+ > - AUTH 开启:监听 \`0.0.0.0\`(允许远端 AccessKey 客户端连接)
346
+ >
347
+ > 写入本地编程工具(Claude Code / Codex)配置文件的地址、以及 UI / CLI 展示的访问地址,统一使用 \`127.0.0.1\`。
348
+
349
+ ## 常见问题
350
+
351
+ ### 1\\. 如何切换供应商?
352
+
353
+ 在路由管理页面修改规则的目标供应商,或调整优先级即可。
354
+
355
+ ### 2\\. 如何查看失败的请求?
356
+
357
+ 在请求日志页面,筛选状态码不为 200 的记录。
358
+
359
+ ### 3\\. 如何备份配置?
360
+
361
+ 在系统设置页面使用**导出配置**功能,然后将提供的数据保存到本地文件中。
362
+
363
+ ### 4\\. 如何设置日志保留时间?
364
+
365
+ 在系统设置页面修改**日志保留天数**配置。
366
+
367
+ ## 我的开源
368
+
369
+ * [PCM](https://github.com/tangshuang/pcm): 用户意图识别、精准上下文、多线对话的Agent系统
370
+ * [Lan Transfer](https://github.com/tangshuang/lan-transfer): 免费高效的局域网文件互传工具
371
+ * [MCP Bone](https://github.com/tangshuang/mcp-bone): 远程托管的MCP服管理工具
372
+ * [Anys](https://github.com/tangshuang/anys): 免费前端监控kit
373
+ * [WebCut](https://github.com/tangshuang/webcut): 免费开源的网页端视频剪辑UI框架
374
+ * [indb](https://github.com/tangshuang/indb): 网页端轻量kv数据库操作库
375
+ * [Formast](https://github.com/tangshuang/formast): 复杂业务场景下的企业级JSON驱动表单框架
376
+
377
+ ## 关联资源
378
+
379
+ * [Claude Code 深度教程](https://claudecode.tangshuang.net): 100%免费的Claude Code入门到精通教程
380
+ * [AICodingBus](https://aicodingbus.24x7.to): AI Tokens 交换平台
381
+
382
+ ## 支持我
383
+
384
+ ![](public/donate-to-me.png)
385
+
386
+ 你的支持是我前进的动力!
387
+
388
+ ## 许可
389
+
390
+ 此项目采用双许可证模式:
391
+
392
+ * **开源使用**:项目默认采用 GPL 3.0 许可证,允许个人免费使用、修改和分发,但所有衍生品必须开源。
393
+ * **商业使用**:如果您希望商业化使用而不遵守 GPL 条款(例如闭源销售),请联系我们购买单独的商业许可证。
394
+
395
+ ## 技术支持
396
+
397
+ 如有问题或建议,请访问项目 [GitHub 仓库](https://github.com/tangshuang/aicodeswitch/issues)提交 Issue。
398
+ `,sU=()=>o.jsx("div",{className:"markdown-content",children:o.jsx(Kc,{children:oU})});function qI(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=qI(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qI(e))&&(r&&(r+=" "),r+=t);return r}var lU=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function G0(e){if(typeof e!="string")return!1;var t=lU;return t.includes(e)}var cU=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],uU=new Set(cU);function YI(e){return typeof e!="string"?!1:uU.has(e)}function GI(e){return typeof e=="string"&&e.startsWith("data-")}function ir(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(YI(n)||GI(n))&&(t[n]=e[n]);return t}function as(e){if(e==null)return null;if(f.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return ir(t)}return typeof e=="object"&&!Array.isArray(e)?ir(e):null}function xr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(YI(n)||GI(n)||G0(n))&&(t[n]=e[n]);return t}function dU(e){return e==null?null:f.isValidElement(e)?xr(e.props):typeof e=="object"&&!Array.isArray(e)?xr(e):null}var pU=["children","width","height","viewBox","className","style","title","desc"];function Ov(){return Ov=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ov.apply(null,arguments)}function fU(e,t){if(e==null)return{};var n,r,i=hU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hU(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var X0=f.forwardRef((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,s=e.className,l=e.style,c=e.title,u=e.desc,p=fU(e,pU),d=a||{width:r,height:i,x:0,y:0},h=yt("recharts-surface",s);return f.createElement("svg",Ov({},xr(p),{className:h,width:r,height:i,style:l,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),f.createElement("title",null,c),f.createElement("desc",null,u),n)}),mU=["children","className"];function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nv.apply(null,arguments)}function gU(e,t){if(e==null)return{};var n,r,i=yU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yU(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Xt=f.forwardRef((e,t)=>{var n=e.children,r=e.className,i=gU(e,mU),a=yt("recharts-layer",r);return f.createElement("g",Nv({className:a},xr(i),{ref:t}),n)}),XI=f.createContext(null),vU=()=>f.useContext(XI);function Ot(e){return function(){return e}}const QI=Math.cos,df=Math.sin,fi=Math.sqrt,pf=Math.PI,_h=2*pf,Mv=Math.PI,Rv=2*Mv,Eo=1e-6,xU=Rv-Eo;function ZI(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function bU(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ZI;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class wU{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ZI:bU(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,c=r-t,u=i-n,p=s-t,d=l-n,h=p*p+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Eo)if(!(Math.abs(d*c-u*p)>Eo)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-s,g=i-l,v=c*c+u*u,x=m*m+g*g,y=Math.sqrt(v),b=Math.sqrt(h),w=a*Math.tan((Mv-Math.acos((v+h-x)/(2*y*b)))/2),j=w/b,k=w/y;Math.abs(j-1)>Eo&&this._append`L${t+j*p},${n+j*d}`,this._append`A${a},${a},0,0,${+(d*m>p*g)},${this._x1=t+k*c},${this._y1=n+k*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=t+l,p=n+c,d=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${u},${p}`:(Math.abs(this._x1-u)>Eo||Math.abs(this._y1-p)>Eo)&&this._append`L${u},${p}`,r&&(h<0&&(h=h%Rv+Rv),h>xU?this._append`A${r},${r},0,1,${d},${t-l},${n-c}A${r},${r},0,1,${d},${this._x1=u},${this._y1=p}`:h>Eo&&this._append`A${r},${r},0,${+(h>=Mv)},${d},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Q0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new wU(t)}function Z0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function JI(e){this._context=e}JI.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 Lh(e){return new JI(e)}function eO(e){return e[0]}function tO(e){return e[1]}function nO(e,t){var n=Ot(!0),r=null,i=Lh,a=null,s=Q0(l);e=typeof e=="function"?e:e===void 0?eO:Ot(e),t=typeof t=="function"?t:t===void 0?tO:Ot(t);function l(c){var u,p=(c=Z0(c)).length,d,h=!1,m;for(r==null&&(a=i(m=s())),u=0;u<=p;++u)!(u<p&&n(d=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(d,u,c),+t(d,u,c));if(m)return a=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Ot(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Ot(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Ot(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function Ud(e,t,n){var r=null,i=Ot(!0),a=null,s=Lh,l=null,c=Q0(u);e=typeof e=="function"?e:e===void 0?eO:Ot(+e),t=typeof t=="function"?t:Ot(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?tO:Ot(+n);function u(d){var h,m,g,v=(d=Z0(d)).length,x,y=!1,b,w=new Array(v),j=new Array(v);for(a==null&&(l=s(b=c())),h=0;h<=v;++h){if(!(h<v&&i(x=d[h],h,d))===y)if(y=!y)m=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=m;--g)l.point(w[g],j[g]);l.lineEnd(),l.areaEnd()}y&&(w[h]=+e(x,h,d),j[h]=+t(x,h,d),l.point(r?+r(x,h,d):w[h],n?+n(x,h,d):j[h]))}if(b)return l=null,b+""||null}function p(){return nO().defined(i).curve(s).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Ot(+d),r=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Ot(+d),u):e},u.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Ot(+d),u):r},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Ot(+d),n=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Ot(+d),u):t},u.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Ot(+d),u):n},u.lineX0=u.lineY0=function(){return p().x(e).y(t)},u.lineY1=function(){return p().x(e).y(n)},u.lineX1=function(){return p().x(r).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:Ot(!!d),u):i},u.curve=function(d){return arguments.length?(s=d,a!=null&&(l=s(a)),u):s},u.context=function(d){return arguments.length?(d==null?a=l=null:l=s(a=d),u):a},u}class rO{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function jU(e){return new rO(e,!0)}function SU(e){return new rO(e,!1)}const J0={draw(e,t){const n=fi(t/pf);e.moveTo(n,0),e.arc(0,0,n,0,_h)}},kU={draw(e,t){const n=fi(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},iO=fi(1/3),CU=iO*2,PU={draw(e,t){const n=fi(t/CU),r=n*iO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},AU={draw(e,t){const n=fi(t),r=-n/2;e.rect(r,r,n,n)}},EU=.8908130915292852,aO=df(pf/10)/df(7*pf/10),TU=df(_h/10)*aO,IU=-QI(_h/10)*aO,OU={draw(e,t){const n=fi(t*EU),r=TU*n,i=IU*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=_h*a/5,l=QI(s),c=df(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},_g=fi(3),NU={draw(e,t){const n=-fi(t/(_g*3));e.moveTo(0,n*2),e.lineTo(-_g*n,-n),e.lineTo(_g*n,-n),e.closePath()}},Mr=-.5,Rr=fi(3)/2,_v=1/fi(12),MU=(_v/2+1)*3,RU={draw(e,t){const n=fi(t/MU),r=n/2,i=n*_v,a=r,s=n*_v+n,l=-a,c=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(l,c),e.lineTo(Mr*r-Rr*i,Rr*r+Mr*i),e.lineTo(Mr*a-Rr*s,Rr*a+Mr*s),e.lineTo(Mr*l-Rr*c,Rr*l+Mr*c),e.lineTo(Mr*r+Rr*i,Mr*i-Rr*r),e.lineTo(Mr*a+Rr*s,Mr*s-Rr*a),e.lineTo(Mr*l+Rr*c,Mr*c-Rr*l),e.closePath()}};function _U(e,t){let n=null,r=Q0(i);e=typeof e=="function"?e:Ot(e||J0),t=typeof t=="function"?t:Ot(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Ot(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Ot(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function ff(){}function hf(e,t,n){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+n)/6)}function oO(e){this._context=e}oO.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:hf(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:hf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function LU(e){return new oO(e)}function sO(e){this._context=e}sO.prototype={areaStart:ff,areaEnd:ff,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:hf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function DU(e){return new sO(e)}function lO(e){this._context=e}lO.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 n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:hf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zU(e){return new lO(e)}function cO(e){this._context=e}cO.prototype={areaStart:ff,areaEnd:ff,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 $U(e){return new cO(e)}function KS(e){return e<0?-1:1}function HS(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),l=(a*i+s*r)/(r+i);return(KS(a)+KS(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function VS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Lg(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,s-l*n,a,s)}function mf(e){this._context=e}mf.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:Lg(this,this._t0,VS(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 n=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,Lg(this,VS(this,n=HS(this,e,t)),n);break;default:Lg(this,this._t0,n=HS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function uO(e){this._context=new dO(e)}(uO.prototype=Object.create(mf.prototype)).point=function(e,t){mf.prototype.point.call(this,t,e)};function dO(e){this._context=e}dO.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,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function BU(e){return new mf(e)}function FU(e){return new uO(e)}function pO(e){this._context=e}pO.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,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=qS(e),i=qS(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&n===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 qS(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function UU(e){return new pO(e)}function Dh(e,t){this._context=e,this._t=t}Dh.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;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function WU(e){return new Dh(e,.5)}function KU(e){return new Dh(e,0)}function HU(e){return new Dh(e,1)}function os(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,l=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Lv(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function VU(e,t){return e[t]}function qU(e){const t=[];return t.key=e,t}function YU(){var e=Ot([]),t=Lv,n=os,r=VU;function i(a){var s=Array.from(e.apply(this,arguments),qU),l,c=s.length,u=-1,p;for(const d of a)for(l=0,++u;l<c;++l)(s[l][u]=[0,+r(d,s[l].key,u,a)]).data=d;for(l=0,p=Z0(t(s));l<c;++l)s[p[l]].index=l;return n(s,p),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Ot(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Ot(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Lv:typeof a=="function"?a:Ot(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??os,i):n},i}function GU(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}os(e,t)}}function XU(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var s=0,l=0;s<i;++s)l+=e[s][n][1]||0;r[n][1]+=r[n][0]=-l/2}os(e,t)}}function QU(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var l=0,c=0,u=0;l<s;++l){for(var p=e[t[l]],d=p[r][1]||0,h=p[r-1][1]||0,m=(d-h)/2,g=0;g<l;++g){var v=e[t[g]],x=v[r][1]||0,y=v[r-1][1]||0;m+=x-y}c+=d,u+=m*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,os(e,t)}}function Dv(e){return e==="__proto__"}function fO(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function eb(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is((t=e==null?void 0:e.valueOf)==null?void 0:t.call(e),-0)?"-0":String(e)}function hO(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(hO).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function tb(e){if(Array.isArray(e))return e.map(eb);if(typeof e=="symbol")return[e];e=hO(e);const t=[],n=e.length;if(n===0)return t;let r=0,i="",a="",s=!1;for(e.charCodeAt(0)===46&&t.push("");r<n;){const l=e[r];if(a)l==="\\"&&r+1<n?(r++,i+=e[r]):l===a?a="":i+=l;else if(s)l==='"'||l==="'"?a=l:l==="]"?(s=!1,t.push(i),i=""):i+=l;else if(l==="[")s=!0,i&&(t.push(i),i="");else if(l==="."){i&&(t.push(i),i="");const c=e[r+1];(c===void 0||c===".")&&t.push("")}else i+=l;r++}return i&&t.push(i),t}function Fi(e,t,n){if(e==null)return n;switch(typeof t){case"string":{if(Dv(t))return n;const r=e[t];return r===void 0?fO(t)&&!Object.hasOwn(e,t)?Fi(e,tb(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=eb(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return ZU(e,t,n);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),Dv(t))return n;const r=e[t];return r===void 0?n:r}}}function ZU(e,t,n){if(t.length===0)return n;let r=e;for(let i=0;i<t.length;i++){if(r==null||Dv(t[i]))return n;r=r[t[i]]}return r===void 0?n:r}var JU=4;function aa(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JU,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Dn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,s)=>{var l=n[s-1];return typeof l=="string"?i+l+a:l!==void 0?i+aa(l)+a:i+a},"")}var kn=e=>e===0?0:e>0?1:-1,ui=e=>typeof e=="number"&&e!=+e,ss=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,Ce=e=>(typeof e=="number"||e instanceof Number)&&!ui(e),Ui=e=>Ce(e)||typeof e=="string",eW=0,vu=e=>{var t=++eW;return"".concat(e||"").concat(t)},qn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ce(t)&&typeof t!="string")return r;var a;if(ss(t)){if(n==null)return r;var s=t.indexOf("%");a=n*parseFloat(t.slice(0,s))/100}else a=+t;return ui(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},mO=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Nt(e,t,n){return Ce(e)&&Ce(t)?aa(e+n*(t-e)):t}function gO(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Fi(r,t))===n)}var Bt=e=>e===null||typeof e>"u",Uu=e=>Bt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function fr(e){return e!=null}function po(){}var tW=["type","size","sizeType"];function zv(){return zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zv.apply(null,arguments)}function YS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function GS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YS(Object(n),!0).forEach(function(r){nW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nW(e,t,n){return(t=rW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rW(e){var t=iW(e,"string");return typeof t=="symbol"?t:t+""}function iW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aW(e,t){if(e==null)return{};var n,r,i=oW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var yO={symbolCircle:J0,symbolCross:kU,symbolDiamond:PU,symbolSquare:AU,symbolStar:OU,symbolTriangle:NU,symbolWye:RU},sW=Math.PI/180,lW=e=>{var t="symbol".concat(Uu(e));return yO[t]||J0},cW=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*sW;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},uW=(e,t)=>{yO["symbol".concat(Uu(e))]=t},vO=e=>{var t=e.type,n=t===void 0?"circle":t,r=e.size,i=r===void 0?64:r,a=e.sizeType,s=a===void 0?"area":a,l=aW(e,tW),c=GS(GS({},l),{},{type:n,size:i,sizeType:s}),u="circle";typeof n=="string"&&(u=n);var p=()=>{var v=lW(u),x=_U().type(v).size(cW(i,s,u)),y=x();if(y!==null)return y},d=c.className,h=c.cx,m=c.cy,g=xr(c);return Ce(h)&&Ce(m)&&Ce(i)?f.createElement("path",zv({},g,{className:yt("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(m,")"),d:p()})):null};vO.registerSymbol=uW;var xO=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,nb=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(f.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{G0(i)&&typeof n[i]=="function"&&(r[i]=a=>n[i](n,a))}),r},dW=(e,t,n)=>r=>(e(t,n,r),null),Wu=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];G0(i)&&typeof a=="function"&&(r||(r={}),r[i]=dW(a,t,n))}),r};function XS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XS(Object(n),!0).forEach(function(r){fW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fW(e,t,n){return(t=hW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hW(e){var t=mW(e,"string");return typeof t=="symbol"?t:t+""}function mW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pn(e,t){var n=pW({},e),r=t,i=Object.keys(t),a=i.reduce((s,l)=>(s[l]===void 0&&r[l]!==void 0&&(s[l]=r[l]),s),n);return a}function gf(){return gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gf.apply(null,arguments)}function QS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QS(Object(n),!0).forEach(function(r){gW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gW(e,t,n){return(t=yW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yW(e){var t=vW(e,"string");return typeof t=="symbol"?t:t+""}function vW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dr=32,xW={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function bW(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function wW(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=Dr/2,a=Dr/6,s=Dr/3,l=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return f.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:bW(t.payload),x1:0,y1:i,x2:Dr,y2:i,className:"recharts-legend-icon"});if(c==="line")return f.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(s,`
399
+ A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(i,`
400
+ H`).concat(Dr,"M").concat(2*s,",").concat(i,`
401
+ A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return f.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Dr/8,"h").concat(Dr,"v").concat(Dr*3/4,"h").concat(-Dr,"z"),className:"recharts-legend-icon"});if(f.isValidElement(t.legendIcon)){var u=bO({},t);return delete u.legendIcon,f.cloneElement(t.legendIcon,u)}return f.createElement(vO,{fill:l,cx:i,cy:i,size:Dr,sizeType:"diameter",type:c})}function jW(e){var t=e.payload,n=e.iconSize,r=e.layout,i=e.formatter,a=e.inactiveColor,s=e.iconType,l=e.labelStyle,c={x:0,y:0,width:Dr,height:Dr},u={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,h)=>{var m=d.formatter||i,g=yt({"recharts-legend-item":!0,["legend-item-".concat(h)]:!0,inactive:d.inactive});if(d.type==="none")return null;var v=typeof l=="object"?bO({},l):{};v.color=d.inactive?a:v.color||d.color;var x=m?m(d.value,d,h):d.value;return f.createElement("li",gf({className:g,style:u,key:"legend-item-".concat(h)},Wu(e,d,h)),f.createElement(X0,{width:n,height:n,viewBox:c,style:p,"aria-label":d.value==null?"legend icon":"".concat(d.value," legend icon")},f.createElement(wW,{data:d,iconType:s,inactiveColor:a})),f.createElement("span",{className:"recharts-legend-item-text",style:v},x))})}var SW=e=>{var t=pn(e,xW),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return f.createElement("ul",{className:"recharts-default-legend",style:a},f.createElement(jW,gf({},t,{payload:n})))};function kW(e,t){const n=new Map;for(let r=0;r<e.length;r++){const i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function CW(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function wO(e){return e}function PW(e){return function(t){return Fi(t,e)}}function $v(e){return e==null||typeof e!="object"&&typeof e!="function"}function AW(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function EW(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function rb(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const TW="[object RegExp]",jO="[object String]",SO="[object Number]",kO="[object Boolean]",CO="[object Arguments]",IW="[object Symbol]",OW="[object Date]",NW="[object Map]",MW="[object Set]",RW="[object Array]",_W="[object ArrayBuffer]",LW="[object Object]",DW="[object DataView]",zW="[object Uint8Array]",$W="[object Uint8ClampedArray]",BW="[object Uint16Array]",FW="[object Uint32Array]",UW="[object Int8Array]",WW="[object Int16Array]",KW="[object Int32Array]",HW="[object Float32Array]",VW="[object Float64Array]",ZS=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function qW(e){return typeof ZS.Buffer<"u"&&ZS.Buffer.isBuffer(e)}function YW(e,t){return Do(e,void 0,e,new Map,t)}function Do(e,t,n,r=new Map,i=void 0){const a=i==null?void 0:i(e,t,n,r);if(a!==void 0)return a;if($v(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const s=new Array(e.length);r.set(e,s);for(let l=0;l<e.length;l++)s[l]=Do(e[l],l,n,r,i);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;r.set(e,s);for(const[l,c]of e)s.set(l,Do(c,l,n,r,i));return s}if(e instanceof Set){const s=new Set;r.set(e,s);for(const l of e)s.add(Do(l,void 0,n,r,i));return s}if(qW(e))return e.subarray();if(AW(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,s);for(let l=0;l<e.length;l++)s[l]=Do(e[l],l,n,r,i);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,s),ni(s,e,n,r,i),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return r.set(e,s),ni(s,e,n,r,i),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return r.set(e,s),ni(s,e,n,r,i),s}if(e instanceof Error){const s=structuredClone(e);return r.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,ni(s,e,n,r,i),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return r.set(e,s),ni(s,e,n,r,i),s}if(e instanceof Number){const s=new Number(e.valueOf());return r.set(e,s),ni(s,e,n,r,i),s}if(e instanceof String){const s=new String(e.valueOf());return r.set(e,s),ni(s,e,n,r,i),s}if(typeof e=="object"&&GW(e)){const s=Object.create(Object.getPrototypeOf(e));return r.set(e,s),ni(s,e,n,r,i),s}return e}function ni(e,t,n=e,r,i){const a=[...Object.keys(t),...EW(t)];for(let s=0;s<a.length;s++){const l=a[s],c=Object.getOwnPropertyDescriptor(e,l);(c==null||c.writable)&&(e[l]=Do(t[l],l,n,r,i))}}function GW(e){switch(rb(e)){case CO:case RW:case _W:case DW:case kO:case OW:case HW:case VW:case UW:case WW:case KW:case NW:case SO:case LW:case TW:case MW:case jO:case IW:case zW:case $W:case BW:case FW:return!0;default:return!1}}function XW(e){return Do(e,void 0,e,new Map,void 0)}function Ep(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function PO(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function AO(e,t,n){return typeof n!="function"?AO(e,t,()=>{}):Bv(e,t,function r(i,a,s,l,c,u){const p=n(i,a,s,l,c,u);return p!==void 0?!!p:Bv(i,a,r,u,!1)},new Map,!0)}function Bv(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case"object":return QW(e,t,n,r);case"function":return Object.keys(t).length>0?Bv(e,{...t},n,r,i):Ep(e,t);default:return PO(e)&&i?typeof t=="string"?t==="":!0:Ep(e,t)}}function QW(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return EO(e,t,n,r);if(t instanceof Map)return ZW(e,t,n,r);if(t instanceof Set)return JW(e,t,n,r);const i=Object.keys(t);if(e==null||$v(e))return i.length===0;if(i.length===0)return!0;if(r!=null&&r.has(t))return r.get(t)===e;r==null||r.set(t,e);try{for(let a=0;a<i.length;a++){const s=i[a];if(!$v(e)&&!(s in e)||t[s]===void 0&&e[s]!==void 0||t[s]===null&&e[s]!==null||!n(e[s],t[s],s,e,t,r))return!1}return!0}finally{r==null||r.delete(t)}}function ZW(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(const[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function EO(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;const i=new Set;for(let a=0;a<t.length;a++){const s=t[a];let l=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;const u=e[c];let p=!1;if(n(u,s,a,e,t,r)&&(p=!0),p){i.add(c),l=!0;break}}if(!l)return!1}return!0}function JW(e,t,n,r){return t.size===0?!0:e instanceof Set?EO([...e],[...t],n,r):!1}function TO(e,t){return AO(e,t,()=>{})}function e9(e){return e=XW(e),t=>TO(t,e)}function t9(e,t){return YW(e,(n,r,i,a)=>{if(typeof e=="object"){if(rb(e)==="[object Object]"&&typeof e.constructor!="function"){const s={};return a.set(e,s),ni(s,e,i,a),s}switch(Object.prototype.toString.call(e)){case SO:case jO:case kO:{const s=new e.constructor(e==null?void 0:e.valueOf());return ni(s,e),s}case CO:{const s={};return ni(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}function n9(e){return t9(e)}const r9=/^(?:0|[1-9]\d*)$/;function IO(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return r9.test(e)}}function i9(e){return e!==null&&typeof e=="object"&&rb(e)==="[object Arguments]"}function a9(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&fO(t)&&(e==null?void 0:e[t])==null?n=tb(t):n=[t],n.length===0)return!1;let r=e;for(let i=0;i<n.length;i++){const a=n[i];if((r==null||!Object.hasOwn(r,a))&&!((Array.isArray(r)||i9(r))&&IO(a)&&a<r.length))return!1;r=r[a]}return!0}function o9(e,t){switch(typeof e){case"object":Object.is(e==null?void 0:e.valueOf(),-0)&&(e="-0");break;case"number":e=eb(e);break}return t=n9(t),function(n){const r=Fi(n,e);return r===void 0?a9(n,e):t===void 0?r===void 0:TO(r,t)}}function s9(e){if(e==null)return wO;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?o9(e[0],e[1]):e9(e);case"string":case"symbol":case"number":return PW(e)}}function l9(e){return Number.isSafeInteger(e)&&e>=0}function OO(e){return e!=null&&typeof e!="function"&&l9(e.length)}function c9(e){return typeof e=="object"&&e!==null}function u9(e){return c9(e)&&OO(e)}function JS(e,t=wO){return u9(e)?kW(Array.from(e),CW(s9(t),1)):[]}function NO(e,t,n){return t===!0?JS(e,n):typeof t=="function"?JS(e,t):e}var MO={exports:{}},RO={},_O={exports:{}},LO={};/**
402
+ * @license React
403
+ * use-sync-external-store-shim.production.js
404
+ *
405
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
406
+ *
407
+ * This source code is licensed under the MIT license found in the
408
+ * LICENSE file in the root directory of this source tree.
409
+ */var Cl=f;function d9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var p9=typeof Object.is=="function"?Object.is:d9,f9=Cl.useState,h9=Cl.useEffect,m9=Cl.useLayoutEffect,g9=Cl.useDebugValue;function y9(e,t){var n=t(),r=f9({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return m9(function(){i.value=n,i.getSnapshot=t,Dg(i)&&a({inst:i})},[e,n,t]),h9(function(){return Dg(i)&&a({inst:i}),e(function(){Dg(i)&&a({inst:i})})},[e]),g9(n),n}function Dg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!p9(e,n)}catch{return!0}}function v9(e,t){return t()}var x9=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?v9:y9;LO.useSyncExternalStore=Cl.useSyncExternalStore!==void 0?Cl.useSyncExternalStore:x9;_O.exports=LO;var b9=_O.exports;/**
410
+ * @license React
411
+ * use-sync-external-store-shim/with-selector.production.js
412
+ *
413
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
414
+ *
415
+ * This source code is licensed under the MIT license found in the
416
+ * LICENSE file in the root directory of this source tree.
417
+ */var zh=f,w9=b9;function j9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var S9=typeof Object.is=="function"?Object.is:j9,k9=w9.useSyncExternalStore,C9=zh.useRef,P9=zh.useEffect,A9=zh.useMemo,E9=zh.useDebugValue;RO.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=C9(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=A9(function(){function c(m){if(!u){if(u=!0,p=m,m=r(m),i!==void 0&&s.hasValue){var g=s.value;if(i(g,m))return d=g}return d=m}if(g=d,S9(p,m))return g;var v=r(m);return i!==void 0&&i(g,v)?(p=m,g):(p=m,d=v)}var u=!1,p,d,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var l=k9(e,a[0],a[1]);return P9(function(){s.hasValue=!0,s.value=l},[l]),E9(l),l};MO.exports=RO;var T9=MO.exports,ib=f.createContext(null),I9=e=>e,Ct=()=>{var e=f.useContext(ib);return e?e.store.dispatch:I9},Tp=()=>{},O9=()=>Tp,N9=(e,t)=>e===t;function Ie(e){var t=f.useContext(ib),n=f.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Tp,[t,e]);return T9.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:O9,t?t.store.getState:Tp,t?t.store.getState:Tp,n,N9)}function M9(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function R9(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var ek=e=>Array.isArray(e)?e:[e];function _9(e){const t=Array.isArray(e[0])?e[0]:e;return R9(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function L9(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var D9=class{constructor(e){this.value=e}deref(){return this.value}},z9=()=>typeof WeakRef>"u"?D9:WeakRef,DO=z9(),$9=0,tk=1;function Wd(){return{s:$9,v:void 0,o:null,p:null}}function B9(e){return e instanceof DO?e.deref():e}function zO(e,t={}){let n=Wd();const{resultEqualityCheck:r}=t;let i,a=0;function s(){let l=n;const{length:c}=arguments;for(let d=0,h=c;d<h;d++){const m=arguments[d];if(typeof m=="function"||typeof m=="object"&&m!==null){let g=l.o;g===null&&(l.o=g=new WeakMap);const v=g.get(m);v===void 0?(l=Wd(),g.set(m,l)):l=v}else{let g=l.p;g===null&&(l.p=g=new Map);const v=g.get(m);v===void 0?(l=Wd(),g.set(m,l)):l=v}}const u=l;let p;if(l.s===tk)p=l.v;else if(p=e.apply(null,arguments),a++,r){const d=B9(i);d!=null&&r(d,p)&&(p=d,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new DO(p):p}return u.s=tk,u.v=p,p}return s.clearCache=()=>{n=Wd(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function F9(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,s=0,l,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),M9(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const p={...n,...c},{memoize:d,memoizeOptions:h=[],argsMemoize:m=zO,argsMemoizeOptions:g=[]}=p,v=ek(h),x=ek(g),y=_9(i),b=d(function(){return a++,u.apply(null,arguments)},...v),w=m(function(){s++;const k=L9(y,arguments);return l=b.apply(null,k),l},...x);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var G=F9(zO);function U9(e,t=1){const n=[],r=Math.floor(t),i=(a,s)=>{for(let l=0;l<a.length;l++){const c=a[l];Array.isArray(c)&&s<r?i(c,s+1):n.push(c)}};return i(e,0),n}function Fv(e,t,n){return PO(n)&&(typeof t=="number"&&OO(n)&&IO(t)&&t<n.length||typeof t=="string"&&t in n)?Ep(n[t],e):!1}function nk(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const W9=(e,t,n)=>{if(e!==t){const r=nk(e),i=nk(t);if(r===i&&r===0){if(e<t)return n==="desc"?1:-1;if(e>t)return n==="desc"?-1:1}return n==="desc"?i-r:r-i}return 0};function $O(e){return typeof e=="symbol"||e instanceof Symbol}const K9=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H9=/^\w*$/;function V9(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||$O(e)?!0:typeof e=="string"&&(H9.test(e)||!K9.test(e))||t!=null}function q9(e,t,n,r){if(e==null)return[];n=n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(l=>String(l));const i=(l,c)=>{let u=l;for(let p=0;p<c.length&&u!=null;++p)u=u[c[p]];return u},a=(l,c)=>c==null||l==null?c:typeof l=="object"&&"key"in l?Object.hasOwn(c,l.key)?c[l.key]:i(c,l.path):typeof l=="function"?l(c):Array.isArray(l)?i(c,l):typeof c=="object"?c[l]:c,s=t.map(l=>(Array.isArray(l)&&l.length===1&&(l=l[0]),l==null||typeof l=="function"||Array.isArray(l)||V9(l)?l:{key:l,path:tb(l)}));return e.map(l=>({original:l,criteria:s.map(c=>a(c,l))})).slice().sort((l,c)=>{for(let u=0;u<s.length;u++){const p=W9(l.criteria[u],c.criteria[u],n[u]);if(p!==0)return p}return 0}).map(l=>l.original)}function $h(e,...t){const n=t.length;return n>1&&Fv(e,t[0],t[1])?t=[]:n>2&&Fv(t[0],t[1],t[2])&&(t=[t[0]]),q9(e,U9(t),["asc"])}var BO=e=>e.legend.settings,Y9=e=>e.legend.size,G9=e=>e.legend.payload,X9=G([G9,BO],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?$h(r,n):r});function Q9(){return Ie(X9)}function Z9(e,t){return nK(e)||tK(e,t)||eK(e,t)||J9()}function J9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
418
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eK(e,t){if(e){if(typeof e=="string")return rk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rk(e,t):void 0}}function rk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function nK(e){if(Array.isArray(e))return e}var Kd=1;function ik(e,t){return Math.abs(e.height-t.height)>Kd||Math.abs(e.left-t.left)>Kd||Math.abs(e.top-t.top)>Kd||Math.abs(e.width-t.width)>Kd}function ak(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function FO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=f.useState({height:0,left:0,top:0,width:0}),n=Z9(t,2),r=n[0],i=n[1],a=f.useRef(null),s=f.useRef(r);s.current=r;var l=f.useCallback(c=>{if(a.current!=null&&(a.current.disconnect(),a.current=null),c!=null){var u=ak(c);if(ik(u,s.current)&&i(u),typeof ResizeObserver<"u"){var p=new ResizeObserver(()=>{var d=ak(c);ik(d,s.current)&&i(d)});p.observe(c),a.current=p}}},[...e]);return f.useEffect(()=>()=>{var c;(c=a.current)===null||c===void 0||c.disconnect()},[]),[r,l]}function Mn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var rK=typeof Symbol=="function"&&Symbol.observable||"@@observable",ok=rK,zg=()=>Math.random().toString(36).substring(7).split("").join("."),iK={INIT:`@@redux/INIT${zg()}`,REPLACE:`@@redux/REPLACE${zg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${zg()}`},yf=iK;function ab(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function UO(e,t,n){if(typeof e!="function")throw new Error(Mn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Mn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Mn(1));return n(UO)(e,t)}let r=e,i=t,a=new Map,s=a,l=0,c=!1;function u(){s===a&&(s=new Map,a.forEach((x,y)=>{s.set(y,x)}))}function p(){if(c)throw new Error(Mn(3));return i}function d(x){if(typeof x!="function")throw new Error(Mn(4));if(c)throw new Error(Mn(5));let y=!0;u();const b=l++;return s.set(b,x),function(){if(y){if(c)throw new Error(Mn(6));y=!1,u(),s.delete(b),a=null}}}function h(x){if(!ab(x))throw new Error(Mn(7));if(typeof x.type>"u")throw new Error(Mn(8));if(typeof x.type!="string")throw new Error(Mn(17));if(c)throw new Error(Mn(9));try{c=!0,i=r(i,x)}finally{c=!1}return(a=s).forEach(b=>{b()}),x}function m(x){if(typeof x!="function")throw new Error(Mn(10));r=x,h({type:yf.REPLACE})}function g(){const x=d;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(Mn(11));function b(){const j=y;j.next&&j.next(p())}return b(),{unsubscribe:x(b)}},[ok](){return this}}}return h({type:yf.INIT}),{dispatch:h,subscribe:d,getState:p,replaceReducer:m,[ok]:g}}function aK(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:yf.INIT})>"u")throw new Error(Mn(12));if(typeof n(void 0,{type:yf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Mn(13))})}function WO(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const s=t[a];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{aK(n)}catch(a){i=a}return function(s={},l){if(i)throw i;let c=!1;const u={};for(let p=0;p<r.length;p++){const d=r[p],h=n[d],m=s[d],g=h(m,l);if(typeof g>"u")throw l&&l.type,new Error(Mn(14));u[d]=g,c=c||g!==m}return c=c||r.length!==Object.keys(s).length,c?u:s}}function vf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function oK(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Mn(15))};const s={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},l=e.map(c=>c(s));return a=vf(...l)(i.dispatch),{...i,dispatch:a}}}function KO(e){return ab(e)&&"type"in e&&typeof e.type=="string"}var HO=Symbol.for("immer-nothing"),sk=Symbol.for("immer-draftable"),ar=Symbol.for("immer-state");function ai(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pr=Object,Pl=Pr.getPrototypeOf,xf="constructor",Bh="prototype",Uv="configurable",bf="enumerable",Ip="writable",xu="value",ma=e=>!!e&&!!e[ar];function di(e){var t;return e?VO(e)||Uh(e)||!!e[sk]||!!((t=e[xf])!=null&&t[sk])||Wh(e)||Kh(e):!1}var sK=Pr[Bh][xf].toString(),lk=new WeakMap;function VO(e){if(!e||!ob(e))return!1;const t=Pl(e);if(t===null||t===Pr[Bh])return!0;const n=Pr.hasOwnProperty.call(t,xf)&&t[xf];if(n===Object)return!0;if(!$s(n))return!1;let r=lk.get(n);return r===void 0&&(r=Function.toString.call(n),lk.set(n,r)),r===sK}function Fh(e,t,n=!0){Ku(e)===0?(n?Reflect.ownKeys(e):Pr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Ku(e){const t=e[ar];return t?t.type_:Uh(e)?1:Wh(e)?2:Kh(e)?3:0}var $g=(e,t,n=Ku(e))=>n===2?e.has(t):Pr[Bh].hasOwnProperty.call(e,t),Wv=(e,t,n=Ku(e))=>n===2?e.get(t):e[t],wf=(e,t,n,r=Ku(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function lK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Uh=Array.isArray,Wh=e=>e instanceof Map,Kh=e=>e instanceof Set,ob=e=>typeof e=="object",$s=e=>typeof e=="function",Bg=e=>typeof e=="boolean";function cK(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ei=e=>e.copy_||e.base_,sb=e=>e.modified_?e.copy_:e.base_;function Kv(e,t){if(Wh(e))return new Map(e);if(Kh(e))return new Set(e);if(Uh(e))return Array[Bh].slice.call(e);const n=VO(e);if(t===!0||t==="class_only"&&!n){const r=Pr.getOwnPropertyDescriptors(e);delete r[ar];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],l=r[s];l[Ip]===!1&&(l[Ip]=!0,l[Uv]=!0),(l.get||l.set)&&(r[s]={[Uv]:!0,[Ip]:!0,[bf]:l[bf],[xu]:e[s]})}return Pr.create(Pl(e),r)}else{const r=Pl(e);if(r!==null&&n)return{...e};const i=Pr.create(r);return Pr.assign(i,e)}}function lb(e,t=!1){return Hh(e)||ma(e)||!di(e)||(Ku(e)>1&&Pr.defineProperties(e,{set:Hd,add:Hd,clear:Hd,delete:Hd}),Pr.freeze(e),t&&Fh(e,(n,r)=>{lb(r,!0)},!1)),e}function uK(){ai(2)}var Hd={[xu]:uK};function Hh(e){return e===null||!ob(e)?!0:Pr.isFrozen(e)}var jf="MapSet",Hv="Patches",ck="ArrayMethods",qO={};function ls(e){const t=qO[e];return t||ai(0,e),t}var uk=e=>!!qO[e],bu,YO=()=>bu,dK=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:uk(jf)?ls(jf):void 0,arrayMethodsPlugin_:uk(ck)?ls(ck):void 0});function dk(e,t){t&&(e.patchPlugin_=ls(Hv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Vv(e){qv(e),e.drafts_.forEach(pK),e.drafts_=null}function qv(e){e===bu&&(bu=e.parent_)}var pk=e=>bu=dK(bu,e);function pK(e){const t=e[ar];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[ar].modified_&&(Vv(t),ai(4)),di(e)&&(e=hk(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[ar].base_,e,t)}else e=hk(t,n);return fK(t,e,!0),Vv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==HO?e:void 0}function hk(e,t){if(Hh(t))return t;const n=t[ar];if(!n)return Sf(t,e.handledSet_,e);if(!Vh(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);QO(n,e)}return n.copy_}function fK(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&lb(t,n)}function GO(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Vh=(e,t)=>e.scope_===t,hK=[];function XO(e,t,n,r){const i=Ei(e),a=e.type_;if(r!==void 0&&Wv(i,r,a)===t){wf(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;Fh(i,(c,u)=>{if(ma(u)){const p=l.get(u)||[];p.push(c),l.set(u,p)}})}const s=e.draftLocations_.get(t)??hK;for(const l of s)wf(i,l,n,a)}function mK(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!Vh(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const s=sb(a);XO(e,a.draft_??a,s,n),QO(a,i)})}function QO(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}GO(e)}}function gK(e,t,n){const{scope_:r}=e;if(ma(n)){const i=n[ar];Vh(i,r)&&i.callbacks_.push(function(){Op(e);const s=sb(i);XO(e,n,s,t)})}else di(n)&&e.callbacks_.push(function(){const a=Ei(e);e.type_===3?a.has(n)&&Sf(n,r.handledSet_,r):Wv(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Sf(Wv(e.copy_,t,e.type_),r.handledSet_,r)})}function Sf(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ma(e)||t.has(e)||!di(e)||Hh(e)||(t.add(e),Fh(e,(r,i)=>{if(ma(i)){const a=i[ar];if(Vh(a,n)){const s=sb(a);wf(e,r,s,e.type_),GO(a)}}else di(i)&&Sf(i,t,n)})),e}function yK(e,t){const n=Uh(e),r={type_:n?1:0,scope_:t?t.scope_:YO(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=kf;n&&(i=[r],a=wu);const{revoke:s,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=s,[l,r]}var kf={get(e,t){if(t===ar)return e;if(t==="constructor"||t==="__proto__"){const l=Ei(e)[t];return new Proxy(l||{},{get:(c,u)=>u==="__proto__"||u==="prototype"?Object.freeze(Object.create(null)):Reflect.get(c,u),set:()=>!0,apply:(c,u,p)=>Reflect.apply(c,u,p)})}let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Ei(e);if(!$g(i,t,e.type_))return vK(e,i,t);const a=i[t];if(e.finalized_||!di(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&cK(t))return a;if(a===Fg(e.base_,t)){Op(e);const s=e.type_===1?+t:t,l=Gv(e.scope_,a,e,s);return e.copy_[s]=l}return a},has(e,t){return t==="constructor"||t==="__proto__"||t==="prototype"?!1:t in Ei(e)},ownKeys(e){return Reflect.ownKeys(Ei(e))},set(e,t,n){if(t==="constructor"||t==="__proto__"||t==="prototype")return!0;const r=ZO(Ei(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Fg(Ei(e),t),a=i==null?void 0:i[ar];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(lK(n,i)&&(n!==void 0||$g(e.base_,t,e.type_)))return!0;Op(e),Yv(e)}return e.copy_[t]===n&&(n!==void 0||$g(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),gK(e,t,n)),!0},deleteProperty(e,t){return Op(e),Fg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Yv(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ei(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ip]:!0,[Uv]:e.type_!==1||t!=="length",[bf]:r[bf],[xu]:n[t]}},defineProperty(){ai(11)},getPrototypeOf(e){return Pl(e.base_)},setPrototypeOf(){ai(12)}},wu={};for(let e in kf){let t=kf[e];wu[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}wu.deleteProperty=function(e,t){return wu.set.call(this,e,t,void 0)};wu.set=function(e,t,n){return kf.set.call(this,e[0],t,n,e[0])};function Fg(e,t){const n=e[ar];return(n?Ei(n):e)[t]}function vK(e,t,n){var i;const r=ZO(t,n);return r?xu in r?r[xu]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function ZO(e,t){if(!(t in e))return;let n=Pl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Pl(n)}}function Yv(e){e.modified_||(e.modified_=!0,e.parent_&&Yv(e.parent_))}function Op(e){e.copy_||(e.assigned_=new Map,e.copy_=Kv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var xK=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if($s(t)&&!$s(n)){const a=n;n=t;const s=this;return function(c=a,...u){return s.produce(c,p=>n.call(this,p,...u))}}$s(n)||ai(6),r!==void 0&&!$s(r)&&ai(7);let i;if(di(t)){const a=pk(this),s=Gv(a,t,void 0);let l=!0;try{i=n(s),l=!1}finally{l?Vv(a):qv(a)}return dk(a,r),fk(i,a)}else if(!t||!ob(t)){if(i=n(t),i===void 0&&(i=t),i===HO&&(i=void 0),this.autoFreeze_&&lb(i,!0),r){const a=[],s=[];ls(Hv).generateReplacementPatches_(t,i,{patches_:a,inversePatches_:s}),r(a,s)}return i}else ai(1,t)},this.produceWithPatches=(t,n)=>{if($s(t))return(s,...l)=>this.produceWithPatches(s,c=>t(c,...l));let r,i;return[this.produce(t,n,(s,l)=>{r=s,i=l}),r,i]},Bg(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Bg(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Bg(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){di(e)||ai(8),ma(e)&&(e=Wr(e));const t=pk(this),n=Gv(t,e,void 0);return n[ar].isManual_=!0,qv(t),n}finishDraft(e,t){const n=e&&e[ar];(!n||!n.isManual_)&&ai(9);const{scope_:r}=n;return dk(r,t),fk(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=ls(Hv).applyPatches_;return ma(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Gv(e,t,n,r){const[i,a]=Wh(t)?ls(jf).proxyMap_(t,n):Kh(t)?ls(jf).proxySet_(t,n):yK(t,n);return((n==null?void 0:n.scope_)??YO()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?mK(n,a,r):a.callbacks_.push(function(c){var p;(p=c.mapSetPlugin_)==null||p.fixSetContents(a);const{patchPlugin_:u}=c;a.modified_&&u&&u.generatePatches_(a,[],c)}),i}function Wr(e){return ma(e)||ai(10,e),JO(e)}function JO(e){if(!di(e)||Hh(e))return e;const t=e[ar];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Kv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Kv(e,!0);return Fh(n,(i,a)=>{wf(n,i,JO(a))},r),t&&(t.finalized_=!1),n}var bK=new xK,eN=bK.produce,mt=e=>e;function tN(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var wK=tN(),jK=tN,SK=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?vf:vf.apply(null,arguments)};function Ir(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Er(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>KO(r)&&r.type===e,n}var nN=class Tc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Tc.prototype)}static get[Symbol.species](){return Tc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Tc(...t[0].concat(this)):new Tc(...t.concat(this))}};function mk(e){return di(e)?eN(e,()=>{}):e}function Vd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function kK(e){return typeof e=="boolean"}var CK=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let s=new nN;return n&&(kK(n)?s.push(wK):s.push(jK(n.extraArgument))),s},rN="RTK_autoBatch",Dt=()=>e=>({payload:e,meta:{[rN]:!0}}),gk=e=>t=>{setTimeout(t,e)},PK=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(s),n())},a=e(i),s=setTimeout(i,t)},iN=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,s=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?PK(window.requestAnimationFrame,100):gk(10):e.type==="callback"?e.queueNotification:gk(e.timeout),u=()=>{s=!1,a&&(a=!1,l.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const d=()=>i&&p(),h=r.subscribe(d);return l.add(p),()=>{h(),l.delete(p)}},dispatch(p){var d;try{return i=!((d=p==null?void 0:p.meta)!=null&&d[rN]),a=!i,a&&(s||(s=!0,c(u))),r.dispatch(p)}finally{i=!0}}})},AK=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new nN(e);return r&&i.push(iN(typeof r=="object"?r:void 0)),i};function EK(e){const t=CK(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(ab(n))l=WO(n);else throw new Error(Er(1));let c;typeof r=="function"?c=r(t):c=t();let u=vf;i&&(u=SK({trace:!1,...typeof i=="object"&&i}));const p=oK(...c),d=AK(p);let h=typeof s=="function"?s(d):d();const m=u(...h);return UO(l,a,m)}function aN(e){const t={},n=[];let r;const i={addCase(a,s){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(Er(28));if(l in t)throw new Error(Er(29));return t[l]=s,i},addAsyncThunk(a,s){return s.pending&&(t[a.pending.type]=s.pending),s.rejected&&(t[a.rejected.type]=s.rejected),s.fulfilled&&(t[a.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:a.settled,reducer:s.settled}),i},addMatcher(a,s){return n.push({matcher:a,reducer:s}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function TK(e){return typeof e=="function"}function IK(e,t){let[n,r,i]=aN(t),a;if(TK(e))a=()=>mk(e());else{const l=mk(e);a=()=>l}function s(l=a(),c){let u=[n[c.type],...r.filter(({matcher:p})=>p(c)).map(({reducer:p})=>p)];return u.filter(p=>!!p).length===0&&(u=[i]),u.reduce((p,d)=>{if(d)if(ma(p)){const m=d(p,c);return m===void 0?p:m}else{if(di(p))return eN(p,h=>d(h,c));{const h=d(p,c);if(h===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return p},l)}return s.getInitialState=a,s}var OK="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",NK=(e=21)=>{let t="",n=e;for(;n--;)t+=OK[Math.random()*64|0];return t},MK=Symbol.for("rtk-slice-createasyncthunk");function RK(e,t){return`${e}/${t}`}function _K({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[MK];return function(i){const{name:a,reducerPath:s=a}=i;if(!a)throw new Error(Er(11));const l=(typeof i.reducers=="function"?i.reducers(DK()):i.reducers)||{},c=Object.keys(l),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(j,k){const S=typeof j=="string"?j:j.type;if(!S)throw new Error(Er(12));if(S in u.sliceCaseReducersByType)throw new Error(Er(13));return u.sliceCaseReducersByType[S]=k,p},addMatcher(j,k){return u.sliceMatchers.push({matcher:j,reducer:k}),p},exposeAction(j,k){return u.actionCreators[j]=k,p},exposeCaseReducer(j,k){return u.sliceCaseReducersByName[j]=k,p}};c.forEach(j=>{const k=l[j],S={reducerName:j,type:RK(a,j),createNotation:typeof i.reducers=="function"};$K(k)?FK(S,k,p,t):zK(S,k,p)});function d(){const[j={},k=[],S=void 0]=typeof i.extraReducers=="function"?aN(i.extraReducers):[i.extraReducers],A={...j,...u.sliceCaseReducersByType};return IK(i.initialState,T=>{for(let L in A)T.addCase(L,A[L]);for(let L of u.sliceMatchers)T.addMatcher(L.matcher,L.reducer);for(let L of k)T.addMatcher(L.matcher,L.reducer);S&&T.addDefaultCase(S)})}const h=j=>j,m=new Map,g=new WeakMap;let v;function x(j,k){return v||(v=d()),v(j,k)}function y(){return v||(v=d()),v.getInitialState()}function b(j,k=!1){function S(T){let L=T[j];return typeof L>"u"&&k&&(L=Vd(g,S,y)),L}function A(T=h){const L=Vd(m,k,()=>new WeakMap);return Vd(L,T,()=>{const O={};for(const[R,_]of Object.entries(i.selectors??{}))O[R]=LK(_,T,()=>Vd(g,T,y),k);return O})}return{reducerPath:j,getSelectors:A,get selectors(){return A(S)},selectSlice:S}}const w={name:a,reducer:x,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:y,...b(s),injectInto(j,{reducerPath:k,...S}={}){const A=k??s;return j.inject({reducerPath:A,reducer:x},S),{...w,...b(A,!0)}}};return w}}function LK(e,t,n,r){function i(a,...s){let l=t(a);return typeof l>"u"&&r&&(l=n()),e(l,...s)}return i.unwrapped=e,i}var Xn=_K();function DK(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function zK({type:e,reducerName:t,createNotation:n},r,i){let a,s;if("reducer"in r){if(n&&!BK(r))throw new Error(Er(17));a=r.reducer,s=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?Ir(e,s):Ir(e))}function $K(e){return e._reducerDefinitionType==="asyncThunk"}function BK(e){return e._reducerDefinitionType==="reducerWithPrepare"}function FK({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Er(18));const{payloadCreator:a,fulfilled:s,pending:l,rejected:c,settled:u,options:p}=n,d=i(e,a,p);r.exposeAction(t,d),s&&r.addCase(d.fulfilled,s),l&&r.addCase(d.pending,l),c&&r.addCase(d.rejected,c),u&&r.addMatcher(d.settled,u),r.exposeCaseReducer(t,{fulfilled:s||qd,pending:l||qd,rejected:c||qd,settled:u||qd})}function qd(){}var UK="task",oN="listener",sN="completed",cb="cancelled",WK=`task-${cb}`,KK=`task-${sN}`,Xv=`${oN}-${cb}`,HK=`${oN}-${sN}`,qh=class{constructor(e){Be(this,"code");Be(this,"name","TaskAbortError");Be(this,"message");this.code=e,this.message=`${UK} ${cb} (reason: ${e})`}},ub=(e,t)=>{if(typeof e!="function")throw new TypeError(Er(32))},Cf=()=>{},lN=(e,t=Cf)=>(e.catch(t),e),cN=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Go=e=>{if(e.aborted)throw new qh(e.reason)};function uN(e,t){let n=Cf;return new Promise((r,i)=>{const a=()=>i(new qh(e.reason));if(e.aborted){a();return}n=cN(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Cf})}var VK=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof qh?"cancelled":"rejected",error:n}}finally{t==null||t()}},Pf=e=>t=>lN(uN(e,t).then(n=>(Go(e),n))),dN=e=>{const t=Pf(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:dl}=Object,yk={},Yh="listenerMiddleware",qK=(e,t)=>{const n=r=>cN(e,()=>r.abort(e.reason));return(r,i)=>{ub(r);const a=new AbortController;n(a);const s=VK(async()=>{Go(e),Go(a.signal);const l=await r({pause:Pf(a.signal),delay:dN(a.signal),signal:a.signal});return Go(a.signal),l},()=>a.abort(KK));return i!=null&&i.autoJoin&&t.push(s.catch(Cf)),{result:Pf(e)(s),cancel(){a.abort(WK)}}}},YK=(e,t)=>{const n=async(r,i)=>{Go(t);let a=()=>{};const l=[new Promise((c,u)=>{let p=e({predicate:r,effect:(d,h)=>{h.unsubscribe(),c([d,h.getState(),h.getOriginalState()])}});a=()=>{p(),u()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await uN(t,Promise.race(l));return Go(t),c}finally{a()}};return(r,i)=>lN(n(r,i))},pN=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Ir(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Er(21));return ub(a),{predicate:i,type:t,effect:a}},fN=dl(e=>{const{type:t,predicate:n,effect:r}=pN(e);return{id:NK(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Er(22))}}},{withTypes:()=>fN}),vk=(e,t)=>{const{type:n,effect:r,predicate:i}=pN(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Qv=e=>{e.pending.forEach(t=>{t.abort(Xv)})},GK=(e,t)=>()=>{for(const n of t.keys())Qv(n);e.clear()},xk=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},hN=dl(Ir(`${Yh}/add`),{withTypes:()=>hN}),XK=Ir(`${Yh}/removeAll`),mN=dl(Ir(`${Yh}/remove`),{withTypes:()=>mN}),QK=(...e)=>{console.error(`${Yh}/error`,...e)},Hu=(e={})=>{const t=new Map,n=new Map,r=m=>{const g=n.get(m)??0;n.set(m,g+1)},i=m=>{const g=n.get(m)??1;g===1?n.delete(m):n.set(m,g-1)},{extra:a,onError:s=QK}=e;ub(s);const l=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),g=>{m.unsubscribe(),g!=null&&g.cancelActive&&Qv(m)}),c=m=>{const g=vk(t,m)??fN(m);return l(g)};dl(c,{withTypes:()=>c});const u=m=>{const g=vk(t,m);return g&&(g.unsubscribe(),m.cancelActive&&Qv(g)),!!g};dl(u,{withTypes:()=>u});const p=async(m,g,v,x)=>{const y=new AbortController,b=YK(c,y.signal),w=[];try{m.pending.add(y),r(m),await Promise.resolve(m.effect(g,dl({},v,{getOriginalState:x,condition:(j,k)=>b(j,k).then(Boolean),take:b,delay:dN(y.signal),pause:Pf(y.signal),extra:a,signal:y.signal,fork:qK(y.signal,w),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((j,k,S)=>{j!==y&&(j.abort(Xv),S.delete(j))})},cancel:()=>{y.abort(Xv),m.pending.delete(y)},throwIfCancelled:()=>{Go(y.signal)}})))}catch(j){j instanceof qh||xk(s,j,{raisedBy:"effect"})}finally{await Promise.all(w),y.abort(HK),i(m),m.pending.delete(y)}},d=GK(t,n);return{middleware:m=>g=>v=>{if(!KO(v))return g(v);if(hN.match(v))return c(v.payload);if(XK.match(v)){d();return}if(mN.match(v))return u(v.payload);let x=m.getState();const y=()=>{if(x===yk)throw new Error(Er(23));return x};let b;try{if(b=g(v),t.size>0){const w=m.getState(),j=Array.from(t.values());for(const k of j){let S=!1;try{S=k.predicate(v,w,x)}catch(A){S=!1,xk(s,A,{raisedBy:"predicate"})}S&&p(k,v,m,y)}}}finally{x=yk}return b},startListening:c,stopListening:u,clearListeners:d}};function Er(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ZK={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},gN=Xn({name:"chartLayout",initialState:ZK,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),Gh=gN.actions,JK=Gh.setMargin,eH=Gh.setLayout,tH=Gh.setChartSize,nH=Gh.setScale,rH=gN.reducer;function yN(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function et(e){return Number.isFinite(e)}function Wi(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function bk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function el(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bk(Object(n),!0).forEach(function(r){iH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iH(e,t,n){return(t=aH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aH(e){var t=oH(e,"string");return typeof t=="symbol"?t:t+""}function oH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gt(e,t,n){return Bt(e)||Bt(t)?n:Ui(t)?Fi(e,t,n):typeof t=="function"?t(e):n}var sH=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,s=t.verticalAlign,l=t.layout;if((l==="vertical"||l==="horizontal"&&s==="middle")&&a!=="center"&&Ce(e[a]))return el(el({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&s!=="middle"&&Ce(e[s]))return el(el({},e),{},{[s]:e[s]+(i||0)})}return e},hi=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",vN=(e,t,n,r)=>{if(r)return e.map(l=>l.coordinate);var i,a,s=e.map(l=>(l.coordinate===t&&(i=!0),l.coordinate===n&&(a=!0),l.coordinate));return i||s.push(t),a||s.push(n),s},xN=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,s=e.scale,l=e.realScaleType,c=e.isCategorical,u=e.categoricalDomain,p=e.tickCount,d=e.ticks,h=e.niceTicks,m=e.axisType;if(!s)return null;var g=l==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,v=i==="category"&&s.bandwidth?s.bandwidth()/g:0;if(v=m==="angleAxis"&&a&&a.length>=2?kn(a[0]-a[1])*2*v:v,d||h){var x=(d||h||[]).map((y,b)=>{var w=r?r.indexOf(y):y,j=s.map(w);return et(j)?{coordinate:j+v,value:y,offset:v,index:b}:null}).filter(fr);return x}return c&&u?u.map((y,b)=>{var w=s.map(y);return et(w)?{coordinate:w+v,value:y,index:b,offset:v}:null}).filter(fr):s.ticks&&p!=null?s.ticks(p).map((y,b)=>{var w=s.map(y);return et(w)?{coordinate:w+v,value:y,index:b,offset:v}:null}).filter(fr):s.domain().map((y,b)=>{var w=s.map(y);return et(w)?{coordinate:w+v,value:r?r[y]:y,index:b,offset:v}:null}).filter(fr)},lH=(e,t)=>{if(!t||t.length!==2||!Ce(t[0])||!Ce(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Ce(e[0])||e[0]<n)&&(i[0]=n),(!Ce(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},cH=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,s=0,l=0;l<n;++l){var c=e[l],u=c==null?void 0:c[i];if(u!=null){var p=u[1],d=u[0],h=ui(p)?d:p;h>=0?(u[0]=a,a+=h,u[1]=a):(u[0]=s,s+=h,u[1]=s)}}}},uH=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,s=0;s<n;++s){var l=e[s],c=l==null?void 0:l[i];if(c!=null){var u=ui(c[1])?c[0]:c[1];u>=0?(c[0]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},dH={sign:cH,expand:GU,none:os,silhouette:XU,wiggle:QU,positive:uH},pH=(e,t,n)=>{var r,i=(r=dH[n])!==null&&r!==void 0?r:os,a=YU().keys(t).value((l,c)=>Number(gt(l,c,0))).order(Lv).offset(i),s=a(e);return s.forEach((l,c)=>{l.forEach((u,p)=>{var d=gt(e[p],t[c],0);Array.isArray(d)&&d.length===2&&Ce(d[0])&&Ce(d[1])&&(u[0]=d[0],u[1]=d[1])})}),s};function bN(e){return e==null?void 0:String(e)}function Af(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Bt(i[t.dataKey])){var l=gO(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=gt(i,Bt(s)?t.dataKey:s),u=t.scale.map(c);return Ce(u)?u:null}var wk=e=>{var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,s=e.index;if(t.type==="category")return n[s]?n[s].coordinate+r:null;var l=gt(a,t.dataKey,t.scale.domain()[s]);if(Bt(l))return null;var c=t.scale.map(l);return Ce(c)?c-i/2+r:null},fH=e=>{var t=e.numericAxis,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},hH=e=>{var t=e.flat(2).filter(Ce);return[Math.min(...t),Math.max(...t)]},mH=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],gH=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return mH(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var s=a.stackedData,l=s.reduce((c,u)=>{var p=yN(u,t,n),d=hH(p);return!et(d[0])||!et(d[1])?c:[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},jk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Sk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,io=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=$h(t,p=>p.coordinate),a=1/0,s=1,l=i.length;s<l;s++){var c=i[s],u=i[s-1];a=Math.min(((c==null?void 0:c.coordinate)||0)-((u==null?void 0:u.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function kk(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return el(el({},t),{},{dataKey:n,payload:r,value:i,name:a})}function fo(e,t){if(e!=null)return String(e);if(typeof t=="string")return t}var yH=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},vH=(e,t)=>t==="centric"?e.angle:e.radius,ja=e=>e.layout.width,Sa=e=>e.layout.height,xH=e=>e.layout.scale,wN=e=>e.layout.margin,Xh=G(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Qh=G(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),jN="data-recharts-item-index",SN="data-recharts-item-id",Vu=60;function Ck(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ck(Object(n),!0).forEach(function(r){bH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ck(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bH(e,t,n){return(t=wH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wH(e){var t=jH(e,"string");return typeof t=="symbol"?t:t+""}function jH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SH=e=>e.brush.height;function kH(e){var t=Qh(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Vu;return n+i}return n},0)}function CH(e){var t=Qh(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Vu;return n+i}return n},0)}function PH(e){var t=Xh(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function AH(e){var t=Xh(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var xn=G([ja,Sa,wN,SH,kH,CH,PH,AH,BO,Y9],(e,t,n,r,i,a,s,l,c,u)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},d={top:(n.top||0)+s,bottom:(n.bottom||0)+l},h=Yd(Yd({},d),p),m=h.bottom;h.bottom+=r,h=sH(h,c,u);var g=e-h.left-h.right,v=t-h.top-h.bottom;return Yd(Yd({brushBottom:m},h),{},{width:Math.max(g,0),height:Math.max(v,0)})}),EH=G(xn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),db=G(ja,Sa,(e,t)=>({x:0,y:0,width:e,height:t})),TH=f.createContext(null),Pn=()=>f.useContext(TH)!=null,Zh=e=>e.brush,Jh=G([Zh,xn,wN],(e,t,n)=>({height:e.height,x:Ce(e.x)?e.x:t.left,y:Ce(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Ce(e.width)?e.width:t.width}));function IH(e,t,{signal:n,edges:r}={}){let i,a=null;const s=r!=null&&r.includes("leading"),l=r==null||r.includes("trailing"),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},u=()=>{l&&c(),m()};let p=null;const d=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,u()},t)},h=()=>{p!==null&&(clearTimeout(p),p=null)},m=()=>{h(),i=void 0,a=null},g=()=>{c()},v=function(...x){if(n!=null&&n.aborted)return;i=this,a=x;const y=p==null;d(),s&&y&&c()};return v.schedule=d,v.cancel=m,v.flush=g,n==null||n.addEventListener("abort",m,{once:!0}),v}function OH(e,t=0,n={}){typeof n!="object"&&(n={});const{leading:r=!1,trailing:i=!0,maxWait:a}=n,s=Array(2);r&&(s[0]="leading"),i&&(s[1]="trailing");let l,c=null;const u=IH(function(...h){l=e.apply(this,h),c=null},t,{edges:s}),p=function(...h){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(l=e.apply(this,h),c=Date.now(),u.cancel(),u.schedule(),l):(u.apply(this,h),l)},d=()=>(u.flush(),l);return p.cancel=u.cancel,p.flush=d,p}function NH(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return OH(e,t,{leading:r,maxWait:t,trailing:i})}var Ef=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(n.replace(/%s/g,()=>i[s++]))}},Ri={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},kN=(e,t,n)=>{var r=n.width,i=r===void 0?Ri.width:r,a=n.height,s=a===void 0?Ri.height:a,l=n.aspect,c=n.maxHeight,u=ss(i)?e:Number(i),p=ss(s)?t:Number(s);return l&&l>0&&(u?p=u/l:p&&(u=p*l),c&&p!=null&&p>c&&(p=c)),{calculatedWidth:u,calculatedHeight:p}},MH={width:0,height:0,overflow:"visible"},RH={width:0,overflowX:"visible"},_H={height:0,overflowY:"visible"},LH={},DH=e=>{var t=e.width,n=e.height,r=ss(t),i=ss(n);return r&&i?MH:r?RH:i?_H:LH};function zH(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Ri.width,a=Ri.height):i===void 0?i=r&&r>0?void 0:Ri.width:a===void 0&&(a=r&&r>0?void 0:Ri.height),{width:i,height:a}}var $H=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Tf(){return Tf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tf.apply(null,arguments)}function Pk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ak(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pk(Object(n),!0).forEach(function(r){BH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BH(e,t,n){return(t=FH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FH(e){var t=UH(e,"string");return typeof t=="symbol"?t:t+""}function UH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WH(e,t){return qH(e)||VH(e,t)||HH(e,t)||KH()}function KH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
419
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HH(e,t){if(e){if(typeof e=="string")return Ek(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ek(e,t):void 0}}function Ek(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function VH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function qH(e){if(Array.isArray(e))return e}function YH(e,t){if(e==null)return{};var n,r,i=GH(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GH(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var CN=f.createContext(Ri.initialDimension);function XH(e){return Wi(e.width)&&Wi(e.height)}function PN(e){var t=e.children,n=e.width,r=e.height,i=f.useMemo(()=>({width:n,height:r}),[n,r]);return XH(i)?f.createElement(CN.Provider,{value:i},t):null}var pb=()=>f.useContext(CN),QH=f.forwardRef((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Ri.initialDimension:r,a=e.width,s=e.height,l=e.minWidth,c=l===void 0?Ri.minWidth:l,u=e.minHeight,p=e.maxHeight,d=e.children,h=e.debounce,m=h===void 0?Ri.debounce:h,g=e.id,v=e.className,x=e.onResize,y=e.style,b=y===void 0?{}:y,w=YH(e,$H),j=f.useRef(null),k=f.useRef();k.current=x,f.useImperativeHandle(t,()=>j.current);var S=f.useState({containerWidth:i.width,containerHeight:i.height}),A=WH(S,2),T=A[0],L=A[1],O=f.useCallback(($,H)=>{L(N=>{var W=Math.round($),P=Math.round(H);return N.containerWidth===W&&N.containerHeight===P?N:{containerWidth:W,containerHeight:P}})},[]);f.useEffect(()=>{if(j.current==null||typeof ResizeObserver>"u")return po;var $=U=>{var le,E=U[0];if(E!=null){var me=E.contentRect,ye=me.width,Q=me.height;O(ye,Q),(le=k.current)===null||le===void 0||le.call(k,ye,Q)}};m>0&&($=NH($,m,{trailing:!0,leading:!1}));var H=new ResizeObserver($),N=j.current.getBoundingClientRect(),W=N.width,P=N.height;return O(W,P),H.observe(j.current),()=>{H.disconnect()}},[O,m]);var R=T.containerWidth,_=T.containerHeight;Ef(!n||n>0,"The aspect(%s) must be greater than zero.",n);var X=kN(R,_,{width:a,height:s,aspect:n,maxHeight:p}),q=X.calculatedWidth,I=X.calculatedHeight;return Ef(R<0||_<0||q!=null&&q>0||I!=null&&I>0,`The width(%s) and height(%s) of chart should be greater than 0,
420
+ please check the style of container, or the props width(%s) and height(%s),
421
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
422
+ height and width.`,q,I,a,s,c,u,n),f.createElement("div",Tf({id:g?"".concat(g):void 0,className:yt("recharts-responsive-container",v),style:Ak(Ak({},b),{},{width:a,height:s,minWidth:c,minHeight:u,maxHeight:p}),ref:j},w),f.createElement("div",{style:DH({width:a,height:s})},f.createElement(PN,{width:q,height:I},d)))}),Bs=f.forwardRef((e,t)=>{var n=pb();if(Wi(n.width)&&Wi(n.height))return e.children;var r=zH({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,s=kN(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),l=s.calculatedWidth,c=s.calculatedHeight;return Ce(l)&&Ce(c)?f.createElement(PN,{width:l,height:c},e.children):f.createElement(QH,Tf({},e,{width:i,height:a,ref:t}))});function fb(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var em=()=>{var e,t=Pn(),n=Ie(EH),r=Ie(Jh),i=(e=Ie(Zh))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},ZH={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},AN=()=>{var e;return(e=Ie(xn))!==null&&e!==void 0?e:ZH},hb=()=>Ie(ja),mb=()=>Ie(Sa),JH=()=>Ie(e=>e.layout.margin),ct=e=>e.layout.layoutType,ho=()=>Ie(ct),gb=()=>{var e=ho();if(e==="horizontal"||e==="vertical")return e},yb=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},e7=()=>Ie(yb),t7=()=>{var e=ho();return e!==void 0},qu=e=>{var t=Ct(),n=Pn(),r=e.width,i=e.height,a=pb(),s=r,l=i;return a&&(s=a.width>0?a.width:r,l=a.height>0?a.height:i),f.useEffect(()=>{!n&&Wi(s)&&Wi(l)&&t(tH({width:s,height:l}))},[t,n,s,l]),null},n7={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},EN=Xn({name:"legend",initialState:n7,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(mt(t.payload))},prepare:Dt()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Wr(e).payload.indexOf(mt(r));a>-1&&(e.payload[a]=mt(i))},prepare:Dt()},removeLegendPayload:{reducer(e,t){var n=Wr(e).payload.indexOf(mt(t.payload));n>-1&&e.payload.splice(n,1)},prepare:Dt()}}}),Yu=EN.actions,Tk=Yu.setLegendSize,r7=Yu.setLegendSettings,TN=Yu.addLegendPayload,IN=Yu.replaceLegendPayload,ON=Yu.removeLegendPayload,i7=EN.reducer,a7={};/**
423
+ * @license React
424
+ * use-sync-external-store-with-selector.production.js
425
+ *
426
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
427
+ *
428
+ * This source code is licensed under the MIT license found in the
429
+ * LICENSE file in the root directory of this source tree.
430
+ */var Gu=f;function o7(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var s7=typeof Object.is=="function"?Object.is:o7,l7=Gu.useSyncExternalStore,c7=Gu.useRef,u7=Gu.useEffect,d7=Gu.useMemo,p7=Gu.useDebugValue;a7.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=c7(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=d7(function(){function c(m){if(!u){if(u=!0,p=m,m=r(m),i!==void 0&&s.hasValue){var g=s.value;if(i(g,m))return d=g}return d=m}if(g=d,s7(p,m))return g;var v=r(m);return i!==void 0&&i(g,v)?(p=m,g):(p=m,d=v)}var u=!1,p,d,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var l=l7(e,a[0],a[1]);return u7(function(){s.hasValue=!0,s.value=l},[l]),p7(l),l};function f7(e){e()}function h7(){let e=null,t=null;return{clear(){e=null,t=null},notify(){f7(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Ik={notify(){},get:()=>[]};function m7(e,t){let n,r=Ik,i=0,a=!1;function s(v){p();const x=r.subscribe(v);let y=!1;return()=>{y||(y=!0,x(),d())}}function l(){r.notify()}function c(){g.onStateChange&&g.onStateChange()}function u(){return a}function p(){i++,n||(n=e.subscribe(c),r=h7())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Ik)}function h(){a||(a=!0,p())}function m(){a&&(a=!1,d())}const g={addNestedSub:s,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:u,trySubscribe:h,tryUnsubscribe:m,getListeners:()=>r};return g}var g7=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y7=g7(),v7=()=>typeof navigator<"u"&&navigator.product==="ReactNative",x7=v7(),b7=()=>y7||x7?f.useLayoutEffect:f.useEffect,w7=b7();function Ok(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function j7(e,t){if(Ok(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!Ok(e[n[i]],t[n[i]]))return!1;return!0}var Ug=Symbol.for("react-redux-context"),Wg=typeof globalThis<"u"?globalThis:{};function S7(){if(!f.createContext)return{};const e=Wg[Ug]??(Wg[Ug]=new Map);let t=e.get(f.createContext);return t||(t=f.createContext(null),e.set(f.createContext,t)),t}var k7=S7();function C7(e){const{children:t,context:n,serverState:r,store:i}=e,a=f.useMemo(()=>{const c=m7(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),s=f.useMemo(()=>i.getState(),[i]);w7(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,s]);const l=n||k7;return f.createElement(l.Provider,{value:a},t)}var P7=C7,A7=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function E7(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function ys(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(A7.has(r)){if(e[r]==null&&t[r]==null)continue;if(!j7(e[r],t[r]))return!1}else if(!E7(e[r],t[r]))return!1;return!0}var T7=["contextPayload"];function Zv(){return Zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zv.apply(null,arguments)}function I7(e,t){return R7(e)||M7(e,t)||N7(e,t)||O7()}function O7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
431
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N7(e,t){if(e){if(typeof e=="string")return Nk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nk(e,t):void 0}}function Nk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function M7(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function R7(e){if(Array.isArray(e))return e}function Mk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Al(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mk(Object(n),!0).forEach(function(r){_7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _7(e,t,n){return(t=L7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L7(e){var t=D7(e,"string");return typeof t=="symbol"?t:t+""}function D7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function z7(e,t){if(e==null)return{};var n,r,i=$7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $7(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function B7(e){return e.value}function F7(e){var t=e.contextPayload,n=z7(e,T7),r=NO(t,e.payloadUniqBy,B7),i=Al(Al({},n),{},{payload:r});return f.isValidElement(e.content)?f.cloneElement(e.content,i):typeof e.content=="function"?f.createElement(e.content,i):f.createElement(SW,i)}function U7(e,t,n,r,i,a){var s=t.layout,l=t.align,c=t.verticalAlign,u,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l==="center"&&s==="vertical"?u={left:((r||0)-a.width)/2}:u=l==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(c==="middle"?p={top:((i||0)-a.height)/2}:p=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Al(Al({},u),p)}function W7(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=Ct();return f.useLayoutEffect(()=>{a(r7({align:t,layout:n,verticalAlign:r,itemSorter:i}))},[a,t,n,r,i]),null}function K7(e){var t=e.width,n=e.height,r=Ct();return f.useLayoutEffect(()=>{r(Tk({width:t,height:n}))},[r,t,n]),f.useLayoutEffect(()=>()=>{r(Tk({width:0,height:0}))},[r]),null}function H7(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var V7={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",labelStyle:{},layout:"horizontal",verticalAlign:"bottom"};function q7(e){var t=pn(e,V7),n=Q9(),r=vU(),i=JH(),a=t.width,s=t.height,l=t.wrapperStyle,c=t.portal,u=FO([n]),p=I7(u,2),d=p[0],h=p[1],m=hb(),g=mb();if(m==null||g==null)return null;var v=m-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),x=H7(t.layout,s,a,v),y=c?l:Al(Al({position:"absolute",width:(x==null?void 0:x.width)||a||"auto",height:(x==null?void 0:x.height)||s||"auto"},U7(l,t,i,m,g,d)),l),b=c??r;if(b==null||n==null)return null;var w=f.createElement("div",{className:"recharts-legend-wrapper",style:y,ref:h},f.createElement(W7,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&f.createElement(K7,{width:d.width,height:d.height}),f.createElement(F7,Zv({},t,x,{margin:i,chartWidth:m,chartHeight:g,contextPayload:n})));return Lu.createPortal(w,b)}var tl=f.memo(q7,ys);tl.displayName="Legend";function Jv(){return Jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jv.apply(null,arguments)}function Rk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rk(Object(n),!0).forEach(function(r){Y7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Y7(e,t,n){return(t=G7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G7(e){var t=X7(e,"string");return typeof t=="symbol"?t:t+""}function X7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q7(e,t){return tV(e)||eV(e,t)||J7(e,t)||Z7()}function Z7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
432
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J7(e,t){if(e){if(typeof e=="string")return _k(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_k(e,t):void 0}}function _k(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function tV(e){if(Array.isArray(e))return e}function nV(e){return Array.isArray(e)&&Ui(e[0])&&Ui(e[1])?e.join(" ~ "):e}var Is={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function rV(e,t){return t==null?e:$h(e,t)}var iV=e=>{var t=e.separator,n=t===void 0?Is.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,s=a===void 0?Is.labelStyle:a,l=e.payload,c=e.formatter,u=e.itemSorter,p=e.wrapperClassName,d=e.labelClassName,h=e.label,m=e.labelFormatter,g=e.accessibilityLayer,v=g===void 0?Is.accessibilityLayer:g,x=()=>{if(l&&l.length){var T={padding:0,margin:0},L=rV(l,u),O=L.map((R,_)=>{if(!R||R.type==="none")return null;var X=R.formatter||c||nV,q=R.value,I=R.name,$=q,H=I;if(X){var N=X(q,I,R,_,l);if(Array.isArray(N)){var W=Q7(N,2);$=W[0],H=W[1]}else if(N!=null)$=N;else return null}var P=fc(fc({},Is.itemStyle),{},{color:R.color||Is.itemStyle.color},i);return f.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(_),style:P},Ui(H)?f.createElement("span",{className:"recharts-tooltip-item-name"},H):null,Ui(H)?f.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,f.createElement("span",{className:"recharts-tooltip-item-value"},$),f.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return f.createElement("ul",{className:"recharts-tooltip-item-list",style:T},O)}return null},y=fc(fc({},Is.contentStyle),r),b=fc({margin:0},s),w=!Bt(h),j=w?h:"",k=yt("recharts-default-tooltip",p),S=yt("recharts-tooltip-label",d);w&&m&&l!==void 0&&l!==null&&(j=m(h,l));var A=v?{role:"status","aria-live":"assertive"}:{};return f.createElement("div",Jv({className:k,style:y},A),f.createElement("p",{className:S,style:b},f.isValidElement(j)?j:"".concat(j)),x())},hc="recharts-tooltip-wrapper",aV={visibility:"hidden"};function oV(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return yt(hc,{["".concat(hc,"-right")]:Ce(n)&&t&&Ce(t.x)&&n>=t.x,["".concat(hc,"-left")]:Ce(n)&&t&&Ce(t.x)&&n<t.x,["".concat(hc,"-bottom")]:Ce(r)&&t&&Ce(t.y)&&r>=t.y,["".concat(hc,"-top")]:Ce(r)&&t&&Ce(t.y)&&r<t.y})}function Lk(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offset,a=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&Ce(a[r]))return a[r];var p=n[r]-l-(i>0?i:0),d=n[r]+i;if(t[r])return s[r]?p:d;var h=c[r];if(h==null)return 0;if(s[r]){var m=p,g=h;return m<g?Math.max(d,h):Math.max(p,h)}if(u==null)return 0;var v=d+l,x=h+u;return v>x?Math.max(p,h):Math.max(d,h)}function sV(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function lV(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,s=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,u=e.viewBox,p,d,h;return l.height>0&&l.width>0&&n?(d=Lk({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:s,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),h=Lk({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:s,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),p=sV({translateX:d,translateY:h,useTranslate3d:c})):p=aV,{cssProperties:p,cssClasses:oV({translateX:d,translateY:h,coordinate:n})}}var cV=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Xu={isSsr:cV()};function uV(e,t){return hV(e)||fV(e,t)||pV(e,t)||dV()}function dV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
433
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pV(e,t){if(e){if(typeof e=="string")return Dk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dk(e,t):void 0}}function Dk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function hV(e){if(Array.isArray(e))return e}function NN(){var e=f.useState(()=>Xu.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=uV(e,2),n=t[0],r=t[1];return f.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{r(i.matches)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}}},[]),n}function zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Os(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zk(Object(n),!0).forEach(function(r){mV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mV(e,t,n){return(t=gV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gV(e){var t=yV(e,"string");return typeof t=="symbol"?t:t+""}function yV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vV(e,t){return jV(e)||wV(e,t)||bV(e,t)||xV()}function xV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
434
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bV(e,t){if(e){if(typeof e=="string")return $k(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$k(e,t):void 0}}function $k(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function jV(e){if(Array.isArray(e))return e}function SV(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing=="string"?e.animationEasing:"ease";return"transform ".concat(e.animationDuration,"ms ").concat(t)}}function kV(e){var t,n,r,i,a,s,l=NN(),c=f.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),u=vV(c,2),p=u[0],d=u[1];f.useEffect(()=>{var y=b=>{if(b.key==="Escape"){var w,j,k,S;d({dismissed:!0,dismissedAtCoordinate:{x:(w=(j=e.coordinate)===null||j===void 0?void 0:j.x)!==null&&w!==void 0?w:0,y:(k=(S=e.coordinate)===null||S===void 0?void 0:S.y)!==null&&k!==void 0?k:0}})}};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),p.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==p.dismissedAtCoordinate.x||((a=(s=e.coordinate)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0)!==p.dismissedAtCoordinate.y)&&d(Os(Os({},p),{},{dismissed:!1}));var h=lV({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),m=h.cssClasses,g=h.cssProperties,v=e.hasPortalFromProps?{}:Os(Os({transition:SV({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},g),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),x=Os(Os({},v),{},{visibility:!p.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return f.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:m,style:x,ref:e.innerRef},e.children)}var CV=f.memo(kV),MN=()=>{var e;return(e=Ie(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function ex(){return ex=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ex.apply(null,arguments)}function Bk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bk(Object(n),!0).forEach(function(r){PV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PV(e,t,n){return(t=AV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AV(e){var t=EV(e,"string");return typeof t=="symbol"?t:t+""}function EV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uk={curveBasisClosed:DU,curveBasisOpen:zU,curveBasis:LU,curveBumpX:jU,curveBumpY:SU,curveLinearClosed:$U,curveLinear:Lh,curveMonotoneX:BU,curveMonotoneY:FU,curveNatural:UU,curveStep:WU,curveStepAfter:HU,curveStepBefore:KU},If=e=>et(e.x)&&et(e.y),Wk=e=>e.base!=null&&If(e.base)&&If(e),mc=e=>e.x,gc=e=>e.y,TV=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Uu(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=Uk["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return Uk[n]||Lh},Kk={connectNulls:!1,type:"linear"},IV=e=>{var t=e.type,n=t===void 0?Kk.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,s=e.layout,l=e.connectNulls,c=l===void 0?Kk.connectNulls:l,u=TV(n,s),p=c?i.filter(If):i;if(Array.isArray(a)){var d,h=i.map((y,b)=>Fk(Fk({},y),{},{base:a[b]}));s==="vertical"?d=Ud().y(gc).x1(mc).x0(y=>y.base.x):d=Ud().x(mc).y1(gc).y0(y=>y.base.y);var m=d.defined(Wk).curve(u),g=c?h.filter(Wk):h;return m(g)}var v;s==="vertical"&&Ce(a)?v=Ud().y(gc).x1(mc).x0(a):Ce(a)?v=Ud().x(mc).y1(gc).y0(a):v=nO().x(mc).y(gc);var x=v.defined(If).curve(u);return x(p)},pl=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=ho();if((!n||!n.length)&&!r)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},l=n&&n.length?IV(s):r;return f.createElement("path",ex({},ir(e),nb(e),{className:yt("recharts-curve",t),d:l===null?void 0:l,ref:i}))},OV=["x","y","top","left","width","height","className"];function tx(){return tx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tx.apply(null,arguments)}function Hk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hk(Object(n),!0).forEach(function(r){MV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MV(e,t,n){return(t=RV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RV(e){var t=_V(e,"string");return typeof t=="symbol"?t:t+""}function _V(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LV(e,t){if(e==null)return{};var n,r,i=DV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var zV=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),$V=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,p=u===void 0?0:u,d=e.height,h=d===void 0?0:d,m=e.className,g=LV(e,OV),v=NV({x:n,y:i,top:s,left:c,width:p,height:h},g);return!Ce(n)||!Ce(i)||!Ce(p)||!Ce(h)||!Ce(s)||!Ce(c)?null:f.createElement("path",tx({},xr(v),{className:yt("recharts-cross",m),d:zV(n,i,p,h,s,c)}))};function BV(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}var Of=1e-4,RN=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],_N=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),Vk=(e,t)=>n=>{var r=RN(e,t);return _N(r,n)},FV=(e,t)=>n=>{var r=RN(e,t),i=[...r.map((a,s)=>a*s).slice(1),0];return _N(i,n)},UV=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},WV=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=UV(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},KV=(e,t,n,r)=>{var i=Vk(e,n),a=Vk(t,r),s=FV(e,n),l=u=>u>1?1:u<0?0:u,c=u=>{for(var p=u>1?1:u,d=p,h=0;h<8;++h){var m=i(d)-p,g=s(d);if(Math.abs(m-p)<Of||g<Of)return a(d);d=l(d-m/g)}return a(d)};return c.isStepper=!1,c},qk=function(){return KV(...WV(...arguments))},HV=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,s=t.dt,l=s===void 0?16.67:s,c=1,u=[0],p=0,d=0,h=1e4,m=0;m<h;){var g=-(p-c)*r,v=d*a;if(d+=(g-v)*l/1e3,p+=d*l/1e3,u.push(p),Math.abs(p-c)<Of&&Math.abs(d)<Of)break;m++}u[u.length-1]=c;var x=u.length-1;return y=>{var b,w,j;if(y<=0)return 0;if(y>=1)return c;var k=y*x,S=Math.floor(k),A=k-S;return((b=u[S])!==null&&b!==void 0?b:0)+(((w=u[S+1])!==null&&w!==void 0?w:0)-((j=u[S])!==null&&j!==void 0?j:0))*A}},VV=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return qk(e);case"spring":return HV();default:if(e.split("(")[0]==="cubic-bezier")return qk(e)}return typeof e=="function"?e:null},qV=(e,t,n)=>{var r,i=a=>{var s=t.tick(a);if(t.getState()==="active"){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,s);return}r=e.setTimeout(i,s)};return r=e.setTimeout(i,0),()=>{var a;return(a=r)===null||a===void 0?void 0:a()}},LN=f.createContext(qV);LN.Provider;function YV(e){var t=f.useContext(LN);return f.useMemo(()=>e??t,[e,t])}function GV(e,t,n){return(t=XV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XV(e){var t=QV(e,"string");return typeof t=="symbol"?t:t+""}function QV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yk="init",Gk="pending",Xk="active",ZV="completed";function Kg(e){return Math.max(0,e)}class JV{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var n;GV(this,"state",Yk),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=Kg(t.animationDuration),this.animationBegin=Kg(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(n=t.onAnimationStart)===null||n===void 0||n.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===Yk)return this.state=Gk,this.beginStartedTime=t,this.animationBegin;if(this.getState()===Gk){if(this.beginStartedTime==null)throw new Error;var n=t-this.beginStartedTime;return n>=this.animationBegin?(this.state=Xk,this.animationStartedTime=t,this.nextAnimationUpdate(0)):Kg(this.animationBegin-n)}if(this.getState()===Xk){if(this.animationStartedTime==null)throw new Error;var r=t-this.animationStartedTime;return this.setProgress(r/this.animationDuration),this.nextAnimationUpdate(r)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=ZV}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class eq extends JV{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(Nt(this.getFrom(),this.getTo(),this.getProgress()))}}class tq{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=s=>{s-r>=n?t(s):i=requestAnimationFrame(a)};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function nq(e,t){return oq(e)||aq(e,t)||iq(e,t)||rq()}function rq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
435
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iq(e,t){if(e){if(typeof e=="string")return Qk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qk(e,t):void 0}}function Qk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function aq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function oq(e){if(Array.isArray(e))return e}var sq={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Zk=0,Hg=1;function DN(e){var t=pn(e,sq),n=t.animationId,r=t.isActive,i=t.canBegin,a=t.duration,s=t.easing,l=t.begin,c=t.onAnimationEnd,u=t.onAnimationStart,p=t.children,d=NN(),h=r==="auto"?!Xu.isSsr&&!d:r,m=YV(t.animationController),g=f.useState(h?Zk:Hg),v=nq(g,2),x=v[0],y=v[1];return f.useEffect(()=>{h||y(Hg)},[h]),f.useEffect(()=>{var b=VV(s);if(!h||!i||b==null)return po;var w=new tq,j=new eq({animationId:n,easing:b,animationDuration:a,animationBegin:l,onAnimationStart:u,onAnimationEnd:c,from:Zk,to:Hg});return m(w,j,y)},[m,n,h,i,a,s,l,u,c]),p(Number(x))}function zN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=f.useRef(vu(t)),r=f.useRef(e);return r.current!==e&&(n.current=vu(t),r.current=e),n.current}var lq=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),cq=(e,t,n)=>e.map(r=>"".concat(lq(r)," ").concat(t,"ms ").concat(n)).join(","),uq=["radius"],dq=["radius"],Jk,eC,tC,nC,rC,iC,aC,oC,sC,lC;function cC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cC(Object(n),!0).forEach(function(r){pq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pq(e,t,n){return(t=fq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fq(e){var t=hq(e,"string");return typeof t=="symbol"?t:t+""}function hq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nf(){return Nf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nf.apply(null,arguments)}function dC(e,t){if(e==null)return{};var n,r,i=mq(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mq(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gq(e,t){return bq(e)||xq(e,t)||vq(e,t)||yq()}function yq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
436
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vq(e,t){if(e){if(typeof e=="string")return pC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pC(e,t):void 0}}function pC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function bq(e){if(Array.isArray(e))return e}function bi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var fC=(e,t,n,r,i)=>{var a=aa(n),s=aa(r),l=Math.min(Math.abs(a)/2,Math.abs(s)/2),c=s>=0?1:-1,u=a>=0?1:-1,p=s>=0&&a>=0||s<0&&a<0?1:0,d;if(l>0&&Array.isArray(i)){for(var h=[0,0,0,0],m=0,g=4;m<g;m++){var v,x=(v=i[m])!==null&&v!==void 0?v:0;h[m]=x>l?l:x}d=Dn(Jk||(Jk=bi(["M",",",""])),e,t+c*h[0]),h[0]>0&&(d+=Dn(eC||(eC=bi(["A ",",",",0,0,",",",",",""])),h[0],h[0],p,e+u*h[0],t)),d+=Dn(tC||(tC=bi(["L ",",",""])),e+n-u*h[1],t),h[1]>0&&(d+=Dn(nC||(nC=bi(["A ",",",",0,0,",`,
437
+ `,",",""])),h[1],h[1],p,e+n,t+c*h[1])),d+=Dn(rC||(rC=bi(["L ",",",""])),e+n,t+r-c*h[2]),h[2]>0&&(d+=Dn(iC||(iC=bi(["A ",",",",0,0,",`,
438
+ `,",",""])),h[2],h[2],p,e+n-u*h[2],t+r)),d+=Dn(aC||(aC=bi(["L ",",",""])),e+u*h[3],t+r),h[3]>0&&(d+=Dn(oC||(oC=bi(["A ",",",",0,0,",`,
439
+ `,",",""])),h[3],h[3],p,e,t+r-c*h[3])),d+="Z"}else if(l>0&&i===+i&&i>0){var y=Math.min(l,i);d=Dn(sC||(sC=bi(["M ",",",`
440
+ A `,",",",0,0,",",",",",`
441
+ L `,",",`
442
+ A `,",",",0,0,",",",",",`
443
+ L `,",",`
444
+ A `,",",",0,0,",",",",",`
445
+ L `,",",`
446
+ A `,",",",0,0,",",",","," Z"])),e,t+c*y,y,y,p,e+u*y,t,e+n-u*y,t,y,y,p,e+n,t+c*y,e+n,t+r-c*y,y,y,p,e+n-u*y,t+r,e+u*y,t+r,y,y,p,e,t+r-c*y)}else d=Dn(lC||(lC=bi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},hC={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$N=e=>{var t=pn(e,hC),n=f.useRef(null),r=f.useState(-1),i=gq(r,2),a=i[0],s=i[1];f.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var N=n.current.getTotalLength();N&&s(N)}catch{}},[]);var l=t.x,c=t.y,u=t.width,p=t.height,d=t.radius,h=t.className,m=t.animationEasing,g=t.animationDuration,v=t.animationBegin,x=t.isAnimationActive,y=t.isUpdateAnimationActive,b=f.useRef(u),w=f.useRef(p),j=f.useRef(l),k=f.useRef(c),S=f.useMemo(()=>({x:l,y:c,width:u,height:p,radius:d}),[l,c,u,p,d]),A=zN(S,"rectangle-");if(l!==+l||c!==+c||u!==+u||p!==+p||u===0||p===0)return null;var T=yt("recharts-rectangle",h);if(!y){var L=xr(t);L.radius;var O=dC(L,uq);return f.createElement("path",Nf({},O,{x:aa(l),y:aa(c),width:aa(u),height:aa(p),radius:typeof d=="number"?d:void 0,className:T,d:fC(l,c,u,p,d)}))}var R=b.current,_=w.current,X=j.current,q=k.current,I="0px ".concat(a===-1?1:a,"px"),$="".concat(a,"px ").concat(a,"px"),H=cq(["strokeDasharray"],g,typeof m=="string"?m:hC.animationEasing);return f.createElement(DN,{animationId:A,key:A,canBegin:a>0,duration:g,easing:m,isActive:y,begin:v},N=>{var W=Nt(R,u,N),P=Nt(_,p,N),U=Nt(X,l,N),le=Nt(q,c,N);n.current&&(b.current=W,w.current=P,j.current=U,k.current=le);var E;x?N>0?E={transition:H,strokeDasharray:$}:E={strokeDasharray:I}:E={strokeDasharray:$};var me=xr(t);me.radius;var ye=dC(me,dq);return f.createElement("path",Nf({},ye,{radius:typeof d=="number"?d:void 0,className:T,d:fC(U,le,W,P,d),ref:n,style:uC(uC({},E),t.style)}))})};function mC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mC(Object(n),!0).forEach(function(r){wq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wq(e,t,n){return(t=jq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jq(e){var t=Sq(e,"string");return typeof t=="symbol"?t:t+""}function Sq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mf=Math.PI/180,kq=e=>e*180/Math.PI,un=(e,t,n,r)=>({x:e+Math.cos(-Mf*r)*n,y:t+Math.sin(-Mf*r)*n}),BN=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},Cq=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},Pq=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,s=Cq({x:n,y:r},{x:i,y:a});if(s<=0)return{radius:s,angle:0};var l=(n-i)/s,c=Math.acos(l);return r>a&&(c=2*Math.PI-c),{radius:s,angle:kq(c),angleInRadian:c}},Aq=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},Eq=(e,t)=>{var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),s=Math.min(i,a);return e+s*360},Tq=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=Pq({x:n,y:r},t),a=i.radius,s=i.angle,l=t.innerRadius,c=t.outerRadius;if(a<l||a>c||a===0)return null;var u=Aq(t),p=u.startAngle,d=u.endAngle,h=s,m;if(p<=d){for(;h>d;)h-=360;for(;h<p;)h+=360;m=h>=p&&h<=d}else{for(;h>p;)h-=360;for(;h<d;)h+=360;m=h>=d&&h<=p}return m?gC(gC({},t),{},{radius:a,angle:Eq(h,t)}):null};function FN(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,s=un(t,n,r,i),l=un(t,n,r,a);return{points:[s,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var yC,vC,xC,bC,wC,jC,SC;function nx(){return nx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nx.apply(null,arguments)}function zo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Iq=(e,t)=>{var n=kn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Gd=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,s=e.isExternal,l=e.cornerRadius,c=e.cornerIsExternal,u=l*(s?1:-1)+r,p=Math.asin(l/u)/Mf,d=c?i:i+a*p,h=un(t,n,u,d),m=un(t,n,r,d),g=c?i-a*p:i,v=un(t,n,u*Math.cos(p*Mf),g);return{center:h,circleTangency:m,lineTangency:v,theta:p}},UN=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,s=e.endAngle,l=Iq(a,s),c=a+l,u=un(t,n,i,a),p=un(t,n,i,c),d=Dn(yC||(yC=zo(["M ",",",`
447
+ A `,",",`,0,
448
+ `,",",`,
449
+ `,",",`
450
+ `])),u.x,u.y,i,i,+(Math.abs(l)>180),+(a>c),p.x,p.y);if(r>0){var h=un(t,n,r,a),m=un(t,n,r,c);d+=Dn(vC||(vC=zo(["L ",",",`
451
+ A `,",",`,0,
452
+ `,",",`,
453
+ `,","," Z"])),m.x,m.y,r,r,+(Math.abs(l)>180),+(a<=c),h.x,h.y)}else d+=Dn(xC||(xC=zo(["L ",","," Z"])),t,n);return d},Oq=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,p=kn(u-c),d=Gd({cx:t,cy:n,radius:i,angle:c,sign:p,cornerRadius:a,cornerIsExternal:l}),h=d.circleTangency,m=d.lineTangency,g=d.theta,v=Gd({cx:t,cy:n,radius:i,angle:u,sign:-p,cornerRadius:a,cornerIsExternal:l}),x=v.circleTangency,y=v.lineTangency,b=v.theta,w=l?Math.abs(c-u):Math.abs(c-u)-g-b;if(w<0)return s?Dn(bC||(bC=zo(["M ",",",`
454
+ a`,",",",0,0,1,",`,0
455
+ a`,",",",0,0,1,",`,0
456
+ `])),m.x,m.y,a,a,a*2,a,a,-a*2):UN({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var j=Dn(wC||(wC=zo(["M ",",",`
457
+ A`,",",",0,0,",",",",",`
458
+ A`,",",",0,",",",",",",",`
459
+ A`,",",",0,0,",",",",",`
460
+ `])),m.x,m.y,a,a,+(p<0),h.x,h.y,i,i,+(w>180),+(p<0),x.x,x.y,a,a,+(p<0),y.x,y.y);if(r>0){var k=Gd({cx:t,cy:n,radius:r,angle:c,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),S=k.circleTangency,A=k.lineTangency,T=k.theta,L=Gd({cx:t,cy:n,radius:r,angle:u,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),O=L.circleTangency,R=L.lineTangency,_=L.theta,X=l?Math.abs(c-u):Math.abs(c-u)-T-_;if(X<0&&a===0)return"".concat(j,"L").concat(t,",").concat(n,"Z");j+=Dn(jC||(jC=zo(["L",",",`
461
+ A`,",",",0,0,",",",",",`
462
+ A`,",",",0,",",",",",",",`
463
+ A`,",",",0,0,",",",",","Z"])),R.x,R.y,a,a,+(p<0),O.x,O.y,r,r,+(X>180),+(p>0),S.x,S.y,a,a,+(p<0),A.x,A.y)}else j+=Dn(SC||(SC=zo(["L",",","Z"])),t,n);return j},Nq={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},WN=e=>{var t=pn(e,Nq),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,p=t.endAngle,d=t.className;if(a<i||u===p)return null;var h=yt("recharts-sector",d),m=a-i,g=qn(s,m,0,!0),v;return g>0&&Math.abs(u-p)<360?v=Oq({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,m/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:p}):v=UN({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:p}),f.createElement("path",nx({},xr(t),{className:h,d:v}))};function Mq(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(xO(t)){if(e==="centric"){var r=t.cx,i=t.cy,a=t.innerRadius,s=t.outerRadius,l=t.angle,c=un(r,i,a,l),u=un(r,i,s,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return FN(t)}}function Rq(e){return $O(e)?NaN:Number(e)}function Vg(e){return e?(e=Rq(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function KN(e,t,n){n&&typeof n!="number"&&Fv(e,t,n)&&(t=n=void 0),e=Vg(e),t===void 0?(t=e,e=0):t=Vg(t),n=n===void 0?e<t?1:-1:Vg(n);const r=Math.max(Math.ceil((t-e)/(n||1)),0),i=new Array(r);for(let a=0;a<r;a++)i[a]=e,e+=n;return i}var mi=e=>e.chartData,Qu=G([mi],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Zu=(e,t,n,r)=>r?Qu(e):mi(e),HN=(e,t,n)=>n?Qu(e):mi(e),_q=G([Zu],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]}),Lq=G([Qu],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]}),Dq=G([mi],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});function vb(e,t){return Fq(e)||Bq(e,t)||$q(e,t)||zq()}function zq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
464
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $q(e,t){if(e){if(typeof e=="string")return kC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kC(e,t):void 0}}function kC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Bq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Fq(e){if(Array.isArray(e))return e}function zi(e){if(Array.isArray(e)&&e.length===2){var t=vb(e,2),n=t[0],r=t[1];if(et(n)&&et(r))return!0}return!1}function CC(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function VN(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var n=vb(e,2),r=n[0],i=n[1],a,s;if(et(r))a=r;else if(typeof r=="function")return;if(et(i))s=i;else if(typeof i=="function")return;var l=[a,s];if(zi(l))return l}}function Uq(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(zi(r))return CC(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=vb(e,2),a=i[0],s=i[1],l,c;if(a==="auto")t!=null&&(l=Math.min(...t));else if(Ce(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t==null?void 0:t[0]))}catch{}else if(typeof a=="string"&&jk.test(a)){var u=jk.exec(a);if(u==null||u[1]==null||t==null)l=void 0;else{var p=+u[1];l=t[0]-p}}else l=t==null?void 0:t[0];if(s==="auto")t!=null&&(c=Math.max(...t));else if(Ce(s))c=s;else if(typeof s=="function")try{t!=null&&(c=s(t==null?void 0:t[1]))}catch{}else if(typeof s=="string"&&Sk.test(s)){var d=Sk.exec(s);if(d==null||d[1]==null||t==null)c=void 0;else{var h=+d[1];c=t[1]+h}}else c=t==null?void 0:t[1];var m=[l,c];if(zi(m))return t==null?m:CC(m,t,n)}}}var Ul=1e9,Wq={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},bb,Wt=!0,Yr="[DecimalError] ",Xo=Yr+"Invalid argument: ",xb=Yr+"Exponent out of range: ",Wl=Math.floor,To=Math.pow,Kq=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Sr,jn=1e7,zt=7,qN=9007199254740991,Rf=Wl(qN/zt),Me={};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Me.comparedTo=Me.cmp=function(e){var t,n,r,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(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Me.decimalPlaces=Me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*zt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Me.dividedBy=Me.div=function(e){return ca(this,new this.constructor(e))};Me.dividedToIntegerBy=Me.idiv=function(e){var t=this,n=t.constructor;return Et(ca(t,new n(e),0,1),n.precision)};Me.equals=Me.eq=function(e){return!this.cmp(e)};Me.exponent=function(){return dn(this)};Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0};Me.greaterThanOrEqualTo=Me.gte=function(e){return this.cmp(e)>=0};Me.isInteger=Me.isint=function(){return this.e>this.d.length-2};Me.isNegative=Me.isneg=function(){return this.s<0};Me.isPositive=Me.ispos=function(){return this.s>0};Me.isZero=function(){return this.s===0};Me.lessThan=Me.lt=function(e){return this.cmp(e)<0};Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1};Me.logarithm=Me.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Sr))throw Error(Yr+"NaN");if(n.s<1)throw Error(Yr+(n.s?"NaN":"-Infinity"));return n.eq(Sr)?new r(0):(Wt=!1,t=ca(ju(n,a),ju(e,a),a),Wt=!0,Et(t,i))};Me.minus=Me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?XN(t,e):YN(t,(e.s=-e.s,e))};Me.modulo=Me.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Yr+"NaN");return n.s?(Wt=!1,t=ca(n,e,0,1).times(e),Wt=!0,n.minus(t)):Et(new r(n),i)};Me.naturalExponential=Me.exp=function(){return GN(this)};Me.naturalLogarithm=Me.ln=function(){return ju(this)};Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Me.plus=Me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?YN(t,e):XN(t,(e.s=-e.s,e))};Me.precision=Me.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Xo+e);if(t=dn(i)+1,r=i.d.length-1,n=r*zt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Me.squareRoot=Me.sqrt=function(){var e,t,n,r,i,a,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Yr+"NaN")}for(e=dn(l),Wt=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=_i(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Wl((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),r=new c(t)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(a=r,r=a.plus(ca(l,a,s+2)).times(.5),_i(a.d).slice(0,s)===(t=_i(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Et(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;s+=4}return Wt=!0,Et(r,n)};Me.times=Me.mul=function(e){var t,n,r,i,a,s,l,c,u,p=this,d=p.constructor,h=p.d,m=(e=new d(e)).d;if(!p.s||!e.s)return new d(0);for(e.s*=p.s,n=p.e+e.e,c=h.length,u=m.length,c<u&&(a=h,h=m,m=a,s=c,c=u,u=s),a=[],s=c+u,r=s;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+m[r]*h[i-r-1]+t,a[i--]=l%jn|0,t=l/jn|0;a[i]=(a[i]+t)%jn|0}for(;!a[--s];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Wt?Et(e,d.precision):e};Me.toDecimalPlaces=Me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ki(e,0,Ul),t===void 0?t=r.rounding:Ki(t,0,8),Et(n,e+dn(n)+1,t))};Me.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=cs(r,!0):(Ki(e,0,Ul),t===void 0?t=i.rounding:Ki(t,0,8),r=Et(new i(r),e+1,t),n=cs(r,!0,e+1)),n};Me.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?cs(i):(Ki(e,0,Ul),t===void 0?t=a.rounding:Ki(t,0,8),r=Et(new a(i),e+dn(i)+1,t),n=cs(r.abs(),!1,e+dn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Me.toInteger=Me.toint=function(){var e=this,t=e.constructor;return Et(new t(e),dn(e)+1,t.rounding)};Me.toNumber=function(){return+this};Me.toPower=Me.pow=function(e){var t,n,r,i,a,s,l=this,c=l.constructor,u=12,p=+(e=new c(e));if(!e.s)return new c(Sr);if(l=new c(l),!l.s){if(e.s<1)throw Error(Yr+"Infinity");return l}if(l.eq(Sr))return l;if(r=c.precision,e.eq(Sr))return Et(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,a=l.s,s){if((n=p<0?-p:p)<=qN){for(i=new c(Sr),t=Math.ceil(r/zt+4),Wt=!1;n%2&&(i=i.times(l),AC(i.d,t)),n=Wl(n/2),n!==0;)l=l.times(l),AC(l.d,t);return Wt=!0,e.s<0?new c(Sr).div(i):Et(i,r)}}else if(a<0)throw Error(Yr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Wt=!1,i=e.times(ju(l,r+u)),Wt=!0,i=GN(i),i.s=a,i};Me.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=dn(i),r=cs(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ki(e,1,Ul),t===void 0?t=a.rounding:Ki(t,0,8),i=Et(new a(i),e,t),n=dn(i),r=cs(i,e<=n||n<=a.toExpNeg,e)),r};Me.toSignificantDigits=Me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ki(e,1,Ul),t===void 0?t=r.rounding:Ki(t,0,8)),Et(new r(n),e,t)};Me.toString=Me.valueOf=Me.val=Me.toJSON=Me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=dn(e),n=e.constructor;return cs(e,t<=n.toExpNeg||t>=n.toExpPos)};function YN(e,t){var n,r,i,a,s,l,c,u,p=e.constructor,d=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),Wt?Et(t,d):t;if(c=e.d,u=t.d,s=e.e,i=t.e,c=c.slice(),a=s-i,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,i=s,l=c.length),s=Math.ceil(d/zt),l=s>l?s+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/jn|0,c[a]%=jn;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Wt?Et(t,d):t}function Ki(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Xo+e)}function _i(e){var t,n,r,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;t<i;t++)r=e[t]+"",n=zt-r.length,n&&(a+=Da(n)),a+=r;s=e[t],r=s+"",n=zt-r.length,n&&(a+=Da(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var ca=function(){function e(r,i){var a,s=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+s,r[l]=a%jn|0,s=a/jn|0;return s&&r.unshift(s),r}function t(r,i,a,s){var l,c;if(a!=s)c=a>s?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var s=0;a--;)r[a]-=s,s=r[a]<i[a]?1:0,r[a]=s*jn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,s){var l,c,u,p,d,h,m,g,v,x,y,b,w,j,k,S,A,T,L=r.constructor,O=r.s==i.s?1:-1,R=r.d,_=i.d;if(!r.s)return new L(r);if(!i.s)throw Error(Yr+"Division by zero");for(c=r.e-i.e,A=_.length,k=R.length,m=new L(O),g=m.d=[],u=0;_[u]==(R[u]||0);)++u;if(_[u]>(R[u]||0)&&--c,a==null?b=a=L.precision:s?b=a+(dn(r)-dn(i))+1:b=a,b<0)return new L(0);if(b=b/zt+2|0,u=0,A==1)for(p=0,_=_[0],b++;(u<k||p)&&b--;u++)w=p*jn+(R[u]||0),g[u]=w/_|0,p=w%_|0;else{for(p=jn/(_[0]+1)|0,p>1&&(_=e(_,p),R=e(R,p),A=_.length,k=R.length),j=A,v=R.slice(0,A),x=v.length;x<A;)v[x++]=0;T=_.slice(),T.unshift(0),S=_[0],_[1]>=jn/2&&++S;do p=0,l=t(_,v,A,x),l<0?(y=v[0],A!=x&&(y=y*jn+(v[1]||0)),p=y/S|0,p>1?(p>=jn&&(p=jn-1),d=e(_,p),h=d.length,x=v.length,l=t(d,v,h,x),l==1&&(p--,n(d,A<h?T:_,h))):(p==0&&(l=p=1),d=_.slice()),h=d.length,h<x&&d.unshift(0),n(v,d,x),l==-1&&(x=v.length,l=t(_,v,A,x),l<1&&(p++,n(v,A<x?T:_,x))),x=v.length):l===0&&(p++,v=[0]),g[u++]=p,l&&v[0]?v[x++]=R[j]||0:(v=[R[j]],x=1);while((j++<k||v[0]!==void 0)&&b--)}return g[0]||g.shift(),m.e=c,Et(m,s?a+dn(m)+1:a)}}();function GN(e,t){var n,r,i,a,s,l,c=0,u=0,p=e.constructor,d=p.precision;if(dn(e)>16)throw Error(xb+dn(e));if(!e.s)return new p(Sr);for(Wt=!1,l=d,s=new p(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(To(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new p(Sr),p.precision=l;;){if(i=Et(i.times(e),l),n=n.times(++c),s=a.plus(ca(i,n,l)),_i(s.d).slice(0,l)===_i(a.d).slice(0,l)){for(;u--;)a=Et(a.times(a),l);return p.precision=d,t==null?(Wt=!0,Et(a,d)):a}a=s}}function dn(e){for(var t=e.e*zt,n=e.d[0];n>=10;n/=10)t++;return t}function qg(e,t,n){if(t>e.LN10.sd())throw Wt=!0,n&&(e.precision=n),Error(Yr+"LN10 precision limit exceeded");return Et(new e(e.LN10),t)}function Da(e){for(var t="";e--;)t+="0";return t}function ju(e,t){var n,r,i,a,s,l,c,u,p,d=1,h=10,m=e,g=m.d,v=m.constructor,x=v.precision;if(m.s<1)throw Error(Yr+(m.s?"NaN":"-Infinity"));if(m.eq(Sr))return new v(0);if(t==null?(Wt=!1,u=x):u=t,m.eq(10))return t==null&&(Wt=!0),qg(v,u);if(u+=h,v.precision=u,n=_i(g),r=n.charAt(0),a=dn(m),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=_i(m.d),r=n.charAt(0),d++;a=dn(m),r>1?(m=new v("0."+n),a++):m=new v(r+"."+n.slice(1))}else return c=qg(v,u+2,x).times(a+""),m=ju(new v(r+"."+n.slice(1)),u-h).plus(c),v.precision=x,t==null?(Wt=!0,Et(m,x)):m;for(l=s=m=ca(m.minus(Sr),m.plus(Sr),u),p=Et(m.times(m),u),i=3;;){if(s=Et(s.times(p),u),c=l.plus(ca(s,new v(i),u)),_i(c.d).slice(0,u)===_i(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(qg(v,u+2,x).times(a+""))),l=ca(l,new v(d),u),v.precision=x,t==null?(Wt=!0,Et(l,x)):l;l=c,i+=2}}function PC(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Wl(n/zt),e.d=[],r=(n+1)%zt,n<0&&(r+=zt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=zt;r<i;)e.d.push(+t.slice(r,r+=zt));t=t.slice(r),r=zt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Wt&&(e.e>Rf||e.e<-Rf))throw Error(xb+n)}else e.s=0,e.e=0,e.d=[0];return e}function Et(e,t,n){var r,i,a,s,l,c,u,p,d=e.d;for(s=1,a=d[0];a>=10;a/=10)s++;if(r=t-s,r<0)r+=zt,i=t,u=d[p=0];else{if(p=Math.ceil((r+1)/zt),a=d.length,p>=a)return e;for(u=a=d[p],s=1;a>=10;a/=10)s++;r%=zt,i=r-zt+s}if(n!==void 0&&(a=To(10,s-i-1),l=u/a%10|0,c=t<0||d[p+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?u/To(10,s-i):0:d[p-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=dn(e),d.length=1,t=t-a-1,d[0]=To(10,(zt-t%zt)%zt),e.e=Wl(-t/zt)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(r==0?(d.length=p,a=1,p--):(d.length=p+1,a=To(10,zt-r),d[p]=i>0?(u/To(10,s-i)%To(10,i)|0)*a:0),c)for(;;)if(p==0){(d[0]+=a)==jn&&(d[0]=1,++e.e);break}else{if(d[p]+=a,d[p]!=jn)break;d[p--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if(Wt&&(e.e>Rf||e.e<-Rf))throw Error(xb+dn(e));return e}function XN(e,t){var n,r,i,a,s,l,c,u,p,d,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Wt?Et(t,m):t;if(c=e.d,d=t.d,r=t.e,u=e.e,c=c.slice(),s=u-r,s){for(p=s<0,p?(n=c,s=-s,l=d.length):(n=d,r=u,l=c.length),i=Math.max(Math.ceil(m/zt),l)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=d.length,p=i<l,p&&(l=i),i=0;i<l;i++)if(c[i]!=d[i]){p=c[i]<d[i];break}s=0}for(p&&(n=c,c=d,d=n,t.s=-t.s),l=c.length,i=d.length-l;i>0;--i)c[l++]=0;for(i=d.length;i>s;){if(c[--i]<d[i]){for(a=i;a&&c[--a]===0;)c[a]=jn-1;--c[a],c[i]+=jn}c[i]-=d[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Wt?Et(t,m):t):new h(0)}function cs(e,t,n){var r,i=dn(e),a=_i(e.d),s=a.length;return t?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+Da(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Da(-i-1)+a,n&&(r=n-s)>0&&(a+=Da(r))):i>=s?(a+=Da(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+Da(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=Da(r))),e.s<0?"-"+a:a}function AC(e,t){if(e.length>t)return e.length=t,!0}function QN(e){var t,n,r;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Xo+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return PC(s,a.toString())}else if(typeof a!="string")throw Error(Xo+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,Kq.test(a))PC(s,a);else throw Error(Xo+a)}if(i.prototype=Me,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=QN,i.config=i.set=Hq,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Hq(e){if(!e||typeof e!="object")throw Error(Yr+"Object expected");var t,n,r,i=["precision",1,Ul,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Wl(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Xo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Xo+n+": "+r);return this}var bb=QN(Wq);Sr=new bb(1);const lt=bb;function ZN(e){var t;return e===0?t=1:t=Math.floor(new lt(e).abs().log(10).toNumber())+1,t}function JN(e,t,n){for(var r=new lt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function Su(e,t){return Gq(e)||Yq(e,t)||qq(e,t)||Vq()}function Vq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
465
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qq(e,t){if(e){if(typeof e=="string")return EC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?EC(e,t):void 0}}function EC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Gq(e){if(Array.isArray(e))return e}var eM=e=>{var t=Su(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},wb=(e,t,n)=>{if(e.lte(0))return new lt(0);var r=ZN(e.toNumber()),i=new lt(10).pow(r),a=e.div(i),s=r!==1?.05:.1,l=new lt(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=l.mul(i);return t?new lt(c.toNumber()):new lt(Math.ceil(c.toNumber()))},tM=(e,t,n)=>{var r;if(e.lte(0))return new lt(0);var i=[1,2,2.5,5],a=e.toNumber(),s=Math.floor(new lt(a).abs().log(10).toNumber()),l=new lt(10).pow(s),c=e.div(l).toNumber(),u=i.findIndex(m=>m>=c-1e-10);if(u===-1&&(l=l.mul(10),u=0),u+=n,u>=i.length){var p=Math.floor(u/i.length);u%=i.length,l=l.mul(new lt(10).pow(p))}var d=(r=i[u])!==null&&r!==void 0?r:1,h=new lt(d).mul(l);return t?h:new lt(Math.ceil(h.toNumber()))},Xq=(e,t,n)=>{var r=new lt(1),i=new lt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new lt(10).pow(ZN(e)-1),i=new lt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new lt(Math.floor(e)))}else e===0?i=new lt(Math.floor((t-1)/2)):n||(i=new lt(Math.floor(e)));for(var s=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new lt(c-s).mul(r)).toNumber());return l},nM=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:wb;if(!Number.isFinite((n-t)/(r-1)))return{step:new lt(0),tickMin:new lt(0),tickMax:new lt(0)};var l=s(new lt(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new lt(0):(c=new lt(t).add(n).div(2),c=c.sub(new lt(c).mod(l)));var u=Math.ceil(c.sub(t).div(l).toNumber()),p=Math.ceil(new lt(n).sub(c).div(l).toNumber()),d=u+p+1;return d>r?nM(t,n,r,i,a+1,s):(d<r&&(p=n>0?p+(r-d):p,u=n>0?u:u+(r-d)),{step:l,tickMin:c.sub(new lt(u).mul(l)),tickMax:c.add(new lt(p).mul(l))})},TC=function(t){var n=Su(t,2),r=n[0],i=n[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(a,2),u=eM([r,i]),p=Su(u,2),d=p[0],h=p[1];if(d===-1/0||h===1/0){var m=h===1/0?[d,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),h];return r>i?m.reverse():m}if(d===h)return Xq(d,a,s);var g=l==="snap125"?tM:wb,v=nM(d,h,c,s,0,g),x=v.step,y=v.tickMin,b=v.tickMax,w=JN(y,b.add(new lt(.1).mul(x)),x);return r>i?w.reverse():w},IC=function(t,n){var r=Su(t,2),i=r[0],a=r[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=eM([i,a]),u=Su(c,2),p=u[0],d=u[1];if(p===-1/0||d===1/0)return[i,a];if(p===d)return[p];var h=l==="snap125"?tM:wb,m=Math.max(n,2),g=h(new lt(d).sub(p).div(m-1),s,0),v=[...JN(new lt(p),new lt(d),g),d];if(s===!1){v=v.map(y=>Math.round(y));var x=v.length-1;x>0&&v[x]===v[x-1]&&(v=v.slice(0,x))}return i>a?v.reverse():v},rM=e=>e.rootProps.maxBarSize,Qq=e=>e.rootProps.barGap,iM=e=>e.rootProps.barCategoryGap,Zq=e=>e.rootProps.barSize,Ju=e=>e.rootProps.stackOffset,aM=e=>e.rootProps.reverseStackOrder,jb=e=>e.options.chartName,Sb=e=>e.rootProps.syncId,oM=e=>e.rootProps.syncMethod,kb=e=>e.options.eventEmitter,Jq=e=>e.rootProps.baseValue,on={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},bo={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},wi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},tm=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function nm(e,t,n){if(n!=="auto")return n;if(e!=null)return hi(e,t)?"category":"number"}function OC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _f(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OC(Object(n),!0).forEach(function(r){eY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eY(e,t,n){return(t=tY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tY(e){var t=nY(e,"string");return typeof t=="symbol"?t:t+""}function nY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NC={allowDataOverflow:bo.allowDataOverflow,allowDecimals:bo.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:bo.angleAxisId,includeHidden:!1,name:void 0,reversed:bo.reversed,scale:bo.scale,tick:bo.tick,tickCount:void 0,ticks:void 0,type:bo.type,unit:void 0,niceTicks:"auto"},MC={allowDataOverflow:wi.allowDataOverflow,allowDecimals:wi.allowDecimals,allowDuplicatedCategory:wi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:wi.radiusAxisId,includeHidden:wi.includeHidden,name:void 0,reversed:wi.reversed,scale:wi.scale,tick:wi.tick,tickCount:wi.tickCount,ticks:void 0,type:wi.type,unit:void 0,niceTicks:"auto"},rY=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Cb=G([rY,yb],(e,t)=>{var n;if(e!=null)return e;var r=(n=nm(t,"angleAxis",NC.type))!==null&&n!==void 0?n:"category";return _f(_f({},NC),{},{type:r})}),iY=(e,t)=>e.polarAxis.radiusAxis[t],Pb=G([iY,yb],(e,t)=>{var n;if(e!=null)return e;var r=(n=nm(t,"radiusAxis",MC.type))!==null&&n!==void 0?n:"category";return _f(_f({},MC),{},{type:r})}),rm=e=>e.polarOptions,Ab=G([ja,Sa,xn],BN),sM=G([rm,Ab],(e,t)=>{if(e!=null)return qn(e.innerRadius,t,0)}),lM=G([rm,Ab],(e,t)=>{if(e!=null)return qn(e.outerRadius,t,t*.8)}),aY=e=>{if(e==null)return[0,0];var t=e.startAngle,n=e.endAngle;return[t,n]},cM=G([rm],aY);G([Cb,cM],tm);var uM=G([Ab,sM,lM],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});G([Pb,uM],tm);var dM=G([ct,rm,sM,lM,ja,Sa],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var s=t.cx,l=t.cy,c=t.startAngle,u=t.endAngle;return{cx:qn(s,i,i/2),cy:qn(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),Qt=(e,t)=>t,ed=(e,t,n)=>n;function im(e){return e==null?void 0:e.id}function pM(e,t,n){var r=t.chartData,i=r===void 0?[]:r,a=n.allowDuplicatedCategory,s=n.dataKey,l=new Map;return e.forEach(c=>{var u,p=(u=c.data)!==null&&u!==void 0?u:i;if(!(p==null||p.length===0)){var d=im(c);p.forEach((h,m)=>{var g=s==null||a?m:String(gt(h,s,null)),v=gt(h,c.dataKey,0),x;l.has(g)?x=l.get(g):x={},Object.assign(x,{[d]:v}),l.set(g,x)})}}),Array.from(l.values())}function am(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var td=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function om(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function oY(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var An=e=>{var t=ct(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Kl=e=>e.tooltip.settings.axisId;function Eb(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(a){function s(){return a.apply(this,arguments)}return s.toString=function(){return a.toString()},s}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var s=i[0],l=i[1];return s<=l?a>=s&&a<=l:a>=l&&a<=s},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,s)=>{var l=e(a);if(l!=null){if(e.bandwidth&&s!==null&&s!==void 0&&s.position){var c=e.bandwidth();switch(s.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var fM=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!zi(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];et(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function eo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function sY(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Tb(e){let t,n,r;e.length!==2?(t=eo,n=(l,c)=>eo(e(l),c),r=(l,c)=>e(l)-c):(t=e===eo||e===sY?e:lY,n=e,r=e);function i(l,c,u=0,p=l.length){if(u<p){if(t(c,c)!==0)return p;do{const d=u+p>>>1;n(l[d],c)<0?u=d+1:p=d}while(u<p)}return u}function a(l,c,u=0,p=l.length){if(u<p){if(t(c,c)!==0)return p;do{const d=u+p>>>1;n(l[d],c)<=0?u=d+1:p=d}while(u<p)}return u}function s(l,c,u=0,p=l.length){const d=i(l,c,u,p-1);return d>u&&r(l[d-1],c)>-r(l[d],c)?d-1:d}return{left:i,center:s,right:a}}function lY(){return 0}function hM(e){return e===null?NaN:+e}function*cY(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const uY=Tb(eo),nd=uY.right;Tb(hM).center;class RC extends Map{constructor(t,n=fY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(_C(this,t))}has(t){return super.has(_C(this,t))}set(t,n){return super.set(dY(this,t),n)}delete(t){return super.delete(pY(this,t))}}function _C({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function dY({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function pY({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function fY(e){return e!==null&&typeof e=="object"?e.valueOf():e}function hY(e=eo){if(e===eo)return mM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function mM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const mY=Math.sqrt(50),gY=Math.sqrt(10),yY=Math.sqrt(2);function Lf(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=mY?10:a>=gY?5:a>=yY?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/s,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)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?Lf(e,t,n*2):[l,c,u]}function rx(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?Lf(t,e,n):Lf(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)if(s<0)for(let u=0;u<l;++u)c[u]=(a-u)/-s;else for(let u=0;u<l;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(i+u)/-s;else for(let u=0;u<l;++u)c[u]=(i+u)*s;return c}function ix(e,t,n){return t=+t,e=+e,n=+n,Lf(e,t,n)[2]}function ax(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?ix(t,e,n):ix(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function LC(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function DC(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function gM(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?mM:hY(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,p=Math.log(c),d=.5*Math.exp(2*p/3),h=.5*Math.sqrt(p*d*(c-d)/c)*(u-c/2<0?-1:1),m=Math.max(n,Math.floor(t-u*d/c+h)),g=Math.min(r,Math.floor(t+(c-u)*d/c+h));gM(e,t,m,g,i)}const a=e[t];let s=n,l=r;for(yc(e,n,t),i(e[r],a)>0&&yc(e,n,r);s<l;){for(yc(e,s,l),++s,--l;i(e[s],a)<0;)++s;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?yc(e,n,l):(++l,yc(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function yc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function vY(e,t,n){if(e=Float64Array.from(cY(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return DC(e);if(t>=1)return LC(e);var r,i=(r-1)*t,a=Math.floor(i),s=LC(gM(e,a).subarray(0,a+1)),l=DC(e.subarray(a+1));return s+(l-s)*(i-a)}}function xY(e,t,n=hM){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),s=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return s+(l-s)*(i-a)}}function bY(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Gr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ka(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}const ox=Symbol("implicit");function Ib(){var e=new RC,t=[],n=[],r=ox;function i(a){let s=e.get(a);if(s===void 0){if(r!==ox)return r;e.set(a,s=t.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new RC;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Ib(t,n).unknown(r)},Gr.apply(i,arguments),i}function Ob(){var e=Ib().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,s,l=!1,c=0,u=0,p=.5;delete e.unknown;function d(){var h=t().length,m=i<r,g=m?i:r,v=m?r:i;a=(v-g)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),g+=(v-g-a*(h-c))*p,s=a*(1-c),l&&(g=Math.round(g),s=Math.round(s));var x=bY(h).map(function(y){return g+a*y});return n(m?x.reverse():x)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,l=!0,d()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,d()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),d()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),d()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,d()):u},e.align=function(h){return arguments.length?(p=Math.max(0,Math.min(1,h)),d()):p},e.copy=function(){return Ob(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(p)},Gr.apply(d(),arguments)}function yM(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return yM(t())},e}function wY(){return yM(Ob.apply(null,arguments).paddingInner(1))}function Nb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vM(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function rd(){}var ku=.7,Df=1/ku,fl="\\s*([+-]?\\d+)\\s*",Cu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jY=/^#([0-9a-f]{3,8})$/,SY=new RegExp(`^rgb\\(${fl},${fl},${fl}\\)$`),kY=new RegExp(`^rgb\\(${$i},${$i},${$i}\\)$`),CY=new RegExp(`^rgba\\(${fl},${fl},${fl},${Cu}\\)$`),PY=new RegExp(`^rgba\\(${$i},${$i},${$i},${Cu}\\)$`),AY=new RegExp(`^hsl\\(${Cu},${$i},${$i}\\)$`),EY=new RegExp(`^hsla\\(${Cu},${$i},${$i},${Cu}\\)$`),zC={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};Nb(rd,Pu,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$C,formatHex:$C,formatHex8:TY,formatHsl:IY,formatRgb:BC,toString:BC});function $C(){return this.rgb().formatHex()}function TY(){return this.rgb().formatHex8()}function IY(){return xM(this).formatHsl()}function BC(){return this.rgb().formatRgb()}function Pu(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=jY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?FC(t):n===3?new hr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=SY.exec(e))?new hr(t[1],t[2],t[3],1):(t=kY.exec(e))?new hr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=CY.exec(e))?Xd(t[1],t[2],t[3],t[4]):(t=PY.exec(e))?Xd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=AY.exec(e))?KC(t[1],t[2]/100,t[3]/100,1):(t=EY.exec(e))?KC(t[1],t[2]/100,t[3]/100,t[4]):zC.hasOwnProperty(e)?FC(zC[e]):e==="transparent"?new hr(NaN,NaN,NaN,0):null}function FC(e){return new hr(e>>16&255,e>>8&255,e&255,1)}function Xd(e,t,n,r){return r<=0&&(e=t=n=NaN),new hr(e,t,n,r)}function OY(e){return e instanceof rd||(e=Pu(e)),e?(e=e.rgb(),new hr(e.r,e.g,e.b,e.opacity)):new hr}function sx(e,t,n,r){return arguments.length===1?OY(e):new hr(e,t,n,r??1)}function hr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Nb(hr,sx,vM(rd,{brighter(e){return e=e==null?Df:Math.pow(Df,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ku:Math.pow(ku,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hr(Qo(this.r),Qo(this.g),Qo(this.b),zf(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:UC,formatHex:UC,formatHex8:NY,formatRgb:WC,toString:WC}));function UC(){return`#${$o(this.r)}${$o(this.g)}${$o(this.b)}`}function NY(){return`#${$o(this.r)}${$o(this.g)}${$o(this.b)}${$o((isNaN(this.opacity)?1:this.opacity)*255)}`}function WC(){const e=zf(this.opacity);return`${e===1?"rgb(":"rgba("}${Qo(this.r)}, ${Qo(this.g)}, ${Qo(this.b)}${e===1?")":`, ${e})`}`}function zf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $o(e){return e=Qo(e),(e<16?"0":"")+e.toString(16)}function KC(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new oi(e,t,n,r)}function xM(e){if(e instanceof oi)return new oi(e.h,e.s,e.l,e.opacity);if(e instanceof rd||(e=Pu(e)),!e)return new oi;if(e instanceof oi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,l=a-i,c=(a+i)/2;return l?(t===a?s=(n-r)/l+(n<r)*6:n===a?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?a+i:2-a-i,s*=60):l=c>0&&c<1?0:s,new oi(s,l,c,e.opacity)}function MY(e,t,n,r){return arguments.length===1?xM(e):new oi(e,t,n,r??1)}function oi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Nb(oi,MY,vM(rd,{brighter(e){return e=e==null?Df:Math.pow(Df,e),new oi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ku:Math.pow(ku,e),new oi(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,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new hr(Yg(e>=240?e-240:e+120,i,r),Yg(e,i,r),Yg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new oi(HC(this.h),Qd(this.s),Qd(this.l),zf(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=zf(this.opacity);return`${e===1?"hsl(":"hsla("}${HC(this.h)}, ${Qd(this.s)*100}%, ${Qd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function HC(e){return e=(e||0)%360,e<0?e+360:e}function Qd(e){return Math.max(0,Math.min(1,e||0))}function Yg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Mb=e=>()=>e;function RY(e,t){return function(n){return e+n*t}}function _Y(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function LY(e){return(e=+e)==1?bM:function(t,n){return n-t?_Y(t,n,e):Mb(isNaN(t)?n:t)}}function bM(e,t){var n=t-e;return n?RY(e,n):Mb(isNaN(e)?t:e)}const VC=function e(t){var n=LY(t);function r(i,a){var s=n((i=sx(i)).r,(a=sx(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=bM(i.opacity,a.opacity);return function(p){return i.r=s(p),i.g=l(p),i.b=c(p),i.opacity=u(p),i+""}}return r.gamma=e,r}(1);function DY(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function zY(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $Y(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=Hl(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(l){for(s=0;s<r;++s)a[s]=i[s](l);return a}}function BY(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function $f(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function FY(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Hl(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var lx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gg=new RegExp(lx.source,"g");function UY(e){return function(){return e}}function WY(e){return function(t){return e(t)+""}}function KY(e,t){var n=lx.lastIndex=Gg.lastIndex=0,r,i,a,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=lx.exec(e))&&(i=Gg.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[s]?l[s]+=a:l[++s]=a),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:$f(r,i)})),n=Gg.lastIndex;return n<t.length&&(a=t.slice(n),l[s]?l[s]+=a:l[++s]=a),l.length<2?c[0]?WY(c[0].x):UY(t):(t=c.length,function(u){for(var p=0,d;p<t;++p)l[(d=c[p]).i]=d.x(u);return l.join("")})}function Hl(e,t){var n=typeof t,r;return t==null||n==="boolean"?Mb(t):(n==="number"?$f:n==="string"?(r=Pu(t))?(t=r,VC):KY:t instanceof Pu?VC:t instanceof Date?BY:zY(t)?DY:Array.isArray(t)?$Y:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?FY:$f)(e,t)}function Rb(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function HY(e,t){t===void 0&&(t=e,e=Hl);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(s){var l=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return a[l](s-l)}}function VY(e){return function(){return e}}function Bf(e){return+e}var qC=[0,1];function nr(e){return e}function cx(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:VY(isNaN(t)?NaN:.5)}function qY(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function YY(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=cx(i,r),a=n(s,a)):(r=cx(r,i),a=n(a,s)),function(l){return a(r(l))}}function GY(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=cx(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(l){var c=nd(e,l,1,r)-1;return a[c](i[c](l))}}function id(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function sm(){var e=qC,t=qC,n=Hl,r,i,a,s=nr,l,c,u;function p(){var h=Math.min(e.length,t.length);return s!==nr&&(s=qY(e[0],e[h-1])),l=h>2?GY:YY,c=u=null,d}function d(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(r),t,n)))(r(s(h)))}return d.invert=function(h){return s(i((u||(u=l(t,e.map(r),$f)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,Bf),p()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),p()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Rb,p()},d.clamp=function(h){return arguments.length?(s=h?!0:nr,p()):s!==nr},d.interpolate=function(h){return arguments.length?(n=h,p()):n},d.unknown=function(h){return arguments.length?(a=h,d):a},function(h,m){return r=h,i=m,p()}}function _b(){return sm()(nr,nr)}function XY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ff(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function El(e){return e=Ff(Math.abs(e)),e?e[1]:NaN}function QY(e,t){return function(n,r){for(var i=n.length,a=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[s=(s+1)%e.length];return a.reverse().join(t)}}function ZY(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var JY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Au(e){if(!(t=JY.exec(e)))throw new Error("invalid format: "+e);var t;return new Lb({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]})}Au.prototype=Lb.prototype;function Lb(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+""}Lb.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 eG(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Uf;function tG(e,t){var n=Ff(e,t);if(!n)return Uf=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Uf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ff(e,Math.max(0,t+a-1))[0]}function YC(e,t){var n=Ff(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const GC={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:XY,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)=>YC(e*100,t),r:YC,s:tG,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function XC(e){return e}var QC=Array.prototype.map,ZC=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nG(e){var t=e.grouping===void 0||e.thousands===void 0?XC:QY(QC.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?XC:ZY(QC.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,h){d=Au(d);var m=d.fill,g=d.align,v=d.sign,x=d.symbol,y=d.zero,b=d.width,w=d.comma,j=d.precision,k=d.trim,S=d.type;S==="n"?(w=!0,S="g"):GC[S]||(j===void 0&&(j=12),k=!0,S="g"),(y||m==="0"&&g==="=")&&(y=!0,m="0",g="=");var A=(h&&h.prefix!==void 0?h.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),T=(x==="$"?r:/[%p]/.test(S)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),L=GC[S],O=/[defgprs%]/.test(S);j=j===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function R(_){var X=A,q=T,I,$,H;if(S==="c")q=L(_)+q,_="";else{_=+_;var N=_<0||1/_<0;if(_=isNaN(_)?c:L(Math.abs(_),j),k&&(_=eG(_)),N&&+_==0&&v!=="+"&&(N=!1),X=(N?v==="("?v:l:v==="-"||v==="("?"":v)+X,q=(S==="s"&&!isNaN(_)&&Uf!==void 0?ZC[8+Uf/3]:"")+q+(N&&v==="("?")":""),O){for(I=-1,$=_.length;++I<$;)if(H=_.charCodeAt(I),48>H||H>57){q=(H===46?i+_.slice(I+1):_.slice(I))+q,_=_.slice(0,I);break}}}w&&!y&&(_=t(_,1/0));var W=X.length+_.length+q.length,P=W<b?new Array(b-W+1).join(m):"";switch(w&&y&&(_=t(P+_,P.length?b-q.length:1/0),P=""),g){case"<":_=X+_+q+P;break;case"=":_=X+P+_+q;break;case"^":_=P.slice(0,W=P.length>>1)+X+_+q+P.slice(W);break;default:_=P+X+_+q;break}return a(_)}return R.toString=function(){return d+""},R}function p(d,h){var m=Math.max(-8,Math.min(8,Math.floor(El(h)/3)))*3,g=Math.pow(10,-m),v=u((d=Au(d),d.type="f",d),{suffix:ZC[8+m/3]});return function(x){return v(g*x)}}return{format:u,formatPrefix:p}}var Zd,Db,wM;rG({thousands:",",grouping:[3],currency:["$",""]});function rG(e){return Zd=nG(e),Db=Zd.format,wM=Zd.formatPrefix,Zd}function iG(e){return Math.max(0,-El(Math.abs(e)))}function aG(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(El(t)/3)))*3-El(Math.abs(e)))}function oG(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,El(t)-El(e))+1}function jM(e,t,n,r){var i=ax(e,t,n),a;switch(r=Au(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=aG(i,s))&&(r.precision=a),wM(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=oG(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=iG(i))&&(r.precision=a-(r.type==="%")*2);break}}return Db(r)}function mo(e){var t=e.domain;return e.ticks=function(n){var r=t();return rx(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return jM(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,s=r[i],l=r[a],c,u,p=10;for(l<s&&(u=s,s=l,l=u,u=i,i=a,a=u);p-- >0;){if(u=ix(s,l,n),u===c)return r[i]=s,r[a]=l,t(r);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function SM(){var e=_b();return e.copy=function(){return id(e,SM())},Gr.apply(e,arguments),mo(e)}function kM(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Bf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return kM(e).unknown(t)},e=arguments.length?Array.from(e,Bf):[0,1],mo(n)}function CM(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}function JC(e){return Math.log(e)}function eP(e){return Math.exp(e)}function sG(e){return-Math.log(-e)}function lG(e){return-Math.exp(-e)}function cG(e){return isFinite(e)?+("1e"+e):e<0?0:e}function uG(e){return e===10?cG:e===Math.E?Math.exp:t=>Math.pow(e,t)}function dG(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 tP(e){return(t,n)=>-e(-t,n)}function zb(e){const t=e(JC,eP),n=t.domain;let r=10,i,a;function s(){return i=dG(r),a=uG(r),n()[0]<0?(i=tP(i),a=tP(a),e(sG,lG)):e(JC,eP),t}return t.base=function(l){return arguments.length?(r=+l,s()):r},t.domain=function(l){return arguments.length?(n(l),s()):n()},t.ticks=l=>{const c=n();let u=c[0],p=c[c.length-1];const d=p<u;d&&([u,p]=[p,u]);let h=i(u),m=i(p),g,v;const x=l==null?10:+l;let y=[];if(!(r%1)&&m-h<x){if(h=Math.floor(h),m=Math.ceil(m),u>0){for(;h<=m;++h)for(g=1;g<r;++g)if(v=h<0?g/a(-h):g*a(h),!(v<u)){if(v>p)break;y.push(v)}}else for(;h<=m;++h)for(g=r-1;g>=1;--g)if(v=h>0?g/a(-h):g*a(h),!(v<u)){if(v>p)break;y.push(v)}y.length*2<x&&(y=rx(u,p,x))}else y=rx(h,m,Math.min(m-h,x)).map(a);return d?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Au(c)).precision==null&&(c.trim=!0),c=Db(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return p=>{let d=p/a(Math.round(i(p)));return d*r<r-.5&&(d*=r),d<=u?c(p):""}},t.nice=()=>n(CM(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function PM(){const e=zb(sm()).domain([1,10]);return e.copy=()=>id(e,PM()).base(e.base()),Gr.apply(e,arguments),e}function nP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function rP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function $b(e){var t=1,n=e(nP(t),rP(t));return n.constant=function(r){return arguments.length?e(nP(t=+r),rP(t)):t},mo(n)}function AM(){var e=$b(sm());return e.copy=function(){return id(e,AM()).constant(e.constant())},Gr.apply(e,arguments)}function iP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function pG(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function fG(e){return e<0?-e*e:e*e}function Bb(e){var t=e(nr,nr),n=1;function r(){return n===1?e(nr,nr):n===.5?e(pG,fG):e(iP(n),iP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},mo(t)}function Fb(){var e=Bb(sm());return e.copy=function(){return id(e,Fb()).exponent(e.exponent())},Gr.apply(e,arguments),e}function hG(){return Fb.apply(null,arguments).exponent(.5)}function aP(e){return Math.sign(e)*e*e}function mG(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function EM(){var e=_b(),t=[0,1],n=!1,r;function i(a){var s=mG(e(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return e.invert(aP(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,Bf)).map(aP)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return EM(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Gr.apply(i,arguments),mo(i)}function TM(){var e=[],t=[],n=[],r;function i(){var s=0,l=Math.max(1,t.length);for(n=new Array(l-1);++s<l;)n[s-1]=xY(e,s/l);return a}function a(s){return s==null||isNaN(s=+s)?r:t[nd(n,s)]}return a.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(eo),i()},a.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return TM().domain(e).range(t).unknown(r)},Gr.apply(a,arguments)}function IM(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[nd(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},s.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return IM().domain([e,t]).range(i).unknown(a)},Gr.apply(mo(s),arguments)}function OM(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[nd(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var s=t.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return OM().domain(e).range(t).unknown(n)},Gr.apply(i,arguments)}const Xg=new Date,Qg=new Date;function bn(e,t,n,r){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 s=i(a),l=i.ceil(a);return a-s<l-a?s:l},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<s)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<s);return c},i.filter=a=>bn(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!a(s););else for(;--l>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(Xg.setTime(+a),Qg.setTime(+s),e(Xg),e(Qg),Math.floor(n(Xg,Qg))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Wf=bn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Wf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?bn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Wf);Wf.range;const oa=1e3,Kr=oa*60,sa=Kr*60,ga=sa*24,Ub=ga*7,oP=ga*30,Zg=ga*365,Bo=bn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*oa)},(e,t)=>(t-e)/oa,e=>e.getUTCSeconds());Bo.range;const Wb=bn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*oa)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getMinutes());Wb.range;const Kb=bn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getUTCMinutes());Kb.range;const Hb=bn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*oa-e.getMinutes()*Kr)},(e,t)=>{e.setTime(+e+t*sa)},(e,t)=>(t-e)/sa,e=>e.getHours());Hb.range;const Vb=bn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*sa)},(e,t)=>(t-e)/sa,e=>e.getUTCHours());Vb.range;const ad=bn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Kr)/ga,e=>e.getDate()-1);ad.range;const lm=bn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ga,e=>e.getUTCDate()-1);lm.range;const NM=bn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ga,e=>Math.floor(e/ga));NM.range;function vs(e){return bn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Kr)/Ub)}const cm=vs(0),Kf=vs(1),gG=vs(2),yG=vs(3),Tl=vs(4),vG=vs(5),xG=vs(6);cm.range;Kf.range;gG.range;yG.range;Tl.range;vG.range;xG.range;function xs(e){return bn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Ub)}const um=xs(0),Hf=xs(1),bG=xs(2),wG=xs(3),Il=xs(4),jG=xs(5),SG=xs(6);um.range;Hf.range;bG.range;wG.range;Il.range;jG.range;SG.range;const qb=bn(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());qb.range;const Yb=bn(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());Yb.range;const ya=bn(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());ya.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:bn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});ya.range;const va=bn(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());va.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:bn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});va.range;function MM(e,t,n,r,i,a){const s=[[Bo,1,oa],[Bo,5,5*oa],[Bo,15,15*oa],[Bo,30,30*oa],[a,1,Kr],[a,5,5*Kr],[a,15,15*Kr],[a,30,30*Kr],[i,1,sa],[i,3,3*sa],[i,6,6*sa],[i,12,12*sa],[r,1,ga],[r,2,2*ga],[n,1,Ub],[t,1,oP],[t,3,3*oP],[e,1,Zg]];function l(u,p,d){const h=p<u;h&&([u,p]=[p,u]);const m=d&&typeof d.range=="function"?d:c(u,p,d),g=m?m.range(u,+p+1):[];return h?g.reverse():g}function c(u,p,d){const h=Math.abs(p-u)/d,m=Tb(([,,x])=>x).right(s,h);if(m===s.length)return e.every(ax(u/Zg,p/Zg,d));if(m===0)return Wf.every(Math.max(ax(u,p,d),1));const[g,v]=s[h/s[m-1][2]<s[m][2]/h?m-1:m];return g.every(v)}return[l,c]}const[kG,CG]=MM(va,Yb,um,NM,Vb,Kb),[PG,AG]=MM(ya,qb,cm,ad,Hb,Wb);function Jg(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 ey(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 vc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function EG(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=xc(i),p=bc(i),d=xc(a),h=bc(a),m=xc(s),g=bc(s),v=xc(l),x=bc(l),y=xc(c),b=bc(c),w={a:H,A:N,b:W,B:P,c:null,d:pP,e:pP,f:QG,g:sX,G:cX,H:YG,I:GG,j:XG,L:RM,m:ZG,M:JG,p:U,q:le,Q:mP,s:gP,S:eX,u:tX,U:nX,V:rX,w:iX,W:aX,x:null,X:null,y:oX,Y:lX,Z:uX,"%":hP},j={a:E,A:me,b:ye,B:Q,c:null,d:fP,e:fP,f:hX,g:kX,G:PX,H:dX,I:pX,j:fX,L:LM,m:mX,M:gX,p:ie,q:je,Q:mP,s:gP,S:yX,u:vX,U:xX,V:bX,w:wX,W:jX,x:null,X:null,y:SX,Y:CX,Z:AX,"%":hP},k={a:O,A:R,b:_,B:X,c:q,d:uP,e:uP,f:KG,g:cP,G:lP,H:dP,I:dP,j:BG,L:WG,m:$G,M:FG,p:L,q:zG,Q:VG,s:qG,S:UG,u:MG,U:RG,V:_G,w:NG,W:LG,x:I,X:$,y:cP,Y:lP,Z:DG,"%":HG};w.x=S(n,w),w.X=S(r,w),w.c=S(t,w),j.x=S(n,j),j.X=S(r,j),j.c=S(t,j);function S(Z,re){return function(pe){var se=[],Re=-1,ke=0,ne=Z.length,De,qe,ze;for(pe instanceof Date||(pe=new Date(+pe));++Re<ne;)Z.charCodeAt(Re)===37&&(se.push(Z.slice(ke,Re)),(qe=sP[De=Z.charAt(++Re)])!=null?De=Z.charAt(++Re):qe=De==="e"?" ":"0",(ze=re[De])&&(De=ze(pe,qe)),se.push(De),ke=Re+1);return se.push(Z.slice(ke,Re)),se.join("")}}function A(Z,re){return function(pe){var se=vc(1900,void 0,1),Re=T(se,Z,pe+="",0),ke,ne;if(Re!=pe.length)return null;if("Q"in se)return new Date(se.Q);if("s"in se)return new Date(se.s*1e3+("L"in se?se.L:0));if(re&&!("Z"in se)&&(se.Z=0),"p"in se&&(se.H=se.H%12+se.p*12),se.m===void 0&&(se.m="q"in se?se.q:0),"V"in se){if(se.V<1||se.V>53)return null;"w"in se||(se.w=1),"Z"in se?(ke=ey(vc(se.y,0,1)),ne=ke.getUTCDay(),ke=ne>4||ne===0?Hf.ceil(ke):Hf(ke),ke=lm.offset(ke,(se.V-1)*7),se.y=ke.getUTCFullYear(),se.m=ke.getUTCMonth(),se.d=ke.getUTCDate()+(se.w+6)%7):(ke=Jg(vc(se.y,0,1)),ne=ke.getDay(),ke=ne>4||ne===0?Kf.ceil(ke):Kf(ke),ke=ad.offset(ke,(se.V-1)*7),se.y=ke.getFullYear(),se.m=ke.getMonth(),se.d=ke.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),ne="Z"in se?ey(vc(se.y,0,1)).getUTCDay():Jg(vc(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(ne+5)%7:se.w+se.U*7-(ne+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,ey(se)):Jg(se)}}function T(Z,re,pe,se){for(var Re=0,ke=re.length,ne=pe.length,De,qe;Re<ke;){if(se>=ne)return-1;if(De=re.charCodeAt(Re++),De===37){if(De=re.charAt(Re++),qe=k[De in sP?re.charAt(Re++):De],!qe||(se=qe(Z,pe,se))<0)return-1}else if(De!=pe.charCodeAt(se++))return-1}return se}function L(Z,re,pe){var se=u.exec(re.slice(pe));return se?(Z.p=p.get(se[0].toLowerCase()),pe+se[0].length):-1}function O(Z,re,pe){var se=m.exec(re.slice(pe));return se?(Z.w=g.get(se[0].toLowerCase()),pe+se[0].length):-1}function R(Z,re,pe){var se=d.exec(re.slice(pe));return se?(Z.w=h.get(se[0].toLowerCase()),pe+se[0].length):-1}function _(Z,re,pe){var se=y.exec(re.slice(pe));return se?(Z.m=b.get(se[0].toLowerCase()),pe+se[0].length):-1}function X(Z,re,pe){var se=v.exec(re.slice(pe));return se?(Z.m=x.get(se[0].toLowerCase()),pe+se[0].length):-1}function q(Z,re,pe){return T(Z,t,re,pe)}function I(Z,re,pe){return T(Z,n,re,pe)}function $(Z,re,pe){return T(Z,r,re,pe)}function H(Z){return s[Z.getDay()]}function N(Z){return a[Z.getDay()]}function W(Z){return c[Z.getMonth()]}function P(Z){return l[Z.getMonth()]}function U(Z){return i[+(Z.getHours()>=12)]}function le(Z){return 1+~~(Z.getMonth()/3)}function E(Z){return s[Z.getUTCDay()]}function me(Z){return a[Z.getUTCDay()]}function ye(Z){return c[Z.getUTCMonth()]}function Q(Z){return l[Z.getUTCMonth()]}function ie(Z){return i[+(Z.getUTCHours()>=12)]}function je(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var re=S(Z+="",w);return re.toString=function(){return Z},re},parse:function(Z){var re=A(Z+="",!1);return re.toString=function(){return Z},re},utcFormat:function(Z){var re=S(Z+="",j);return re.toString=function(){return Z},re},utcParse:function(Z){var re=A(Z+="",!0);return re.toString=function(){return Z},re}}}var sP={"-":"",_:" ",0:"0"},En=/^\s*\d+/,TG=/^%/,IG=/[\\^$*+?|[\]().{}]/g;function vt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function OG(e){return e.replace(IG,"\\$&")}function xc(e){return new RegExp("^(?:"+e.map(OG).join("|")+")","i")}function bc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function NG(e,t,n){var r=En.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function MG(e,t,n){var r=En.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function RG(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function _G(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function LG(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function lP(e,t,n){var r=En.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function cP(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function DG(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function zG(e,t,n){var r=En.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function $G(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function uP(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function BG(e,t,n){var r=En.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function dP(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function FG(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function UG(e,t,n){var r=En.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function WG(e,t,n){var r=En.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function KG(e,t,n){var r=En.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function HG(e,t,n){var r=TG.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function VG(e,t,n){var r=En.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qG(e,t,n){var r=En.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function pP(e,t){return vt(e.getDate(),t,2)}function YG(e,t){return vt(e.getHours(),t,2)}function GG(e,t){return vt(e.getHours()%12||12,t,2)}function XG(e,t){return vt(1+ad.count(ya(e),e),t,3)}function RM(e,t){return vt(e.getMilliseconds(),t,3)}function QG(e,t){return RM(e,t)+"000"}function ZG(e,t){return vt(e.getMonth()+1,t,2)}function JG(e,t){return vt(e.getMinutes(),t,2)}function eX(e,t){return vt(e.getSeconds(),t,2)}function tX(e){var t=e.getDay();return t===0?7:t}function nX(e,t){return vt(cm.count(ya(e)-1,e),t,2)}function _M(e){var t=e.getDay();return t>=4||t===0?Tl(e):Tl.ceil(e)}function rX(e,t){return e=_M(e),vt(Tl.count(ya(e),e)+(ya(e).getDay()===4),t,2)}function iX(e){return e.getDay()}function aX(e,t){return vt(Kf.count(ya(e)-1,e),t,2)}function oX(e,t){return vt(e.getFullYear()%100,t,2)}function sX(e,t){return e=_M(e),vt(e.getFullYear()%100,t,2)}function lX(e,t){return vt(e.getFullYear()%1e4,t,4)}function cX(e,t){var n=e.getDay();return e=n>=4||n===0?Tl(e):Tl.ceil(e),vt(e.getFullYear()%1e4,t,4)}function uX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function fP(e,t){return vt(e.getUTCDate(),t,2)}function dX(e,t){return vt(e.getUTCHours(),t,2)}function pX(e,t){return vt(e.getUTCHours()%12||12,t,2)}function fX(e,t){return vt(1+lm.count(va(e),e),t,3)}function LM(e,t){return vt(e.getUTCMilliseconds(),t,3)}function hX(e,t){return LM(e,t)+"000"}function mX(e,t){return vt(e.getUTCMonth()+1,t,2)}function gX(e,t){return vt(e.getUTCMinutes(),t,2)}function yX(e,t){return vt(e.getUTCSeconds(),t,2)}function vX(e){var t=e.getUTCDay();return t===0?7:t}function xX(e,t){return vt(um.count(va(e)-1,e),t,2)}function DM(e){var t=e.getUTCDay();return t>=4||t===0?Il(e):Il.ceil(e)}function bX(e,t){return e=DM(e),vt(Il.count(va(e),e)+(va(e).getUTCDay()===4),t,2)}function wX(e){return e.getUTCDay()}function jX(e,t){return vt(Hf.count(va(e)-1,e),t,2)}function SX(e,t){return vt(e.getUTCFullYear()%100,t,2)}function kX(e,t){return e=DM(e),vt(e.getUTCFullYear()%100,t,2)}function CX(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function PX(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Il(e):Il.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function AX(){return"+0000"}function hP(){return"%"}function mP(e){return+e}function gP(e){return Math.floor(+e/1e3)}var Ns,zM,$M;EX({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 EX(e){return Ns=EG(e),zM=Ns.format,Ns.parse,$M=Ns.utcFormat,Ns.utcParse,Ns}function TX(e){return new Date(e)}function IX(e){return e instanceof Date?+e:+new Date(+e)}function Gb(e,t,n,r,i,a,s,l,c,u){var p=_b(),d=p.invert,h=p.domain,m=u(".%L"),g=u(":%S"),v=u("%I:%M"),x=u("%I %p"),y=u("%a %d"),b=u("%b %d"),w=u("%B"),j=u("%Y");function k(S){return(c(S)<S?m:l(S)<S?g:s(S)<S?v:a(S)<S?x:r(S)<S?i(S)<S?y:b:n(S)<S?w:j)(S)}return p.invert=function(S){return new Date(d(S))},p.domain=function(S){return arguments.length?h(Array.from(S,IX)):h().map(TX)},p.ticks=function(S){var A=h();return e(A[0],A[A.length-1],S??10)},p.tickFormat=function(S,A){return A==null?k:u(A)},p.nice=function(S){var A=h();return(!S||typeof S.range!="function")&&(S=t(A[0],A[A.length-1],S??10)),S?h(CM(A,S)):p},p.copy=function(){return id(p,Gb(e,t,n,r,i,a,s,l,c,u))},p}function OX(){return Gr.apply(Gb(PG,AG,ya,qb,cm,ad,Hb,Wb,Bo,zM).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function NX(){return Gr.apply(Gb(kG,CG,va,Yb,um,lm,Vb,Kb,Bo,$M).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function dm(){var e=0,t=1,n,r,i,a,s=nr,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:s(i===0?.5:(d=(a(d)-n)*i,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(s=d,u):s};function p(d){return function(h){var m,g;return arguments.length?([m,g]=h,s=d(m,g),u):[s(0),s(1)]}}return u.range=p(Hl),u.rangeRound=p(Rb),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return a=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),u}}function go(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function BM(){var e=mo(dm()(nr));return e.copy=function(){return go(e,BM())},ka.apply(e,arguments)}function FM(){var e=zb(dm()).domain([1,10]);return e.copy=function(){return go(e,FM()).base(e.base())},ka.apply(e,arguments)}function UM(){var e=$b(dm());return e.copy=function(){return go(e,UM()).constant(e.constant())},ka.apply(e,arguments)}function Xb(){var e=Bb(dm());return e.copy=function(){return go(e,Xb()).exponent(e.exponent())},ka.apply(e,arguments)}function MX(){return Xb.apply(null,arguments).exponent(.5)}function WM(){var e=[],t=nr;function n(r){if(r!=null&&!isNaN(r=+r))return t((nd(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(eo),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>vY(e,a/r))},n.copy=function(){return WM(t).domain(e)},ka.apply(n,arguments)}function pm(){var e=0,t=.5,n=1,r=1,i,a,s,l,c,u=nr,p,d=!1,h;function m(v){return isNaN(v=+v)?h:(v=.5+((v=+p(v))-a)*(r*v<r*a?l:c),u(d?Math.max(0,Math.min(1,v)):v))}m.domain=function(v){return arguments.length?([e,t,n]=v,i=p(e=+e),a=p(t=+t),s=p(n=+n),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,m):[e,t,n]},m.clamp=function(v){return arguments.length?(d=!!v,m):d},m.interpolator=function(v){return arguments.length?(u=v,m):u};function g(v){return function(x){var y,b,w;return arguments.length?([y,b,w]=x,u=HY(v,[y,b,w]),m):[u(0),u(.5),u(1)]}}return m.range=g(Hl),m.rangeRound=g(Rb),m.unknown=function(v){return arguments.length?(h=v,m):h},function(v){return p=v,i=v(e),a=v(t),s=v(n),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,m}}function KM(){var e=mo(pm()(nr));return e.copy=function(){return go(e,KM())},ka.apply(e,arguments)}function HM(){var e=zb(pm()).domain([.1,1,10]);return e.copy=function(){return go(e,HM()).base(e.base())},ka.apply(e,arguments)}function VM(){var e=$b(pm());return e.copy=function(){return go(e,VM()).constant(e.constant())},ka.apply(e,arguments)}function Qb(){var e=Bb(pm());return e.copy=function(){return go(e,Qb()).exponent(e.exponent())},ka.apply(e,arguments)}function RX(){return Qb.apply(null,arguments).exponent(.5)}const qM=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ob,scaleDiverging:KM,scaleDivergingLog:HM,scaleDivergingPow:Qb,scaleDivergingSqrt:RX,scaleDivergingSymlog:VM,scaleIdentity:kM,scaleImplicit:ox,scaleLinear:SM,scaleLog:PM,scaleOrdinal:Ib,scalePoint:wY,scalePow:Fb,scaleQuantile:TM,scaleQuantize:IM,scaleRadial:EM,scaleSequential:BM,scaleSequentialLog:FM,scaleSequentialPow:Xb,scaleSequentialQuantile:WM,scaleSequentialSqrt:MX,scaleSequentialSymlog:UM,scaleSqrt:hG,scaleSymlog:AM,scaleThreshold:OM,scaleTime:OX,scaleUtc:NX,tickFormat:jM},Symbol.toStringTag,{value:"Module"}));function _X(e){var t=qM;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Uu(e));if(n in t&&typeof t[n]=="function")return t[n]()}function yP(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=_X(e);if(r!=null)return r.domain(t).range(n),r}}function Zb(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?yP(e.scale,n,r):yP(t,n,r)}function LX(e){return"scale".concat(Uu(e))}function DX(e){return LX(e)in qM}var YM=(e,t,n)=>{if(e!=null){var r=e.scale,i=e.type;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return DX(r)?r:"point"}};function zX(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function GM(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var s;return(s=e(a))!==null&&s!==void 0?s:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var s,l,c=zX(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var u=(s=r[c-1])!==null&&s!==void 0?s:0,p=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-u)<=Math.abs(a-p)?n[c-1]:n[c]}}}function $X(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):GM(e,void 0)}function vP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vP(Object(n),!0).forEach(function(r){BX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BX(e,t,n){return(t=FX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FX(e){var t=UX(e,"string");return typeof t=="symbol"?t:t+""}function UX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XM(e,t){return VX(e)||HX(e,t)||KX(e,t)||WX()}function WX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
466
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KX(e,t){if(e){if(typeof e=="string")return xP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xP(e,t):void 0}}function xP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function HX(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function VX(e){if(Array.isArray(e))return e}var ux=[0,"auto"],hn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},QM=(e,t)=>e.cartesianAxis.xAxis[t],Ca=(e,t)=>{var n=QM(e,t);return n??hn},mn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:ux,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:Vu},ZM=(e,t)=>e.cartesianAxis.yAxis[t],Pa=(e,t)=>{var n=ZM(e,t);return n??mn},qX={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Jb=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??qX},Zt=(e,t,n)=>{switch(t){case"xAxis":return Ca(e,n);case"yAxis":return Pa(e,n);case"zAxis":return Jb(e,n);case"angleAxis":return Cb(e,n);case"radiusAxis":return Pb(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},YX=(e,t,n)=>{switch(t){case"xAxis":return Ca(e,n);case"yAxis":return Pa(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Vl=(e,t,n)=>{switch(t){case"xAxis":return Ca(e,n);case"yAxis":return Pa(e,n);case"angleAxis":return Cb(e,n);case"radiusAxis":return Pb(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},JM=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function e1(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var od=e=>e.graphicalItems.cartesianItems,GX=G([Qt,ed],e1),t1=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),ql=G([od,Zt,GX],t1,{memoizeOptions:{resultEqualityCheck:om}}),eR=G([ql],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(am)),tR=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),XX=G([ql],tR),n1=e=>e.map(t=>t.data).filter(Boolean).flat(1),QX=G([ql],e=>e.some(t=>!t.data)),nR=G([ql],n1,{memoizeOptions:{resultEqualityCheck:om}}),r1=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},i1=G([nR,Zu],r1),rR=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:gt(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:gt(i,r)}))):e.map(r=>({value:r})),iR=(e,t,n,r,i,a)=>{var s=r.chartData,l=s===void 0?[]:s,c=r.dataStartIndex,u=r.dataEndIndex,p=rR(e,t,n);if(i&&(t==null?void 0:t.dataKey)!=null&&a.length>0){var d=l.slice(c,u+1),h=d.map(m=>({value:gt(m,t.dataKey)})).filter(m=>m.value!=null);return[...h,...p]}return p},sd=G([i1,Zt,ql,Zu,QX,nR],iR);function hl(e){if(Ui(e)||e instanceof Date){var t=Number(e);if(et(t))return t}}function bP(e){if(Array.isArray(e)){var t=[hl(e[0]),hl(e[1])];return zi(t)?t:void 0}var n=hl(e);if(n!=null)return[n,n]}function pi(e){return e.map(hl).filter(fr)}function ZX(e,t){var n=hl(e),r=hl(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var JX=G([sd],e=>e==null?void 0:e.map(t=>t.value).sort(ZX));function aR(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function eQ(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!ui(t))r=t;else if(Array.isArray(t)){var i=pi(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:pi(n.flatMap(a=>{var s=gt(e,a.dataKey),l,c;if(Array.isArray(s)){var u=XM(s,2);l=u[0],c=u[1]}else l=c=s;if(!(!et(l)||!et(c)))return[r-l,r+c]}))}var wn=e=>{var t=An(e),n=Kl(e);return Vl(e,t,n)},Ol=G([wn],e=>e==null?void 0:e.dataKey),tQ=G([eR,Zu,wn],pM),oR=(e,t,n,r)=>{var i={},a=t.reduce((s,l)=>{if(l.stackId==null)return s;var c=s[l.stackId];return c==null&&(c=[]),c.push(l),s[l.stackId]=c,s},i);return Object.fromEntries(Object.entries(a).map(s=>{var l=XM(s,2),c=l[0],u=l[1],p=r?[...u].reverse():u,d=p.map(im);return[c,{stackedData:pH(e,d,n),graphicalItems:p}]}))},qf=G([tQ,eR,Ju,aM],oR),sR=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!=="zAxis")return gH(e,i,a)},nQ=G([Zt],e=>e.allowDataOverflow),a1=e=>{var t;if(e==null||!("domain"in e))return ux;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=pi(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:ux},o1=G([Zt],a1),s1=G([o1,nQ],VN),rQ=G([qf,mi,Qt,s1],sR,{memoizeOptions:{resultEqualityCheck:td}}),fm=e=>e.errorBars,iQ=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>aR(n,r)),Yf=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),s=Math.min(...a),l=Math.max(...a);return[s,l]}},l1=function(t,n,r,i,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],l,c;if(r.length>0&&r.forEach(u=>{var p,d=u.data!=null?[...u.data]:s,h=(p=i[u.id])===null||p===void 0?void 0:p.filter(m=>aR(a,m));d.forEach(m=>{var g,v=gt(m,(g=n.dataKey)!==null&&g!==void 0?g:u.dataKey),x=eQ(m,v,h);if(x.length>=2){var y=Math.min(...x),b=Math.max(...x);(l==null||y<l)&&(l=y),(c==null||b>c)&&(c=b)}var w=bP(v);w!=null&&(l=l==null?w[0]:Math.min(l,w[0]),c=c==null?w[1]:Math.max(c,w[1]))})}),(n==null?void 0:n.dataKey)!=null&&r.length===0&&t.forEach(u=>{var p=bP(gt(u,n.dataKey));p!=null&&(l=l==null?p[0]:Math.min(l,p[0]),c=c==null?p[1]:Math.max(c,p[1]))}),et(l)&&et(c))return[l,c]},aQ=G([i1,Zt,XX,fm,Qt,_q],l1,{memoizeOptions:{resultEqualityCheck:td}});function oQ(e){var t=e.value;if(Ui(t)||t instanceof Date)return t}var sQ=(e,t,n)=>{var r=e.map(oQ).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&mO(r))?KN(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},lR=e=>e.referenceElements.dots,Yl=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),lQ=G([lR,Qt,ed],Yl),cR=e=>e.referenceElements.areas,cQ=G([cR,Qt,ed],Yl),uR=e=>e.referenceElements.lines,uQ=G([uR,Qt,ed],Yl),dR=(e,t)=>{if(e!=null){var n=pi(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},dQ=G(lQ,Qt,dR),pR=(e,t)=>{if(e!=null){var n=pi(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},pQ=G([cQ,Qt],pR);function fQ(e){var t;if(e.x!=null)return pi([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:pi(n)}function hQ(e){var t;if(e.y!=null)return pi([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:pi(n)}var fR=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?fQ(r):hQ(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},mQ=G([uQ,Qt],fR),gQ=G(dQ,mQ,pQ,(e,t,n)=>Yf(e,n,t)),c1=(e,t,n,r,i,a,s,l,c)=>{if(n!=null)return n;var u=s==="vertical"&&l==="xAxis"||s==="horizontal"&&l==="yAxis",p=u?Yf(r,a,i):Yf(a,i),d=Uq(t,p,e.allowDataOverflow);return d??(e.allowDataOverflow&&p==null&&c!=null?c:d)},yQ=e=>{if(!(e==null||e.type!=="number"||!("ticks"in e)||e.ticks==null)){var t=pi(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},vQ=G([Zt],yQ,{memoizeOptions:{resultEqualityCheck:td}}),xQ=G([Zt,o1,s1,rQ,aQ,gQ,ct,Qt,vQ],c1,{memoizeOptions:{resultEqualityCheck:td}}),bQ=[0,1],u1=(e,t,n,r,i,a,s)=>{if(!((e==null||n==null||n.length===0)&&s===void 0)){var l=e.dataKey,c=e.type,u=hi(t,a);if(u&&l==null){var p;return KN(0,(p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)}return c==="category"?sQ(r,e,u):i==="expand"&&!u?bQ:s}},d1=G([Zt,ct,i1,sd,Ju,Qt,xQ],u1),yo=G([Zt,JM,jb],YM),p1=(e,t,n)=>{var r=t.niceTicks;if(r!=="none"){var i=a1(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&zi(e)){if(a)return TC(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return IC(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&zi(e))return TC(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&zi(e))return IC(e,t.tickCount,t.allowDecimals,"adaptive")}}},f1=G([d1,Vl,yo],p1),h1=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&zi(t)&&Array.isArray(n)&&n.length>0){var i,a,s=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],u=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(s,l),Math.max(c,u)]}return t},wQ=G([Zt,d1,f1,Qt],h1),jQ=G(sd,Zt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(pi(e.map(d=>d.value))).sort((d,h)=>d-h),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var s=a-i;if(s===0)return 1/0;for(var l=0;l<r.length-1;l++){var c=r[l],u=r[l+1];if(!(c==null||u==null)){var p=u-c;n=Math.min(n,p)}}return n/s}}),hR=G(jQ,ct,iM,xn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!et(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var s=qn(n,e*a),l=e*a/2;return l-s-(l-s)/a*s}return 0}),SQ=(e,t,n)=>{var r=Ca(e,t);return r==null||typeof r.padding!="string"?0:hR(e,"xAxis",t,n,r.padding)},kQ=(e,t,n)=>{var r=Pa(e,t);return r==null||typeof r.padding!="string"?0:hR(e,"yAxis",t,n,r.padding)},CQ=G(Ca,SQ,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),PQ=G(Pa,kQ,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),mR=G([xn,CQ,Jh,Zh,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),gR=G([xn,ct,PQ,Jh,Zh,(e,t,n)=>n],(e,t,n,r,i,a)=>{var s=i.padding;return a?[r.height-s.bottom,s.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),ld=(e,t,n,r)=>{var i;switch(t){case"xAxis":return mR(e,n,r);case"yAxis":return gR(e,n,r);case"zAxis":return(i=Jb(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return cM(e);case"radiusAxis":return uM(e,n);default:return}},yR=G([Zt,ld],tm),AQ=G([yo,wQ],fM),m1=G([Zt,yo,AQ,yR],Zb),vR=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale,s=hi(e,r);if(s&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},g1=G([ct,sd,Vl,Qt],vR),hm=G([m1],Eb);G([m1],$X);G([m1,JX],GM);G([ql,fm,Qt],iQ);function xR(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var mm=(e,t)=>t,gm=(e,t,n)=>n,EQ=G(Xh,mm,gm,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(xR)),TQ=G(Qh,mm,gm,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(xR)),bR=(e,t)=>({width:e.width,height:t.height}),IQ=(e,t)=>{var n=typeof t.width=="number"?t.width:Vu;return{width:n,height:e.height}},wR=G(xn,Ca,bR),OQ=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},NQ=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},MQ=G(Sa,xn,EQ,mm,gm,(e,t,n,r,i)=>{var a={},s;return n.forEach(l=>{var c=bR(t,l);s==null&&(s=OQ(t,r,e));var u=r==="top"&&!i||r==="bottom"&&i;a[l.id]=s-Number(u)*c.height,s+=(u?-1:1)*c.height}),a}),RQ=G(ja,xn,TQ,mm,gm,(e,t,n,r,i)=>{var a={},s;return n.forEach(l=>{var c=IQ(t,l);s==null&&(s=NQ(t,r,e));var u=r==="left"&&!i||r==="right"&&i;a[l.id]=s-Number(u)*c.width,s+=(u?-1:1)*c.width}),a}),_Q=(e,t)=>{var n=Ca(e,t);if(n!=null)return MQ(e,n.orientation,n.mirror)},LQ=G([xn,Ca,_Q,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),DQ=(e,t)=>{var n=Pa(e,t);if(n!=null)return RQ(e,n.orientation,n.mirror)},zQ=G([xn,Pa,DQ,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),jR=G(xn,Pa,(e,t)=>{var n=typeof t.width=="number"?t.width:Vu;return{width:n,height:e.height}}),wP=(e,t,n)=>{switch(t){case"xAxis":return wR(e,n).width;case"yAxis":return jR(e,n).height;default:return}},SR=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,s=n.dataKey,l=hi(e,r),c=t.map(p=>p.value),u=c.filter(p=>p!=null);if(s&&l&&a==="category"&&i&&mO(u))return c}},y1=G([ct,sd,Zt,Qt],SR),jP=G([ct,YX,yo,hm,y1,g1,ld,f1,Qt],(e,t,n,r,i,a,s,l,c)=>{if(t!=null){var u=hi(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:u,niceTicks:l,range:s,realScaleType:n,scale:r}}}),$Q=(e,t,n,r,i,a,s,l,c)=>{if(!(t==null||r==null)){var u=hi(e,c),p=t.type,d=t.ticks,h=t.tickCount,m=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,g=p==="category"&&r.bandwidth?r.bandwidth()/m:0;g=c==="angleAxis"&&a!=null&&a.length>=2?kn(a[0]-a[1])*2*g:g;var v=d||i;return v?v.map((x,y)=>{var b=s?s.indexOf(x):x,w=r.map(b);return et(w)?{index:y,coordinate:w+g,value:x,offset:g}:null}).filter(fr):u&&l?l.map((x,y)=>{var b=r.map(x);return et(b)?{coordinate:b+g,value:x,index:y,offset:g}:null}).filter(fr):r.ticks?r.ticks(h).map((x,y)=>{var b=r.map(x);return et(b)?{coordinate:b+g,value:x,index:y,offset:g}:null}).filter(fr):r.domain().map((x,y)=>{var b=r.map(x);return et(b)?{coordinate:b+g,value:s?s[x]:x,index:y,offset:g}:null}).filter(fr)}},kR=G([ct,Vl,yo,hm,f1,ld,y1,g1,Qt],$Q),BQ=(e,t,n,r,i,a,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=hi(e,s),c=t.tickCount,u=0;return u=s==="angleAxis"&&(r==null?void 0:r.length)>=2?kn(r[0]-r[1])*2*u:u,l&&a?a.map((p,d)=>{var h=n.map(p);return et(h)?{coordinate:h+u,value:p,index:d,offset:u}:null}).filter(fr):n.ticks?n.ticks(c).map((p,d)=>{var h=n.map(p);return et(h)?{coordinate:h+u,value:p,index:d,offset:u}:null}).filter(fr):n.domain().map((p,d)=>{var h=n.map(p);return et(h)?{coordinate:h+u,value:i?i[p]:p,index:d,offset:u}:null}).filter(fr)}},Hi=G([ct,Vl,hm,ld,y1,g1,Qt],BQ),Vi=G(Zt,hm,(e,t)=>{if(!(e==null||t==null))return Vf(Vf({},e),{},{scale:t})}),FQ=G([Zt,yo,d1,yR],Zb),UQ=G([FQ],Eb);G((e,t,n)=>Jb(e,n),UQ,(e,t)=>{if(!(e==null||t==null))return Vf(Vf({},e),{},{scale:t})});var WQ=G([ct,Xh,Qh],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),KQ=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};G([KQ],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var s=Math.abs(a.coordinate-t);s<r&&(r=s,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var CR=e=>e.options.defaultTooltipEventType,PR=e=>e.options.validateTooltipEventTypes;function AR(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function cd(e,t){var n=CR(e),r=PR(e);return AR(t,n,r)}function HQ(e){return Ie(t=>cd(t,e))}var ER=(e,t)=>{var n,r=Number(t);if(!(ui(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},VQ=e=>e.tooltip.settings,Fa={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},qQ={itemInteraction:{click:Fa,hover:Fa},axisInteraction:{click:Fa,hover:Fa},keyboardInteraction:Fa,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},TR=Xn({name:"tooltip",initialState:qQ,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(mt(t.payload))},prepare:Dt()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Wr(e).tooltipItemPayloads.indexOf(mt(r));a>-1&&(e.tooltipItemPayloads[a]=mt(i))},prepare:Dt()},removeTooltipEntrySettings:{reducer(e,t){var n=Wr(e).tooltipItemPayloads.indexOf(mt(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Dt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),Xr=TR.actions,YQ=Xr.addTooltipEntrySettings,GQ=Xr.replaceTooltipEntrySettings,XQ=Xr.removeTooltipEntrySettings,QQ=Xr.setTooltipSettingsState,IR=Xr.setActiveMouseOverItemIndex,ZQ=Xr.mouseLeaveItem,OR=Xr.mouseLeaveChart,JQ=Xr.setActiveClickItemIndex,NR=Xr.setMouseOverAxisIndex,eZ=Xr.setMouseClickAxisIndex,Ic=Xr.setSyncInteraction,Gf=Xr.setKeyboardInteraction,tZ=TR.reducer;function SP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SP(Object(n),!0).forEach(function(r){nZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nZ(e,t,n){return(t=rZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rZ(e){var t=iZ(e,"string");return typeof t=="symbol"?t:t+""}function iZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aZ(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function oZ(e){return e.index!=null}var MR=(e,t,n,r)=>{if(t==null)return Fa;var i=aZ(e,t,n);if(i==null)return Fa;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(oZ(i)){if(a)return Jd(Jd({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Jd(Jd({},Fa),{},{coordinate:i.coordinate})};function sZ(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function lZ(e,t){var n=sZ(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),s=Math.max(r,i);return n>=a&&n<=s}function cZ(e,t,n){if(n==null||t==null)return!0;var r=gt(e,t);return r==null||!zi(n)?!0:lZ(r,n)}var Hc=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!et(a))return i;var s=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(s,Math.min(a,l)),u=t[c];return u==null||cZ(u,n,r)?String(c):null},RR=(e,t,n,r,i,a,s)=>{if(a!=null){var l=s[0],c=l==null?void 0:l.getPosition(a);if(c!=null)return c;var u=i==null?void 0:i[Number(a)];if(u)switch(n){case"horizontal":return{x:u.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:u.coordinate}}}},_R=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(s=>{var l;return((l=s.settings)===null||l===void 0?void 0:l.graphicalItemId)===i})},LR=e=>e.options.tooltipPayloadSearcher,Gl=e=>e.tooltip;function kP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kP(Object(n),!0).forEach(function(r){uZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uZ(e,t,n){return(t=dZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dZ(e){var t=pZ(e,"string");return typeof t=="symbol"?t:t+""}function pZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fZ(e){if(typeof e=="string"||typeof e=="number")return e}function hZ(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function mZ(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function PP(e){if(typeof e=="string")return e}function gZ(e){if(!(e==null||typeof e!="object")){var t="name"in e?fZ(e.name):void 0,n="unit"in e?hZ(e.unit):void 0,r="dataKey"in e?mZ(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?PP(e.color):void 0,s="fill"in e?PP(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:s}}}function yZ(e,t){return e??t}var DR=(e,t,n,r,i,a,s)=>{if(!(t==null||a==null)){var l=n.chartData,c=n.computedData,u=n.dataStartIndex,p=n.dataEndIndex,d=[];return e.reduce((h,m)=>{var g,v=m.dataDefinedOnItem,x=m.settings,y=yZ(v,l),b=Array.isArray(y)?yN(y,u,p):y,w=(g=x==null?void 0:x.dataKey)!==null&&g!==void 0?g:r,j=x==null?void 0:x.nameKey,k;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&s==="axis"?k=gO(b,r,i):k=a(b,t,c,j),Array.isArray(k))k.forEach(A=>{var T,L,O=gZ(A),R=O==null?void 0:O.name,_=O==null?void 0:O.dataKey,X=O==null?void 0:O.payload,q=CP(CP({},x),{},{name:R,unit:O==null?void 0:O.unit,color:(T=O==null?void 0:O.color)!==null&&T!==void 0?T:x==null?void 0:x.color,fill:(L=O==null?void 0:O.fill)!==null&&L!==void 0?L:x==null?void 0:x.fill});h.push(kk({tooltipEntrySettings:q,dataKey:_,payload:X,value:gt(X,_),name:R==null?void 0:String(R)}))});else{var S;h.push(kk({tooltipEntrySettings:x,dataKey:w,payload:k,value:gt(k,w),name:(S=gt(k,j))!==null&&S!==void 0?S:x==null?void 0:x.name}))}return h},d)}},v1=G([wn,JM,jb],YM),vZ=G([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),xZ=G([An,Kl],e1),bs=G([vZ,wn,xZ],t1,{memoizeOptions:{resultEqualityCheck:om}}),bZ=G([bs],e=>e.filter(am)),zR=G([bs],n1,{memoizeOptions:{resultEqualityCheck:om}}),wZ=G([bs],e=>e.some(t=>!t.data)),us=G([zR,mi],r1),jZ=G([bZ,mi,wn],pM),x1=G([us,wn,bs,mi,wZ,zR],iR),$R=G([wn],a1),SZ=G([wn],e=>e.allowDataOverflow),BR=G([$R,SZ],VN),kZ=G([bs],e=>e.filter(am)),CZ=G([jZ,kZ,Ju,aM],oR),PZ=G([CZ,mi,An,BR],sR),AZ=G([bs],tR),EZ=G([us,wn,AZ,fm,An,Dq],l1,{memoizeOptions:{resultEqualityCheck:td}}),TZ=G([lR,An,Kl],Yl),IZ=G([TZ,An],dR),OZ=G([cR,An,Kl],Yl),NZ=G([OZ,An],pR),MZ=G([uR,An,Kl],Yl),RZ=G([MZ,An],fR),_Z=G([IZ,RZ,NZ],Yf),LZ=G([wn,$R,BR,PZ,EZ,_Z,ct,An],c1),Nl=G([wn,ct,us,x1,Ju,An,LZ],u1),DZ=G([Nl,wn,v1],p1),zZ=G([wn,Nl,DZ,An],h1),FR=e=>{var t=An(e),n=Kl(e),r=!1;return ld(e,t,n,r)},UR=G([wn,FR],tm),$Z=G([wn,v1,zZ,UR],Zb),WR=G([$Z],Eb),BZ=G([ct,x1,wn,An],SR),FZ=G([ct,x1,wn,An],vR),UZ=(e,t,n,r,i,a,s,l)=>{if(t){var c=t.type,u=hi(e,l);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,d=c==="category"&&r.bandwidth?r.bandwidth()/p:0;return d=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?kn(i[0]-i[1])*2*d:d,u&&s?s.map((h,m)=>{var g=r.map(h);return et(g)?{coordinate:g+d,value:h,index:m,offset:d}:null}).filter(fr):r.domain().map((h,m)=>{var g=r.map(h);return et(g)?{coordinate:g+d,value:a?a[h]:h,index:m,offset:d}:null}).filter(fr)}}},Aa=G([ct,wn,v1,WR,FR,BZ,FZ,An],UZ),b1=G([CR,PR,VQ],(e,t,n)=>AR(n.shared,e,t)),KR=e=>e.tooltip.settings.trigger,w1=e=>e.tooltip.settings.defaultIndex,ud=G([Gl,b1,KR,w1],MR),ao=G([ud,us,Ol,Nl],Hc),HR=G([Aa,ao],ER),j1=G([ud],e=>{if(e)return e.dataKey}),VR=G([ud],e=>{if(e)return e.graphicalItemId}),qR=G([Gl,b1,KR,w1],_R),WZ=G([ja,Sa,ct,xn,Aa,w1,qR],RR),KZ=G([ud,WZ],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),HZ=G([ud],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),VZ=G([qR,ao,mi,Ol,HR,LR,b1],DR),qZ=G([VZ],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function AP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AP(Object(n),!0).forEach(function(r){YZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YZ(e,t,n){return(t=GZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GZ(e){var t=XZ(e,"string");return typeof t=="symbol"?t:t+""}function XZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QZ=()=>Ie(wn),ZZ=()=>{var e=QZ(),t=Ie(Aa),n=Ie(WR);return io(!e||!n?void 0:EP(EP({},e),{},{scale:n}),t)};function TP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ms(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TP(Object(n),!0).forEach(function(r){JZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JZ(e,t,n){return(t=eJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eJ(e){var t=tJ(e,"string");return typeof t=="symbol"?t:t+""}function tJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nJ=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},rJ=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var a=i.coordinate,s=r.radius;return Ms(Ms(Ms({},r),un(r.cx,r.cy,s,a)),{},{angle:a,radius:s})}var l=i.coordinate,c=r.angle;return Ms(Ms(Ms({},r),un(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function iJ(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var YR=(e,t,n,r,i)=>{var a,s=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(s<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l<s;l++){var c,u,p,d,h,m=l>0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(u=n[s-1])===null||u===void 0?void 0:u.coordinate,g=(p=n[l])===null||p===void 0?void 0:p.coordinate,v=l>=s-1?(d=n[0])===null||d===void 0?void 0:d.coordinate:(h=n[l+1])===null||h===void 0?void 0:h.coordinate,x=void 0;if(!(m==null||g==null||v==null))if(kn(g-m)!==kn(v-g)){var y=[];if(kn(v-g)===kn(i[1]-i[0])){x=v;var b=g+i[1]-i[0];y[0]=Math.min(b,(b+m)/2),y[1]=Math.max(b,(b+m)/2)}else{x=m;var w=v+i[1]-i[0];y[0]=Math.min(g,(w+g)/2),y[1]=Math.max(g,(w+g)/2)}var j=[Math.min(g,(x+g)/2),Math.max(g,(x+g)/2)];if(e>j[0]&&e<=j[1]||e>=y[0]&&e<=y[1]){var k;return(k=n[l])===null||k===void 0?void 0:k.index}}else{var S=Math.min(m,v),A=Math.max(m,v);if(e>(S+g)/2&&e<=(A+g)/2){var T;return(T=n[l])===null||T===void 0?void 0:T.index}}}else if(t)for(var L=0;L<s;L++){var O=t[L];if(O!=null){var R=t[L+1],_=t[L-1];if(L===0&&R!=null&&e<=(O.coordinate+R.coordinate)/2||L===s-1&&_!=null&&e>(O.coordinate+_.coordinate)/2||L>0&&L<s-1&&_!=null&&R!=null&&e>(O.coordinate+_.coordinate)/2&&e<=(O.coordinate+R.coordinate)/2)return O.index}}return-1},GR=()=>Ie(jb),S1=(e,t)=>t,XR=(e,t,n)=>n,k1=(e,t,n,r)=>r,aJ=G(Aa,e=>$h(e,t=>t.coordinate)),C1=G([Gl,S1,XR,k1],MR),P1=G([C1,us,Ol,Nl],Hc),oJ=(e,t,n)=>{if(t!=null){var r=Gl(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},QR=G([Gl,S1,XR,k1],_R),Xf=G([ja,Sa,ct,xn,Aa,k1,QR],RR),sJ=G([C1,Xf],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),ZR=G([Aa,P1],ER),lJ=G([QR,P1,mi,Ol,ZR,LR,S1],DR),cJ=G([C1,P1],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),uJ=(e,t,n,r,i,a,s)=>{if(!(!e||!n||!r||!i)&&iJ(e,s)){var l=yH(e,t),c=YR(l,a,i,n,r),u=nJ(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},dJ=(e,t,n,r,i,a,s)=>{if(!(!e||!r||!i||!a||!n)){var l=Tq(e,n);if(l){var c=vH(l,t),u=YR(c,s,a,r,i),p=rJ(t,a,u,l);return{activeIndex:String(u),activeCoordinate:p}}}},pJ=(e,t,n,r,i,a,s,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?uJ(e,t,r,i,a,s,l):dJ(e,t,n,r,i,a,s)},fJ=G(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),hJ=G(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(on)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:oY}});function IP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IP(Object(n),!0).forEach(function(r){mJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mJ(e,t,n){return(t=gJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gJ(e){var t=yJ(e,"string");return typeof t=="symbol"?t:t+""}function yJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vJ={},xJ={zIndexMap:Object.values(on).reduce((e,t)=>OP(OP({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),vJ)},bJ=new Set(Object.values(on));function wJ(e){return bJ.has(e)}var JR=Xn({name:"zIndex",initialState:xJ,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Dt()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!wJ(n)&&delete e.zIndexMap[n])},prepare:Dt()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=mt(i):e.zIndexMap[r].element=mt(i):e.zIndexMap[r]={consumers:0,element:a?void 0:mt(i),panoramaElement:a?mt(i):void 0}},prepare:Dt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:Dt()}}}),ym=JR.actions,jJ=ym.registerZIndexPortal,ty=ym.unregisterZIndexPortal,SJ=ym.registerZIndexPortalElement,kJ=ym.unregisterZIndexPortalElement,CJ=JR.reducer;function lr(e){var t=e.zIndex,n=e.children,r=t7(),i=r&&t!==void 0&&t!==0,a=Pn(),s=f.useRef(void 0),l=f.useRef(new Set),c=Ct(),u=Ie(d=>fJ(d,t,a));if(f.useLayoutEffect(()=>{if(!i){var d=l.current;d.forEach(m=>{c(ty({zIndex:m}))}),d.clear(),s.current=void 0;return}if(l.current.has(t)||(c(jJ({zIndex:t})),l.current.add(t)),u){s.current=u;var h=l.current;h.forEach(m=>{m!==t&&(c(ty({zIndex:m})),h.delete(m))})}},[c,t,i,u]),f.useLayoutEffect(()=>{var d=l.current;return()=>{d.forEach(h=>{c(ty({zIndex:h}))}),d.clear()}},[c]),!i)return n;var p=u??s.current;return p?Lu.createPortal(n,p):null}function dx(){return dx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dx.apply(null,arguments)}function NP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ep(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NP(Object(n),!0).forEach(function(r){PJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PJ(e,t,n){return(t=AJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AJ(e){var t=EJ(e,"string");return typeof t=="symbol"?t:t+""}function EJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function TJ(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return f.isValidElement(t)?f.cloneElement(t,r):f.createElement(n,r)}function IJ(e){var t,n=e.coordinate,r=e.payload,i=e.index,a=e.offset,s=e.tooltipAxisBandSize,l=e.layout,c=e.cursor,u=e.tooltipEventType,p=e.chartName,d=n,h=r,m=i;if(!c||!d||p!=="ScatterChart"&&u!=="axis")return null;var g,v,x;if(p==="ScatterChart")g=d,v=$V,x=on.cursorLine;else if(p==="BarChart")g=BV(l,d,a,s),v=$N,x=on.cursorRectangle;else if(l==="radial"&&xO(d)){var y=FN(d),b=y.cx,w=y.cy,j=y.radius,k=y.startAngle,S=y.endAngle;g={cx:b,cy:w,startAngle:k,endAngle:S,innerRadius:j,outerRadius:j},v=WN,x=on.cursorLine}else g={points:Mq(l,d,a)},v=pl,x=on.cursorLine;var A=typeof c=="object"&&"className"in c?c.className:void 0,T=ep(ep(ep(ep({stroke:"#ccc",pointerEvents:"none"},a),g),as(c)),{},{payload:h,payloadIndex:m,className:yt("recharts-tooltip-cursor",A)});return f.createElement(lr,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:x},f.createElement(TJ,{cursor:c,cursorComp:v,cursorProps:T}))}function OJ(e){var t=ZZ(),n=AN(),r=ho(),i=GR();return t==null||n==null||r==null||i==null?null:f.createElement(IJ,dx({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var e_=f.createContext(null),NJ=()=>f.useContext(e_),t_={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,p){this.fn=c,this.context=u,this.once=p||!1}function a(c,u,p,d,h){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new i(p,d||c,h),g=n?n+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 s(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],p,d;if(this._eventsCount===0)return u;for(d in p=this._events)t.call(p,d)&&u.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(p)):u},l.prototype.listeners=function(u){var p=n?n+u:u,d=this._events[p];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,m=d.length,g=new Array(m);h<m;h++)g[h]=d[h].fn;return g},l.prototype.listenerCount=function(u){var p=n?n+u:u,d=this._events[p];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,p,d,h,m,g){var v=n?n+u:u;if(!this._events[v])return!1;var x=this._events[v],y=arguments.length,b,w;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),y){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,p),!0;case 3:return x.fn.call(x.context,p,d),!0;case 4:return x.fn.call(x.context,p,d,h),!0;case 5:return x.fn.call(x.context,p,d,h,m),!0;case 6:return x.fn.call(x.context,p,d,h,m,g),!0}for(w=1,b=new Array(y-1);w<y;w++)b[w-1]=arguments[w];x.fn.apply(x.context,b)}else{var j=x.length,k;for(w=0;w<j;w++)switch(x[w].once&&this.removeListener(u,x[w].fn,void 0,!0),y){case 1:x[w].fn.call(x[w].context);break;case 2:x[w].fn.call(x[w].context,p);break;case 3:x[w].fn.call(x[w].context,p,d);break;case 4:x[w].fn.call(x[w].context,p,d,h);break;default:if(!b)for(k=1,b=new Array(y-1);k<y;k++)b[k-1]=arguments[k];x[w].fn.apply(x[w].context,b)}}return!0},l.prototype.on=function(u,p,d){return a(this,u,p,d,!1)},l.prototype.once=function(u,p,d){return a(this,u,p,d,!0)},l.prototype.removeListener=function(u,p,d,h){var m=n?n+u:u;if(!this._events[m])return this;if(!p)return s(this,m),this;var g=this._events[m];if(g.fn)g.fn===p&&(!h||g.once)&&(!d||g.context===d)&&s(this,m);else{for(var v=0,x=[],y=g.length;v<y;v++)(g[v].fn!==p||h&&!g[v].once||d&&g[v].context!==d)&&x.push(g[v]);x.length?this._events[m]=x.length===1?x[0]:x:s(this,m)}return this},l.prototype.removeAllListeners=function(u){var p;return u?(p=n?n+u:u,this._events[p]&&s(this,p)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(t_);var MJ=t_.exports;const RJ=Rl(MJ);var Eu=new RJ,px="recharts.syncEvent.tooltip",MP="recharts.syncEvent.brush",dd=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ui(n))return e[n]}},_J={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},n_=Xn({name:"options",initialState:_J,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),LJ=n_.reducer,DJ=n_.actions.createEventEmitter;function zJ(e){return e.tooltip.syncInteraction}var $J={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},r_=Xn({name:"chartData",initialState:$J,reducers:{setChartData(e,t){if(e.chartData=mt(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),A1=r_.actions,RP=A1.setChartData,BJ=A1.setDataStartEndIndexes;A1.setComputedData;var FJ=r_.reducer,UJ=["x","y"];function _P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_P(Object(n),!0).forEach(function(r){WJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_P(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WJ(e,t,n){return(t=KJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KJ(e){var t=HJ(e,"string");return typeof t=="symbol"?t:t+""}function HJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VJ(e,t){if(e==null)return{};var n,r,i=qJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function qJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function YJ(){var e=Ie(Sb),t=Ie(kb),n=Ct(),r=Ie(oM),i=Ie(Aa),a=ho(),s=em(),l=Ie(c=>c.rootProps.className);f.useEffect(()=>{if(e==null)return po;var c=(u,p,d)=>{if(t!==d&&e===u){if(p.payload.active===!1){n(Ic({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var h;if(s&&p!==null&&p!==void 0&&(h=p.payload)!==null&&h!==void 0&&h.coordinate&&p.payload.sourceViewBox){var m=p.payload.coordinate,g=m.x,v=m.y,x=VJ(m,UJ),y=p.payload.sourceViewBox,b=y.x,w=y.y,j=y.width,k=y.height,S=Rs(Rs({},x),{},{x:s.x+(j?(g-b)/j:0)*s.width,y:s.y+(k?(v-w)/k:0)*s.height});n(Rs(Rs({},p),{},{payload:Rs(Rs({},p.payload),{},{coordinate:S})}))}else n(p);return}if(i!=null){var A;if(typeof r=="function"){var T={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},L=r(i,T);A=i[L]}else r==="value"&&(A=i.find(H=>String(H.value)===p.payload.label));var O=p.payload.coordinate;if(O==null||s==null){n(Ic({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(A==null){n(Ic({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var R=O.x,_=O.y,X=Math.min(R,s.x+s.width),q=Math.min(_,s.y+s.height),I={x:a==="horizontal"?A.coordinate:X,y:a==="horizontal"?q:A.coordinate},$=Ic({active:p.payload.active,coordinate:I,dataKey:p.payload.dataKey,index:String(A.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n($)}}};return Eu.on(px,c),()=>{Eu.off(px,c)}},[l,n,t,e,r,i,a,s])}function GJ(){var e=Ie(Sb),t=Ie(kb),n=Ct();f.useEffect(()=>{if(e==null)return po;var r=(i,a,s)=>{t!==s&&e===i&&n(BJ(a))};return Eu.on(MP,r),()=>{Eu.off(MP,r)}},[n,t,e])}function XJ(){var e=Ct();f.useEffect(()=>{e(DJ())},[e]),YJ(),GJ()}function QJ(e,t,n,r,i,a){var s=Ie(g=>oJ(g,e,t)),l=Ie(VR),c=Ie(kb),u=Ie(Sb),p=Ie(oM),d=Ie(zJ),h=(d==null?void 0:d.sourceViewBox)!=null,m=em();f.useEffect(()=>{if(!h&&u!=null&&c!=null){var g=Ic({active:a,coordinate:n,dataKey:s,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:m,graphicalItemId:l});Eu.emit(px,u,g,c)}},[h,n,s,l,i,r,c,u,p,a,m])}function LP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LP(Object(n),!0).forEach(function(r){ZJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZJ(e,t,n){return(t=JJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JJ(e){var t=eee(e,"string");return typeof t=="symbol"?t:t+""}function eee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tee(e,t){return aee(e)||iee(e,t)||ree(e,t)||nee()}function nee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
467
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ree(e,t){if(e){if(typeof e=="string")return zP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zP(e,t):void 0}}function zP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function aee(e){if(Array.isArray(e))return e}function oee(e){return e.dataKey}function see(e,t){return f.isValidElement(e)?f.cloneElement(e,t):typeof e=="function"?f.createElement(e,t):f.createElement(iV,t)}var $P=[],lee={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function No(e){var t,n,r=pn(e,lee),i=r.active,a=r.allowEscapeViewBox,s=r.animationDuration,l=r.animationEasing,c=r.content,u=r.filterNull,p=r.isAnimationActive,d=r.offset,h=r.payloadUniqBy,m=r.position,g=r.reverseDirection,v=r.useTranslate3d,x=r.wrapperStyle,y=r.cursor,b=r.shared,w=r.trigger,j=r.defaultIndex,k=r.portal,S=r.axisId,A=Ct(),T=typeof j=="number"?String(j):j;f.useEffect(()=>{A(QQ({shared:b,trigger:w,axisId:S,active:i,defaultIndex:T}))},[A,b,w,S,i,T]);var L=em(),O=MN(),R=HQ(b),_=(t=Ie(pe=>cJ(pe,R,w,T)))!==null&&t!==void 0?t:{},X=_.activeIndex,q=_.isActive,I=Ie(pe=>lJ(pe,R,w,T)),$=Ie(pe=>ZR(pe,R,w,T)),H=Ie(pe=>sJ(pe,R,w,T)),N=I,W=NJ(),P=(n=i??q)!==null&&n!==void 0?n:!1,U=FO([N,P]),le=tee(U,2),E=le[0],me=le[1],ye=R==="axis"?$:void 0;QJ(R,w,H,ye,X,P);var Q=k??W;if(Q==null||L==null||R==null)return null;var ie=N??$P;P||(ie=$P),u&&ie.length&&(ie=NO(ie.filter(pe=>pe.value!=null&&(pe.hide!==!0||r.includeHidden)),h,oee));var je=ie.length>0,Z=DP(DP({},r),{},{payload:ie,label:ye,active:P,activeIndex:X,coordinate:H,accessibilityLayer:O}),re=f.createElement(CV,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:p,active:P,coordinate:H,hasPayload:je,offset:d,position:m,reverseDirection:g,useTranslate3d:v,viewBox:L,wrapperStyle:x,lastBoundingBox:E,innerRef:me,hasPortalFromProps:!!k},see(c,Z));return f.createElement(f.Fragment,null,Lu.createPortal(re,Q),P&&f.createElement(OJ,{cursor:y,tooltipEventType:R,coordinate:H,payload:ie,index:X}))}var pd=e=>null;pd.displayName="Cell";function cee(e,t,n){return(t=uee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uee(e){var t=dee(e,"string");return typeof t=="symbol"?t:t+""}function dee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class pee{constructor(t){cee(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function BP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BP(Object(n),!0).forEach(function(r){hee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hee(e,t,n){return(t=mee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mee(e){var t=gee(e,"string");return typeof t=="symbol"?t:t+""}function gee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yee={cacheSize:2e3,enableCache:!0},i_=fee({},yee),FP=new pee(i_.cacheSize),vee={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},UP="recharts_measurement_span";function xee(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",s=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(s,"|").concat(l)}var WP=(e,t)=>{try{var n=document.getElementById(UP);n||(n=document.createElement("span"),n.setAttribute("id",UP),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,vee,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Vc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Xu.isSsr)return{width:0,height:0};if(!i_.enableCache)return WP(t,n);var r=xee(t,n),i=FP.get(r);if(i)return i;var a=WP(t,n);return FP.set(r,a),a},a_;function Qf(e,t){return See(e)||jee(e,t)||wee(e,t)||bee()}function bee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
468
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wee(e,t){if(e){if(typeof e=="string")return KP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?KP(e,t):void 0}}function KP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function See(e){if(Array.isArray(e))return e}function kee(e,t,n){return(t=Cee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cee(e){var t=Pee(e,"string");return typeof t=="symbol"?t:t+""}function Pee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var HP=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,VP=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Aee=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Eee=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Tee={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Iee=["cm","mm","pt","pc","in","Q","px"];function Oee(e){return Iee.includes(e)}var nl="NaN";function Nee(e,t){return e*Tee[t]}class zn{static parse(t){var n,r=(n=Eee.exec(t))!==null&&n!==void 0?n:[],i=Qf(r,3),a=i[1],s=i[2];return a==null?zn.NaN:new zn(parseFloat(a),s??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ui(t)&&(this.unit=""),n!==""&&!Aee.test(n)&&(this.num=NaN,this.unit=""),Oee(n)&&(this.num=Nee(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new zn(NaN,""):new zn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new zn(NaN,""):new zn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new zn(NaN,""):new zn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new zn(NaN,""):new zn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ui(this.num)}}a_=zn;kee(zn,"NaN",new a_(NaN,""));function o_(e){if(e==null||e.includes(nl))return nl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=HP.exec(t))!==null&&n!==void 0?n:[],i=Qf(r,4),a=i[1],s=i[2],l=i[3],c=zn.parse(a??""),u=zn.parse(l??""),p=s==="*"?c.multiply(u):c.divide(u);if(p.isNaN())return nl;t=t.replace(HP,p.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,h=(d=VP.exec(t))!==null&&d!==void 0?d:[],m=Qf(h,4),g=m[1],v=m[2],x=m[3],y=zn.parse(g??""),b=zn.parse(x??""),w=v==="+"?y.add(b):y.subtract(b);if(w.isNaN())return nl;t=t.replace(VP,w.toString())}return t}var qP=/\(([^()]*)\)/;function Mee(e){for(var t=e,n;(n=qP.exec(t))!=null;){var r=n,i=Qf(r,2),a=i[1];t=t.replace(qP,o_(a))}return t}function Ree(e){var t=e.replace(/\s+/g,"");return t=Mee(t),t=o_(t),t}function _ee(e){try{return Ree(e)}catch{return nl}}function ny(e){var t=_ee(e.slice(5,-1));return t===nl?"":t}var Lee=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Dee=["dx","dy","angle","className","breakAll"];function fx(){return fx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fx.apply(null,arguments)}function YP(e,t){if(e==null)return{};var n,r,i=zee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function GP(e,t){return Uee(e)||Fee(e,t)||Bee(e,t)||$ee()}function $ee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
469
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bee(e,t){if(e){if(typeof e=="string")return XP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XP(e,t):void 0}}function XP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Fee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Uee(e){if(Array.isArray(e))return e}var s_=/[ \f\n\r\t\v\u2028\u2029]+/,l_=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];Bt(t)||(n?i=t.toString().split(""):i=t.toString().split(s_));var a=i.map(l=>({word:l,width:Vc(l,r).width})),s=n?0:Vc(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}};function c_(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Wee(e){return Bt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var u_=(e,t,n,r)=>e.reduce((i,a)=>{var s=a.word,l=a.width,c=i[i.length-1];if(c&&l!=null&&(t==null||r||c.width+l+n<Number(t)))c.words.push(s),c.width+=l+n;else{var u={words:[s],width:l};i.push(u)}return i},[]),d_=e=>e.reduce((t,n)=>t.width>n.width?t:n),Kee="…",QP=(e,t,n,r,i,a,s,l)=>{var c=e.slice(0,t),u=l_({breakAll:n,style:r,children:c+Kee});if(!u)return[!1,[]];var p=u_(u.wordsWithComputedWidth,a,s,l),d=p.length>i||d_(p).width>Number(a);return[d,p]},Hee=(e,t,n,r,i)=>{var a=e.maxLines,s=e.children,l=e.style,c=e.breakAll,u=Ce(a),p=String(s),d=u_(t,r,n,i);if(!u||i)return d;var h=d.length>a||d_(d).width>Number(r);if(!h)return d;for(var m=0,g=p.length-1,v=0,x;m<=g&&v<=p.length-1;){var y=Math.floor((m+g)/2),b=y-1,w=QP(p,b,c,l,a,r,n,i),j=GP(w,2),k=j[0],S=j[1],A=QP(p,y,c,l,a,r,n,i),T=GP(A,1),L=T[0];if(!k&&!L&&(m=y+1),k&&L&&(g=y-1),!k&&L){x=S;break}v++}return x||d},ZP=e=>{var t=Bt(e)?[]:e.toString().split(s_);return[{words:t,width:void 0}]},Vee=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,s=e.maxLines;if((t||n)&&!Xu.isSsr){var l,c,u=l_({breakAll:a,children:r,style:i});if(u){var p=u.wordsWithComputedWidth,d=u.spaceWidth;l=p,c=d}else return ZP(r);return Hee({breakAll:a,children:r,maxLines:s,style:i},l,c,t,!!n)}return ZP(r)},p_="#808080",qee={angle:0,breakAll:!1,capHeight:"0.71em",fill:p_,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},vm=f.forwardRef((e,t)=>{var n=pn(e,qee),r=n.x,i=n.y,a=n.lineHeight,s=n.capHeight,l=n.fill,c=n.scaleToFit,u=n.textAnchor,p=n.verticalAnchor,d=YP(n,Lee),h=f.useMemo(()=>Vee({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),m=d.dx,g=d.dy,v=d.angle,x=d.className,y=d.breakAll,b=YP(d,Dee);if(!Ui(r)||!Ui(i)||h.length===0)return null;var w=Number(r)+(Ce(m)?m:0),j=Number(i)+(Ce(g)?g:0);if(!et(w)||!et(j))return null;var k;switch(p){case"start":k=ny("calc(".concat(s,")"));break;case"middle":k=ny("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(s," / 2))"));break;default:k=ny("calc(".concat(h.length-1," * -").concat(a,")"));break}var S=[],A=h[0];if(c&&A!=null){var T=A.width,L=d.width;S.push("scale(".concat(Ce(L)&&Ce(T)?L/T:1,")"))}return v&&S.push("rotate(".concat(v,", ").concat(w,", ").concat(j,")")),S.length&&(b.transform=S.join(" ")),f.createElement("text",fx({},xr(b),{ref:t,x:w,y:j,className:yt("recharts-text",x),textAnchor:u,fill:l.includes("url")?p_:l}),h.map((O,R)=>{var _=O.words.join(y?"":" ");return f.createElement("tspan",{x:w,dy:R===0?k:a,key:"".concat(_,"-").concat(R)},_)}))});vm.displayName="Text";function JP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JP(Object(n),!0).forEach(function(r){Yee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yee(e,t,n){return(t=Gee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gee(e){var t=Xee(e,"string");return typeof t=="symbol"?t:t+""}function Xee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qee=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,s=fb(t),l=s.x,c=s.y,u=s.height,p=s.upperWidth,d=s.lowerWidth,h=l,m=l+(p-d)/2,g=(h+m)/2,v=(p+d)/2,x=h+p/2,y=u>=0?1:-1,b=y*i,w=y>0?"end":"start",j=y>0?"start":"end",k=p>=0?1:-1,S=k*i,A=k>0?"end":"start",T=k>0?"start":"end",L=a;if(n==="top"){var O={x:h+p/2,y:c-b,horizontalAnchor:"middle",verticalAnchor:w};return L&&(O.height=Math.max(c-L.y,0),O.width=p),O}if(n==="bottom"){var R={x:m+d/2,y:c+u+b,horizontalAnchor:"middle",verticalAnchor:j};return L&&(R.height=Math.max(L.y+L.height-(c+u),0),R.width=d),R}if(n==="left"){var _={x:g-S,y:c+u/2,horizontalAnchor:A,verticalAnchor:"middle"};return L&&(_.width=Math.max(_.x-L.x,0),_.height=u),_}if(n==="right"){var X={x:g+v+S,y:c+u/2,horizontalAnchor:T,verticalAnchor:"middle"};return L&&(X.width=Math.max(L.x+L.width-X.x,0),X.height=u),X}var q=L?{width:v,height:u}:{};return n==="insideLeft"?ji({x:g+S,y:c+u/2,horizontalAnchor:T,verticalAnchor:"middle"},q):n==="insideRight"?ji({x:g+v-S,y:c+u/2,horizontalAnchor:A,verticalAnchor:"middle"},q):n==="insideTop"?ji({x:h+p/2,y:c+b,horizontalAnchor:"middle",verticalAnchor:j},q):n==="insideBottom"?ji({x:m+d/2,y:c+u-b,horizontalAnchor:"middle",verticalAnchor:w},q):n==="insideTopLeft"?ji({x:h+S,y:c+b,horizontalAnchor:T,verticalAnchor:j},q):n==="insideTopRight"?ji({x:h+p-S,y:c+b,horizontalAnchor:A,verticalAnchor:j},q):n==="insideBottomLeft"?ji({x:m+S,y:c+u-b,horizontalAnchor:T,verticalAnchor:w},q):n==="insideBottomRight"?ji({x:m+d-S,y:c+u-b,horizontalAnchor:A,verticalAnchor:w},q):n&&typeof n=="object"&&(Ce(n.x)||ss(n.x))&&(Ce(n.y)||ss(n.y))?ji({x:l+qn(n.x,v),y:c+qn(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},q):ji({x,y:c+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},q)},Zee=["labelRef"],Jee=["content"];function eA(e,t){if(e==null)return{};var n,r,i=ete(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ete(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function tA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Oc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tA(Object(n),!0).forEach(function(r){tte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tte(e,t,n){return(t=nte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nte(e){var t=rte(e,"string");return typeof t=="symbol"?t:t+""}function rte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function na(){return na=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},na.apply(null,arguments)}var f_=f.createContext(null),ite=e=>{var t=e.x,n=e.y,r=e.upperWidth,i=e.lowerWidth,a=e.width,s=e.height,l=e.children,c=f.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:s}),[t,n,r,i,a,s]);return f.createElement(f_.Provider,{value:c},l)},h_=()=>{var e=f.useContext(f_),t=em();return e||(t?fb(t):void 0)},ate=f.createContext(null),ote=()=>{var e=f.useContext(ate),t=Ie(dM);return e||t},ste=e=>{var t=e.value,n=e.formatter,r=Bt(e.children)?t:e.children;return typeof n=="function"?n(r):r},E1=e=>e!=null&&typeof e=="function",lte=(e,t)=>{var n=kn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},cte=(e,t,n,r,i)=>{var a=e.offset,s=e.className,l=i.cx,c=i.cy,u=i.innerRadius,p=i.outerRadius,d=i.startAngle,h=i.endAngle,m=i.clockWise,g=(u+p)/2,v=lte(d,h),x=v>=0?1:-1,y,b;switch(t){case"insideStart":y=d+x*a,b=m;break;case"insideEnd":y=h-x*a,b=!m;break;case"end":y=h+x*a,b=m;break;default:throw new Error("Unsupported position ".concat(t))}b=v<=0?b:!b;var w=un(l,c,g,y),j=un(l,c,g,y+(b?1:-1)*359),k="M".concat(w.x,",").concat(w.y,`
470
+ A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
471
+ `).concat(j.x,",").concat(j.y),S=Bt(e.id)?vu("recharts-radial-line-"):e.id;return f.createElement("text",na({},r,{dominantBaseline:"central",className:yt("recharts-radial-bar-label",s)}),f.createElement("defs",null,f.createElement("path",{id:S,d:k})),f.createElement("textPath",{xlinkHref:"#".concat(S)},n))},ute=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,s=e.outerRadius,l=e.startAngle,c=e.endAngle,u=(l+c)/2;if(n==="outside"){var p=un(r,i,s+t,u),d=p.x,h=p.y;return{x:d,y:h,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var m=(a+s)/2,g=un(r,i,m,u),v=g.x,x=g.y;return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},Np=e=>e!=null&&"cx"in e&&Ce(e.cx),dte={angle:0,offset:5,zIndex:on.label,position:"middle",textBreakAll:!1};function pte(e){if(!Np(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function za(e){var t=pn(e,dte),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,s=t.children,l=t.content,c=t.className,u=c===void 0?"":c,p=t.textBreakAll,d=t.labelRef,h=ote(),m=h_(),g=i==="center"?m:h??m,v,x,y;n==null?v=g:Np(n)?v=n:v=fb(n);var b=pte(v);if(!v||Bt(a)&&Bt(s)&&!f.isValidElement(l)&&typeof l!="function")return null;var w=Oc(Oc({},t),{},{viewBox:v});if(f.isValidElement(l)){w.labelRef;var j=eA(w,Zee);return f.cloneElement(l,j)}if(typeof l=="function"){w.content;var k=eA(w,Jee);if(x=f.createElement(l,k),f.isValidElement(x))return x}else x=ste(t);var S=xr(t);if(Np(v)){if(i==="insideStart"||i==="insideEnd"||i==="end")return cte(t,i,x,S,v);y=ute(v,t.offset,t.position)}else{if(!b)return null;var A=Qee({viewBox:b,position:i,offset:t.offset,parentViewBox:Np(r)?void 0:r});y=Oc(Oc({x:A.x,y:A.y,textAnchor:A.horizontalAnchor,verticalAnchor:A.verticalAnchor},A.width!==void 0?{width:A.width}:{}),A.height!==void 0?{height:A.height}:{})}return f.createElement(lr,{zIndex:t.zIndex},f.createElement(vm,na({ref:d,className:yt("recharts-label",u)},S,y,{textAnchor:c_(S.textAnchor)?S.textAnchor:y.textAnchor,breakAll:p}),x))}za.displayName="Label";var fte=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?f.createElement(za,na({key:"label-implicit"},r)):Ui(e)?f.createElement(za,na({key:"label-implicit",value:e},r)):f.isValidElement(e)?e.type===za?f.cloneElement(e,Oc({key:"label-implicit"},r)):f.createElement(za,na({key:"label-implicit",content:e},r)):E1(e)?f.createElement(za,na({key:"label-implicit",content:e},r)):e&&typeof e=="object"?f.createElement(za,na({},e,{key:"label-implicit"},r)):null};function hte(e){var t=e.label,n=e.labelRef,r=h_();return fte(t,r,n)||null}var mte=["valueAccessor"],gte=["dataKey","clockWise","id","textBreakAll","zIndex"];function Zf(){return Zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zf.apply(null,arguments)}function nA(e,t){if(e==null)return{};var n,r,i=yte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vte=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Wee(t))return t},m_=f.createContext(void 0),T1=m_.Provider,g_=f.createContext(void 0),xte=g_.Provider;function bte(){return f.useContext(m_)}function wte(){return f.useContext(g_)}function Mp(e){var t=e.valueAccessor,n=t===void 0?vte:t,r=nA(e,mte),i=r.dataKey;r.clockWise;var a=r.id,s=r.textBreakAll,l=r.zIndex,c=nA(r,gte),u=bte(),p=wte(),d=u||p;return!d||!d.length?null:f.createElement(lr,{zIndex:l??on.label},f.createElement(Xt,{className:"recharts-label-list"},d.map((h,m)=>{var g,v=Bt(i)?n(h,m):gt(h.payload,i),x=Bt(a)?{}:{id:"".concat(a,"-").concat(m)};return f.createElement(za,Zf({key:"label-".concat(m)},xr(h),c,x,{fill:(g=r.fill)!==null&&g!==void 0?g:h.fill,parentViewBox:h.parentViewBox,value:v,textBreakAll:s,viewBox:h.viewBox,index:m,zIndex:0}))})))}Mp.displayName="LabelList";function xm(e){var t=e.label;return t?t===!0?f.createElement(Mp,{key:"labelList-implicit"}):f.isValidElement(t)||E1(t)?f.createElement(Mp,{key:"labelList-implicit",content:t}):typeof t=="object"?f.createElement(Mp,Zf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function hx(){return hx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hx.apply(null,arguments)}var y_=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=yt("recharts-dot",i);return Ce(t)&&Ce(n)&&Ce(r)?f.createElement("circle",hx({},ir(e),nb(e),{className:a,cx:t,cy:n,r})):null},v_=e=>e.graphicalItems.polarItems,jte=G([Qt,ed],e1),bm=G([v_,Zt,jte],t1),Ste=G([bm],n1),wm=G([Ste,Qu],r1),kte=G([wm,Zt,bm],rR);G([wm,Zt,bm],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,s=gt(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:s,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:gt(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var rA=()=>{},Cte=G([wm,Zt,bm,fm,Qt,Lq],l1),Pte=G([Zt,o1,s1,rA,Cte,rA,ct,Qt],c1),x_=G([Zt,ct,wm,kte,Ju,Qt,Pte],u1),Ate=G([x_,Vl,yo],p1),Ete=G([Zt,x_,Ate,Qt],h1);G([yo,Ete],fM);var Tte={radiusAxis:{},angleAxis:{}},b_=Xn({name:"polarAxis",initialState:Tte,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=mt(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=mt(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),jm=b_.actions;jm.addRadiusAxis;jm.removeRadiusAxis;jm.addAngleAxis;jm.removeAngleAxis;var Ite=b_.reducer;function w_(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function iA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iA(Object(n),!0).forEach(function(r){Ote(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ote(e,t,n){return(t=Nte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nte(e){var t=Mte(e,"string");return typeof t=="symbol"?t:t+""}function Mte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rte=(e,t)=>t,I1=G([v_,Rte],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),_te=[],O1=(e,t,n)=>(n==null?void 0:n.length)===0?_te:n,j_=G([Qu,I1,O1],(e,t,n)=>{var r=e.chartData;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(a=>aA(aA({},t.presentationProps),a.props))),i!=null)return i}}),Lte=G([j_,I1,O1],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,s=gt(r,t.nameKey,t.name),l;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:fo(s,t.dataKey),dataKey:t.dataKey,color:l,payload:r,type:t.legendType}})}),Dte=G([j_,I1,O1,xn],(e,t,n,r)=>{if(!(t==null||e==null))return Yne({offset:r,pieSettings:t,displayedData:e,cells:n})}),S_={exports:{}},Tt={};/**
472
+ * @license React
473
+ * react-is.production.js
474
+ *
475
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
476
+ *
477
+ * This source code is licensed under the MIT license found in the
478
+ * LICENSE file in the root directory of this source tree.
479
+ */var N1=Symbol.for("react.transitional.element"),M1=Symbol.for("react.portal"),Sm=Symbol.for("react.fragment"),km=Symbol.for("react.strict_mode"),Cm=Symbol.for("react.profiler"),Pm=Symbol.for("react.consumer"),Am=Symbol.for("react.context"),Em=Symbol.for("react.forward_ref"),Tm=Symbol.for("react.suspense"),Im=Symbol.for("react.suspense_list"),Om=Symbol.for("react.memo"),Nm=Symbol.for("react.lazy"),zte=Symbol.for("react.view_transition"),$te=Symbol.for("react.client.reference");function Qr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case N1:switch(e=e.type,e){case Sm:case Cm:case km:case Tm:case Im:case zte:return e;default:switch(e=e&&e.$$typeof,e){case Am:case Em:case Nm:case Om:return e;case Pm:return e;default:return t}}case M1:return t}}}Tt.ContextConsumer=Pm;Tt.ContextProvider=Am;Tt.Element=N1;Tt.ForwardRef=Em;Tt.Fragment=Sm;Tt.Lazy=Nm;Tt.Memo=Om;Tt.Portal=M1;Tt.Profiler=Cm;Tt.StrictMode=km;Tt.Suspense=Tm;Tt.SuspenseList=Im;Tt.isContextConsumer=function(e){return Qr(e)===Pm};Tt.isContextProvider=function(e){return Qr(e)===Am};Tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===N1};Tt.isForwardRef=function(e){return Qr(e)===Em};Tt.isFragment=function(e){return Qr(e)===Sm};Tt.isLazy=function(e){return Qr(e)===Nm};Tt.isMemo=function(e){return Qr(e)===Om};Tt.isPortal=function(e){return Qr(e)===M1};Tt.isProfiler=function(e){return Qr(e)===Cm};Tt.isStrictMode=function(e){return Qr(e)===km};Tt.isSuspense=function(e){return Qr(e)===Tm};Tt.isSuspenseList=function(e){return Qr(e)===Im};Tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Sm||e===Cm||e===km||e===Tm||e===Im||typeof e=="object"&&e!==null&&(e.$$typeof===Nm||e.$$typeof===Om||e.$$typeof===Am||e.$$typeof===Pm||e.$$typeof===Em||e.$$typeof===$te||e.getModuleId!==void 0)};Tt.typeOf=Qr;S_.exports=Tt;var Bte=S_.exports,oA=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",sA=null,ry=null,k_=e=>{if(e===sA&&Array.isArray(ry))return ry;var t=[];return f.Children.forEach(e,n=>{Bt(n)||(Bte.isFragment(n)?t=t.concat(k_(n.props.children)):t.push(n))}),ry=t,sA=e,t};function R1(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>oA(i)):r=[oA(t)],k_(e).forEach(i=>{var a=Fi(i,"type.displayName")||Fi(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var _1=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function lA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lA(Object(n),!0).forEach(function(r){Fte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fte(e,t,n){return(t=Ute(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ute(e){var t=Wte(e,"string");return typeof t=="symbol"?t:t+""}function Wte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C_(e,t){return cA(cA({},t),e)}function Kte(e){return f.isValidElement(e)?e.props:e}function Hte(e,t){return f.cloneElement(e,C_(Kte(e),t))}function Vte(e){if("index"in e){var t=e.index;return typeof t=="number"||typeof t=="string"?t:void 0}}function qte(e){return"isActive"in e&&e.isActive===!0}function Mm(e){var t=e.option,n=e.DefaultShape,r=e.shapeProps,i=e.activeClassName,a=i===void 0?"recharts-active-shape":i,s=e.inActiveClassName,l=s===void 0?"recharts-shape":s,c=Vte(r),u;return f.isValidElement(t)?u=Hte(t,r):t===n?u=f.createElement(n,r):typeof t=="function"?u=t(r,c):typeof t=="object"?u=f.createElement(n,C_(t,r)):u=f.createElement(n,r),qte(r)?f.createElement(Xt,{className:a},u):f.createElement(Xt,{className:l},u)}var L1=(e,t,n)=>{var r=Ct();return(i,a)=>s=>{e==null||e(i,a,s),r(IR({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},D1=e=>{var t=Ct();return(n,r)=>i=>{e==null||e(n,r,i),t(ZQ())}},z1=(e,t,n)=>{var r=Ct();return(i,a)=>s=>{e==null||e(i,a,s),r(JQ({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function Rm(e){var t=e.tooltipEntrySettings,n=Ct(),r=Pn(),i=f.useRef(null);return f.useLayoutEffect(()=>{r||(i.current===null?n(YQ(t)):i.current!==t&&n(GQ({prev:i.current,next:t})),i.current=t)},[t,n,r]),f.useLayoutEffect(()=>()=>{i.current&&(n(XQ(i.current)),i.current=null)},[n]),null}function $1(e){var t=e.legendPayload,n=Ct(),r=Pn(),i=f.useRef(null);return f.useLayoutEffect(()=>{r||(i.current===null?n(TN(t)):i.current!==t&&n(IN({prev:i.current,next:t})),i.current=t)},[n,r,t]),f.useLayoutEffect(()=>()=>{i.current&&(n(ON(i.current)),i.current=null)},[n]),null}function Yte(e){var t=e.legendPayload,n=Ct(),r=Ie(ct),i=f.useRef(null);return f.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(TN(t)):i.current!==t&&n(IN({prev:i.current,next:t})),i.current=t)},[n,r,t]),f.useLayoutEffect(()=>()=>{i.current&&(n(ON(i.current)),i.current=null)},[n]),null}function Gte(e,t){return Jte(e)||Zte(e,t)||Qte(e,t)||Xte()}function Xte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
480
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qte(e,t){if(e){if(typeof e=="string")return uA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uA(e,t):void 0}}function uA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zte(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Jte(e){if(Array.isArray(e))return e}var _m="index",B1="append";function F1(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var i of n)r.push({status:"removed",prev:i});for(var a=0;a<t.length;a++){var s=e[a],l=t[a];s!=null?r.push({status:"matched",prev:s,next:l}):r.push({status:"added",next:l})}return r}function ene(e,t){var n=e.length/t.length,r=t.map((i,a)=>e[Math.floor(a*n)]);return F1(r,t)}function tne(e,t){var n=t.map((r,i)=>e[i]);return F1(n,t)}function nne(e,t){for(var n=new Map,r=0;r<e.length;r++){var i=e[r];if(i!=null){var a=t(i,r);a!=null&&!n.has(a)&&n.set(a,i)}}return n}function rne(e,t,n){var r=nne(e,n),i=new Set,a=t.map((d,h)=>{var m=n(d,h);if(m!=null){var g=r.get(m);if(g!==void 0)return i.add(m),g}}),s=[];for(var l of r){var c=Gte(l,2),u=c[0],p=c[1];i.has(u)||s.push(p)}return F1(a,t,s)}function mx(e,t,n){return t==null?null:e==null?t.map(r=>({status:"added",next:r})):n===_m?ene(e,t):n===B1?tne(e,t):rne(e,t,n)}function P_(e,t){var n=f.useRef(e),r=f.useRef(t.current),i=f.useRef(!0);n.current!==e&&(n.current=e,r.current=t.current,i.current=!1);var a=f.useCallback(function(s,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(l===0){i.current=!0;return}l===1&&(r.current=s),l>0&&i.current&&c&&(t.current=s)},[t]);return{startValue:r.current,syncStepValue:a}}function ine(e,t){return lne(e)||sne(e,t)||one(e,t)||ane()}function ane(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
481
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function one(e,t){if(e){if(typeof e=="string")return dA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dA(e,t):void 0}}function dA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function lne(e){if(Array.isArray(e))return e}function Lm(e,t){var n=f.useState(!1),r=ine(n,2),i=r[0],a=r[1],s=f.useCallback(()=>{typeof e=="function"&&e(),a(!0)},[e]),l=f.useCallback(()=>{typeof t=="function"&&t(),a(!1)},[t]);return{isAnimating:i,handleAnimationStart:s,handleAnimationEnd:l}}function Dm(e){var t,n=e.animationInput,r=e.animationIdPrefix,i=e.items,a=e.previousItemsRef,s=e.isAnimationActive,l=e.animationBegin,c=e.animationDuration,u=e.animationEasing,p=e.onAnimationStart,d=e.onAnimationEnd,h=e.animationInterpolateFn,m=e.animationMatchBy,g=e.shouldUpdatePreviousRef,v=e.children,x=e.layout,y=zN(n,r),b=P_(y,a),w=(t=b.startValue)!==null&&t!==void 0?t:null,j=mx(w,i,m??_m);return f.createElement(DN,{animationId:y,begin:l,duration:c,isActive:s,easing:u,onAnimationEnd:d,onAnimationStart:p,key:y},k=>{var S=w==null,A=i==null?i:h(j,k,x),T=g?g(k):k>0;return b.syncStepValue(A,k,T),A==null?null:v(A,k,S)})}var iy;function cne(e,t){return fne(e)||pne(e,t)||dne(e,t)||une()}function une(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
482
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dne(e,t){if(e){if(typeof e=="string")return pA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pA(e,t):void 0}}function pA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function fne(e){if(Array.isArray(e))return e}var hne=()=>{var e=f.useState(()=>vu("uid-")),t=cne(e,1),n=t[0];return n},A_=(iy=z2.useId)!==null&&iy!==void 0?iy:hne;function mne(e,t){var n=A_();return t||(e?"".concat(e,"-").concat(n):n)}var gne=f.createContext(void 0),zm=e=>{var t=e.id,n=e.type,r=e.children,i=mne("recharts-".concat(n),t);return f.createElement(gne.Provider,{value:i},r(i))},yne={cartesianItems:[],polarItems:[]},E_=Xn({name:"graphicalItems",initialState:yne,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(mt(t.payload))},prepare:Dt()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Wr(e).cartesianItems.indexOf(mt(r));a>-1&&(e.cartesianItems[a]=mt(i))},prepare:Dt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Wr(e).cartesianItems.indexOf(mt(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:Dt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(mt(t.payload))},prepare:Dt()},removePolarGraphicalItem:{reducer(e,t){var n=Wr(e).polarItems.indexOf(mt(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:Dt()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Wr(e).polarItems.indexOf(mt(r));a>-1&&(e.polarItems[a]=mt(i))},prepare:Dt()}}}),Xl=E_.actions,vne=Xl.addCartesianGraphicalItem,xne=Xl.replaceCartesianGraphicalItem,bne=Xl.removeCartesianGraphicalItem,wne=Xl.addPolarGraphicalItem,jne=Xl.removePolarGraphicalItem,Sne=Xl.replacePolarGraphicalItem,kne=E_.reducer,Cne=e=>{var t=Ct(),n=f.useRef(null);return f.useLayoutEffect(()=>{n.current===null?t(vne(e)):n.current!==e&&t(xne({prev:n.current,next:e})),n.current=e},[t,e]),f.useLayoutEffect(()=>()=>{n.current&&(t(bne(n.current)),n.current=null)},[t]),null},U1=f.memo(Cne),Pne=e=>{var t=Ct(),n=f.useRef(null);return f.useLayoutEffect(()=>{n.current===null?t(wne(e)):n.current!==e&&t(Sne({prev:n.current,next:e})),n.current=e},[t,e]),f.useLayoutEffect(()=>()=>{n.current&&(t(jne(n.current)),n.current=null)},[t]),null},Ane=f.memo(Pne),Ene=["key"],Tne=["onMouseEnter","onClick","onMouseLeave"],Ine=["id"],One=["id"];function ds(){return ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ds.apply(null,arguments)}function $m(e,t){if(e==null)return{};var n,r,i=Nne(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Nne(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function fA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fA(Object(n),!0).forEach(function(r){Mne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mne(e,t,n){return(t=Rne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rne(e){var t=_ne(e,"string");return typeof t=="symbol"?t:t+""}function _ne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T_=WN;function Lne(e){var t=f.useMemo(()=>R1(e.children,pd),[e.children]),n=Ie(r=>Lte(r,e.id,t));return n==null?null:f.createElement(Yte,{legendPayload:n})}function Dne(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(f.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var r=e.fill;return typeof r=="string"?r:void 0}}var zne=f.memo(e=>{var t=e.dataKey,n=e.nameKey,r=e.sectors,i=e.stroke,a=e.strokeWidth,s=e.fill,l=e.name,c=e.hide,u=e.tooltipType,p=e.formatter,d=e.id,h=e.activeShape,m=Dne(h),g=r.map(x=>{var y=x.tooltipPayload;return m==null||y==null?y:y.map(b=>Ft(Ft({},b),{},{color:m,fill:m}))}),v={dataDefinedOnItem:g,getPosition:x=>{var y;return(y=r[Number(x)])===null||y===void 0?void 0:y.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:s,dataKey:t,nameKey:n,name:fo(l,t),hide:c,type:u,color:s,unit:"",formatter:p,graphicalItemId:d}};return f.createElement(Rm,{tooltipEntrySettings:v})}),$ne=(e,t)=>e>t?"start":e<t?"end":"middle",Bne=(e,t,n)=>qn(typeof t=="function"?t(e):t,n,n*.8),Fne=(e,t,n)=>{var r=t.top,i=t.left,a=t.width,s=t.height,l=BN(a,s),c=i+qn(e.cx,a,a/2),u=r+qn(e.cy,s,s/2),p=qn(e.innerRadius,l,0),d=Bne(n,e.outerRadius,l),h=e.maxRadius||Math.sqrt(a*a+s*s)/2;return{cx:c,cy:u,innerRadius:p,outerRadius:d,maxRadius:h}},Une=(e,t)=>{var n=kn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Wne=(e,t)=>{if(f.isValidElement(e))return f.cloneElement(e,t);if(typeof e=="function")return e(t);var n=yt("recharts-pie-label-line",typeof e!="boolean"?e.className:"");t.key;var r=$m(t,Ene);return f.createElement(pl,ds({},r,{type:"linear",className:n}))},Kne=(e,t,n)=>{if(f.isValidElement(e))return f.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),f.isValidElement(r)))return r;var i=yt("recharts-pie-label-text",w_(e));return f.createElement(vm,ds({},t,{alignmentBaseline:"middle",className:i}),r)};function Hne(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label,a=n.labelLine,s=n.dataKey;if(!r||!i||!t)return null;var l=ir(n),c=as(i),u=as(a),p=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,d=t.map((h,m)=>{var g=(h.startAngle+h.endAngle)/2,v=un(h.cx,h.cy,h.outerRadius+p,g),x=Ft(Ft(Ft(Ft({},l),h),{},{stroke:"none"},c),{},{index:m,textAnchor:$ne(v.x,h.cx)},v),y=Ft(Ft(Ft(Ft({},l),h),{},{fill:"none",stroke:h.fill},u),{},{index:m,points:[un(h.cx,h.cy,h.outerRadius,g),v],key:"line"});return f.createElement(lr,{zIndex:on.label,key:"label-".concat(h.startAngle,"-").concat(h.endAngle,"-").concat(h.midAngle,"-").concat(m)},f.createElement(Xt,null,a&&Wne(a,y),Kne(i,x,gt(h,s))))});return f.createElement(Xt,{className:"recharts-pie-labels"},d)}function Vne(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label;return typeof i=="object"&&i!=null&&"position"in i?f.createElement(xm,{label:i}):f.createElement(Hne,{sectors:t,props:n,showLabels:r})}function qne(e){var t=e.sectors,n=e.activeShape,r=e.inactiveShape,i=e.allOtherPieProps,a=e.shape,s=e.id,l=e.animationElapsedTime,c=e.isAnimating,u=e.isEntrance,p=Ie(ao),d=Ie(j1),h=Ie(VR),m=i.onMouseEnter,g=i.onClick,v=i.onMouseLeave,x=$m(i,Tne),y=L1(m,i.dataKey,s),b=D1(v),w=z1(g,i.dataKey,s);return t==null||t.length===0?null:f.createElement(f.Fragment,null,t.map((j,k)=>{if((j==null?void 0:j.startAngle)===0&&(j==null?void 0:j.endAngle)===0&&t.length!==1)return null;var S=h==null||h===s,A=String(k)===p&&(d==null||i.dataKey===d)&&S,T=p?r:null,L=n&&A?n:T,O=Ft(Ft({},j),{},{stroke:j.stroke,tabIndex:-1,index:k,isActive:A,animationElapsedTime:l,isAnimating:c,isEntrance:u,[jN]:k,[SN]:s});return f.createElement(Xt,ds({key:"sector-".concat(j==null?void 0:j.startAngle,"-").concat(j==null?void 0:j.endAngle,"-").concat(j.midAngle,"-").concat(k),tabIndex:-1,className:"recharts-pie-sector"},Wu(x,j,k),{onMouseEnter:y(j,k),onMouseLeave:b(j,k),onClick:w(j,k)}),f.createElement(Mm,{option:L??a,DefaultShape:T_,shapeProps:O}))}))}function Yne(e){var t,n=e.pieSettings,r=e.displayedData,i=e.cells,a=e.offset,s=n.cornerRadius,l=n.startAngle,c=n.endAngle,u=n.dataKey,p=n.nameKey,d=n.tooltipType,h=Math.abs(n.minAngle),m=Une(l,c),g=Math.abs(m),v=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,x=r.filter(T=>gt(T,u,0)!==0).length,y=(g>=360?x:x-1)*v,b=r.reduce((T,L)=>{var O=gt(L,u,0);return T+(Ce(O)?O:0)},0),w=h>0&&b>0&&r.some(T=>{var L=gt(T,u,0),O=(Ce(L)?L:0)/b;return L!==0&&O*g<h}),j=w?h:0,k=g-x*j-y,S;if(b>0){var A;S=r.map((T,L)=>{var O=gt(T,u,0),R=gt(T,p,L),_=Fne(n,a,T),X=(Ce(O)?O:0)/b,q,I=Ft(Ft({},T),i&&i[L]&&i[L].props),$=I!=null&&"fill"in I&&typeof I.fill=="string"?I.fill:n.fill;L?q=A.endAngle+kn(m)*v*(O!==0?1:0):q=l;var H=q+kn(m)*((O!==0?j:0)+X*k),N=(q+H)/2,W=(_.innerRadius+_.outerRadius)/2,P=[{name:R,value:O,payload:I,dataKey:u,type:d,color:$,fill:$,graphicalItemId:n.id}],U=un(_.cx,_.cy,W,N);return A=Ft(Ft(Ft(Ft({},n.presentationProps),{},{percent:X,cornerRadius:typeof s=="string"?parseFloat(s):s,name:R,tooltipPayload:P,midAngle:N,middleRadius:W,tooltipPosition:U},I),_),{},{value:O,dataKey:u,startAngle:q,endAngle:H,payload:I,paddingAngle:O!==0?kn(m)*v:0}),A})}return S}function Gne(e){var t=e.showLabels,n=e.sectors,r=e.children,i=f.useMemo(()=>!t||!n?[]:n.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[n,t]);return f.createElement(xte,{value:t?i:void 0},r)}var Xne=(e,t)=>{if(e==null)return[];var n=[],r=e.find(a=>a.status!=="removed"),i=r?r.next.startAngle:0;return e.forEach((a,s)=>{if(a.status!=="removed"){var l=s>0?Fi(a.next,"paddingAngle",0):0;if(a.status==="matched"){var c=Nt(a.prev.endAngle-a.prev.startAngle,a.next.endAngle-a.next.startAngle,t),u=Ft(Ft({},a.next),{},{startAngle:i+l,endAngle:i+c+l});n.push(u),i=u.endAngle}else{var p=Nt(0,a.next.endAngle-a.next.startAngle,t),d=Ft(Ft({},a.next),{},{startAngle:i+l,endAngle:i+p+l});n.push(d),i=d.endAngle}}}),n};function Qne(e){var t=e.props,n=e.previousSectorsRef,r=e.id,i=t.sectors,a=t.activeShape,s=t.inactiveShape,l=t.animationInterpolateFn,c=Lm(t.onAnimationStart,t.onAnimationEnd),u=c.isAnimating,p=c.handleAnimationStart,d=c.handleAnimationEnd,h=e7();return h==null?null:f.createElement(Gne,{showLabels:!u,sectors:i},f.createElement(Dm,{animationInput:t,animationIdPrefix:"recharts-pie-",items:i,previousItemsRef:n,isAnimationActive:t.isAnimationActive,animationBegin:t.animationBegin,animationDuration:t.animationDuration,animationEasing:t.animationEasing,onAnimationStart:p,onAnimationEnd:d,animationInterpolateFn:l,animationMatchBy:t.animationMatchBy,layout:h},(m,g,v)=>f.createElement(Xt,null,f.createElement(qne,{sectors:m,activeShape:a,inactiveShape:s,allOtherPieProps:t,shape:t.shape,id:r,animationElapsedTime:g,isAnimating:u||g<1,isEntrance:v}))),f.createElement(Vne,{showLabels:!u,sectors:i,props:t}),t.children)}var Zne={animationBegin:400,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:Xne,animationMatchBy:B1,cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,shape:T_,startAngle:0,stroke:"#fff",zIndex:on.area};function Jne(e){var t=e.id,n=$m(e,Ine),r=e.hide,i=e.className,a=e.rootTabIndex,s=f.useMemo(()=>R1(e.children,pd),[e.children]),l=Ie(p=>Dte(p,t,s)),c=f.useRef(null),u=yt("recharts-pie",i);return r||l==null?(c.current=null,f.createElement(Xt,{tabIndex:a,className:u})):f.createElement(lr,{zIndex:e.zIndex},f.createElement(zne,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,formatter:e.formatter,id:t,activeShape:e.activeShape}),f.createElement(Xt,{tabIndex:a,className:u},f.createElement(Qne,{props:Ft(Ft({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function ere(e){var t=pn(e,Zne),n=t.id,r=$m(t,One),i=ir(r);return f.createElement(zm,{id:n,type:"pie"},a=>f.createElement(f.Fragment,null,f.createElement(Ane,{type:"pie",id:a,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),f.createElement(Lne,ds({},r,{id:a})),f.createElement(Jne,ds({},r,{id:a}))))}var I_=ere;I_.displayName="Pie";var tre=["points"];function hA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ay(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hA(Object(n),!0).forEach(function(r){nre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nre(e,t,n){return(t=rre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rre(e){var t=ire(e,"string");return typeof t=="symbol"?t:t+""}function ire(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jf(){return Jf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jf.apply(null,arguments)}function are(e,t){if(e==null)return{};var n,r,i=ore(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ore(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function sre(e){var t=e.option,n=e.dotProps,r=e.className;if(f.isValidElement(t))return f.cloneElement(t,n);if(typeof t=="function")return t(n);var i=yt(r,typeof t!="boolean"?t.className:""),a=n??{};a.points;var s=are(a,tre);return f.createElement(y_,Jf({},s,{className:i}))}function lre(e,t){return e==null?!1:t?!0:e.length===1}function O_(e){var t=e.points,n=e.dot,r=e.className,i=e.dotClassName,a=e.dataKey,s=e.baseProps,l=e.needClip,c=e.clipPathId,u=e.zIndex,p=u===void 0?on.scatter:u;if(!lre(t,n))return null;var d=_1(n),h=dU(n),m=t.map((v,x)=>{var y,b,w=ay(ay(ay({r:3},s),h),{},{index:x,cx:(y=v.x)!==null&&y!==void 0?y:void 0,cy:(b=v.y)!==null&&b!==void 0?b:void 0,dataKey:a,value:v.value,payload:v.payload,points:t});return f.createElement(sre,{key:"dot-".concat(x),option:n,dotProps:w,className:i})}),g={};return l&&c!=null&&(g.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),f.createElement(lr,{zIndex:p},f.createElement(Xt,Jf({className:r},g),m))}function mA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mA(Object(n),!0).forEach(function(r){cre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cre(e,t,n){return(t=ure(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ure(e){var t=dre(e,"string");return typeof t=="symbol"?t:t+""}function dre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N_=0,pre={xAxis:{},yAxis:{},zAxis:{}},M_=Xn({name:"cartesianAxis",initialState:pre,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=mt(t.payload)},prepare:Dt()},replaceXAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.xAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.xAxis[r.id],e.xAxis[i.id]=mt(i))},prepare:Dt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Dt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=mt(t.payload)},prepare:Dt()},replaceYAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.yAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.yAxis[r.id],e.yAxis[i.id]=mt(i))},prepare:Dt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Dt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=mt(t.payload)},prepare:Dt()},replaceZAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.zAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.zAxis[r.id],e.zAxis[i.id]=mt(i))},prepare:Dt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Dt()},updateYAxisWidth(e,t){var n=t.payload,r=n.id,i=n.width,a=e.yAxis[r];if(a){var s,l=a.widthHistory||[];if(l.length===3&&l[0]===l[2]&&i===l[1]&&i!==a.width&&Math.abs(i-((s=l[0])!==null&&s!==void 0?s:0))<=1)return;var c=[...l,i].slice(-3);e.yAxis[r]=gA(gA({},a),{},{width:i,widthHistory:c})}}}}),qi=M_.actions,fre=qi.addXAxis,hre=qi.replaceXAxis,mre=qi.removeXAxis,gre=qi.addYAxis,yre=qi.replaceYAxis,vre=qi.removeYAxis;qi.addZAxis;qi.replaceZAxis;qi.removeZAxis;var xre=qi.updateYAxisWidth,bre=M_.reducer,wre=G([xn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),jre=G([wre,ja,Sa],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Bm=()=>Ie(jre),Sre=()=>Ie(qZ);function yA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yA(Object(n),!0).forEach(function(r){kre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kre(e,t,n){return(t=Cre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cre(e){var t=Pre(e,"string");return typeof t=="symbol"?t:t+""}function Pre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Are=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,s=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=oy(oy(oy({},l),as(i)),nb(i)),u;return f.isValidElement(i)?u=f.cloneElement(i,c):typeof i=="function"?u=i(c):u=f.createElement(y_,c),f.createElement(Xt,{className:"recharts-active-dot",clipPath:s},u)};function gx(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,s=e.zIndex,l=s===void 0?on.activeDot:s,c=Ie(ao),u=Sre();if(t==null||u==null)return null;var p=t.find(d=>u.includes(d.payload));return Bt(p)?null:f.createElement(lr,{zIndex:l},f.createElement(Are,{point:p,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}function Ere(e,t){return Nre(e)||Ore(e,t)||Ire(e,t)||Tre()}function Tre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
483
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ire(e,t){if(e){if(typeof e=="string")return vA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vA(e,t):void 0}}function vA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ore(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Nre(e){if(Array.isArray(e))return e}var xA=(e,t,n)=>{var r=n??e;if(!Bt(r))return qn(r,t,0)},Mre=(e,t,n)=>{var r={},i=e.filter(am),a=e.filter(u=>u.stackId==null),s=i.reduce((u,p)=>{var d=u[p.stackId];return d==null&&(d=[]),d.push(p),u[p.stackId]=d,u},r),l=Object.entries(s).map(u=>{var p,d=Ere(u,2),h=d[0],m=d[1],g=m.map(x=>x.dataKey),v=xA(t,n,(p=m[0])===null||p===void 0?void 0:p.barSize);return{stackId:h,dataKeys:g,barSize:v}}),c=a.map(u=>{var p=[u.dataKey].filter(h=>h!=null),d=xA(t,n,u.barSize);return{stackId:void 0,dataKeys:p,barSize:d}});return[...l,...c]};function bA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bA(Object(n),!0).forEach(function(r){Rre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rre(e,t,n){return(t=_re(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _re(e){var t=Lre(e,"string");return typeof t=="symbol"?t:t+""}function Lre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dre(e,t,n,r,i){var a,s=r.length;if(!(s<1)){var l=qn(e,n,0,!0),c,u=[];if(et((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,d=n/s,h=r.reduce((b,w)=>b+(w.barSize||0),0);h+=(s-1)*l,h>=n&&(h-=(s-1)*l,l=0),h>=n&&d>0&&(p=!0,d*=.9,h=s*d);var m=Math.round((n-h)/2),g={offset:m-l,size:0};c=r.reduce((b,w)=>{var j,k={stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:g.offset+g.size+l,size:p?d:(j=w.barSize)!==null&&j!==void 0?j:0}},S=[...b,k];return g=k.position,S},u)}else{var v=qn(t,n,0,!0);n-2*v-(s-1)*l<=0&&(l=0);var x=(n-2*v-(s-1)*l)/s;x>1&&(x=Math.round(x));var y=et(i)?Math.min(x,i):x;c=r.reduce((b,w,j)=>[...b,{stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:v+(x+l)*j+(x-y)/2,size:y}}],u)}return c}}var zre=(e,t,n,r,i,a,s)=>{var l=Bt(s)?t:s,c=Dre(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(u=>tp(tp({},u),{},{position:tp(tp({},u.position),{},{offset:u.position.offset-i/2})}))),c},$re=(e,t)=>{var n=im(t);if(!(!e||n==null||t==null)){var r=t.stackId;if(r!=null){var i=e[r];if(i){var a=i.stackedData;if(a)return a.find(s=>s.key===n)}}}},Bre=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function Fre(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&et(e.zIndex)?e.zIndex:t}var R_=e=>{var t=e.chartData,n=Ct(),r=Pn();return f.useEffect(()=>r?()=>{}:(n(RP(t)),()=>{n(RP(void 0))}),[t,n,r]),null},wA={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},__=Xn({name:"brush",initialState:wA,reducers:{setBrushSettings(e,t){return t.payload==null?wA:t.payload}}});__.actions.setBrushSettings;var Ure=__.reducer;function Wre(e){return(e%180+180)%180}var Kre=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Wre(i),s=a*Math.PI/180,l=Math.atan(r/n),c=s>l&&s<Math.PI-l?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},Hre={dots:[],areas:[],lines:[]},L_=Xn({name:"referenceElements",initialState:Hre,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Wr(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Wr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(mt(t.payload))},removeLine:(e,t)=>{var n=Wr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),Ql=L_.actions;Ql.addDot;Ql.removeDot;Ql.addArea;Ql.removeArea;Ql.addLine;Ql.removeLine;var Vre=L_.reducer;function qre(e,t){return Qre(e)||Xre(e,t)||Gre(e,t)||Yre()}function Yre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
484
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gre(e,t){if(e){if(typeof e=="string")return jA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jA(e,t):void 0}}function jA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Qre(e){if(Array.isArray(e))return e}var Zre=f.createContext(void 0),Jre=e=>{var t=e.children,n=f.useState("".concat(vu("recharts"),"-clip")),r=qre(n,1),i=r[0],a=Bm();if(a==null)return null;var s=a.x,l=a.y,c=a.width,u=a.height;return f.createElement(Zre.Provider,{value:i},f.createElement("defs",null,f.createElement("clipPath",{id:i},f.createElement("rect",{x:s,y:l,height:u,width:c}))),t)};function D_(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function eie(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Kre(r,n)}function tie(e,t,n){var r=n==="width",i=e.x,a=e.y,s=e.width,l=e.height;return t===1?{start:r?i:a,end:r?i+s:a+l}:{start:r?i+s:a+l,end:r?i:a}}function Tu(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function nie(e,t){return D_(e,t+1)}function rie(e,t,n,r,i){for(var a=(r||[]).slice(),s=t.start,l=t.end,c=0,u=1,p=s,d=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:D_(r,u)};var v=c,x,y=()=>(x===void 0&&(x=n(g,v)),x),b=g.coordinate,w=c===0||Tu(e,b,y,p,l);w||(c=0,p=s,u+=1),w&&(p=b+e*(y()/2+i),c+=u)},h;u<=a.length;)if(h=d(),h)return h.v;return[]}function iie(e,t,n,r,i){var a=(r||[]).slice(),s=a.length;if(s===0)return[];for(var l=t.start,c=t.end,u=1;u<=s;u++){for(var p=(s-1)%u,d=l,h=!0,m=function(){var j=r[v];if(j==null)return 0;var k=v,S,A=()=>(S===void 0&&(S=n(j,k)),S),T=j.coordinate,L=v===p||Tu(e,T,A,d,c);if(!L)return h=!1,1;L&&(d=T+e*(A()/2+i))},g,v=p;v<s&&(g=m(),!(g!==0&&g===1));v+=u);if(h){for(var x=[],y=p;y<s;y+=u){var b=r[y];b!=null&&x.push(b)}return x}}return[]}function SA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SA(Object(n),!0).forEach(function(r){aie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aie(e,t,n){return(t=oie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oie(e){var t=sie(e,"string");return typeof t=="symbol"?t:t+""}function sie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lie(e,t,n,r,i){for(var a=(r||[]).slice(),s=a.length,l=t.start,c=t.end,u=function(h){var m=a[h];if(m==null)return 1;var g=m,v,x=()=>(v===void 0&&(v=n(m,h)),v);if(h===s-1){var y=e*(g.coordinate+e*x()/2-c);a[h]=g=Kn(Kn({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else a[h]=g=Kn(Kn({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var b=Tu(e,g.tickCoord,x,l,c);b&&(c=g.tickCoord-e*(x()/2+i),a[h]=Kn(Kn({},g),{},{isShow:!0}))}},p=s-1;p>=0;p--)u(p);return a}function cie(e,t,n,r,i,a){var s=(r||[]).slice(),l=s.length,c=t.start,u=t.end;if(a){var p=r[l-1];if(p!=null){var d=n(p,l-1),h=e*(p.coordinate+e*d/2-u);if(s[l-1]=p=Kn(Kn({},p),{},{tickCoord:h>0?p.coordinate-h*e:p.coordinate}),p.tickCoord!=null){var m=Tu(e,p.tickCoord,()=>d,c,u);m&&(u=p.tickCoord-e*(d/2+i),s[l-1]=Kn(Kn({},p),{},{isShow:!0}))}}}for(var g=a?l-1:l,v=function(b){var w=s[b];if(w==null)return 1;var j=w,k,S=()=>(k===void 0&&(k=n(w,b)),k);if(b===0){var A=e*(j.coordinate-e*S()/2-c);s[b]=j=Kn(Kn({},j),{},{tickCoord:A<0?j.coordinate-A*e:j.coordinate})}else s[b]=j=Kn(Kn({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var T=Tu(e,j.tickCoord,S,c,u);T&&(c=j.tickCoord+e*(S()/2+i),s[b]=Kn(Kn({},j),{},{isShow:!0}))}},x=0;x<g;x++)v(x);return s}function W1(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,p=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(Ce(c)||Xu.isSsr){var h;return(h=nie(i,Ce(c)?c:0))!==null&&h!==void 0?h:[]}var m=[],g=l==="top"||l==="bottom"?"width":"height",v=p&&g==="width"?Vc(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},x=(k,S)=>{var A=typeof u=="function"?u(k.value,S):k.value;return g==="width"?eie(Vc(A,{fontSize:t,letterSpacing:n}),v,d):Vc(A,{fontSize:t,letterSpacing:n})[g]},y=i[0],b=i[1],w=i.length>=2&&y!=null&&b!=null?kn(b.coordinate-y.coordinate):1,j=tie(a,w,g);return c==="equidistantPreserveStart"?rie(w,j,x,i,s):c==="equidistantPreserveEnd"?iie(w,j,x,i,s):(c==="preserveStart"||c==="preserveStartEnd"?m=cie(w,j,x,i,s,c==="preserveStartEnd"):m=lie(w,j,x,i,s),m.filter(k=>k.isShow))}var uie=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r,a=e.tickSize,s=a===void 0?0:a,l=e.tickMargin,c=l===void 0?0:l,u=0;if(t){Array.from(t).forEach(m=>{if(m){var g=m.getBoundingClientRect();g.width>u&&(u=g.width)}});var p=n?n.getBoundingClientRect().width:0,d=s+c,h=u+d+p+(n?i:0);return Math.round(h)}return 0},die={xAxis:{},yAxis:{}},z_=Xn({name:"renderedTicks",initialState:die,reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=mt(a)},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),$_=z_.actions,pie=$_.setRenderedTicks,fie=$_.removeRenderedTicks,hie=z_.reducer,mie=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function kA(e,t){return xie(e)||vie(e,t)||yie(e,t)||gie()}function gie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
485
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yie(e,t){if(e){if(typeof e=="string")return CA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?CA(e,t):void 0}}function CA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function xie(e){if(Array.isArray(e))return e}function bie(e,t){if(e==null)return{};var n,r,i=wie(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function wie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ps(){return ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ps.apply(null,arguments)}function PA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function en(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PA(Object(n),!0).forEach(function(r){jie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jie(e,t,n){return(t=Sie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sie(e){var t=kie(e,"string");return typeof t=="symbol"?t:t+""}function kie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ua={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",zIndex:on.axis};function Cie(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,s=e.mirror,l=e.axisLine,c=e.otherSvgProps;if(!l)return null;var u=en(en(en({},c),ir(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!s||a==="bottom"&&s);u=en(en({},u),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var d=+(a==="left"&&!s||a==="right"&&s);u=en(en({},u),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return f.createElement("line",ps({},u,{className:yt("recharts-cartesian-axis-line",Fi(l,"className"))}))}function Pie(e,t,n,r,i,a,s,l,c){var u,p,d,h,m,g,v=l?-1:1,x=e.tickSize||s,y=Ce(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=p=e.coordinate,h=n+ +!l*i,d=h-v*x,g=d-v*c,m=y;break;case"left":d=h=e.coordinate,p=t+ +!l*r,u=p-v*x,m=u-v*c,g=y;break;case"right":d=h=e.coordinate,p=t+ +l*r,u=p+v*x,m=u+v*c,g=y;break;default:u=p=e.coordinate,h=n+ +l*i,d=h+v*x,g=d+v*c,m=y;break}return{line:{x1:u,y1:d,x2:p,y2:h},tick:{x:m,y:g}}}function Aie(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Eie(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Tie(e){var t=e.option,n=e.tickProps,r=e.value,i,a=yt(n.className,"recharts-cartesian-axis-tick-value");if(f.isValidElement(t))i=f.cloneElement(t,en(en({},n),{},{className:a}));else if(typeof t=="function")i=t(en(en({},n),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=yt(s,w_(t))),i=f.createElement(vm,ps({},n,{className:s}),r)}return i}function Iie(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=Ct();return f.useEffect(()=>{if(r==null||n==null)return po;var a=t.map(s=>({value:s.value,coordinate:s.coordinate,offset:s.offset,index:s.index}));return i(pie({ticks:a,axisId:r,axisType:n})),()=>{i(fie({axisId:r,axisType:n}))}},[i,t,r,n]),null}var Oie=f.forwardRef((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,s=e.stroke,l=e.tickFormatter,c=e.unit,u=e.padding,p=e.tickTextProps,d=e.orientation,h=e.mirror,m=e.x,g=e.y,v=e.width,x=e.height,y=e.tickSize,b=e.tickMargin,w=e.fontSize,j=e.letterSpacing,k=e.getTicksConfig,S=e.events,A=e.axisType,T=e.axisId,L=W1(en(en({},k),{},{ticks:r}),w,j),O=ir(k),R=as(i),_=c_(O.textAnchor)?O.textAnchor:Aie(d,h),X=Eie(d,h),q={};typeof a=="object"&&(q=a);var I=en(en({},O),{},{fill:"none"},q),$=L.map(W=>en({entry:W},Pie(W,m,g,v,x,d,y,h,b))),H=$.map(W=>{var P=W.entry,U=W.line;return f.createElement(Xt,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},a&&f.createElement("line",ps({},I,U,{className:yt("recharts-cartesian-axis-tick-line",Fi(a,"className"))})))}),N=$.map((W,P)=>{var U,le,E=W.entry,me=W.tick,ye=en(en(en(en({verticalAnchor:X},O),{},{textAnchor:_,stroke:"none",fill:s},me),{},{index:P,payload:E,visibleTicksCount:L.length,tickFormatter:l,padding:u},p),{},{angle:(U=(le=p==null?void 0:p.angle)!==null&&le!==void 0?le:O.angle)!==null&&U!==void 0?U:0}),Q=en(en({},ye),R);return f.createElement(Xt,ps({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},Wu(S,E,P)),i&&f.createElement(Tie,{option:i,tickProps:Q,value:"".concat(typeof l=="function"?l(E.value,P):E.value).concat(c||"")}))});return f.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},f.createElement(Iie,{ticks:L,axisId:T,axisType:A}),N.length>0&&f.createElement(lr,{zIndex:on.label},f.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},N)),H.length>0&&f.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},H))}),Nie=f.forwardRef((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,s=e.hide,l=e.ticks,c=e.axisType,u=e.axisId,p=bie(e,mie),d=f.useState(""),h=kA(d,2),m=h[0],g=h[1],v=f.useState(""),x=kA(v,2),y=x[0],b=x[1],w=f.useRef(null);f.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return uie({ticks:w.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=f.useCallback(k=>{if(k){var S=k.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=S;var A=S[0];if(A){var T=window.getComputedStyle(A),L=T.fontSize,O=T.letterSpacing;(L!==m||O!==y)&&(g(L),b(O))}}},[m,y]);return s||r!=null&&r<=0||i!=null&&i<=0?null:f.createElement(lr,{zIndex:e.zIndex},f.createElement(Xt,{className:yt("recharts-cartesian-axis",a)},f.createElement(Cie,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:ir(e)}),f.createElement(Oie,{ref:j,axisType:c,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:y,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),f.createElement(ite,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},f.createElement(hte,{label:e.label,labelRef:e.labelRef}),e.children)))}),K1=f.forwardRef((e,t)=>{var n=pn(e,ua);return f.createElement(Nie,ps({},n,{ref:t}))});K1.displayName="CartesianAxis";var Mie=["x1","y1","x2","y2","key"],Rie=["offset"],_ie=["xAxisId","yAxisId"],Lie=["xAxisId","yAxisId"];function AA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AA(Object(n),!0).forEach(function(r){Die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Die(e,t,n){return(t=zie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zie(e){var t=$ie(e,"string");return typeof t=="symbol"?t:t+""}function $ie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fo(){return Fo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fo.apply(null,arguments)}function eh(e,t){if(e==null)return{};var n,r,i=Bie(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Bie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Fie=e=>{var t=e.fill;if(!t||t==="none")return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,s=e.height,l=e.ry;return f.createElement("rect",{x:r,y:i,ry:l,width:a,height:s,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function B_(e){var t=e.option,n=e.lineItemProps,r;if(f.isValidElement(t))r=f.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,a=n.x1,s=n.y1,l=n.x2,c=n.y2,u=n.key,p=eh(n,Mie),d=(i=ir(p))!==null&&i!==void 0?i:{};d.offset;var h=eh(d,Rie);r=f.createElement("line",Fo({},h,{x1:a,y1:s,x2:l,y2:c,fill:"none",key:u}))}return r}function Uie(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var s=eh(e,_ie),l=a.map((c,u)=>{var p=Vn(Vn({},s),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(u),index:u});return f.createElement(B_,{key:"line-".concat(u),option:i,lineItemProps:p})});return f.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function Wie(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var s=eh(e,Lie),l=a.map((c,u)=>{var p=Vn(Vn({},s),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(u),index:u});return f.createElement(B_,{option:i,lineItemProps:p,key:"line-".concat(u)})});return f.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function Kie(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,s=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length||l==null)return null;var p=l.map(h=>Math.round(h+i-i)).sort((h,m)=>h-m);i!==p[0]&&p.unshift(0);var d=p.map((h,m)=>{var g=p[m+1],v=g==null,x=v?i+s-h:g-h;if(x<=0)return null;var y=m%t.length;return f.createElement("rect",{key:"react-".concat(m),y:h,x:r,height:x,width:a,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return f.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function Hie(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,s=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var p=u.map(h=>Math.round(h+a-a)).sort((h,m)=>h-m);a!==p[0]&&p.unshift(0);var d=p.map((h,m)=>{var g=p[m+1],v=g==null,x=v?a+l-h:g-h;if(x<=0)return null;var y=m%r.length;return f.createElement("rect",{key:"react-".concat(m),x:h,y:s,width:x,height:c,stroke:"none",fill:r[y],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return f.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var Vie=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return vN(W1(Vn(Vn(Vn({},ua),n),{},{ticks:xN(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},qie=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return vN(W1(Vn(Vn(Vn({},ua),n),{},{ticks:xN(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Yie={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:on.grid};function Uo(e){var t=hb(),n=mb(),r=AN(),i=Vn(Vn({},pn(e,Yie)),{},{x:Ce(e.x)?e.x:r.left,y:Ce(e.y)?e.y:r.top,width:Ce(e.width)?e.width:r.width,height:Ce(e.height)?e.height:r.height}),a=i.xAxisId,s=i.yAxisId,l=i.x,c=i.y,u=i.width,p=i.height,d=i.syncWithTicks,h=i.horizontalValues,m=i.verticalValues,g=Pn(),v=Ie(L=>jP(L,"xAxis",a,g)),x=Ie(L=>jP(L,"yAxis",s,g));if(!Wi(u)||!Wi(p)||!Ce(l)||!Ce(c))return null;var y=i.verticalCoordinatesGenerator||Vie,b=i.horizontalCoordinatesGenerator||qie,w=i.horizontalPoints,j=i.verticalPoints;if((!w||!w.length)&&typeof b=="function"){var k=h&&h.length,S=b({yAxis:x?Vn(Vn({},x),{},{ticks:k?h:x.ticks}):void 0,width:t??u,height:n??p,offset:r},k?!0:d);Ef(Array.isArray(S),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof S,"]")),Array.isArray(S)&&(w=S)}if((!j||!j.length)&&typeof y=="function"){var A=m&&m.length,T=y({xAxis:v?Vn(Vn({},v),{},{ticks:A?m:v.ticks}):void 0,width:t??u,height:n??p,offset:r},A?!0:d);Ef(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(j=T)}return f.createElement(lr,{zIndex:i.zIndex},f.createElement("g",{className:"recharts-cartesian-grid"},f.createElement(Fie,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),f.createElement(Kie,Fo({},i,{horizontalPoints:w})),f.createElement(Hie,Fo({},i,{verticalPoints:j})),f.createElement(Uie,Fo({},i,{offset:r,horizontalPoints:w,xAxis:v,yAxis:x})),f.createElement(Wie,Fo({},i,{offset:r,verticalPoints:j,xAxis:v,yAxis:x}))))}Uo.displayName="CartesianGrid";var Gie=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];function yx(){return yx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yx.apply(null,arguments)}function Xie(e,t){if(e==null)return{};var n,r,i=Qie(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Zie(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function F_(e,t){return"".concat(t,"px ").concat(e,"px")}function Jie(e){return e.length%2!==0?[...e,...e]:e}function eae(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function tae(e,t,n){var r=Jie(n),i=r.reduce((m,g)=>m+g,0);if(!i)return F_(t,e);for(var a=Math.floor(e/i),s=e%i,l=[],c=0,u=0;c<r.length;u+=(p=r[c])!==null&&p!==void 0?p:0,++c){var p,d=r[c];if(d!=null&&u+d>s){l=[...r.slice(0,c),s-u];break}}var h=l.length%2===0?[0,t]:[t];return[...eae(r,a),...l,...h].map(m=>"".concat(m,"px")).join(", ")}function nae(e,t,n){if(e){var r="".concat(e).split(/[,\s]+/gim).map(i=>parseFloat(i));return tae(n,t,r)}return F_(t,n)}function rae(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Xie(e,Gie),a=r??!1,s;if(t!=null){var l,c=i.pathRef,u=Zie((l=c==null?void 0:c.current)!==null&&l!==void 0?l:null);s=nae(n,u,t)}else n!=null&&(s=String(n));return f.createElement(pl,yx({},i,{connectNulls:a,strokeDasharray:s}))}function iae(e){var t=f.useRef(0),n=f.useRef(0),r=f.useRef(!1),i=f.useRef(e);return i.current!==e&&(t.current=n.current,i.current=e),f.useCallback((a,s)=>{if(r.current)return null;var l=Math.min(aa(t.current+a*s),s);return a>0&&s>0&&(n.current=Math.max(n.current,l),l>=s)?(r.current=!0,null):l},[])}var aae={},U_=Xn({name:"errorBars",initialState:aae,reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(s=>s.dataKey===i.dataKey&&s.direction===i.direction?a:s))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(a=>a.dataKey!==i.dataKey||a.direction!==i.direction))}}}),H1=U_.actions;H1.addErrorBar;H1.replaceErrorBar;H1.removeErrorBar;var oae=U_.reducer,sae=["children"];function lae(e,t){if(e==null)return{};var n,r,i=cae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function cae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var uae={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},dae=f.createContext(uae);function W_(e){var t=e.children,n=lae(e,sae);return f.createElement(dae.Provider,{value:n},t)}function Fm(e,t){var n,r,i=Ie(u=>Ca(u,e)),a=Ie(u=>Pa(u,t)),s=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:hn.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:mn.allowDataOverflow,c=s||l;return{needClip:c,needClipX:s,needClipY:l}}function V1(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=Bm(),a=Fm(t,n),s=a.needClipX,l=a.needClipY,c=a.needClip,u=Ie(w=>mR(w,t,!1)),p=Ie(w=>gR(w,n,!1));if(!c||!i)return null;var d=i.x,h=i.y,m=i.width,g=i.height,v=s&&u?Math.min(u[0],u[1]):d-m/2,x=l&&p?Math.min(p[0],p[1]):h-g/2,y=s&&u?Math.abs(u[1]-u[0]):m*2,b=l&&p?Math.abs(p[1]-p[0]):g*2;return f.createElement("clipPath",{id:"clipPath-".concat(r)},f.createElement("rect",{x:v,y:x,width:y,height:b}))}var K_=(e,t,n,r)=>Vi(e,"xAxis",t,r),H_=(e,t,n,r)=>Hi(e,"xAxis",t,r),V_=(e,t,n,r)=>Vi(e,"yAxis",n,r),q_=(e,t,n,r)=>Hi(e,"yAxis",n,r),pae=G([ct,K_,V_,H_,q_],(e,t,n,r,i)=>hi(e,"xAxis")?io(t,r,!1):io(n,i,!1)),fae=(e,t,n,r,i)=>i;function hae(e){return e.type==="line"}var mae=G([od,fae],(e,t)=>e.filter(hae).find(n=>n.id===t)),gae=G([ct,K_,V_,H_,q_,mae,pae,Zu],(e,t,n,r,i,a,s,l)=>{var c=l.chartData,u=l.dataStartIndex,p=l.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null||e!=="horizontal"&&e!=="vertical")){var d=a.dataKey,h=a.data,m;if(h!=null&&h.length>0?m=h:m=c==null?void 0:c.slice(u,p+1),m!=null)return Dae({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:s,displayedData:m})}});function Y_(e){var t=as(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,s=Number(i),l=Number(a);return(Number.isNaN(s)||s<0)&&(s=n),(Number.isNaN(l)||l<0)&&(l=r),{r:s,strokeWidth:l}}return{r:n,strokeWidth:r}}var yae=["id"],vae=["type","layout","connectNulls","needClip","shape","strokeDasharray"],xae=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function th(){return th=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},th.apply(null,arguments)}function q1(e,t){if(e==null)return{};var n,r,i=bae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function EA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ti(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EA(Object(n),!0).forEach(function(r){wae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wae(e,t,n){return(t=jae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jae(e){var t=Sae(e,"string");return typeof t=="symbol"?t:t+""}function Sae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kae(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Cae(e){var t=0,n=0;for(var r of e)r.status==="matched"&&r.prev.x!=null&&r.next.x!=null&&(t+=r.next.x-r.prev.x,n++);return n>0?t/n:0}var Pae=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(l=>l.status==="removed"?[]:[l.next]);var n=Cae(e),r=[];for(var i of e)if(i.status==="matched")r.push(Ti(Ti({},i.next),{},{x:Nt(i.prev.x,i.next.x,t),y:Nt(i.prev.y,i.next.y,t)}));else if(i.status==="added")if(i.next.x!=null){var a=i.next.x-n;r.push(Ti(Ti({},i.next),{},{x:Nt(a,i.next.x,t),y:i.next.y}))}else r.push(i.next);else if(i.status==="removed"&&i.prev.x!=null){var s=i.prev.x+n;r.push(Ti(Ti({},i.prev),{},{x:Nt(i.prev.x,s,t),y:i.prev.y}))}return r},Y1={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:Pae,animationMatchBy:_m,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:rae,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:on.line,type:"linear"},Aae=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:fo(n,t),payload:e}]},Eae=f.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,s=e.name,l=e.hide,c=e.unit,u=e.formatter,p=e.tooltipType,d=e.id,h={dataDefinedOnItem:n,getPosition:po,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:fo(s,t),hide:l,type:p,color:r,unit:c,formatter:u,graphicalItemId:d}};return f.createElement(Rm,{tooltipEntrySettings:h})});function Tae(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,s=r.needClip;r.id;var l=q1(r,yae),c=ir(l);return f.createElement(O_,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:c,needClip:s,clipPathId:t})}function Iae(e){var t=e.showLabels,n=e.children,r=e.points,i=f.useMemo(()=>r==null?void 0:r.map(a=>{var s,l,c={x:(s=a.x)!==null&&s!==void 0?s:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ti(Ti({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return f.createElement(T1,{value:t?i:void 0},n)}function Oae(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,s=e.isAnimating,l=e.isEntrance,c=e.visibleLength,u=i.type,p=i.layout,d=i.connectNulls,h=i.needClip,m=i.shape,g=i.strokeDasharray,v=q1(i,vae),x=Ti(Ti({},xr(v)),{},{fill:"none",className:"recharts-line-curve",clipPath:h?"url(#clipPath-".concat(t,")"):void 0,points:r,type:u,layout:p,connectNulls:d,strokeDasharray:g??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:s,isEntrance:i.animateNewValues?l:!1,visibleLength:c});return f.createElement(f.Fragment,null,(r==null?void 0:r.length)>1&&f.createElement(Mm,{option:m,DefaultShape:Y1.shape,shapeProps:x}),f.createElement(Tae,{points:r,clipPathId:t,props:i}))}function Nae(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,s=n.isAnimationActive,l=n.animationBegin,c=n.animationDuration,u=n.animationEasing,p=n.animationMatchBy,d=n.animationInterpolateFn,h=n.layout,m=kae(r.current),g=Lm(n.onAnimationStart,n.onAnimationEnd),v=g.isAnimating,x=g.handleAnimationStart,y=g.handleAnimationEnd,b=!v,w=iae(a),j=f.useCallback(k=>k>0&&m>0,[m]);return f.createElement(Iae,{points:a,showLabels:b},n.children,f.createElement(Dm,{animationInput:a,animationIdPrefix:"recharts-line-",items:a,previousItemsRef:i,isAnimationActive:s,animationBegin:l,animationDuration:c,animationEasing:u,onAnimationStart:x,onAnimationEnd:y,animationInterpolateFn:d,animationMatchBy:p,shouldUpdatePreviousRef:j,layout:h},(k,S,A)=>{var T=v||S<1,L=T?w(S,m):null;return f.createElement(Oae,{props:n,points:k,clipPathId:t,pathRef:r,animationElapsedTime:S,isAnimating:T,isEntrance:A,visibleLength:L})}),f.createElement(xm,{label:n.label}))}function Mae(e){var t=e.clipPathId,n=e.props,r=f.useRef(null),i=f.useRef(null);return f.createElement(Nae,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var Rae=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:gt(e.payload,t)}};class _ae extends f.Component{render(){var t=this.props,n=t.hide,r=t.dot,i=t.points,a=t.className,s=t.xAxisId,l=t.yAxisId,c=t.top,u=t.left,p=t.width,d=t.height,h=t.id,m=t.needClip,g=t.zIndex;if(n)return null;var v=yt("recharts-line",a),x=h,y=Y_(r),b=y.r,w=y.strokeWidth,j=_1(r),k=b*2+w,S=m?"url(#clipPath-".concat(j?"":"dots-").concat(x,")"):void 0;return f.createElement(lr,{zIndex:g},f.createElement(Xt,{className:v},m&&f.createElement("defs",null,f.createElement(V1,{clipPathId:x,xAxisId:s,yAxisId:l}),!j&&f.createElement("clipPath",{id:"clipPath-dots-".concat(x)},f.createElement("rect",{x:u-k/2,y:c-k/2,width:p+k,height:d+k}))),f.createElement(W_,{xAxisId:s,yAxisId:l,data:i,dataPointFormatter:Rae,errorBarOffset:0},f.createElement(Mae,{props:this.props,clipPathId:x}))),f.createElement(gx,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:S}))}}function Lae(e){var t=pn(e,Y1),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,s=t.animationEasing,l=t.connectNulls,c=t.dot,u=t.hide,p=t.isAnimationActive,d=t.label,h=t.legendType,m=t.xAxisId,g=t.yAxisId,v=t.id,x=q1(t,xae),y=Fm(m,g),b=y.needClip,w=Bm(),j=ho(),k=Pn(),S=Ie(R=>gae(R,m,g,k,v));if(j!=="horizontal"&&j!=="vertical"||S==null||w==null)return null;var A=w.height,T=w.width,L=w.x,O=w.y;return f.createElement(_ae,th({},x,{id:v,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:s,isAnimationActive:p,hide:u,label:d,legendType:h,xAxisId:m,yAxisId:g,points:S,layout:j,height:A,width:T,left:L,top:O,needClip:b}))}function Dae(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,s=e.dataKey,l=e.bandSize,c=e.displayedData;return c.map((u,p)=>{var d=gt(u,s);if(t==="horizontal"){var h=Af({axis:n,ticks:i,bandSize:l,entry:u,index:p}),m=Bt(d)?null:r.scale.map(d);return{x:h,y:m??null,value:d,payload:u}}var g=Bt(d)?null:n.scale.map(d),v=Af({axis:r,ticks:a,bandSize:l,entry:u,index:p});return g==null||v==null?null:{x:g,y:v,value:d,payload:u}}).filter(Boolean)}function zae(e){var t=pn(e,Y1),n=Pn();return f.createElement(zm,{id:t.id,type:"line"},r=>f.createElement(f.Fragment,null,f.createElement($1,{legendPayload:Aae(t)}),f.createElement(Eae,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:r}),f.createElement(U1,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),f.createElement(Lae,th({},t,{id:r}))))}var Zo=f.memo(zae,ys);Zo.displayName="Line";function Yi(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:N_}function Gi(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:N_}var G_=(e,t,n)=>Vi(e,"xAxis",Yi(e,t),n),X_=(e,t,n)=>Hi(e,"xAxis",Yi(e,t),n),Q_=(e,t,n)=>Vi(e,"yAxis",Gi(e,t),n),Z_=(e,t,n)=>Hi(e,"yAxis",Gi(e,t),n),$ae=G([ct,G_,Q_,X_,Z_],(e,t,n,r,i)=>hi(e,"xAxis")?io(t,r,!1):io(n,i,!1)),Bae=(e,t)=>t,J_=G([od,Bae],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),eL=e=>{var t=ct(e),n=hi(t,"xAxis");return n?"yAxis":"xAxis"},Fae=(e,t)=>{var n=eL(e);return n==="yAxis"?Gi(e,t):Yi(e,t)},Uae=(e,t,n)=>qf(e,eL(e),Fae(e,t),n),Wae=G([J_,Uae],(e,t)=>{var n;if(!(e==null||t==null)){var r=e.stackId,i=im(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,s=a==null?void 0:a.find(l=>l.key===i);if(s!=null)return s.map(l=>[l[0],l[1]])}}}),Kae=G([ct,G_,Q_,X_,Z_,Wae,HN,$ae,J_,Jq],(e,t,n,r,i,a,s,l,c,u)=>{var p=s.chartData,d=s.dataStartIndex,h=s.dataEndIndex;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null)){var m=c.data,g;if(m&&m.length>0?g=m:g=p==null?void 0:p.slice(d,h+1),g!=null)return goe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:g,chartBaseValue:u,bandSize:l})}}),Hae=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],Vae=["id","baseLine"];function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qc.apply(null,arguments)}function TA(e,t){if(e==null)return{};var n,r,i=qae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function qae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Yae(e){var t,n,r=e.alpha,i=e.baseLine,a=e.points,s=e.strokeWidth,l=(t=a[0])===null||t===void 0?void 0:t.x,c=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!et(l)||!et(c))return null;var u=r*Math.abs(l-c),p=Math.max(...a.map(d=>d.y||0));return Ce(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(d=>d.y||0),p)),Ce(p)?f.createElement("rect",{x:l<c?l:l-u,y:0,width:u,height:Math.floor(p+(s?parseInt("".concat(s),10):1))}):null}function Gae(e){var t,n,r=e.alpha,i=e.baseLine,a=e.points,s=e.strokeWidth,l=(t=a[0])===null||t===void 0?void 0:t.y,c=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!et(l)||!et(c))return null;var u=r*Math.abs(l-c),p=Math.max(...a.map(d=>d.x||0));return Ce(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(d=>d.x||0),p)),Ce(p)?f.createElement("rect",{x:0,y:l<c?l:l-u,width:p+(s?parseInt("".concat(s),10):1),height:Math.floor(u)}):null}function Xae(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n==="vertical"?f.createElement(Gae,{alpha:t,points:r,baseLine:i,strokeWidth:a}):f.createElement(Yae,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Qae(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r===void 0?!1:r,a=e.isEntrance,s=a===void 0?!1:a,l=e.layout,c=e.isRange,u=e.stroke,p=e.connectNulls,d=TA(e,Hae),h=l==="vertical"?"vertical":"horizontal",m=p??!1,g=A_(),v=d.id,x=d.baseLine,y=TA(d,Vae),b=ir(y),w=f.createElement(pl,qc({},d,{id:v,baseLine:x,connectNulls:m,stroke:"none",className:"recharts-area-area",layout:h})),j=u!=="none"&&f.createElement(pl,qc({},b,{className:"recharts-area-curve",layout:h,type:d.type,connectNulls:m,fill:"none",stroke:u,points:d.points})),k=u!=="none"&&c&&Array.isArray(x)&&f.createElement(pl,qc({},b,{className:"recharts-area-curve",layout:h,type:d.type,connectNulls:m,fill:"none",stroke:u,points:x}));if(s&&(i||n<1)){var S;return f.createElement(Xt,null,f.createElement("defs",null,f.createElement("clipPath",{id:g},f.createElement(Xae,{alpha:n,points:(S=d.points)!==null&&S!==void 0?S:[],baseLine:x,layout:h,strokeWidth:d.strokeWidth}))),f.createElement(Xt,{clipPath:"url(#".concat(g,")")},w,j,k))}return f.createElement(f.Fragment,null,w,j,k)}var Zae=["id"],Jae=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function nh(){return nh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nh.apply(null,arguments)}function tL(e,t){if(e==null)return{};var n,r,i=eoe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eoe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function IA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ml(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IA(Object(n),!0).forEach(function(r){toe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function toe(e,t,n){return(t=noe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function noe(e){var t=roe(e,"string");return typeof t=="symbol"?t:t+""}function roe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ioe=(e,t)=>e==null?[]:t===1?e.flatMap(n=>n.status==="removed"?[]:[n.next]):e.flatMap(n=>n.status==="matched"?[Ml(Ml({},n.next),{},{x:Nt(n.prev.x,n.next.x,t),y:Nt(n.prev.y,n.next.y,t)})]:n.status==="added"?[n.next]:[]),nL={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:_m,animationInterpolateFn:ioe,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:Qae,xAxisId:0,yAxisId:0,zIndex:on.area};function rh(e,t){return e&&e!=="none"?e:t}var aoe=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType,s=e.hide;return[{inactive:s,dataKey:t,type:a,color:rh(r,i),value:fo(n,t),payload:e}]},ooe=f.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,s=e.name,l=e.hide,c=e.unit,u=e.formatter,p=e.tooltipType,d=e.id,h={dataDefinedOnItem:n,getPosition:po,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:fo(s,t),hide:l,type:p,color:rh(r,a),unit:c,formatter:u,graphicalItemId:d}};return f.createElement(Rm,{tooltipEntrySettings:h})});function soe(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,s=r.dataKey,l=ir(r);return f.createElement(O_,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:s,baseProps:l,needClip:i,clipPathId:t})}function loe(e){var t=e.showLabels,n=e.children,r=e.points,i=r.map(a=>{var s,l,c={x:(s=a.x)!==null&&s!==void 0?s:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ml(Ml({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return f.createElement(T1,{value:t?i:void 0},n)}function coe(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,s=e.animationElapsedTime,l=e.isAnimating,c=e.isEntrance,u=a.layout,p=a.type,d=a.stroke,h=a.connectNulls,m=a.isRange,g=a.shape,v=a.id,x=tL(a,Zae),y=xr(x),b=Ml(Ml({},y),{},{id:v,points:t,connectNulls:h,type:p,baseLine:n,layout:u,stroke:d,isRange:m,animationElapsedTime:s,isAnimating:l,isEntrance:c});return f.createElement(f.Fragment,null,(t==null?void 0:t.length)>1&&f.createElement(Xt,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},f.createElement(Mm,{option:g,DefaultShape:nL.shape,shapeProps:b})),f.createElement(soe,{points:t,props:x,clipPathId:i}))}function uoe(e,t,n){if(Ce(e)){var r=Ce(t)?t:void 0;return Nt(r,e,n)}if(Bt(e)||ui(e)){var i=Ce(t)?t:void 0;return Nt(i,0,n)}return e}function doe(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,s=r.points,l=r.baseLine,c=r.isAnimationActive,u=r.animationBegin,p=r.animationDuration,d=r.animationEasing,h=r.animationMatchBy,m=r.animationInterpolateFn,g=f.useMemo(()=>({points:s,baseLine:l}),[s,l]),v=P_(g,a),x=gb(),y=Lm(r.onAnimationStart,r.onAnimationEnd),b=y.isAnimating,w=y.handleAnimationStart,j=y.handleAnimationEnd,k=v.startValue;if(x==null)return null;var S;return Array.isArray(l)&&Array.isArray(k)?S=mx(k,l,h):Array.isArray(l)?S=mx(null,l,h):S=null,f.createElement(Dm,{animationInput:g,animationIdPrefix:"recharts-area-",items:s,previousItemsRef:i,isAnimationActive:c,animationBegin:u,animationDuration:p,animationEasing:d,onAnimationStart:w,onAnimationEnd:j,animationInterpolateFn:m,animationMatchBy:h,layout:x},(A,T,L)=>{var O;return T===1?O=l:Array.isArray(l)?O=m(S,T,x):O=L?l:uoe(l,k,T),v.syncStepValue(O,T),f.createElement(loe,{showLabels:!b,points:s},r.children,f.createElement(coe,{points:A,baseLine:O,needClip:t,clipPathId:n,props:r,animationElapsedTime:T,isAnimating:b||T<1,isEntrance:L}),f.createElement(xm,{label:r.label}))})}function poe(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=f.useRef(null),a=f.useRef();return f.createElement(doe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class foe extends f.PureComponent{render(){var t=this.props,n=t.hide,r=t.dot,i=t.points,a=t.className,s=t.top,l=t.left,c=t.needClip,u=t.xAxisId,p=t.yAxisId,d=t.width,h=t.height,m=t.id,g=t.baseLine,v=t.zIndex;if(n)return null;var x=yt("recharts-area",a),y=m,b=Y_(r),w=b.r,j=b.strokeWidth,k=_1(r),S=w*2+j,A=c?"url(#clipPath-".concat(k?"":"dots-").concat(y,")"):void 0;return f.createElement(lr,{zIndex:v},f.createElement(Xt,{className:x},c&&f.createElement("defs",null,f.createElement(V1,{clipPathId:y,xAxisId:u,yAxisId:p}),!k&&f.createElement("clipPath",{id:"clipPath-dots-".concat(y)},f.createElement("rect",{x:l-S/2,y:s-S/2,width:d+S,height:h+S}))),f.createElement(poe,{needClip:c,clipPathId:y,props:this.props})),f.createElement(gx,{points:i,mainColor:rh(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:A}),this.props.isRange&&Array.isArray(g)&&f.createElement(gx,{points:g,mainColor:rh(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:A}))}}function hoe(e){var t,n=e.activeDot,r=e.animationBegin,i=e.animationDuration,a=e.animationEasing,s=e.connectNulls,l=e.dot,c=e.fill,u=e.fillOpacity,p=e.hide,d=e.isAnimationActive,h=e.legendType,m=e.stroke,g=e.xAxisId,v=e.yAxisId,x=tL(e,Jae),y=ho(),b=GR(),w=Fm(g,v),j=w.needClip,k=Pn(),S=(t=Ie(I=>Kae(I,e.id,k)))!==null&&t!==void 0?t:{},A=S.points,T=S.isRange,L=S.baseLine,O=Bm();if(y!=="horizontal"&&y!=="vertical"||O==null||b!=="AreaChart"&&b!=="ComposedChart")return null;var R=O.height,_=O.width,X=O.x,q=O.y;return!A||!A.length?null:f.createElement(foe,nh({},x,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:L,connectNulls:s,dot:l,fill:c,fillOpacity:u,height:R,hide:p,layout:y,isAnimationActive:d,isRange:T,legendType:h,needClip:j,points:A,stroke:m,width:_,left:X,top:q,xAxisId:g,yAxisId:v}))}var moe=(e,t,n,r,i)=>{var a=n??t;if(Ce(a))return a;var s=e==="horizontal"?i:r,l=s.scale.domain();if(s.type==="number"){var c=Math.max(l[0],l[1]),u=Math.min(l[0],l[1]);return a==="dataMin"?u:a==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return a==="dataMin"?l[0]:a==="dataMax"?l[1]:l[0]};function goe(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,s=e.layout,l=e.chartBaseValue,c=e.xAxis,u=e.yAxis,p=e.displayedData,d=e.dataStartIndex,h=e.xAxisTicks,m=e.yAxisTicks,g=e.bandSize,v=a&&a.length,x=moe(s,l,r,c,u),y=s==="horizontal",b=!1,w=p.map((k,S)=>{var A,T,L,O;if(v)O=a[d+S];else{var R=gt(k,i);Array.isArray(R)?(O=R,b=!0):O=[x,R]}var _=(A=(T=O)===null||T===void 0?void 0:T[1])!==null&&A!==void 0?A:null,X=_==null||v&&!n&&gt(k,i)==null;if(y){var q;return{x:Af({axis:c,ticks:h,bandSize:g,entry:k,index:S}),y:X?null:(q=u.scale.map(_))!==null&&q!==void 0?q:null,value:O,payload:k}}return{x:X?null:(L=c.scale.map(_))!==null&&L!==void 0?L:null,y:Af({axis:u,ticks:m,bandSize:g,entry:k,index:S}),value:O,payload:k}}),j;return v||b?j=w.map(k=>{var S,A=Array.isArray(k.value)?k.value[0]:null;if(y){var T;return{x:k.x,y:A!=null&&k.y!=null&&(T=u.scale.map(A))!==null&&T!==void 0?T:null,payload:k.payload}}return{x:A!=null&&(S=c.scale.map(A))!==null&&S!==void 0?S:null,y:k.y,payload:k.payload}}):j=y?u.scale.map(x):c.scale.map(x),{points:w,baseLine:j??0,isRange:b}}function yoe(e){var t=pn(e,nL),n=Pn();return f.createElement(zm,{id:t.id,type:"area"},r=>f.createElement(f.Fragment,null,f.createElement($1,{legendPayload:aoe(t)}),f.createElement(ooe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:r}),f.createElement(U1,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:bN(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),f.createElement(hoe,nh({},t,{id:r}))))}var ih=f.memo(yoe,ys);ih.displayName="Area";var voe="Invariant failed";function xoe(e,t){throw new Error(voe)}var boe=["option"];function woe(e,t){if(e==null)return{};var n,r,i=joe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function joe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var G1=$N;function X1(e){var t=e.option,n=woe(e,boe);return f.createElement(Mm,{option:t,DefaultShape:G1,shapeProps:n,activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"})}var Soe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Ce(t))return t;var a=Ce(r)||Bt(r);return a?t(r,i):(a||xoe(),n)}},koe=(e,t,n)=>n,Coe=(e,t)=>t,fd=G([od,Coe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),Poe=G([fd],e=>e==null?void 0:e.maxBarSize),Aoe=(e,t,n,r)=>r,Eoe=G([ct,od,Yi,Gi,koe],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),Toe=(e,t,n)=>{var r=ct(e),i=Yi(e,t),a=Gi(e,t);if(!(i==null||a==null))return r==="horizontal"?qf(e,"yAxis",a,n):qf(e,"xAxis",i,n)},Ioe=(e,t)=>{var n=ct(e),r=Yi(e,t),i=Gi(e,t);if(!(r==null||i==null))return n==="horizontal"?wP(e,"xAxis",r):wP(e,"yAxis",i)},Ooe=G([Eoe,Zq,Ioe],Mre),Noe=(e,t,n)=>{var r,i,a=fd(e,t);if(a==null)return 0;var s=Yi(e,t),l=Gi(e,t);if(s==null||l==null)return 0;var c=ct(e),u=rM(e),p=a.maxBarSize,d=Bt(p)?u:p,h,m;return c==="horizontal"?(h=Vi(e,"xAxis",s,n),m=Hi(e,"xAxis",s,n)):(h=Vi(e,"yAxis",l,n),m=Hi(e,"yAxis",l,n)),(r=(i=io(h,m,!0))!==null&&i!==void 0?i:d)!==null&&r!==void 0?r:0},rL=(e,t,n)=>{var r=ct(e),i=Yi(e,t),a=Gi(e,t);if(!(i==null||a==null)){var s,l;return r==="horizontal"?(s=Vi(e,"xAxis",i,n),l=Hi(e,"xAxis",i,n)):(s=Vi(e,"yAxis",a,n),l=Hi(e,"yAxis",a,n)),io(s,l)}},Moe=G([Ooe,rM,Qq,iM,Noe,rL,Poe],zre),Roe=(e,t,n)=>{var r=Yi(e,t);if(r!=null)return Vi(e,"xAxis",r,n)},_oe=(e,t,n)=>{var r=Gi(e,t);if(r!=null)return Vi(e,"yAxis",r,n)},Loe=(e,t,n)=>{var r=Yi(e,t);if(r!=null)return Hi(e,"xAxis",r,n)},Doe=(e,t,n)=>{var r=Gi(e,t);if(r!=null)return Hi(e,"yAxis",r,n)},zoe=G([Moe,fd],Bre),$oe=G([Toe,fd],$re),Boe=G([xn,db,Roe,_oe,Loe,Doe,zoe,ct,HN,rL,$oe,fd,Aoe],(e,t,n,r,i,a,s,l,c,u,p,d,h)=>{var m=c.chartData,g=c.dataStartIndex,v=c.dataEndIndex;if(!(d==null||s==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||u==null)){var x=d.data,y;if(x!=null&&x.length>0?y=x:y=m==null?void 0:m.slice(g,v+1),y!=null)return xse({layout:l,barSettings:d,pos:s,parentViewBox:t,bandSize:u,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:y,offset:e,cells:h,dataStartIndex:g})}}),Foe=["index"];function vx(){return vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vx.apply(null,arguments)}function Uoe(e,t){if(e==null)return{};var n,r,i=Woe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Woe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var iL=f.createContext(void 0),Koe=e=>{var t=f.useContext(iL);if(t!=null)return t.stackId;if(e!=null)return bN(e)},Hoe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),Voe=e=>{var t=f.useContext(iL);if(t!=null){var n=t.stackId;return"url(#".concat(Hoe(n,e),")")}},aL=e=>{var t=e.index,n=Uoe(e,Foe),r=Voe(t);return f.createElement(Xt,vx({className:"recharts-bar-stack-layer",clipPath:r},n))},qoe=["onMouseEnter","onMouseLeave","onClick"],Yoe=["value","background","tooltipPosition"],Goe=["id"],Xoe=["onMouseEnter","onClick","onMouseLeave"];function OA(e,t){return ese(e)||Joe(e,t)||Zoe(e,t)||Qoe()}function Qoe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
486
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zoe(e,t){if(e){if(typeof e=="string")return NA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?NA(e,t):void 0}}function NA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Joe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function ese(e){if(Array.isArray(e))return e}function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oo.apply(null,arguments)}function MA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MA(Object(n),!0).forEach(function(r){tse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tse(e,t,n){return(t=nse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nse(e){var t=rse(e,"string");return typeof t=="symbol"?t:t+""}function rse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ah(e,t){if(e==null)return{};var n,r,i=ise(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ise(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ase=e=>{var t=e.dataKey,n=e.name,r=e.fill,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:fo(n,t),payload:e}]},ose=f.memo(e=>{var t=e.dataKey,n=e.stroke,r=e.strokeWidth,i=e.fill,a=e.name,s=e.hide,l=e.unit,c=e.formatter,u=e.tooltipType,p=e.id,d={dataDefinedOnItem:void 0,getPosition:po,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:fo(a,t),hide:s,type:u,color:i,unit:l,formatter:c,graphicalItemId:p}};return f.createElement(Rm,{tooltipEntrySettings:d})});function sse(e){var t=Ie(ao),n=e.data,r=e.dataKey,i=e.background,a=e.allOtherBarProps,s=a.onMouseEnter,l=a.onMouseLeave,c=a.onClick,u=ah(a,qoe),p=L1(s,r,a.id),d=D1(l),h=z1(c,r,a.id);if(!i||n==null)return null;var m=as(i);return f.createElement(lr,{zIndex:Fre(i,on.barBackground)},n.map((g,v)=>{g.value;var x=g.background;g.tooltipPosition;var y=ah(g,Yoe);if(!x)return null;var b=p(g,g.originalDataIndex),w=d(g,g.originalDataIndex),j=h(g,g.originalDataIndex),k=gn(gn(gn(gn(gn({option:i,isActive:String(g.originalDataIndex)===t},y),{},{fill:"#eee"},x),m),Wu(u,g,v)),{},{onMouseEnter:b,onMouseLeave:w,onClick:j,dataKey:r,index:v,className:"recharts-bar-background-rectangle"});return f.createElement(X1,oo({key:"background-bar-".concat(v)},k))}))}function lse(e){var t=e.showLabels,n=e.children,r=e.rects,i=r==null?void 0:r.map(a=>{var s={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return gn(gn({},s),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:s,fill:a.fill})});return f.createElement(T1,{value:t?i:void 0},n)}function cse(e){var t=e.shape,n=e.activeBar,r=e.baseProps,i=e.entry,a=e.index,s=e.dataKey,l=Ie(ao),c=Ie(j1),u=n&&String(i.originalDataIndex)===l&&(c==null||s===c),p=f.useState(!1),d=OA(p,2),h=d[0],m=d[1],g=f.useState(!1),v=OA(g,2),x=v[0],y=v[1];f.useEffect(()=>{var A;return u?(m(!0),A=requestAnimationFrame(()=>{y(!0)})):y(!1),()=>{cancelAnimationFrame(A)}},[u]);var b=f.useCallback(()=>{u||m(!1)},[u]),w=u&&x,j=u||h,k;u?n===!0?k=t:k=n:k=t;var S=f.createElement(X1,oo({},r,{name:String(r.name)},i,{isActive:w,option:k,index:a,dataKey:s,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:b}));return j?f.createElement(lr,{zIndex:on.activeBar},f.createElement(aL,{index:i.originalDataIndex},S)):S}function use(e){var t=e.shape,n=e.baseProps,r=e.entry,i=e.index,a=e.dataKey;return f.createElement(X1,oo({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance}))}function dse(e){var t,n=e.data,r=e.props,i=e.animationElapsedTime,a=e.isAnimating,s=e.isEntrance,l=(t=ir(r))!==null&&t!==void 0?t:{},c=l.id,u=ah(l,Goe),p=r.shape,d=r.dataKey,h=r.activeBar,m=r.onMouseEnter,g=r.onClick,v=r.onMouseLeave,x=ah(r,Xoe),y=L1(m,d,c),b=D1(v),w=z1(g,d,c);return n?f.createElement(f.Fragment,null,n.map((j,k)=>f.createElement(aL,oo({index:j.originalDataIndex,key:"rectangle-".concat(j==null?void 0:j.x,"-").concat(j==null?void 0:j.y,"-").concat(j==null?void 0:j.value,"-").concat(k),className:"recharts-bar-rectangle"},Wu(x,j,k),{onMouseEnter:y(j,j.originalDataIndex),onMouseLeave:b(j,j.originalDataIndex),onClick:w(j,j.originalDataIndex)}),h?f.createElement(cse,{shape:p,activeBar:h,baseProps:u,entry:j,index:k,dataKey:d,animationElapsedTime:i,isAnimating:a,isEntrance:s}):f.createElement(use,{shape:p,baseProps:u,entry:j,index:k,dataKey:d,animationElapsedTime:i,isAnimating:a,isEntrance:s})))):null}var pse=(e,t,n)=>e==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>{if(r.status==="removed")return n==="horizontal"?[gn(gn({},r.prev),{},{height:Nt(r.prev.height,0,t),y:Nt(r.prev.y,r.prev.y+r.prev.height,t)})]:[gn(gn({},r.prev),{},{width:Nt(r.prev.width,0,t)})];if(r.status==="matched")return[gn(gn({},r.next),{},{x:Nt(r.prev.x,r.next.x,t),y:Nt(r.prev.y,r.next.y,t),width:Nt(r.prev.width,r.next.width,t),height:Nt(r.prev.height,r.next.height,t)})];var i=r.next;return n==="horizontal"?[gn(gn({},i),{},{height:Nt(0,i.height,t),y:Nt(i.stackedBarStart,i.y,t)})]:[gn(gn({},i),{},{width:Nt(0,i.width,t),x:Nt(i.stackedBarStart,i.x,t)})]});function fse(e){var t=e.props,n=e.previousRectanglesRef,r=t.data,i=t.isAnimationActive,a=t.animationBegin,s=t.animationDuration,l=t.animationEasing,c=t.animationInterpolateFn,u=t.layout,p=Lm(t.onAnimationStart,t.onAnimationEnd),d=p.isAnimating,h=p.handleAnimationStart,m=p.handleAnimationEnd;return f.createElement(lse,{showLabels:!d,rects:r},f.createElement(Dm,{animationInput:r,animationIdPrefix:"recharts-bar-",items:r,previousItemsRef:n,isAnimationActive:i,animationBegin:a,animationDuration:s,animationEasing:l,onAnimationStart:h,onAnimationEnd:m,animationInterpolateFn:c,animationMatchBy:t.animationMatchBy,layout:u},(g,v,x)=>f.createElement(Xt,null,f.createElement(dse,{props:t,data:g,animationElapsedTime:v,isAnimating:d||v<1,isEntrance:x}))),f.createElement(xm,{label:t.label}),t.children)}function hse(e){var t=f.useRef(null);return f.createElement(fse,{previousRectanglesRef:t,props:e})}var oL=0,mse=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:gt(e,t)}};class gse extends f.PureComponent{render(){var t=this.props,n=t.hide,r=t.data,i=t.dataKey,a=t.className,s=t.xAxisId,l=t.yAxisId,c=t.needClip,u=t.background,p=t.id;if(n||r==null)return null;var d=yt("recharts-bar",a),h=p;return f.createElement(Xt,{className:d,id:p},c&&f.createElement("defs",null,f.createElement(V1,{clipPathId:h,xAxisId:s,yAxisId:l})),f.createElement(Xt,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(h,")"):void 0},f.createElement(sse,{data:r,dataKey:i,background:u,allOtherBarProps:this.props}),f.createElement(hse,this.props)))}}var yse={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",animationInterpolateFn:pse,animationMatchBy:B1,background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:oL,shape:G1,xAxisId:0,yAxisId:0,zIndex:on.bar};function vse(e){var t=e.xAxisId,n=e.yAxisId,r=e.hide,i=e.legendType,a=e.minPointSize,s=e.activeBar,l=e.animationBegin,c=e.animationDuration,u=e.animationEasing,p=e.isAnimationActive,d=Fm(t,n),h=d.needClip,m=ho(),g=Pn(),v=R1(e.children,pd),x=Ie(w=>Boe(w,e.id,g,v));if(m!=="vertical"&&m!=="horizontal")return null;var y,b=x==null?void 0:x[0];return b==null||b.height==null||b.width==null?y=0:y=m==="vertical"?b.height/2:b.width/2,f.createElement(W_,{xAxisId:t,yAxisId:n,data:x,dataPointFormatter:mse,errorBarOffset:y},f.createElement(gse,oo({},e,{layout:m,needClip:h,data:x,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:u,isAnimationActive:p})))}function xse(e){var t=e.layout,n=e.barSettings,r=n.dataKey,i=n.minPointSize,a=n.hasCustomShape,s=e.pos,l=e.bandSize,c=e.xAxis,u=e.yAxis,p=e.xAxisTicks,d=e.yAxisTicks,h=e.stackedData,m=e.displayedData,g=e.offset,v=e.cells,x=e.parentViewBox,y=e.dataStartIndex,b=t==="horizontal"?u:c,w=h?b.scale.domain():null,j=fH({numericAxis:b}),k=b.scale.map(j);return m.map((S,A)=>{var T,L,O,R,_,X;if(h){var q=h[A+y];if(q==null)return null;T=lH(q,w)}else T=gt(S,r),Array.isArray(T)||(T=[j,T]);var I=Soe(i,oL)(T[1],A);if(t==="horizontal"){var $,H=u.scale.map(T[0]),N=u.scale.map(T[1]);if(H==null||N==null)return null;L=wk({axis:c,ticks:p,bandSize:l,offset:s.offset,entry:S,index:A}),O=($=N??H)!==null&&$!==void 0?$:void 0,R=s.size;var W=H-N;if(_=ui(W)?0:W,X={x:L,y:g.top,width:R,height:g.height},Math.abs(I)>0&&Math.abs(_)<Math.abs(I)){var P=kn(_||I)*(Math.abs(I)-Math.abs(_));O-=P,_+=P}}else{var U=c.scale.map(T[0]),le=c.scale.map(T[1]);if(U==null||le==null)return null;if(L=U,O=wk({axis:u,ticks:d,bandSize:l,offset:s.offset,entry:S,index:A}),R=le-U,_=s.size,X={x:g.left,y:O,width:g.width,height:_},Math.abs(I)>0&&Math.abs(R)<Math.abs(I)){var E=kn(R||I)*(Math.abs(I)-Math.abs(R));R+=E}}if(L==null||O==null||R==null||_==null||!a&&(R===0||_===0))return null;var me=gn(gn({},S),{},{stackedBarStart:k,x:L,y:O,width:R,height:_,value:h?T:T[1],payload:S,background:X,tooltipPosition:{x:L+R/2,y:O+_/2},parentViewBox:x,originalDataIndex:A},v&&v[A]&&v[A].props);return me}).filter(Boolean)}function bse(e){var t=pn(e,yse),n=Koe(t.stackId),r=Pn();return f.createElement(zm,{id:t.id,type:"bar"},i=>f.createElement(f.Fragment,null,f.createElement($1,{legendPayload:ase(t)}),f.createElement(ose,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:i}),f.createElement(U1,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null&&t.shape!==G1}),f.createElement(lr,{zIndex:t.zIndex},f.createElement(vse,oo({},t,{id:i})))))}var sL=f.memo(bse,ys);sL.displayName="Bar";var wse=["domain","range"],jse=["domain","range"];function RA(e,t){if(e==null)return{};var n,r,i=Sse(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Sse(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function _A(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function lL(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=RA(e,wse),a=t.domain,s=t.range,l=RA(t,jse);return!_A(n,a)||!_A(r,s)?!1:ys(i,l)}var kse=["type"],Cse=["dangerouslySetInnerHTML","ticks","scale"],Pse=["id","scale"];function xx(){return xx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xx.apply(null,arguments)}function LA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LA(Object(n),!0).forEach(function(r){Ase(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ase(e,t,n){return(t=Ese(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ese(e){var t=Tse(e,"string");return typeof t=="symbol"?t:t+""}function Tse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bx(e,t){if(e==null)return{};var n,r,i=Ise(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ise(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ose(e){var t=Ct(),n=f.useRef(null),r=gb(),i=e.type,a=bx(e,kse),s=nm(r,"xAxis",i),l=f.useMemo(()=>{if(s!=null)return DA(DA({},a),{},{type:s})},[a,s]);return f.useLayoutEffect(()=>{l!=null&&(n.current===null?t(fre(l)):n.current!==l&&t(hre({prev:n.current,next:l})),n.current=l)},[l,t]),f.useLayoutEffect(()=>()=>{n.current&&(t(mre(n.current)),n.current=null)},[t]),null}var Nse=e=>{var t=e.xAxisId,n=e.className,r=Ie(db),i=Pn(),a="xAxis",s=Ie(h=>kR(h,a,t,i)),l=Ie(h=>wR(h,t)),c=Ie(h=>LQ(h,t)),u=Ie(h=>QM(h,t));if(l==null||c==null||u==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var p=bx(e,Cse);u.id,u.scale;var d=bx(u,Pse);return f.createElement(K1,xx({},p,d,{x:c.x,y:c.y,width:l.width,height:l.height,className:yt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:s,axisType:a,axisId:t}))},Mse={allowDataOverflow:hn.allowDataOverflow,allowDecimals:hn.allowDecimals,allowDuplicatedCategory:hn.allowDuplicatedCategory,angle:hn.angle,axisLine:ua.axisLine,height:hn.height,hide:!1,includeHidden:hn.includeHidden,interval:hn.interval,label:!1,minTickGap:hn.minTickGap,mirror:hn.mirror,orientation:hn.orientation,padding:hn.padding,reversed:hn.reversed,scale:hn.scale,tick:hn.tick,tickCount:hn.tickCount,tickLine:ua.tickLine,tickSize:ua.tickSize,type:hn.type,niceTicks:hn.niceTicks,xAxisId:0},Rse=e=>{var t=pn(e,Mse);return f.createElement(f.Fragment,null,f.createElement(Ose,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),f.createElement(Nse,t))},Wo=f.memo(Rse,lL);Wo.displayName="XAxis";var _se=["type"],Lse=["dangerouslySetInnerHTML","ticks","scale"],Dse=["id","scale"];function wx(){return wx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wx.apply(null,arguments)}function zA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $A(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zA(Object(n),!0).forEach(function(r){zse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zse(e,t,n){return(t=$se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $se(e){var t=Bse(e,"string");return typeof t=="symbol"?t:t+""}function Bse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jx(e,t){if(e==null)return{};var n,r,i=Fse(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fse(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Use(e){var t=Ct(),n=f.useRef(null),r=gb(),i=e.type,a=jx(e,_se),s=nm(r,"yAxis",i),l=f.useMemo(()=>{if(s!=null)return $A($A({},a),{},{type:s})},[s,a]);return f.useLayoutEffect(()=>{l!=null&&(n.current===null?t(gre(l)):n.current!==l&&t(yre({prev:n.current,next:l})),n.current=l)},[l,t]),f.useLayoutEffect(()=>()=>{n.current&&(t(vre(n.current)),n.current=null)},[t]),null}function Wse(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=f.useRef(null),s=f.useRef(null),l=Ie(db),c=Pn(),u=Ct(),p="yAxis",d=Ie(y=>jR(y,t)),h=Ie(y=>zQ(y,t)),m=Ie(y=>kR(y,p,t,c)),g=Ie(y=>ZM(y,t));if(f.useLayoutEffect(()=>{if(!(r!=="auto"||!d||E1(i)||f.isValidElement(i)||g==null)){var y=a.current;if(y){var b=y.getCalculatedWidth();Math.round(d.width)!==Math.round(b)&&u(xre({id:t,width:b}))}}},[m,d,u,i,t,r,g]),d==null||h==null||g==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var v=jx(e,Lse);g.id,g.scale;var x=jx(g,Dse);return f.createElement(K1,wx({},v,x,{ref:a,labelRef:s,x:h.x,y:h.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:d.width,height:d.height,className:yt("recharts-".concat(p," ").concat(p),n),viewBox:l,ticks:m,axisType:p,axisId:t}))}var Kse={allowDataOverflow:mn.allowDataOverflow,allowDecimals:mn.allowDecimals,allowDuplicatedCategory:mn.allowDuplicatedCategory,angle:mn.angle,axisLine:ua.axisLine,hide:!1,includeHidden:mn.includeHidden,interval:mn.interval,label:!1,minTickGap:mn.minTickGap,mirror:mn.mirror,orientation:mn.orientation,padding:mn.padding,reversed:mn.reversed,scale:mn.scale,tick:mn.tick,tickCount:mn.tickCount,tickLine:ua.tickLine,tickSize:ua.tickSize,type:mn.type,niceTicks:mn.niceTicks,width:mn.width,yAxisId:0},Hse=e=>{var t=pn(e,Kse);return f.createElement(f.Fragment,null,f.createElement(Use,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),f.createElement(Wse,t))},Ko=f.memo(Hse,lL);Ko.displayName="YAxis";var Vse=(e,t)=>t,Q1=G([Vse,ct,dM,An,UR,Aa,aJ,xn],pJ);function qse(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Z1(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(qse(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var s=(l,c)=>({relativeX:Math.round((l-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(l=>s(l.clientX,l.clientY)):s(e.clientX,e.clientY)}var cL=Ir("mouseClick"),uL=Hu();uL.startListening({actionCreator:cL,effect:(e,t)=>{var n=e.payload,r=Q1(t.getState(),Z1(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(eZ({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Sx=Ir("mouseMove"),dL=Hu(),_s=null,wo=null,sy=null;dL.startListening({actionCreator:Sx,effect:(e,t)=>{var n=e.payload,r=t.getState(),i=r.eventSettings,a=i.throttleDelay,s=i.throttledEvents,l=s==="all"||(s==null?void 0:s.includes("mousemove"));_s!==null&&(cancelAnimationFrame(_s),_s=null),wo!==null&&(typeof a!="number"||!l)&&(clearTimeout(wo),wo=null),sy=Z1(n);var c=()=>{var u=t.getState(),p=cd(u,u.tooltip.settings.shared);if(!sy){_s=null,wo=null;return}if(p==="axis"){var d=Q1(u,sy);(d==null?void 0:d.activeIndex)!=null?t.dispatch(NR({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(OR())}_s=null,wo=null};if(!l){c();return}a==="raf"?_s=requestAnimationFrame(c):typeof a=="number"&&wo===null&&(wo=setTimeout(c,a))}});function Yse(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var BA={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},pL=Xn({name:"rootProps",initialState:BA,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:BA.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Gse=pL.reducer,Xse=pL.actions.updateOptions,Qse=null,Zse={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},fL=Xn({name:"polarOptions",initialState:Qse,reducers:Zse}),Jse=fL.actions.updatePolarOptions,ele=fL.reducer,hL=Ir("keyDown"),mL=Ir("focus"),gL=Ir("blur"),Um=Hu(),Ls=null,jo=null,np=null;Um.startListening({actionCreator:hL,effect:(e,t)=>{np=e.payload,Ls!==null&&(cancelAnimationFrame(Ls),Ls=null);var n=t.getState(),r=n.eventSettings,i=r.throttleDelay,a=r.throttledEvents,s=a==="all"||a.includes("keydown");jo!==null&&(typeof i!="number"||!s)&&(clearTimeout(jo),jo=null);var l=()=>{try{var c=t.getState(),u=c.rootProps.accessibilityLayer!==!1;if(!u)return;var p=c.tooltip.keyboardInteraction,d=np;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var h=Hc(p,us(c),Ol(c),Nl(c)),m=h==null?-1:Number(h),g=!Number.isFinite(m)||m<0,v=Aa(c),x=us(c),y=cd(c,c.tooltip.settings.shared);if(d==="Enter"){if(g)return;var b=Xf(c,y,"hover",String(p.index));t.dispatch(Gf({active:!p.active,activeIndex:p.index,activeCoordinate:b}));return}var w=WQ(c),j=w==="left-to-right"?1:-1,k=d==="ArrowRight"?1:-1,S;if(g){var A=Ol(c),T=Nl(c),L=k*j,O=I=>({active:!1,index:String(I),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(S=-1,L>0){for(var R=0;R<x.length;R++)if(Hc(O(R),x,A,T)!=null){S=R;break}}else for(var _=x.length-1;_>=0;_--)if(Hc(O(_),x,A,T)!=null){S=_;break}if(S<0)return}else{S=m+k*j;var X=(v==null?void 0:v.length)||x.length;if(X===0||S>=X||S<0)return}var q=Xf(c,y,"hover",String(S));t.dispatch(Gf({active:!0,activeIndex:S.toString(),activeCoordinate:q}))}finally{Ls=null,jo=null}};if(!s){l();return}i==="raf"?Ls=requestAnimationFrame(l):typeof i=="number"&&jo===null&&(l(),np=null,jo=setTimeout(()=>{np?l():(jo=null,Ls=null)},i))}});Um.startListening({actionCreator:mL,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var a="0",s=cd(n,n.tooltip.settings.shared),l=Xf(n,s,"hover",String(a));t.dispatch(Gf({active:!0,activeIndex:a,activeCoordinate:l}))}}}});Um.startListening({actionCreator:gL,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;i.active&&t.dispatch(Gf({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function yL(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Lr=Ir("externalEvent"),vL=Hu(),rp=new Map,wc=new Map,ly=new Map;vL.startListening({actionCreator:Lr,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,s=yL(i);ly.set(a,{handler:r,reactEvent:s});var l=rp.get(a);l!==void 0&&(cancelAnimationFrame(l),rp.delete(a));var c=t.getState(),u=c.eventSettings,p=u.throttleDelay,d=u.throttledEvents,h=d,m=h==="all"||(h==null?void 0:h.includes(a)),g=wc.get(a);g!==void 0&&(typeof p!="number"||!m)&&(clearTimeout(g),wc.delete(a));var v=()=>{var b=ly.get(a);try{if(!b)return;var w=b.handler,j=b.reactEvent,k=t.getState(),S={activeCoordinate:KZ(k),activeDataKey:j1(k),activeIndex:ao(k),activeLabel:HR(k),activeTooltipIndex:ao(k),isTooltipActive:HZ(k)};w&&w(S,j)}finally{rp.delete(a),wc.delete(a),ly.delete(a)}};if(!m){v();return}if(p==="raf"){var x=requestAnimationFrame(v);rp.set(a,x)}else if(typeof p=="number"){if(!wc.has(a)){v();var y=setTimeout(v,p);wc.set(a,y)}}else v()}}});var tle=G([Gl],e=>e.tooltipItemPayloads),nle=G([tle,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),xL=Ir("touchMove"),bL=Hu(),So=null,Oa=null,FA=null,jc=null;bL.startListening({actionCreator:xL,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){jc=yL(n);var r=t.getState(),i=r.eventSettings,a=i.throttleDelay,s=i.throttledEvents,l=s==="all"||s.includes("touchmove");So!==null&&(cancelAnimationFrame(So),So=null),Oa!==null&&(typeof a!="number"||!l)&&(clearTimeout(Oa),Oa=null),FA=Array.from(n.touches).map(u=>Z1({clientX:u.clientX,clientY:u.clientY,currentTarget:n.currentTarget}));var c=()=>{if(jc!=null){var u=t.getState(),p=cd(u,u.tooltip.settings.shared);if(p==="axis"){var d,h=(d=FA)===null||d===void 0?void 0:d[0];if(h==null){So=null,Oa=null;return}var m=Q1(u,h);(m==null?void 0:m.activeIndex)!=null&&t.dispatch(NR({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate}))}else if(p==="item"){var g,v=jc.touches[0];if(document.elementFromPoint==null||v==null)return;var x=document.elementFromPoint(v.clientX,v.clientY);if(!x||!x.getAttribute)return;var y=x.getAttribute(jN),b=(g=x.getAttribute(SN))!==null&&g!==void 0?g:void 0,w=bs(u).find(S=>S.id===b);if(y==null||w==null||b==null)return;var j=w.dataKey,k=nle(u,y,b);t.dispatch(IR({activeDataKey:j,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:b}))}So=null,Oa=null}};if(!l){c();return}a==="raf"?So=requestAnimationFrame(c):typeof a=="number"&&Oa===null&&(c(),jc=null,Oa=setTimeout(()=>{jc?c():(Oa=null,So=null)},a))}}});var J1={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},wL=Xn({name:"eventSettings",initialState:J1,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=mt(t.payload.throttledEvents))}}}),rle=wL.actions.setEventSettings,ile=wL.reducer,ale=WO({brush:Ure,cartesianAxis:bre,chartData:FJ,errorBars:oae,eventSettings:ile,graphicalItems:kne,layout:rH,legend:i7,options:LJ,polarAxis:Ite,polarOptions:ele,referenceElements:Vre,renderedTicks:hie,rootProps:Gse,tooltip:tZ,zIndex:CJ}),ole=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return EK({reducer:ale,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([uL.middleware,dL.middleware,Um.middleware,vL.middleware,bL.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(iN({type:"raf"}))},devTools:{serialize:{replacer:Yse},name:"recharts-".concat(n)}})};function jL(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=Pn(),a=f.useRef(null);if(i)return n;a.current==null&&(a.current=ole(t,r));var s=ib;return f.createElement(P7,{context:s,store:a.current},n)}function sle(e){var t=e.layout,n=e.margin,r=Ct(),i=Pn();return f.useEffect(()=>{i||(r(eH(t)),r(JK(n)))},[r,i,t,n]),null}var SL=f.memo(sle,ys);function kL(e){var t=Ct();return f.useEffect(()=>{t(Xse(e))},[t,e]),null}var lle=e=>{var t=Ct();return f.useEffect(()=>{t(rle(e))},[t,e]),null},CL=f.memo(lle,ys);function UA(e){var t=e.zIndex,n=e.isPanorama,r=f.useRef(null),i=Ct();return f.useLayoutEffect(()=>(r.current&&i(SJ({zIndex:t,element:r.current,isPanorama:n})),()=>{i(kJ({zIndex:t,isPanorama:n}))}),[i,t,n]),f.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function WA(e){var t=e.children,n=e.isPanorama,r=Ie(hJ);if(!r||r.length===0)return t;var i=r.filter(s=>s<0),a=r.filter(s=>s>0);return f.createElement(f.Fragment,null,i.map(s=>f.createElement(UA,{key:s,zIndex:s,isPanorama:n})),t,a.map(s=>f.createElement(UA,{key:s,zIndex:s,isPanorama:n})))}var cle=["children"];function ule(e,t){if(e==null)return{};var n,r,i=dle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function oh(){return oh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oh.apply(null,arguments)}var ple={width:"100%",height:"100%",display:"block"},fle=f.forwardRef((e,t)=>{var n=hb(),r=mb(),i=MN();if(!Wi(n)||!Wi(r))return null;var a=e.children,s=e.otherAttributes,l=e.title,c=e.desc,u,p;return s!=null&&(typeof s.tabIndex=="number"?u=s.tabIndex:u=i?0:void 0,typeof s.role=="string"?p=s.role:p=i?"application":void 0),f.createElement(X0,oh({},s,{title:l,desc:c,role:p,tabIndex:u,width:n,height:r,style:ple,ref:t}),a)}),hle=e=>{var t=e.children,n=Ie(Jh);if(!n)return null;var r=n.width,i=n.height,a=n.y,s=n.x;return f.createElement(X0,{width:r,height:i,x:s,y:a},t)},KA=f.forwardRef((e,t)=>{var n=e.children,r=ule(e,cle),i=Pn();return i?f.createElement(hle,null,f.createElement(WA,{isPanorama:!0},n)):f.createElement(fle,oh({ref:t},r),f.createElement(WA,{isPanorama:!1},n))});function mle(e,t){return xle(e)||vle(e,t)||yle(e,t)||gle()}function gle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
487
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yle(e,t){if(e){if(typeof e=="string")return HA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HA(e,t):void 0}}function HA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function xle(e){if(Array.isArray(e))return e}function ble(){var e=Ct(),t=f.useState(null),n=mle(t,2),r=n[0],i=n[1],a=Ie(xH);return f.useEffect(()=>{if(r!=null){var s=r.getBoundingClientRect(),l=s.width/r.offsetWidth;et(l)&&l!==a&&e(nH(l))}},[r,e,a]),i}function VA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wle(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VA(Object(n),!0).forEach(function(r){jle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jle(e,t,n){return(t=Sle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sle(e){var t=kle(e,"string");return typeof t=="symbol"?t:t+""}function kle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function to(){return to=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},to.apply(null,arguments)}function sh(e,t){return Ele(e)||Ale(e,t)||Ple(e,t)||Cle()}function Cle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
488
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ple(e,t){if(e){if(typeof e=="string")return qA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qA(e,t):void 0}}function qA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ale(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Ele(e){if(Array.isArray(e))return e}var Tle=()=>(XJ(),null);function lh(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Ile=f.forwardRef((e,t)=>{var n,r,i=f.useRef(null),a=f.useState({containerWidth:lh((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:lh((r=e.style)===null||r===void 0?void 0:r.height)}),s=sh(a,2),l=s[0],c=s[1],u=f.useCallback((d,h)=>{c(m=>{var g=Math.round(d),v=Math.round(h);return m.containerWidth===g&&m.containerHeight===v?m:{containerWidth:g,containerHeight:v}})},[]),p=f.useCallback(d=>{if(typeof t=="function"&&t(d),i.current!=null&&(i.current.disconnect(),i.current=null),d!=null&&typeof ResizeObserver<"u"){var h=d.getBoundingClientRect(),m=h.width,g=h.height;u(m,g);var v=y=>{var b=y[0];if(b!=null){var w=b.contentRect,j=w.width,k=w.height;u(j,k)}},x=new ResizeObserver(v);x.observe(d),i.current=x}},[t,u]);return f.useEffect(()=>()=>{var d=i.current;d!=null&&d.disconnect()},[u]),f.createElement(f.Fragment,null,f.createElement(qu,{width:l.containerWidth,height:l.containerHeight}),f.createElement("div",to({ref:p},e)))}),Ole=f.forwardRef((e,t)=>{var n=e.width,r=e.height,i=f.useState({containerWidth:lh(n),containerHeight:lh(r)}),a=sh(i,2),s=a[0],l=a[1],c=f.useCallback((p,d)=>{l(h=>{var m=Math.round(p),g=Math.round(d);return h.containerWidth===m&&h.containerHeight===g?h:{containerWidth:m,containerHeight:g}})},[]),u=f.useCallback(p=>{if(typeof t=="function"&&t(p),p!=null){var d=p.getBoundingClientRect(),h=d.width,m=d.height;c(h,m)}},[t,c]);return f.createElement(f.Fragment,null,f.createElement(qu,{width:s.containerWidth,height:s.containerHeight}),f.createElement("div",to({ref:u},e)))}),Nle=f.forwardRef((e,t)=>{var n=e.width,r=e.height;return f.createElement(f.Fragment,null,f.createElement(qu,{width:n,height:r}),f.createElement("div",to({ref:t},e)))}),Mle=f.forwardRef((e,t)=>{var n=e.width,r=e.height;return typeof n=="string"||typeof r=="string"?f.createElement(Ole,to({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?f.createElement(Nle,to({},e,{width:n,height:r,ref:t})):f.createElement(f.Fragment,null,f.createElement(qu,{width:n,height:r}),f.createElement("div",to({ref:t},e)))});function Rle(e){return e?Ile:Mle}var _le=f.forwardRef((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,s=e.onContextMenu,l=e.onDoubleClick,c=e.onMouseDown,u=e.onMouseEnter,p=e.onMouseLeave,d=e.onMouseMove,h=e.onMouseUp,m=e.onTouchEnd,g=e.onTouchMove,v=e.onTouchStart,x=e.style,y=e.width,b=e.responsive,w=e.dispatchTouchEvents,j=w===void 0?!0:w,k=f.useRef(null),S=Ct(),A=f.useState(null),T=sh(A,2),L=T[0],O=T[1],R=f.useState(null),_=sh(R,2),X=_[0],q=_[1],I=ble(),$=pb(),H=($==null?void 0:$.width)>0?$.width:y,N=($==null?void 0:$.height)>0?$.height:i,W=f.useCallback(ne=>{I(ne),typeof t=="function"&&t(ne),O(ne),q(ne),ne!=null&&(k.current=ne)},[I,t,O,q]),P=f.useCallback(ne=>{S(cL(ne)),S(Lr({handler:a,reactEvent:ne}))},[S,a]),U=f.useCallback(ne=>{S(Sx(ne)),S(Lr({handler:u,reactEvent:ne}))},[S,u]),le=f.useCallback(ne=>{S(OR()),S(Lr({handler:p,reactEvent:ne}))},[S,p]),E=f.useCallback(ne=>{S(Sx(ne)),S(Lr({handler:d,reactEvent:ne}))},[S,d]),me=f.useCallback(()=>{S(mL())},[S]),ye=f.useCallback(()=>{S(gL())},[S]),Q=f.useCallback(ne=>{S(hL(ne.key))},[S]),ie=f.useCallback(ne=>{S(Lr({handler:s,reactEvent:ne}))},[S,s]),je=f.useCallback(ne=>{S(Lr({handler:l,reactEvent:ne}))},[S,l]),Z=f.useCallback(ne=>{S(Lr({handler:c,reactEvent:ne}))},[S,c]),re=f.useCallback(ne=>{S(Lr({handler:h,reactEvent:ne}))},[S,h]),pe=f.useCallback(ne=>{S(Lr({handler:v,reactEvent:ne}))},[S,v]),se=f.useCallback(ne=>{j&&S(xL(ne)),S(Lr({handler:g,reactEvent:ne}))},[S,j,g]),Re=f.useCallback(ne=>{S(Lr({handler:m,reactEvent:ne}))},[S,m]),ke=Rle(b);return f.createElement(e_.Provider,{value:L},f.createElement(XI.Provider,{value:X},f.createElement(ke,{width:H??(x==null?void 0:x.width),height:N??(x==null?void 0:x.height),className:yt("recharts-wrapper",r),style:wle({position:"relative",cursor:"default",width:H,height:N},x),onClick:P,onContextMenu:ie,onDoubleClick:je,onFocus:me,onBlur:ye,onKeyDown:Q,onMouseDown:Z,onMouseEnter:U,onMouseLeave:le,onMouseMove:E,onMouseUp:re,onTouchEnd:Re,onTouchMove:se,onTouchStart:pe,ref:W},f.createElement(Tle,null),n)))}),Lle=["width","height","responsive","children","className","style","compact","title","desc"];function Dle(e,t){if(e==null)return{};var n,r,i=zle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var PL=f.forwardRef((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,s=e.className,l=e.style,c=e.compact,u=e.title,p=e.desc,d=Dle(e,Lle),h=ir(d);return c?f.createElement(f.Fragment,null,f.createElement(qu,{width:n,height:r}),f.createElement(KA,{otherAttributes:h,title:u,desc:p},a)):f.createElement(_le,{className:s,style:l,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},f.createElement(KA,{otherAttributes:h,title:u,desc:p,ref:t},f.createElement(Jre,null,a)))});function kx(){return kx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kx.apply(null,arguments)}function YA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YA(Object(n),!0).forEach(function(r){Ble(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ble(e,t,n){return(t=Fle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fle(e){var t=Ule(e,"string");return typeof t=="symbol"?t:t+""}function Ule(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wle={top:5,right:5,bottom:5,left:5},Kle=$le({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Wle,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},J1),Wm=f.forwardRef(function(t,n){var r,i=pn(t.categoricalChartProps,Kle),a=t.chartName,s=t.defaultTooltipEventType,l=t.validateTooltipEventTypes,c=t.tooltipPayloadSearcher,u=t.categoricalChartProps,p={chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return f.createElement(jL,{preloadedState:{options:p},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},f.createElement(R_,{chartData:u.data}),f.createElement(SL,{layout:i.layout,margin:i.margin}),f.createElement(CL,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),f.createElement(kL,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),f.createElement(PL,kx({},i,{ref:n})))}),Hle=["axis"],Cx=f.forwardRef((e,t)=>f.createElement(Wm,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Hle,tooltipPayloadSearcher:dd,categoricalChartProps:e,ref:t})),Vle=["axis","item"],qle=f.forwardRef((e,t)=>f.createElement(Wm,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Vle,tooltipPayloadSearcher:dd,categoricalChartProps:e,ref:t}));function Yle(e){var t=Ct();return f.useEffect(()=>{t(Jse(e))},[t,e]),null}var Gle=["layout"];function Px(){return Px=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Px.apply(null,arguments)}function Xle(e,t){if(e==null)return{};var n,r,i=Qle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function GA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zle(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GA(Object(n),!0).forEach(function(r){Jle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jle(e,t,n){return(t=ece(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ece(e){var t=tce(e,"string");return typeof t=="symbol"?t:t+""}function tce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nce={top:5,right:5,bottom:5,left:5},AL=Zle({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:nce,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},J1),rce=f.forwardRef(function(t,n){var r,i=pn(t.categoricalChartProps,AL),a=i.layout,s=Xle(i,Gle),l=t.chartName,c=t.defaultTooltipEventType,u=t.validateTooltipEventTypes,p=t.tooltipPayloadSearcher,d={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:p,eventEmitter:void 0};return f.createElement(jL,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},f.createElement(R_,{chartData:i.data}),f.createElement(SL,{layout:a,margin:i.margin}),f.createElement(CL,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),f.createElement(kL,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),f.createElement(Yle,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),f.createElement(PL,Px({},s,{ref:n})))});function XA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function QA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XA(Object(n),!0).forEach(function(r){ice(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ice(e,t,n){return(t=ace(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ace(e){var t=oce(e,"string");return typeof t=="symbol"?t:t+""}function oce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sce=["item"],lce=QA(QA({},AL),{},{layout:"centric",startAngle:0,endAngle:360}),cce=f.forwardRef((e,t)=>{var n=pn(e,lce);return f.createElement(rce,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:sce,tooltipPayloadSearcher:dd,categoricalChartProps:n,ref:t})}),uce=["axis"],dce=f.forwardRef((e,t)=>f.createElement(Wm,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:uce,tooltipPayloadSearcher:dd,categoricalChartProps:e,ref:t})),pce=["axis"],fce=f.forwardRef((e,t)=>f.createElement(Wm,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:pce,tooltipPayloadSearcher:dd,categoricalChartProps:e,ref:t}));const hce={background:"var(--bg-card)",borderRadius:"16px",border:"1px solid var(--border-primary)",padding:"20px",marginTop:"24px"},mce={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",cursor:"pointer",fontSize:"13px"},cy={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"13px"};function ip(e){return e?e>=1e3?`${(e/1e3).toFixed(2)}s`:`${Math.round(e)}ms`:"-"}function Na(e){return e?Math.round(e).toLocaleString():"-"}function gce(e){return`${(e*100).toFixed(1)}%`}function yce(e,t){return e?e.slice(-t):[]}function vce(){const[e,t]=f.useState("service"),[n,r]=f.useState("ttft"),[i,a]=f.useState(24),[s,l]=f.useState("overview"),[c,u]=f.useState(null),[p,d]=f.useState(null),[h,m]=f.useState(null),[g,v]=f.useState(null),[x,y]=f.useState("desc"),[b,w]=f.useState([]),[j,k]=f.useState([]),[S,A]=f.useState(null),[T,L]=f.useState(null),[O,R]=f.useState(null),[_,X]=f.useState(!1),[q,I]=f.useState(null),$=f.useCallback(async()=>{X(!0),I(null);try{s==="overview"?e==="service"?w(await V.getPerformanceServicesOverview()||[]):k(await V.getPerformanceVendors()||[]):s==="vendor"&&c?A(await V.getPerformanceVendor(c)):s==="service"&&p?L(await V.getPerformanceService(p)):s==="model"&&p&&h&&R(await V.getPerformanceModel(p,h))}catch(ne){I((ne==null?void 0:ne.message)||"加载失败")}finally{X(!1)}},[e,s,c,p,h]);f.useEffect(()=>{$()},[$]);const H=ne=>{t(ne),l("overview"),u(null),d(null),m(null),A(null),L(null),R(null),v(null)},N=ne=>{u(ne),d(null),m(null),A(null),L(null),R(null),l("vendor"),v(null)},W=ne=>{d(ne),m(null),L(null),R(null),l("service"),v(null)},P=ne=>{m(ne),R(null),l("model"),v(null)},U=()=>{u(null),d(null),m(null),l("overview"),v(null)},le=()=>{d(null),m(null),L(null),l("vendor"),v(null)},E=f.useMemo(()=>s==="overview"&&e==="service"?b.map(ne=>({id:ne.serviceId,name:ne.serviceName||ne.serviceId,vendorName:ne.vendorName,derived:ne.derived,onClick:()=>W(ne.serviceId)})):s==="overview"&&e==="vendor"?j.map(ne=>({id:ne.vendorId,name:ne.vendorName||ne.vendorId,derived:ne.derived,onClick:()=>N(ne.vendorId)})):s==="vendor"&&S?S.services.map(ne=>({id:ne.serviceId,name:ne.serviceName||ne.serviceId,vendorName:S.vendorName,derived:ne.derived,onClick:()=>W(ne.serviceId)})):s==="service"&&T?T.models.map(ne=>({id:ne.model,name:ne.model,vendorName:T.vendorName,serviceName:T.serviceName,derived:ne.derived,onClick:()=>P(ne.model)})):[],[s,e,b,j,S,T]),me=f.useMemo(()=>{if(!g)return E;const ne=x==="asc"?1:-1;return[...E].sort((De,qe)=>{const ze=De.derived[g]??0,Ke=qe.derived[g]??0;return(ze-Ke)*ne})},[E,g,x]),ye=ne=>{g===ne?y(De=>De==="asc"?"desc":"asc"):(v(ne),y("desc"))},Q=ne=>g!==ne?" ⇅":x==="asc"?" ▲":" ▼",ie=(()=>{if(s==="vendor")return S==null?void 0:S.hourly;if(s==="service")return T==null?void 0:T.hourly;if(s==="model")return O==null?void 0:O.hourly})(),Z=yce(ie,i).map(ne=>n==="tokens"?{hour:ne.hour.slice(11),inputTokens:ne.inputTokens||0,outputTokens:ne.outputTokens||0,totalTokens:ne.totalTokens||0}:{hour:ne.hour.slice(11),value:n==="ttft"?ne.avgTtftMs:ne.avgTpm}),re=s==="overview"&&e==="service"||s==="vendor"||s==="service",pe=s==="service",se=s==="overview"&&e==="vendor"?"供应商":s==="service"?"模型":"API 服务",Re=n==="ttft"?"首 Token 返回时间":n==="tpm"?"吞吐 TPM":"Token量",ke=s==="model"?O==null?void 0:O.derived:void 0;return o.jsxs("div",{style:hce,children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",flexWrap:"wrap",gap:"8px"},children:[o.jsx("h3",{style:{margin:0,fontSize:"18px",color:"var(--text-primary)"},children:"⚡ 服务性能 / 测速统计"}),s!=="overview"&&o.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center",flexWrap:"wrap",fontSize:"13px"},children:[o.jsx("span",{onClick:U,style:uy,children:e==="service"?"全部 API 服务":"全部供应商"}),e==="vendor"&&c&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"›"}),s==="vendor"?o.jsx("span",{style:{color:"var(--text-primary)"},children:(S==null?void 0:S.vendorName)||c}):o.jsx("span",{onClick:le,style:uy,children:(S==null?void 0:S.vendorName)||c})]}),T&&(s==="service"||s==="model")&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"›"}),s==="service"?o.jsx("span",{style:{color:"var(--text-primary)"},children:T.serviceName||p}):o.jsx("span",{onClick:()=>{m(null),R(null),l("service"),v(null)},style:uy,children:T.serviceName||p})]}),h&&s==="model"&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"›"}),o.jsx("span",{style:{color:"var(--text-primary)"},children:h})]})]})]}),o.jsx("p",{style:{margin:"0 0 16px 0",color:"var(--text-muted)",fontSize:"13px"},children:"全局统计,与认证模式无关。首 Token 返回时间 = 请求发起到首个 token 的延迟;TPM = 生成阶段每分钟吐出的 token 数(基于真实流量被动采集)。"}),o.jsxs("div",{style:{display:"flex",gap:"12px",marginBottom:"16px",flexWrap:"wrap"},children:[s==="overview"&&o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"维度:"}),o.jsxs("select",{style:cy,value:e,onChange:ne=>H(ne.target.value),children:[o.jsx("option",{value:"service",children:"API 服务"}),o.jsx("option",{value:"vendor",children:"供应商"})]})]}),s!=="overview"&&o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"指标:"}),o.jsxs("select",{style:cy,value:n,onChange:ne=>r(ne.target.value),children:[o.jsx("option",{value:"ttft",children:"首 Token 返回时间"}),o.jsx("option",{value:"tpm",children:"吞吐 TPM"}),o.jsx("option",{value:"tokens",children:"Token量"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"时段:"}),o.jsxs("select",{style:cy,value:i,onChange:ne=>a(Number(ne.target.value)),children:[o.jsx("option",{value:24,children:"近 24 小时"}),o.jsx("option",{value:168,children:"近 7 天"}),o.jsx("option",{value:720,children:"近 30 天"})]})]}),o.jsx("button",{style:mce,onClick:$,children:"🔄 刷新"})]}),q&&o.jsx("div",{style:{color:"#e74c3c",marginBottom:"12px"},children:q}),(()=>{const ne=(re?1:0)+(pe?1:0),De=n==="tokens"?3:2,qe=1+ne+De+2;return o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:Si,children:se}),re&&o.jsx("th",{style:Si,children:"供应商"}),pe&&o.jsx("th",{style:Si,children:"API 服务"}),n==="tokens"?o.jsxs(o.Fragment,{children:[o.jsx("th",{style:Si,children:"输入Token"}),o.jsx("th",{style:Si,children:"输出Token"}),o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("totalTokens"),children:["总Token",Q("totalTokens")]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("avgTtftMs"),children:["平均首Token",Q("avgTtftMs")]}),o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("avgTpm"),children:["平均 TPM",Q("avgTpm")]})]}),o.jsx("th",{style:Si,children:"样本数"}),o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("successRate"),children:["成功率",Q("successRate")]})]})}),o.jsxs("tbody",{children:[_&&o.jsx("tr",{children:o.jsx("td",{style:_r,colSpan:qe,align:"center",children:"加载中..."})}),!_&&me.length===0&&o.jsx("tr",{children:o.jsx("td",{style:{..._r,color:"var(--text-muted)"},colSpan:qe,align:"center",children:"暂无数据"})}),!_&&me.map(ze=>o.jsxs("tr",{style:xce,children:[o.jsx("td",{style:_r,children:o.jsx("span",{style:{color:"var(--text-primary)",cursor:"pointer",textDecoration:"underline"},onClick:ze.onClick,children:ze.name})}),re&&o.jsx("td",{style:{..._r,color:"var(--text-muted)"},children:ze.vendorName||"-"}),pe&&o.jsx("td",{style:{..._r,color:"var(--text-muted)"},children:ze.serviceName||"-"}),n==="tokens"?o.jsxs(o.Fragment,{children:[o.jsx("td",{style:_r,children:ze.derived.totalInputTokens!=null?Na(ze.derived.totalInputTokens):"-"}),o.jsx("td",{style:_r,children:ze.derived.totalOutputTokens!=null?Na(ze.derived.totalOutputTokens):"-"}),o.jsx("td",{style:_r,children:ze.derived.totalTokens!=null?Na(ze.derived.totalTokens):"-"})]}):o.jsxs(o.Fragment,{children:[o.jsx("td",{style:_r,children:ip(ze.derived.avgTtftMs)}),o.jsx("td",{style:_r,children:ze.derived.count>0?Na(ze.derived.avgTpm):"-"})]}),o.jsx("td",{style:_r,children:ze.derived.count}),o.jsx("td",{style:_r,children:gce(ze.derived.successRate)})]},ze.id))]})]})})})(),s!=="overview"&&o.jsxs("div",{style:{marginTop:"24px"},children:[o.jsxs("h4",{style:{margin:"0 0 12px 0",fontSize:"15px",color:"var(--text-primary)"},children:[Re," · 按小时走势",ke&&n!=="tokens"&&o.jsxs("span",{style:{marginLeft:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["最小 ",n==="ttft"?ip(ke.minTtftMs):Na(ke.minTps?ke.minTps*60:void 0)," / 最大 ",n==="ttft"?ip(ke.maxTtftMs):Na(ke.maxTps?ke.maxTps*60:void 0)]})]}),Z.length===0?o.jsx("div",{style:{color:"var(--text-muted)",padding:"24px",textAlign:"center"},children:"暂无走势数据"}):o.jsx(Bs,{width:"100%",height:260,children:n==="tokens"?o.jsxs(fce,{data:Z,margin:{top:8,right:16,bottom:0,left:8},children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"perfTotalTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:"#667eea",stopOpacity:.35}),o.jsx("stop",{offset:"100%",stopColor:"#667eea",stopOpacity:.04})]})}),o.jsx(Uo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Wo,{dataKey:"hour",stroke:"var(--text-muted)",fontSize:12}),o.jsx(Ko,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(No,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px"},formatter:(ne,De)=>[Na(Number(ne)),De]}),o.jsx(tl,{wrapperStyle:{fontSize:12}}),o.jsx(ih,{type:"monotone",dataKey:"totalTokens",name:"总Token",stroke:"#667eea",strokeWidth:2,fill:"url(#perfTotalTokens)",dot:!1}),o.jsx(Zo,{type:"monotone",dataKey:"inputTokens",name:"输入Token",stroke:"#37d67a",strokeWidth:2,dot:!1}),o.jsx(Zo,{type:"monotone",dataKey:"outputTokens",name:"输出Token",stroke:"#f5a623",strokeWidth:2,dot:!1})]}):o.jsxs(Cx,{data:Z,margin:{top:8,right:16,bottom:0,left:8},children:[o.jsx(Uo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Wo,{dataKey:"hour",stroke:"var(--text-muted)",fontSize:12}),o.jsx(Ko,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(No,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px"},formatter:ne=>[n==="ttft"?ip(Number(ne)):Na(Number(ne)),Re]}),o.jsx(Zo,{type:"monotone",dataKey:"value",stroke:"#667eea",strokeWidth:2,dot:!1,name:Re})]})})]})]})}const Si={textAlign:"left",padding:"10px 12px",borderBottom:"2px solid var(--border-primary)",color:"var(--text-muted)",fontWeight:500,fontSize:"12px"},_r={padding:"10px 12px",borderBottom:"1px solid var(--border-primary)",color:"var(--text-primary)"},uy={color:"var(--text-primary)",cursor:"pointer",textDecoration:"underline",textDecorationColor:"transparent"},xce={transition:"background 0.15s"},ZA=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#f97316"];function bce(){const[e,t]=f.useState(null),[n,r]=f.useState(!0),[i,a]=f.useState(30);f.useEffect(()=>{s()},[i]);const s=async()=>{try{r(!0);const d=await V.getStatistics(i);t(d)}catch(d){console.error("Failed to load statistics:",d)}finally{r(!1)}},l=d=>d>=1e6?`${(d/1e6).toFixed(1)}M`:d>=1e3?`${(d/1e3).toFixed(1)}K`:d.toString(),c=d=>{if(d>=60){const h=Math.floor(d/60),m=d%60;return`${h}h ${m}m`}return`${d}m`};if(n)return o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"60vh"},children:o.jsx("div",{style:{fontSize:"18px",color:"var(--text-muted)"},children:"加载统计数据中..."})});if(!e)return o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"60vh"},children:o.jsx("div",{style:{fontSize:"18px",color:"var(--text-muted)"},children:"暂无统计数据"})});const u={"image-understanding":"图像理解","high-iq":"高智商","long-context":"长上下文",thinking:"思考模式",background:"后台任务","model-mapping":"模型顶替",default:"默认请求"},p=e.timeline.map(d=>({date:d.date,codingTime:Math.round(d.totalInputTokens/250+d.totalOutputTokens/100)}));return o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"},children:[o.jsxs("div",{children:[o.jsx("h1",{style:{margin:0,fontSize:"28px",fontWeight:"bold",color:"var(--text-primary)"},children:"📊 数据统计"}),o.jsx("p",{style:{margin:"4px 0 0 0",color:"var(--text-muted)"},children:"查看您的 AI 编程助手使用情况分析"})]}),o.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-primary)",fontWeight:"500"},children:"统计周期:"}),o.jsxs("select",{value:i,onChange:d=>a(Number(d.target.value)),style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"14px",cursor:"pointer"},children:[o.jsx("option",{value:7,children:"最近 7 天"}),o.jsx("option",{value:30,children:"最近 30 天"}),o.jsx("option",{value:90,children:"最近 90 天"})]}),o.jsx("button",{onClick:s,style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"14px",cursor:"pointer"},children:"🔄 刷新"})]})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:"16px",marginBottom:"24px"},children:[o.jsxs("div",{style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"总请求数"}),o.jsx("div",{style:{fontSize:"32px",fontWeight:"bold"},children:l(e.overview.totalRequests)})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"总 Tokens"}),o.jsx("div",{style:{fontSize:"32px",fontWeight:"bold"},children:l(e.overview.totalTokens)})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"编程时长"}),o.jsx("div",{style:{fontSize:"32px",fontWeight:"bold"},children:c(e.overview.totalCodingTime)})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #14a042 0%, #38f9d7 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"成功率"}),o.jsxs("div",{style:{fontSize:"32px",fontWeight:"bold"},children:[e.overview.successRate.toFixed(1),"%"]})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #fa709a 0%, #fee140 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"平均响应时间"}),o.jsxs("div",{style:{fontSize:"32px",fontWeight:"bold"},children:[e.overview.avgResponseTime.toFixed(2),"ms"]})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #30cfd0 0%, #330867 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"配置统计"}),o.jsxs("div",{style:{fontSize:"14px",marginTop:"8px"},children:[e.overview.totalVendors," 供应商 · ",e.overview.totalServices," 服务 · ",e.overview.totalRoutes," 路由"]})]})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))",gap:"20px",marginBottom:"24px"},children:[o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"📈 请求趋势"}),o.jsx(Bs,{width:"100%",height:300,children:o.jsxs(dce,{data:e.timeline,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"colorRequests",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#8884d8",stopOpacity:.8}),o.jsx("stop",{offset:"95%",stopColor:"#8884d8",stopOpacity:0})]})}),o.jsx(Uo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Wo,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>wt(d).format("MM/DD")}),o.jsx(Ko,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(No,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>wt(d).format("YYYY-MM-DD")}),o.jsx(tl,{}),o.jsx(ih,{type:"monotone",dataKey:"totalRequests",name:"请求数",stroke:"#8884d8",fillOpacity:1,fill:"url(#colorRequests)"})]})})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🔢 Token 使用趋势"}),o.jsx(Bs,{width:"100%",height:300,children:o.jsxs(Cx,{data:e.timeline,children:[o.jsx(Uo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Wo,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>wt(d).format("MM/DD")}),o.jsx(Ko,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d?l(Number(d)):""}),o.jsx(No,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>wt(d).format("YYYY-MM-DD"),formatter:d=>d?l(Number(d)):""}),o.jsx(tl,{}),o.jsx(Zo,{type:"monotone",dataKey:"totalInputTokens",name:"输入 Tokens",stroke:"#10b981",strokeWidth:2,dot:!1}),o.jsx(Zo,{type:"monotone",dataKey:"totalOutputTokens",name:"输出 Tokens",stroke:"#f59e0b",strokeWidth:2,dot:!1})]})})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"⏱️ 每日编程时长趋势"}),o.jsx(Bs,{width:"100%",height:300,children:o.jsxs(Cx,{data:p,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"colorCodingTime",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#8b5cf6",stopOpacity:.8}),o.jsx("stop",{offset:"95%",stopColor:"#8b5cf6",stopOpacity:0})]})}),o.jsx(Uo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Wo,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>wt(d).format("MM/DD")}),o.jsx(Ko,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d!=null?d>=60?`${Math.round(Number(d)/60)}h`:`${Number(d)}m`:""}),o.jsx(No,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>wt(d).format("YYYY-MM-DD"),formatter:d=>d!=null?c(Number(d)):""}),o.jsx(tl,{}),o.jsx(ih,{type:"monotone",dataKey:"codingTime",name:"编程时长",stroke:"#8b5cf6",fillOpacity:1,fill:"url(#colorCodingTime)"}),o.jsx(Zo,{type:"monotone",dataKey:"codingTime",name:"编程时长",stroke:"#8b5cf6",strokeWidth:3,dot:{fill:"#8b5cf6",r:4},activeDot:{r:6}})]})}),o.jsx("div",{style:{marginTop:"12px",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px",fontSize:"14px",color:"var(--text-muted)",textAlign:"center"},children:"💡 编程时长基于 tokens 估算(阅读速度 250 tokens/分钟,编码速度 100 tokens/分钟)"})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🏢 供应商使用分布"}),o.jsx(Bs,{width:"100%",height:300,children:o.jsxs(qle,{data:e.byVendor,children:[o.jsx(Uo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Wo,{dataKey:"vendorName",stroke:"var(--text-muted)",fontSize:12,angle:-45,textAnchor:"end",height:80}),o.jsx(Ko,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(No,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"}}),o.jsx(tl,{}),o.jsx(sL,{dataKey:"totalRequests",name:"请求数",fill:"#3b82f6"})]})})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"📋 请求类型分布"}),o.jsx(Bs,{width:"100%",height:300,children:o.jsxs(cce,{children:[o.jsx(I_,{data:e.contentTypeDistribution,cx:"50%",cy:"50%",labelLine:!0,label:d=>`${u[d.contentType]||d.contentType} (${d.percentage}%)`,outerRadius:80,fill:"#8884d8",dataKey:"count",children:e.contentTypeDistribution.map((d,h)=>o.jsx(pd,{fill:ZA[h%ZA.length]},`cell-${h}`))}),o.jsx(No,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},formatter:(d,h,m)=>{var b,w;const g=d??0,v=((b=m.payload)==null?void 0:b.percentage)??0,x=((w=m.payload)==null?void 0:w.contentType)||"",y=u[x]||x;return`${g} (${v}%) - ${y}`}})]})})]})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(400px, 1fr))",gap:"20px"},children:[o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🎯 按编程工具统计"}),o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--text-muted)",fontSize:"14px"},children:"类型"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"请求数"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"Tokens"})]})}),o.jsx("tbody",{children:e.byTargetType.map(d=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-secondary)"},children:[o.jsx("td",{style:{padding:"12px",color:"var(--text-primary)"},children:d.targetType==="claude-code"?"Claude Code":d.targetType==="opencode"?"OpenCode":"Codex"}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalTokens)})]},d.targetType))})]})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🤖 按模型统计"}),o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--text-muted)",fontSize:"14px"},children:"模型"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"请求数"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"Tokens"})]})}),o.jsx("tbody",{children:e.byModel.slice(0,10).map(d=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-secondary)"},children:[o.jsx("td",{style:{padding:"12px",color:"var(--text-primary)",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis"},children:d.modelName}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalTokens)})]},d.modelName))})]})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🔧 按服务商API服务统计"}),o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--text-muted)",fontSize:"14px"},children:"服务"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"请求数"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"Tokens"})]})}),o.jsx("tbody",{children:e.byService.slice(0,10).map(d=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-secondary)"},children:[o.jsxs("td",{style:{padding:"12px",color:"var(--text-primary)"},children:[o.jsx("div",{style:{fontSize:"14px",fontWeight:"bold"},children:d.serviceName}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)"},children:d.vendorName})]}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalTokens)})]},d.serviceId))})]})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"💰 Token 详细统计"}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"输入 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalInputTokens)})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"输出 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalOutputTokens)})]}),e.overview.totalCacheReadTokens>0&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"缓存读取 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalCacheReadTokens)})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"总计 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalTokens)})]}),o.jsxs("div",{style:{marginTop:"8px",padding:"12px",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",borderRadius:"8px",color:"white"},children:[o.jsx("div",{style:{fontSize:"12px",opacity:.9},children:"预估节省"}),o.jsxs("div",{style:{fontSize:"20px",fontWeight:"bold",marginTop:"4px"},children:["$",(e.overview.totalTokens/1e6*15).toFixed(2)]}),o.jsx("div",{style:{fontSize:"12px",opacity:.9,marginTop:"4px"},children:"按 $15/1M tokens 估算"})]})]})]})]}),o.jsx(vce,{})]})}function JA({isOpen:e,onClose:t,title:n,children:r,showCloseButton:i=!0,closeOnOverlayClick:a=!1,maxWidth:s="600px"}){return e?o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},onClick:l=>{a||l.stopPropagation()},children:[i&&o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:s,width:"90%"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:n})}),r]})})]}):null}const dy=e=>e==="claude-code"?"Claude Code":e==="opencode"?"OpenCode":"Codex";function wce(){const[e,t]=f.useState(!1),[n,r]=f.useState([]),[i,a]=f.useState(!0),[s,l]=f.useState({skillId:null,skillName:"",isDeleting:!1}),[c,u]=f.useState(!1),[p,d]=f.useState({name:"",description:"",instruction:"",link:"",targets:[]}),[h,m]=f.useState(!1),[g,v]=f.useState(!1),[x,y]=f.useState(""),[b,w]=f.useState(""),[j,k]=f.useState(!1),[S,A]=f.useState([]),[T,L]=f.useState(!1),[O,R]=f.useState({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}),_=async()=>{try{a(!0);const Q=await V.getInstalledSkills();r(Q)}catch(Q){console.error("Failed to load installed skills:",Q),K.error("加载已安装 Skills 失败")}finally{a(!1)}};f.useEffect(()=>{_()},[]);const X=async()=>{const Q=b.trim();if(!Q){K.warning("请输入需求描述后再搜索");return}try{k(!0),L(!0);const je=(await V.searchSkills(Q)).sort((Z,re)=>{const pe=Z.stars??0;return(re.stars??0)-pe});A(je)}catch(ie){console.error("Failed to search skills:",ie),K.error("搜索失败,请稍后重试")}finally{k(!1)}},q=Q=>{R({skill:Q,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},I=()=>{O.isInstalling||R({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},$=(Q,ie)=>{R(je=>({...je,selectedTargets:ie?[...je.selectedTargets,Q]:je.selectedTargets.filter(Z=>Z!==Q)}))},H=async()=>{var Q;if(O.skill)try{R(je=>({...je,isInstalling:!0,status:"preparing",message:"正在准备安装...",progress:0})),R(je=>({...je,status:"downloading",message:"正在从GitHub下载..."}));const ie=await V.installSkill(O.skill,O.selectedTargets[0]);if(ie.success){const je=O.selectedTargets,Z=(Q=ie.installedSkill)==null?void 0:Q.id;if(!Z){R(pe=>({...pe,status:"error",message:"安装返回数据异常"})),K.error("安装返回数据异常");return}let re=0;for(const pe of je)(await V.enableSkill(Z,pe)).success&&re++;R(pe=>({...pe,status:"completed",message:je.length>0?`安装完成!已启用 ${re}/${je.length} 个目标`:"安装完成!可在列表中启用目标",progress:100})),je.length>0?K.success(`已安装到 ${je.map(pe=>dy(pe)).join(", ")}`):K.success("安装完成!可在列表中启用目标"),await _()}else R(je=>({...je,status:"error",message:ie.message?`${ie.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试"})),K.error(ie.message?`${ie.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试")}catch(ie){console.error("Failed to install skill:",ie),R(je=>({...je,status:"error",message:"安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理"})),K.error("安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理")}finally{setTimeout(()=>{R(ie=>({...ie,skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}))},2e3)}},N=async(Q,ie,je)=>{try{je?(await V.enableSkill(Q,ie),K.success(`已启用 ${dy(ie)}`)):(await V.disableSkill(Q,ie),K.success(`已禁用 ${dy(ie)}`)),await _()}catch(Z){console.error("Failed to toggle skill:",Z),K.error("操作失败,请稍后重试")}},W=Q=>{l({skillId:Q.id,skillName:Q.name,isDeleting:!1})},P=()=>{s.isDeleting||l({skillId:null,skillName:"",isDeleting:!1})},U=async()=>{if(s.skillId)try{l(Q=>({...Q,isDeleting:!0})),await V.deleteSkill(s.skillId),K.success("已删除 Skill"),await _(),P()}catch(Q){console.error("Failed to delete skill:",Q),K.error("删除失败,请稍后重试"),l(ie=>({...ie,isDeleting:!1}))}},le=()=>{try{const Q=x.trim();if(!Q){K.error("请粘贴 SKILL.md 内容");return}let ie="",je="",Z=Q;if(Q.startsWith("---")){const re=Q.indexOf("---",3);if(re!==-1){const pe=Q.slice(3,re),se=Q.match(/^#\s+(.+)$/m);ie=se?se[1].trim():"";const Re=pe.split(`
489
+ `);for(const ke of Re)ke.startsWith("name:")?ie=ke.replace("name:","").trim():ke.startsWith("description:")&&(je=ke.replace("description:","").trim());Z=Q.slice(re+3).trim(),Z=Z.replace(/^##\s+指令\n*/,"").trim()}}else{const re=Q.match(/^#\s+(.+)$/m);re&&(ie=re[1].trim())}if(!ie){K.error("无法解析 Skill 名称");return}d(re=>({...re,name:ie,description:je||re.description,instruction:Z||re.instruction})),v(!1),y(""),K.success("解析成功")}catch(Q){console.error("Failed to parse skill:",Q),K.error("解析失败,请检查格式")}},E=async Q=>{var ie;if(Q.preventDefault(),!p.name.trim()){K.error("请填写 Skill 名称");return}if(!p.description.trim()){K.error("请填写描述");return}if(!p.instruction.trim()){K.error("请填写指令");return}try{m(!0);const je=await V.createLocalSkill({name:p.name.trim(),description:p.description.trim(),instruction:p.instruction.trim(),link:p.link.trim()||void 0,targets:p.targets});if(je.success){K.success("Skill 创建成功"),u(!1),d({name:"",description:"",instruction:"",link:"",targets:[]}),await _();for(const Z of p.targets)(ie=je.installedSkill)!=null&&ie.id&&await V.enableSkill(je.installedSkill.id,Z)}else K.error(je.message||"创建失败")}catch(je){console.error("Failed to create skill:",je),K.error("创建失败,请稍后重试")}finally{m(!1)}},me=()=>i?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在加载已安装 Skills..."})}):n.length===0?o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"当前没有检测到全局 Skills"}),o.jsx("span",{children:"你可以在“发现”中搜索并安装新的 Skills。"})]}):o.jsx("div",{className:"skills-grid",children:n.map(Q=>o.jsxs("div",{className:"card skill-card",style:{display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[o.jsx("div",{className:"skill-title",style:{flex:1},children:Q.name}),o.jsxs("div",{style:{display:"flex",gap:"8px",flexShrink:0},children:[Q.githubUrl&&o.jsx("a",{href:Q.githubUrl,target:"_blank",rel:"noopener noreferrer",className:"btn btn-secondary",style:{padding:"6px 12px",fontSize:"12px",textDecoration:"none",display:"inline-flex",alignItems:"center"},children:"查看详情"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>W(Q),style:{padding:"6px 12px",fontSize:"12px"},children:"删除"})]})]}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{className:"skill-description",children:Q.description||"暂无描述"}),o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(Q.installedAt).toLocaleDateString("zh-CN")]})]}),o.jsxs("div",{style:{marginTop:"auto",paddingTop:"16px",borderTop:"1px solid var(--border-color)",display:"flex",gap:"24px"},children:[o.jsx(Rg,{skillId:Q.id,targetType:"claude-code",enabled:Q.enabledTargets.includes("claude-code"),onChange:N}),o.jsx(Rg,{skillId:Q.id,targetType:"codex",enabled:Q.enabledTargets.includes("codex"),onChange:N}),o.jsx(Rg,{skillId:Q.id,targetType:"opencode",enabled:Q.enabledTargets.includes("opencode"),onChange:N})]})]},Q.id))}),ye=()=>o.jsxs("div",{className:"skills-discover",children:[o.jsxs("div",{className:"card skills-search-card",children:[o.jsxs("div",{className:"skills-search-header",children:[o.jsx("h3",{children:"描述你的需求,我会帮你找到你需要的 Skills"}),o.jsx("p",{children:"例如:帮我写 TypeScript 类型定义、自动生成测试用例、优化 React 性能"})]}),o.jsx("textarea",{rows:4,value:b,onChange:Q=>w(Q.target.value),placeholder:"请输入你的需求...",className:"skills-search-input"}),o.jsx("div",{className:"skills-search-actions",children:o.jsx("button",{className:"btn btn-primary",onClick:X,disabled:j,children:j?"搜索中...":"搜索"})})]}),o.jsxs("div",{className:"skills-results",children:[j&&o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在进行 AI 搜索..."})}),!j&&T&&S.length===0&&o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"没有找到匹配的 Skills"}),o.jsx("span",{children:"试试换个描述或添加更多细节。"})]}),!j&&S.length>0&&o.jsx("div",{className:"skills-grid",children:S.map(Q=>o.jsxs("div",{className:"card skill-card",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[o.jsx("div",{className:"skill-title",style:{flex:1},children:Q.name}),Q.stars!==void 0&&Q.stars>0&&o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",color:"#f39c12",fontSize:"14px",flexShrink:0},children:[o.jsx("span",{children:"⭐"}),o.jsx("span",{style:{fontWeight:"600"},children:Q.stars})]})]}),Q.tags&&Q.tags.length>0&&o.jsx("div",{className:"skill-tags",children:Q.tags.map(ie=>o.jsx("span",{className:"badge badge-secondary",children:ie},ie))}),o.jsx("div",{className:"skill-description",children:Q.description||"暂无描述"}),o.jsxs("div",{className:"skills-result-actions",children:[Q.url?o.jsx("a",{className:"btn btn-secondary",href:Q.url,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:"8px"},children:"查看"}):null,o.jsx("button",{className:"btn btn-secondary",onClick:()=>q(Q),children:"安装"})]})]},Q.id))})]})]});return o.jsxs("div",{children:[o.jsxs("div",{className:"skills-header-row",children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"Skills 管理"}),o.jsx("p",{children:"管理 Claude Code 与 Codex 的全局技能,并发现新的生产力增强 Skills。"})]}),o.jsxs("div",{className:"skills-header-actions",children:[!e&&o.jsx("button",{className:"btn btn-secondary skills-discover-btn",onClick:()=>u(!0),style:{marginRight:"8px"},children:"新增"}),o.jsx("button",{className:"btn btn-secondary skills-discover-btn",onClick:()=>t(Q=>!Q),children:e?"返回":"发现"})]})]}),e?ye():me(),O.skill&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:I,disabled:O.isInstalling,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"520px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:O.status==="idle"?"选择安装目标":O.status==="completed"?"安装完成":O.status==="error"?"安装失败":"正在安装"})}),o.jsx("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:O.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{style:{marginBottom:"12px",color:"var(--text-muted)"},children:["即将安装:",o.jsx("strong",{children:O.skill.name})]}),O.skill.description&&o.jsx("p",{style:{marginBottom:"12px",color:"var(--text-muted)",fontSize:"14px"},children:O.skill.description}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)",marginBottom:"12px"},children:"选择安装目标(可多选):"}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:O.selectedTargets.includes("claude-code"),onChange:Q=>$("claude-code",Q.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"Claude Code"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:O.selectedTargets.includes("codex"),onChange:Q=>$("codex",Q.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"Codex"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:O.selectedTargets.includes("opencode"),onChange:Q=>$("opencode",Q.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"OpenCode"})]})]})]})]}):o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsx("div",{style:{height:"8px",backgroundColor:"var(--bg-secondary)",borderRadius:"4px",overflow:"hidden",marginBottom:"16px"},children:o.jsx("div",{style:{width:`${O.progress}%`,height:"100%",backgroundColor:O.status==="error"?"var(--error-color)":"var(--primary-color)",transition:"width 0.3s ease"}})}),o.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",marginBottom:"8px"},children:O.message}),O.status==="error"&&o.jsx("p",{style:{textAlign:"center",color:"var(--error)",fontSize:"14px"},children:O.message})]})}),o.jsx("div",{className:"modal-footer",style:{justifyContent:O.status!=="idle"?"center":"space-between"},children:O.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"btn btn-secondary",onClick:I,disabled:O.isInstalling,children:"取消"}),o.jsx("button",{className:"btn btn-primary",onClick:H,disabled:O.isInstalling,children:"确定安装"})]}):O.status==="completed"||O.status==="error"?o.jsx("button",{className:"btn btn-primary",onClick:I,children:"关闭"}):o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("div",{className:"spinner",style:{width:"16px",height:"16px",border:"2px solid var(--bg-secondary)",borderTopColor:"var(--primary-color)",borderRadius:"50%"}}),o.jsx("span",{style:{color:"var(--text-muted)"},children:"正在处理..."})]})})]})})]}),s.skillId&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000001},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:P,disabled:s.isDeleting,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"400px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"确认删除"})}),o.jsxs("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:[o.jsxs("p",{style:{color:"var(--text-muted)"},children:["确定要删除 Skill ",o.jsx("strong",{children:s.skillName})," 吗?"]}),o.jsx("p",{style:{color:"var(--text-muted)",fontSize:"14px",marginTop:"8px"},children:"这将删除该Skill及其所有平台的软链接,且无法恢复。"})]}),o.jsxs("div",{className:"modal-footer",style:{justifyContent:"space-between"},children:[o.jsx("button",{className:"btn btn-secondary",onClick:P,disabled:s.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:U,disabled:s.isDeleting,children:s.isDeleting?"删除中...":"确认删除"})]})]})})]}),c&&o.jsx(JA,{isOpen:c,onClose:()=>u(!1),title:"新增 Skill",closeOnOverlayClick:!1,children:o.jsxs("form",{onSubmit:E,children:[o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[o.jsx("small",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"从其他来源复制的 SKILL.md 内容可直接粘贴解析"}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>v(!0),style:{padding:"6px 16px",fontSize:"13px"},children:"解析"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["名称 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsx("input",{type:"text",value:p.name,onChange:Q=>d(ie=>({...ie,name:Q.target.value})),placeholder:"输入 Skill 名称",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["描述 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsx("input",{type:"text",value:p.description,onChange:Q=>d(ie=>({...ie,description:Q.target.value})),placeholder:"简要描述这个 Skill 的功能",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["指令 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsx("small",{style:{display:"block",marginBottom:"8px",color:"#666",fontSize:"12px",lineHeight:"1.5"},children:"当这个 Skill 被触发时,你希望模型遵循哪些规则或信息"}),o.jsx("textarea",{value:p.instruction,onChange:Q=>d(ie=>({...ie,instruction:Q.target.value})),placeholder:`当这个 Skill 被触发时,你希望模型遵循哪些规则或信息,例如:
490
+ # codemap
491
+ ## 命令
492
+ ## 使用场景
493
+ ## 输出解释
494
+ ## 示例`,rows:10,style:{fontFamily:"monospace",fontSize:"13px"},required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"链接(可选)"}),o.jsx("input",{type:"url",value:p.link,onChange:Q=>d(ie=>({...ie,link:Q.target.value})),placeholder:"https://example.com 或 GitHub 仓库地址"}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"#666",fontSize:"12px"},children:"Skill 相关文档或资源链接"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["安装目标 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsxs("div",{style:{display:"flex",gap:"20px",marginTop:"8px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",whiteSpace:"nowrap"},children:[o.jsx("input",{type:"checkbox",checked:p.targets.includes("claude-code"),onChange:Q=>{Q.target.checked?d(ie=>({...ie,targets:[...ie.targets,"claude-code"]})):d(ie=>({...ie,targets:ie.targets.filter(je=>je!=="claude-code")}))}}),"Claude Code"]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:p.targets.includes("codex"),onChange:Q=>{Q.target.checked?d(ie=>({...ie,targets:[...ie.targets,"codex"]})):d(ie=>({...ie,targets:ie.targets.filter(je=>je!=="codex")}))}}),"Codex"]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:p.targets.includes("opencode"),onChange:Q=>{Q.target.checked?d(ie=>({...ie,targets:[...ie.targets,"opencode"]})):d(ie=>({...ie,targets:ie.targets.filter(je=>je!=="opencode")}))}}),"OpenCode"]})]})]}),o.jsx("div",{style:{marginTop:"16px",padding:"12px",background:"var(--bg-tertiary)",borderRadius:"8px"},children:o.jsxs("small",{style:{color:"var(--text-muted)",fontSize:"12px",lineHeight:"1.6"},children:["💡 提示:Skill 创建后,可通过 ",o.jsxs("code",{style:{background:"var(--bg-secondary)",padding:"2px 6px",borderRadius:"4px"},children:["~/.aicodeswitch/skills/",p.name||"skill-name"]})," 路径对 Skill 内容进行二次编辑"]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>u(!1),disabled:h,children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",disabled:h,children:h?"创建中...":"确认创建"})]})]})}),g&&o.jsxs(JA,{isOpen:g,onClose:()=>{v(!1),y("")},title:"解析 SKILL.md",closeOnOverlayClick:!1,children:[o.jsxs("div",{style:{padding:"20px"},children:[o.jsx("p",{style:{color:"var(--text-muted)",fontSize:"14px",marginBottom:"12px"},children:"直接粘贴从其他地方复制的 SKILL.md 内容,系统将自动解析填充到表单中。"}),o.jsx("textarea",{value:x,onChange:Q=>y(Q.target.value),placeholder:`---
495
+ name: skill-name
496
+ description: Skill 描述
497
+ ---
498
+
499
+ # Skill 名称
500
+
501
+ Skill 描述
502
+
503
+ ## 指令
504
+
505
+ 技能指令内容...`,rows:15,style:{width:"100%",fontFamily:"monospace",fontSize:"13px",padding:"12px",border:"1px solid var(--border-color)",borderRadius:"8px",background:"var(--bg-primary)",color:"var(--text-primary)",resize:"vertical"}})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{v(!1),y("")},children:"取消"}),o.jsx("button",{type:"button",className:"btn btn-primary",onClick:le,children:"解析并填充"})]})]})]})}const jce=[{id:"glm-vision",name:"GLM 视觉理解",description:"提供图像理解能力,支持多种视觉场景分析",type:"stdio",command:"npx",args:["-y","@z_ai/mcp-server"],env:{Z_AI_MODE:"ZHIPU"},apiKeyIn:"headers"},{id:"glm-web-search",name:"GLM 联网搜索",description:"提供网络搜索能力,实时获取最新信息",type:"http",url:"https://open.bigmodel.cn/api/mcp/web_search_prime/mcp",apiKeyIn:"headers"},{id:"glm-web-reader",name:"GLM 网页读取",description:"提供网页内容读取和解析能力",type:"http",url:"https://open.bigmodel.cn/api/mcp/web_reader/mcp",apiKeyIn:"headers"},{id:"glm-zread",name:"GLM 开源仓库",description:"提供开源仓库代码搜索和阅读能力",type:"http",url:"https://open.bigmodel.cn/api/mcp/zread/mcp",apiKeyIn:"headers"},{id:"minimax-coding-plan",name:"MiniMax Coding Plan",description:"提供网络搜索和图片理解能力",type:"stdio",command:"uvx",args:["-y","minimax-coding-plan-mcp"],env:{MINIMAX_API_HOST:"https://api.minimaxi.com"},apiKeyIn:"env",apiKeyEnvName:"MINIMAX_API_KEY"}];function Sce(){var X,q;const[e,t]=f.useState([]),[n,r]=f.useState(!0),[i,a]=f.useState(!1),[s,l]=f.useState(null),[c,u]=f.useState({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),[p,d]=f.useState(!1),[h,m]=f.useState({mcpId:null,mcpName:"",isDeleting:!1}),[g,v]=f.useState({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null}),x=async()=>{try{r(!0);const I=await V.getMCPs();t(I)}catch(I){console.error("Failed to load MCPs:",I),K.error("加载 MCP 工具失败")}finally{r(!1)}};f.useEffect(()=>{x()},[]);const y=()=>{l(null),u({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),a(!0)},b=I=>{l(I),u({name:I.name,description:I.description||"",type:I.type,command:I.command||"",args:I.args?I.args.join(" "):"",url:I.url||"",headers:I.headers?JSON.stringify(I.headers,null,2):"",env:I.env?JSON.stringify(I.env,null,2):"",targets:I.targets||[]}),a(!0)},w=()=>{p||(a(!1),l(null))},j=async I=>{var $,H;if(I.preventDefault(),!c.name.trim()){K.error("请填写 MCP 名称");return}if(c.type==="stdio"&&!c.command){K.error("请填写命令");return}if((c.type==="http"||c.type==="sse")&&!c.url){K.error("请填写 URL");return}try{d(!0);const N={},W={};if(c.env)try{Object.assign(N,JSON.parse(c.env))}catch{K.error("环境变量格式错误,请使用有效的 JSON 格式");return}if(c.headers)try{Object.assign(W,JSON.parse(c.headers))}catch{K.error("请求头格式错误,请使用有效的 JSON 格式");return}const P={name:c.name.trim(),description:c.description.trim(),type:c.type,command:($=c.command)==null?void 0:$.trim(),args:c.args?c.args.trim().split(/\s+/):void 0,url:(H=c.url)==null?void 0:H.trim(),headers:Object.keys(W).length>0?W:void 0,env:Object.keys(N).length>0?N:void 0,targets:c.targets};s?(await V.updateMCP(s.id,P),K.success("MCP 工具已更新")):(await V.createMCP(P),K.success("MCP 工具已添加")),a(!1),l(null),await x()}catch(N){console.error("Failed to save MCP:",N),K.error("保存失败,请稍后重试")}finally{d(!1)}},k=I=>{m({mcpId:I.id,mcpName:I.name,isDeleting:!1})},S=()=>{h.isDeleting||m({mcpId:null,mcpName:"",isDeleting:!1})},A=async()=>{if(h.mcpId)try{m(I=>({...I,isDeleting:!0})),await V.deleteMCP(h.mcpId),K.success("已删除 MCP 工具"),await x(),S()}catch(I){console.error("Failed to delete MCP:",I),K.error("删除失败,请稍后重试"),m($=>({...$,isDeleting:!1}))}},T=()=>{v({isOpen:!0,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},L=()=>{g.installingMCPName||v({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},O=I=>{v($=>({...$,step:"input-api-key",selectedDefinition:I}))},R=async()=>{var I;if(!g.apiKey.trim()){K.error("请填写 API Key");return}if(g.selectedDefinition)try{const $=g.selectedDefinition;v(me=>({...me,step:"installing",message:"正在安装...",installingMCPName:$.name}));const H=$.apiKeyEnvName||"Z_AI_API_KEY",N=$.apiKeyIn==="env",W=[];$.env&&Object.entries($.env).forEach(([me,ye])=>{ye!==void 0&&W.push([me,ye])}),N&&W.push([H,g.apiKey.trim()]);const P=W.length>0?Object.fromEntries(W):void 0,le=$.apiKeyIn==="headers"?{Authorization:`Bearer ${g.apiKey.trim()}`}:void 0,E={name:$.name,description:$.description,type:$.type,command:$.command,args:$.args,url:$.url,env:P,headers:le,targets:["claude-code","codex"]};await V.createMCP(E),v(me=>({...me,step:"completed",message:`成功安装 ${$.name}`,installingMCPName:null})),K.success(`已安装 ${$.name}`),await x()}catch($){console.error(`Failed to install ${(I=g.selectedDefinition)==null?void 0:I.id}:`,$),v(H=>({...H,step:"error",message:"安装失败,请稍后重试",installingMCPName:null})),K.error("安装失败,请稍后重试")}},_=I=>{switch(I){case"stdio":return"命令行";case"http":return"HTTP";case"sse":return"SSE";default:return I}};return o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsx("h1",{children:"MCP 管理"}),o.jsx("p",{children:"管理 Model Context Protocol (MCP) 工具,扩展 Claude Code 和 Codex 的能力"})]}),o.jsxs("div",{style:{display:"flex",gap:"12px"},children:[o.jsxs("button",{className:"btn btn-secondary",onClick:T,style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{children:"⚡"}),o.jsx("span",{children:"一键安装 MCP"})]}),o.jsx("button",{className:"btn btn-primary",onClick:y,children:"添加 MCP 工具"})]})]}),n?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在加载 MCP 工具..."})}):e.length===0?o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"当前没有安装 MCP 工具"}),o.jsx("span",{children:'你可以点击"添加 MCP 工具"或"一键安装 MCP"来添加工具。'})]}):o.jsx("div",{className:"mcp-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(400px, 1fr))",gap:"16px",marginTop:"24px"},children:e.map(I=>{var $,H,N,W;return o.jsxs("div",{className:"card mcp-card",style:{display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flex:1,minWidth:0},children:[o.jsx("div",{className:"mcp-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:I.name}),o.jsx("div",{className:"badge badge-secondary",children:_(I.type)})]}),o.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>b(I),style:{padding:"6px 14px",fontSize:"13px"},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>k(I),style:{padding:"6px 14px",fontSize:"13px"},children:"删除"})]})]}),I.description&&o.jsx("div",{className:"mcp-description",style:{marginTop:"12px",color:"var(--text-muted)",fontSize:"14px"},children:I.description}),o.jsxs("div",{style:{marginTop:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(I.createdAt).toLocaleDateString("zh-CN")]}),I.type==="stdio"&&I.command&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",fontFamily:"monospace",color:"var(--text-muted)"},children:["命令: ",I.command," ",($=I.args)==null?void 0:$.join(" ")]}),(I.type==="http"||I.type==="sse")&&I.url&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["URL: ",I.url]}),o.jsx("div",{style:{marginTop:"auto",paddingTop:"16px",borderTop:"1px solid var(--border-color)",display:"flex",alignItems:"center"},children:o.jsxs("div",{style:{display:"flex",gap:"24px"},children:[o.jsx(Yo,{checked:((H=I.targets)==null?void 0:H.includes("claude-code"))??!1,onChange:async P=>{const U=I.targets||[],le=P?[...U,"claude-code"]:U.filter(E=>E!=="claude-code");await V.updateMCP(I.id,{targets:le}),await x()},label:"Claude Code",labelPosition:"right"}),o.jsx(Yo,{checked:((N=I.targets)==null?void 0:N.includes("codex"))??!1,onChange:async P=>{const U=I.targets||[],le=P?[...U,"codex"]:U.filter(E=>E!=="codex");await V.updateMCP(I.id,{targets:le}),await x()},label:"Codex",labelPosition:"right"}),o.jsx(Yo,{checked:((W=I.targets)==null?void 0:W.includes("opencode"))??!1,onChange:async P=>{const U=I.targets||[],le=P?[...U,"opencode"]:U.filter(E=>E!=="opencode");await V.updateMCP(I.id,{targets:le}),await x()},label:"OpenCode",labelPosition:"right"})]})})]},I.id)})}),i&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:w,disabled:p,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"600px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:s?"编辑 MCP 工具":"添加 MCP 工具"})}),o.jsxs("form",{onSubmit:j,children:[o.jsxs("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:[o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-name",children:["MCP 名称 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"mcp-name",type:"text",value:c.name,onChange:I=>u({...c,name:I.target.value}),placeholder:"例如:GLM 视觉理解",disabled:p})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-description",children:"描述"}),o.jsx("textarea",{id:"mcp-description",rows:2,value:c.description,onChange:I=>u({...c,description:I.target.value}),placeholder:"描述该 MCP 工具的功能",disabled:p})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-type",children:["类型 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsxs("select",{id:"mcp-type",value:c.type,onChange:I=>u({...c,type:I.target.value}),disabled:p,children:[o.jsx("option",{value:"stdio",children:"命令行 (stdio)"}),o.jsx("option",{value:"http",children:"HTTP"}),o.jsx("option",{value:"sse",children:"SSE"})]})]}),c.type==="stdio"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-command",children:["命令 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"mcp-command",type:"text",value:c.command,onChange:I=>u({...c,command:I.target.value}),placeholder:"例如:npx",disabled:p})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-args",children:"参数(空格分隔)"}),o.jsx("input",{id:"mcp-args",type:"text",value:c.args,onChange:I=>u({...c,args:I.target.value}),placeholder:"例如:-y @z_ai/mcp-server",disabled:p})]})]}),(c.type==="http"||c.type==="sse")&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-url",children:["URL ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"mcp-url",type:"url",value:c.url,onChange:I=>u({...c,url:I.target.value}),placeholder:"例如:https://api.example.com/mcp",disabled:p})]}),(c.type==="http"||c.type==="sse")&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-headers",children:"请求头 (JSON)"}),o.jsx("textarea",{id:"mcp-headers",rows:3,value:c.headers,onChange:I=>u({...c,headers:I.target.value}),placeholder:'{\\n "Authorization": "Bearer your-token"\\n}',disabled:p,style:{fontFamily:"monospace",fontSize:"13px"}})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-env",children:"环境变量 (JSON)"}),o.jsx("textarea",{id:"mcp-env",rows:3,value:c.env,onChange:I=>u({...c,env:I.target.value}),placeholder:'{\\n "API_KEY": "your-key"\\n}',disabled:p,style:{fontFamily:"monospace",fontSize:"13px"}})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用目标"}),o.jsxs("div",{style:{display:"flex",gap:"16px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:c.targets.includes("claude-code"),onChange:I=>u({...c,targets:I.target.checked?[...c.targets,"claude-code"]:c.targets.filter($=>$!=="claude-code")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:p}),o.jsx("span",{children:"Claude Code"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:c.targets.includes("codex"),onChange:I=>u({...c,targets:I.target.checked?[...c.targets,"codex"]:c.targets.filter($=>$!=="codex")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:p}),o.jsx("span",{children:"Codex"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:c.targets.includes("opencode"),onChange:I=>u({...c,targets:I.target.checked?[...c.targets,"opencode"]:c.targets.filter($=>$!=="opencode")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:p}),o.jsx("span",{children:"OpenCode"})]})]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",type:"button",onClick:w,disabled:p,children:"取消"}),o.jsx("button",{className:"btn btn-primary",type:"submit",disabled:p,children:p?"保存中...":s?"保存":"添加"})]})]})]})})]}),h.mcpId&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000001},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:S,disabled:h.isDeleting,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"400px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"确认删除"})}),o.jsx("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:o.jsxs("p",{style:{color:"var(--text-muted)"},children:['确定要删除 MCP 工具 "',o.jsx("strong",{children:h.mcpName}),'" 吗?此操作无法撤销。']})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:S,disabled:h.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:A,disabled:h.isDeleting,children:h.isDeleting?"删除中...":"删除"})]})]})})]}),g.isOpen&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000002},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:L,disabled:g.installingMCPName!==null,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"700px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"一键安装 MCP 工具"})}),o.jsxs("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:[g.step==="select"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)",marginBottom:"20px"},children:"点击下方的卡片,快速安装 MCP 工具到您的系统中:"}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:"16px"},children:jce.map(I=>{const $=e.some(H=>H.name===I.name);return o.jsxs("div",{className:"card",style:{padding:"16px",cursor:$?"not-allowed":"pointer",transition:"all 0.2s ease",opacity:$?.7:1},onClick:()=>!$&&O(I),children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},children:[o.jsx("div",{style:{fontWeight:"600",fontSize:"16px"},children:I.name}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[$&&o.jsx("div",{className:"badge badge-success",style:{fontSize:"12px"},children:"已安装"}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"12px"},children:_(I.type)})]})]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-muted)",marginBottom:"12px"},children:I.description}),o.jsx("button",{className:"btn btn-primary",style:{width:"100%"},disabled:$,children:$?"已安装":"安装"})]},I.id)})})]}),g.step==="input-api-key"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{textAlign:"center",marginBottom:"16px"},children:[o.jsx("h3",{style:{fontSize:"18px",marginBottom:"8px"},children:(X=g.selectedDefinition)==null?void 0:X.name}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)"},children:(q=g.selectedDefinition)==null?void 0:q.description})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"quick-install-api-key",children:["API Key ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"quick-install-api-key",type:"password",value:g.apiKey,onChange:I=>v({...g,apiKey:I.target.value}),placeholder:"请输入您的 API Key",disabled:g.installingMCPName!==null,autoFocus:!0}),o.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px"},children:"API Key 将用于此 MCP 工具的认证。您可以访问相应的开放平台获取。"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>v(I=>({...I,step:"select",selectedDefinition:null})),disabled:g.installingMCPName!==null,children:"返回"}),o.jsx("button",{className:"btn btn-primary",onClick:R,disabled:g.installingMCPName!==null||!g.apiKey.trim(),children:g.installingMCPName?"安装中...":"开始安装"})]})]}),g.step==="installing"&&o.jsxs("div",{style:{padding:"20px 0",textAlign:"center"},children:[o.jsx("div",{className:"spinner",style:{width:"32px",height:"32px",margin:"0 auto 16px"}}),o.jsx("p",{style:{color:"var(--text-muted)"},children:g.message}),o.jsxs("p",{style:{fontSize:"14px",marginTop:"8px",color:"var(--text-muted)"},children:["正在安装 ",o.jsx("strong",{children:g.installingMCPName}),"..."]})]}),g.step==="completed"&&o.jsxs("div",{style:{padding:"20px 0",textAlign:"center"},children:[o.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"✅"}),o.jsx("p",{style:{fontSize:"16px",marginBottom:"8px"},children:g.message}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)"},children:"MCP 工具已启用到 Claude Code 和 Codex,您可以在列表中查看详情。"})]}),g.step==="error"&&o.jsxs("div",{style:{padding:"20px 0",textAlign:"center"},children:[o.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"❌"}),o.jsx("p",{style:{fontSize:"16px",marginBottom:"8px"},children:g.message})]})]}),o.jsx("div",{className:"modal-footer",style:{justifyContent:(g.step==="select"||g.step==="input-api-key","center")},children:(g.step==="completed"||g.step==="error")&&o.jsx("button",{className:"btn btn-primary",onClick:L,children:"关闭"})})]})})]})]})}function EL({keyName:e,apiKey:t,guide:n,onClose:r}){const i=a=>{navigator.clipboard.writeText(a).then(()=>K.success("已复制"))};return o.jsxs("div",{className:"modal-overlay",onClick:r,children:[o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"700px",padding:"28px"},onClick:a=>a.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:r,style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 4px",fontSize:"20px"},children:"📋 接入指引"}),o.jsxs("p",{style:{margin:"0 0 22px",color:"var(--text-tertiary)",fontSize:"13px"},children:["密钥「",e,"」的接入配置"]}),n?(()=>{const a=Object.values(n).flatMap(l=>Object.keys(l.envVars||{})),s=Math.max(...a.map(l=>l.length),0);return o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginBottom:"20px"},children:Object.entries(n).map(([l,c])=>{const u=Object.entries(c.envVars);return o.jsxs("div",{className:"ak-guide-section",children:[o.jsx("div",{className:"ak-guide-section-header",children:c.description}),o.jsx("div",{style:{padding:"14px 16px"},children:u.map(([p,d])=>o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0",marginBottom:"8px",fontSize:"13px"},children:[o.jsx("span",{className:"ak-guide-env-name",style:{minWidth:`${s*8.5}px`},children:p}),o.jsx("span",{style:{color:"var(--text-secondary)",margin:"0 8px"},children:"="}),o.jsx("code",{className:"ak-guide-env-value",children:d}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>i(d),style:{flexShrink:0,padding:"4px 8px",marginLeft:"8px"},children:"复制"})]},p))})]},l)})})})():o.jsxs("div",{style:{marginBottom:"20px",textAlign:"center",padding:"30px 0"},children:[o.jsx("div",{style:{fontSize:"36px",marginBottom:"8px"},children:"🔑"}),o.jsx("div",{style:{fontWeight:600,fontSize:"15px",marginBottom:"12px"},children:"API Key"}),o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:o.jsx("code",{style:{padding:"12px 16px",borderRadius:"8px",background:"var(--bg-primary-solid)",fontSize:"14px",fontFamily:'"SF Mono", "Fira Code", monospace',border:"2px dashed var(--color-primary)"},children:t})}),o.jsx("span",{style:{fontSize:"11px",color:"var(--text-tertiary)",display:"block",marginTop:"8px"},children:"完整 Key 仅在创建时展示,此处仅显示掩码"})]}),o.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:o.jsx("button",{onClick:r,className:"ak-modal-btn-secondary",children:"关闭"})})]}),o.jsx("style",{children:`
506
+ .ak-guide-section {
507
+ border-radius: 10px;
508
+ border: 1px solid var(--border-primary);
509
+ overflow: hidden;
510
+ background: var(--bg-primary-solid);
511
+ }
512
+ .ak-guide-section-header {
513
+ padding: 10px 16px;
514
+ border-bottom: 1px solid var(--border-primary);
515
+ background: var(--bg-secondary);
516
+ fontWeight: 600;
517
+ font-size: 14px;
518
+ }
519
+ .ak-guide-env-name {
520
+ color: var(--color-accent, #8b5cf6);
521
+ fontWeight: 600;
522
+ fontFamily: "SF Mono", "Fira Code", monospace;
523
+ flexShrink: 0;
524
+ }
525
+ .ak-guide-env-value {
526
+ flex: 1;
527
+ padding: 6px 10px;
528
+ border-radius: 5px;
529
+ background: var(--bg-secondary);
530
+ wordBreak: break-all;
531
+ fontSize: 12px;
532
+ fontFamily: "SF Mono", "Fira Code", monospace;
533
+ }
534
+ [data-theme="dark"] .ak-guide-section {
535
+ background: #0C1F12;
536
+ border-color: rgba(167, 243, 208, 0.15);
537
+ }
538
+ [data-theme="dark"] .ak-guide-section-header {
539
+ background: rgba(30, 58, 40, 0.95);
540
+ border-color: rgba(167, 243, 208, 0.15);
541
+ }
542
+ [data-theme="dark"] .ak-guide-env-value {
543
+ background: rgba(30, 58, 40, 0.95);
544
+ }
545
+ `})]})}function kce(){const[e,t]=f.useState([]),[n,r]=f.useState([]),[i,a]=f.useState([]),[s,l]=f.useState([]),[c,u]=f.useState([]),[p,d]=f.useState(0),[h,m]=f.useState(1),g=20,[v,x]=f.useState(!0),[y,b]=f.useState(""),[w,j]=f.useState(""),[k,S]=f.useState(new Set),[A,T]=f.useState(!1),[L,O]=f.useState(null),[R,_]=f.useState(""),[X,q]=f.useState(""),[I,$]=f.useState(""),[H,N]=f.useState(!1),[W,P]=f.useState(()=>localStorage.getItem("policies-panel-open")==="true"),[U,le]=f.useState(null),[E,me]=f.useState(!1),[ye,Q]=f.useState(""),[ie,je]=f.useState(""),[Z,re]=f.useState("system"),[pe,se]=f.useState(""),[Re,ke]=f.useState(""),[ne,De]=f.useState(""),[qe,ze]=f.useState(""),[Ke,pt]=f.useState(""),[Ye,Qe]=f.useState([]),[Ze,tt]=f.useState([]),[J,Y]=f.useState("none"),[ue,M]=f.useState(""),[fe,ee]=f.useState([]),[xe,Se]=f.useState(!1),Le=f.useRef(null),{confirm:$e}=$u(),He=f.useRef(null);f.useEffect(()=>{if(!H)return;const B=z=>{He.current&&!He.current.contains(z.target)&&N(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[H]);const Oe=async()=>{x(!0);try{const B=await V.getAccessKeys({page:h,pageSize:g,status:y||void 0,search:w||void 0});t(B.data),d(B.total)}catch(B){K.error("加载密钥列表失败: "+B.message)}finally{x(!1)}},Xe=async()=>{try{const[B,z,Pe]=await Promise.all([V.getPolicies().catch(()=>[]),V.getRoutes().catch(()=>[]),V.getPolicyTemplates().catch(()=>[])]);r(B),a(z),l(Pe)}catch{}};f.useEffect(()=>{Oe()},[h,y,w]),f.useEffect(()=>{Xe()},[]),f.useEffect(()=>{V.getWriteLocalRecords().then(u).catch(()=>{})},[e]);const D=async()=>{if(!R.trim()){K.error("请输入密钥名称");return}try{const B=await V.createAccessKey({name:R.trim(),remark:X||void 0,policyId:I||void 0});T(!1),O(B),_(""),q(""),$(""),Oe()}catch(B){K.error("创建失败: "+B.message)}},ge=async B=>{try{await V.updateAccessKey(B.id,{status:B.status==="active"?"disabled":"active"}),K.success(B.status==="active"?"已停用":"已启用"),Oe()}catch(z){K.error("操作失败: "+z.message)}},F=async B=>{if(await $e({message:`确定删除密钥「${B.name}」吗?`}))try{await V.deleteAccessKey(B.id),K.success("已删除"),Oe()}catch(Pe){K.error("删除失败: "+Pe.message)}},de=async B=>{if(await $e({message:"重新生成后旧密钥将立即失效,确定继续吗?"}))try{const Pe=await V.regenerateAccessKey(B.id);O({key:{...B,apiKey:Pe.apiKey},apiKey:Pe.apiKey}),Oe()}catch(Pe){K.error("重新生成失败: "+Pe.message)}},[ve,Ae]=f.useState(null),Ee=async B=>{try{const z=await V.getAccessKeyGuide(B.id);Ae({key:B,guide:z})}catch(z){K.error("获取指引失败: "+z.message)}},Ge=async B=>{if(k.size!==0)try{await V.batchUpdateAccessKeyStatus(Array.from(k),B),K.success(`已批量${B==="active"?"启用":"停用"} ${k.size} 个密钥`),S(new Set),N(!1),Oe()}catch(z){K.error("批量操作失败: "+z.message)}},nt=async()=>{if(!(k.size===0||!await $e({message:`确定删除选中的 ${k.size} 个密钥吗?`})))try{await V.batchDeleteAccessKeys(Array.from(k)),K.success(`已删除 ${k.size} 个密钥`),S(new Set),N(!1),Oe()}catch(z){K.error("批量删除失败: "+z.message)}},at=async B=>{if(!(k.size===0||!B))try{await V.batchBindAccessKeyPolicy(Array.from(k),B),K.success("已批量绑定策略"),S(new Set),N(!1),Oe()}catch(z){K.error("批量绑定失败: "+z.message)}},Je=B=>{const z=new Set(k);z.has(B)?z.delete(B):z.add(B),S(z)},nn=()=>S(k.size===e.length?new Set:new Set(e.map(B=>B.id))),Kt=B=>navigator.clipboard.writeText(B).then(()=>K.success("已复制")),ut=()=>{Q(""),je(""),re(""),se(""),ke(""),De(""),ze(""),pt(""),Qe([]),tt([]),Y("none"),M("")},Ht=B=>{var z,Pe,ot,Ue,St,rn,yi;B?(le(B),Q(B.name),je(B.description||""),re(B.routeId||"system"),se(((z=B.dailyTokenLimit)==null?void 0:z.toString())||""),ke(((Pe=B.monthlyTokenLimit)==null?void 0:Pe.toString())||""),De(((ot=B.dailyRequestLimit)==null?void 0:ot.toString())||""),ze(((Ue=B.rpmLimit)==null?void 0:Ue.toString())||""),pt(((St=B.concurrentLimit)==null?void 0:St.toString())||""),Qe(B.allowedModels||[]),tt(B.blockedModels||[]),Y((rn=B.allowedModels)!=null&&rn.length?"allow":(yi=B.blockedModels)!=null&&yi.length?"block":"none")):(le(null),ut()),me(!0),Jt()},Jt=async()=>{try{const B=await V.getVendors(),z=new Map;(B||[]).forEach(Pe=>{const ot=Pe.name||"";(Pe.services||[]).forEach(Ue=>{(Ue.supportedModels||[]).forEach(St=>{z.has(St)||z.set(St,new Set),z.get(St).add(ot)})})}),ee(Array.from(z.entries()).map(([Pe,ot])=>({name:Pe,vendors:Array.from(ot)})).sort((Pe,ot)=>Pe.name.localeCompare(ot.name)))}catch{}},It=J==="allow"?Ye:Ze,Pt=ue.trim()?fe.filter(B=>B.name.toLowerCase().includes(ue.toLowerCase())&&!It.includes(B.name)):fe.filter(B=>!It.includes(B.name)),gi=B=>{var Pe,ot,Ue,St,rn;const z=B.config;Q(z.name||""),je(B.description),se(((Pe=z.dailyTokenLimit)==null?void 0:Pe.toString())||""),ke(((ot=z.monthlyTokenLimit)==null?void 0:ot.toString())||""),De(((Ue=z.dailyRequestLimit)==null?void 0:Ue.toString())||""),ze(((St=z.rpmLimit)==null?void 0:St.toString())||""),pt(((rn=z.concurrentLimit)==null?void 0:rn.toString())||""),K.success(`已应用模板: ${B.name}`)},Xi=async()=>{if(!ye.trim()){K.error("请输入策略名称");return}const B={name:ye.trim(),description:ie||void 0,routeId:Z==="system"?"system":Z||void 0,dailyTokenLimit:pe?Number(pe):void 0,monthlyTokenLimit:Re?Number(Re):void 0,dailyRequestLimit:ne?Number(ne):void 0,rpmLimit:qe?Number(qe):void 0,concurrentLimit:Ke?Number(Ke):void 0,allowedModels:J==="allow"?Ye:void 0,blockedModels:J==="block"?Ze:void 0};try{U?(await V.updatePolicy(U.id,B),K.success("策略已更新")):(await V.createPolicy(B),K.success("策略已创建")),me(!1),Xe(),Oe()}catch(z){K.error("保存失败: "+z.message)}},Ea=async B=>{if(B.keyCount&&B.keyCount>0){K.error(`有 ${B.keyCount} 个密钥正在使用此策略,请先解除绑定`);return}if(await $e({message:`确定删除策略「${B.name}」吗?`}))try{await V.deletePolicy(B.id),K.success("已删除"),Xe(),Oe()}catch(Pe){K.error("删除失败: "+Pe.message)}},ce=async B=>{try{await V.duplicatePolicy(B.id),K.success("已复制"),Xe()}catch(z){K.error("复制失败: "+z.message)}},_t=(B,z)=>{const Pe=ue.trim();Pe&&!B.includes(Pe)&&(z([...B,Pe]),M(""))},Tn=B=>{var z;return(z=i.find(Pe=>Pe.id===B))==null?void 0:z.name},cr=B=>{const z=[];return B.dailyTokenLimit&&z.push(`日${B.dailyTokenLimit}k`),B.monthlyTokenLimit&&z.push(`月${B.monthlyTokenLimit}k`),B.dailyRequestLimit&&z.push(`日${B.dailyRequestLimit}次`),B.rpmLimit&&z.push(`RPM ${B.rpmLimit}`),B.concurrentLimit&&z.push(`并发${B.concurrentLimit}`),z.length>0?z.join(", "):"无限制"},Qi=Math.ceil(p/g),sn={padding:"6px 10px",borderRadius:"4px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",boxSizing:"border-box",fontSize:"13px"};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"},children:[o.jsx("h2",{style:{margin:0},children:"API Key"}),o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>{T(!0),Xe()},style:{height:"45px"},children:"+ 创建密钥"}),o.jsxs("button",{className:`btn ${W?"btn-primary":"btn-secondary"}`,onClick:()=>{const B=!W;P(B),localStorage.setItem("policies-panel-open",String(B)),B&&Xe()},style:{height:"45px",display:"inline-flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{children:"📜 策略管理"}),n.length>0&&o.jsxs("span",{children:["(",n.length,")"]}),o.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"50%",border:"2px solid #fff",background:W?"var(--color-success, #22c55e)":"transparent",flexShrink:0,transition:"all 0.25s"},children:W&&o.jsx("span",{style:{color:"#fff",fontSize:"12px",lineHeight:1},children:"✓"})})]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"0",minHeight:0},children:[o.jsx("div",{style:{flex:1,minWidth:0,transition:"margin-right 0.35s ease",marginRight:W?"24px":"0"},children:o.jsxs("div",{className:"card",style:{marginBottom:"0"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsxs("select",{value:y,onChange:B=>{b(B.target.value),m(1)},style:sn,children:[o.jsx("option",{value:"",children:"全部状态"}),o.jsx("option",{value:"active",children:"启用"}),o.jsx("option",{value:"disabled",children:"停用"})]}),o.jsx("input",{type:"text",placeholder:"搜索名称或备注...",value:w,onChange:B=>{j(B.target.value),m(1)},style:{...sn,minWidth:"200px"}})]}),k.size>0&&o.jsxs("div",{ref:He,style:{position:"relative",flexShrink:0},children:[o.jsxs("button",{className:"ak-action-btn",onClick:()=>N(!H),children:["批量操作 (",k.size,") ▾"]}),H&&o.jsxs("div",{className:"ak-dropdown-menu",children:[o.jsx("button",{className:"dropdown-btn",onClick:()=>Ge("active"),children:"批量启用"}),o.jsx("button",{className:"dropdown-btn",onClick:()=>Ge("disabled"),children:"批量停用"}),o.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid var(--border-primary)"}}),o.jsxs("select",{style:{width:"100%",border:"none",background:"none",padding:"6px 10px",cursor:"pointer",color:"var(--text-primary)"},onChange:B=>{B.target.value&&at(B.target.value)},children:[o.jsx("option",{value:"",children:"批量绑定策略..."}),n.map(B=>o.jsx("option",{value:B.id,children:B.name},B.id))]}),o.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid var(--border-primary)"}}),o.jsx("button",{className:"dropdown-btn",style:{color:"var(--color-danger)"},onClick:nt,children:"批量删除"})]})]})]}),v?o.jsx("div",{style:{textAlign:"center",padding:"40px"},children:"加载中..."}):o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"10px 12px",textAlign:"left",width:32},children:o.jsx("input",{type:"checkbox",checked:k.size===e.length&&e.length>0,onChange:nn})}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left"},children:"名称"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left"},children:"API Key"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left"},children:"策略"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"center",width:60},children:"状态"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left",minWidth:90},children:"创建时间"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left",minWidth:90},children:"最后活跃"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"center",width:120},children:"操作"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:8,style:{padding:"40px",textAlign:"center",color:"var(--text-tertiary)"},children:p===0?"暂无密钥,点击「创建密钥」开始":"无匹配结果"})}):e.map(B=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("td",{style:{padding:"10px 12px"},children:o.jsx("input",{type:"checkbox",checked:k.has(B.id),onChange:()=>Je(B.id)})}),o.jsxs("td",{style:{padding:"10px 12px"},children:[o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[o.jsx("a",{href:`#/access-keys/${B.id}`,style:{color:"var(--color-primary)",textDecoration:"none",fontWeight:500},children:B.name}),(()=>{const z=c.find(Pe=>Pe.accessKeyId===B.id);return z?z.targets.map(Pe=>o.jsx("span",{style:{display:"inline-block",padding:"1px 6px",borderRadius:"8px",fontSize:"11px",lineHeight:"16px",background:Pe==="claude-code"?"#cc7832":"#000",color:"#fff"},children:Pe==="claude-code"?"Claude Code":"Codex"},Pe)):null})()]}),B.remark&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:B.remark})]}),o.jsx("td",{style:{padding:"10px 12px"},children:o.jsx("code",{style:{fontSize:"12px",background:"var(--bg-secondary)",padding:"2px 6px",borderRadius:"3px"},children:B.apiKey})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px"},children:B.policyName||o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"未配置"})}),o.jsx("td",{style:{padding:"10px 12px",textAlign:"center"},children:o.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:B.status==="active"?"#22c55e":"var(--text-tertiary)"},title:B.status==="active"?"启用":"停用"})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:new Date(B.createdAt).toLocaleDateString()}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:B.lastActiveAt?new Date(B.lastActiveAt).toLocaleDateString():"-"}),o.jsx("td",{style:{padding:"10px 12px",textAlign:"center"},children:o.jsxs("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:[o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>Ee(B),title:"接入指引",children:"📋"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>ge(B),title:B.status==="active"?"停用":"启用",children:B.status==="active"?"⏸":"▶"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>de(B),title:"重新生成",children:"🔄"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>F(B),title:"删除",children:"✕"})]})})]},B.id))})]})}),Qi>1&&o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"8px",marginTop:"16px"},children:[o.jsx("button",{className:"btn btn-sm",disabled:h<=1,onClick:()=>m(h-1),children:"‹"}),o.jsxs("span",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:[h,"/",Qi," · 共 ",p," 个"]}),o.jsx("button",{className:"btn btn-sm",disabled:h>=Qi,onClick:()=>m(h+1),children:"›"})]})]})}),o.jsx("div",{style:{width:W?"480px":"0",overflow:"hidden",transition:"width 0.35s ease, opacity 0.35s ease",opacity:W?1:0,flexShrink:0},children:o.jsx("div",{style:{width:"480px",height:"100%"},children:o.jsxs("div",{className:"card",style:{height:"100%",marginBottom:"0",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:"16px",marginBottom:"16px",borderBottom:"1px solid var(--border-primary)",flexShrink:0},children:[o.jsx("h4",{style:{margin:0,fontSize:"16px"},children:"📜 策略管理"}),o.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>Ht(),children:"+ 创建策略"})]}),o.jsx("div",{style:{overflowY:"auto",flex:1},children:n.length===0?o.jsxs("div",{style:{textAlign:"center",padding:"40px 0",color:"var(--text-tertiary)",fontSize:"14px"},children:["暂无策略",o.jsx("br",{}),"点击「创建策略」开始配置"]}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:n.map(B=>o.jsxs("div",{style:{padding:"16px",borderRadius:"12px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:600,fontSize:"14px",marginBottom:"2px"},children:["📋 ",B.name]}),B.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"12px"},children:B.description})]}),o.jsxs("div",{style:{display:"flex",gap:"4px"},children:[o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>Ht(B),children:"编辑"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>ce(B),children:"复制"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>Ea(B),children:"删除"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"16px",fontSize:"12px",color:"var(--text-secondary)"},children:[o.jsxs("span",{children:["🔗 路由: ",B.routeId&&B.routeId!=="system"?Tn(B.routeId)||o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"未绑定"}):o.jsx("span",{style:{color:"var(--accent-color, #4a90d9)"},children:"按系统默认"})]}),o.jsxs("span",{children:["🔑 Key: ",B.keyCount||0]}),o.jsxs("span",{children:["📊 配额: ",cr(B)]})]})]},B.id))})})]})})})]}),A&&o.jsx("div",{className:"modal-overlay",onClick:()=>T(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"480px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>T(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 6px",fontSize:"20px"},children:"创建接入密钥"}),o.jsx("p",{style:{margin:"0 0 20px",color:"var(--text-tertiary)",fontSize:"13px"},children:"生成一个以 sk_ 开头的 API Key,分发给团队成员使用"}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["名称 ",o.jsx("span",{style:{color:"var(--color-danger)"},children:"*"})]}),o.jsx("input",{type:"text",value:R,onChange:B=>_(B.target.value),placeholder:"例如:张三 - 前端组",autoFocus:!0,style:{...sn,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px"}})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["备注 ",o.jsx("span",{style:{color:"var(--text-tertiary)",fontWeight:400,fontSize:"12px"},children:"(可选)"})]}),o.jsx("textarea",{value:X,onChange:B=>q(B.target.value),placeholder:"补充说明信息",style:{...sn,width:"100%",padding:"10px 14px",minHeight:"52px",fontSize:"14px",borderRadius:"8px",resize:"vertical"}})]}),o.jsxs("div",{style:{marginBottom:"24px"},children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["策略 ",o.jsx("span",{style:{color:"var(--text-tertiary)",fontWeight:400,fontSize:"12px"},children:"(可选)"})]}),o.jsxs("select",{value:I,onChange:B=>$(B.target.value),style:{...sn,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"",children:"稍后配置"}),n.map(B=>o.jsx("option",{value:B.id,children:B.name},B.id))]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>T(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:D,className:"ak-modal-btn-primary",children:"创建密钥"})]})]})}),L&&o.jsx("div",{className:"modal-overlay",onClick:()=>O(null),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>O(null),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsxs("div",{style:{textAlign:"center",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"40px",marginBottom:"8px"},children:"🔑"}),o.jsx("h3",{style:{margin:"0",fontSize:"20px",color:"#22c55e"},children:"密钥创建成功"})]}),o.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"16px",border:"2px dashed #22c55e",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"1px"},children:"API Key"}),o.jsx("code",{style:{display:"block",fontSize:"16px",wordBreak:"break-all",lineHeight:1.6,fontFamily:'"SF Mono", "Fira Code", monospace',color:"var(--text-primary)"},children:L.apiKey})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[o.jsx("button",{onClick:()=>Kt(L.apiKey),className:"ak-modal-btn-primary",children:"📋 复制 Key"}),o.jsx("button",{onClick:()=>O(null),className:"ak-modal-btn-secondary",children:"完成"})]})]})}),E&&o.jsx("div",{className:"modal-overlay",onClick:()=>me(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>me(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 4px",fontSize:"20px"},children:U?"编辑策略":"创建策略"}),o.jsx("p",{style:{margin:"0 0 22px",color:"var(--text-tertiary)",fontSize:"13px"},children:"配置路由、配额限制和模型过滤规则,多个密钥可复用同一策略"}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"18px"},children:[o.jsxs("div",{children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["名称 ",o.jsx("span",{style:{color:"var(--color-danger)"},children:"*"})]}),o.jsx("input",{type:"text",value:ye,onChange:B=>Q(B.target.value),placeholder:"例如:中度限制策略",style:{...sn,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px"}})]}),o.jsxs("div",{children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["描述 ",o.jsx("span",{style:{color:"var(--text-tertiary)",fontWeight:400,fontSize:"12px"},children:"(可选)"})]}),o.jsx("input",{type:"text",value:ie,onChange:B=>je(B.target.value),placeholder:"适合普通开发者使用",style:{...sn,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px"}})]})]}),o.jsxs("div",{style:{marginBottom:"18px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"路由绑定"}),o.jsxs("select",{value:Z,onChange:B=>re(B.target.value),style:{...sn,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"system",children:"按系统默认"}),i.map(B=>o.jsx("option",{value:B.id,children:B.name},B.id))]})]}),o.jsxs("div",{style:{marginBottom:"18px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[o.jsx("label",{style:{fontWeight:600,fontSize:"14px"},children:"配额限制"}),!U&&s.length>0&&o.jsxs("select",{style:{fontSize:"13px",padding:"6px 12px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",cursor:"pointer",color:"var(--text-secondary)"},onChange:B=>{B.target.value&&(gi(s[Number(B.target.value)]),B.target.value="")},children:[o.jsx("option",{value:"",children:"📋 使用模板..."}),s.map((B,z)=>o.jsxs("option",{value:String(z),children:[B.name," — ",B.description]},z))]})]}),o.jsx("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"16px",border:"1px solid var(--border-primary)"},children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"12px"},children:[o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"日 Token (k)"}),o.jsx("input",{type:"number",value:pe,onChange:B=>se(B.target.value),placeholder:"不限",style:{...sn,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"月 Token (k)"}),o.jsx("input",{type:"number",value:Re,onChange:B=>ke(B.target.value),placeholder:"不限",style:{...sn,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"日请求 (次)"}),o.jsx("input",{type:"number",value:ne,onChange:B=>De(B.target.value),placeholder:"不限",style:{...sn,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"RPM"}),o.jsx("input",{type:"number",value:qe,onChange:B=>ze(B.target.value),placeholder:"不限",style:{...sn,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"并发"}),o.jsx("input",{type:"number",value:Ke,onChange:B=>pt(B.target.value),placeholder:"不限",style:{...sn,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]})]})})]}),o.jsxs("div",{style:{marginBottom:"24px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"模型过滤"}),o.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"14px",border:"1px solid var(--border-primary)"},children:[o.jsx("div",{style:{display:"flex",gap:"16px",marginBottom:J!=="none"?"12px":"0"},children:[{value:"none",label:"不限制",desc:"允许所有模型"},{value:"allow",label:"白名单",desc:"仅允许指定模型"},{value:"block",label:"黑名单",desc:"禁止指定模型"}].map(B=>o.jsxs("label",{className:`policy-model-opt ${J===B.value?"policy-model-opt--active":""}`,children:[o.jsx("input",{type:"radio",name:"modelMode",value:B.value,checked:J===B.value,onChange:()=>Y(B.value),style:{display:"none"}}),o.jsx("div",{style:{fontWeight:600,fontSize:"14px",marginBottom:"2px"},children:B.label}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)"},children:B.desc})]},B.value))}),J!=="none"&&o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[o.jsxs("div",{style:{position:"relative",flex:1},children:[o.jsx("input",{ref:Le,type:"text",value:ue,onChange:B=>{M(B.target.value),Se(!0)},onFocus:()=>Se(!0),onBlur:()=>setTimeout(()=>Se(!1),150),placeholder:fe.length>0?"搜索或输入模型名...":"输入模型名,回车确认...",autoFocus:!0,onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),_t(J==="allow"?Ye:Ze,J==="allow"?Qe:tt)),B.key==="Escape"&&Se(!1)},style:{...sn,width:"100%",padding:"8px 12px",borderRadius:"6px",fontSize:"13px"}}),xe&&Pt.length>0&&o.jsx("div",{className:"ak-model-suggest",children:Pt.map(B=>o.jsxs("button",{className:"ak-model-suggest-item",onMouseDown:z=>{var Ue;z.preventDefault();const Pe=J==="allow"?Ye:Ze,ot=J==="allow"?Qe:tt;Pe.includes(B.name)||ot([...Pe,B.name]),M(""),Se(!1),(Ue=Le.current)==null||Ue.focus()},children:[o.jsx("span",{children:B.name}),o.jsx("span",{children:B.vendors.join(", ")})]},B.name))})]}),o.jsx("button",{className:"btn btn-primary btn-sm",style:{padding:"8px 14px",borderRadius:"6px"},onClick:()=>_t(J==="allow"?Ye:Ze,J==="allow"?Qe:tt),children:"添加"})]}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",minHeight:"24px"},children:[(J==="allow"?Ye:Ze).length===0&&o.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)",padding:"4px 0"},children:J==="allow"?"尚未添加模型,至少需要添加一个模型才能生效":"尚未添加模型,不添加则不对任何模型进行屏蔽"}),(J==="allow"?Ye:Ze).map((B,z)=>o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",background:"var(--bg-secondary)",borderRadius:"16px",fontSize:"13px",border:"1px solid var(--border-primary)"},children:[B,o.jsx("button",{style:{border:"none",background:"none",cursor:"pointer",padding:"0 2px",color:"var(--text-tertiary)",fontSize:"14px",lineHeight:1},onClick:()=>{(J==="allow"?Qe:tt)((J==="allow"?Ye:Ze).filter((Ue,St)=>St!==z))},children:"×"})]},z))]})]})]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>me(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Xi,className:"ak-modal-btn-primary",children:U?"保存修改":"创建策略"})]})]})}),ve&&o.jsx(EL,{keyName:ve.key.name,apiKey:ve.key.apiKey,guide:ve.guide,onClose:()=>Ae(null)}),o.jsx("style",{children:`
546
+ .dropdown-btn {
547
+ display: block; width: 100%; padding: 6px 10px; text-align: left;
548
+ border: none; background: none; cursor: pointer; font-size: 13px;
549
+ color: var(--text-primary);
550
+ }
551
+ .dropdown-btn:hover { background: var(--bg-secondary); }
552
+
553
+ /* 操作按钮 - 列表/策略面板中的小按钮 */
554
+ .ak-action-btn {
555
+ padding: 4px 10px; border-radius: 6px;
556
+ border: 1px solid var(--border-primary);
557
+ background: var(--bg-secondary);
558
+ color: var(--text-secondary);
559
+ cursor: pointer; font-size: 13px;
560
+ transition: all 0.15s;
561
+ }
562
+ .ak-action-btn:hover {
563
+ background: var(--bg-route-item-hover);
564
+ border-color: var(--text-secondary);
565
+ }
566
+ .ak-action-btn--danger {
567
+ color: var(--accent-danger);
568
+ }
569
+ .ak-action-btn--danger:hover {
570
+ background: rgba(220, 38, 38, 0.1);
571
+ border-color: var(--accent-danger);
572
+ }
573
+
574
+ /* 模型自动补全下拉 */
575
+ .ak-model-suggest {
576
+ position: absolute; left: 0; right: 0; bottom: 100%; z-index: 50;
577
+ margin-top: 4px; max-height: 240px; overflow-y: auto;
578
+ background: var(--bg-primary-solid); border: 1px solid var(--border-primary);
579
+ border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
580
+ padding: 4px 0;
581
+ }
582
+ .ak-model-suggest-item {
583
+ display: flex; justify-content: space-between; align-items: center; gap: 8px;
584
+ width: 100%; padding: 7px 12px;
585
+ border: none; background: none; cursor: pointer;
586
+ font-size: 13px; color: var(--text-primary); text-align: left;
587
+ }
588
+ .ak-model-suggest-item > span:first-child {
589
+ font-family: "SF Mono", "Fira Code", monospace;
590
+ white-space: nowrap;
591
+ }
592
+ .ak-model-suggest-item > span:last-child {
593
+ color: #999; font-size: 11px; white-space: nowrap; flex-shrink: 0;
594
+ }
595
+ [data-theme="dark"] .ak-model-suggest-item > span:last-child {
596
+ color: #888;
597
+ }
598
+ .ak-model-suggest-item:hover {
599
+ background: var(--bg-secondary);
600
+ }
601
+ [data-theme="dark"] .ak-model-suggest {
602
+ background: #0C1F12;
603
+ border-color: rgba(167, 243, 208, 0.2);
604
+ }
605
+ [data-theme="dark"] .ak-model-suggest-item:hover {
606
+ background: rgba(30, 58, 40, 0.95);
607
+ }
608
+
609
+ /* 批量操作按钮 */
610
+ .ak-action-btn[onClick] {
611
+ padding: 6px 12px;
612
+ }
613
+
614
+ /* 下拉菜单 */
615
+ .ak-dropdown-menu {
616
+ position: absolute; right: 0; top: 100%; z-index: 100;
617
+ background: var(--bg-primary-solid);
618
+ border: 1px solid var(--border-primary);
619
+ border-radius: 6px;
620
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
621
+ min-width: 140px; padding: 4px 0;
622
+ }
623
+
624
+ /* 弹窗按钮 */
625
+ .ak-modal-btn-primary {
626
+ padding: 10px 28px; border-radius: 8px; border: none;
627
+ background: var(--color-primary, #3b82f6); color: #fff;
628
+ cursor: pointer; font-size: 14px; font-weight: 600;
629
+ transition: opacity 0.15s;
630
+ }
631
+ .ak-modal-btn-primary:hover { opacity: 0.9; }
632
+
633
+ .ak-modal-btn-secondary {
634
+ padding: 10px 24px; border-radius: 8px;
635
+ border: 1px solid var(--border-primary);
636
+ background: var(--bg-secondary);
637
+ color: var(--text-primary);
638
+ cursor: pointer; font-size: 14px; font-weight: 500;
639
+ transition: all 0.15s;
640
+ }
641
+ .ak-modal-btn-secondary:hover {
642
+ background: var(--bg-route-item-hover);
643
+ }
644
+
645
+ /* 模型过滤选项 */
646
+ .policy-model-opt {
647
+ cursor: pointer; padding: 10px 14px; border-radius: 8px;
648
+ flex: 1; text-align: center; transition: all 0.2s;
649
+ border: 1px solid var(--border-primary);
650
+ background: transparent;
651
+ }
652
+ .policy-model-opt:hover {
653
+ background: rgba(59,130,246,0.05);
654
+ }
655
+ .policy-model-opt--active {
656
+ border: 2px solid var(--color-primary, #3b82f6);
657
+ background: rgba(59,130,246,0.12);
658
+ }
659
+ .policy-model-opt--active:hover {
660
+ background: rgba(59,130,246,0.18);
661
+ }
662
+
663
+ /* ========== 深色模式 ========== */
664
+ [data-theme="dark"] .ak-action-btn {
665
+ background: rgba(30, 58, 40, 0.95);
666
+ border-color: rgba(167, 243, 208, 0.2);
667
+ color: #A7F3D0;
668
+ }
669
+ [data-theme="dark"] .ak-action-btn:hover {
670
+ background: rgba(40, 75, 52, 0.95);
671
+ border-color: rgba(167, 243, 208, 0.4);
672
+ }
673
+ [data-theme="dark"] .ak-action-btn--danger {
674
+ color: #EF4444;
675
+ }
676
+ [data-theme="dark"] .ak-action-btn--danger:hover {
677
+ background: rgba(239, 68, 68, 0.15);
678
+ border-color: rgba(239, 68, 68, 0.5);
679
+ }
680
+ [data-theme="dark"] .ak-dropdown-menu {
681
+ background: #0C1F12;
682
+ border-color: rgba(167, 243, 208, 0.2);
683
+ }
684
+ [data-theme="dark"] .ak-modal-btn-secondary {
685
+ background: rgba(30, 58, 40, 0.95);
686
+ border-color: rgba(167, 243, 208, 0.2);
687
+ color: #ECFEF5;
688
+ }
689
+ [data-theme="dark"] .ak-modal-btn-secondary:hover {
690
+ background: rgba(40, 75, 52, 0.95);
691
+ border-color: rgba(167, 243, 208, 0.35);
692
+ }
693
+ [data-theme="dark"] .policy-model-opt:hover {
694
+ background: rgba(96,165,250,0.12);
695
+ }
696
+ [data-theme="dark"] .policy-model-opt--active {
697
+ background: rgba(96,165,250,0.28);
698
+ border-color: #60a5fa;
699
+ }
700
+ [data-theme="dark"] .policy-model-opt--active:hover {
701
+ background: rgba(96,165,250,0.38);
702
+ }
703
+ [data-theme="dark"] .page-container select option {
704
+ background: #0C1F12;
705
+ color: #ECFEF5;
706
+ }
707
+ [data-theme="dark"] .page-container textarea,
708
+ [data-theme="dark"] .page-container input[type="text"],
709
+ [data-theme="dark"] .page-container input[type="number"] {
710
+ color-scheme: dark;
711
+ }
712
+ `})]})}function Cce(){var cr,Qi,sn,B;const{id:e}=U$(),t=Th(),{confirm:n}=$u(),[r,i]=f.useState(null),[a,s]=f.useState([]),[l,c]=f.useState([]),[u,p]=f.useState(!0),[d,h]=f.useState("info"),[m,g]=f.useState(null),[v,x]=f.useState([]),[y,b]=f.useState(30),[w,j]=f.useState([]),[k,S]=f.useState(0),[A,T]=f.useState(1),[L,O]=f.useState(20),[R,_]=f.useState(""),[X,q]=f.useState(""),[I,$]=f.useState(""),[H,N]=f.useState(""),[W,P]=f.useState(null),[U,le]=f.useState(!1),[E,me]=f.useState(10),ye=f.useRef(null),[Q,ie]=f.useState(!1),[je,Z]=f.useState(""),[re,pe]=f.useState(""),[se,Re]=f.useState(""),[ke,ne]=f.useState(null),[De,qe]=f.useState(!1),[ze,Ke]=f.useState({"claude-code":!0,codex:!0}),[pt,Ye]=f.useState(!1),[Qe,Ze]=f.useState([]),[tt,J]=f.useState(0),[Y,ue]=f.useState(1),[M,fe]=f.useState(20),[ee,xe]=f.useState(""),[Se,Le]=f.useState(""),[$e,He]=f.useState(null),[Oe,Xe]=f.useState([]),[D,ge]=f.useState(!1),[F,de]=f.useState(!1),[ve,Ae]=f.useState(10),Ee=f.useRef(null),Ge=f.useCallback(async()=>{if(e)try{const[z,Pe,ot]=await Promise.all([V.getAccessKey(e).catch(()=>null),V.getPolicies().catch(()=>[]),V.getRoutes().catch(()=>[])]);if(!z){K.error("密钥不存在"),t("/access-keys");return}i(z),s(Pe),c(ot),Z(z.name),pe(z.remark||""),Re(z.policyId||"")}catch(z){K.error("加载数据失败: "+z.message)}finally{p(!1)}},[e,t]),nt=f.useCallback(async()=>{if(e)try{const[z,Pe]=await Promise.all([V.getAccessKeyUsage(e).catch(()=>null),V.getAccessKeyUsageTrend(e,y).catch(()=>[])]);g(z),x(Pe)}catch{}},[e,y]),at=f.useCallback(async()=>{if(e)try{const z=await V.getAccessKeyLogs(e,{page:A,pageSize:L,startDate:R||void 0,endDate:X||void 0,contentType:I||void 0,search:H||void 0});j(z.data),S(z.total)}catch{}},[e,A,L,R,X,I,H]),Je=f.useCallback(async()=>{if(e)try{const z=await V.getAccessKeySessions(e,{page:Y,pageSize:M,targetType:Se||void 0,search:ee||void 0});Ze(z.data),J(z.total)}catch{}},[e,Y,M,Se,ee]);f.useEffect(()=>{Ge()},[Ge]),f.useEffect(()=>{d==="stats"&&nt(),d==="logs"&&at(),d==="sessions"&&Je()},[d,nt,at,Je]),f.useEffect(()=>{if(U&&d==="logs")return ye.current=setInterval(()=>{me(z=>z<=1?(at(),10):z-1)},1e3),()=>{ye.current&&clearInterval(ye.current)};ye.current&&clearInterval(ye.current),me(10)},[U,d,at]),f.useEffect(()=>{if(F&&d==="sessions")return Ee.current=setInterval(()=>{Ae(z=>z<=1?(Je(),10):z-1)},1e3),()=>{Ee.current&&clearInterval(Ee.current)};Ee.current&&clearInterval(Ee.current),Ae(10)},[F,d,Je]);const nn=async()=>{if(!(!e||!je.trim()))try{await V.updateAccessKey(e,{name:je.trim(),remark:re||void 0,policyId:se||void 0}),K.success("已保存"),ie(!1),Ge()}catch(z){K.error("保存失败: "+z.message)}},Kt=async()=>{if(r)try{await V.updateAccessKey(r.id,{status:r.status==="active"?"disabled":"active"}),K.success(r.status==="active"?"已停用":"已启用"),Ge()}catch(z){K.error("操作失败: "+z.message)}},ut=async()=>{if(!(!r||!await n({message:"确定删除此密钥吗?删除后不可恢复。"})))try{await V.deleteAccessKey(r.id),K.success("已删除"),t("/access-keys")}catch(Pe){K.error("删除失败: "+Pe.message)}},Ht=async()=>{if(r)try{const z=await V.getAccessKeyGuide(r.id);ne({key:r,guide:z})}catch(z){K.error("获取指引失败: "+z.message)}},Jt=async()=>{var z,Pe;if(r)try{const ot=await V.getAccessKeyGuide(r.id),Ue=((Pe=(z=ot==null?void 0:ot.claudeCode)==null?void 0:z.envVars)==null?void 0:Pe.ANTHROPIC_AUTH_TOKEN)||r.apiKey;await navigator.clipboard.writeText(Ue),K.success("已复制到剪贴板")}catch{try{await navigator.clipboard.writeText(r.apiKey),K.success("已复制到剪贴板")}catch{K.error("复制失败")}}},It=async()=>{if(!r)return;const z=Object.entries(ze).filter(([,Pe])=>Pe).map(([Pe])=>Pe);if(z.length===0){K.error("请选择至少一个目标");return}Ye(!0);try{await V.writeAccessKeyToLocal(r.id,z),K.success("已写入本地配置文件"),qe(!1)}catch(Pe){K.error("写入失败: "+(Pe.message||"未知错误"))}finally{Ye(!1)}},Pt=z=>z>=1e6?(z/1e6).toFixed(1)+"M":z>=1e3?(z/1e3).toFixed(1)+"k":String(z),gi=z=>z?new Date(z).toLocaleString():"-",Xi={width:"100%",padding:"8px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",boxSizing:"border-box",fontSize:"14px"};if(u)return o.jsx("div",{style:{textAlign:"center",padding:"40px"},children:"加载中..."});if(!r)return null;const Ea=m&&m.lifetime.totalRequests>0?((m.lifetime.totalRequests-m.lifetime.errorCount)/m.lifetime.totalRequests*100).toFixed(1):"-",ce=Math.max(...v.map(z=>z.tokens),1),_t=Math.max(...v.map(z=>z.requests),1),Tn=[{key:"info",label:"基本信息"},{key:"policy",label:"策略"},{key:"stats",label:"统计"},{key:"logs",label:"日志"},{key:"sessions",label:"会话"}];return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"20px"},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>t("/access-keys"),children:"← 返回"}),o.jsx("h2",{style:{flex:1},children:r.name}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:()=>ie(!0),children:"编辑"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:()=>qe(!0),children:"💾 写入本地"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:Kt,children:r.status==="active"?"停用":"启用"}),o.jsx("button",{className:"ak-action-btn ak-action-btn--danger",style:{padding:"6px 14px"},onClick:ut,children:"删除"})]}),o.jsx("div",{className:"ak-tab-bar",style:{display:"flex",gap:"0",borderBottom:"2px solid var(--border-primary)",marginBottom:"20px"},children:Tn.map(z=>o.jsx("button",{className:`ak-tab-btn ${d===z.key?"ak-tab-btn--active":""}`,onClick:()=>h(z.key),children:z.label},z.key))}),d==="info"&&o.jsx("div",{className:"card",children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr",gap:"16px 20px",alignItems:"start"},children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"API Key"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("code",{style:{fontSize:"14px",padding:"4px 8px",background:"var(--bg-secondary)",borderRadius:"4px"},children:r.apiKey}),o.jsx("button",{className:"ak-action-btn",onClick:Jt,title:"复制",children:"📋"}),o.jsx("button",{className:"ak-action-btn",onClick:Ht,children:"接入指引"})]}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"策略"}),o.jsx("div",{style:{fontSize:"14px"},children:r.policyName||o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"未配置"})}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"状态"}),o.jsxs("div",{style:{fontSize:"14px",display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:r.status==="active"?"var(--color-success, #22c55e)":"var(--text-tertiary)"}}),r.status==="active"?"启用":"停用"]}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"创建时间"}),o.jsx("div",{style:{fontSize:"14px"},children:gi(r.createdAt)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"最后活跃"}),o.jsx("div",{style:{fontSize:"14px"},children:gi(r.lastActiveAt)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"备注"}),o.jsx("div",{style:{fontSize:"14px",color:r.remark?"var(--text-primary)":"var(--text-tertiary)"},children:r.remark||"无"}),m&&o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"累计 Token"}),o.jsx("div",{style:{fontSize:"14px"},children:Pt(m.lifetime.totalTokens)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"累计请求"}),o.jsx("div",{style:{fontSize:"14px"},children:m.lifetime.totalRequests})]})]})}),d==="policy"&&(()=>{var yi,Zl,Jl,hd,ws;const z=a.find(st=>st.id===r.policyId),Pe=z!=null&&z.routeId&&z.routeId!=="system"?(yi=l.find(st=>st.id===z.routeId))==null?void 0:yi.name:void 0,ot=st=>{const fn=[];return st.dailyTokenLimit&&fn.push(`日 ${st.dailyTokenLimit}k Token`),st.weeklyTokenLimit&&fn.push(`周 ${st.weeklyTokenLimit}k Token`),st.monthlyTokenLimit&&fn.push(`月 ${st.monthlyTokenLimit}k Token`),st.customTokenLimit&&st.customTokenResetHours&&fn.push(`${st.customTokenResetHours}h ${st.customTokenLimit}k Token`),st.dailyRequestLimit&&fn.push(`日 ${st.dailyRequestLimit} 次请求`),st.weeklyRequestLimit&&fn.push(`周 ${st.weeklyRequestLimit} 次请求`),st.monthlyRequestLimit&&fn.push(`月 ${st.monthlyRequestLimit} 次请求`),st.customRequestLimit&&st.customRequestResetHours&&fn.push(`${st.customRequestResetHours}h ${st.customRequestLimit} 次请求`),st.rpmLimit&&fn.push(`RPM ${st.rpmLimit}`),st.concurrentLimit&&fn.push(`并发 ${st.concurrentLimit}`),fn.length>0?fn:null},Ue=(Zl=z==null?void 0:z.allowedModels)!=null&&Zl.length?z.allowedModels:(Jl=z==null?void 0:z.blockedModels)!=null&&Jl.length?z.blockedModels:null,St=(hd=z==null?void 0:z.allowedModels)!=null&&hd.length?"allow":(ws=z==null?void 0:z.blockedModels)!=null&&ws.length?"block":"none";if(!z)return o.jsxs("div",{className:"card",style:{textAlign:"center",padding:"60px 20px"},children:[o.jsx("div",{style:{fontSize:"36px",marginBottom:"12px"},children:"📋"}),o.jsx("div",{style:{fontSize:"16px",fontWeight:500,marginBottom:"8px"},children:"未绑定策略"}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px"},children:"可在「编辑」弹窗中为此密钥绑定策略,以启用配额限制和模型过滤"})]});const rn=ot(z);return o.jsxs("div",{className:"card",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[o.jsxs("div",{children:[o.jsxs("h3",{style:{margin:"0 0 4px",fontSize:"18px"},children:["📋 ",z.name]}),z.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px"},children:z.description})]}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:"只读 · 如需修改请前往策略管理"})]}),o.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center",marginBottom:"20px",paddingBottom:"20px",borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px"},children:"绑定路由:"}),o.jsx("div",{style:{fontSize:"14px"},children:Pe?o.jsx("span",{children:Pe}):o.jsx("span",{style:{color:"var(--accent-color, #4a90d9)"},children:"按系统默认"})})]}),o.jsxs("div",{style:{marginBottom:"20px",paddingBottom:"20px",borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("h4",{style:{margin:"0 0 12px",fontSize:"15px"},children:"📊 配额限制"}),rn?o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:rn.map((st,fn)=>o.jsx("span",{style:{display:"inline-block",padding:"6px 12px",borderRadius:"6px",background:"var(--bg-secondary)",fontSize:"13px",border:"1px solid var(--border-primary)"},children:st},fn))}):o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px"},children:"无限制"})]}),o.jsxs("div",{children:[o.jsx("h4",{style:{margin:"0 0 12px",fontSize:"15px"},children:"🏷️ 模型过滤"}),St==="none"?o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px"},children:"不限制,允许所有模型"}):o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:"13px",marginBottom:"10px",color:"var(--text-secondary)"},children:St==="allow"?"✅ 白名单模式 — 仅允许以下模型":"🚫 黑名单模式 — 禁止以下模型"}),o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Ue.map((st,fn)=>o.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"5px 12px",background:"var(--bg-secondary)",borderRadius:"16px",fontSize:"13px",border:"1px solid var(--border-primary)"},children:st},fn))})]})]})]})})(),d==="stats"&&o.jsxs("div",{children:[m&&o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:"12px",marginBottom:"20px"},children:[{label:"累计 Token",value:Pt(m.lifetime.totalTokens)},{label:"累计请求",value:String(m.lifetime.totalRequests)},{label:"成功率",value:Ea+"%"},{label:"错误数",value:String(m.lifetime.errorCount)},{label:"输入 Token",value:Pt(m.lifetime.inputTokens)},{label:"输出 Token",value:Pt(m.lifetime.outputTokens)}].map(z=>o.jsxs("div",{className:"card",style:{padding:"16px",textAlign:"center",marginBottom:"0"},children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px",marginBottom:"4px"},children:z.label}),o.jsx("div",{style:{fontSize:"20px",fontWeight:600},children:z.value})]},z.label))}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[o.jsx("h4",{style:{margin:0},children:"消耗趋势"}),o.jsx("div",{style:{display:"flex",gap:"4px"},children:[7,30,90].map(z=>o.jsxs("button",{className:`ak-action-btn ${y===z?"ak-action-btn--active":""}`,style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>b(z),children:[z,"天"]},z))})]}),v.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无趋势数据"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"8px"},children:"Token 消耗"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"80px"},children:v.slice(-y).map((z,Pe)=>o.jsx("div",{style:{flex:1,minWidth:0,height:ce>0?`${Math.max(2,z.tokens/ce*100)}%`:"2px",background:"var(--color-primary, #3b82f6)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${Pt(z.tokens)}`},Pe))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(cr=v[0])==null?void 0:cr.date}),o.jsx("span",{children:(Qi=v[v.length-1])==null?void 0:Qi.date})]})]}),o.jsxs("div",{style:{marginBottom:"8px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"8px"},children:"请求量"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"60px"},children:v.slice(-y).map((z,Pe)=>o.jsx("div",{style:{flex:1,minWidth:0,height:_t>0?`${Math.max(2,z.requests/_t*100)}%`:"2px",background:"var(--color-success, #22c55e)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${z.requests} 请求`},Pe))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(sn=v[0])==null?void 0:sn.date}),o.jsx("span",{children:(B=v[v.length-1])==null?void 0:B.date})]})]}),o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"8px"},children:"错误数"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"40px"},children:v.slice(-y).map((z,Pe)=>{const ot=Math.max(...v.map(Ue=>Ue.errors),1);return o.jsx("div",{style:{flex:1,minWidth:0,height:ot>0?`${Math.max(2,z.errors/ot*100)}%`:"2px",background:z.errors>0?"var(--accent-danger, #ef4444)":"var(--border-primary)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${z.errors} 错误`},Pe)})})]})]})]})]}),d==="logs"&&o.jsxs("div",{children:[o.jsx("div",{className:"card",style:{marginBottom:"16px",padding:"12px 16px"},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1,minWidth:0},children:[o.jsx("input",{type:"text",placeholder:"搜索路径、模型...",value:H,onChange:z=>{N(z.target.value),T(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px",width:"180px"}}),o.jsxs("select",{value:I,onChange:z=>{$(z.target.value),T(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"},children:[o.jsx("option",{value:"",children:"全部类型"}),o.jsx("option",{value:"default",children:"默认"}),o.jsx("option",{value:"thinking",children:"思考"}),o.jsx("option",{value:"long-context",children:"长上下文"}),o.jsx("option",{value:"image-understanding",children:"图像理解"}),o.jsx("option",{value:"background",children:"后台"}),o.jsx("option",{value:"compact",children:"压缩"}),o.jsx("option",{value:"high-iq",children:"高智商"})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("label",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:"开始"}),o.jsx("input",{type:"date",value:R,onChange:z=>{_(z.target.value),T(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"}})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("label",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:"结束"}),o.jsx("input",{type:"date",value:X,onChange:z=>{q(z.target.value),T(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"}})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexShrink:0},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"13px",cursor:"pointer",color:"var(--text-tertiary)"},children:[o.jsx("input",{type:"checkbox",checked:U,onChange:z=>le(z.target.checked)}),"自动刷新 ",U&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",E,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>at(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:w.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无请求记录"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"时间"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"路径"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"模型"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"Token"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"耗时"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"center"},children:"状态"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"类型"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"center"},children:"操作"})]})}),o.jsx("tbody",{children:w.map(z=>{var Ue,St,rn;const Pe=((Ue=z.usage)==null?void 0:Ue.totalTokens)||(((St=z.usage)==null?void 0:St.inputTokens)||0)+(((rn=z.usage)==null?void 0:rn.outputTokens)||0),ot=(z.statusCode||200)<400;return o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>P(z),children:[o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(z.timestamp).toLocaleString()}),o.jsx("td",{style:{padding:"8px 6px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z.path||"-"}),o.jsx("td",{style:{padding:"8px 6px"},children:z.targetModel||z.requestModel||"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:Pt(Pe)}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:z.responseTime?(z.responseTime/1e3).toFixed(1)+"s":"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"center"},children:o.jsx("span",{style:{display:"inline-block",padding:"2px 6px",borderRadius:"4px",fontSize:"12px",background:ot?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",color:ot?"var(--color-success, #22c55e)":"var(--accent-danger, #ef4444)"},children:z.statusCode||200})}),o.jsx("td",{style:{padding:"8px 6px"},children:z.contentType||"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"center"},children:o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px"},onClick:yi=>{yi.stopPropagation(),P(z)},children:"详情"})})]},z.id)})})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(yu,{currentPage:A,totalItems:k,pageSize:L,onPageChange:T,onPageSizeChange:z=>{O(z),T(1)}})})]})})]}),d==="sessions"&&(()=>{const z=(Ue,St)=>{const rn=St-Ue;return rn<6e4?`${Math.floor(rn/1e3)}秒`:rn<36e5?`${Math.floor(rn/6e4)}分钟`:`${Math.floor(rn/36e5)}小时`},Pe=async Ue=>{He(Ue),ge(!0);try{const St=await V.getAccessKeySessionLogs(e,Ue.id,1e4);Xe(St)}catch{K.error("加载会话日志失败")}finally{ge(!1)}},ot=async()=>{if(!(!$e||D)){ge(!0);try{const Ue=await V.getAccessKeySessionLogs(e,$e.id,1e4);Xe(Ue)}catch{}finally{ge(!1)}}};return o.jsxs("div",{children:[o.jsx("div",{className:"card",style:{marginBottom:"16px",padding:"12px 16px"},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1,minWidth:0},children:[o.jsx("input",{type:"text",placeholder:"搜索标题或ID...",value:ee,onChange:Ue=>{xe(Ue.target.value),ue(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px",width:"200px"}}),o.jsxs("select",{value:Se,onChange:Ue=>{Le(Ue.target.value),ue(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"},children:[o.jsx("option",{value:"",children:"全部类型"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexShrink:0},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"13px",cursor:"pointer",color:"var(--text-tertiary)"},children:[o.jsx("input",{type:"checkbox",checked:F,onChange:Ue=>de(Ue.target.checked)}),"自动刷新 ",F&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",ve,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>Je(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:Qe.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无会话记录"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"标题"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"类型"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"请求数"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"Tokens"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"首次请求"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"最后请求"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"时长"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"center"},children:"操作"})]})}),o.jsx("tbody",{children:Qe.map(Ue=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>Pe(Ue),children:[o.jsx("td",{style:{padding:"8px 6px",maxWidth:"250px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Lo(Ue.title)}),o.jsx("td",{style:{padding:"8px 6px"},children:o.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",background:Ue.targetType==="claude-code"?"rgba(59,130,246,0.1)":"rgba(34,197,94,0.1)",color:Ue.targetType==="claude-code"?"var(--color-primary, #3b82f6)":"var(--color-success, #22c55e)"},children:Ue.targetType==="claude-code"?"Claude Code":"Codex"})}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:Ue.requestCount}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:Pt(Ue.totalTokens)}),o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(Ue.firstRequestAt).toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(Ue.lastRequestAt).toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),o.jsx("td",{style:{padding:"8px 6px"},children:z(Ue.firstRequestAt,Ue.lastRequestAt)}),o.jsxs("td",{style:{padding:"8px 6px",textAlign:"center"},children:[o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px"},onClick:St=>{St.stopPropagation(),Pe(Ue)},children:"详情"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px",marginLeft:"4px"},onClick:St=>{St.stopPropagation(),He(Ue),ge(!0),V.getAccessKeySessionLogs(e,Ue.id,1e4).then(rn=>{Xe(rn),ge(!1)}).catch(()=>ge(!1))},children:"对话"})]})]},Ue.id))})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(yu,{currentPage:Y,totalItems:tt,pageSize:M,onPageChange:ue,onPageSizeChange:Ue=>{fe(Ue),ue(1)}})})]})}),$e&&o.jsx(Y0,{session:$e,logs:Oe,logsLoading:D,onRefreshLogs:ot,onFetchNewLogs:async()=>$e?await V.getAccessKeySessionLogs(e,$e.id,1e4):[],onClose:()=>{He(null),Xe([])}})]})})(),Q&&o.jsx("div",{className:"modal-overlay",onClick:()=>ie(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"480px",padding:"28px"},onClick:z=>z.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>ie(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 20px",fontSize:"20px"},children:"编辑密钥"}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"名称"}),o.jsx("input",{type:"text",value:je,onChange:z=>Z(z.target.value),style:Xi})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"备注"}),o.jsx("textarea",{value:re,onChange:z=>pe(z.target.value),style:{...Xi,minHeight:"60px",resize:"vertical"}})]}),o.jsxs("div",{style:{marginBottom:"24px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"策略"}),o.jsxs("select",{value:se,onChange:z=>Re(z.target.value),style:{...Xi,cursor:"pointer"},children:[o.jsx("option",{value:"",children:"未配置"}),a.map(z=>o.jsx("option",{value:z.id,children:z.name},z.id))]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>ie(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:nn,className:"ak-modal-btn-primary",children:"保存"})]})]})}),W&&o.jsx(uf,{log:W,onClose:()=>P(null)}),ke&&o.jsx(EL,{keyName:ke.key.name,apiKey:ke.key.apiKey,guide:ke.guide,onClose:()=>ne(null)}),De&&o.jsx("div",{className:"modal-overlay",onClick:()=>qe(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"420px",padding:"28px"},onClick:z=>z.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>qe(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 16px",fontSize:"20px"},children:"写入本地配置"}),o.jsx("p",{style:{margin:"0 0 16px",fontSize:"14px",color:"var(--text-secondary)"},children:"将此密钥写入本地工具配置文件(仅更新认证字段,不影响其他配置)"}),o.jsx("div",{style:{marginBottom:"20px"},children:[{key:"claude-code",label:"Claude Code",desc:"~/.claude/settings.json → ANTHROPIC_AUTH_TOKEN"},{key:"codex",label:"Codex",desc:"~/.codex/auth.json → OPENAI_API_KEY"}].map(z=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px",marginBottom:"8px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:ze[z.key]?"var(--bg-secondary)":"transparent",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:ze[z.key],onChange:Pe=>Ke(ot=>({...ot,[z.key]:Pe.target.checked})),style:{marginTop:"2px"}}),o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:z.label}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:z.desc})]})]},z.key))}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>qe(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:It,className:"ak-modal-btn-primary",disabled:pt,children:pt?"写入中...":"确认写入"})]})]})}),o.jsx("style",{children:`
713
+ .ak-tab-btn {
714
+ padding: 10px 24px;
715
+ border: none;
716
+ background: transparent;
717
+ color: var(--text-tertiary);
718
+ font-size: 14px;
719
+ font-weight: 500;
720
+ cursor: pointer;
721
+ border-bottom: 2px solid transparent;
722
+ margin-bottom: -2px;
723
+ transition: all 0.15s;
724
+ }
725
+ .ak-tab-btn:hover {
726
+ color: var(--text-secondary);
727
+ }
728
+ .ak-tab-btn--active {
729
+ color: var(--color-primary, #3b82f6);
730
+ border-bottom-color: var(--color-primary, #3b82f6);
731
+ font-weight: 600;
732
+ }
733
+ .ak-action-btn {
734
+ padding: 4px 10px; border-radius: 6px;
735
+ border: 1px solid var(--border-primary);
736
+ background: var(--bg-secondary);
737
+ color: var(--text-secondary);
738
+ cursor: pointer; font-size: 13px;
739
+ transition: all 0.15s;
740
+ }
741
+ .ak-action-btn:hover {
742
+ background: var(--bg-route-item-hover);
743
+ border-color: var(--text-secondary);
744
+ }
745
+ .ak-action-btn--active {
746
+ background: var(--color-primary, #3b82f6);
747
+ color: #fff;
748
+ border-color: var(--color-primary, #3b82f6);
749
+ }
750
+ .ak-action-btn--danger {
751
+ color: var(--accent-danger);
752
+ }
753
+ .ak-action-btn--danger:hover {
754
+ background: rgba(220, 38, 38, 0.1);
755
+ border-color: var(--accent-danger);
756
+ }
757
+ .ak-modal-btn-primary {
758
+ padding: 10px 28px; border-radius: 8px; border: none;
759
+ background: var(--color-primary, #3b82f6); color: #fff;
760
+ cursor: pointer; font-size: 14px; font-weight: 600;
761
+ transition: opacity 0.15s;
762
+ }
763
+ .ak-modal-btn-primary:hover { opacity: 0.9; }
764
+ .ak-modal-btn-secondary {
765
+ padding: 10px 24px; border-radius: 8px;
766
+ border: 1px solid var(--border-primary);
767
+ background: var(--bg-secondary);
768
+ color: var(--text-primary);
769
+ cursor: pointer; font-size: 14px; font-weight: 500;
770
+ transition: all 0.15s;
771
+ }
772
+ .ak-modal-btn-secondary:hover {
773
+ background: var(--bg-route-item-hover);
774
+ }
775
+
776
+ /* 深色模式 */
777
+ [data-theme="dark"] .ak-action-btn {
778
+ background: rgba(30, 58, 40, 0.95);
779
+ border-color: rgba(167, 243, 208, 0.2);
780
+ color: #A7F3D0;
781
+ }
782
+ [data-theme="dark"] .ak-action-btn:hover {
783
+ background: rgba(40, 75, 52, 0.95);
784
+ border-color: rgba(167, 243, 208, 0.4);
785
+ }
786
+ [data-theme="dark"] .ak-action-btn--danger {
787
+ color: #EF4444;
788
+ }
789
+ [data-theme="dark"] .ak-action-btn--danger:hover {
790
+ background: rgba(239, 68, 68, 0.15);
791
+ border-color: rgba(239, 68, 68, 0.5);
792
+ }
793
+ [data-theme="dark"] .ak-modal-btn-secondary {
794
+ background: rgba(30, 58, 40, 0.95);
795
+ border-color: rgba(167, 243, 208, 0.2);
796
+ color: #ECFEF5;
797
+ }
798
+ [data-theme="dark"] .ak-modal-btn-secondary:hover {
799
+ background: rgba(40, 75, 52, 0.95);
800
+ border-color: rgba(167, 243, 208, 0.35);
801
+ }
802
+ [data-theme="dark"] .page-container select option {
803
+ background: #0C1F12;
804
+ color: #ECFEF5;
805
+ }
806
+ [data-theme="dark"] .page-container textarea,
807
+ [data-theme="dark"] .page-container input[type="text"],
808
+ [data-theme="dark"] .page-container input[type="date"] {
809
+ color-scheme: dark;
810
+ }
811
+ `})]})}const TL=f.createContext(null);function Pce(){const e=f.useContext(TL);if(!e)throw new Error("useAgentNotifications must be used inside <AgentNotificationsProvider>");return e}function Ace({children:e}){const[t,n]=f.useState(!1);f.useEffect(()=>{V.getAgentMapNotify().then(i=>n(!!i.enabled)).catch(()=>{})},[]);const r=f.useCallback(()=>{n(i=>{const a=!i;return V.setAgentMapNotify(a).catch(()=>{}),a})},[]);return o.jsx(TL.Provider,{value:{enabled:t,toggle:r},children:e})}const Ji=1e3,ea=700,Yc=36e5,ew=864e5,IL=.4,OL=4,tw={Read:"📖",Edit:"📝",Write:"📝",MultiEdit:"📝",Bash:"🔧",Glob:"🔍",Grep:"🔍",WebFetch:"🌐",WebSearch:"🌐",Agent:"🤖",Task:"🤖",NotebookEdit:"📓"},e2=8,Ece=96;function t2(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}const ko=[[0,0],[1,400],[7,640],[30,720],[365,800]];function NL(e){if(!Number.isFinite(e)||e<=0)return ko[0][1];for(let t=1;t<ko.length;t++)if(e<=ko[t][0]){const[n,r]=ko[t-1],[i,a]=ko[t],s=(e-n)/(i-n);return r+(a-r)*s}return ko[ko.length-1][1]}function n2(e,t,n){const r=Ji/2,i=ea/2,a=n-t,s=Number.isFinite(a)&&a>0?a/ew:0,l=NL(s),c=(t2(e)%360+(t2(e+"~j")%40-20))*(Math.PI/180);return{x:r+Math.cos(c)*l,y:i+Math.sin(c)*l}}const Tce=[{days:1,tier:0,label:"1 天"},{days:7,tier:1,label:"7 天"},{days:30,tier:2,label:"30 天"},{days:365,tier:3,label:"1 年"}],Ice=Tce.map(e=>({days:e.days,tier:e.tier,label:e.label,r:NL(e.days)}));function Ax(e){const t=Date.now()-e;return t<6e4?`${Math.floor(t/1e3)}秒前`:t<36e5?`${Math.floor(t/6e4)}分钟前`:t<864e5?`${Math.floor(t/36e5)}小时前`:`${Math.floor(t/864e5)}天前`}function Oce({item:e,pos:t,selected:n}){const r=e.requestCount||0,i=Math.min(r/100,1),a=e2+(Ece-e2)*i,s=Math.round(a*.85);return o.jsxs("g",{transform:`translate(${t.x} ${t.y})`,className:`am-node am-node--${e.status}${n?" am-node--selected":""}`,"data-sid":e.sessionId,children:[o.jsx("circle",{r:a+6,className:"am-node-glow"}),o.jsx("circle",{r:a,className:"am-node-circle",vectorEffect:"non-scaling-stroke"}),e.agent==="codex"?o.jsx(K0,{size:s,x:-s/2,y:-s/2}):e.agent==="opencode"?o.jsx(H0,{size:s,x:-s/2,y:-s/2}):o.jsx(W0,{size:s,x:-s/2,y:-s/2}),o.jsx("text",{textAnchor:"middle",dy:a+16,className:"am-node-title",children:(e.title||e.sessionId.slice(-8)).slice(0,18)}),o.jsx("text",{textAnchor:"middle",dy:a+32,className:"am-node-activity",children:e.lastToolName?`${tw[e.lastToolName]||"•"} ${e.lastToolName}`:(e.lastActivitySummary||"").slice(0,20)||Ax(e.lastRequestAt)}),e.source==="access-key"&&o.jsxs("text",{textAnchor:"middle",dy:a+48,className:"am-node-source",children:["🔑 ",e.keyName||"key"]})]})}function Nce({view:e,onView:t}){const n=i=>{const a=Ji/2,s=ea/2,{zoom:l,panX:c,panY:u}=e,p=Math.min(OL,Math.max(IL,l*i)),d=(a-c)/l,h=(s-u)/l;t({zoom:p,panX:a-d*p,panY:s-h*p})},r=Math.round(e.zoom*100);return o.jsxs("div",{className:"am-zoom",children:[o.jsx("button",{className:"am-zoom-btn",onClick:()=>n(1/1.2),title:"缩小",children:"−"}),o.jsxs("span",{className:"am-zoom-pct",children:[r,"%"]}),o.jsx("button",{className:"am-zoom-btn",onClick:()=>n(1.2),title:"放大",children:"+"}),o.jsx("button",{className:"am-zoom-btn",onClick:()=>t({zoom:1,panX:0,panY:0}),title:"重置缩放",children:"⟲"})]})}function Mce({sessions:e,now:t,selectedId:n,onSelect:r,view:i,onView:a,focus:s}){const l=f.useRef(null),c=f.useRef(null),u=f.useRef(i);u.current=i;const[p,d]=f.useState(!1),h=f.useMemo(()=>{const w={};for(const j of e)w[j.sessionId]=n2(j.sessionId,j.firstRequestAt,t);return w},[e,t]),m=f.useCallback((w,j)=>{const k=l.current;if(!k)return null;const S=k.getScreenCTM();if(!S)return null;const A=k.createSVGPoint();A.x=w,A.y=j;const T=A.matrixTransform(S.inverse());return{x:T.x,y:T.y}},[]);f.useEffect(()=>{const w=l.current;if(!w)return;const j=k=>{k.preventDefault();const S=m(k.clientX,k.clientY);if(!S)return;const{zoom:A,panX:T,panY:L}=u.current,O=k.deltaY<0?1.15:1/1.15,R=Math.min(OL,Math.max(IL,A*O)),_=(S.x-T)/A,X=(S.y-L)/A;a({zoom:R,panX:S.x-_*R,panY:S.y-X*R})};return w.addEventListener("wheel",j,{passive:!1}),()=>w.removeEventListener("wheel",j)},[m,a,e.length]),f.useEffect(()=>{if(!s)return;const w=e.find(k=>k.sessionId===s.sessionId);if(!w)return;const j=n2(s.sessionId,w.firstRequestAt,Date.now());a(k=>({zoom:k.zoom,panX:Ji/2-j.x*k.zoom,panY:ea/2-j.y*k.zoom}))},[s==null?void 0:s.nonce]);const g=f.useRef(null),v=w=>{var A,T;if(w.button!==0)return;d(!0);let j=w.target,k=null;for(;j&&j!==w.currentTarget;){const L=j.getAttribute&&j.getAttribute("data-sid");if(L){k=L;break}j=j.parentElement}const S=m(w.clientX,w.clientY);g.current={startClient:{x:w.clientX,y:w.clientY},startVB:S||{x:0,y:0},panX:u.current.panX,panY:u.current.panY,moved:!1,sid:k},(T=(A=w.currentTarget).setPointerCapture)==null||T.call(A,w.pointerId)},x=w=>{const j=g.current;if(!j)return;!j.moved&&Math.hypot(w.clientX-j.startClient.x,w.clientY-j.startClient.y)>5&&(j.moved=!0,r(null));const k=m(w.clientX,w.clientY);k&&a(S=>({...S,panX:j.panX+(k.x-j.startVB.x),panY:j.panY+(k.y-j.startVB.y)}))},y=()=>{d(!1);const w=g.current;g.current=null,!(!w||w.moved)&&r(w.sid)},b=f.useMemo(()=>{const w=j=>j.sessionId===n?2:j.status==="active"||j.status==="error"?1:0;return[...e].sort((j,k)=>w(j)-w(k))},[e,n]);return o.jsxs("svg",{ref:l,className:"am-canvas",viewBox:`0 0 ${Ji} ${ea}`,preserveAspectRatio:"xMidYMid meet",onPointerDown:v,onPointerMove:x,onPointerUp:y,onPointerLeave:y,onPointerCancel:y,style:{cursor:p?"grabbing":"grab",touchAction:"none"},children:[o.jsx("rect",{x:0,y:0,width:Ji,height:ea,fill:"transparent"}),o.jsxs("g",{ref:c,transform:`translate(${i.panX} ${i.panY}) scale(${i.zoom})`,children:[o.jsx("circle",{cx:Ji/2,cy:ea/2,r:4,className:"am-center-mark"}),Ice.map(w=>o.jsxs("g",{className:`am-ring am-ring--t${w.tier}`,children:[o.jsx("circle",{cx:Ji/2,cy:ea/2,r:w.r,fill:"none"}),o.jsx("text",{x:Ji/2,y:ea/2-w.r-6,textAnchor:"middle",className:"am-ring-label",children:w.label})]},`ring-${w.days}`)),e.filter(w=>w.status==="active").map(w=>{const j=h[w.sessionId];return j?o.jsx("line",{x1:Ji/2,y1:ea/2,x2:j.x,y2:j.y,className:"am-link am-link--active"},`l-${w.sessionId}`):null}),b.map(w=>{const j=h[w.sessionId];return j?o.jsx(Oce,{item:w,pos:j,selected:w.sessionId===n},w.sessionId):null})]})]})}const r2={type:"change"},py={type:"start"},i2={type:"end"},ap=new yD,a2=new vD,Rce=Math.cos(70*S2.DEG2RAD);class _ce extends gD{constructor(t,n){super(),this.object=t,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new rt,this.cursor=new rt,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Ps.ROTATE,MIDDLE:Ps.DOLLY,RIGHT:Ps.PAN},this.touches={ONE:As.ROTATE,TWO:As.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(D){D.addEventListener("keydown",M),this._domElementKeyEvents=D},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",M),this._domElementKeyEvents=null},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(r2),r.update(),a=i.NONE},this.update=function(){const D=new rt,ge=new Xc().setFromUnitVectors(t.up,new rt(0,1,0)),F=ge.clone().invert(),de=new rt,ve=new Xc,Ae=new rt,Ee=2*Math.PI;return function(nt=null){const at=r.object.position;D.copy(at).sub(r.target),D.applyQuaternion(ge),l.setFromVector3(D),r.autoRotate&&a===i.NONE&&_(O(nt)),r.enableDamping?(l.theta+=c.theta*r.dampingFactor,l.phi+=c.phi*r.dampingFactor):(l.theta+=c.theta,l.phi+=c.phi);let Je=r.minAzimuthAngle,nn=r.maxAzimuthAngle;isFinite(Je)&&isFinite(nn)&&(Je<-Math.PI?Je+=Ee:Je>Math.PI&&(Je-=Ee),nn<-Math.PI?nn+=Ee:nn>Math.PI&&(nn-=Ee),Je<=nn?l.theta=Math.max(Je,Math.min(nn,l.theta)):l.theta=l.theta>(Je+nn)/2?Math.max(Je,l.theta):Math.min(nn,l.theta)),l.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,l.phi)),l.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(p,r.dampingFactor):r.target.add(p),r.target.sub(r.cursor),r.target.clampLength(r.minTargetRadius,r.maxTargetRadius),r.target.add(r.cursor);let Kt=!1;if(r.zoomToCursor&&S||r.object.isOrthographicCamera)l.radius=P(l.radius);else{const ut=l.radius;l.radius=P(l.radius*u),Kt=ut!=l.radius}if(D.setFromSpherical(l),D.applyQuaternion(F),at.copy(r.target).add(D),r.object.lookAt(r.target),r.enableDamping===!0?(c.theta*=1-r.dampingFactor,c.phi*=1-r.dampingFactor,p.multiplyScalar(1-r.dampingFactor)):(c.set(0,0,0),p.set(0,0,0)),r.zoomToCursor&&S){let ut=null;if(r.object.isPerspectiveCamera){const Ht=D.length();ut=P(Ht*u);const Jt=Ht-ut;r.object.position.addScaledVector(j,Jt),r.object.updateMatrixWorld(),Kt=!!Jt}else if(r.object.isOrthographicCamera){const Ht=new rt(k.x,k.y,0);Ht.unproject(r.object);const Jt=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/u)),r.object.updateProjectionMatrix(),Kt=Jt!==r.object.zoom;const It=new rt(k.x,k.y,0);It.unproject(r.object),r.object.position.sub(It).add(Ht),r.object.updateMatrixWorld(),ut=D.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;ut!==null&&(this.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(ut).add(r.object.position):(ap.origin.copy(r.object.position),ap.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(ap.direction))<Rce?t.lookAt(r.target):(a2.setFromNormalAndCoplanarPoint(r.object.up,r.target),ap.intersectPlane(a2,r.target))))}else if(r.object.isOrthographicCamera){const ut=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/u)),ut!==r.object.zoom&&(r.object.updateProjectionMatrix(),Kt=!0)}return u=1,S=!1,Kt||de.distanceToSquared(r.object.position)>s||8*(1-ve.dot(r.object.quaternion))>s||Ae.distanceToSquared(r.target)>s?(r.dispatchEvent(r2),de.copy(r.object.position),ve.copy(r.object.quaternion),Ae.copy(r.target),!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",xe),r.domElement.removeEventListener("pointerdown",Ke),r.domElement.removeEventListener("pointercancel",Ye),r.domElement.removeEventListener("wheel",tt),r.domElement.removeEventListener("pointermove",pt),r.domElement.removeEventListener("pointerup",Ye),r.domElement.getRootNode().removeEventListener("keydown",Y,{capture:!0}),r._domElementKeyEvents!==null&&(r._domElementKeyEvents.removeEventListener("keydown",M),r._domElementKeyEvents=null)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let a=i.NONE;const s=1e-6,l=new Cw,c=new Cw;let u=1;const p=new rt,d=new Ln,h=new Ln,m=new Ln,g=new Ln,v=new Ln,x=new Ln,y=new Ln,b=new Ln,w=new Ln,j=new rt,k=new Ln;let S=!1;const A=[],T={};let L=!1;function O(D){return D!==null?2*Math.PI/60*r.autoRotateSpeed*D:2*Math.PI/60/60*r.autoRotateSpeed}function R(D){const ge=Math.abs(D*.01);return Math.pow(.95,r.zoomSpeed*ge)}function _(D){c.theta-=D}function X(D){c.phi-=D}const q=function(){const D=new rt;return function(F,de){D.setFromMatrixColumn(de,0),D.multiplyScalar(-F),p.add(D)}}(),I=function(){const D=new rt;return function(F,de){r.screenSpacePanning===!0?D.setFromMatrixColumn(de,1):(D.setFromMatrixColumn(de,0),D.crossVectors(r.object.up,D)),D.multiplyScalar(F),p.add(D)}}(),$=function(){const D=new rt;return function(F,de){const ve=r.domElement;if(r.object.isPerspectiveCamera){const Ae=r.object.position;D.copy(Ae).sub(r.target);let Ee=D.length();Ee*=Math.tan(r.object.fov/2*Math.PI/180),q(2*F*Ee/ve.clientHeight,r.object.matrix),I(2*de*Ee/ve.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(q(F*(r.object.right-r.object.left)/r.object.zoom/ve.clientWidth,r.object.matrix),I(de*(r.object.top-r.object.bottom)/r.object.zoom/ve.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function H(D){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u/=D:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function N(D){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u*=D:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function W(D,ge){if(!r.zoomToCursor)return;S=!0;const F=r.domElement.getBoundingClientRect(),de=D-F.left,ve=ge-F.top,Ae=F.width,Ee=F.height;k.x=de/Ae*2-1,k.y=-(ve/Ee)*2+1,j.set(k.x,k.y,1).unproject(r.object).sub(r.object.position).normalize()}function P(D){return Math.max(r.minDistance,Math.min(r.maxDistance,D))}function U(D){d.set(D.clientX,D.clientY)}function le(D){W(D.clientX,D.clientX),y.set(D.clientX,D.clientY)}function E(D){g.set(D.clientX,D.clientY)}function me(D){h.set(D.clientX,D.clientY),m.subVectors(h,d).multiplyScalar(r.rotateSpeed);const ge=r.domElement;_(2*Math.PI*m.x/ge.clientHeight),X(2*Math.PI*m.y/ge.clientHeight),d.copy(h),r.update()}function ye(D){b.set(D.clientX,D.clientY),w.subVectors(b,y),w.y>0?H(R(w.y)):w.y<0&&N(R(w.y)),y.copy(b),r.update()}function Q(D){v.set(D.clientX,D.clientY),x.subVectors(v,g).multiplyScalar(r.panSpeed),$(x.x,x.y),g.copy(v),r.update()}function ie(D){W(D.clientX,D.clientY),D.deltaY<0?N(R(D.deltaY)):D.deltaY>0&&H(R(D.deltaY)),r.update()}function je(D){let ge=!1;switch(D.code){case r.keys.UP:D.ctrlKey||D.metaKey||D.shiftKey?X(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(0,r.keyPanSpeed),ge=!0;break;case r.keys.BOTTOM:D.ctrlKey||D.metaKey||D.shiftKey?X(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(0,-r.keyPanSpeed),ge=!0;break;case r.keys.LEFT:D.ctrlKey||D.metaKey||D.shiftKey?_(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(r.keyPanSpeed,0),ge=!0;break;case r.keys.RIGHT:D.ctrlKey||D.metaKey||D.shiftKey?_(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(-r.keyPanSpeed,0),ge=!0;break}ge&&(D.preventDefault(),r.update())}function Z(D){if(A.length===1)d.set(D.pageX,D.pageY);else{const ge=Oe(D),F=.5*(D.pageX+ge.x),de=.5*(D.pageY+ge.y);d.set(F,de)}}function re(D){if(A.length===1)g.set(D.pageX,D.pageY);else{const ge=Oe(D),F=.5*(D.pageX+ge.x),de=.5*(D.pageY+ge.y);g.set(F,de)}}function pe(D){const ge=Oe(D),F=D.pageX-ge.x,de=D.pageY-ge.y,ve=Math.sqrt(F*F+de*de);y.set(0,ve)}function se(D){r.enableZoom&&pe(D),r.enablePan&&re(D)}function Re(D){r.enableZoom&&pe(D),r.enableRotate&&Z(D)}function ke(D){if(A.length==1)h.set(D.pageX,D.pageY);else{const F=Oe(D),de=.5*(D.pageX+F.x),ve=.5*(D.pageY+F.y);h.set(de,ve)}m.subVectors(h,d).multiplyScalar(r.rotateSpeed);const ge=r.domElement;_(2*Math.PI*m.x/ge.clientHeight),X(2*Math.PI*m.y/ge.clientHeight),d.copy(h)}function ne(D){if(A.length===1)v.set(D.pageX,D.pageY);else{const ge=Oe(D),F=.5*(D.pageX+ge.x),de=.5*(D.pageY+ge.y);v.set(F,de)}x.subVectors(v,g).multiplyScalar(r.panSpeed),$(x.x,x.y),g.copy(v)}function De(D){const ge=Oe(D),F=D.pageX-ge.x,de=D.pageY-ge.y,ve=Math.sqrt(F*F+de*de);b.set(0,ve),w.set(0,Math.pow(b.y/y.y,r.zoomSpeed)),H(w.y),y.copy(b);const Ae=(D.pageX+ge.x)*.5,Ee=(D.pageY+ge.y)*.5;W(Ae,Ee)}function qe(D){r.enableZoom&&De(D),r.enablePan&&ne(D)}function ze(D){r.enableZoom&&De(D),r.enableRotate&&ke(D)}function Ke(D){r.enabled!==!1&&(A.length===0&&(r.domElement.setPointerCapture(D.pointerId),r.domElement.addEventListener("pointermove",pt),r.domElement.addEventListener("pointerup",Ye)),!$e(D)&&(Se(D),D.pointerType==="touch"?fe(D):Qe(D)))}function pt(D){r.enabled!==!1&&(D.pointerType==="touch"?ee(D):Ze(D))}function Ye(D){switch(Le(D),A.length){case 0:r.domElement.releasePointerCapture(D.pointerId),r.domElement.removeEventListener("pointermove",pt),r.domElement.removeEventListener("pointerup",Ye),r.dispatchEvent(i2),a=i.NONE;break;case 1:const ge=A[0],F=T[ge];fe({pointerId:ge,pageX:F.x,pageY:F.y});break}}function Qe(D){let ge;switch(D.button){case 0:ge=r.mouseButtons.LEFT;break;case 1:ge=r.mouseButtons.MIDDLE;break;case 2:ge=r.mouseButtons.RIGHT;break;default:ge=-1}switch(ge){case Ps.DOLLY:if(r.enableZoom===!1)return;le(D),a=i.DOLLY;break;case Ps.ROTATE:if(D.ctrlKey||D.metaKey||D.shiftKey){if(r.enablePan===!1)return;E(D),a=i.PAN}else{if(r.enableRotate===!1)return;U(D),a=i.ROTATE}break;case Ps.PAN:if(D.ctrlKey||D.metaKey||D.shiftKey){if(r.enableRotate===!1)return;U(D),a=i.ROTATE}else{if(r.enablePan===!1)return;E(D),a=i.PAN}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(py)}function Ze(D){switch(a){case i.ROTATE:if(r.enableRotate===!1)return;me(D);break;case i.DOLLY:if(r.enableZoom===!1)return;ye(D);break;case i.PAN:if(r.enablePan===!1)return;Q(D);break}}function tt(D){r.enabled===!1||r.enableZoom===!1||a!==i.NONE||(D.preventDefault(),r.dispatchEvent(py),ie(J(D)),r.dispatchEvent(i2))}function J(D){const ge=D.deltaMode,F={clientX:D.clientX,clientY:D.clientY,deltaY:D.deltaY};switch(ge){case 1:F.deltaY*=16;break;case 2:F.deltaY*=100;break}return D.ctrlKey&&!L&&(F.deltaY*=10),F}function Y(D){D.key==="Control"&&(L=!0,r.domElement.getRootNode().addEventListener("keyup",ue,{passive:!0,capture:!0}))}function ue(D){D.key==="Control"&&(L=!1,r.domElement.getRootNode().removeEventListener("keyup",ue,{passive:!0,capture:!0}))}function M(D){r.enabled===!1||r.enablePan===!1||je(D)}function fe(D){switch(He(D),A.length){case 1:switch(r.touches.ONE){case As.ROTATE:if(r.enableRotate===!1)return;Z(D),a=i.TOUCH_ROTATE;break;case As.PAN:if(r.enablePan===!1)return;re(D),a=i.TOUCH_PAN;break;default:a=i.NONE}break;case 2:switch(r.touches.TWO){case As.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;se(D),a=i.TOUCH_DOLLY_PAN;break;case As.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Re(D),a=i.TOUCH_DOLLY_ROTATE;break;default:a=i.NONE}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(py)}function ee(D){switch(He(D),a){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;ke(D),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;ne(D),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;qe(D),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ze(D),r.update();break;default:a=i.NONE}}function xe(D){r.enabled!==!1&&D.preventDefault()}function Se(D){A.push(D.pointerId)}function Le(D){delete T[D.pointerId];for(let ge=0;ge<A.length;ge++)if(A[ge]==D.pointerId){A.splice(ge,1);return}}function $e(D){for(let ge=0;ge<A.length;ge++)if(A[ge]==D.pointerId)return!0;return!1}function He(D){let ge=T[D.pointerId];ge===void 0&&(ge=new Ln,T[D.pointerId]=ge),ge.set(D.pageX,D.pageY)}function Oe(D){const ge=D.pointerId===A[0]?A[1]:A[0];return T[ge]}r.domElement.addEventListener("contextmenu",xe),r.domElement.addEventListener("pointerdown",Ke),r.domElement.addEventListener("pointercancel",Ye),r.domElement.addEventListener("wheel",tt,{passive:!1}),r.domElement.getRootNode().addEventListener("keydown",Y,{passive:!0,capture:!0}),this.update()}}class fy extends k2{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Ln(.5,.5),this.addEventListener("removed",function(){this.traverse(function(n){n.element instanceof Element&&n.element.parentNode!==null&&n.element.parentNode.removeChild(n.element)})})}copy(t,n){return super.copy(t,n),this.element=t.element.cloneNode(!0),this.center=t.center,this}}const Ds=new rt,o2=new Ix,s2=new Ix,l2=new rt,c2=new rt;class Lce{constructor(t={}){const n=this;let r,i,a,s;const l={objects:new WeakMap},c=t.element!==void 0?t.element:document.createElement("div");c.style.overflow="hidden",this.domElement=c,this.getSize=function(){return{width:r,height:i}},this.render=function(g,v){g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),v.parent===null&&v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld(),o2.copy(v.matrixWorldInverse),s2.multiplyMatrices(v.projectionMatrix,o2),p(g,g,v),m(g)},this.setSize=function(g,v){r=g,i=v,a=r/2,s=i/2,c.style.width=g+"px",c.style.height=v+"px"};function u(g){g.isCSS2DObject&&(g.element.style.display="none");for(let v=0,x=g.children.length;v<x;v++)u(g.children[v])}function p(g,v,x){if(g.visible===!1){u(g);return}if(g.isCSS2DObject){Ds.setFromMatrixPosition(g.matrixWorld),Ds.applyMatrix4(s2);const y=Ds.z>=-1&&Ds.z<=1&&g.layers.test(x.layers)===!0,b=g.element;b.style.display=y===!0?"":"none",y===!0&&(g.onBeforeRender(n,v,x),b.style.transform="translate("+-100*g.center.x+"%,"+-100*g.center.y+"%)translate("+(Ds.x*a+a)+"px,"+(-Ds.y*s+s)+"px)",b.parentNode!==c&&c.appendChild(b),g.onAfterRender(n,v,x));const w={distanceToCameraSquared:d(x,g)};l.objects.set(g,w)}for(let y=0,b=g.children.length;y<b;y++)p(g.children[y],v,x)}function d(g,v){return l2.setFromMatrixPosition(g.matrixWorld),c2.setFromMatrixPosition(v.matrixWorld),l2.distanceToSquared(c2)}function h(g){const v=[];return g.traverseVisible(function(x){x.isCSS2DObject&&v.push(x)}),v}function m(g){const v=h(g).sort(function(y,b){if(y.renderOrder!==b.renderOrder)return b.renderOrder-y.renderOrder;const w=l.objects.get(y).distanceToCameraSquared,j=l.objects.get(b).distanceToCameraSquared;return w-j}),x=v.length;for(let y=0,b=v.length;y<b;y++)v[y].element.style.zIndex=x-y}}}const u2=new Ox,op=new rt;class ML extends xD{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(r),this.setAttribute("position",new Pw(t,3)),this.setAttribute("uv",new Pw(n,2))}applyMatrix4(t){const n=this.attributes.instanceStart,r=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(t),r.applyMatrix4(t),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let n;t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));const r=new xy(n,6,1);return this.setAttribute("instanceStart",new Fs(r,3,0)),this.setAttribute("instanceEnd",new Fs(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let n;t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));const r=new xy(n,6,1);return this.setAttribute("instanceColorStart",new Fs(r,3,0)),this.setAttribute("instanceColorEnd",new Fs(r,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new bD(t.geometry)),this}fromLineSegments(t){const n=t.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ox);const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;t!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(t),u2.setFromBufferAttribute(n),this.boundingBox.union(u2))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new C2),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(t!==void 0&&n!==void 0){const r=this.boundingSphere.center;this.boundingBox.getCenter(r);let i=0;for(let a=0,s=t.count;a<s;a++)op.fromBufferAttribute(t,a),i=Math.max(i,r.distanceToSquared(op)),op.fromBufferAttribute(n,a),i=Math.max(i,r.distanceToSquared(op));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}fp.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Ln(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};pp.line={uniforms:P2.merge([fp.common,fp.fog,fp.line]),vertexShader:`
812
+ #include <common>
813
+ #include <color_pars_vertex>
814
+ #include <fog_pars_vertex>
815
+ #include <logdepthbuf_pars_vertex>
816
+ #include <clipping_planes_pars_vertex>
817
+
818
+ uniform float linewidth;
819
+ uniform vec2 resolution;
820
+
821
+ attribute vec3 instanceStart;
822
+ attribute vec3 instanceEnd;
823
+
824
+ attribute vec3 instanceColorStart;
825
+ attribute vec3 instanceColorEnd;
826
+
827
+ #ifdef WORLD_UNITS
828
+
829
+ varying vec4 worldPos;
830
+ varying vec3 worldStart;
831
+ varying vec3 worldEnd;
832
+
833
+ #ifdef USE_DASH
834
+
835
+ varying vec2 vUv;
836
+
837
+ #endif
838
+
839
+ #else
840
+
841
+ varying vec2 vUv;
842
+
843
+ #endif
844
+
845
+ #ifdef USE_DASH
846
+
847
+ uniform float dashScale;
848
+ attribute float instanceDistanceStart;
849
+ attribute float instanceDistanceEnd;
850
+ varying float vLineDistance;
851
+
852
+ #endif
853
+
854
+ void trimSegment( const in vec4 start, inout vec4 end ) {
855
+
856
+ // trim end segment so it terminates between the camera plane and the near plane
857
+
858
+ // conservative estimate of the near plane
859
+ float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
860
+ float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
861
+ float nearEstimate = - 0.5 * b / a;
862
+
863
+ float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
864
+
865
+ end.xyz = mix( start.xyz, end.xyz, alpha );
866
+
867
+ }
868
+
869
+ void main() {
870
+
871
+ #ifdef USE_COLOR
872
+
873
+ vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
874
+
875
+ #endif
876
+
877
+ #ifdef USE_DASH
878
+
879
+ vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
880
+ vUv = uv;
881
+
882
+ #endif
883
+
884
+ float aspect = resolution.x / resolution.y;
885
+
886
+ // camera space
887
+ vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
888
+ vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
889
+
890
+ #ifdef WORLD_UNITS
891
+
892
+ worldStart = start.xyz;
893
+ worldEnd = end.xyz;
894
+
895
+ #else
896
+
897
+ vUv = uv;
898
+
899
+ #endif
900
+
901
+ // special case for perspective projection, and segments that terminate either in, or behind, the camera plane
902
+ // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
903
+ // but we need to perform ndc-space calculations in the shader, so we must address this issue directly
904
+ // perhaps there is a more elegant solution -- WestLangley
905
+
906
+ bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
907
+
908
+ if ( perspective ) {
909
+
910
+ if ( start.z < 0.0 && end.z >= 0.0 ) {
911
+
912
+ trimSegment( start, end );
913
+
914
+ } else if ( end.z < 0.0 && start.z >= 0.0 ) {
915
+
916
+ trimSegment( end, start );
917
+
918
+ }
919
+
920
+ }
921
+
922
+ // clip space
923
+ vec4 clipStart = projectionMatrix * start;
924
+ vec4 clipEnd = projectionMatrix * end;
925
+
926
+ // ndc space
927
+ vec3 ndcStart = clipStart.xyz / clipStart.w;
928
+ vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
929
+
930
+ // direction
931
+ vec2 dir = ndcEnd.xy - ndcStart.xy;
932
+
933
+ // account for clip-space aspect ratio
934
+ dir.x *= aspect;
935
+ dir = normalize( dir );
936
+
937
+ #ifdef WORLD_UNITS
938
+
939
+ vec3 worldDir = normalize( end.xyz - start.xyz );
940
+ vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );
941
+ vec3 worldUp = normalize( cross( worldDir, tmpFwd ) );
942
+ vec3 worldFwd = cross( worldDir, worldUp );
943
+ worldPos = position.y < 0.5 ? start: end;
944
+
945
+ // height offset
946
+ float hw = linewidth * 0.5;
947
+ worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;
948
+
949
+ // don't extend the line if we're rendering dashes because we
950
+ // won't be rendering the endcaps
951
+ #ifndef USE_DASH
952
+
953
+ // cap extension
954
+ worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;
955
+
956
+ // add width to the box
957
+ worldPos.xyz += worldFwd * hw;
958
+
959
+ // endcaps
960
+ if ( position.y > 1.0 || position.y < 0.0 ) {
961
+
962
+ worldPos.xyz -= worldFwd * 2.0 * hw;
963
+
964
+ }
965
+
966
+ #endif
967
+
968
+ // project the worldpos
969
+ vec4 clip = projectionMatrix * worldPos;
970
+
971
+ // shift the depth of the projected points so the line
972
+ // segments overlap neatly
973
+ vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
974
+ clip.z = clipPose.z * clip.w;
975
+
976
+ #else
977
+
978
+ vec2 offset = vec2( dir.y, - dir.x );
979
+ // undo aspect ratio adjustment
980
+ dir.x /= aspect;
981
+ offset.x /= aspect;
982
+
983
+ // sign flip
984
+ if ( position.x < 0.0 ) offset *= - 1.0;
985
+
986
+ // endcaps
987
+ if ( position.y < 0.0 ) {
988
+
989
+ offset += - dir;
990
+
991
+ } else if ( position.y > 1.0 ) {
992
+
993
+ offset += dir;
994
+
995
+ }
996
+
997
+ // adjust for linewidth
998
+ offset *= linewidth;
999
+
1000
+ // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
1001
+ offset /= resolution.y;
1002
+
1003
+ // select end
1004
+ vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
1005
+
1006
+ // back to clip space
1007
+ offset *= clip.w;
1008
+
1009
+ clip.xy += offset;
1010
+
1011
+ #endif
1012
+
1013
+ gl_Position = clip;
1014
+
1015
+ vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
1016
+
1017
+ #include <logdepthbuf_vertex>
1018
+ #include <clipping_planes_vertex>
1019
+ #include <fog_vertex>
1020
+
1021
+ }
1022
+ `,fragmentShader:`
1023
+ uniform vec3 diffuse;
1024
+ uniform float opacity;
1025
+ uniform float linewidth;
1026
+
1027
+ #ifdef USE_DASH
1028
+
1029
+ uniform float dashOffset;
1030
+ uniform float dashSize;
1031
+ uniform float gapSize;
1032
+
1033
+ #endif
1034
+
1035
+ varying float vLineDistance;
1036
+
1037
+ #ifdef WORLD_UNITS
1038
+
1039
+ varying vec4 worldPos;
1040
+ varying vec3 worldStart;
1041
+ varying vec3 worldEnd;
1042
+
1043
+ #ifdef USE_DASH
1044
+
1045
+ varying vec2 vUv;
1046
+
1047
+ #endif
1048
+
1049
+ #else
1050
+
1051
+ varying vec2 vUv;
1052
+
1053
+ #endif
1054
+
1055
+ #include <common>
1056
+ #include <color_pars_fragment>
1057
+ #include <fog_pars_fragment>
1058
+ #include <logdepthbuf_pars_fragment>
1059
+ #include <clipping_planes_pars_fragment>
1060
+
1061
+ vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
1062
+
1063
+ float mua;
1064
+ float mub;
1065
+
1066
+ vec3 p13 = p1 - p3;
1067
+ vec3 p43 = p4 - p3;
1068
+
1069
+ vec3 p21 = p2 - p1;
1070
+
1071
+ float d1343 = dot( p13, p43 );
1072
+ float d4321 = dot( p43, p21 );
1073
+ float d1321 = dot( p13, p21 );
1074
+ float d4343 = dot( p43, p43 );
1075
+ float d2121 = dot( p21, p21 );
1076
+
1077
+ float denom = d2121 * d4343 - d4321 * d4321;
1078
+
1079
+ float numer = d1343 * d4321 - d1321 * d4343;
1080
+
1081
+ mua = numer / denom;
1082
+ mua = clamp( mua, 0.0, 1.0 );
1083
+ mub = ( d1343 + d4321 * ( mua ) ) / d4343;
1084
+ mub = clamp( mub, 0.0, 1.0 );
1085
+
1086
+ return vec2( mua, mub );
1087
+
1088
+ }
1089
+
1090
+ void main() {
1091
+
1092
+ #include <clipping_planes_fragment>
1093
+
1094
+ #ifdef USE_DASH
1095
+
1096
+ if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
1097
+
1098
+ if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
1099
+
1100
+ #endif
1101
+
1102
+ float alpha = opacity;
1103
+
1104
+ #ifdef WORLD_UNITS
1105
+
1106
+ // Find the closest points on the view ray and the line segment
1107
+ vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
1108
+ vec3 lineDir = worldEnd - worldStart;
1109
+ vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
1110
+
1111
+ vec3 p1 = worldStart + lineDir * params.x;
1112
+ vec3 p2 = rayEnd * params.y;
1113
+ vec3 delta = p1 - p2;
1114
+ float len = length( delta );
1115
+ float norm = len / linewidth;
1116
+
1117
+ #ifndef USE_DASH
1118
+
1119
+ #ifdef USE_ALPHA_TO_COVERAGE
1120
+
1121
+ float dnorm = fwidth( norm );
1122
+ alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
1123
+
1124
+ #else
1125
+
1126
+ if ( norm > 0.5 ) {
1127
+
1128
+ discard;
1129
+
1130
+ }
1131
+
1132
+ #endif
1133
+
1134
+ #endif
1135
+
1136
+ #else
1137
+
1138
+ #ifdef USE_ALPHA_TO_COVERAGE
1139
+
1140
+ // artifacts appear on some hardware if a derivative is taken within a conditional
1141
+ float a = vUv.x;
1142
+ float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
1143
+ float len2 = a * a + b * b;
1144
+ float dlen = fwidth( len2 );
1145
+
1146
+ if ( abs( vUv.y ) > 1.0 ) {
1147
+
1148
+ alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
1149
+
1150
+ }
1151
+
1152
+ #else
1153
+
1154
+ if ( abs( vUv.y ) > 1.0 ) {
1155
+
1156
+ float a = vUv.x;
1157
+ float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
1158
+ float len2 = a * a + b * b;
1159
+
1160
+ if ( len2 > 1.0 ) discard;
1161
+
1162
+ }
1163
+
1164
+ #endif
1165
+
1166
+ #endif
1167
+
1168
+ vec4 diffuseColor = vec4( diffuse, alpha );
1169
+
1170
+ #include <logdepthbuf_fragment>
1171
+ #include <color_fragment>
1172
+
1173
+ gl_FragColor = vec4( diffuseColor.rgb, alpha );
1174
+
1175
+ #include <tonemapping_fragment>
1176
+ #include <colorspace_fragment>
1177
+ #include <fog_fragment>
1178
+ #include <premultiplied_alpha_fragment>
1179
+
1180
+ }
1181
+ `};class rl extends wD{constructor(t){super({type:"LineMaterial",uniforms:P2.clone(pp.line.uniforms),vertexShader:pp.line.vertexShader,fragmentShader:pp.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){t===!0!==this.dashed&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(t===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),t===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const hy=new Iu,d2=new rt,p2=new rt,On=new Iu,Nn=new Iu,ki=new Iu,my=new rt,gy=new Ix,_n=new jD,f2=new rt,sp=new Ox,lp=new C2,Ci=new Iu;let Mi,Jo;function h2(e,t,n){return Ci.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),Ci.multiplyScalar(1/Ci.w),Ci.x=Jo/n.width,Ci.y=Jo/n.height,Ci.applyMatrix4(e.projectionMatrixInverse),Ci.multiplyScalar(1/Ci.w),Math.abs(Math.max(Ci.x,Ci.y))}function Dce(e,t){const n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,s=Math.min(r.instanceCount,i.count);for(let l=0,c=s;l<c;l++){_n.start.fromBufferAttribute(i,l),_n.end.fromBufferAttribute(a,l),_n.applyMatrix4(n);const u=new rt,p=new rt;Mi.distanceSqToSegment(_n.start,_n.end,p,u),p.distanceTo(u)<Jo*.5&&t.push({point:p,pointOnLine:u,distance:Mi.origin.distanceTo(p),object:e,face:null,faceIndex:l,uv:null,uv1:null})}}function zce(e,t,n){const r=t.projectionMatrix,a=e.material.resolution,s=e.matrixWorld,l=e.geometry,c=l.attributes.instanceStart,u=l.attributes.instanceEnd,p=Math.min(l.instanceCount,c.count),d=-t.near;Mi.at(1,ki),ki.w=1,ki.applyMatrix4(t.matrixWorldInverse),ki.applyMatrix4(r),ki.multiplyScalar(1/ki.w),ki.x*=a.x/2,ki.y*=a.y/2,ki.z=0,my.copy(ki),gy.multiplyMatrices(t.matrixWorldInverse,s);for(let h=0,m=p;h<m;h++){if(On.fromBufferAttribute(c,h),Nn.fromBufferAttribute(u,h),On.w=1,Nn.w=1,On.applyMatrix4(gy),Nn.applyMatrix4(gy),On.z>d&&Nn.z>d)continue;if(On.z>d){const w=On.z-Nn.z,j=(On.z-d)/w;On.lerp(Nn,j)}else if(Nn.z>d){const w=Nn.z-On.z,j=(Nn.z-d)/w;Nn.lerp(On,j)}On.applyMatrix4(r),Nn.applyMatrix4(r),On.multiplyScalar(1/On.w),Nn.multiplyScalar(1/Nn.w),On.x*=a.x/2,On.y*=a.y/2,Nn.x*=a.x/2,Nn.y*=a.y/2,_n.start.copy(On),_n.start.z=0,_n.end.copy(Nn),_n.end.z=0;const v=_n.closestPointToPointParameter(my,!0);_n.at(v,f2);const x=S2.lerp(On.z,Nn.z,v),y=x>=-1&&x<=1,b=my.distanceTo(f2)<Jo*.5;if(y&&b){_n.start.fromBufferAttribute(c,h),_n.end.fromBufferAttribute(u,h),_n.start.applyMatrix4(s),_n.end.applyMatrix4(s);const w=new rt,j=new rt;Mi.distanceSqToSegment(_n.start,_n.end,j,w),n.push({point:j,pointOnLine:w,distance:Mi.origin.distanceTo(j),object:e,face:null,faceIndex:h,uv:null,uv1:null})}}}class $ce extends Ra{constructor(t=new ML,n=new rl({color:Math.random()*16777215})){super(t,n),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,n=t.attributes.instanceStart,r=t.attributes.instanceEnd,i=new Float32Array(2*n.count);for(let s=0,l=0,c=n.count;s<c;s++,l+=2)d2.fromBufferAttribute(n,s),p2.fromBufferAttribute(r,s),i[l]=l===0?0:i[l-1],i[l+1]=i[l]+d2.distanceTo(p2);const a=new xy(i,2,1);return t.setAttribute("instanceDistanceStart",new Fs(a,1,0)),t.setAttribute("instanceDistanceEnd",new Fs(a,1,1)),this}raycast(t,n){const r=this.material.worldUnits,i=t.camera;i===null&&!r&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const a=t.params.Line2!==void 0&&t.params.Line2.threshold||0;Mi=t.ray;const s=this.matrixWorld,l=this.geometry,c=this.material;Jo=c.linewidth+a,l.boundingSphere===null&&l.computeBoundingSphere(),lp.copy(l.boundingSphere).applyMatrix4(s);let u;if(r)u=Jo*.5;else{const d=Math.max(i.near,lp.distanceToPoint(Mi.origin));u=h2(i,d,c.resolution)}if(lp.radius+=u,Mi.intersectsSphere(lp)===!1)return;l.boundingBox===null&&l.computeBoundingBox(),sp.copy(l.boundingBox).applyMatrix4(s);let p;if(r)p=Jo*.5;else{const d=Math.max(i.near,sp.distanceToPoint(Mi.origin));p=h2(i,d,c.resolution)}sp.expandByScalar(p),Mi.intersectsBox(sp)!==!1&&(r?Dce(this,n):zce(this,i,n))}onBeforeRender(t){const n=this.material.uniforms;n&&n.resolution&&(t.getViewport(hy),this.material.uniforms.resolution.value.set(hy.z,hy.w))}}class Ex extends ML{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const n=t.length-3,r=new Float32Array(2*n);for(let i=0;i<n;i+=3)r[2*i]=t[i],r[2*i+1]=t[i+1],r[2*i+2]=t[i+2],r[2*i+3]=t[i+3],r[2*i+4]=t[i+4],r[2*i+5]=t[i+5];return super.setPositions(r),this}setColors(t){const n=t.length-3,r=new Float32Array(2*n);for(let i=0;i<n;i+=3)r[2*i]=t[i],r[2*i+1]=t[i+1],r[2*i+2]=t[i+2],r[2*i+3]=t[i+3],r[2*i+4]=t[i+4],r[2*i+5]=t[i+5];return super.setColors(r),this}fromLine(t){const n=t.geometry;return this.setPositions(n.attributes.position.array),this}}class cp extends $ce{constructor(t=new Ex,n=new rl({color:Math.random()*16777215})){super(t,n),this.isLine2=!0,this.type="Line2"}}const Bce=864e5,Fce=1e6,Sc=[0,1,7,30,365],Uce=[32,48,48,32],kc=(()=>{const e=[0];let t=0;for(const n of Uce)t+=n,e.push(t);return e})(),Ii=new rt(0,0,0);function Tx(e){if(!Number.isFinite(e)||e<=0)return 0;for(let t=1;t<Sc.length;t++)if(e<=Sc[t]){const n=(e-Sc[t-1])/(Sc[t]-Sc[t-1]);return kc[t-1]+(kc[t]-kc[t-1])*n}return kc[kc.length-1]}const ch=.7,RL=4,Gc=10;function Wce(e){return Math.min((e||0)/100,1)}function m2(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}function Kce(e){const t=Math.max(0,e|0);return t<=0?0:Math.max(0,Math.min(1,Math.log10(t+1)/Math.log10(Fce+1)))}const g2=[9,9,18,36,72,144],y2=[0,1e4,1e5,1e6,1e7,1e8,1e9];function Hce(){const e=[[y2[0],0]];let t=0;for(let n=0;n<g2.length;n++)t+=g2[n],e.push([y2[n+1],t]);return e}const zs=Hce(),yy=[[1e4,Io(1e4)],[1e5,Io(1e5)],[1e6,Io(1e6)],[1e7,Io(1e7)],[1e8,Io(1e8)],[1e9,Io(1e9)]];function Io(e){const t=Math.max(0,e|0);if(t<=0)return 0;for(let n=1;n<zs.length;n++)if(t<=zs[n][0]){const[r,i]=zs[n-1],[a,s]=zs[n],l=(t-r)/(a-r);return i+(s-i)*l}return zs[zs.length-1][1]}function Vce(e){return Io(e)}function qce(e){return e>=1e9?`${e/1e9}B`:e>=1e6?`${e/1e6}M`:e>=1e3?`${e/1e3}k`:`${e}`}function Yce(e){const t=Wce(e),n=Math.max(0,Math.min(Gc-1,Math.round(t*(Gc-1))));return{radius:ch+(RL-ch)*(n/(Gc-1)),bucket:n}}function Gce(e,t){const n=t-e.firstRequestAt,r=Number.isFinite(n)&&n>0?n/Bce:0,i=(m2(e.sessionId)%360+(m2(e.sessionId+"~j")%40-20))*(Math.PI/180),a=Tx(r),s=Math.cos(i)*a,l=Math.sin(i)*a,c=Kce(e.totalTokens),u=Vce(e.totalTokens),p=new rt(s,u,l);let d=null;const h=e.inputTokens|0,m=e.outputTokens|0;if(h>0&&m>0){const y=Math.min(h/(h+m),.85);d=new rt(Ii.x+(p.x-Ii.x)*y,Ii.y+(p.y-Ii.y)*y,Ii.z+(p.z-Ii.z)*y)}const{radius:g,bucket:v}=Yce(e.requestCount);return{pos:p,radius:g,bucket:v,depth01:c,split:d}}const Xce='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude Code</title><path clip-rule="evenodd" d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z" fill="#D97757" fill-rule="evenodd"></path></svg>',Qce=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Codex</title><path clip-rule="evenodd" d="M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z" fill="url(#codex-gradient)" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="codex-gradient" x1="12" x2="12" y1="3" y2="21"><stop stop-color="#B1A7FF"></stop><stop offset=".5" stop-color="#7A9DFF"></stop><stop offset="1" stop-color="#3941FF"></stop></linearGradient></defs></svg>
1182
+ `,Zce=`<svg fill="#10B981" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>opencode</title><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>
1183
+ `,v2=new rt(0,60,60),vy=new rt(0,28,0),up=new rt(0,.82,.58).normalize(),x2=.32,b2=54784;function Jce(e){const n=new FD(1,1,12,12),r=n.attributes.position,i=Math.abs(up.y)<.9?new rt(0,1,0):new rt(0,0,1),a=new rt().crossVectors(up,i).normalize(),s=new rt().crossVectors(up,a).normalize(),l=new Xc,c=new Xc,u=new rt;for(let p=0;p<r.count;p++){const d=r.getX(p)*2*x2,h=r.getY(p)*2*x2;l.setFromAxisAngle(a,d),c.setFromAxisAngle(s,h),u.copy(up).applyQuaternion(l).applyQuaternion(c).normalize();const m=e*1.003;r.setXYZ(p,u.x*m,u.y*m,u.z*m)}return r.needsUpdate=!0,n.computeVertexNormals(),n}const dp={active:"--accent-primary",idle:"--accent-warning",completed:"--border-secondary",error:"--accent-danger"};class eue{constructor(t,n){Be(this,"container");Be(this,"cb");Be(this,"renderer");Be(this,"css2d");Be(this,"scene");Be(this,"camera");Be(this,"controls");Be(this,"raycaster",new SD);Be(this,"pointer",new Ln);Be(this,"clock",new kD);Be(this,"nodes",new Map);Be(this,"links",new Map);Be(this,"pickables",[]);Be(this,"sphereGeoms",[]);Be(this,"glowGeoms",[]);Be(this,"decalGeoms",[]);Be(this,"ringPivot");Be(this,"ringMesh");Be(this,"ringMat");Be(this,"floor");Be(this,"floorRings",[]);Be(this,"apexMat");Be(this,"apexMesh");Be(this,"axisMat");Be(this,"axisLine");Be(this,"axisLabels",[]);Be(this,"ringLabels",[]);Be(this,"palette");Be(this,"completedNodeColor");Be(this,"bgColor");Be(this,"logoTexCache",new Map);Be(this,"logoImg",{});Be(this,"selectedId",null);Be(this,"showAllLabels",!1);Be(this,"showLinks",!1);Be(this,"focusTarget",null);Be(this,"rafId",0);Be(this,"running",!1);Be(this,"disposed",!1);Be(this,"downClient",{x:0,y:0});Be(this,"downCamPos",new rt);Be(this,"downCamQuat",new Xc);Be(this,"pointerDownTime",0);Be(this,"ro");Be(this,"mo");Be(this,"probeEl");Be(this,"onPointerDown",t=>{this.downClient={x:t.clientX,y:t.clientY},this.downCamPos.copy(this.camera.position),this.downCamQuat.copy(this.camera.quaternion),this.pointerDownTime=performance.now()});Be(this,"onPointerUp",t=>{const n=Math.hypot(t.clientX-this.downClient.x,t.clientY-this.downClient.y),r=this.camera.position.distanceTo(this.downCamPos)>1e-4||Math.abs(this.camera.quaternion.dot(this.downCamQuat))<.9995,i=performance.now()-this.pointerDownTime;if(n>5||r||i>350)return;const a=this.renderer.domElement.getBoundingClientRect();this.pointer.x=(t.clientX-a.left)/a.width*2-1,this.pointer.y=-((t.clientY-a.top)/a.height)*2+1,this.raycaster.setFromCamera(this.pointer,this.camera);const s=this.raycaster.intersectObjects(this.pickables,!1);if(s.length>0){const l=s[0].object,c=this.findByMesh(l);this.cb.onSelect(c?c.sessionId:null)}else this.cb.onSelect(null)});Be(this,"onContextLost",t=>{var n,r;t.preventDefault(),this.running=!1,cancelAnimationFrame(this.rafId),(r=(n=this.cb).onContextLost)==null||r.call(n)});Be(this,"onVisibility",()=>{document.hidden?(this.running=!1,cancelAnimationFrame(this.rafId)):!this.disposed&&!this.running&&(this.running=!0,this.clock.getDelta(),this.loop())});Be(this,"loop",()=>{if(!this.running||this.disposed)return;this.rafId=requestAnimationFrame(this.loop);const t=Math.min(this.clock.getDelta(),.05),n=this.clock.elapsedTime,r=1-Math.exp(-t*6);for(const i of this.nodes.values())i.group.position.lerp(i.targetPos,r),i.glow.visible&&(i.glowMat.opacity=(.4+Math.sin(n*2)*.2)*.5,i.glow.scale.setScalar(1+Math.sin(n*2)*.05)),i.inFlight>0?i.sphere.scale.setScalar(1+Math.sin(n*6)*.05):i.sphere.scale.x!==1&&i.sphere.scale.setScalar(1);if(this.selectedId&&this.ringPivot.visible){const i=this.nodes.get(this.selectedId);i?(this.ringPivot.position.copy(i.group.position),this.ringPivot.rotation.y+=t*.8):this.ringPivot.visible=!1}this.focusTarget&&(this.camera.position.lerp(this.focusTarget.cam,1-Math.exp(-t*3)),this.controls.target.lerp(this.focusTarget.look,1-Math.exp(-t*3)),this.camera.position.distanceTo(this.focusTarget.cam)<.1&&(this.focusTarget=null)),this.controls.update(),this.renderer.render(this.scene,this.camera),this.css2d.render(this.scene,this.camera)});this.container=t,this.cb=n,this.probeEl=document.createElement("div"),this.probeEl.style.position="absolute",this.probeEl.style.visibility="hidden",this.probeEl.style.pointerEvents="none";try{this.build()}catch(r){throw this.dispose(),r}}build(){const t=this.container.clientWidth||800,n=this.container.clientHeight||600;this.renderer=new CD({antialias:!0,alpha:!0,powerPreference:"high-performance"}),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.renderer.setSize(t,n),this.renderer.setClearColor(0,0),this.renderer.toneMapping=PD,this.renderer.toneMappingExposure=1.05,this.renderer.outputColorSpace=Aw,this.renderer.domElement.style.position="absolute",this.renderer.domElement.style.inset="0",this.renderer.domElement.style.width="100%",this.renderer.domElement.style.height="100%",this.renderer.domElement.style.display="block",this.renderer.domElement.style.cursor="grab",this.container.appendChild(this.renderer.domElement),this.renderer.domElement.addEventListener("webglcontextlost",this.onContextLost,!1),this.css2d=new Lce,this.css2d.setSize(t,n);const r=this.css2d.domElement;r.style.position="absolute",r.style.inset="0",r.style.width="100%",r.style.height="100%",r.style.pointerEvents="none",this.container.appendChild(r),this.scene=new AD,this.refreshPalette(),this.scene.background=null,this.scene.fog=new ED(this.bgColor.getHex(),250,3e3),this.camera=new TD(50,t/n,.1,3e4),this.camera.position.copy(v2),this.camera.lookAt(vy);const i=new ID(16777215,.85);this.scene.add(i);const a=new OD(16777215,1);a.position.set(150,500,200),this.scene.add(a);const s=new ND(16767392,.6,2e3,1.2);s.position.set(0,150,0),this.scene.add(s),this.controls=new _ce(this.camera,this.renderer.domElement),this.controls.target.copy(vy),this.controls.enableDamping=!0,this.controls.dampingFactor=.08,this.controls.rotateSpeed=.7,this.controls.zoomSpeed=.9,this.controls.panSpeed=.8,this.controls.minDistance=6,this.controls.maxDistance=6e3,this.controls.maxPolarAngle=Math.PI*.49,this.controls.addEventListener("start",()=>{this.focusTarget=null,this.renderer.domElement.style.cursor="grabbing"}),this.controls.addEventListener("end",()=>{this.renderer.domElement.style.cursor="grab"});for(let p=0;p<Gc;p++){const d=this.bucketRadius(p);this.sphereGeoms.push(new Ew(d,32,24)),this.glowGeoms.push(new Ew(d*1.55,24,16)),this.decalGeoms.push(Jce(d))}const l=Tx(365)+14;this.floor=new Ra(new Tw(l,96),new Es({color:this.palette.completed,transparent:!0,opacity:.05,side:tc})),this.floor.rotation.x=-Math.PI/2,this.scene.add(this.floor);const c=[1,7,30,365];for(const p of c){const d=Tx(p),h=new Es({color:this.palette.completed,transparent:!0,opacity:.2,side:tc}),m=new Ra(new MD(d-1,d+1,128),h);m.rotation.x=-Math.PI/2,m.position.y=.01,this.scene.add(m),this.floorRings.push({mesh:m,mat:h});const g=document.createElement("div");g.className="am-axis-label",g.style.pointerEvents="none",g.textContent=p>=365?"1年":`${p} 天`;const v=new fy(g);v.position.set(d,.6,0),this.scene.add(v),this.ringLabels.push(v)}this.apexMat=new Es({color:this.palette.completed,side:tc}),this.apexMesh=new Ra(new Tw(.7,32),this.apexMat),this.apexMesh.rotation.x=-Math.PI/2,this.apexMesh.position.set(0,.02,0),this.scene.add(this.apexMesh),this.ringMat=new Es({color:this.palette.active.clone(),transparent:!0,opacity:.85,side:tc}),this.ringMesh=new Ra(new RD(1,.05,12,80),this.ringMat),this.ringMesh.rotation.x=Math.PI*.42,this.ringPivot=new k2,this.ringPivot.add(this.ringMesh),this.ringPivot.visible=!1,this.scene.add(this.ringPivot),this.buildAxis(t,n);const u=this.renderer.domElement;u.addEventListener("pointerdown",this.onPointerDown),u.addEventListener("pointerup",this.onPointerUp),this.ro=new ResizeObserver(()=>this.resize()),this.ro.observe(this.container),this.mo=new MutationObserver(()=>this.refreshTheme()),this.mo.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),document.addEventListener("visibilitychange",this.onVisibility),this.running=!0,this.clock.start(),this.loop()}bucketRadius(t){return ch+(RL-ch)*(t/(Gc-1))}getDecalTex(t){const n=this.logoTexCache.get(t);if(n)return n;const r=256,i=document.createElement("canvas");i.width=i.height=r;const a=i.getContext("2d");a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high";const s=new _D(i);s.colorSpace=Aw,s.generateMipmaps=!0,s.minFilter=LD,s.magFilter=DD,s.anisotropy=8,this.logoTexCache.set(t,s);const c=Math.round(r*.8),u=(r-c)/2;return this.ensureLogoImg(t).then(p=>{a.drawImage(p,u,u,c,c),s.needsUpdate=!0}),s}applyDecalTint(t,n){n==="completed"?(t.opacity=.32,t.color.set(10133670)):n==="idle"?(t.opacity=.8,t.color.set(16777215)):(t.opacity=1,t.color.set(16777215))}applyNodeAppearance(t){const n=t.sessionId===this.selectedId,r=t.status==="completed";n?(t.sphereMat.wireframe=!1,t.sphereMat.transparent=!1,t.sphereMat.opacity=1,t.decalMat.opacity=1,t.decalMat.color.set(16777215)):(t.sphereMat.transparent=r,t.sphereMat.opacity=r?.7:1,t.sphereMat.wireframe=r,this.applyDecalTint(t.decalMat,t.status))}ensureLogoImg(t){const n=this.logoImg[t];if(n&&n.complete)return Promise.resolve(n);const i=(t==="codex"?Qce:t==="opencode"?Zce:Xce).replace(/width="[^"]*"/,'width="512"').replace(/height="[^"]*"/,'height="512"'),a="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i),s=n||new Image;s.crossOrigin="anonymous";const l=new Promise(c=>{s.onload=()=>{this.logoImg[t]=s,c(s)},s.onerror=()=>c(s)});return s.src=a,l}buildAxis(t,n){const r=yy[yy.length-1][1]+6;this.axisMat=new rl({color:this.palette.completed.getHex(),linewidth:2,transparent:!0,opacity:.5,dashed:!0,dashScale:1,dashSize:.4,gapSize:.25}),this.axisMat.resolution=new Ln(t,n);const i=new Ex;i.setPositions([0,0,0,0,r,0]),this.axisLine=new cp(i,this.axisMat),this.axisLine.computeLineDistances(),this.scene.add(this.axisLine);for(const[a,s]of yy){const l=document.createElement("div");l.className="am-axis-label",l.style.pointerEvents="none",l.textContent=qce(a);const c=new fy(l);c.position.set(.6,s,0),this.scene.add(c),this.axisLabels.push(c)}}refreshPalette(){this.palette={active:this.resolveColor(dp.active),idle:this.resolveColor(dp.idle),completed:this.resolveColor(dp.completed),error:this.resolveColor(dp.error)},this.bgColor=this.resolveColor("--bg-primary-solid"),this.completedNodeColor=new Iw(document.documentElement.getAttribute("data-theme")==="dark"?"#4ADE80":"#86EFAC")}resolveColor(t){this.probeEl.parentElement||document.body.appendChild(this.probeEl),this.probeEl.style.color=`var(${t})`;const n=getComputedStyle(this.probeEl).color||"rgb(128,128,128)";return new Iw(n)}refreshTheme(){this.refreshPalette(),this.scene.fog&&this.scene.fog.color.copy(this.bgColor);for(const t of this.nodes.values()){const n=t.status==="completed";t.sphereMat.color.copy(n?this.completedNodeColor:this.palette[t.status]),t.glowMat.color.copy(this.palette[t.status])}for(const t of this.links.values())t.bgMat.color.copy(this.palette.active),t.segInMat.color.copy(this.palette.active),t.segOutMat.color.setHex(b2);this.floor.material.color.copy(this.palette.completed);for(const t of this.floorRings)t.mat.color.copy(this.palette.completed);if(this.apexMat.color.copy(this.palette.completed),this.selectedId){const t=this.nodes.get(this.selectedId);t&&this.ringMat.color.copy(t.status==="completed"?this.completedNodeColor:this.palette[t.status])}this.axisMat&&this.axisMat.color.copy(this.palette.completed)}update(t,n){if(this.disposed)return;const r=new Set(t.map(i=>i.sessionId));for(const i of t){const a=Gce(i,n),s=this.nodes.get(i.sessionId);s?this.updateNode(s,i,a):this.createNode(i,a);const l=this.links.get(i.sessionId);l?this.updateLink(l,a):this.createLink(i.sessionId,a)}for(const[i,a]of[...this.nodes.entries()])if(!r.has(i)){this.disposeNode(a),this.nodes.delete(i);const s=this.links.get(i);s&&(this.disposeLink(s),this.links.delete(i))}this.selectedId&&!this.nodes.has(this.selectedId)&&this.applySelection(null),this.refreshPickables()}createNode(t,n){const r=new Ow;r.position.copy(n.pos);const i=this.sphereGeoms[n.bucket],a=t.status==="completed",s=new zD({color:(a?this.completedNodeColor:this.palette[t.status]).clone(),roughness:.5,metalness:.1,transparent:a,opacity:a?.7:1,wireframe:a}),l=new Ra(i,s);r.add(l);const c=new Es({color:this.palette[t.status].clone(),transparent:!0,opacity:0,side:BD,depthWrite:!1,blending:$D}),u=new Ra(this.glowGeoms[n.bucket],c);u.visible=t.status==="active",r.add(u);const p=new Es({map:this.getDecalTex(t.agent),transparent:!0,depthWrite:!1,side:tc});this.applyDecalTint(p,t.status);const d=new Ra(this.decalGeoms[n.bucket],p);l.add(d);const h=t.sessionId,m=document.createElement("div");m.className="am-node-label";const g=this.showAllLabels?"auto":"none";m.style.pointerEvents=g,m.style.cursor=g==="auto"?"pointer":"default",m.addEventListener("click",w=>{w.stopPropagation(),this.cb.onSelect(h)});const v=document.createElement("div");v.className="am-node-label-title";const x=document.createElement("div");x.className="am-node-label-sub",m.appendChild(v),m.appendChild(x);const y=new fy(m);y.position.set(0,-n.radius*1.8,0),r.add(y),this.scene.add(r);const b={sessionId:t.sessionId,group:r,sphere:l,sphereMat:s,glow:u,glowMat:c,decal:d,decalMat:p,labelEl:m,label:y,targetPos:n.pos.clone(),status:t.status,radius:n.radius,bucket:n.bucket,depth01:n.depth01,inFlight:t.inFlight|0,split:n.split?n.split.clone():null};this.nodes.set(t.sessionId,b),this.writeLabel(b,t),this.syncLabel(b),this.applyNodeAppearance(b)}updateNode(t,n,r){if(t.targetPos.copy(r.pos),t.depth01=r.depth01,t.inFlight=n.inFlight|0,t.split=r.split?r.split.clone():null,r.bucket!==t.bucket&&(t.bucket=r.bucket,t.radius=r.radius,t.sphere.geometry=this.sphereGeoms[r.bucket],t.glow.geometry=this.glowGeoms[r.bucket],t.decal.geometry=this.decalGeoms[r.bucket],t.label.position.set(0,-r.radius*1.8,0),this.selectedId===t.sessionId&&this.ringMesh.scale.setScalar(r.radius*1.8)),n.status!==t.status){t.status=n.status;const a=n.status==="completed"?this.completedNodeColor:this.palette[n.status];t.sphereMat.color.copy(a),t.glowMat.color.copy(this.palette[n.status]),t.glow.visible=n.status==="active",this.applyNodeAppearance(t),t.sessionId===this.selectedId&&this.showRing(t)}this.writeLabel(t,n),this.syncLabel(t)}writeLabel(t,n){const r=t.labelEl.firstChild,i=t.labelEl.lastChild;r.textContent=(n.title||n.sessionId.slice(-8)).slice(0,20);const a=[];n.totalTokens>0&&a.push(`${this.formatTokens(n.totalTokens)} tok`),n.lastToolName&&a.push(n.lastToolName),n.source==="access-key"&&n.keyName&&a.push(`🔑 ${n.keyName}`),i.textContent=a.join(" · ")}syncLabel(t){t.label.visible=this.showAllLabels||t.sessionId===this.selectedId}setLabelsVisible(t){if(this.showAllLabels===t)return;this.showAllLabels=t;const n=t?"auto":"none";for(const r of this.nodes.values())r.labelEl.style.pointerEvents=n,r.labelEl.style.cursor=n==="auto"?"pointer":"default",this.syncLabel(r)}formatTokens(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)}k`:`${t}`}createLink(t,n){const r=new Ow,i=this.container.clientWidth||800,a=this.container.clientHeight||600,s=new Ln(i,a),l=!!n.split,c=new rl({color:this.palette.active.getHex(),linewidth:3,transparent:!0,opacity:.85+n.depth01*.15,dashed:!1});c.resolution=s;const u=new cp(this.makeLineGeo(Ii,n.pos),c),p=new rl({color:this.palette.active.getHex(),linewidth:3,transparent:!0,opacity:.95});p.resolution=s;const d=new rl({color:b2,linewidth:3,transparent:!0,opacity:.95});d.resolution=s;const h=n.split??n.pos,m=new cp(this.makeLineGeo(Ii,h),p),g=new cp(this.makeLineGeo(h,n.pos),d);u.visible=!l,m.visible=l,g.visible=l,r.add(u,m,g),r.visible=this.linkVisible(t),this.scene.add(r),this.links.set(t,{group:r,bg:u,bgMat:c,segIn:m,segInMat:p,segOut:g,segOutMat:d})}linkVisible(t){return this.showLinks||t===this.selectedId}setLinksVisible(t){if(this.showLinks!==t){this.showLinks=t;for(const[n,r]of this.links)r.group.visible=this.linkVisible(n)}}updateLink(t,n){const r=!!n.split,i=n.split??n.pos;this.setLineGeo(t.bg.geometry,Ii,n.pos),t.bgMat.opacity=.85+n.depth01*.15,this.setLineGeo(t.segIn.geometry,Ii,i),this.setLineGeo(t.segOut.geometry,i,n.pos),t.bg.visible=!r,t.segIn.visible=r,t.segOut.visible=r}makeLineGeo(t,n){const r=new Ex;return r.setPositions([t.x,t.y,t.z,n.x,n.y,n.z]),r}setLineGeo(t,n,r){t.setPositions([n.x,n.y,n.z,r.x,r.y,r.z])}setSelected(t){this.selectedId!==t&&this.applySelection(t)}showRing(t){this.ringMat.color.copy(t.status==="completed"?this.completedNodeColor:this.palette[t.status]),this.ringMesh.scale.setScalar(t.radius*1.8),this.ringPivot.visible=!0}applySelection(t){const n=this.selectedId;if(this.selectedId=t,n){const a=this.nodes.get(n);a&&(this.applyNodeAppearance(a),this.syncLabel(a));const s=this.links.get(n);s&&(s.group.visible=this.linkVisible(n))}if(!t){this.ringPivot.visible=!1;return}const r=this.nodes.get(t);if(!r){this.ringPivot.visible=!1;return}const i=this.links.get(t);i&&(i.group.visible=this.linkVisible(t)),this.applyNodeAppearance(r),this.syncLabel(r),this.showRing(r)}focusSession(t){const n=this.nodes.get(t);if(!n)return;this.applySelection(t);const r=new rt(0,4,14);this.focusTarget={cam:n.targetPos.clone().add(r),look:n.targetPos.clone()}}resetCamera(){this.focusTarget={cam:v2.clone(),look:vy.clone()}}refreshPickables(){this.pickables=[];for(const t of this.nodes.values())this.pickables.push(t.sphere)}findByMesh(t){for(const n of this.nodes.values())if(n.sphere===t)return n;return null}resize(){if(this.disposed)return;const t=this.container.clientWidth||800,n=this.container.clientHeight||600;this.camera.aspect=t/n,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,n),this.css2d.setSize(t,n);const r=new Ln(t,n);for(const i of this.links.values())i.bgMat.resolution=r,i.segInMat.resolution=r,i.segOutMat.resolution=r;this.axisMat&&(this.axisMat.resolution=r)}dispose(){var r,i,a,s,l,c,u,p;if(this.disposed)return;this.disposed=!0,this.running=!1,cancelAnimationFrame(this.rafId),document.removeEventListener("visibilitychange",this.onVisibility),(r=this.ro)==null||r.disconnect(),(i=this.mo)==null||i.disconnect();const t=(a=this.renderer)==null?void 0:a.domElement;t&&(t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("webglcontextlost",this.onContextLost));for(const d of[...this.nodes.values()])this.disposeNode(d);this.nodes.clear();for(const d of[...this.links.values()])this.disposeLink(d);this.links.clear();for(const d of this.sphereGeoms)d.dispose();for(const d of this.glowGeoms)d.dispose();for(const d of this.decalGeoms)d.dispose();this.ringMesh.geometry.dispose(),this.ringMat.dispose(),this.floor.geometry.dispose(),this.floor.material.dispose();for(const d of this.floorRings)d.mesh.geometry.dispose(),d.mat.dispose();this.apexMesh.geometry.dispose(),this.apexMat.dispose(),this.axisLine&&(this.axisLine.geometry.dispose(),this.axisMat.dispose());for(const d of this.axisLabels)d.element.remove(),d.removeFromParent();this.axisLabels=[],(s=this.controls)==null||s.dispose();for(const d of this.logoTexCache.values())d.dispose();this.logoTexCache.clear(),(l=this.renderer)==null||l.dispose(),t!=null&&t.parentElement&&t.parentElement.removeChild(t);const n=(c=this.css2d)==null?void 0:c.domElement;n!=null&&n.parentElement&&n.parentElement.removeChild(n),this.probeEl.parentElement&&this.probeEl.parentElement.removeChild(this.probeEl),(p=(u=this.renderer)==null?void 0:u.forceContextLoss)==null||p.call(u)}disposeNode(t){this.scene.remove(t.group),t.sphereMat.dispose(),t.glowMat.dispose(),t.decalMat.dispose(),t.labelEl.remove(),t.label.removeFromParent()}disposeLink(t){this.scene.remove(t.group),t.bg.geometry.dispose(),t.segIn.geometry.dispose(),t.segOut.geometry.dispose(),t.bgMat.dispose(),t.segInMat.dispose(),t.segOutMat.dispose()}}function tue({sessions:e,now:t,selectedId:n,onSelect:r,showLabels:i,showLinks:a,focus:s,resetNonce:l,onContextLost:c}){const u=f.useRef(null),p=f.useRef(null);return f.useEffect(()=>{if(!u.current)return;let d;try{d=new eue(u.current,{onSelect:r,onContextLost:c})}catch{c();return}return p.current=d,()=>{d.dispose(),p.current=null}},[]),f.useEffect(()=>{var d;(d=p.current)==null||d.update(e,t)},[e,t]),f.useEffect(()=>{var d;(d=p.current)==null||d.setSelected(n)},[n]),f.useEffect(()=>{var d;(d=p.current)==null||d.setLabelsVisible(i)},[i]),f.useEffect(()=>{var d;(d=p.current)==null||d.setLinksVisible(a)},[a]),f.useEffect(()=>{var d;s&&((d=p.current)==null||d.focusSession(s.sessionId))},[s==null?void 0:s.nonce]),f.useEffect(()=>{var d;l!==0&&((d=p.current)==null||d.resetCamera())},[l]),o.jsx("div",{ref:u,className:"am-canvas am-canvas-3d"})}const nue={active:"进行中",idle:"空闲",completed:"已完成",error:"异常"},w2=[{key:"all",label:"全部",ms:0},{key:"1h",label:"近 1 小时",ms:Yc},{key:"6h",label:"近 6 小时",ms:6*Yc},{key:"24h",label:"近 24 小时",ms:24*Yc},{key:"7d",label:"近 7 天",ms:7*ew}];function j2(e,t){const n=new Date(e);return t<=ew?`${n.getHours().toString().padStart(2,"0")}:00`:`${n.getMonth()+1}/${n.getDate()}`}function rue(e){if(e.length===0)return"";if(e.length===1)return`M ${e[0].x} ${e[0].y}`;const t=[`M ${e[0].x} ${e[0].y}`];for(let n=0;n<e.length-1;n++){const r=e[n-1]||e[n],i=e[n],a=e[n+1],s=e[n+2]||a,l=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,u=a.x-(s.x-i.x)/6,p=a.y-(s.y-i.y)/6;t.push(`C ${l.toFixed(2)} ${c.toFixed(2)}, ${u.toFixed(2)} ${p.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`)}return t.join(" ")}function iue({sessions:e,start:t,end:n}){const s=f.useMemo(()=>{const m=Math.max(1,n-t),g=Math.max(1,Math.min(96,Math.round(m/Yc))),v=new Array(g).fill(0);for(const x of e){const y=x.lastRequestAt;if(y<t||y>n)continue;let b=Math.floor((y-t)/(m/g));b<0&&(b=0),b>=g&&(b=g-1),v[b]++}return v},[e,t,n]),l=Math.max(1,...s),c=s.reduce((m,g)=>m+g,0),u=n-t,p=s.map((m,g)=>({x:s.length===1?220/2:g/(s.length-1)*218+1,y:41-m/l*(44-2*3)})),d=rue(p),h=p.length>0?`${d} L ${p[p.length-1].x.toFixed(2)} 44 L ${p[0].x.toFixed(2)} 44 Z`:"";return o.jsxs("div",{className:"am-trend",title:`区间内会话最后活动分布:共 ${c} 个会话(按小时统计)`,children:[o.jsx("span",{className:"am-trend-label",children:"会话趋势"}),o.jsxs("svg",{className:"am-trend-svg",viewBox:"0 0 220 44",preserveAspectRatio:"none",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"am-trend-grad",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:"var(--accent-primary)",stopOpacity:"0.35"}),o.jsx("stop",{offset:"100%",stopColor:"var(--accent-primary)",stopOpacity:"0.02"})]})}),h&&o.jsx("path",{d:h,fill:"url(#am-trend-grad)",stroke:"none"}),d&&o.jsx("path",{d,fill:"none",stroke:"var(--accent-primary)",strokeWidth:"1.5",vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round"})]}),o.jsxs("span",{className:"am-trend-axis",children:[j2(t,u)," – ",j2(n,u)]})]})}function aue({events:e}){if(e.length===0)return o.jsx("div",{className:"am-empty",children:"暂无活动记录(发起一次请求后会出现)"});const t=[...e].sort((r,i)=>i.ts-r.ts),n=[];for(const r of t){const i=`${r.kind}|${r.toolName||""}|${r.summary||""}`,a=n[n.length-1];if(a&&a.key===i){a.count+=1;continue}n.push({key:i,kind:r.kind,toolName:r.toolName,summary:r.summary||r.kind,count:1,ts:r.ts})}return o.jsx("div",{className:"am-path",children:n.map((r,i)=>{const a=r.kind==="prompt"?"💬":r.kind==="thinking"?"💭":r.kind==="error"?"⚠️":r.kind==="cancelled"?"🚫":r.kind==="response"?"💬":tw[r.toolName||""]||"•";return o.jsxs("div",{className:`am-path-item am-path-item--${r.kind}`,children:[o.jsxs("div",{className:"am-path-rail",children:[o.jsx("div",{className:"am-path-dot"}),i<n.length-1&&o.jsx("div",{className:"am-path-line"})]}),o.jsxs("div",{className:"am-path-body",children:[o.jsxs("div",{className:"am-path-head",children:[o.jsx("span",{className:"am-path-icon",children:a}),o.jsx("span",{className:"am-path-summary",children:r.summary}),o.jsx("span",{className:"am-path-time",children:new Date(r.ts).toLocaleTimeString()}),r.count>1&&o.jsxs("span",{className:"am-path-count",children:["×",r.count]})]}),r.kind==="prompt"&&o.jsx("div",{className:"am-path-prompt",children:r.summary})]})]},r.key+i)})})}function oue({events:e,onSelectSession:t}){return e.length===0?o.jsx("div",{className:"am-feed-empty",children:"等待实时活动…"}):o.jsx("div",{className:"am-feed",children:e.slice(0,80).map(n=>o.jsxs("div",{className:`am-feed-row am-feed-row--${n.kind}${t?" am-feed-row--clickable":""}`,onClick:t?()=>t(n.sessionId):void 0,title:t?"点击定位到地图节点并展开详情":void 0,children:[o.jsx("span",{className:"am-feed-time",children:new Date(n.ts).toLocaleTimeString()}),o.jsx(FI,{agent:n.agent,size:13,className:"am-feed-agent"}),o.jsx("span",{className:"am-feed-icon",children:n.kind==="prompt"?"💬":n.kind==="error"?"⚠️":n.kind==="cancelled"?"🚫":tw[n.toolName||""]||"•"}),o.jsx("span",{className:"am-feed-summary",children:n.summary})]},n.id))})}function xt({icon:e,label:t,desc:n}){return o.jsxs("div",{className:"am-legend-row",children:[o.jsx("span",{className:"am-legend-ic",children:e}),o.jsxs("span",{className:"am-legend-text",children:[o.jsx("span",{className:"am-legend-label",children:t}),o.jsx("span",{className:"am-legend-desc",children:n})]})]})}function Ma({title:e,children:t}){return o.jsxs("div",{className:"am-legend-group",children:[o.jsx("div",{className:"am-legend-group-title",children:e}),t]})}function sue({onClose:e}){return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"am-popover-overlay",onClick:e}),o.jsxs("div",{className:"am-popover am-popover--wide",children:[o.jsxs("div",{className:"am-popover-head",children:[o.jsx("span",{children:"🗺️ 地图符号说明"}),o.jsx("button",{className:"am-popover-close",onClick:e,"aria-label":"关闭",children:"×"})]}),o.jsxs("div",{className:"am-popover-body am-legend-grid",children:[o.jsxs("div",{className:"am-legend-col",children:[o.jsxs(Ma,{title:"客户端类型(节点中心图标)",children:[o.jsx(xt,{icon:o.jsx(W0,{size:16}),label:"Claude Code",desc:"该 Session 来自 Claude Code 客户端"}),o.jsx(xt,{icon:o.jsx(K0,{size:16}),label:"Codex",desc:"该 Session 来自 Codex 客户端"})]}),o.jsxs(Ma,{title:"节点状态(颜色 + 光晕)",children:[o.jsx(xt,{icon:o.jsx("i",{className:"am-dot am-dot--active"}),label:"进行中",desc:"最近 60 秒内有请求,或有在途请求(脉冲发光)"}),o.jsx(xt,{icon:o.jsx("i",{className:"am-dot am-dot--idle"}),label:"空闲",desc:"超过 60 秒无新请求,但 10 分钟内有过活动"}),o.jsx(xt,{icon:o.jsx("i",{className:"am-dot am-dot--completed"}),label:"已完成",desc:"超过 10 分钟无活动,且末轮正常结束(变暗、虚线)"}),o.jsx(xt,{icon:o.jsx("i",{className:"am-dot am-dot--error"}),label:"异常",desc:"末次请求失败(上游 5xx),红色脉冲"})]}),o.jsxs(Ma,{title:"距离分档(同心圆,按时间阶梯 1/7/30/365 天)",children:[o.jsx(xt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"var(--accent-success)"}}),label:"1 天临界",desc:"圈内在 1 天内开始的会话;圈外是更早的会话"}),o.jsx(xt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"var(--accent-warning)"}}),label:"7 天临界",desc:"1–7 天前开始的会话落在本圈与 1 天圈之间"}),o.jsx(xt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"#6BA8E5"}}),label:"30 天临界",desc:"7–30 天前开始的会话落在本圈与 7 天圈之间"}),o.jsx(xt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"#6BA8E5"}}),label:"1 年临界(最外圈)",desc:"30 天–1 年前开始的会话落在本圈与 30 天圈之间;超过 1 年的会话游离在本圈之外(最外围)"})]})]}),o.jsxs("div",{className:"am-legend-col",children:[o.jsxs(Ma,{title:"节点装饰",children:[o.jsx(xt,{icon:o.jsx("span",{children:"🔑"}),label:"接入密钥来源",desc:"节点下方钥匙标记,走 AccessKey 接入密钥流量"}),o.jsx(xt,{icon:o.jsx("span",{className:"am-ic-center"}),label:"中心点",desc:"画布中心圆点,进行中节点会与它连线"})]}),o.jsxs(Ma,{title:"节点位置与尺寸",children:[o.jsx(xt,{icon:o.jsx("span",{children:"🎯"}),label:"距中心距离 = 会话开始时间",desc:"以会话开始时间(firstRequestAt)按龄分档:1 天内居内侧(分布最宽),1–5 天、5–10 天依次外扩,10 天以上在最外围。内圈带宽最大、越往外越紧凑,落定后不漂移"}),o.jsx(xt,{icon:o.jsx("span",{children:"🔵"}),label:"节点大小 = 对话轮数",desc:"默认较小,仅随对话轮数(requestCount)增长并封顶,越大代表历史对话轮数越多"})]}),o.jsxs(Ma,{title:"操作",children:[o.jsx(xt,{icon:o.jsx("span",{className:"am-ic-mouse",children:"🖱"}),label:"缩放 / 平移",desc:"2D:滚轮缩放、拖拽平移、短按选中;3D:拖拽旋转、滚轮缩放、右键平移、点击选中"}),o.jsx(xt,{icon:o.jsx("span",{className:"am-ic-chart",children:"📈"}),label:"时间筛选",desc:"点 topbar「时间筛选」按预设区间过滤;趋势曲线仅作参考"})]})]}),o.jsx("div",{className:"am-legend-col",children:o.jsxs(Ma,{title:"3D 视图操作与标识",children:[o.jsx(xt,{icon:o.jsx("span",{children:"🧊"}),label:"进入 / 退出 3D",desc:"右下角「2D / 3D」分段切换;3D 使用 WebGL,若环境不支持会自动回退到 2D(此时 3D 按钮置灰)。3D 与 2D 是两套完全独立的画布,互不影响"}),o.jsx(xt,{icon:o.jsx("span",{className:"am-ic-mouse",children:"🖱"}),label:"鼠标操作",desc:"左键按住拖拽 = 环绕旋转视角;滚轮 = 以光标为中心缩放;右键(或双指)按住拖拽 = 平移;在节点上单击 = 选中并展开详情,点空白 = 取消选中。一旦开始拖拽,复位/定位的自动过渡会立即停止,视角完全交给用户"}),o.jsx(xt,{icon:o.jsx("span",{children:"🕹️"}),label:"连线 / 标签 / 复位",desc:"3D 模式下右下角额外出现「连线」「标签」「复位」三个按钮:连线 = 开关中心点到各节点的 Token 连线(默认开,关闭后选中节点的连线仍显示);标签 = 切换是否显示所有节点文字(默认只显示选中节点的文字);复位 = 把相机平滑回到初始机位"}),o.jsx(xt,{icon:o.jsx("span",{children:"📐"}),label:"中心纵轴 = Token 量尺",desc:"底部中心点垂直向上一根虚线纵轴,标注 10k / 100k / 1M / 10M / 100M / 1B 临界刻度;节点高度由 Token 总量驱动(阶梯式分段、每跨一档放大但不超过 2 倍),Token 越多越往上长"}),o.jsx(xt,{icon:o.jsx("span",{children:"🌀"}),label:"地面同心圆 = 会话年龄",desc:"底部平面同心圆按时间阶梯对齐到 1 天 / 7 天 / 30 天 / 1 年 临界(段长比 20/30/30/20,1 天段最长):越靠中心 = 会话越新(刚创建),越往外 = 会话开始得越早;超过 1 年的节点游离在最外圈之外。节点距中心的水平距离由会话开始时间决定,落定后不漂移"}),o.jsx(xt,{icon:o.jsx("span",{children:"🎨"}),label:"节点颜色 / 形态",desc:"进行中=主色(带脉冲发光圈)、空闲=黄色、异常=红色(快频脉冲)、已完成=浅绿线框球(半透明、不遮挡视野)。in-flight 请求中的节点球体会轻微呼吸缩放"})]})}),o.jsx("div",{className:"am-legend-col",children:o.jsxs(Ma,{title:"活动路径 / 活动流图标",children:[o.jsx(xt,{icon:o.jsx("span",{children:"💬"}),label:"提问 / 回复",desc:"用户提问或模型回复"}),o.jsx(xt,{icon:o.jsx("span",{children:"💭"}),label:"思考",desc:"模型推理思考过程"}),o.jsx(xt,{icon:o.jsx("span",{children:"⚠️"}),label:"错误",desc:"请求失败"}),o.jsx(xt,{icon:o.jsx("span",{children:"📖"}),label:"Read",desc:"读取文件"}),o.jsx(xt,{icon:o.jsx("span",{children:"📝"}),label:"Edit / Write",desc:"编辑 / 写入文件"}),o.jsx(xt,{icon:o.jsx("span",{children:"🔧"}),label:"Bash",desc:"执行终端命令"}),o.jsx(xt,{icon:o.jsx("span",{children:"🔍"}),label:"Grep / Glob",desc:"搜索内容 / 匹配文件"}),o.jsx(xt,{icon:o.jsx("span",{children:"🌐"}),label:"WebFetch / WebSearch",desc:"抓取网页 / 联网搜索"}),o.jsx(xt,{icon:o.jsx("span",{children:"🤖"}),label:"Agent / Task",desc:"调用子 Agent"})]})})]})]})]})}function lue(){const[e,t]=f.useState(new Map),[n,r]=f.useState([]),[i,a]=f.useState(null),[s,l]=f.useState(null),[c,u]=f.useState([]),[p,d]=f.useState(null),[h,m]=f.useState([]),[g,v]=f.useState(!1),[x,y]=f.useState(null),[b,w]=f.useState({loading:!1}),[j,k]=f.useState(!0),S=f.useCallback(()=>k(ee=>!ee),[]),[A,T]=f.useState(!1),[L,O]=f.useState(!1),{enabled:R,toggle:_}=Pce(),[X,q]=f.useState(!1),[I,$]=f.useState({zoom:1,panX:0,panY:0}),[H,N]=f.useState(!1),[W,P]=f.useState(!1),[U,le]=f.useState(!1),[E,me]=f.useState(!1),[ye,Q]=f.useState(null),[ie,je]=f.useState(0);f.useEffect(()=>{const ee=V.streamAgentMap({onInit:xe=>{q(!0);const Se=new Map;for(const Le of xe.sessions)Se.set(Le.sessionId,Le);t(Se),r(xe.events),a(xe.stats)},onSessionUpdate:xe=>t(Se=>{const Le=new Map(Se);return Le.set(xe.sessionId,xe),Le}),onActivity:xe=>r(Se=>[xe,...Se].slice(0,500)),onStats:xe=>a(xe),onError:()=>q(!1)});return()=>ee.abort()},[]);const[,Z]=f.useState(0);f.useEffect(()=>{const ee=setInterval(()=>Z(xe=>(xe+1)%1e9),1e4);return()=>clearInterval(ee)},[]);const re=f.useCallback(async ee=>{try{u(await V.getAgentMapSessionEvents(ee))}catch{u([])}},[]),pe=f.useCallback(async(ee,xe,Se)=>ee==="access-key"&&Se?V.getAccessKeySessionLogs(Se,xe,1e4):V.getSessionLogs(xe,1e4),[]),se=f.useCallback(ee=>{const xe=ee.source==="access-key"?"access-key":"global";d({id:ee.sessionId,targetType:ee.agent,title:ee.title,firstRequestAt:ee.firstRequestAt,lastRequestAt:ee.lastRequestAt,requestCount:ee.requestCount,totalTokens:ee.totalTokens}),m([]),y({source:xe,keyId:ee.keyId,sessionId:ee.sessionId}),v(!0),pe(xe,ee.sessionId,ee.keyId).then(Se=>m(Se)).catch(Se=>console.error("Failed to load session logs:",Se)).finally(()=>v(!1))},[pe]),Re=f.useCallback(()=>{d(null),m([]),y(null),v(!1)},[]);f.useEffect(()=>{s?re(s):u([])},[s,re]);const ke=s?e.get(s):null;f.useEffect(()=>{s&&re(s)},[ke==null?void 0:ke.lastRequestAt]),f.useEffect(()=>{if(!s){w({loading:!1});return}const ee=e.get(s);if(!ee){w({loading:!1});return}if(ee.source==="access-key"){w({loading:!1,unavailable:!0});return}if(ee.projectPath){w({loading:!1,projectPath:ee.projectPath});return}w({loading:!0});let xe=!0;return V.getAgentMapSessionMeta(s).then(Se=>{xe&&w({loading:!1,projectPath:Se.projectPath})}).catch(()=>{xe&&w({loading:!1})}),()=>{xe=!1}},[s,ke==null?void 0:ke.projectPath]);const ne=f.useCallback(ee=>{e.has(ee)&&(l(ee),qe("all"),k(!0),Q({sessionId:ee,nonce:Date.now()}))},[e]),[De,qe]=f.useState("all"),ze=Math.floor(Date.now()/1e4)*1e4,Ke=w2.find(ee=>ee.key===De).ms,pt=De!=="all",Ye=f.useMemo(()=>De==="all"?null:{start:ze-Ke,end:ze},[De,ze,Ke]),Qe=f.useMemo(()=>Array.from(e.values()),[e]),Ze=f.useMemo(()=>Ye?Qe.filter(ee=>ee.lastRequestAt>=Ye.start&&ee.lastRequestAt<=Ye.end):Qe,[Qe,Ye]),tt=f.useRef(null);ke&&(tt.current=ke);const J=ke??(s?tt.current:null);f.useEffect(()=>{s||(tt.current=null)},[s]);const Y=f.useCallback(ee=>{l(ee),ee&&k(!0)},[]),ue=n.length?n[n.length-1].ts:ze,M=De==="all"?Math.min(ue,ze-24*Yc):ze-Ke,fe=ze;return o.jsxs("div",{className:"am-page",children:[o.jsxs("div",{className:"am-header",children:[o.jsxs("div",{className:"am-title",children:[o.jsx("h2",{children:"🗺️ 任务雷达"}),o.jsx("span",{className:`am-conn${X?" am-conn--on":""}`,children:X?"● 实时":"○ 连接中"})]}),o.jsxs("div",{className:"am-stats",children:[o.jsxs("span",{className:"am-stat am-stat--active",children:["进行中 ",o.jsx("b",{children:(i==null?void 0:i.activeSessions)??0})]}),o.jsxs("span",{className:"am-stat am-stat--idle",children:["空闲 ",o.jsx("b",{children:(i==null?void 0:i.idleSessions)??0})]}),o.jsxs("span",{className:"am-stat am-stat--completed",children:["已完成 ",o.jsx("b",{children:(i==null?void 0:i.completedSessions)??0})]}),o.jsxs("span",{className:"am-stat am-stat--error",children:["异常 ",o.jsx("b",{children:(i==null?void 0:i.errorSessions)??0})]}),o.jsxs("span",{className:"am-stat",children:["在途 ",o.jsx("b",{children:(i==null?void 0:i.inFlightRequests)??0})]}),o.jsxs("span",{className:"am-stat",children:["显示 ",o.jsx("b",{children:Ze.length}),"/",Qe.length]})]}),o.jsxs("div",{className:"am-actions",children:[o.jsxs("button",{className:"am-btn am-toggle-btn",onClick:()=>{O(ee=>!ee),T(!1)},title:L?"收起时间筛选":"展开时间筛选",children:[o.jsx("span",{children:"时间筛选"}),o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.18s",transform:L?"rotate(180deg)":"none"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),o.jsxs("button",{className:"am-btn am-toggle-btn",onClick:()=>{T(ee=>!ee),O(!1)},title:"符号说明",children:[o.jsx("span",{children:"符号说明"}),o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.18s",transform:A?"rotate(180deg)":"none"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),o.jsxs("div",{className:"am-notify-switch",title:R?"已开启:每个会话的一轮任务结束时(请求完成、流结束,或停滞超过阈值)会弹一次系统通知":"开启:每个会话的一轮任务结束时(请求完成、流结束,或停滞超过阈值)会弹一次系统通知",children:[o.jsx(Yo,{checked:R,onChange:_,label:"🔔 通知"}),R&&o.jsx("button",{type:"button",className:"am-notify-test",onClick:()=>V.testAgentMapNotify(),title:"发一条测试通知,验证系统是否真的弹(若没弹,请在系统设置里允许 AICodeSwitch/终端 的通知)",children:"测试"})]})]}),A&&o.jsx(sue,{onClose:()=>T(!1)})]}),L&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"am-popover-overlay",onClick:()=>O(!1)}),o.jsxs("div",{className:"am-popover am-popover--time",children:[o.jsxs("div",{className:"am-popover-head",children:[o.jsx("span",{children:"🕒 时间筛选"}),o.jsx("button",{className:"am-popover-close",onClick:()=>O(!1),"aria-label":"关闭",children:"×"})]}),o.jsxs("div",{className:"am-timefilter",children:[o.jsx("div",{className:"am-timepresets",children:w2.map(ee=>o.jsx("button",{className:`am-chip${De===ee.key?" am-chip--active":""}`,onClick:()=>qe(ee.key),children:ee.label},ee.key))}),o.jsx(iue,{sessions:Qe,start:M,end:fe})]}),pt&&o.jsxs("div",{className:"am-timefilter-hint",children:["已筛选:",new Date(Ye.start).toLocaleString()," → 现在 · 显示 ",Ze.length,"/",Qe.length]})]})]}),o.jsxs("div",{className:"am-main",children:[o.jsxs("div",{className:"am-canvas-wrap",children:[Qe.length===0?o.jsxs("div",{className:"am-empty-canvas",children:[o.jsx("div",{className:"am-empty-icon",children:"🌌"}),o.jsx("p",{children:"暂无 Session"}),o.jsx("p",{className:"am-empty-hint",children:"启动 Claude Code 或 Codex 开始编程,节点会实时出现在这里"})]}):H&&!W?o.jsx(tue,{sessions:Ze,now:ze,selectedId:s,onSelect:Y,showLabels:U,showLinks:E,focus:ye,resetNonce:ie,onContextLost:()=>P(!0)}):o.jsx(Mce,{sessions:Ze,now:ze,selectedId:s,onSelect:Y,view:I,onView:$,focus:ye}),o.jsxs("div",{className:"am-legend",children:[o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--active"})," 进行中"]}),o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--idle"})," 空闲"]}),o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--completed"})," 已完成"]}),o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--error"})," 异常"]})]}),o.jsxs("div",{className:"am-float-controls",children:[o.jsxs("div",{className:"am-view-toggle",role:"group","aria-label":"2D / 3D 视图切换",children:[o.jsx("button",{className:`am-view-btn${H?"":" am-view-btn--active"}`,onClick:()=>N(!1),title:"2D 平面视图(默认)",children:"2D"}),o.jsx("button",{className:`am-view-btn${H?" am-view-btn--active":""}${W?" am-view-btn--disabled":""}`,onClick:()=>{W||N(!0)},disabled:W,title:W?"WebGL 不可用,已回退到 2D":"3D 场景视图(Three.js):自由轨道旋转/缩放/平移",children:"3D"})]}),H&&!W?o.jsxs("div",{className:"am-view-toggle",role:"group","aria-label":"3D 显示控制",children:[o.jsx("button",{className:`am-view-btn am-view-btn--link${E?" am-view-btn--active":""}`,onClick:()=>me(ee=>!ee),title:E?"隐藏中心点到节点的 Token 连线(选中节点的连线仍显示)":"显示中心点到节点的 Token 连线",children:"连线"}),o.jsx("button",{className:`am-view-btn am-view-btn--label${U?" am-view-btn--active":""}`,onClick:()=>le(ee=>!ee),title:U?"隐藏所有节点标签(仅保留选中节点)":"显示所有节点标签",children:"标签"}),o.jsx("button",{className:"am-view-btn",onClick:()=>je(ee=>ee+1),title:"复位视角",children:"复位"})]}):o.jsx(Nce,{view:I,onView:$})]})]}),o.jsxs("div",{className:"am-feed-wrap",children:[o.jsx("button",{className:"am-feed-toggle",onClick:S,title:j?"收起侧栏":"展开侧栏","aria-label":j?"收起侧栏":"展开侧栏",children:o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:j?o.jsx("polyline",{points:"9 18 15 12 9 6"}):o.jsx("polyline",{points:"15 18 9 12 15 6"})})}),j&&o.jsx("aside",{className:"am-feed-sidebar",children:J?o.jsxs("div",{className:"am-detail am-detail--sidebar",children:[o.jsxs("div",{className:"am-detail-head",children:[o.jsxs("span",{className:`am-badge am-badge--${J.status}`,children:[o.jsx(FI,{agent:J.agent,size:14})," ",nue[J.status]]}),o.jsx("button",{className:"am-detail-close",onClick:()=>l(null),title:"返回活动流",children:"×"})]}),o.jsxs("div",{className:"am-detail-body",children:[o.jsx("h3",{className:"am-detail-title",children:J.title||J.sessionId}),o.jsxs("div",{className:"am-detail-meta",children:[o.jsxs("div",{children:["请求轮次:",o.jsx("b",{children:J.requestCount})]}),o.jsxs("div",{children:["输入 Token:",o.jsx("b",{children:(J.inputTokens||0).toLocaleString()})]}),o.jsxs("div",{children:["输出 Token:",o.jsx("b",{children:(J.outputTokens||0).toLocaleString()})]}),o.jsxs("div",{children:["累计 Token:",o.jsx("b",{children:(J.totalTokens||0).toLocaleString()})]}),o.jsxs("div",{children:["最近模型:",o.jsx("b",{children:J.lastModel||"-"})]}),o.jsxs("div",{className:"am-detail-path",children:["项目路径:",b.projectPath?o.jsx("code",{title:b.projectPath,children:b.projectPath}):b.unavailable?o.jsx("span",{className:"am-detail-path-na",children:"接入密钥会话,无法读取本地项目信息"}):b.loading?o.jsx("span",{className:"am-detail-path-na",children:"解析中…"}):o.jsx("span",{className:"am-detail-path-na",children:"未识别"})]}),o.jsxs("div",{children:["首/末:",o.jsx("b",{children:Ax(J.firstRequestAt)})," · ",o.jsx("b",{children:Ax(J.lastRequestAt)})]})]}),o.jsx("div",{className:"am-detail-section-title",children:"活动路径"}),o.jsx(aue,{events:c})]}),o.jsxs("div",{className:"am-detail-footer",children:[o.jsx("button",{className:"am-btn am-btn--ghost",onClick:()=>re(J.sessionId),children:"刷新活动"}),o.jsx("button",{className:"am-btn am-btn--ghost",disabled:J.source==="access-key"&&!J.keyId,onClick:()=>se(J),children:"会话详情"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"am-feed-head",children:[o.jsx("span",{children:"📜 全局活动流"}),o.jsx("span",{className:"am-feed-count",children:n.length})]}),o.jsx(oue,{events:n,onSelectSession:ne})]})})]})]}),p&&x&&o.jsx(Y0,{session:p,logs:h,logsLoading:g,onRefreshLogs:async()=>{if(x){v(!0);try{const ee=await pe(x.source,x.sessionId,x.keyId);m(ee)}catch(ee){console.error("Failed to refresh session logs:",ee)}finally{v(!1)}}},onFetchNewLogs:async()=>{if(!x)return[];const ee=await pe(x.source,x.sessionId,x.keyId);return m(ee),ee},onClose:Re})]})}function ei({children:e,text:t,showTooltip:n}){const[r,i]=f.useState(!1),[a,s]=f.useState(null),l=f.useRef(null),c=()=>{if(n){if(l.current){const p=l.current.getBoundingClientRect();s({left:p.right+12,top:p.top+p.height/2})}i(!0)}},u=()=>{i(!1)};return o.jsxs("div",{ref:l,className:"nav-item-with-tooltip",onMouseEnter:c,onMouseLeave:u,children:[e,n&&r&&a&&Lu.createPortal(o.jsx("div",{className:"nav-tooltip",style:{left:a.left,top:a.top},children:t}),document.body)]})}const cue=""+new URL("logo-CRx_w1Ov.png",import.meta.url).href,uue=`升级到 v6.0.0 版本将会有破坏性影响,你需要注意:
1184
+
1185
+ * 我们升级了日志系统,以解决老的日志系统所带来的存储问题。新日志系统会迁移你的日志数据,但是,为了确保日志数据不丢失,我们会在下一个版本中才删除老的日志文件,这也就意味着你的电脑上可能同时存在两份日志文件,占用空间。为了节约你的电脑磁盘空间,你可以在运行一段时间感觉正常之后,删除 \`~/.aicodeswitch/fs-db/logs\` 目录来移除老的日志文件。
1186
+
1187
+ 本次升级带来了新的大功能:
1188
+
1189
+ * 「任务雷达」功能,帮助你时刻掌握当前任务状态,历史任务分布,通过对任务雷达的分析,你可以掌握自己的编程习惯,从而作出适当的调整。
1190
+ `;function due(){const e=Th(),[t,n]=f.useState("light"),[r,i]=f.useState(!1),[a,s]=f.useState(!1),[l,c]=f.useState(!1),[u,p]=f.useState(!1),[d,h]=f.useState(!1),[m,g]=f.useState(null),[v,x]=f.useState(null),[y,b]=f.useState(!1),w=cF(),[j,k]=f.useState(!1),[S,A]=f.useState(!1),[T,L]=f.useState(""),[O,R]=f.useState(""),[_,X]=f.useState(!0),[q,I]=f.useState(!1),[$,H]=f.useState(""),[N,W]=f.useState(!1);f.useEffect(()=>{const Z=localStorage.getItem("theme")||"light";n(Z),document.documentElement.setAttribute("data-theme",Z),localStorage.getItem("sidebar-collapsed")==="true"&&p(!0)},[]),f.useEffect(()=>{const Z=async()=>{try{const pe=await V.checkVersion();h(pe.hasUpdate),g(pe.latestVersion),x(pe.currentVersion)}catch(pe){console.error("Failed to check version:",pe)}};Z();const re=setInterval(Z,6e4);return()=>clearInterval(re)},[]),f.useEffect(()=>{(async()=>{try{const re=await V.getAuthStatus();if(k(re.enabled),!re.enabled){A(!0),X(!1);return}if(!localStorage.getItem("auth_token")){X(!1);return}try{await V.getVendors(),A(!0)}catch{}}catch(re){console.error("Failed to check auth status:",re)}finally{X(!1)}})()},[]),f.useEffect(()=>{(async()=>{if(!N)try{const re=await V.getUpgrade();re.shouldShow&&re.content&&(H(re.content),I(!0)),W(!0)}catch(re){console.error("Failed to check upgrade:",re)}})()},[N]),f.useEffect(()=>{(async()=>{try{(await V.getVendors()).length===0&&!a&&(i(!0),s(!0))}catch(re){console.error("Failed to check vendors:",re)}})()},[a]);const P=()=>{const Z=t==="light"?"dark":"light";n(Z),document.documentElement.setAttribute("data-theme",Z),localStorage.setItem("theme",Z)},U=()=>{p(!u),localStorage.setItem("sidebar-collapsed",(!u).toString())},le=f.useRef(null),[E,me]=f.useState({scrollable:!1,atTop:!0,atBottom:!0});f.useEffect(()=>{const Z=le.current;if(!Z)return;const re=()=>{const ke=Z.scrollHeight-Z.clientHeight>2;me({scrollable:ke,atTop:Z.scrollTop<=1,atBottom:Z.scrollTop+Z.clientHeight>=Z.scrollHeight-1})};re();let pe=0;const se=()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(re)},Re=new ResizeObserver(se);return Re.observe(Z),Z.addEventListener("scroll",se,{passive:!0}),()=>{cancelAnimationFrame(pe),Re.disconnect(),Z.removeEventListener("scroll",se)}},[j,u]);const ye=E.scrollable,Q=()=>{i(!1),e("/vendors")},ie=async()=>{try{await V.acknowledgeUpgrade()}catch(Z){console.error("Failed to acknowledge upgrade:",Z)}I(!1)},je=async Z=>{if(Z.preventDefault(),R(""),!T.trim()){R("请输入鉴权码");return}try{const re=await V.login(T);localStorage.setItem("auth_token",re.token),A(!0),L("")}catch(re){re instanceof Error?R(re.message||"登录失败,请检查鉴权码"):R("登录失败,请检查鉴权码")}};return _?o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",fontSize:"18px",color:"var(--text-secondary)"},children:"加载中..."}):j&&!S?o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>{},"aria-label":"关闭",disabled:!0,style:{opacity:.3,cursor:"not-allowed"},children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"400px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"🔐 系统鉴权"})}),o.jsxs("form",{onSubmit:je,children:[o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6",color:"var(--text-secondary)"},children:"系统已启用鉴权保护,请输入鉴权码以继续访问。"}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500"},children:"鉴权码"}),o.jsx("input",{type:"password",value:T,onChange:Z=>L(Z.target.value),placeholder:"请输入鉴权码",style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-color)",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box"},autoFocus:!0})]}),O&&o.jsx("div",{style:{padding:"10px 12px",backgroundColor:"#fee",border:"1px solid #fcc",borderRadius:"6px",color:"#c33",fontSize:"14px",marginBottom:"16px"},children:O})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%"},children:"登录"})})]})]})})]}):o.jsxs("div",{className:"app",children:[o.jsxs("nav",{className:`sidebar ${u?"collapsed":""}`,children:[o.jsxs("div",{className:"logo",children:[o.jsx("img",{src:cue,alt:"AI Code Switch Logo",className:"logo-image"}),o.jsx("h2",{children:"AI Code Switch"})]}),o.jsxs("div",{className:"nav-menu-wrap",children:[o.jsxs("ul",{className:"nav-menu",ref:le,children:[o.jsx("li",{children:o.jsx(ei,{text:"路由管理",showTooltip:u,children:o.jsxs(Jr,{to:"/routes",children:[o.jsx("span",{className:"nav-icon",children:"🌏"}),o.jsx("span",{className:"nav-text",children:"路由管理"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"供应商管理",showTooltip:u,children:o.jsxs(Jr,{to:"/vendors",children:[o.jsx("span",{className:"nav-icon",children:"🏭"}),o.jsx("span",{className:"nav-text",children:"供应商管理"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"Skills 管理",showTooltip:u,children:o.jsxs(Jr,{to:"/skills",children:[o.jsx("span",{className:"nav-icon",children:"🧩"}),o.jsx("span",{className:"nav-text",children:"Skills 管理"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"MCP 管理",showTooltip:u,children:o.jsxs(Jr,{to:"/mcp",children:[o.jsx("span",{className:"nav-icon",children:"🧰"}),o.jsx("span",{className:"nav-text",children:"MCP 管理"})]})})}),j&&o.jsxs(o.Fragment,{children:[o.jsx("li",{className:"nav-divider",children:o.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-primary)",margin:"4px 8px"}})}),o.jsx("li",{children:o.jsx(ei,{text:"API Key",showTooltip:u,children:o.jsxs(Jr,{to:"/access-keys",children:[o.jsx("span",{className:"nav-icon",children:"🔑"}),o.jsx("span",{className:"nav-text",children:"API Key"})]})})})]}),o.jsx("li",{className:"nav-divider",children:o.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-primary)",margin:"4px 8px"}})}),o.jsx("li",{children:o.jsx(ei,{text:"任务雷达",showTooltip:u,children:o.jsxs(Jr,{to:"/agent-map",children:[o.jsx("span",{className:"nav-icon",children:"🗺️"}),o.jsx("span",{className:"nav-text",children:"任务雷达"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"数据统计",showTooltip:u,children:o.jsxs(Jr,{to:"/statistics",children:[o.jsx("span",{className:"nav-icon",children:"📊"}),o.jsx("span",{className:"nav-text",children:"数据统计"})]})})}),!j&&o.jsxs(o.Fragment,{children:[o.jsx("li",{children:o.jsx(ei,{text:"会话",showTooltip:u,children:o.jsxs(Jr,{to:"/sessions",children:[o.jsx("span",{className:"nav-icon",children:"💬"}),o.jsx("span",{className:"nav-text",children:"会话"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"日志",showTooltip:u,children:o.jsxs(Jr,{to:"/logs",children:[o.jsx("span",{className:"nav-icon",children:"🪵"}),o.jsx("span",{className:"nav-text",children:"日志"})]})})})]}),o.jsx("li",{children:o.jsx(ei,{text:"设置",showTooltip:u,children:o.jsxs(Jr,{to:"/settings",children:[o.jsx("span",{className:"nav-icon",children:"⚙️"}),o.jsx("span",{className:"nav-text",children:"设置"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"使用说明",showTooltip:u,children:o.jsxs(Jr,{to:"/usage",children:[o.jsx("span",{className:"nav-icon",children:"📖"}),o.jsx("span",{className:"nav-text",children:"使用说明"})]})})})]}),ye&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`nav-scroll-shadow nav-scroll-shadow--top${E.atTop?" is-hidden":""}`,"aria-hidden":"true"}),o.jsx("div",{className:`nav-scroll-shadow nav-scroll-shadow--bottom${E.atBottom?" is-hidden":""}`,"aria-hidden":"true",children:o.jsx("span",{className:"nav-scroll-wheel",children:o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"6",y:"3",width:"12",height:"18",rx:"6"}),o.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"})]})})})]})]}),o.jsxs("div",{className:"theme-toggle",children:[o.jsx("button",{onClick:P,className:"theme-mode-btn",children:t==="dark"?"🌙":"☀️"}),o.jsx("a",{href:"https://github.com/tangshuang/aicodeswitch",target:"_blank",rel:"noopener noreferrer",className:"github-link",title:"GitHub",children:o.jsx("svg",{viewBox:"0 0 16 16",width:"20",height:"20",fill:"currentColor",children:o.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})})}),v&&o.jsx("div",{className:`version-info-wrapper ${d?"has-update":""}`,onClick:()=>b(!0),style:{cursor:"pointer"},children:o.jsxs("div",{className:"version-info",children:["v",v,d&&o.jsx("span",{className:"version-badge"})]})}),o.jsx("button",{onClick:U,className:"sidebar-toggle-btn",title:u?"展开侧边栏":"收起侧边栏",children:u?"»":"«"})]})]}),o.jsx("main",{className:"main-content",children:o.jsxs(i3,{children:[o.jsx(er,{path:"/",element:o.jsx(uc,{to:"/routes",replace:!0})}),o.jsx(er,{path:"/agent-map",element:o.jsx(lue,{})}),o.jsx(er,{path:"/statistics",element:o.jsx(bce,{})}),o.jsx(er,{path:"/routes",element:o.jsx(NF,{})}),o.jsx(er,{path:"/vendors",element:o.jsx(hF,{})}),o.jsx(er,{path:"/skills",element:o.jsx(wce,{})}),o.jsx(er,{path:"/mcp",element:o.jsx(Sce,{})}),o.jsx(er,{path:"/access-keys",element:j?o.jsx(kce,{}):o.jsx(uc,{to:"/"})}),o.jsx(er,{path:"/access-keys/:id",element:j?o.jsx(Cce,{}):o.jsx(uc,{to:"/"})}),o.jsx(er,{path:"/sessions",element:j?o.jsx(uc,{to:"/"}):o.jsx(rU,{})}),o.jsx(er,{path:"/logs",element:j?o.jsx(uc,{to:"/"}):o.jsx(qF,{})}),o.jsx(er,{path:"/write-config",element:o.jsx(aU,{})}),o.jsx(er,{path:"/settings",element:o.jsx(iU,{})}),o.jsx(er,{path:"/usage",element:o.jsx(sU,{})})]})}),r&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>i(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"⚠️ 需要配置供应商"})}),o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6"},children:"检测到系统中没有配置任何API供应商。在没有供应商的情况下,路由将无法正常工作。"}),o.jsx("p",{style:{marginBottom:"0",lineHeight:"1.6",fontWeight:"500"},children:"请先添加至少一个供应商,然后再配置路由规则。"})]}),o.jsxs("div",{className:"modal-footer",style:{justifyContent:"space-between"},children:[o.jsx("button",{type:"button",className:"btn",style:{background:"linear-gradient(135deg, #8B5CF6, #7C3AED)",color:"white",position:"relative",overflow:"hidden"},onClick:()=>{i(!1),c(!0)},children:"一键配置"}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>i(!1),children:"稍后"}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:Q,children:"前往供应商管理"})]})]})]})})]}),o.jsx(BI,{show:l,onClose:()=>c(!1),onComplete:()=>s(!0)}),q&&o.jsx("div",{className:"modal-overlay",children:o.jsx("div",{className:"modal",style:{maxWidth:"800px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"📋 升级提示"})}),o.jsx("div",{className:"modal-body",children:o.jsx("div",{className:"markdown-content",children:o.jsx(Kc,{children:$})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:ie,children:"我知道了"})})]})})}),y&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>b(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"700px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"📦 版本信息"})}),o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px",backgroundColor:"var(--bg-secondary)",borderRadius:"8px",marginBottom:"20px"},children:[o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"当前版本"}),o.jsxs("div",{style:{fontSize:"18px",fontWeight:"600"},children:["v",v]})]}),d?o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{fontSize:"24px",color:"var(--text-secondary)"},children:"→"}),o.jsxs("div",{style:{textAlign:"right"},children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"最新版本"}),o.jsxs("div",{style:{fontSize:"18px",fontWeight:"600"},children:["v",m]})]})]}):o.jsx("div",{style:{padding:"6px 12px",backgroundColor:"#d4edda",color:"#155724",borderRadius:"4px",fontSize:"14px",fontWeight:"500"},children:"已是最新版本"})]}),d&&o.jsxs("div",{style:{padding:"16px",backgroundColor:"var(--bg-info-blue)",border:"1px solid var(--border-info-blue)",borderRadius:"8px",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"14px",marginBottom:"8px",fontWeight:"500",color:"var(--text-primary)"},children:"更新命令:"}),o.jsx("code",{style:{display:"block",padding:"8px 12px",backgroundColor:"var(--bg-secondary)",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"13px",color:"var(--accent-danger)"},children:"npm i -g aicodeswitch@latest"})]}),d?w?o.jsx("div",{className:"markdown-content",style:{maxHeight:"400px",overflow:"auto"},children:o.jsx(Kc,{children:w})}):null:o.jsxs("div",{className:"markdown-content",children:[o.jsx("h4",{style:{marginBottom:12},children:"当前版本提示:"}),o.jsx(Kc,{children:uue})]})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>b(!1),children:"关闭"})})]})})]})]})}function pue(){return o.jsx(p3,{children:o.jsx(uF,{children:o.jsx(bF,{children:o.jsxs(Ace,{children:[o.jsx(due,{}),o.jsx(pF,{})]})})})})}by.createRoot(document.getElementById("root")).render(o.jsx(D2.StrictMode,{children:o.jsx(pue,{})}));