aicodeswitch 5.2.5 → 5.2.6

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.
@@ -1,821 +0,0 @@
1
- var zR=Object.defineProperty;var $R=(e,t,n)=>t in e?zR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Uu=(e,t,n)=>$R(e,typeof t!="symbol"?t+"":t,n);function BR(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 l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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 Ma=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zP={exports:{}},Ep={},$P={exports:{}},He={};/**
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 ru=Symbol.for("react.element"),FR=Symbol.for("react.portal"),UR=Symbol.for("react.fragment"),WR=Symbol.for("react.strict_mode"),KR=Symbol.for("react.profiler"),qR=Symbol.for("react.provider"),HR=Symbol.for("react.context"),VR=Symbol.for("react.forward_ref"),YR=Symbol.for("react.suspense"),GR=Symbol.for("react.memo"),XR=Symbol.for("react.lazy"),j1=Symbol.iterator;function QR(e){return e===null||typeof e!="object"?null:(e=j1&&e[j1]||e["@@iterator"],typeof e=="function"?e:null)}var BP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},FP=Object.assign,UP={};function is(e,t,n){this.props=e,this.context=t,this.refs=UP,this.updater=n||BP}is.prototype.isReactComponent={};is.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")};is.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function WP(){}WP.prototype=is.prototype;function Ry(e,t,n){this.props=e,this.context=t,this.refs=UP,this.updater=n||BP}var Dy=Ry.prototype=new WP;Dy.constructor=Ry;FP(Dy,is.prototype);Dy.isPureReactComponent=!0;var S1=Array.isArray,KP=Object.prototype.hasOwnProperty,Ly={current:null},qP={key:!0,ref:!0,__self:!0,__source:!0};function HP(e,t,n){var r,i={},a=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(a=""+t.key),t)KP.call(t,r)&&!qP.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:ru,type:e,key:a,ref:l,props:i,_owner:Ly.current}}function JR(e,t){return{$$typeof:ru,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function zy(e){return typeof e=="object"&&e!==null&&e.$$typeof===ru}function ZR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var k1=/\/+/g;function dm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ZR(""+e.key):t.toString(36)}function Nd(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case ru:case FR:l=!0}}if(l)return l=e,i=i(l),e=r===""?"."+dm(l,0):r,S1(i)?(n="",e!=null&&(n=e.replace(k1,"$&/")+"/"),Nd(i,t,n,"",function(u){return u})):i!=null&&(zy(i)&&(i=JR(i,n+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(k1,"$&/")+"/")+e)),t.push(i)),1;if(l=0,r=r===""?".":r+":",S1(e))for(var s=0;s<e.length;s++){a=e[s];var c=r+dm(a,s);l+=Nd(a,t,n,c,i)}else if(c=QR(e),typeof c=="function")for(e=c.call(e),s=0;!(a=e.next()).done;)a=a.value,c=r+dm(a,s++),l+=Nd(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 l}function Wu(e,t,n){if(e==null)return e;var r=[],i=0;return Nd(e,r,"","",function(a){return t.call(n,a,i++)}),r}function eD(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 Vn={current:null},_d={transition:null},tD={ReactCurrentDispatcher:Vn,ReactCurrentBatchConfig:_d,ReactCurrentOwner:Ly};function VP(){throw Error("act(...) is not supported in production builds of React.")}He.Children={map:Wu,forEach:function(e,t,n){Wu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Wu(e,function(){t++}),t},toArray:function(e){return Wu(e,function(t){return t})||[]},only:function(e){if(!zy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};He.Component=is;He.Fragment=UR;He.Profiler=KR;He.PureComponent=Ry;He.StrictMode=WR;He.Suspense=YR;He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tD;He.act=VP;He.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=FP({},e.props),i=e.key,a=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,l=Ly.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(c in t)KP.call(t,c)&&!qP.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&s!==void 0?s[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){s=Array(c);for(var u=0;u<c;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:ru,type:e.type,key:i,ref:a,props:r,_owner:l}};He.createContext=function(e){return e={$$typeof:HR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:qR,_context:e},e.Consumer=e};He.createElement=HP;He.createFactory=function(e){var t=HP.bind(null,e);return t.type=e,t};He.createRef=function(){return{current:null}};He.forwardRef=function(e){return{$$typeof:VR,render:e}};He.isValidElement=zy;He.lazy=function(e){return{$$typeof:XR,_payload:{_status:-1,_result:e},_init:eD}};He.memo=function(e,t){return{$$typeof:GR,type:e,compare:t===void 0?null:t}};He.startTransition=function(e){var t=_d.transition;_d.transition={};try{e()}finally{_d.transition=t}};He.unstable_act=VP;He.useCallback=function(e,t){return Vn.current.useCallback(e,t)};He.useContext=function(e){return Vn.current.useContext(e)};He.useDebugValue=function(){};He.useDeferredValue=function(e){return Vn.current.useDeferredValue(e)};He.useEffect=function(e,t){return Vn.current.useEffect(e,t)};He.useId=function(){return Vn.current.useId()};He.useImperativeHandle=function(e,t,n){return Vn.current.useImperativeHandle(e,t,n)};He.useInsertionEffect=function(e,t){return Vn.current.useInsertionEffect(e,t)};He.useLayoutEffect=function(e,t){return Vn.current.useLayoutEffect(e,t)};He.useMemo=function(e,t){return Vn.current.useMemo(e,t)};He.useReducer=function(e,t,n){return Vn.current.useReducer(e,t,n)};He.useRef=function(e){return Vn.current.useRef(e)};He.useState=function(e){return Vn.current.useState(e)};He.useSyncExternalStore=function(e,t,n){return Vn.current.useSyncExternalStore(e,t,n)};He.useTransition=function(){return Vn.current.useTransition()};He.version="18.3.1";$P.exports=He;var h=$P.exports;const YP=zr(h),GP=BR({__proto__:null,default:YP},[h]);/**
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 nD=h,rD=Symbol.for("react.element"),iD=Symbol.for("react.fragment"),aD=Object.prototype.hasOwnProperty,oD=nD.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lD={key:!0,ref:!0,__self:!0,__source:!0};function XP(e,t,n){var r,i={},a=null,l=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)aD.call(t,r)&&!lD.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:rD,type:e,key:a,ref:l,props:i,_owner:oD.current}}Ep.Fragment=iD;Ep.jsx=XP;Ep.jsxs=XP;zP.exports=Ep;var o=zP.exports,kg={},QP={exports:{}},xr={},JP={exports:{}},ZP={};/**
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(M,B){var k=M.length;M.push(B);e:for(;0<k;){var L=k-1>>>1,X=M[L];if(0<i(X,B))M[L]=B,M[k]=X,k=L;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var B=M[0],k=M.pop();if(k!==B){M[0]=k;e:for(var L=0,X=M.length,T=X>>>1;L<T;){var ce=2*(L+1)-1,ge=M[ce],Q=ce+1,ae=M[Q];if(0>i(ge,k))Q<X&&0>i(ae,ge)?(M[L]=ae,M[Q]=k,L=Q):(M[L]=ge,M[ce]=k,L=ce);else if(Q<X&&0>i(ae,k))M[L]=ae,M[Q]=k,L=Q;else break e}}return B}function i(M,B){var k=M.sortIndex-B.sortIndex;return k!==0?k:M.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var c=[],u=[],f=1,d=null,p=3,m=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,v=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(M){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=M)r(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(u)}}function j(M){if(y=!1,w(M),!g)if(n(c)!==null)g=!0,F(C);else{var B=n(u);B!==null&&W(j,B.startTime-M)}}function C(M,B){g=!1,y&&(y=!1,v(I),I=-1),m=!0;var k=p;try{for(w(B),d=n(c);d!==null&&(!(d.expirationTime>B)||M&&!_());){var L=d.callback;if(typeof L=="function"){d.callback=null,p=d.priorityLevel;var X=L(d.expirationTime<=B);B=e.unstable_now(),typeof X=="function"?d.callback=X:d===n(c)&&r(c),w(B)}else r(c);d=n(c)}if(d!==null)var T=!0;else{var ce=n(u);ce!==null&&W(j,ce.startTime-B),T=!1}return T}finally{d=null,p=k,m=!1}}var S=!1,E=null,I=-1,R=5,A=-1;function _(){return!(e.unstable_now()-A<R)}function N(){if(E!==null){var M=e.unstable_now();A=M;var B=!0;try{B=E(!0,M)}finally{B?Y():(S=!1,E=null)}}else S=!1}var Y;if(typeof b=="function")Y=function(){b(N)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,O=K.port2;K.port1.onmessage=N,Y=function(){O.postMessage(null)}}else Y=function(){x(N,0)};function F(M){E=M,S||(S=!0,Y())}function W(M,B){I=x(function(){M(e.unstable_now())},B)}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(M){M.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,F(C))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(M){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var k=p;p=B;try{return M()}finally{p=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,B){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var k=p;p=M;try{return B()}finally{p=k}},e.unstable_scheduleCallback=function(M,B,k){var L=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?L+k:L):k=L,M){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=k+X,M={id:f++,callback:B,priorityLevel:M,startTime:k,expirationTime:X,sortIndex:-1},k>L?(M.sortIndex=k,t(u,M),n(c)===null&&M===n(u)&&(y?(v(I),I=-1):y=!0,W(j,k-L))):(M.sortIndex=X,t(c,M),g||m||(g=!0,F(C))),M},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(M){var B=p;return function(){var k=p;p=B;try{return M.apply(this,arguments)}finally{p=k}}}})(ZP);JP.exports=ZP;var sD=JP.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 cD=h,gr=sD;function de(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 eE=new Set,xc={};function Ho(e,t){Bl(e,t),Bl(e+"Capture",t)}function Bl(e,t){for(xc[e]=t,e=0;e<t.length;e++)eE.add(t[e])}var Ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cg=Object.prototype.hasOwnProperty,uD=/^[: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]*$/,C1={},P1={};function dD(e){return Cg.call(P1,e)?!0:Cg.call(C1,e)?!1:uD.test(e)?P1[e]=!0:(C1[e]=!0,!1)}function fD(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 pD(e,t,n,r){if(t===null||typeof t>"u"||fD(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 Yn(e,t,n,r,i,a,l){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=l}var En={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){En[e]=new Yn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];En[t]=new Yn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){En[e]=new Yn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){En[e]=new Yn(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){En[e]=new Yn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){En[e]=new Yn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){En[e]=new Yn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){En[e]=new Yn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){En[e]=new Yn(e,5,!1,e.toLowerCase(),null,!1,!1)});var $y=/[\-:]([a-z])/g;function By(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($y,By);En[t]=new Yn(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($y,By);En[t]=new Yn(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($y,By);En[t]=new Yn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){En[e]=new Yn(e,1,!1,e.toLowerCase(),null,!1,!1)});En.xlinkHref=new Yn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){En[e]=new Yn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Fy(e,t,n,r){var i=En.hasOwnProperty(t)?En[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(pD(t,n,i,r)&&(n=null),r||i===null?dD(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 Ji=cD.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ku=Symbol.for("react.element"),hl=Symbol.for("react.portal"),ml=Symbol.for("react.fragment"),Uy=Symbol.for("react.strict_mode"),Pg=Symbol.for("react.profiler"),tE=Symbol.for("react.provider"),nE=Symbol.for("react.context"),Wy=Symbol.for("react.forward_ref"),Eg=Symbol.for("react.suspense"),Tg=Symbol.for("react.suspense_list"),Ky=Symbol.for("react.memo"),fa=Symbol.for("react.lazy"),rE=Symbol.for("react.offscreen"),E1=Symbol.iterator;function ks(e){return e===null||typeof e!="object"?null:(e=E1&&e[E1]||e["@@iterator"],typeof e=="function"?e:null)}var Dt=Object.assign,fm;function Vs(e){if(fm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);fm=t&&t[1]||""}return`
34
- `+fm+e}var pm=!1;function hm(e,t){if(!e||pm)return"";pm=!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
- `),l=i.length-1,s=a.length-1;1<=l&&0<=s&&i[l]!==a[s];)s--;for(;1<=l&&0<=s;l--,s--)if(i[l]!==a[s]){if(l!==1||s!==1)do if(l--,s--,0>s||i[l]!==a[s]){var c=`
37
- `+i[l].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=l&&0<=s);break}}}finally{pm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Vs(e):""}function hD(e){switch(e.tag){case 5:return Vs(e.type);case 16:return Vs("Lazy");case 13:return Vs("Suspense");case 19:return Vs("SuspenseList");case 0:case 2:case 15:return e=hm(e.type,!1),e;case 11:return e=hm(e.type.render,!1),e;case 1:return e=hm(e.type,!0),e;default:return""}}function Og(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 ml:return"Fragment";case hl:return"Portal";case Pg:return"Profiler";case Uy:return"StrictMode";case Eg:return"Suspense";case Tg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case nE:return(e.displayName||"Context")+".Consumer";case tE:return(e._context.displayName||"Context")+".Provider";case Wy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ky:return t=e.displayName||null,t!==null?t:Og(e.type)||"Memo";case fa:t=e._payload,e=e._init;try{return Og(e(t))}catch{}}return null}function mD(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 Og(t);case 8:return t===Uy?"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 Ra(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function iE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gD(e){var t=iE(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(l){r=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qu(e){e._valueTracker||(e._valueTracker=gD(e))}function aE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=iE(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Jd(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 Ag(e,t){var n=t.checked;return Dt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function T1(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ra(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 oE(e,t){t=t.checked,t!=null&&Fy(e,"checked",t,!1)}function Ig(e,t){oE(e,t);var n=Ra(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")?Ng(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ng(e,t.type,Ra(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function O1(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 Ng(e,t,n){(t!=="number"||Jd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ys=Array.isArray;function Ol(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=""+Ra(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 _g(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(de(91));return Dt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function A1(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(de(92));if(Ys(n)){if(1<n.length)throw Error(de(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ra(n)}}function lE(e,t){var n=Ra(t.value),r=Ra(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 I1(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function sE(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 Mg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?sE(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hu,cE=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(Hu=Hu||document.createElement("div"),Hu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Hu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ic={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},vD=["Webkit","ms","Moz","O"];Object.keys(ic).forEach(function(e){vD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ic[t]=ic[e]})});function uE(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ic.hasOwnProperty(e)&&ic[e]?(""+t).trim():t+"px"}function dE(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=uE(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var yD=Dt({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 Rg(e,t){if(t){if(yD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(de(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(de(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(de(61))}if(t.style!=null&&typeof t.style!="object")throw Error(de(62))}}function Dg(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 Lg=null;function qy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zg=null,Al=null,Il=null;function N1(e){if(e=ou(e)){if(typeof zg!="function")throw Error(de(280));var t=e.stateNode;t&&(t=Np(t),zg(e.stateNode,e.type,t))}}function fE(e){Al?Il?Il.push(e):Il=[e]:Al=e}function pE(){if(Al){var e=Al,t=Il;if(Il=Al=null,N1(e),t)for(e=0;e<t.length;e++)N1(t[e])}}function hE(e,t){return e(t)}function mE(){}var mm=!1;function gE(e,t,n){if(mm)return e(t,n);mm=!0;try{return hE(e,t,n)}finally{mm=!1,(Al!==null||Il!==null)&&(mE(),pE())}}function wc(e,t){var n=e.stateNode;if(n===null)return null;var r=Np(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(de(231,t,typeof n));return n}var $g=!1;if(Ki)try{var Cs={};Object.defineProperty(Cs,"passive",{get:function(){$g=!0}}),window.addEventListener("test",Cs,Cs),window.removeEventListener("test",Cs,Cs)}catch{$g=!1}function xD(e,t,n,r,i,a,l,s,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var ac=!1,Zd=null,ef=!1,Bg=null,bD={onError:function(e){ac=!0,Zd=e}};function wD(e,t,n,r,i,a,l,s,c){ac=!1,Zd=null,xD.apply(bD,arguments)}function jD(e,t,n,r,i,a,l,s,c){if(wD.apply(this,arguments),ac){if(ac){var u=Zd;ac=!1,Zd=null}else throw Error(de(198));ef||(ef=!0,Bg=u)}}function Vo(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 vE(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 _1(e){if(Vo(e)!==e)throw Error(de(188))}function SD(e){var t=e.alternate;if(!t){if(t=Vo(e),t===null)throw Error(de(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 _1(i),e;if(a===r)return _1(i),t;a=a.sibling}throw Error(de(188))}if(n.return!==r.return)n=i,r=a;else{for(var l=!1,s=i.child;s;){if(s===n){l=!0,n=i,r=a;break}if(s===r){l=!0,r=i,n=a;break}s=s.sibling}if(!l){for(s=a.child;s;){if(s===n){l=!0,n=a,r=i;break}if(s===r){l=!0,r=a,n=i;break}s=s.sibling}if(!l)throw Error(de(189))}}if(n.alternate!==r)throw Error(de(190))}if(n.tag!==3)throw Error(de(188));return n.stateNode.current===n?e:t}function yE(e){return e=SD(e),e!==null?xE(e):null}function xE(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=xE(e);if(t!==null)return t;e=e.sibling}return null}var bE=gr.unstable_scheduleCallback,M1=gr.unstable_cancelCallback,kD=gr.unstable_shouldYield,CD=gr.unstable_requestPaint,Yt=gr.unstable_now,PD=gr.unstable_getCurrentPriorityLevel,Hy=gr.unstable_ImmediatePriority,wE=gr.unstable_UserBlockingPriority,tf=gr.unstable_NormalPriority,ED=gr.unstable_LowPriority,jE=gr.unstable_IdlePriority,Tp=null,yi=null;function TD(e){if(yi&&typeof yi.onCommitFiberRoot=="function")try{yi.onCommitFiberRoot(Tp,e,void 0,(e.current.flags&128)===128)}catch{}}var Gr=Math.clz32?Math.clz32:ID,OD=Math.log,AD=Math.LN2;function ID(e){return e>>>=0,e===0?32:31-(OD(e)/AD|0)|0}var Vu=64,Yu=4194304;function Gs(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 nf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=Gs(s):(a&=l,a!==0&&(r=Gs(a)))}else l=n&~i,l!==0?r=Gs(l):a!==0&&(r=Gs(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-Gr(t),i=1<<n,r|=e[n],t&=~i;return r}function ND(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 _D(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-Gr(a),s=1<<l,c=i[l];c===-1?(!(s&n)||s&r)&&(i[l]=ND(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Fg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function SE(){var e=Vu;return Vu<<=1,!(Vu&4194240)&&(Vu=64),e}function gm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function iu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Gr(t),e[t]=n}function MD(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-Gr(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Vy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Gr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var dt=0;function kE(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var CE,Yy,PE,EE,TE,Ug=!1,Gu=[],Sa=null,ka=null,Ca=null,jc=new Map,Sc=new Map,ga=[],RD="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 R1(e,t){switch(e){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":ka=null;break;case"mouseover":case"mouseout":Ca=null;break;case"pointerover":case"pointerout":jc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sc.delete(t.pointerId)}}function Ps(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=ou(t),t!==null&&Yy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function DD(e,t,n,r,i){switch(t){case"focusin":return Sa=Ps(Sa,e,t,n,r,i),!0;case"dragenter":return ka=Ps(ka,e,t,n,r,i),!0;case"mouseover":return Ca=Ps(Ca,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return jc.set(a,Ps(jc.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Sc.set(a,Ps(Sc.get(a)||null,e,t,n,r,i)),!0}return!1}function OE(e){var t=mo(e.target);if(t!==null){var n=Vo(t);if(n!==null){if(t=n.tag,t===13){if(t=vE(n),t!==null){e.blockedOn=t,TE(e.priority,function(){PE(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 Md(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Wg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Lg=r,n.target.dispatchEvent(r),Lg=null}else return t=ou(n),t!==null&&Yy(t),e.blockedOn=n,!1;t.shift()}return!0}function D1(e,t,n){Md(e)&&n.delete(t)}function LD(){Ug=!1,Sa!==null&&Md(Sa)&&(Sa=null),ka!==null&&Md(ka)&&(ka=null),Ca!==null&&Md(Ca)&&(Ca=null),jc.forEach(D1),Sc.forEach(D1)}function Es(e,t){e.blockedOn===t&&(e.blockedOn=null,Ug||(Ug=!0,gr.unstable_scheduleCallback(gr.unstable_NormalPriority,LD)))}function kc(e){function t(i){return Es(i,e)}if(0<Gu.length){Es(Gu[0],e);for(var n=1;n<Gu.length;n++){var r=Gu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Sa!==null&&Es(Sa,e),ka!==null&&Es(ka,e),Ca!==null&&Es(Ca,e),jc.forEach(t),Sc.forEach(t),n=0;n<ga.length;n++)r=ga[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ga.length&&(n=ga[0],n.blockedOn===null);)OE(n),n.blockedOn===null&&ga.shift()}var Nl=Ji.ReactCurrentBatchConfig,rf=!0;function zD(e,t,n,r){var i=dt,a=Nl.transition;Nl.transition=null;try{dt=1,Gy(e,t,n,r)}finally{dt=i,Nl.transition=a}}function $D(e,t,n,r){var i=dt,a=Nl.transition;Nl.transition=null;try{dt=4,Gy(e,t,n,r)}finally{dt=i,Nl.transition=a}}function Gy(e,t,n,r){if(rf){var i=Wg(e,t,n,r);if(i===null)Pm(e,t,r,af,n),R1(e,r);else if(DD(i,e,t,n,r))r.stopPropagation();else if(R1(e,r),t&4&&-1<RD.indexOf(e)){for(;i!==null;){var a=ou(i);if(a!==null&&CE(a),a=Wg(e,t,n,r),a===null&&Pm(e,t,r,af,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Pm(e,t,r,null,n)}}var af=null;function Wg(e,t,n,r){if(af=null,e=qy(r),e=mo(e),e!==null)if(t=Vo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=vE(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 af=e,null}function AE(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(PD()){case Hy:return 1;case wE:return 4;case tf:case ED:return 16;case jE:return 536870912;default:return 16}default:return 16}}var xa=null,Xy=null,Rd=null;function IE(){if(Rd)return Rd;var e,t=Xy,n=t.length,r,i="value"in xa?xa.value:xa.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===i[a-r];r++);return Rd=i.slice(e,1<r?1-r:void 0)}function Dd(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 Xu(){return!0}function L1(){return!1}function br(e){function t(n,r,i,a,l){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Xu:L1,this.isPropagationStopped=L1,this}return Dt(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=Xu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xu)},persist:function(){},isPersistent:Xu}),t}var as={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qy=br(as),au=Dt({},as,{view:0,detail:0}),BD=br(au),vm,ym,Ts,Op=Dt({},au,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jy,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!==Ts&&(Ts&&e.type==="mousemove"?(vm=e.screenX-Ts.screenX,ym=e.screenY-Ts.screenY):ym=vm=0,Ts=e),vm)},movementY:function(e){return"movementY"in e?e.movementY:ym}}),z1=br(Op),FD=Dt({},Op,{dataTransfer:0}),UD=br(FD),WD=Dt({},au,{relatedTarget:0}),xm=br(WD),KD=Dt({},as,{animationName:0,elapsedTime:0,pseudoElement:0}),qD=br(KD),HD=Dt({},as,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),VD=br(HD),YD=Dt({},as,{data:0}),$1=br(YD),GD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XD={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"},QD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function JD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=QD[e])?!!t[e]:!1}function Jy(){return JD}var ZD=Dt({},au,{key:function(e){if(e.key){var t=GD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Dd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?XD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jy,charCode:function(e){return e.type==="keypress"?Dd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Dd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),eL=br(ZD),tL=Dt({},Op,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),B1=br(tL),nL=Dt({},au,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jy}),rL=br(nL),iL=Dt({},as,{propertyName:0,elapsedTime:0,pseudoElement:0}),aL=br(iL),oL=Dt({},Op,{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}),lL=br(oL),sL=[9,13,27,32],Zy=Ki&&"CompositionEvent"in window,oc=null;Ki&&"documentMode"in document&&(oc=document.documentMode);var cL=Ki&&"TextEvent"in window&&!oc,NE=Ki&&(!Zy||oc&&8<oc&&11>=oc),F1=" ",U1=!1;function _E(e,t){switch(e){case"keyup":return sL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ME(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gl=!1;function uL(e,t){switch(e){case"compositionend":return ME(t);case"keypress":return t.which!==32?null:(U1=!0,F1);case"textInput":return e=t.data,e===F1&&U1?null:e;default:return null}}function dL(e,t){if(gl)return e==="compositionend"||!Zy&&_E(e,t)?(e=IE(),Rd=Xy=xa=null,gl=!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 NE&&t.locale!=="ko"?null:t.data;default:return null}}var fL={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 W1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fL[e.type]:t==="textarea"}function RE(e,t,n,r){fE(r),t=of(t,"onChange"),0<t.length&&(n=new Qy("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var lc=null,Cc=null;function pL(e){HE(e,0)}function Ap(e){var t=xl(e);if(aE(t))return e}function hL(e,t){if(e==="change")return t}var DE=!1;if(Ki){var bm;if(Ki){var wm="oninput"in document;if(!wm){var K1=document.createElement("div");K1.setAttribute("oninput","return;"),wm=typeof K1.oninput=="function"}bm=wm}else bm=!1;DE=bm&&(!document.documentMode||9<document.documentMode)}function q1(){lc&&(lc.detachEvent("onpropertychange",LE),Cc=lc=null)}function LE(e){if(e.propertyName==="value"&&Ap(Cc)){var t=[];RE(t,Cc,e,qy(e)),gE(pL,t)}}function mL(e,t,n){e==="focusin"?(q1(),lc=t,Cc=n,lc.attachEvent("onpropertychange",LE)):e==="focusout"&&q1()}function gL(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ap(Cc)}function vL(e,t){if(e==="click")return Ap(t)}function yL(e,t){if(e==="input"||e==="change")return Ap(t)}function xL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qr=typeof Object.is=="function"?Object.is:xL;function Pc(e,t){if(Qr(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(!Cg.call(t,i)||!Qr(e[i],t[i]))return!1}return!0}function H1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function V1(e,t){var n=H1(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=H1(n)}}function zE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $E(){for(var e=window,t=Jd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jd(e.document)}return t}function ex(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 bL(e){var t=$E(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&zE(n.ownerDocument.documentElement,n)){if(r!==null&&ex(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=V1(n,a);var l=V1(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.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 wL=Ki&&"documentMode"in document&&11>=document.documentMode,vl=null,Kg=null,sc=null,qg=!1;function Y1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qg||vl==null||vl!==Jd(r)||(r=vl,"selectionStart"in r&&ex(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}),sc&&Pc(sc,r)||(sc=r,r=of(Kg,"onSelect"),0<r.length&&(t=new Qy("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=vl)))}function Qu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var yl={animationend:Qu("Animation","AnimationEnd"),animationiteration:Qu("Animation","AnimationIteration"),animationstart:Qu("Animation","AnimationStart"),transitionend:Qu("Transition","TransitionEnd")},jm={},BE={};Ki&&(BE=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function Ip(e){if(jm[e])return jm[e];if(!yl[e])return e;var t=yl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in BE)return jm[e]=t[n];return e}var FE=Ip("animationend"),UE=Ip("animationiteration"),WE=Ip("animationstart"),KE=Ip("transitionend"),qE=new Map,G1="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 Fa(e,t){qE.set(e,t),Ho(t,[e])}for(var Sm=0;Sm<G1.length;Sm++){var km=G1[Sm],jL=km.toLowerCase(),SL=km[0].toUpperCase()+km.slice(1);Fa(jL,"on"+SL)}Fa(FE,"onAnimationEnd");Fa(UE,"onAnimationIteration");Fa(WE,"onAnimationStart");Fa("dblclick","onDoubleClick");Fa("focusin","onFocus");Fa("focusout","onBlur");Fa(KE,"onTransitionEnd");Bl("onMouseEnter",["mouseout","mouseover"]);Bl("onMouseLeave",["mouseout","mouseover"]);Bl("onPointerEnter",["pointerout","pointerover"]);Bl("onPointerLeave",["pointerout","pointerover"]);Ho("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ho("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ho("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ho("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ho("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ho("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xs="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(" "),kL=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xs));function X1(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,jD(r,t,void 0,e),e.currentTarget=null}function HE(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 l=r.length-1;0<=l;l--){var s=r[l],c=s.instance,u=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break e;X1(i,s,u),a=c}else for(l=0;l<r.length;l++){if(s=r[l],c=s.instance,u=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break e;X1(i,s,u),a=c}}}if(ef)throw e=Bg,ef=!1,Bg=null,e}function kt(e,t){var n=t[Xg];n===void 0&&(n=t[Xg]=new Set);var r=e+"__bubble";n.has(r)||(VE(t,e,2,!1),n.add(r))}function Cm(e,t,n){var r=0;t&&(r|=4),VE(n,e,r,t)}var Ju="_reactListening"+Math.random().toString(36).slice(2);function Ec(e){if(!e[Ju]){e[Ju]=!0,eE.forEach(function(n){n!=="selectionchange"&&(kL.has(n)||Cm(n,!1,e),Cm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ju]||(t[Ju]=!0,Cm("selectionchange",!1,t))}}function VE(e,t,n,r){switch(AE(t)){case 1:var i=zD;break;case 4:i=$D;break;default:i=Gy}n=i.bind(null,t,n,e),i=void 0,!$g||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 Pm(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(l===4)for(l=r.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;l=l.return}for(;s!==null;){if(l=mo(s),l===null)return;if(c=l.tag,c===5||c===6){r=a=l;continue e}s=s.parentNode}}r=r.return}gE(function(){var u=a,f=qy(n),d=[];e:{var p=qE.get(e);if(p!==void 0){var m=Qy,g=e;switch(e){case"keypress":if(Dd(n)===0)break e;case"keydown":case"keyup":m=eL;break;case"focusin":g="focus",m=xm;break;case"focusout":g="blur",m=xm;break;case"beforeblur":case"afterblur":m=xm;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=z1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=UD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=rL;break;case FE:case UE:case WE:m=qD;break;case KE:m=aL;break;case"scroll":m=BD;break;case"wheel":m=lL;break;case"copy":case"cut":case"paste":m=VD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=B1}var y=(t&4)!==0,x=!y&&e==="scroll",v=y?p!==null?p+"Capture":null:p;y=[];for(var b=u,w;b!==null;){w=b;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,v!==null&&(j=wc(b,v),j!=null&&y.push(Tc(b,j,w)))),x)break;b=b.return}0<y.length&&(p=new m(p,g,null,n,f),d.push({event:p,listeners:y}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&n!==Lg&&(g=n.relatedTarget||n.fromElement)&&(mo(g)||g[qi]))break e;if((m||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?mo(g):null,g!==null&&(x=Vo(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(y=z1,j="onMouseLeave",v="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(y=B1,j="onPointerLeave",v="onPointerEnter",b="pointer"),x=m==null?p:xl(m),w=g==null?p:xl(g),p=new y(j,b+"leave",m,n,f),p.target=x,p.relatedTarget=w,j=null,mo(f)===u&&(y=new y(v,b+"enter",g,n,f),y.target=w,y.relatedTarget=x,j=y),x=j,m&&g)t:{for(y=m,v=g,b=0,w=y;w;w=il(w))b++;for(w=0,j=v;j;j=il(j))w++;for(;0<b-w;)y=il(y),b--;for(;0<w-b;)v=il(v),w--;for(;b--;){if(y===v||v!==null&&y===v.alternate)break t;y=il(y),v=il(v)}y=null}else y=null;m!==null&&Q1(d,p,m,y,!1),g!==null&&x!==null&&Q1(d,x,g,y,!0)}}e:{if(p=u?xl(u):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var C=hL;else if(W1(p))if(DE)C=yL;else{C=gL;var S=mL}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(C=vL);if(C&&(C=C(e,u))){RE(d,C,n,f);break e}S&&S(e,p,u),e==="focusout"&&(S=p._wrapperState)&&S.controlled&&p.type==="number"&&Ng(p,"number",p.value)}switch(S=u?xl(u):window,e){case"focusin":(W1(S)||S.contentEditable==="true")&&(vl=S,Kg=u,sc=null);break;case"focusout":sc=Kg=vl=null;break;case"mousedown":qg=!0;break;case"contextmenu":case"mouseup":case"dragend":qg=!1,Y1(d,n,f);break;case"selectionchange":if(wL)break;case"keydown":case"keyup":Y1(d,n,f)}var E;if(Zy)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else gl?_E(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(NE&&n.locale!=="ko"&&(gl||I!=="onCompositionStart"?I==="onCompositionEnd"&&gl&&(E=IE()):(xa=f,Xy="value"in xa?xa.value:xa.textContent,gl=!0)),S=of(u,I),0<S.length&&(I=new $1(I,e,null,n,f),d.push({event:I,listeners:S}),E?I.data=E:(E=ME(n),E!==null&&(I.data=E)))),(E=cL?uL(e,n):dL(e,n))&&(u=of(u,"onBeforeInput"),0<u.length&&(f=new $1("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:u}),f.data=E))}HE(d,t)})}function Tc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function of(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=wc(e,n),a!=null&&r.unshift(Tc(e,a,i)),a=wc(e,t),a!=null&&r.push(Tc(e,a,i))),e=e.return}return r}function il(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Q1(e,t,n,r,i){for(var a=t._reactName,l=[];n!==null&&n!==r;){var s=n,c=s.alternate,u=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&u!==null&&(s=u,i?(c=wc(n,a),c!=null&&l.unshift(Tc(n,c,s))):i||(c=wc(n,a),c!=null&&l.push(Tc(n,c,s)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var CL=/\r\n?/g,PL=/\u0000|\uFFFD/g;function J1(e){return(typeof e=="string"?e:""+e).replace(CL,`
38
- `).replace(PL,"")}function Zu(e,t,n){if(t=J1(t),J1(e)!==t&&n)throw Error(de(425))}function lf(){}var Hg=null,Vg=null;function Yg(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 Gg=typeof setTimeout=="function"?setTimeout:void 0,EL=typeof clearTimeout=="function"?clearTimeout:void 0,Z1=typeof Promise=="function"?Promise:void 0,TL=typeof queueMicrotask=="function"?queueMicrotask:typeof Z1<"u"?function(e){return Z1.resolve(null).then(e).catch(OL)}:Gg;function OL(e){setTimeout(function(){throw e})}function Em(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),kc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);kc(t)}function Pa(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 ew(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 os=Math.random().toString(36).slice(2),hi="__reactFiber$"+os,Oc="__reactProps$"+os,qi="__reactContainer$"+os,Xg="__reactEvents$"+os,AL="__reactListeners$"+os,IL="__reactHandles$"+os;function mo(e){var t=e[hi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qi]||n[hi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ew(e);e!==null;){if(n=e[hi])return n;e=ew(e)}return t}e=n,n=e.parentNode}return null}function ou(e){return e=e[hi]||e[qi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function xl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(de(33))}function Np(e){return e[Oc]||null}var Qg=[],bl=-1;function Ua(e){return{current:e}}function Et(e){0>bl||(e.current=Qg[bl],Qg[bl]=null,bl--)}function jt(e,t){bl++,Qg[bl]=e.current,e.current=t}var Da={},Dn=Ua(Da),rr=Ua(!1),Io=Da;function Fl(e,t){var n=e.type.contextTypes;if(!n)return Da;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 ir(e){return e=e.childContextTypes,e!=null}function sf(){Et(rr),Et(Dn)}function tw(e,t,n){if(Dn.current!==Da)throw Error(de(168));jt(Dn,t),jt(rr,n)}function YE(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(de(108,mD(e)||"Unknown",i));return Dt({},n,r)}function cf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Da,Io=Dn.current,jt(Dn,e),jt(rr,rr.current),!0}function nw(e,t,n){var r=e.stateNode;if(!r)throw Error(de(169));n?(e=YE(e,t,Io),r.__reactInternalMemoizedMergedChildContext=e,Et(rr),Et(Dn),jt(Dn,e)):Et(rr),jt(rr,n)}var Mi=null,_p=!1,Tm=!1;function GE(e){Mi===null?Mi=[e]:Mi.push(e)}function NL(e){_p=!0,GE(e)}function Wa(){if(!Tm&&Mi!==null){Tm=!0;var e=0,t=dt;try{var n=Mi;for(dt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Mi=null,_p=!1}catch(i){throw Mi!==null&&(Mi=Mi.slice(e+1)),bE(Hy,Wa),i}finally{dt=t,Tm=!1}}return null}var wl=[],jl=0,uf=null,df=0,Tr=[],Or=0,No=null,Li=1,zi="";function so(e,t){wl[jl++]=df,wl[jl++]=uf,uf=e,df=t}function XE(e,t,n){Tr[Or++]=Li,Tr[Or++]=zi,Tr[Or++]=No,No=e;var r=Li;e=zi;var i=32-Gr(r)-1;r&=~(1<<i),n+=1;var a=32-Gr(t)+i;if(30<a){var l=i-i%5;a=(r&(1<<l)-1).toString(32),r>>=l,i-=l,Li=1<<32-Gr(t)+i|n<<i|r,zi=a+e}else Li=1<<a|n<<i|r,zi=e}function tx(e){e.return!==null&&(so(e,1),XE(e,1,0))}function nx(e){for(;e===uf;)uf=wl[--jl],wl[jl]=null,df=wl[--jl],wl[jl]=null;for(;e===No;)No=Tr[--Or],Tr[Or]=null,zi=Tr[--Or],Tr[Or]=null,Li=Tr[--Or],Tr[Or]=null}var hr=null,dr=null,At=!1,qr=null;function QE(e,t){var n=Ir(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 rw(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,hr=e,dr=Pa(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,hr=e,dr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=No!==null?{id:Li,overflow:zi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ir(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,hr=e,dr=null,!0):!1;default:return!1}}function Jg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zg(e){if(At){var t=dr;if(t){var n=t;if(!rw(e,t)){if(Jg(e))throw Error(de(418));t=Pa(n.nextSibling);var r=hr;t&&rw(e,t)?QE(r,n):(e.flags=e.flags&-4097|2,At=!1,hr=e)}}else{if(Jg(e))throw Error(de(418));e.flags=e.flags&-4097|2,At=!1,hr=e}}}function iw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;hr=e}function ed(e){if(e!==hr)return!1;if(!At)return iw(e),At=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Yg(e.type,e.memoizedProps)),t&&(t=dr)){if(Jg(e))throw JE(),Error(de(418));for(;t;)QE(e,t),t=Pa(t.nextSibling)}if(iw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(de(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){dr=Pa(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}dr=null}}else dr=hr?Pa(e.stateNode.nextSibling):null;return!0}function JE(){for(var e=dr;e;)e=Pa(e.nextSibling)}function Ul(){dr=hr=null,At=!1}function rx(e){qr===null?qr=[e]:qr.push(e)}var _L=Ji.ReactCurrentBatchConfig;function Os(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(de(309));var r=n.stateNode}if(!r)throw Error(de(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(l){var s=i.refs;l===null?delete s[a]:s[a]=l},t._stringRef=a,t)}if(typeof e!="string")throw Error(de(284));if(!n._owner)throw Error(de(290,e))}return e}function td(e,t){throw e=Object.prototype.toString.call(t),Error(de(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function aw(e){var t=e._init;return t(e._payload)}function ZE(e){function t(v,b){if(e){var w=v.deletions;w===null?(v.deletions=[b],v.flags|=16):w.push(b)}}function n(v,b){if(!e)return null;for(;b!==null;)t(v,b),b=b.sibling;return null}function r(v,b){for(v=new Map;b!==null;)b.key!==null?v.set(b.key,b):v.set(b.index,b),b=b.sibling;return v}function i(v,b){return v=Aa(v,b),v.index=0,v.sibling=null,v}function a(v,b,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<b?(v.flags|=2,b):w):(v.flags|=2,b)):(v.flags|=1048576,b)}function l(v){return e&&v.alternate===null&&(v.flags|=2),v}function s(v,b,w,j){return b===null||b.tag!==6?(b=Rm(w,v.mode,j),b.return=v,b):(b=i(b,w),b.return=v,b)}function c(v,b,w,j){var C=w.type;return C===ml?f(v,b,w.props.children,j,w.key):b!==null&&(b.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===fa&&aw(C)===b.type)?(j=i(b,w.props),j.ref=Os(v,b,w),j.return=v,j):(j=Wd(w.type,w.key,w.props,null,v.mode,j),j.ref=Os(v,b,w),j.return=v,j)}function u(v,b,w,j){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=Dm(w,v.mode,j),b.return=v,b):(b=i(b,w.children||[]),b.return=v,b)}function f(v,b,w,j,C){return b===null||b.tag!==7?(b=Co(w,v.mode,j,C),b.return=v,b):(b=i(b,w),b.return=v,b)}function d(v,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=Rm(""+b,v.mode,w),b.return=v,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ku:return w=Wd(b.type,b.key,b.props,null,v.mode,w),w.ref=Os(v,null,b),w.return=v,w;case hl:return b=Dm(b,v.mode,w),b.return=v,b;case fa:var j=b._init;return d(v,j(b._payload),w)}if(Ys(b)||ks(b))return b=Co(b,v.mode,w,null),b.return=v,b;td(v,b)}return null}function p(v,b,w,j){var C=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return C!==null?null:s(v,b,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ku:return w.key===C?c(v,b,w,j):null;case hl:return w.key===C?u(v,b,w,j):null;case fa:return C=w._init,p(v,b,C(w._payload),j)}if(Ys(w)||ks(w))return C!==null?null:f(v,b,w,j,null);td(v,w)}return null}function m(v,b,w,j,C){if(typeof j=="string"&&j!==""||typeof j=="number")return v=v.get(w)||null,s(b,v,""+j,C);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Ku:return v=v.get(j.key===null?w:j.key)||null,c(b,v,j,C);case hl:return v=v.get(j.key===null?w:j.key)||null,u(b,v,j,C);case fa:var S=j._init;return m(v,b,w,S(j._payload),C)}if(Ys(j)||ks(j))return v=v.get(w)||null,f(b,v,j,C,null);td(b,j)}return null}function g(v,b,w,j){for(var C=null,S=null,E=b,I=b=0,R=null;E!==null&&I<w.length;I++){E.index>I?(R=E,E=null):R=E.sibling;var A=p(v,E,w[I],j);if(A===null){E===null&&(E=R);break}e&&E&&A.alternate===null&&t(v,E),b=a(A,b,I),S===null?C=A:S.sibling=A,S=A,E=R}if(I===w.length)return n(v,E),At&&so(v,I),C;if(E===null){for(;I<w.length;I++)E=d(v,w[I],j),E!==null&&(b=a(E,b,I),S===null?C=E:S.sibling=E,S=E);return At&&so(v,I),C}for(E=r(v,E);I<w.length;I++)R=m(E,v,I,w[I],j),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?I:R.key),b=a(R,b,I),S===null?C=R:S.sibling=R,S=R);return e&&E.forEach(function(_){return t(v,_)}),At&&so(v,I),C}function y(v,b,w,j){var C=ks(w);if(typeof C!="function")throw Error(de(150));if(w=C.call(w),w==null)throw Error(de(151));for(var S=C=null,E=b,I=b=0,R=null,A=w.next();E!==null&&!A.done;I++,A=w.next()){E.index>I?(R=E,E=null):R=E.sibling;var _=p(v,E,A.value,j);if(_===null){E===null&&(E=R);break}e&&E&&_.alternate===null&&t(v,E),b=a(_,b,I),S===null?C=_:S.sibling=_,S=_,E=R}if(A.done)return n(v,E),At&&so(v,I),C;if(E===null){for(;!A.done;I++,A=w.next())A=d(v,A.value,j),A!==null&&(b=a(A,b,I),S===null?C=A:S.sibling=A,S=A);return At&&so(v,I),C}for(E=r(v,E);!A.done;I++,A=w.next())A=m(E,v,I,A.value,j),A!==null&&(e&&A.alternate!==null&&E.delete(A.key===null?I:A.key),b=a(A,b,I),S===null?C=A:S.sibling=A,S=A);return e&&E.forEach(function(N){return t(v,N)}),At&&so(v,I),C}function x(v,b,w,j){if(typeof w=="object"&&w!==null&&w.type===ml&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ku:e:{for(var C=w.key,S=b;S!==null;){if(S.key===C){if(C=w.type,C===ml){if(S.tag===7){n(v,S.sibling),b=i(S,w.props.children),b.return=v,v=b;break e}}else if(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===fa&&aw(C)===S.type){n(v,S.sibling),b=i(S,w.props),b.ref=Os(v,S,w),b.return=v,v=b;break e}n(v,S);break}else t(v,S);S=S.sibling}w.type===ml?(b=Co(w.props.children,v.mode,j,w.key),b.return=v,v=b):(j=Wd(w.type,w.key,w.props,null,v.mode,j),j.ref=Os(v,b,w),j.return=v,v=j)}return l(v);case hl: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(v,b.sibling),b=i(b,w.children||[]),b.return=v,v=b;break e}else{n(v,b);break}else t(v,b);b=b.sibling}b=Dm(w,v.mode,j),b.return=v,v=b}return l(v);case fa:return S=w._init,x(v,b,S(w._payload),j)}if(Ys(w))return g(v,b,w,j);if(ks(w))return y(v,b,w,j);td(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(v,b.sibling),b=i(b,w),b.return=v,v=b):(n(v,b),b=Rm(w,v.mode,j),b.return=v,v=b),l(v)):n(v,b)}return x}var Wl=ZE(!0),e2=ZE(!1),ff=Ua(null),pf=null,Sl=null,ix=null;function ax(){ix=Sl=pf=null}function ox(e){var t=ff.current;Et(ff),e._currentValue=t}function ev(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 _l(e,t){pf=e,ix=Sl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(er=!0),e.firstContext=null)}function Rr(e){var t=e._currentValue;if(ix!==e)if(e={context:e,memoizedValue:t,next:null},Sl===null){if(pf===null)throw Error(de(308));Sl=e,pf.dependencies={lanes:0,firstContext:e}}else Sl=Sl.next=e;return t}var go=null;function lx(e){go===null?go=[e]:go.push(e)}function t2(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,lx(t)):(n.next=i.next,i.next=n),t.interleaved=n,Hi(e,r)}function Hi(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 pa=!1;function sx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function n2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Fi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ea(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,et&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Hi(e,n)}return i=r.interleaved,i===null?(t.next=t,lx(r)):(t.next=i.next,i.next=t),r.interleaved=t,Hi(e,n)}function Ld(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,Vy(e,n)}}function ow(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 l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=l:a=a.next=l,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 hf(e,t,n,r){var i=e.updateQueue;pa=!1;var a=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,u=c.next;c.next=null,l===null?a=u:l.next=u,l=c;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;l=0,f=u=c=null,s=a;do{var p=s.lane,m=s.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:m,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,y=s;switch(p=t,m=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){d=g.call(m,d,p);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,p=typeof g=="function"?g.call(m,d,p):g,p==null)break e;d=Dt({},d,p);break e;case 2:pa=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else m={eventTime:m,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=m,c=d):f=f.next=m,l|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(c=d),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Mo|=l,e.lanes=l,e.memoizedState=d}}function lw(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(de(191,i));i.call(r)}}}var lu={},xi=Ua(lu),Ac=Ua(lu),Ic=Ua(lu);function vo(e){if(e===lu)throw Error(de(174));return e}function cx(e,t){switch(jt(Ic,t),jt(Ac,e),jt(xi,lu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Mg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Mg(t,e)}Et(xi),jt(xi,t)}function Kl(){Et(xi),Et(Ac),Et(Ic)}function r2(e){vo(Ic.current);var t=vo(xi.current),n=Mg(t,e.type);t!==n&&(jt(Ac,e),jt(xi,n))}function ux(e){Ac.current===e&&(Et(xi),Et(Ac))}var _t=Ua(0);function mf(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 Om=[];function dx(){for(var e=0;e<Om.length;e++)Om[e]._workInProgressVersionPrimary=null;Om.length=0}var zd=Ji.ReactCurrentDispatcher,Am=Ji.ReactCurrentBatchConfig,_o=0,Mt=null,on=null,gn=null,gf=!1,cc=!1,Nc=0,ML=0;function On(){throw Error(de(321))}function fx(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Qr(e[n],t[n]))return!1;return!0}function px(e,t,n,r,i,a){if(_o=a,Mt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,zd.current=e===null||e.memoizedState===null?zL:$L,e=n(r,i),cc){a=0;do{if(cc=!1,Nc=0,25<=a)throw Error(de(301));a+=1,gn=on=null,t.updateQueue=null,zd.current=BL,e=n(r,i)}while(cc)}if(zd.current=vf,t=on!==null&&on.next!==null,_o=0,gn=on=Mt=null,gf=!1,t)throw Error(de(300));return e}function hx(){var e=Nc!==0;return Nc=0,e}function di(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gn===null?Mt.memoizedState=gn=e:gn=gn.next=e,gn}function Dr(){if(on===null){var e=Mt.alternate;e=e!==null?e.memoizedState:null}else e=on.next;var t=gn===null?Mt.memoizedState:gn.next;if(t!==null)gn=t,on=e;else{if(e===null)throw Error(de(310));on=e,e={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},gn===null?Mt.memoizedState=gn=e:gn=gn.next=e}return gn}function _c(e,t){return typeof t=="function"?t(e):t}function Im(e){var t=Dr(),n=t.queue;if(n===null)throw Error(de(311));n.lastRenderedReducer=e;var r=on,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var l=i.next;i.next=a.next,a.next=l}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var s=l=null,c=null,u=a;do{var f=u.lane;if((_o&f)===f)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:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(s=c=d,l=r):c=c.next=d,Mt.lanes|=f,Mo|=f}u=u.next}while(u!==null&&u!==a);c===null?l=r:c.next=s,Qr(r,t.memoizedState)||(er=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,Mt.lanes|=a,Mo|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Nm(e){var t=Dr(),n=t.queue;if(n===null)throw Error(de(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var l=i=i.next;do a=e(a,l.action),l=l.next;while(l!==i);Qr(a,t.memoizedState)||(er=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function i2(){}function a2(e,t){var n=Mt,r=Dr(),i=t(),a=!Qr(r.memoizedState,i);if(a&&(r.memoizedState=i,er=!0),r=r.queue,mx(s2.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||gn!==null&&gn.memoizedState.tag&1){if(n.flags|=2048,Mc(9,l2.bind(null,n,r,i,t),void 0,null),yn===null)throw Error(de(349));_o&30||o2(n,t,i)}return i}function o2(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Mt.updateQueue,t===null?(t={lastEffect:null,stores:null},Mt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function l2(e,t,n,r){t.value=n,t.getSnapshot=r,c2(t)&&u2(e)}function s2(e,t,n){return n(function(){c2(t)&&u2(e)})}function c2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qr(e,n)}catch{return!0}}function u2(e){var t=Hi(e,1);t!==null&&Xr(t,e,1,-1)}function sw(e){var t=di();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_c,lastRenderedState:e},t.queue=e,e=e.dispatch=LL.bind(null,Mt,e),[t.memoizedState,e]}function Mc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Mt.updateQueue,t===null?(t={lastEffect:null,stores:null},Mt.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 d2(){return Dr().memoizedState}function $d(e,t,n,r){var i=di();Mt.flags|=e,i.memoizedState=Mc(1|t,n,void 0,r===void 0?null:r)}function Mp(e,t,n,r){var i=Dr();r=r===void 0?null:r;var a=void 0;if(on!==null){var l=on.memoizedState;if(a=l.destroy,r!==null&&fx(r,l.deps)){i.memoizedState=Mc(t,n,a,r);return}}Mt.flags|=e,i.memoizedState=Mc(1|t,n,a,r)}function cw(e,t){return $d(8390656,8,e,t)}function mx(e,t){return Mp(2048,8,e,t)}function f2(e,t){return Mp(4,2,e,t)}function p2(e,t){return Mp(4,4,e,t)}function h2(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 m2(e,t,n){return n=n!=null?n.concat([e]):null,Mp(4,4,h2.bind(null,t,e),n)}function gx(){}function g2(e,t){var n=Dr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&fx(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function v2(e,t){var n=Dr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&fx(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function y2(e,t,n){return _o&21?(Qr(n,t)||(n=SE(),Mt.lanes|=n,Mo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,er=!0),e.memoizedState=n)}function RL(e,t){var n=dt;dt=n!==0&&4>n?n:4,e(!0);var r=Am.transition;Am.transition={};try{e(!1),t()}finally{dt=n,Am.transition=r}}function x2(){return Dr().memoizedState}function DL(e,t,n){var r=Oa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},b2(e))w2(t,n);else if(n=t2(e,t,n,r),n!==null){var i=Kn();Xr(n,e,r,i),j2(n,t,r)}}function LL(e,t,n){var r=Oa(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(b2(e))w2(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,s=a(l,n);if(i.hasEagerState=!0,i.eagerState=s,Qr(s,l)){var c=t.interleaved;c===null?(i.next=i,lx(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=t2(e,t,i,r),n!==null&&(i=Kn(),Xr(n,e,r,i),j2(n,t,r))}}function b2(e){var t=e.alternate;return e===Mt||t!==null&&t===Mt}function w2(e,t){cc=gf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function j2(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vy(e,n)}}var vf={readContext:Rr,useCallback:On,useContext:On,useEffect:On,useImperativeHandle:On,useInsertionEffect:On,useLayoutEffect:On,useMemo:On,useReducer:On,useRef:On,useState:On,useDebugValue:On,useDeferredValue:On,useTransition:On,useMutableSource:On,useSyncExternalStore:On,useId:On,unstable_isNewReconciler:!1},zL={readContext:Rr,useCallback:function(e,t){return di().memoizedState=[e,t===void 0?null:t],e},useContext:Rr,useEffect:cw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$d(4194308,4,h2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $d(4194308,4,e,t)},useInsertionEffect:function(e,t){return $d(4,2,e,t)},useMemo:function(e,t){var n=di();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=di();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=DL.bind(null,Mt,e),[r.memoizedState,e]},useRef:function(e){var t=di();return e={current:e},t.memoizedState=e},useState:sw,useDebugValue:gx,useDeferredValue:function(e){return di().memoizedState=e},useTransition:function(){var e=sw(!1),t=e[0];return e=RL.bind(null,e[1]),di().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Mt,i=di();if(At){if(n===void 0)throw Error(de(407));n=n()}else{if(n=t(),yn===null)throw Error(de(349));_o&30||o2(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,cw(s2.bind(null,r,a,e),[e]),r.flags|=2048,Mc(9,l2.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=di(),t=yn.identifierPrefix;if(At){var n=zi,r=Li;n=(r&~(1<<32-Gr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Nc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ML++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$L={readContext:Rr,useCallback:g2,useContext:Rr,useEffect:mx,useImperativeHandle:m2,useInsertionEffect:f2,useLayoutEffect:p2,useMemo:v2,useReducer:Im,useRef:d2,useState:function(){return Im(_c)},useDebugValue:gx,useDeferredValue:function(e){var t=Dr();return y2(t,on.memoizedState,e)},useTransition:function(){var e=Im(_c)[0],t=Dr().memoizedState;return[e,t]},useMutableSource:i2,useSyncExternalStore:a2,useId:x2,unstable_isNewReconciler:!1},BL={readContext:Rr,useCallback:g2,useContext:Rr,useEffect:mx,useImperativeHandle:m2,useInsertionEffect:f2,useLayoutEffect:p2,useMemo:v2,useReducer:Nm,useRef:d2,useState:function(){return Nm(_c)},useDebugValue:gx,useDeferredValue:function(e){var t=Dr();return on===null?t.memoizedState=e:y2(t,on.memoizedState,e)},useTransition:function(){var e=Nm(_c)[0],t=Dr().memoizedState;return[e,t]},useMutableSource:i2,useSyncExternalStore:a2,useId:x2,unstable_isNewReconciler:!1};function Wr(e,t){if(e&&e.defaultProps){t=Dt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function tv(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Dt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rp={isMounted:function(e){return(e=e._reactInternals)?Vo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Kn(),i=Oa(e),a=Fi(r,i);a.payload=t,n!=null&&(a.callback=n),t=Ea(e,a,i),t!==null&&(Xr(t,e,i,r),Ld(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Kn(),i=Oa(e),a=Fi(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Ea(e,a,i),t!==null&&(Xr(t,e,i,r),Ld(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Kn(),r=Oa(e),i=Fi(n,r);i.tag=2,t!=null&&(i.callback=t),t=Ea(e,i,r),t!==null&&(Xr(t,e,r,n),Ld(t,e,r))}};function uw(e,t,n,r,i,a,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,l):t.prototype&&t.prototype.isPureReactComponent?!Pc(n,r)||!Pc(i,a):!0}function S2(e,t,n){var r=!1,i=Da,a=t.contextType;return typeof a=="object"&&a!==null?a=Rr(a):(i=ir(t)?Io:Dn.current,r=t.contextTypes,a=(r=r!=null)?Fl(e,i):Da),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Rp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function dw(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&&Rp.enqueueReplaceState(t,t.state,null)}function nv(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},sx(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Rr(a):(a=ir(t)?Io:Dn.current,i.context=Fl(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(tv(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&&Rp.enqueueReplaceState(i,i.state,null),hf(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ql(e,t){try{var n="",r=t;do n+=hD(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 _m(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function rv(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var FL=typeof WeakMap=="function"?WeakMap:Map;function k2(e,t,n){n=Fi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xf||(xf=!0,pv=r),rv(e,t)},n}function C2(e,t,n){n=Fi(-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(){rv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){rv(e,t),typeof r!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function fw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new FL;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=tz.bind(null,e,t,n),t.then(e,e))}function pw(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 hw(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=Fi(-1,1),t.tag=2,Ea(n,t,1))),n.lanes|=1),e)}var UL=Ji.ReactCurrentOwner,er=!1;function Fn(e,t,n,r){t.child=e===null?e2(t,null,n,r):Wl(t,e.child,n,r)}function mw(e,t,n,r,i){n=n.render;var a=t.ref;return _l(t,i),r=px(e,t,n,r,a,i),n=hx(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Vi(e,t,i)):(At&&n&&tx(t),t.flags|=1,Fn(e,t,r,i),t.child)}function gw(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!kx(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,P2(e,t,a,r,i)):(e=Wd(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 l=a.memoizedProps;if(n=n.compare,n=n!==null?n:Pc,n(l,r)&&e.ref===t.ref)return Vi(e,t,i)}return t.flags|=1,e=Aa(a,r),e.ref=t.ref,e.return=t,t.child=e}function P2(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Pc(a,r)&&e.ref===t.ref)if(er=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(er=!0);else return t.lanes=e.lanes,Vi(e,t,i)}return iv(e,t,n,r,i)}function E2(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},jt(Cl,cr),cr|=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,jt(Cl,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,jt(Cl,cr),cr|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,jt(Cl,cr),cr|=r;return Fn(e,t,i,n),t.child}function T2(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function iv(e,t,n,r,i){var a=ir(n)?Io:Dn.current;return a=Fl(t,a),_l(t,i),n=px(e,t,n,r,a,i),r=hx(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Vi(e,t,i)):(At&&r&&tx(t),t.flags|=1,Fn(e,t,n,i),t.child)}function vw(e,t,n,r,i){if(ir(n)){var a=!0;cf(t)}else a=!1;if(_l(t,i),t.stateNode===null)Bd(e,t),S2(t,n,r),nv(t,n,r,i),r=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var c=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=Rr(u):(u=ir(n)?Io:Dn.current,u=Fl(t,u));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||c!==u)&&dw(t,l,r,u),pa=!1;var p=t.memoizedState;l.state=p,hf(t,r,l,i),c=t.memoizedState,s!==r||p!==c||rr.current||pa?(typeof f=="function"&&(tv(t,n,f,r),c=t.memoizedState),(s=pa||uw(t,n,s,r,p,c,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),l.props=r,l.state=c,l.context=u,r=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,n2(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Wr(t.type,s),l.props=u,d=t.pendingProps,p=l.context,c=n.contextType,typeof c=="object"&&c!==null?c=Rr(c):(c=ir(n)?Io:Dn.current,c=Fl(t,c));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==d||p!==c)&&dw(t,l,r,c),pa=!1,p=t.memoizedState,l.state=p,hf(t,r,l,i);var g=t.memoizedState;s!==d||p!==g||rr.current||pa?(typeof m=="function"&&(tv(t,n,m,r),g=t.memoizedState),(u=pa||uw(t,n,u,r,p,g,c)||!1)?(f||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,g,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,g,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),l.props=r,l.state=g,l.context=c,r=u):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return av(e,t,n,r,a,i)}function av(e,t,n,r,i,a){T2(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return i&&nw(t,n,!1),Vi(e,t,a);r=t.stateNode,UL.current=t;var s=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Wl(t,e.child,null,a),t.child=Wl(t,null,s,a)):Fn(e,t,s,a),t.memoizedState=r.state,i&&nw(t,n,!0),t.child}function O2(e){var t=e.stateNode;t.pendingContext?tw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tw(e,t.context,!1),cx(e,t.containerInfo)}function yw(e,t,n,r,i){return Ul(),rx(i),t.flags|=256,Fn(e,t,n,r),t.child}var ov={dehydrated:null,treeContext:null,retryLane:0};function lv(e){return{baseLanes:e,cachePool:null,transitions:null}}function A2(e,t,n){var r=t.pendingProps,i=_t.current,a=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),jt(_t,i&1),e===null)return Zg(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):(l=r.children,e=r.fallback,a?(r=t.mode,a=t.child,l={mode:"hidden",children:l},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=zp(l,r,0,null),e=Co(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=lv(n),t.memoizedState=ov,e):vx(t,l));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return WL(e,t,l,r,s,i,n);if(a){a=r.fallback,l=t.mode,i=e.child,s=i.sibling;var c={mode:"hidden",children:r.children};return!(l&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Aa(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=Aa(s,a):(a=Co(a,l,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,l=e.child.memoizedState,l=l===null?lv(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~n,t.memoizedState=ov,r}return a=e.child,e=a.sibling,r=Aa(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 vx(e,t){return t=zp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nd(e,t,n,r){return r!==null&&rx(r),Wl(t,e.child,null,n),e=vx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function WL(e,t,n,r,i,a,l){if(n)return t.flags&256?(t.flags&=-257,r=_m(Error(de(422))),nd(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=zp({mode:"visible",children:r.children},i,0,null),a=Co(a,i,l,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&Wl(t,e.child,null,l),t.child.memoizedState=lv(l),t.memoizedState=ov,a);if(!(t.mode&1))return nd(e,t,l,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,a=Error(de(419)),r=_m(a,r,void 0),nd(e,t,l,r)}if(s=(l&e.childLanes)!==0,er||s){if(r=yn,r!==null){switch(l&-l){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|l)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,Hi(e,i),Xr(r,e,i,-1))}return Sx(),r=_m(Error(de(421))),nd(e,t,l,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=nz.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,dr=Pa(i.nextSibling),hr=t,At=!0,qr=null,e!==null&&(Tr[Or++]=Li,Tr[Or++]=zi,Tr[Or++]=No,Li=e.id,zi=e.overflow,No=t),t=vx(t,r.children),t.flags|=4096,t)}function xw(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ev(e.return,t,n)}function Mm(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 I2(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Fn(e,t,r.children,n),r=_t.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&&xw(e,n,t);else if(e.tag===19)xw(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(jt(_t,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&&mf(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Mm(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&&mf(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Mm(t,!0,n,null,a);break;case"together":Mm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Mo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(de(153));if(t.child!==null){for(e=t.child,n=Aa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Aa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function KL(e,t,n){switch(t.tag){case 3:O2(t),Ul();break;case 5:r2(t);break;case 1:ir(t.type)&&cf(t);break;case 4:cx(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;jt(ff,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(jt(_t,_t.current&1),t.flags|=128,null):n&t.child.childLanes?A2(e,t,n):(jt(_t,_t.current&1),e=Vi(e,t,n),e!==null?e.sibling:null);jt(_t,_t.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return I2(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),jt(_t,_t.current),r)break;return null;case 22:case 23:return t.lanes=0,E2(e,t,n)}return Vi(e,t,n)}var N2,sv,_2,M2;N2=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}};sv=function(){};_2=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,vo(xi.current);var a=null;switch(n){case"input":i=Ag(e,i),r=Ag(e,r),a=[];break;case"select":i=Dt({},i,{value:void 0}),r=Dt({},r,{value:void 0}),a=[];break;case"textarea":i=_g(e,i),r=_g(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=lf)}Rg(n,r);var l;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(l in s)s.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(xc.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==s&&(c!=null||s!=null))if(u==="style")if(s){for(l in s)!s.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in c)c.hasOwnProperty(l)&&s[l]!==c[l]&&(n||(n={}),n[l]=c[l])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,s=s?s.__html:void 0,c!=null&&s!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(xc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&kt("scroll",e),a||s===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};M2=function(e,t,n,r){n!==r&&(t.flags|=4)};function As(e,t){if(!At)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 An(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 qL(e,t,n){var r=t.pendingProps;switch(nx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return An(t),null;case 1:return ir(t.type)&&sf(),An(t),null;case 3:return r=t.stateNode,Kl(),Et(rr),Et(Dn),dx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ed(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,qr!==null&&(gv(qr),qr=null))),sv(e,t),An(t),null;case 5:ux(t);var i=vo(Ic.current);if(n=t.type,e!==null&&t.stateNode!=null)_2(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(de(166));return An(t),null}if(e=vo(xi.current),ed(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[hi]=t,r[Oc]=a,e=(t.mode&1)!==0,n){case"dialog":kt("cancel",r),kt("close",r);break;case"iframe":case"object":case"embed":kt("load",r);break;case"video":case"audio":for(i=0;i<Xs.length;i++)kt(Xs[i],r);break;case"source":kt("error",r);break;case"img":case"image":case"link":kt("error",r),kt("load",r);break;case"details":kt("toggle",r);break;case"input":T1(r,a),kt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},kt("invalid",r);break;case"textarea":A1(r,a),kt("invalid",r)}Rg(n,a),i=null;for(var l in a)if(a.hasOwnProperty(l)){var s=a[l];l==="children"?typeof s=="string"?r.textContent!==s&&(a.suppressHydrationWarning!==!0&&Zu(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&Zu(r.textContent,s,e),i=["children",""+s]):xc.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&kt("scroll",r)}switch(n){case"input":qu(r),O1(r,a,!0);break;case"textarea":qu(r),I1(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=lf)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=sE(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[hi]=t,e[Oc]=r,N2(e,t,!1,!1),t.stateNode=e;e:{switch(l=Dg(n,r),n){case"dialog":kt("cancel",e),kt("close",e),i=r;break;case"iframe":case"object":case"embed":kt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Xs.length;i++)kt(Xs[i],e);i=r;break;case"source":kt("error",e),i=r;break;case"img":case"image":case"link":kt("error",e),kt("load",e),i=r;break;case"details":kt("toggle",e),i=r;break;case"input":T1(e,r),i=Ag(e,r),kt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Dt({},r,{value:void 0}),kt("invalid",e);break;case"textarea":A1(e,r),i=_g(e,r),kt("invalid",e);break;default:i=r}Rg(n,i),s=i;for(a in s)if(s.hasOwnProperty(a)){var c=s[a];a==="style"?dE(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&cE(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&bc(e,c):typeof c=="number"&&bc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(xc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&kt("scroll",e):c!=null&&Fy(e,a,c,l))}switch(n){case"input":qu(e),O1(e,r,!1);break;case"textarea":qu(e),I1(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ra(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?Ol(e,!!r.multiple,a,!1):r.defaultValue!=null&&Ol(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=lf)}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 An(t),null;case 6:if(e&&t.stateNode!=null)M2(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(de(166));if(n=vo(Ic.current),vo(xi.current),ed(t)){if(r=t.stateNode,n=t.memoizedProps,r[hi]=t,(a=r.nodeValue!==n)&&(e=hr,e!==null))switch(e.tag){case 3:Zu(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Zu(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[hi]=t,t.stateNode=r}return An(t),null;case 13:if(Et(_t),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(At&&dr!==null&&t.mode&1&&!(t.flags&128))JE(),Ul(),t.flags|=98560,a=!1;else if(a=ed(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(de(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(de(317));a[hi]=t}else Ul(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;An(t),a=!1}else qr!==null&&(gv(qr),qr=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||_t.current&1?sn===0&&(sn=3):Sx())),t.updateQueue!==null&&(t.flags|=4),An(t),null);case 4:return Kl(),sv(e,t),e===null&&Ec(t.stateNode.containerInfo),An(t),null;case 10:return ox(t.type._context),An(t),null;case 17:return ir(t.type)&&sf(),An(t),null;case 19:if(Et(_t),a=t.memoizedState,a===null)return An(t),null;if(r=(t.flags&128)!==0,l=a.rendering,l===null)if(r)As(a,!1);else{if(sn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=mf(e),l!==null){for(t.flags|=128,As(a,!1),r=l.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,l=a.alternate,l===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=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return jt(_t,_t.current&1|2),t.child}e=e.sibling}a.tail!==null&&Yt()>Hl&&(t.flags|=128,r=!0,As(a,!1),t.lanes=4194304)}else{if(!r)if(e=mf(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),As(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!At)return An(t),null}else 2*Yt()-a.renderingStartTime>Hl&&n!==1073741824&&(t.flags|=128,r=!0,As(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(n=a.last,n!==null?n.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Yt(),t.sibling=null,n=_t.current,jt(_t,r?n&1|2:n&1),t):(An(t),null);case 22:case 23:return jx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?cr&1073741824&&(An(t),t.subtreeFlags&6&&(t.flags|=8192)):An(t),null;case 24:return null;case 25:return null}throw Error(de(156,t.tag))}function HL(e,t){switch(nx(t),t.tag){case 1:return ir(t.type)&&sf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kl(),Et(rr),Et(Dn),dx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ux(t),null;case 13:if(Et(_t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(de(340));Ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Et(_t),null;case 4:return Kl(),null;case 10:return ox(t.type._context),null;case 22:case 23:return jx(),null;case 24:return null;default:return null}}var rd=!1,_n=!1,VL=typeof WeakSet=="function"?WeakSet:Set,Se=null;function kl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Kt(e,t,r)}else n.current=null}function cv(e,t,n){try{n()}catch(r){Kt(e,t,r)}}var bw=!1;function YL(e,t){if(Hg=rf,e=$E(),ex(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 l=0,s=-1,c=-1,u=0,f=0,d=e,p=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(s=l+i),d!==a||r!==0&&d.nodeType!==3||(c=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===e)break t;if(p===n&&++u===i&&(s=l),p===a&&++f===r&&(c=l),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}n=s===-1||c===-1?null:{start:s,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Vg={focusedElem:e,selectionRange:n},rf=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;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 y=g.memoizedProps,x=g.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:Wr(t.type,y),x);v.__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(de(163))}}catch(j){Kt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return g=bw,bw=!1,g}function uc(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&&cv(t,n,a)}i=i.next}while(i!==r)}}function Dp(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 uv(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 R2(e){var t=e.alternate;t!==null&&(e.alternate=null,R2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[hi],delete t[Oc],delete t[Xg],delete t[AL],delete t[IL])),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 D2(e){return e.tag===5||e.tag===3||e.tag===4}function ww(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||D2(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 dv(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=lf));else if(r!==4&&(e=e.child,e!==null))for(dv(e,t,n),e=e.sibling;e!==null;)dv(e,t,n),e=e.sibling}function fv(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(fv(e,t,n),e=e.sibling;e!==null;)fv(e,t,n),e=e.sibling}var kn=null,Kr=!1;function ca(e,t,n){for(n=n.child;n!==null;)L2(e,t,n),n=n.sibling}function L2(e,t,n){if(yi&&typeof yi.onCommitFiberUnmount=="function")try{yi.onCommitFiberUnmount(Tp,n)}catch{}switch(n.tag){case 5:_n||kl(n,t);case 6:var r=kn,i=Kr;kn=null,ca(e,t,n),kn=r,Kr=i,kn!==null&&(Kr?(e=kn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):kn.removeChild(n.stateNode));break;case 18:kn!==null&&(Kr?(e=kn,n=n.stateNode,e.nodeType===8?Em(e.parentNode,n):e.nodeType===1&&Em(e,n),kc(e)):Em(kn,n.stateNode));break;case 4:r=kn,i=Kr,kn=n.stateNode.containerInfo,Kr=!0,ca(e,t,n),kn=r,Kr=i;break;case 0:case 11:case 14:case 15:if(!_n&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&cv(n,t,l),i=i.next}while(i!==r)}ca(e,t,n);break;case 1:if(!_n&&(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Kt(n,t,s)}ca(e,t,n);break;case 21:ca(e,t,n);break;case 22:n.mode&1?(_n=(r=_n)||n.memoizedState!==null,ca(e,t,n),_n=r):ca(e,t,n);break;default:ca(e,t,n)}}function jw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new VL),t.forEach(function(r){var i=rz.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ur(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,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:kn=s.stateNode,Kr=!1;break e;case 3:kn=s.stateNode.containerInfo,Kr=!0;break e;case 4:kn=s.stateNode.containerInfo,Kr=!0;break e}s=s.return}if(kn===null)throw Error(de(160));L2(a,l,i),kn=null,Kr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Kt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)z2(t,e),t=t.sibling}function z2(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ur(t,e),ai(e),r&4){try{uc(3,e,e.return),Dp(3,e)}catch(y){Kt(e,e.return,y)}try{uc(5,e,e.return)}catch(y){Kt(e,e.return,y)}}break;case 1:Ur(t,e),ai(e),r&512&&n!==null&&kl(n,n.return);break;case 5:if(Ur(t,e),ai(e),r&512&&n!==null&&kl(n,n.return),e.flags&32){var i=e.stateNode;try{bc(i,"")}catch(y){Kt(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,l=n!==null?n.memoizedProps:a,s=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&oE(i,a),Dg(s,l);var u=Dg(s,a);for(l=0;l<c.length;l+=2){var f=c[l],d=c[l+1];f==="style"?dE(i,d):f==="dangerouslySetInnerHTML"?cE(i,d):f==="children"?bc(i,d):Fy(i,f,d,u)}switch(s){case"input":Ig(i,a);break;case"textarea":lE(i,a);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?Ol(i,!!a.multiple,m,!1):p!==!!a.multiple&&(a.defaultValue!=null?Ol(i,!!a.multiple,a.defaultValue,!0):Ol(i,!!a.multiple,a.multiple?[]:"",!1))}i[Oc]=a}catch(y){Kt(e,e.return,y)}}break;case 6:if(Ur(t,e),ai(e),r&4){if(e.stateNode===null)throw Error(de(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){Kt(e,e.return,y)}}break;case 3:if(Ur(t,e),ai(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{kc(t.containerInfo)}catch(y){Kt(e,e.return,y)}break;case 4:Ur(t,e),ai(e);break;case 13:Ur(t,e),ai(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(bx=Yt())),r&4&&jw(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(_n=(u=_n)||f,Ur(t,e),_n=u):Ur(t,e),ai(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(Se=e,f=e.child;f!==null;){for(d=Se=f;Se!==null;){switch(p=Se,m=p.child,p.tag){case 0:case 11:case 14:case 15:uc(4,p,p.return);break;case 1:kl(p,p.return);var g=p.stateNode;if(typeof g.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(y){Kt(r,n,y)}}break;case 5:kl(p,p.return);break;case 22:if(p.memoizedState!==null){kw(d);continue}}m!==null?(m.return=p,Se=m):kw(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{i=d.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=d.stateNode,c=d.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,s.style.display=uE("display",l))}catch(y){Kt(e,e.return,y)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){Kt(e,e.return,y)}}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;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ur(t,e),ai(e),r&4&&jw(e);break;case 21:break;default:Ur(t,e),ai(e)}}function ai(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(D2(n)){var r=n;break e}n=n.return}throw Error(de(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(bc(i,""),r.flags&=-33);var a=ww(e);fv(e,a,i);break;case 3:case 4:var l=r.stateNode.containerInfo,s=ww(e);dv(e,s,l);break;default:throw Error(de(161))}}catch(c){Kt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function GL(e,t,n){Se=e,$2(e)}function $2(e,t,n){for(var r=(e.mode&1)!==0;Se!==null;){var i=Se,a=i.child;if(i.tag===22&&r){var l=i.memoizedState!==null||rd;if(!l){var s=i.alternate,c=s!==null&&s.memoizedState!==null||_n;s=rd;var u=_n;if(rd=l,(_n=c)&&!u)for(Se=i;Se!==null;)l=Se,c=l.child,l.tag===22&&l.memoizedState!==null?Cw(i):c!==null?(c.return=l,Se=c):Cw(i);for(;a!==null;)Se=a,$2(a),a=a.sibling;Se=i,rd=s,_n=u}Sw(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Se=a):Sw(e)}}function Sw(e){for(;Se!==null;){var t=Se;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:_n||Dp(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!_n)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Wr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&lw(t,a,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lw(t,l,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;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 f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&kc(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(de(163))}_n||t.flags&512&&uv(t)}catch(p){Kt(t,t.return,p)}}if(t===e){Se=null;break}if(n=t.sibling,n!==null){n.return=t.return,Se=n;break}Se=t.return}}function kw(e){for(;Se!==null;){var t=Se;if(t===e){Se=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Se=n;break}Se=t.return}}function Cw(e){for(;Se!==null;){var t=Se;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Dp(4,t)}catch(c){Kt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){Kt(t,i,c)}}var a=t.return;try{uv(t)}catch(c){Kt(t,a,c)}break;case 5:var l=t.return;try{uv(t)}catch(c){Kt(t,l,c)}}}catch(c){Kt(t,t.return,c)}if(t===e){Se=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Se=s;break}Se=t.return}}var XL=Math.ceil,yf=Ji.ReactCurrentDispatcher,yx=Ji.ReactCurrentOwner,Mr=Ji.ReactCurrentBatchConfig,et=0,yn=null,en=null,Pn=0,cr=0,Cl=Ua(0),sn=0,Rc=null,Mo=0,Lp=0,xx=0,dc=null,Zn=null,bx=0,Hl=1/0,_i=null,xf=!1,pv=null,Ta=null,id=!1,ba=null,bf=0,fc=0,hv=null,Fd=-1,Ud=0;function Kn(){return et&6?Yt():Fd!==-1?Fd:Fd=Yt()}function Oa(e){return e.mode&1?et&2&&Pn!==0?Pn&-Pn:_L.transition!==null?(Ud===0&&(Ud=SE()),Ud):(e=dt,e!==0||(e=window.event,e=e===void 0?16:AE(e.type)),e):1}function Xr(e,t,n,r){if(50<fc)throw fc=0,hv=null,Error(de(185));iu(e,n,r),(!(et&2)||e!==yn)&&(e===yn&&(!(et&2)&&(Lp|=n),sn===4&&va(e,Pn)),ar(e,r),n===1&&et===0&&!(t.mode&1)&&(Hl=Yt()+500,_p&&Wa()))}function ar(e,t){var n=e.callbackNode;_D(e,t);var r=nf(e,e===yn?Pn:0);if(r===0)n!==null&&M1(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&M1(n),t===1)e.tag===0?NL(Pw.bind(null,e)):GE(Pw.bind(null,e)),TL(function(){!(et&6)&&Wa()}),n=null;else{switch(kE(r)){case 1:n=Hy;break;case 4:n=wE;break;case 16:n=tf;break;case 536870912:n=jE;break;default:n=tf}n=V2(n,B2.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function B2(e,t){if(Fd=-1,Ud=0,et&6)throw Error(de(327));var n=e.callbackNode;if(Ml()&&e.callbackNode!==n)return null;var r=nf(e,e===yn?Pn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=wf(e,r);else{t=r;var i=et;et|=2;var a=U2();(yn!==e||Pn!==t)&&(_i=null,Hl=Yt()+500,ko(e,t));do try{ZL();break}catch(s){F2(e,s)}while(!0);ax(),yf.current=a,et=i,en!==null?t=0:(yn=null,Pn=0,t=sn)}if(t!==0){if(t===2&&(i=Fg(e),i!==0&&(r=i,t=mv(e,i))),t===1)throw n=Rc,ko(e,0),va(e,r),ar(e,Yt()),n;if(t===6)va(e,r);else{if(i=e.current.alternate,!(r&30)&&!QL(i)&&(t=wf(e,r),t===2&&(a=Fg(e),a!==0&&(r=a,t=mv(e,a))),t===1))throw n=Rc,ko(e,0),va(e,r),ar(e,Yt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(de(345));case 2:co(e,Zn,_i);break;case 3:if(va(e,r),(r&130023424)===r&&(t=bx+500-Yt(),10<t)){if(nf(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Kn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Gg(co.bind(null,e,Zn,_i),t);break}co(e,Zn,_i);break;case 4:if(va(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var l=31-Gr(r);a=1<<l,l=t[l],l>i&&(i=l),r&=~a}if(r=i,r=Yt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*XL(r/1960))-r,10<r){e.timeoutHandle=Gg(co.bind(null,e,Zn,_i),r);break}co(e,Zn,_i);break;case 5:co(e,Zn,_i);break;default:throw Error(de(329))}}}return ar(e,Yt()),e.callbackNode===n?B2.bind(null,e):null}function mv(e,t){var n=dc;return e.current.memoizedState.isDehydrated&&(ko(e,t).flags|=256),e=wf(e,t),e!==2&&(t=Zn,Zn=n,t!==null&&gv(t)),e}function gv(e){Zn===null?Zn=e:Zn.push.apply(Zn,e)}function QL(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(!Qr(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 va(e,t){for(t&=~xx,t&=~Lp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Gr(t),r=1<<n;e[n]=-1,t&=~r}}function Pw(e){if(et&6)throw Error(de(327));Ml();var t=nf(e,0);if(!(t&1))return ar(e,Yt()),null;var n=wf(e,t);if(e.tag!==0&&n===2){var r=Fg(e);r!==0&&(t=r,n=mv(e,r))}if(n===1)throw n=Rc,ko(e,0),va(e,t),ar(e,Yt()),n;if(n===6)throw Error(de(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,co(e,Zn,_i),ar(e,Yt()),null}function wx(e,t){var n=et;et|=1;try{return e(t)}finally{et=n,et===0&&(Hl=Yt()+500,_p&&Wa())}}function Ro(e){ba!==null&&ba.tag===0&&!(et&6)&&Ml();var t=et;et|=1;var n=Mr.transition,r=dt;try{if(Mr.transition=null,dt=1,e)return e()}finally{dt=r,Mr.transition=n,et=t,!(et&6)&&Wa()}}function jx(){cr=Cl.current,Et(Cl)}function ko(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,EL(n)),en!==null)for(n=en.return;n!==null;){var r=n;switch(nx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&sf();break;case 3:Kl(),Et(rr),Et(Dn),dx();break;case 5:ux(r);break;case 4:Kl();break;case 13:Et(_t);break;case 19:Et(_t);break;case 10:ox(r.type._context);break;case 22:case 23:jx()}n=n.return}if(yn=e,en=e=Aa(e.current,null),Pn=cr=t,sn=0,Rc=null,xx=Lp=Mo=0,Zn=dc=null,go!==null){for(t=0;t<go.length;t++)if(n=go[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var l=a.next;a.next=i,r.next=l}n.pending=r}go=null}return e}function F2(e,t){do{var n=en;try{if(ax(),zd.current=vf,gf){for(var r=Mt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}gf=!1}if(_o=0,gn=on=Mt=null,cc=!1,Nc=0,yx.current=null,n===null||n.return===null){sn=1,Rc=t,en=null;break}e:{var a=e,l=n.return,s=n,c=t;if(t=Pn,s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,f=s,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var m=pw(l);if(m!==null){m.flags&=-257,hw(m,l,s,a,t),m.mode&1&&fw(a,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var y=new Set;y.add(c),t.updateQueue=y}else g.add(c);break e}else{if(!(t&1)){fw(a,u,t),Sx();break e}c=Error(de(426))}}else if(At&&s.mode&1){var x=pw(l);if(x!==null){!(x.flags&65536)&&(x.flags|=256),hw(x,l,s,a,t),rx(ql(c,s));break e}}a=c=ql(c,s),sn!==4&&(sn=2),dc===null?dc=[a]:dc.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var v=k2(a,c,t);ow(a,v);break e;case 1:s=c;var b=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ta===null||!Ta.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=C2(a,s,t);ow(a,j);break e}}a=a.return}while(a!==null)}K2(n)}catch(C){t=C,en===n&&n!==null&&(en=n=n.return);continue}break}while(!0)}function U2(){var e=yf.current;return yf.current=vf,e===null?vf:e}function Sx(){(sn===0||sn===3||sn===2)&&(sn=4),yn===null||!(Mo&268435455)&&!(Lp&268435455)||va(yn,Pn)}function wf(e,t){var n=et;et|=2;var r=U2();(yn!==e||Pn!==t)&&(_i=null,ko(e,t));do try{JL();break}catch(i){F2(e,i)}while(!0);if(ax(),et=n,yf.current=r,en!==null)throw Error(de(261));return yn=null,Pn=0,sn}function JL(){for(;en!==null;)W2(en)}function ZL(){for(;en!==null&&!kD();)W2(en)}function W2(e){var t=H2(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?K2(e):en=t,yx.current=null}function K2(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=HL(n,t),n!==null){n.flags&=32767,en=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{sn=6,en=null;return}}else if(n=qL(n,t,cr),n!==null){en=n;return}if(t=t.sibling,t!==null){en=t;return}en=t=e}while(t!==null);sn===0&&(sn=5)}function co(e,t,n){var r=dt,i=Mr.transition;try{Mr.transition=null,dt=1,ez(e,t,n,r)}finally{Mr.transition=i,dt=r}return null}function ez(e,t,n,r){do Ml();while(ba!==null);if(et&6)throw Error(de(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(de(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(MD(e,a),e===yn&&(en=yn=null,Pn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||id||(id=!0,V2(tf,function(){return Ml(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Mr.transition,Mr.transition=null;var l=dt;dt=1;var s=et;et|=4,yx.current=null,YL(e,n),z2(n,e),bL(Vg),rf=!!Hg,Vg=Hg=null,e.current=n,GL(n),CD(),et=s,dt=l,Mr.transition=a}else e.current=n;if(id&&(id=!1,ba=e,bf=i),a=e.pendingLanes,a===0&&(Ta=null),TD(n.stateNode),ar(e,Yt()),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(xf)throw xf=!1,e=pv,pv=null,e;return bf&1&&e.tag!==0&&Ml(),a=e.pendingLanes,a&1?e===hv?fc++:(fc=0,hv=e):fc=0,Wa(),null}function Ml(){if(ba!==null){var e=kE(bf),t=Mr.transition,n=dt;try{if(Mr.transition=null,dt=16>e?16:e,ba===null)var r=!1;else{if(e=ba,ba=null,bf=0,et&6)throw Error(de(331));var i=et;for(et|=4,Se=e.current;Se!==null;){var a=Se,l=a.child;if(Se.flags&16){var s=a.deletions;if(s!==null){for(var c=0;c<s.length;c++){var u=s[c];for(Se=u;Se!==null;){var f=Se;switch(f.tag){case 0:case 11:case 15:uc(8,f,a)}var d=f.child;if(d!==null)d.return=f,Se=d;else for(;Se!==null;){f=Se;var p=f.sibling,m=f.return;if(R2(f),f===u){Se=null;break}if(p!==null){p.return=m,Se=p;break}Se=m}}}var g=a.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var x=y.sibling;y.sibling=null,y=x}while(y!==null)}}Se=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,Se=l;else e:for(;Se!==null;){if(a=Se,a.flags&2048)switch(a.tag){case 0:case 11:case 15:uc(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,Se=v;break e}Se=a.return}}var b=e.current;for(Se=b;Se!==null;){l=Se;var w=l.child;if(l.subtreeFlags&2064&&w!==null)w.return=l,Se=w;else e:for(l=b;Se!==null;){if(s=Se,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:Dp(9,s)}}catch(C){Kt(s,s.return,C)}if(s===l){Se=null;break e}var j=s.sibling;if(j!==null){j.return=s.return,Se=j;break e}Se=s.return}}if(et=i,Wa(),yi&&typeof yi.onPostCommitFiberRoot=="function")try{yi.onPostCommitFiberRoot(Tp,e)}catch{}r=!0}return r}finally{dt=n,Mr.transition=t}}return!1}function Ew(e,t,n){t=ql(n,t),t=k2(e,t,1),e=Ea(e,t,1),t=Kn(),e!==null&&(iu(e,1,t),ar(e,t))}function Kt(e,t,n){if(e.tag===3)Ew(e,e,n);else for(;t!==null;){if(t.tag===3){Ew(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ta===null||!Ta.has(r))){e=ql(n,e),e=C2(t,e,1),t=Ea(t,e,1),e=Kn(),t!==null&&(iu(t,1,e),ar(t,e));break}}t=t.return}}function tz(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Kn(),e.pingedLanes|=e.suspendedLanes&n,yn===e&&(Pn&n)===n&&(sn===4||sn===3&&(Pn&130023424)===Pn&&500>Yt()-bx?ko(e,0):xx|=n),ar(e,t)}function q2(e,t){t===0&&(e.mode&1?(t=Yu,Yu<<=1,!(Yu&130023424)&&(Yu=4194304)):t=1);var n=Kn();e=Hi(e,t),e!==null&&(iu(e,t,n),ar(e,n))}function nz(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),q2(e,n)}function rz(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(de(314))}r!==null&&r.delete(t),q2(e,n)}var H2;H2=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rr.current)er=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return er=!1,KL(e,t,n);er=!!(e.flags&131072)}else er=!1,At&&t.flags&1048576&&XE(t,df,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Bd(e,t),e=t.pendingProps;var i=Fl(t,Dn.current);_l(t,n),i=px(null,t,r,e,i,n);var a=hx();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,ir(r)?(a=!0,cf(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,sx(t),i.updater=Rp,t.stateNode=i,i._reactInternals=t,nv(t,r,e,n),t=av(null,t,r,!0,a,n)):(t.tag=0,At&&a&&tx(t),Fn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Bd(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=az(r),e=Wr(r,e),i){case 0:t=iv(null,t,r,e,n);break e;case 1:t=vw(null,t,r,e,n);break e;case 11:t=mw(null,t,r,e,n);break e;case 14:t=gw(null,t,r,Wr(r.type,e),n);break e}throw Error(de(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Wr(r,i),iv(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Wr(r,i),vw(e,t,r,i,n);case 3:e:{if(O2(t),e===null)throw Error(de(387));r=t.pendingProps,a=t.memoizedState,i=a.element,n2(e,t),hf(t,r,null,n);var l=t.memoizedState;if(r=l.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=ql(Error(de(423)),t),t=yw(e,t,r,n,i);break e}else if(r!==i){i=ql(Error(de(424)),t),t=yw(e,t,r,n,i);break e}else for(dr=Pa(t.stateNode.containerInfo.firstChild),hr=t,At=!0,qr=null,n=e2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ul(),r===i){t=Vi(e,t,n);break e}Fn(e,t,r,n)}t=t.child}return t;case 5:return r2(t),e===null&&Zg(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,l=i.children,Yg(r,i)?l=null:a!==null&&Yg(r,a)&&(t.flags|=32),T2(e,t),Fn(e,t,l,n),t.child;case 6:return e===null&&Zg(t),null;case 13:return A2(e,t,n);case 4:return cx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Wl(t,null,r,n):Fn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Wr(r,i),mw(e,t,r,i,n);case 7:return Fn(e,t,t.pendingProps,n),t.child;case 8:return Fn(e,t,t.pendingProps.children,n),t.child;case 12:return Fn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,l=i.value,jt(ff,r._currentValue),r._currentValue=l,a!==null)if(Qr(a.value,l)){if(a.children===i.children&&!rr.current){t=Vi(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){l=a.child;for(var c=s.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=Fi(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ev(a.return,n,t),s.lanes|=n;break}c=c.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(de(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),ev(l,n,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Fn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,_l(t,n),i=Rr(i),r=r(i),t.flags|=1,Fn(e,t,r,n),t.child;case 14:return r=t.type,i=Wr(r,t.pendingProps),i=Wr(r.type,i),gw(e,t,r,i,n);case 15:return P2(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Wr(r,i),Bd(e,t),t.tag=1,ir(r)?(e=!0,cf(t)):e=!1,_l(t,n),S2(t,r,i),nv(t,r,i,n),av(null,t,r,!0,e,n);case 19:return I2(e,t,n);case 22:return E2(e,t,n)}throw Error(de(156,t.tag))};function V2(e,t){return bE(e,t)}function iz(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 Ir(e,t,n,r){return new iz(e,t,n,r)}function kx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function az(e){if(typeof e=="function")return kx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Wy)return 11;if(e===Ky)return 14}return 2}function Aa(e,t){var n=e.alternate;return n===null?(n=Ir(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 Wd(e,t,n,r,i,a){var l=2;if(r=e,typeof e=="function")kx(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case ml:return Co(n.children,i,a,t);case Uy:l=8,i|=8;break;case Pg:return e=Ir(12,n,t,i|2),e.elementType=Pg,e.lanes=a,e;case Eg:return e=Ir(13,n,t,i),e.elementType=Eg,e.lanes=a,e;case Tg:return e=Ir(19,n,t,i),e.elementType=Tg,e.lanes=a,e;case rE:return zp(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tE:l=10;break e;case nE:l=9;break e;case Wy:l=11;break e;case Ky:l=14;break e;case fa:l=16,r=null;break e}throw Error(de(130,e==null?e:typeof e,""))}return t=Ir(l,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Co(e,t,n,r){return e=Ir(7,e,r,t),e.lanes=n,e}function zp(e,t,n,r){return e=Ir(22,e,r,t),e.elementType=rE,e.lanes=n,e.stateNode={isHidden:!1},e}function Rm(e,t,n){return e=Ir(6,e,null,t),e.lanes=n,e}function Dm(e,t,n){return t=Ir(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function oz(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=gm(0),this.expirationTimes=gm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gm(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Cx(e,t,n,r,i,a,l,s,c){return e=new oz(e,t,n,s,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ir(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},sx(a),e}function lz(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:hl,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Y2(e){if(!e)return Da;e=e._reactInternals;e:{if(Vo(e)!==e||e.tag!==1)throw Error(de(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ir(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(de(171))}if(e.tag===1){var n=e.type;if(ir(n))return YE(e,n,t)}return t}function G2(e,t,n,r,i,a,l,s,c){return e=Cx(n,r,!0,e,i,a,l,s,c),e.context=Y2(null),n=e.current,r=Kn(),i=Oa(n),a=Fi(r,i),a.callback=t??null,Ea(n,a,i),e.current.lanes=i,iu(e,i,r),ar(e,r),e}function $p(e,t,n,r){var i=t.current,a=Kn(),l=Oa(i);return n=Y2(n),t.context===null?t.context=n:t.pendingContext=n,t=Fi(a,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ea(i,t,l),e!==null&&(Xr(e,i,l,a),Ld(e,i,l)),l}function jf(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 Tw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Px(e,t){Tw(e,t),(e=e.alternate)&&Tw(e,t)}function sz(){return null}var X2=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ex(e){this._internalRoot=e}Bp.prototype.render=Ex.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(de(409));$p(e,t,null,null)};Bp.prototype.unmount=Ex.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ro(function(){$p(null,e,null,null)}),t[qi]=null}};function Bp(e){this._internalRoot=e}Bp.prototype.unstable_scheduleHydration=function(e){if(e){var t=EE();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ga.length&&t!==0&&t<ga[n].priority;n++);ga.splice(n,0,e),n===0&&OE(e)}};function Tx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ow(){}function cz(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=jf(l);a.call(u)}}var l=G2(t,r,e,0,null,!1,!1,"",Ow);return e._reactRootContainer=l,e[qi]=l.current,Ec(e.nodeType===8?e.parentNode:e),Ro(),l}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=jf(c);s.call(u)}}var c=Cx(e,0,!1,null,null,!1,!1,"",Ow);return e._reactRootContainer=c,e[qi]=c.current,Ec(e.nodeType===8?e.parentNode:e),Ro(function(){$p(t,c,n,r)}),c}function Up(e,t,n,r,i){var a=n._reactRootContainer;if(a){var l=a;if(typeof i=="function"){var s=i;i=function(){var c=jf(l);s.call(c)}}$p(t,l,e,i)}else l=cz(n,t,e,i,r);return jf(l)}CE=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Gs(t.pendingLanes);n!==0&&(Vy(t,n|1),ar(t,Yt()),!(et&6)&&(Hl=Yt()+500,Wa()))}break;case 13:Ro(function(){var r=Hi(e,1);if(r!==null){var i=Kn();Xr(r,e,1,i)}}),Px(e,1)}};Yy=function(e){if(e.tag===13){var t=Hi(e,134217728);if(t!==null){var n=Kn();Xr(t,e,134217728,n)}Px(e,134217728)}};PE=function(e){if(e.tag===13){var t=Oa(e),n=Hi(e,t);if(n!==null){var r=Kn();Xr(n,e,t,r)}Px(e,t)}};EE=function(){return dt};TE=function(e,t){var n=dt;try{return dt=e,t()}finally{dt=n}};zg=function(e,t,n){switch(t){case"input":if(Ig(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=Np(r);if(!i)throw Error(de(90));aE(r),Ig(r,i)}}}break;case"textarea":lE(e,n);break;case"select":t=n.value,t!=null&&Ol(e,!!n.multiple,t,!1)}};hE=wx;mE=Ro;var uz={usingClientEntryPoint:!1,Events:[ou,xl,Np,fE,pE,wx]},Is={findFiberByHostInstance:mo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dz={bundleType:Is.bundleType,version:Is.version,rendererPackageName:Is.rendererPackageName,rendererConfig:Is.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ji.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=yE(e),e===null?null:e.stateNode},findFiberByHostInstance:Is.findFiberByHostInstance||sz,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 ad=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ad.isDisabled&&ad.supportsFiber)try{Tp=ad.inject(dz),yi=ad}catch{}}xr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uz;xr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tx(t))throw Error(de(200));return lz(e,t,null,n)};xr.createRoot=function(e,t){if(!Tx(e))throw Error(de(299));var n=!1,r="",i=X2;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Cx(e,1,!1,null,null,n,!1,r,i),e[qi]=t.current,Ec(e.nodeType===8?e.parentNode:e),new Ex(t)};xr.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(de(188)):(e=Object.keys(e).join(","),Error(de(268,e)));return e=yE(t),e=e===null?null:e.stateNode,e};xr.flushSync=function(e){return Ro(e)};xr.hydrate=function(e,t,n){if(!Fp(t))throw Error(de(200));return Up(null,e,t,!0,n)};xr.hydrateRoot=function(e,t,n){if(!Tx(e))throw Error(de(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",l=X2;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=G2(t,null,e,1,n??null,i,!1,a,l),e[qi]=t.current,Ec(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 Bp(t)};xr.render=function(e,t,n){if(!Fp(t))throw Error(de(200));return Up(null,e,t,!1,n)};xr.unmountComponentAtNode=function(e){if(!Fp(e))throw Error(de(40));return e._reactRootContainer?(Ro(function(){Up(null,null,e,!1,function(){e._reactRootContainer=null,e[qi]=null})}),!0):!1};xr.unstable_batchedUpdates=wx;xr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Fp(n))throw Error(de(200));if(e==null||e._reactInternals===void 0)throw Error(de(38));return Up(e,t,n,!1,r)};xr.version="18.3.1-next-f1338f8080-20240426";function Q2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Q2)}catch(e){console.error(e)}}Q2(),QP.exports=xr;var Wp=QP.exports,Aw=Wp;kg.createRoot=Aw.createRoot,kg.hydrateRoot=Aw.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 Dc(){return Dc=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},Dc.apply(null,arguments)}var wa;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(wa||(wa={}));const Iw="popstate";function fz(e){e===void 0&&(e={});function t(i,a){let{pathname:l="/",search:s="",hash:c=""}=Yo(i.location.hash.substr(1));return!l.startsWith("/")&&!l.startsWith(".")&&(l="/"+l),vv("",{pathname:l,search:s,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(i,a){let l=i.document.querySelector("base"),s="";if(l&&l.getAttribute("href")){let c=i.location.href,u=c.indexOf("#");s=u===-1?c:c.slice(0,u)}return s+"#"+(typeof a=="string"?a:Sf(a))}function r(i,a){Kp(i.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")")}return hz(t,n,r,e)}function Rt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Kp(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function pz(){return Math.random().toString(36).substr(2,8)}function Nw(e,t){return{usr:e.state,key:e.key,idx:t}}function vv(e,t,n,r){return n===void 0&&(n=null),Dc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Yo(t):t,{state:n,key:t&&t.key||r||pz()})}function Sf(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 Yo(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 hz(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,l=i.history,s=wa.Pop,c=null,u=f();u==null&&(u=0,l.replaceState(Dc({},l.state,{idx:u}),""));function f(){return(l.state||{idx:null}).idx}function d(){s=wa.Pop;let x=f(),v=x==null?null:x-u;u=x,c&&c({action:s,location:y.location,delta:v})}function p(x,v){s=wa.Push;let b=vv(y.location,x,v);n&&n(b,x),u=f()+1;let w=Nw(b,u),j=y.createHref(b);try{l.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(j)}a&&c&&c({action:s,location:y.location,delta:1})}function m(x,v){s=wa.Replace;let b=vv(y.location,x,v);n&&n(b,x),u=f();let w=Nw(b,u),j=y.createHref(b);l.replaceState(w,"",j),a&&c&&c({action:s,location:y.location,delta:0})}function g(x){let v=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof x=="string"?x:Sf(x);return b=b.replace(/ $/,"%20"),Rt(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let y={get action(){return s},get location(){return e(i,l)},listen(x){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Iw,d),c=x,()=>{i.removeEventListener(Iw,d),c=null}},createHref(x){return t(i,x)},createURL:g,encodeLocation(x){let v=g(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:m,go(x){return l.go(x)}};return y}var _w;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_w||(_w={}));function mz(e,t,n){return n===void 0&&(n="/"),gz(e,t,n)}function gz(e,t,n,r){let i=typeof t=="string"?Yo(t):t,a=Vl(i.pathname||"/",n);if(a==null)return null;let l=J2(e);vz(l);let s=null,c=Tz(a);for(let u=0;s==null&&u<l.length;++u)s=Pz(l[u],c);return s}function J2(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,l,s)=>{let c={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};c.relativePath.startsWith("/")&&(Rt(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=Ia([r,c.relativePath]),f=n.concat(c);a.children&&a.children.length>0&&(Rt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),J2(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:kz(u,a.index),routesMeta:f})};return e.forEach((a,l)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,l);else for(let c of Z2(a.path))i(a,l,c)}),t}function Z2(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 l=Z2(r.join("/")),s=[];return s.push(...l.map(c=>c===""?a:[a,c].join("/"))),i&&s.push(...l),s.map(c=>e.startsWith("/")&&c===""?"/":c)}function vz(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Cz(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const yz=/^:[\w-]+$/,xz=3,bz=2,wz=1,jz=10,Sz=-2,Mw=e=>e==="*";function kz(e,t){let n=e.split("/"),r=n.length;return n.some(Mw)&&(r+=Sz),t&&(r+=bz),n.filter(i=>!Mw(i)).reduce((i,a)=>i+(yz.test(a)?xz:a===""?wz:jz),r)}function Cz(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 Pz(e,t,n){let{routesMeta:r}=e,i={},a="/",l=[];for(let s=0;s<r.length;++s){let c=r[s],u=s===r.length-1,f=a==="/"?t:t.slice(a.length)||"/",d=yv({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},f),p=c.route;if(!d)return null;Object.assign(i,d.params),l.push({params:i,pathname:Ia([a,d.pathname]),pathnameBase:_z(Ia([a,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(a=Ia([a,d.pathnameBase]))}return l}function yv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ez(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],l=a.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((u,f,d)=>{let{paramName:p,isOptional:m}=f;if(p==="*"){let y=s[d]||"";l=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const g=s[d];return m&&!g?u[p]=void 0:u[p]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:l,pattern:e}}function Ez(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Kp(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,(l,s,c)=>(r.push({paramName:s,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 Tz(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Kp(!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 Vl(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 Oz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Az=e=>Oz.test(e);function Iz(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Yo(e):e,a;if(n)if(Az(n))a=n;else{if(n.includes("//")){let l=n;n=eT(n),Kp(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?a=Rw(n.substring(1),"/"):a=Rw(n,t)}else a=t;return{pathname:a,search:Mz(r),hash:Rz(i)}}function Rw(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 Lm(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 Nz(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ox(e,t){let n=Nz(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ax(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Yo(e):(i=Dc({},e),Rt(!i.pathname||!i.pathname.includes("?"),Lm("?","pathname","search",i)),Rt(!i.pathname||!i.pathname.includes("#"),Lm("#","pathname","hash",i)),Rt(!i.search||!i.search.includes("#"),Lm("#","search","hash",i)));let a=e===""||i.pathname==="",l=a?"/":i.pathname,s;if(l==null)s=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}s=d>=0?t[d]:"/"}let c=Iz(i,s),u=l&&l!=="/"&&l.endsWith("/"),f=(a||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const eT=e=>e.replace(/\/\/+/g,"/"),Ia=e=>eT(e.join("/")),_z=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Mz=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Rz=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Dz(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const tT=["post","put","patch","delete"];new Set(tT);const Lz=["get",...tT];new Set(Lz);/**
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 Lc(){return Lc=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},Lc.apply(null,arguments)}const qp=h.createContext(null),nT=h.createContext(null),Zi=h.createContext(null),Hp=h.createContext(null),ea=h.createContext({outlet:null,matches:[],isDataRoute:!1}),rT=h.createContext(null);function zz(e,t){let{relative:n}=t===void 0?{}:t;ls()||Rt(!1);let{basename:r,navigator:i}=h.useContext(Zi),{hash:a,pathname:l,search:s}=Yp(e,{relative:n}),c=l;return r!=="/"&&(c=l==="/"?r:Ia([r,l])),i.createHref({pathname:c,search:s,hash:a})}function ls(){return h.useContext(Hp)!=null}function ss(){return ls()||Rt(!1),h.useContext(Hp).location}function iT(e){h.useContext(Zi).static||h.useLayoutEffect(e)}function Vp(){let{isDataRoute:e}=h.useContext(ea);return e?Jz():$z()}function $z(){ls()||Rt(!1);let e=h.useContext(qp),{basename:t,future:n,navigator:r}=h.useContext(Zi),{matches:i}=h.useContext(ea),{pathname:a}=ss(),l=JSON.stringify(Ox(i,n.v7_relativeSplatPath)),s=h.useRef(!1);return iT(()=>{s.current=!0}),h.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=Ax(u,JSON.parse(l),a,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Ia([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,l,a,e])}function Bz(){let{matches:e}=h.useContext(ea),t=e[e.length-1];return t?t.params:{}}function Yp(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(Zi),{matches:i}=h.useContext(ea),{pathname:a}=ss(),l=JSON.stringify(Ox(i,r.v7_relativeSplatPath));return h.useMemo(()=>Ax(e,JSON.parse(l),a,n==="path"),[e,l,a,n])}function Fz(e,t){return Uz(e,t)}function Uz(e,t,n,r){ls()||Rt(!1);let{navigator:i}=h.useContext(Zi),{matches:a}=h.useContext(ea),l=a[a.length-1],s=l?l.params:{};l&&l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let u=ss(),f;if(t){var d;let x=typeof t=="string"?Yo(t):t;c==="/"||(d=x.pathname)!=null&&d.startsWith(c)||Rt(!1),f=x}else f=u;let p=f.pathname||"/",m=p;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=mz(e,{pathname:m}),y=Vz(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},s,x.params),pathname:Ia([c,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Ia([c,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,n,r);return t&&y?h.createElement(Hp.Provider,{value:{location:Lc({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:wa.Pop}},y):y}function Wz(){let e=Qz(),t=Dz(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 h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:i},n):null,null)}const Kz=h.createElement(Wz,null);class qz extends h.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?h.createElement(ea.Provider,{value:this.props.routeContext},h.createElement(rT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Hz(e){let{routeContext:t,match:n,children:r}=e,i=h.useContext(qp);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(ea.Provider,{value:t},r)}function Vz(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 l=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let f=l.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||Rt(!1),l=l.slice(0,Math.min(l.length,f+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<l.length;f++){let d=l[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=f),d.route.id){let{loaderData:p,errors:m}=n,g=d.route.loader&&p[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||g){c=!0,u>=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((f,d,p)=>{let m,g=!1,y=null,x=null;n&&(m=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||Kz,c&&(u<0&&p===0?(Zz("route-fallback"),g=!0,x=null):u===p&&(g=!0,x=d.route.hydrateFallbackElement||null)));let v=t.concat(l.slice(0,p+1)),b=()=>{let w;return m?w=y:g?w=x:d.route.Component?w=h.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=f,h.createElement(Hz,{match:d,routeContext:{outlet:f,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?h.createElement(qz,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var aT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(aT||{}),oT=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}(oT||{});function Yz(e){let t=h.useContext(qp);return t||Rt(!1),t}function Gz(e){let t=h.useContext(nT);return t||Rt(!1),t}function Xz(e){let t=h.useContext(ea);return t||Rt(!1),t}function lT(e){let t=Xz(),n=t.matches[t.matches.length-1];return n.route.id||Rt(!1),n.route.id}function Qz(){var e;let t=h.useContext(rT),n=Gz(),r=lT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Jz(){let{router:e}=Yz(aT.UseNavigateStable),t=lT(oT.UseNavigateStable),n=h.useRef(!1);return iT(()=>{n.current=!0}),h.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Lc({fromRouteId:t},a)))},[e,t])}const Dw={};function Zz(e,t,n){Dw[e]||(Dw[e]=!0)}function e4(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function od(e){let{to:t,replace:n,state:r,relative:i}=e;ls()||Rt(!1);let{future:a,static:l}=h.useContext(Zi),{matches:s}=h.useContext(ea),{pathname:c}=ss(),u=Vp(),f=Ax(t,Ox(s,a.v7_relativeSplatPath),c,i==="path"),d=JSON.stringify(f);return h.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function Qn(e){Rt(!1)}function t4(e){let{basename:t="/",children:n=null,location:r,navigationType:i=wa.Pop,navigator:a,static:l=!1,future:s}=e;ls()&&Rt(!1);let c=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:c,navigator:a,static:l,future:Lc({v7_relativeSplatPath:!1},s)}),[c,s,a,l]);typeof r=="string"&&(r=Yo(r));let{pathname:f="/",search:d="",hash:p="",state:m=null,key:g="default"}=r,y=h.useMemo(()=>{let x=Vl(f,c);return x==null?null:{location:{pathname:x,search:d,hash:p,state:m,key:g},navigationType:i}},[c,f,d,p,m,g,i]);return y==null?null:h.createElement(Zi.Provider,{value:u},h.createElement(Hp.Provider,{children:n,value:y}))}function n4(e){let{children:t,location:n}=e;return Fz(xv(t),n)}new Promise(()=>{});function xv(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(r,i)=>{if(!h.isValidElement(r))return;let a=[...t,i];if(r.type===h.Fragment){n.push.apply(n,xv(r.props.children,a));return}r.type!==Qn&&Rt(!1),!r.props.index||!r.props.children||Rt(!1);let l={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&&(l.children=xv(r.props.children,a)),n.push(l)}),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 kf(){return kf=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},kf.apply(null,arguments)}function sT(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 r4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function i4(e,t){return e.button===0&&(!t||t==="_self")&&!r4(e)}const a4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],o4=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],l4="6";try{window.__reactRouterVersion=l4}catch{}const s4=h.createContext({isTransitioning:!1}),c4="startTransition",Lw=GP[c4];function u4(e){let{basename:t,children:n,future:r,window:i}=e,a=h.useRef();a.current==null&&(a.current=fz({window:i,v5Compat:!0}));let l=a.current,[s,c]=h.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},f=h.useCallback(d=>{u&&Lw?Lw(()=>c(d)):c(d)},[c,u]);return h.useLayoutEffect(()=>l.listen(f),[l,f]),h.useEffect(()=>e4(r),[r]),h.createElement(t4,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const d4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,p4=h.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:l,state:s,target:c,to:u,preventScrollReset:f,viewTransition:d}=t,p=sT(t,a4),{basename:m}=h.useContext(Zi),g,y=!1;if(typeof u=="string"&&f4.test(u)&&(g=u,d4))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=Vl(j.pathname,m);j.origin===w.origin&&C!=null?u=C+j.search+j.hash:y=!0}catch{}let x=zz(u,{relative:i}),v=m4(u,{replace:l,state:s,target:c,preventScrollReset:f,relative:i,viewTransition:d});function b(w){r&&r(w),w.defaultPrevented||v(w)}return h.createElement("a",kf({},p,{href:g||x,onClick:y||a?r:b,ref:n,target:c}))}),oi=h.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:l=!1,style:s,to:c,viewTransition:u,children:f}=t,d=sT(t,o4),p=Yp(c,{relative:d.relative}),m=ss(),g=h.useContext(nT),{navigator:y,basename:x}=h.useContext(Zi),v=g!=null&&g4(p)&&u===!0,b=y.encodeLocation?y.encodeLocation(p).pathname:p.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=Vl(j,x)||j);const C=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let S=w===b||!l&&w.startsWith(b)&&w.charAt(C)==="/",E=j!=null&&(j===b||!l&&j.startsWith(b)&&j.charAt(b.length)==="/"),I={isActive:S,isPending:E,isTransitioning:v},R=S?r:void 0,A;typeof a=="function"?A=a(I):A=[a,S?"active":null,E?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let _=typeof s=="function"?s(I):s;return h.createElement(p4,kf({},d,{"aria-current":R,className:A,ref:n,style:_,to:c,viewTransition:u}),typeof f=="function"?f(I):f)});var bv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(bv||(bv={}));var zw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(zw||(zw={}));function h4(e){let t=h.useContext(qp);return t||Rt(!1),t}function m4(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:l,viewTransition:s}=t===void 0?{}:t,c=Vp(),u=ss(),f=Yp(e,{relative:l});return h.useCallback(d=>{if(i4(d,n)){d.preventDefault();let p=r!==void 0?r:Sf(u)===Sf(f);c(e,{replace:p,state:i,preventScrollReset:a,relative:l,viewTransition:s})}},[u,c,f,r,i,n,e,a,l,s])}function g4(e,t){t===void 0&&(t={});let n=h.useContext(s4);n==null&&Rt(!1);let{basename:r}=h4(bv.useViewTransitionState),i=Yp(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Vl(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Vl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yv(i.pathname,l)!=null||yv(i.pathname,a)!=null}function v4(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const y4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,x4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,b4={};function $w(e,t){return(b4.jsx?x4:y4).test(e)}const w4=/[ \t\n\f\r]/g;function j4(e){return typeof e=="object"?e.type==="text"?Bw(e.value):!1:Bw(e)}function Bw(e){return e.replace(w4,"")===""}class su{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}su.prototype.normal={};su.prototype.property={};su.prototype.space=void 0;function cT(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new su(n,r,t)}function wv(e){return e.toLowerCase()}class lr{constructor(t,n){this.attribute=n,this.property=t}}lr.prototype.attribute="";lr.prototype.booleanish=!1;lr.prototype.boolean=!1;lr.prototype.commaOrSpaceSeparated=!1;lr.prototype.commaSeparated=!1;lr.prototype.defined=!1;lr.prototype.mustUseProperty=!1;lr.prototype.number=!1;lr.prototype.overloadedBoolean=!1;lr.prototype.property="";lr.prototype.spaceSeparated=!1;lr.prototype.space=void 0;let S4=0;const ze=Go(),Jt=Go(),jv=Go(),pe=Go(),vt=Go(),Po=Go(),sr=Go();function Go(){return 2**++S4}const Sv=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Jt,commaOrSpaceSeparated:sr,commaSeparated:Po,number:pe,overloadedBoolean:jv,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),zm=Object.keys(Sv);class Ix extends lr{constructor(t,n,r,i){let a=-1;if(super(t,n),Fw(this,"space",i),typeof r=="number")for(;++a<zm.length;){const l=zm[a];Fw(this,zm[a],(r&Sv[l])===Sv[l])}}}Ix.prototype.defined=!0;function Fw(e,t,n){n&&(e[t]=n)}function cs(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Ix(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[wv(r)]=r,n[wv(a.attribute)]=r}return new su(t,n,e.space)}const uT=cs({properties:{ariaActiveDescendant:null,ariaAtomic:Jt,ariaAutoComplete:null,ariaBusy:Jt,ariaChecked:Jt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Jt,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Jt,ariaFlowTo:vt,ariaGrabbed:Jt,ariaHasPopup:null,ariaHidden:Jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:pe,ariaLive:null,ariaModal:Jt,ariaMultiLine:Jt,ariaMultiSelectable:Jt,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Jt,ariaReadOnly:Jt,ariaRelevant:null,ariaRequired:Jt,ariaRoleDescription:vt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Jt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function dT(e,t){return t in e?e[t]:t}function fT(e,t){return dT(e,t.toLowerCase())}const k4=cs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Po,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alpha:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:vt,autoFocus:ze,autoPlay:ze,blocking:vt,capture:null,charSet:null,checked:ze,cite:null,className:vt,closedBy:null,colorSpace:null,cols:pe,colSpan:pe,command:null,commandFor:null,content:null,contentEditable:Jt,controls:ze,controlsList:vt,coords:pe|Po,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:jv,draggable:Jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:vt,height:pe,hidden:jv,high:pe,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:vt,itemRef:vt,itemScope:ze,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,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:ze,optimum:pe,pattern:null,ping:vt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:vt,required:ze,reversed:ze,rows:pe,rowSpan:pe,sandbox:vt,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootCustomElementRegistry:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shadowRootSerializable:ze,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Jt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Jt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ze,disablePictureInPicture:ze,disableRemotePlayback:ze,exportParts:Po,part:vt,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:fT}),C4=cs({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:sr,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:vt,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:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,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:Po,g2:Po,glyphName:Po,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:sr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,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:pe,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:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sr,rev:sr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sr,requiredFeatures:sr,requiredFonts:sr,requiredFormats:sr,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:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:sr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sr,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:sr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dT}),pT=cs({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()}}),hT=cs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fT}),mT=cs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),P4={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"},E4=/[A-Z]/g,Uw=/-[a-z]/g,T4=/^data[-\w.:]+$/i;function O4(e,t){const n=wv(t);let r=t,i=lr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&T4.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Uw,I4);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Uw.test(a)){let l=a.replace(E4,A4);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Ix}return new i(r,t)}function A4(e){return"-"+e.toLowerCase()}function I4(e){return e.charAt(1).toUpperCase()}const N4=cT([uT,k4,pT,hT,mT],"html"),Nx=cT([uT,C4,pT,hT,mT],"svg");function _4(e){return e.join(" ").trim()}var _x={},Ww=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,M4=/\n/g,R4=/^\s*/,D4=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,L4=/^:\s*/,z4=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,$4=/^[;\s]*/,B4=/^\s+|\s+$/g,F4=`
68
- `,Kw="/",qw="*",ho="",U4="comment",W4="declaration";function K4(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 y=g.match(M4);y&&(n+=y.length);var x=g.lastIndexOf(F4);r=~x?g.length-x:r+g.length}function a(){var g={line:n,column:r};return function(y){return y.position=new l(g),u(),y}}function l(g){this.start=g,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(g){var y=new Error(t.source+":"+n+":"+r+": "+g);if(y.reason=g,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function c(g){var y=g.exec(e);if(y){var x=y[0];return i(x),e=e.slice(x.length),y}}function u(){c(R4)}function f(g){var y;for(g=g||[];y=d();)y!==!1&&g.push(y);return g}function d(){var g=a();if(!(Kw!=e.charAt(0)||qw!=e.charAt(1))){for(var y=2;ho!=e.charAt(y)&&(qw!=e.charAt(y)||Kw!=e.charAt(y+1));)++y;if(y+=2,ho===e.charAt(y-1))return s("End of comment missing");var x=e.slice(2,y-2);return r+=2,i(x),e=e.slice(y),r+=2,g({type:U4,comment:x})}}function p(){var g=a(),y=c(D4);if(y){if(d(),!c(L4))return s("property missing ':'");var x=c(z4),v=g({type:W4,property:Hw(y[0].replace(Ww,ho)),value:x?Hw(x[0].replace(Ww,ho)):ho});return c($4),v}}function m(){var g=[];f(g);for(var y;y=p();)y!==!1&&(g.push(y),f(g));return g}return u(),m()}function Hw(e){return e?e.replace(B4,ho):ho}var q4=K4,H4=Ma&&Ma.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_x,"__esModule",{value:!0});_x.default=Y4;const V4=H4(q4);function Y4(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,V4.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:l,value:s}=a;i?t(l,s,a):s&&(n=n||{},n[l]=s)}),n}var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.camelCase=void 0;var G4=/^--[a-zA-Z0-9_-]+$/,X4=/-([a-z])/g,Q4=/^[^-]+$/,J4=/^-(webkit|moz|ms|o|khtml)-/,Z4=/^-(ms)-/,e$=function(e){return!e||Q4.test(e)||G4.test(e)},t$=function(e,t){return t.toUpperCase()},Vw=function(e,t){return"".concat(t,"-")},n$=function(e,t){return t===void 0&&(t={}),e$(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Z4,Vw):e=e.replace(J4,Vw),e.replace(X4,t$))};Gp.camelCase=n$;var r$=Ma&&Ma.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i$=r$(_x),a$=Gp;function kv(e,t){var n={};return!e||typeof e!="string"||(0,i$.default)(e,function(r,i){r&&i&&(n[(0,a$.camelCase)(r,t)]=i)}),n}kv.default=kv;var o$=kv;const l$=zr(o$),gT=vT("end"),Mx=vT("start");function vT(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 s$(e){const t=Mx(e),n=gT(e);if(t&&n)return{start:t,end:n}}function pc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Yw(e.position):"start"in e||"end"in e?Yw(e):"line"in e||"column"in e?Cv(e):""}function Cv(e){return Gw(e&&e.line)+":"+Gw(e&&e.column)}function Yw(e){return Cv(e&&e.start)+"-"+Cv(e&&e.end)}function Gw(e){return e&&typeof e=="number"?e:1}class zn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},l=!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&&(l=!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 s=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=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=pc(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=l&&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}}zn.prototype.file="";zn.prototype.name="";zn.prototype.reason="";zn.prototype.message="";zn.prototype.stack="";zn.prototype.column=void 0;zn.prototype.line=void 0;zn.prototype.ancestors=void 0;zn.prototype.cause=void 0;zn.prototype.fatal=void 0;zn.prototype.place=void 0;zn.prototype.ruleId=void 0;zn.prototype.source=void 0;const Rx={}.hasOwnProperty,c$=new Map,u$=/[A-Z]/g,d$=new Set(["table","tbody","thead","tfoot","tr"]),f$=new Set(["td","th"]),yT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function p$(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=w$(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=b$(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"?Nx:N4,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=xT(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function xT(e,t,n){if(t.type==="element")return h$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return m$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return v$(e,t,n);if(t.type==="mdxjsEsm")return g$(e,t);if(t.type==="root")return y$(e,t,n);if(t.type==="text")return x$(e,t)}function h$(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Nx,e.schema=i),e.ancestors.push(t);const a=wT(e,t.tagName,!1),l=j$(e,t);let s=Lx(e,t);return d$.has(t.tagName)&&(s=s.filter(function(c){return typeof c=="string"?!j4(c):!0})),bT(e,l,a,t),Dx(l,s),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function m$(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)}zc(e,t.position)}function g$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zc(e,t.position)}function v$(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Nx,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:wT(e,t.name,!0),l=S$(e,t),s=Lx(e,t);return bT(e,l,a,t),Dx(l,s),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function y$(e,t,n){const r={};return Dx(r,Lx(e,t)),e.create(t,e.Fragment,r,n)}function x$(e,t){return t.value}function bT(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Dx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function b$(e,t,n){return r;function r(i,a,l,s){const u=Array.isArray(l.children)?n:t;return s?u(a,l,s):u(a,l)}}function w$(e,t){return n;function n(r,i,a,l){const s=Array.isArray(a.children),c=Mx(r);return t(i,a,l,s,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function j$(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Rx.call(t.properties,i)){const a=k$(e,i,t.properties[i]);if(a){const[l,s]=a;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&f$.has(t.tagName)?r=s:n[l]=s}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function S$(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 l=a.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else zc(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 s=r.value.data.estree.body[0];s.type,a=e.evaluater.evaluateExpression(s.expression)}else zc(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Lx(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:c$;for(;++r<t.children.length;){const a=t.children[r];let l;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;l=c+"-"+u,i.set(c,u+1)}}const s=xT(e,a,l);s!==void 0&&n.push(s)}return n}function k$(e,t,n){const r=O4(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?v4(n):_4(n)),r.property==="style"){let i=typeof n=="object"?n:C$(e,String(n));return e.stylePropertyNameCase==="css"&&(i=P$(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?P4[r.property]||r.property:r.attribute,n]}}function C$(e,t){try{return l$(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new zn("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=yT+"#cannot-parse-style-attribute",i}}function wT(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,l;for(;++a<i.length;){const s=$w(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:s,computed:!!(a&&s.type==="Literal"),optional:!1}:s}r=l}else r=$w(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Rx.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);zc(e)}function zc(e,t){const n=new zn("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=yT+"#cannot-handle-mdx-estrees-without-createevaluater",n}function P$(e){const t={};let n;for(n in e)Rx.call(e,n)&&(t[E$(n)]=e[n]);return t}function E$(e){let t=e.replace(u$,T$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function T$(e){return"-"+e.toLowerCase()}const $m={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"]},O$={};function A$(e,t){const n=O$,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return jT(e,r,i)}function jT(e,t,n){if(I$(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 Xw(e.children,t,n)}return Array.isArray(e)?Xw(e,t,n):""}function Xw(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=jT(e[i],t,n);return r.join("")}function I$(e){return!!(e&&typeof e=="object")}const Qw=document.createElement("i");function zx(e){const t="&"+e+";";Qw.innerHTML=t;const n=Qw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ji(e,t,n,r){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Ar(e,t){return e.length>0?(ji(e,e.length,0,t),e):t}const Jw={}.hasOwnProperty;function N$(e){const t={};let n=-1;for(;++n<e.length;)_$(t,e[n]);return t}function _$(e,t){let n;for(n in t){const i=(Jw.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Jw.call(i,l)||(i[l]=[]);const s=a[l];M$(i[l],Array.isArray(s)?s:s?[s]:[])}}}function M$(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ji(e,0,0,r)}function ST(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 Rl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const mi=Ka(/[A-Za-z]/),fr=Ka(/[\dA-Za-z]/),R$=Ka(/[#-'*+\--9=?A-Z^-~]/);function Pv(e){return e!==null&&(e<32||e===127)}const Ev=Ka(/\d/),D$=Ka(/[\dA-Fa-f]/),L$=Ka(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function or(e){return e!==null&&(e<0||e===32)}function ot(e){return e===-2||e===-1||e===32}const z$=Ka(new RegExp("\\p{P}|\\p{S}","u")),$$=Ka(/\s/);function Ka(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function us(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&fr(e.charCodeAt(n+1))&&fr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(l=String.fromCharCode(a,s),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function St(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(c){return ot(c)?(e.enter(n),s(c)):t(c)}function s(c){return ot(c)&&a++<i?(e.consume(c),s):(e.exit(n),t(c))}}const B$={tokenize:F$};function F$(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),St(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),a(s)}function a(s){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,l(s)}function l(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Me(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),l)}}const U$={tokenize:W$},Zw={tokenize:K$};function W$(e){const t=this,n=[];let r=0,i,a,l;return s;function s(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 C=j,S;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){S=t.events[C][1].end;break}v(r);let E=j;for(;E<t.events.length;)t.events[E][1].end={...S},E++;return ji(t.events,C+1,0,t.events.slice(j)),t.events.length=E,u(w)}return s(w)}function u(w){if(r===n.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zw,f,d)(w)}function f(w){return i&&b(),v(r),p(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,g(w)}function p(w){return t.containerState={},e.attempt(Zw,m,g)(w)}function m(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function g(w){if(w===null){i&&b(),v(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),y(w)}function y(w){if(w===null){x(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return Me(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),y)}function x(w,j){const C=t.sliceStream(w);if(j&&C.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(C),t.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<l&&(!i.events[S][1].end||i.events[S][1].end.offset>l))return;const E=t.events.length;let I=E,R,A;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(R){A=t.events[I][1].end;break}R=!0}for(v(r),S=E;S<t.events.length;)t.events[S][1].end={...A},S++;ji(t.events,I+1,0,t.events.slice(E)),t.events.length=S}}function v(w){let j=n.length;for(;j-- >w;){const C=n[j];t.containerState=C[1],C[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 K$(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ej(e){if(e===null||or(e)||$$(e))return 1;if(z$(e))return 2}function $x(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 Tv={name:"attention",resolveAll:q$,tokenize:H$};function q$(e,t){let n=-1,r,i,a,l,s,c,u,f;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},p={...e[n][1].start};tj(d,-c),tj(p,c),l={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ar(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ar(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),u=Ar(u,$x(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ar(u,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=Ar(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,ji(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function H$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ej(r);let a;return l;function l(c){return a=c,e.enter("attentionSequence"),s(c)}function s(c){if(c===a)return e.consume(c),s;const u=e.exit("attentionSequence"),f=ej(c),d=!f||f===2&&i||n.includes(c),p=!i||i===2&&f||n.includes(r);return u._open=!!(a===42?d:d&&(i||!p)),u._close=!!(a===42?p:p&&(f||!d)),t(c)}}function tj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const V$={name:"autolink",tokenize:Y$};function Y$(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 mi(m)?(e.consume(m),l):m===64?n(m):u(m)}function l(m){return m===43||m===45||m===46||fr(m)?(r=1,s(m)):u(m)}function s(m){return m===58?(e.consume(m),r=0,c):(m===43||m===45||m===46||fr(m))&&r++<32?(e.consume(m),s):(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||Pv(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),f):R$(m)?(e.consume(m),u):n(m)}function f(m){return fr(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,f):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||fr(m))&&r++<63){const g=m===45?p:d;return e.consume(m),g}return n(m)}}const Xp={partial:!0,tokenize:G$};function G$(e,t,n){return r;function r(a){return ot(a)?St(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Me(a)?t(a):n(a)}}const kT={continuation:{tokenize:Q$},exit:J$,name:"blockQuote",tokenize:X$};function X$(e,t,n){const r=this;return i;function i(l){if(l===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return ot(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Q$(e,t,n){const r=this;return i;function i(l){return ot(l)?St(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(kT,t,n)(l)}}function J$(e){e.exit("blockQuote")}const CT={name:"characterEscape",tokenize:Z$};function Z$(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 L$(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const PT={name:"characterReference",tokenize:e6};function e6(e,t,n){const r=this;let i=0,a,l;return s;function s(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,l=fr,f(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=D$,f):(e.enter("characterReferenceValue"),a=7,l=Ev,f(d))}function f(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return l===fr&&!zx(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(d)&&i++<a?(e.consume(d),f):n(d)}}const nj={partial:!0,tokenize:n6},rj={concrete:!0,name:"codeFenced",tokenize:t6};function t6(e,t,n){const r=this,i={partial:!0,tokenize:C};let a=0,l=0,s;return c;function c(S){return u(S)}function u(S){const E=r.events[r.events.length-1];return a=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,s=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(S)}function f(S){return S===s?(l++,e.consume(S),f):l<3?n(S):(e.exit("codeFencedFenceSequence"),ot(S)?St(e,d,"whitespace")(S):d(S))}function d(S){return S===null||Me(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(nj,y,j)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||Me(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):ot(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),St(e,m,"whitespace")(S)):S===96&&S===s?n(S):(e.consume(S),p)}function m(S){return S===null||Me(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||Me(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===s?n(S):(e.consume(S),g)}function y(S){return e.attempt(i,j,x)(S)}function x(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),v}function v(S){return a>0&&ot(S)?St(e,b,"linePrefix",a+1)(S):b(S)}function b(S){return S===null||Me(S)?e.check(nj,y,j)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||Me(S)?(e.exit("codeFlowValue"),b(S)):(e.consume(S),w)}function j(S){return e.exit("codeFenced"),t(S)}function C(S,E,I){let R=0;return A;function A(O){return S.enter("lineEnding"),S.consume(O),S.exit("lineEnding"),_}function _(O){return S.enter("codeFencedFence"),ot(O)?St(S,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):N(O)}function N(O){return O===s?(S.enter("codeFencedFenceSequence"),Y(O)):I(O)}function Y(O){return O===s?(R++,S.consume(O),Y):R>=l?(S.exit("codeFencedFenceSequence"),ot(O)?St(S,K,"whitespace")(O):K(O)):I(O)}function K(O){return O===null||Me(O)?(S.exit("codeFencedFence"),E(O)):I(O)}}}function n6(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Bm={name:"codeIndented",tokenize:i6},r6={partial:!0,tokenize:a6};function i6(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),St(e,a,"linePrefix",5)(u)}function a(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?c(u):Me(u)?e.attempt(r6,l,c)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||Me(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function c(u){return e.exit("codeIndented"),t(u)}}function a6(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):Me(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):St(e,a,"linePrefix",5)(l)}function a(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):Me(l)?i(l):n(l)}}const o6={name:"codeText",previous:s6,resolve:l6,tokenize:c6};function l6(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 s6(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function c6(e,t,n){let r=0,i,a;return l;function l(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(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,f(d)):Me(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||Me(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",u(d))}}class u6{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&&Ns(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),Ns(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ns(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);Ns(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ns(this.left,n.reverse())}}}function Ns(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 ET(e){const t={};let n=-1,r,i,a,l,s,c,u;const f=new u6(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.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,d6(f,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(l=f.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},s=f.slice(i,n),s.unshift(r),f.splice(i,n-i+1,s))}}return ji(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function d6(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const s=l.events,c=[],u={};let f,d,p=-1,m=n,g=0,y=0;const x=[y];for(;m;){for(;e.get(++i)[1]!==m;);a.push(i),m._tokenizer||(f=r.sliceStream(m),m.next||f.push(null),d&&l.defineSkip(m.start),m._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),m._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(y=p+1,x.push(y),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(l.events=[],m?(m._tokenizer=void 0,m.previous=void 0):x.pop(),p=x.length;p--;){const v=s.slice(x[p],x[p+1]),b=a.pop();c.push([b,b+v.length-1]),e.splice(b,2,v)}for(c.reverse(),p=-1;++p<c.length;)u[g+c[p][0]]=g+c[p][1],g+=c[p][1]-c[p][0]-1;return u}const f6={resolve:h6,tokenize:m6},p6={partial:!0,tokenize:g6};function h6(e){return ET(e),e}function m6(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?a(s):Me(s)?e.check(p6,l,a)(s):(e.consume(s),i)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function l(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function g6(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),St(e,a,"linePrefix")}function a(l){if(l===null||Me(l))return n(l);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function TT(e,t,n,r,i,a,l,s,c){const u=c||Number.POSITIVE_INFINITY;let f=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(v),e.exit(a),p):v===null||v===32||v===41||Pv(v)?n(v):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(v))}function p(v){return v===62?(e.enter(a),e.consume(v),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(s),p(v)):v===null||v===60||Me(v)?n(v):(e.consume(v),v===92?g:m)}function g(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function y(v){return!f&&(v===null||v===41||or(v))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(v)):f<u&&v===40?(e.consume(v),f++,y):v===41?(e.consume(v),f--,y):v===null||v===32||v===40||Pv(v)?n(v):(e.consume(v),v===92?x:y)}function x(v){return v===40||v===41||v===92?(e.consume(v),y):y(v)}}function OT(e,t,n,r,i,a){const l=this;let s=0,c;return u;function u(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(a),f}function f(m){return s>999||m===null||m===91||m===93&&!c||m===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(m):m===93?(e.exit(a),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):Me(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||Me(m)||s++>999?(e.exit("chunkString"),f(m)):(e.consume(m),c||(c=!ot(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function AT(e,t,n,r,i,a){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,c):n(p)}function c(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(a),u(p))}function u(p){return p===l?(e.exit(a),c(l)):p===null?n(p):Me(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),St(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||Me(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:f)}function d(p){return p===l||p===92?(e.consume(p),f):f(p)}}function hc(e,t){let n;return r;function r(i){return Me(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ot(i)?St(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const v6={name:"definition",tokenize:x6},y6={partial:!0,tokenize:b6};function x6(e,t,n){const r=this;let i;return a;function a(m){return e.enter("definition"),l(m)}function l(m){return OT.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return i=Rl(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 or(m)?hc(e,u)(m):u(m)}function u(m){return TT(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(y6,d,d)(m)}function d(m){return ot(m)?St(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Me(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function b6(e,t,n){return r;function r(s){return or(s)?hc(e,i)(s):n(s)}function i(s){return AT(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return ot(s)?St(e,l,"whitespace")(s):l(s)}function l(s){return s===null||Me(s)?t(s):n(s)}}const w6={name:"hardBreakEscape",tokenize:j6};function j6(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Me(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const S6={name:"headingAtx",resolve:k6,tokenize:C6};function k6(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"},ji(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function C6(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),a(f)}function a(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||or(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),c(f)):f===null||Me(f)?(e.exit("atxHeading"),t(f)):ot(f)?St(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function c(f){return f===35?(e.consume(f),c):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||or(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const P6=["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"],ij=["pre","script","style","textarea"],E6={concrete:!0,name:"htmlFlow",resolveTo:A6,tokenize:I6},T6={partial:!0,tokenize:_6},O6={partial:!0,tokenize:N6};function A6(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 I6(e,t,n){const r=this;let i,a,l,s,c;return u;function u(T){return f(T)}function f(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),d}function d(T){return T===33?(e.consume(T),p):T===47?(e.consume(T),a=!0,y):T===63?(e.consume(T),i=3,r.interrupt?t:k):mi(T)?(e.consume(T),l=String.fromCharCode(T),x):n(T)}function p(T){return T===45?(e.consume(T),i=2,m):T===91?(e.consume(T),i=5,s=0,g):mi(T)?(e.consume(T),i=4,r.interrupt?t:k):n(T)}function m(T){return T===45?(e.consume(T),r.interrupt?t:k):n(T)}function g(T){const ce="CDATA[";return T===ce.charCodeAt(s++)?(e.consume(T),s===ce.length?r.interrupt?t:N:g):n(T)}function y(T){return mi(T)?(e.consume(T),l=String.fromCharCode(T),x):n(T)}function x(T){if(T===null||T===47||T===62||or(T)){const ce=T===47,ge=l.toLowerCase();return!ce&&!a&&ij.includes(ge)?(i=1,r.interrupt?t(T):N(T)):P6.includes(l.toLowerCase())?(i=6,ce?(e.consume(T),v):r.interrupt?t(T):N(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):a?b(T):w(T))}return T===45||fr(T)?(e.consume(T),l+=String.fromCharCode(T),x):n(T)}function v(T){return T===62?(e.consume(T),r.interrupt?t:N):n(T)}function b(T){return ot(T)?(e.consume(T),b):A(T)}function w(T){return T===47?(e.consume(T),A):T===58||T===95||mi(T)?(e.consume(T),j):ot(T)?(e.consume(T),w):A(T)}function j(T){return T===45||T===46||T===58||T===95||fr(T)?(e.consume(T),j):C(T)}function C(T){return T===61?(e.consume(T),S):ot(T)?(e.consume(T),C):w(T)}function S(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),c=T,E):ot(T)?(e.consume(T),S):I(T)}function E(T){return T===c?(e.consume(T),c=null,R):T===null||Me(T)?n(T):(e.consume(T),E)}function I(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||or(T)?C(T):(e.consume(T),I)}function R(T){return T===47||T===62||ot(T)?w(T):n(T)}function A(T){return T===62?(e.consume(T),_):n(T)}function _(T){return T===null||Me(T)?N(T):ot(T)?(e.consume(T),_):n(T)}function N(T){return T===45&&i===2?(e.consume(T),F):T===60&&i===1?(e.consume(T),W):T===62&&i===4?(e.consume(T),L):T===63&&i===3?(e.consume(T),k):T===93&&i===5?(e.consume(T),B):Me(T)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(T6,X,Y)(T)):T===null||Me(T)?(e.exit("htmlFlowData"),Y(T)):(e.consume(T),N)}function Y(T){return e.check(O6,K,X)(T)}function K(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),O}function O(T){return T===null||Me(T)?Y(T):(e.enter("htmlFlowData"),N(T))}function F(T){return T===45?(e.consume(T),k):N(T)}function W(T){return T===47?(e.consume(T),l="",M):N(T)}function M(T){if(T===62){const ce=l.toLowerCase();return ij.includes(ce)?(e.consume(T),L):N(T)}return mi(T)&&l.length<8?(e.consume(T),l+=String.fromCharCode(T),M):N(T)}function B(T){return T===93?(e.consume(T),k):N(T)}function k(T){return T===62?(e.consume(T),L):T===45&&i===2?(e.consume(T),k):N(T)}function L(T){return T===null||Me(T)?(e.exit("htmlFlowData"),X(T)):(e.consume(T),L)}function X(T){return e.exit("htmlFlow"),t(T)}}function N6(e,t,n){const r=this;return i;function i(l){return Me(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function _6(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Xp,t,n)}}const M6={name:"htmlText",tokenize:R6};function R6(e,t,n){const r=this;let i,a,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),c}function c(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),C):k===63?(e.consume(k),w):mi(k)?(e.consume(k),I):n(k)}function u(k){return k===45?(e.consume(k),f):k===91?(e.consume(k),a=0,g):mi(k)?(e.consume(k),b):n(k)}function f(k){return k===45?(e.consume(k),m):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),p):Me(k)?(l=d,W(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),m):d(k)}function m(k){return k===62?F(k):k===45?p(k):d(k)}function g(k){const L="CDATA[";return k===L.charCodeAt(a++)?(e.consume(k),a===L.length?y:g):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),x):Me(k)?(l=y,W(k)):(e.consume(k),y)}function x(k){return k===93?(e.consume(k),v):y(k)}function v(k){return k===62?F(k):k===93?(e.consume(k),v):y(k)}function b(k){return k===null||k===62?F(k):Me(k)?(l=b,W(k)):(e.consume(k),b)}function w(k){return k===null?n(k):k===63?(e.consume(k),j):Me(k)?(l=w,W(k)):(e.consume(k),w)}function j(k){return k===62?F(k):w(k)}function C(k){return mi(k)?(e.consume(k),S):n(k)}function S(k){return k===45||fr(k)?(e.consume(k),S):E(k)}function E(k){return Me(k)?(l=E,W(k)):ot(k)?(e.consume(k),E):F(k)}function I(k){return k===45||fr(k)?(e.consume(k),I):k===47||k===62||or(k)?R(k):n(k)}function R(k){return k===47?(e.consume(k),F):k===58||k===95||mi(k)?(e.consume(k),A):Me(k)?(l=R,W(k)):ot(k)?(e.consume(k),R):F(k)}function A(k){return k===45||k===46||k===58||k===95||fr(k)?(e.consume(k),A):_(k)}function _(k){return k===61?(e.consume(k),N):Me(k)?(l=_,W(k)):ot(k)?(e.consume(k),_):R(k)}function N(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,Y):Me(k)?(l=N,W(k)):ot(k)?(e.consume(k),N):(e.consume(k),K)}function Y(k){return k===i?(e.consume(k),i=void 0,O):k===null?n(k):Me(k)?(l=Y,W(k)):(e.consume(k),Y)}function K(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||or(k)?R(k):(e.consume(k),K)}function O(k){return k===47||k===62||or(k)?R(k):n(k)}function F(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function W(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),M}function M(k){return ot(k)?St(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):B(k)}function B(k){return e.enter("htmlTextData"),l(k)}}const Bx={name:"labelEnd",resolveAll:$6,resolveTo:B6,tokenize:F6},D6={tokenize:U6},L6={tokenize:W6},z6={tokenize:K6};function $6(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&&ji(e,0,e.length,n),e}function B6(e,t){let n=e.length,r=0,i,a,l,s;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(l){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"&&(l=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[l][1].end}},f={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return s=[["enter",c,t],["enter",u,t]],s=Ar(s,e.slice(a+1,a+r+3)),s=Ar(s,[["enter",f,t]]),s=Ar(s,$x(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),s=Ar(s,[["exit",f,t],e[l-2],e[l-1],["exit",u,t]]),s=Ar(s,e.slice(l+1)),s=Ar(s,[["exit",c,t]]),ji(e,a,e.length,s),e}function F6(e,t,n){const r=this;let i=r.events.length,a,l;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 s;function s(p){return a?a._inactive?d(p):(l=r.parser.defined.includes(Rl(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),c):n(p)}function c(p){return p===40?e.attempt(D6,f,l?f:d)(p):p===91?e.attempt(L6,f,l?u:d)(p):l?f(p):d(p)}function u(p){return e.attempt(z6,f,d)(p)}function f(p){return t(p)}function d(p){return a._balanced=!0,n(p)}}function U6(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 or(d)?hc(e,a)(d):a(d)}function a(d){return d===41?f(d):TT(e,l,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function l(d){return or(d)?hc(e,c)(d):f(d)}function s(d){return n(d)}function c(d){return d===34||d===39||d===40?AT(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return or(d)?hc(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function W6(e,t,n){const r=this;return i;function i(s){return OT.call(r,e,a,l,"reference","referenceMarker","referenceString")(s)}function a(s){return r.parser.defined.includes(Rl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function l(s){return n(s)}}function K6(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 q6={name:"labelStartImage",resolveAll:Bx.resolveAll,tokenize:H6};function H6(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),l):n(s)}function l(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const V6={name:"labelStartLink",resolveAll:Bx.resolveAll,tokenize:Y6};function Y6(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Fm={name:"lineEnding",tokenize:G6};function G6(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),St(e,t,"linePrefix")}}const Kd={name:"thematicBreak",tokenize:X6};function X6(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,s(u)}function s(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Me(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),ot(u)?St(e,s,"whitespace")(u):s(u))}}const Jn={continuation:{tokenize:e3},exit:n3,name:"list",tokenize:Z6},Q6={partial:!0,tokenize:r3},J6={partial:!0,tokenize:t3};function Z6(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,l=0;return s;function s(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Ev(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(Kd,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 Ev(m)&&++l<10?(e.consume(m),c):(!r.interrupt||l<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(Xp,r.interrupt?n:f,e.attempt(Q6,p,d))}function f(m){return r.containerState.initialBlankLine=!0,a++,p(m)}function d(m){return ot(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function e3(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Xp,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,St(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!ot(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(J6,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,St(e,e.attempt(Jn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function t3(e,t,n){const r=this;return St(e,i,"listItemIndent",r.containerState.size+1);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function n3(e){e.exit(this.containerState.type)}function r3(e,t,n){const r=this;return St(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=r.events[r.events.length-1];return!ot(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const aj={name:"setextUnderline",resolveTo:i3,tokenize:a3};function i3(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 l={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",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function a3(e,t,n){const r=this;let i;return a;function a(u){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ot(u)?St(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Me(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const o3={tokenize:l3};function l3(e){const t=this,n=e.attempt(Xp,r,e.attempt(this.parser.constructs.flowInitial,i,St(e,e.attempt(this.parser.constructs.flow,i,e.attempt(f6,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 s3={resolveAll:NT()},c3=IT("string"),u3=IT("text");function IT(e){return{resolveAll:NT(e==="text"?d3:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,s);return l;function l(f){return u(f)?a(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),c}function c(f){return u(f)?(n.exit("data"),a(f)):(n.consume(f),c)}function u(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p<d.length;){const m=d[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function NT(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 d3(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,l=-1,s=0,c;for(;a--;){const u=i[a];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)s++,l--;if(l)break;l=-1}else if(u===-2)c=!0,s++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||c||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},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 f3={42:Jn,43:Jn,45:Jn,48:Jn,49:Jn,50:Jn,51:Jn,52:Jn,53:Jn,54:Jn,55:Jn,56:Jn,57:Jn,62:kT},p3={91:v6},h3={[-2]:Bm,[-1]:Bm,32:Bm},m3={35:S6,42:Kd,45:[aj,Kd],60:E6,61:aj,95:Kd,96:rj,126:rj},g3={38:PT,92:CT},v3={[-5]:Fm,[-4]:Fm,[-3]:Fm,33:q6,38:PT,42:Tv,60:[V$,M6],91:V6,92:[w6,CT],93:Bx,95:Tv,96:o6},y3={null:[Tv,s3]},x3={null:[42,95]},b3={null:[]},w3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:x3,contentInitial:p3,disable:b3,document:f3,flow:m3,flowInitial:h3,insideSpan:y3,string:g3,text:v3},Symbol.toStringTag,{value:"Module"}));function j3(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 l=[],s=[];const c={attempt:E(C),check:E(S),consume:b,enter:w,exit:j,interrupt:E(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:d};let f=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function d(_){return l=Ar(l,_),x(),l[l.length-1]!==null?[]:(I(t,0),u.events=$x(a,u.events,u),u.events)}function p(_,N){return k3(m(_),N)}function m(_){return S3(l,_)}function g(){const{_bufferIndex:_,_index:N,line:Y,column:K,offset:O}=r;return{_bufferIndex:_,_index:N,line:Y,column:K,offset:O}}function y(_){i[_.line]=_.column,A()}function x(){let _;for(;r._index<l.length;){const N=l[r._index];if(typeof N=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<N.length;)v(N.charCodeAt(r._bufferIndex));else v(N)}}function v(_){f=f(_)}function b(_){Me(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,A()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=_}function w(_,N){const Y=N||{};return Y.type=_,Y.start=g(),u.events.push(["enter",Y,u]),s.push(Y),Y}function j(_){const N=s.pop();return N.end=g(),u.events.push(["exit",N,u]),N}function C(_,N){I(_,N.from)}function S(_,N){N.restore()}function E(_,N){return Y;function Y(K,O,F){let W,M,B,k;return Array.isArray(K)?X(K):"tokenize"in K?X([K]):L(K);function L(Q){return ae;function ae(fe){const te=fe!==null&&Q[fe],ee=fe!==null&&Q.null,le=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return X(le)(fe)}}function X(Q){return W=Q,M=0,Q.length===0?F:T(Q[M])}function T(Q){return ae;function ae(fe){return k=R(),B=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?ge():Q.tokenize.call(N?Object.assign(Object.create(u),N):u,c,ce,ge)(fe)}}function ce(Q){return _(B,k),O}function ge(Q){return k.restore(),++M<W.length?T(W[M]):F}}}function I(_,N){_.resolveAll&&!a.includes(_)&&a.push(_),_.resolve&&ji(u.events,N,u.events.length-N,_.resolve(u.events.slice(N),u)),_.resolveTo&&(u.events=_.resolveTo(u.events,u))}function R(){const _=g(),N=u.previous,Y=u.currentConstruct,K=u.events.length,O=Array.from(s);return{from:K,restore:F};function F(){r=_,u.previous=N,u.currentConstruct=Y,u.events.length=K,s=O,A()}}function A(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function S3(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,a)];else{if(l=e.slice(n,i),r>-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function k3(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
69
- `;break}case-3:{l=`\r
70
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function C3(e){const r={constructs:N$([w3,...(e||{}).extensions||[]]),content:i(B$),defined:[],document:i(U$),flow:i(o3),lazy:{},string:i(c3),text:i(u3)};return r;function i(a){return l;function l(s){return j3(r,a,s)}}}function P3(e){for(;!ET(e););return e}const oj=/[\0\t\n\r]/g;function E3(){let e=1,t="",n=!0,r;return i;function i(a,l,s){const c=[];let u,f,d,p,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(oj.lastIndex=d,u=oj.exec(a),p=u&&u.index!==void 0?u.index:a.length,m=a.charCodeAt(p),!u){t=a.slice(d);break}if(m===10&&d===p&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<p&&(c.push(a.slice(d,p)),e+=p-d),m){case 0:{c.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,c.push(-2);e++<f;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return s&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const T3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function O3(e){return e.replace(T3,A3)}function A3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return ST(n.slice(a?2:1),a?16:10)}return zx(n)||e}const _T={}.hasOwnProperty;function I3(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),N3(n)(P3(C3(n).document().write(E3()(e,t,!0))))}function N3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Te),autolinkProtocol:R,autolinkEmail:R,atxHeading:a(Re),blockQuote:a(ee),characterEscape:R,characterReference:R,codeFenced:a(le),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(le,l),codeText:a(ne,l),codeTextData:R,data:R,codeFlowValue:R,definition:a(Ae),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(be),hardBreakEscape:a($e),hardBreakTrailing:a($e),htmlFlow:a(xe,l),htmlFlowData:R,htmlText:a(xe,l),htmlTextData:R,image:a(Ie),label:l,link:a(Te),listItem:a(Ge),listItemValue:p,listOrdered:a(Ve,d),listUnordered:a(Ve),paragraph:a(Ke),reference:T,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Re),strong:a(gt),thematicBreak:a(Z)},exit:{atxHeading:c(),atxHeadingSequence:C,autolink:c(),autolinkEmail:te,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:Q,characterReference:ae,codeFenced:c(x),codeFencedFence:y,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:A,codeIndented:c(v),codeText:c(O),codeTextData:A,data:A,definition:c(),definitionDestinationString:j,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(N),hardBreakTrailing:c(N),htmlFlow:c(Y),htmlFlowData:A,htmlText:c(K),htmlTextData:A,image:c(W),label:B,labelText:M,lineEnding:_,link:c(F),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:k,resourceTitleString:L,resource:X,setextHeading:c(I),setextHeadingLineSequence:E,setextHeadingText:S,strong:c(),thematicBreak:c()}};MT(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let oe={type:"root",children:[]};const D={stack:[oe],tokenStack:[],config:t,enter:s,exit:u,buffer:l,resume:f,data:n},se=[];let he=-1;for(;++he<G.length;)if(G[he][1].type==="listOrdered"||G[he][1].type==="listUnordered")if(G[he][0]==="enter")se.push(he);else{const Ee=se.pop();he=i(G,Ee,he)}for(he=-1;++he<G.length;){const Ee=t[G[he][0]];_T.call(Ee,G[he][1].type)&&Ee[G[he][1].type].call(Object.assign({sliceSerialize:G[he][2].sliceSerialize},D),G[he][1])}if(D.tokenStack.length>0){const Ee=D.tokenStack[D.tokenStack.length-1];(Ee[1]||lj).call(D,void 0,Ee[0])}for(oe.position={start:ua(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:ua(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)oe=t.transforms[he](oe)||oe;return oe}function i(G,oe,D){let se=oe-1,he=-1,Ee=!1,Pe,De,Le,We;for(;++se<=D;){const Be=G[se];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?he++:he--,We=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(Pe&&!We&&!he&&!Le&&(Le=se),We=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:We=void 0}if(!he&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||he===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(Pe){let Xe=se;for(De=void 0;Xe--;){const ct=G[Xe];if(ct[1].type==="lineEnding"||ct[1].type==="lineEndingBlank"){if(ct[0]==="exit")continue;De&&(G[De][1].type="lineEndingBlank",Ee=!0),ct[1].type="lineEnding",De=Xe}else if(!(ct[1].type==="linePrefix"||ct[1].type==="blockQuotePrefix"||ct[1].type==="blockQuotePrefixWhitespace"||ct[1].type==="blockQuoteMarker"||ct[1].type==="listItemIndent"))break}Le&&(!De||Le<De)&&(Pe._spread=!0),Pe.end=Object.assign({},De?G[De][1].start:Be[1].end),G.splice(De||se,0,["exit",Pe,Be[2]]),se++,D++}if(Be[1].type==="listItemPrefix"){const Xe={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};Pe=Xe,G.splice(se,0,["enter",Xe,Be[2]]),se++,D++,Le=void 0,We=!0}}}return G[oe][1]._spread=Ee,D}function a(G,oe){return D;function D(se){s.call(this,G(se),se),oe&&oe.call(this,se)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(G,oe,D){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([oe,D||void 0]),G.position={start:ua(oe.start),end:void 0}}function c(G){return oe;function oe(D){G&&G.call(this,D),u.call(this,D)}}function u(G,oe){const D=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==G.type&&(oe?oe.call(this,G,se[0]):(se[1]||lj).call(this,G,se[0]));else throw new Error("Cannot close `"+G.type+"` ("+pc({start:G.start,end:G.end})+"): it’s not open");D.position.end=ua(G.end)}function f(){return A$(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(G){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function m(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=G}function g(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=G}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G.replace(/(\r?\n|\r)$/g,"")}function b(G){const oe=this.resume(),D=this.stack[this.stack.length-1];D.label=oe,D.identifier=Rl(this.sliceSerialize(G)).toLowerCase()}function w(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.title=G}function j(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.url=G}function C(G){const oe=this.stack[this.stack.length-1];if(!oe.depth){const D=this.sliceSerialize(G).length;oe.depth=D}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function E(G){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function R(G){const D=this.stack[this.stack.length-1].children;let se=D[D.length-1];(!se||se.type!=="text")&&(se=Nt(),se.position={start:ua(G.start),end:void 0},D.push(se)),this.stack.push(se)}function A(G){const oe=this.stack.pop();oe.value+=this.sliceSerialize(G),oe.position.end=ua(G.end)}function _(G){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const D=oe.children[oe.children.length-1];D.position.end=ua(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(oe.type)&&(R.call(this,G),A.call(this,G))}function N(){this.data.atHardBreak=!0}function Y(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G}function K(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G}function O(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G}function F(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=oe,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function W(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=oe,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function M(G){const oe=this.sliceSerialize(G),D=this.stack[this.stack.length-2];D.label=O3(oe),D.identifier=Rl(oe).toLowerCase()}function B(){const G=this.stack[this.stack.length-1],oe=this.resume(),D=this.stack[this.stack.length-1];if(this.data.inReference=!0,D.type==="link"){const se=G.children;D.children=se}else D.alt=oe}function k(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.url=G}function L(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.title=G}function X(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ce(G){const oe=this.resume(),D=this.stack[this.stack.length-1];D.label=oe,D.identifier=Rl(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function ge(G){this.data.characterReferenceType=G.type}function Q(G){const oe=this.sliceSerialize(G),D=this.data.characterReferenceType;let se;D?(se=ST(oe,D==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=zx(oe);const he=this.stack[this.stack.length-1];he.value+=se}function ae(G){const oe=this.stack.pop();oe.position.end=ua(G.end)}function fe(G){A.call(this,G);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(G)}function te(G){A.call(this,G);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(G)}function ee(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function ne(){return{type:"inlineCode",value:""}}function Ae(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function Re(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function xe(){return{type:"html",value:""}}function Ie(){return{type:"image",title:null,url:"",alt:null}}function Te(){return{type:"link",title:null,url:"",children:[]}}function Ve(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function Ge(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function Ke(){return{type:"paragraph",children:[]}}function gt(){return{type:"strong",children:[]}}function Nt(){return{type:"text",value:""}}function Z(){return{type:"thematicBreak"}}}function ua(e){return{line:e.line,column:e.column,offset:e.offset}}function MT(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?MT(e,r):_3(e,r)}}function _3(e,t){let n;for(n in t)if(_T.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 lj(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pc({start:t.start,end:t.end})+") is still open")}function M3(e){const t=this;t.parser=n;function n(r){return I3(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function R3(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 D3(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
71
- `}]}function L3(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 z3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function B3(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=us(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,s+=1,e.footnoteCounts.set(r,s);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function F3(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 U3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function RT(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 l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function W3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return RT(e,t);const i={src:us(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 K3(e,t){const n={src:us(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 q3(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 H3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return RT(e,t);const i={href:us(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 V3(e,t){const n={href:us(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 Y3(e,t,n){const r=e.all(t),i=n?G3(n):DT(t),a={},l=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(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 s=-1;for(;++s<r.length;){const f=r[s];(i||s!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
73
- `}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&l.push({type:"text",value:`
74
- `});const u={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,u),e.applyData(t,u)}function G3(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=DT(n[r])}return t}function DT(e){const t=e.spread;return t??e.children.length>1}function X3(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 l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.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 Q3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J3(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Z3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eB(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Mx(t.children[1]),c=gT(t.children[t.children.length-1]);s&&c&&(l.position={start:s,end:c}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function tB(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let c=-1;const u=[];for(;++c<s;){const d=t.children[c],p={},m=l?l[c]:void 0;m&&(p.align=m);let g={type:"element",tagName:a,properties:p,children:[]};d&&(g.children=e.all(d),e.patch(d,g),g=e.applyData(d,g)),u.push(g)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function nB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const sj=9,cj=32;function rB(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(uj(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(uj(t.slice(i),i>0,!1)),a.join("")}function uj(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===sj||a===cj;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===sj||a===cj;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function iB(e,t){const n={type:"text",value:rB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function aB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const oB={blockquote:R3,break:D3,code:L3,delete:z3,emphasis:$3,footnoteReference:B3,heading:F3,html:U3,imageReference:W3,image:K3,inlineCode:q3,linkReference:H3,link:V3,listItem:Y3,list:X3,paragraph:Q3,root:J3,strong:Z3,table:eB,tableCell:nB,tableRow:tB,text:iB,thematicBreak:aB,toml:ld,yaml:ld,definition:ld,footnoteDefinition:ld};function ld(){}const LT=-1,Qp=0,mc=1,Cf=2,Fx=3,Ux=4,Wx=5,Kx=6,zT=7,$T=8,lB=typeof self=="object"?self:globalThis,dj=(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 lB[e](t)},sB=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case Qp:case LT:return n(l,i);case mc:{const s=n([],i);for(const c of l)s.push(r(c));return s}case Cf:{const s=n({},i);for(const[c,u]of l)s[r(c)]=r(u);return s}case Fx:return n(new Date(l),i);case Ux:{const{source:s,flags:c}=l;return n(new RegExp(s,c),i)}case Wx:{const s=n(new Map,i);for(const[c,u]of l)s.set(r(c),r(u));return s}case Kx:{const s=n(new Set,i);for(const c of l)s.add(r(c));return s}case zT:{const{name:s,message:c}=l;return n(dj(s,c),i)}case $T:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(dj(a,l),i)};return r},fj=e=>sB(new Map,e)(0),al="",{toString:cB}={},{keys:uB}=Object,_s=e=>{const t=typeof e;if(t!=="object"||!e)return[Qp,t];const n=cB.call(e).slice(8,-1);switch(n){case"Array":return[mc,al];case"Object":return[Cf,al];case"Date":return[Fx,al];case"RegExp":return[Ux,al];case"Map":return[Wx,al];case"Set":return[Kx,al];case"DataView":return[mc,n]}return n.includes("Array")?[mc,n]:n.includes("Error")?[zT,n]:[Cf,n]},sd=([e,t])=>e===Qp&&(t==="function"||t==="symbol"),dB=(e,t,n,r)=>{const i=(l,s)=>{const c=r.push(l)-1;return n.set(s,c),c},a=l=>{if(n.has(l))return n.get(l);let[s,c]=_s(l);switch(s){case Qp:{let f=l;switch(c){case"bigint":s=$T,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);f=null;break;case"undefined":return i([LT],l)}return i([s,f],l)}case mc:{if(c){let p=l;return c==="DataView"?p=new Uint8Array(l.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(l)),i([c,[...p]],l)}const f=[],d=i([s,f],l);for(const p of l)f.push(a(p));return d}case Cf:{if(c)switch(c){case"BigInt":return i([c,l.toString()],l);case"Boolean":case"Number":case"String":return i([c,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const f=[],d=i([s,f],l);for(const p of uB(l))(e||!sd(_s(l[p])))&&f.push([a(p),a(l[p])]);return d}case Fx:return i([s,l.toISOString()],l);case Ux:{const{source:f,flags:d}=l;return i([s,{source:f,flags:d}],l)}case Wx:{const f=[],d=i([s,f],l);for(const[p,m]of l)(e||!(sd(_s(p))||sd(_s(m))))&&f.push([a(p),a(m)]);return d}case Kx:{const f=[],d=i([s,f],l);for(const p of l)(e||!sd(_s(p)))&&f.push(a(p));return d}}const{message:u}=l;return i([s,{name:c,message:u}],l)};return a},pj=(e,{json:t,lossy:n}={})=>{const r=[];return dB(!(t||n),!!t,new Map,r)(e),r},Pf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?fj(pj(e,t)):structuredClone(e):(e,t)=>fj(pj(e,t));function fB(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 pB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function hB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||fB,r=e.options.footnoteBackLabel||pB,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const f=e.all(u),d=String(u.identifier).toUpperCase(),p=us(d.toLowerCase());let m=0;const g=[],y=e.footnoteCounts.get(d);for(;y!==void 0&&++m<=y;){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-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const x=f[f.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 f.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,v),s.push(v)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Pf(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
75
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
76
- `}]}}const BT=function(e){if(e==null)return yB;if(typeof e=="function")return Jp(e);if(typeof e=="object")return Array.isArray(e)?mB(e):gB(e);if(typeof e=="string")return vB(e);throw new Error("Expected function, string, or object as test")};function mB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=BT(e[n]);return Jp(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function gB(e){const t=e;return Jp(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function vB(e){return Jp(t);function t(n){return n&&n.type===e}}function Jp(e){return t;function t(n,r,i){return!!(xB(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function yB(){return!0}function xB(e){return e!==null&&typeof e=="object"&&"type"in e}const FT=[],bB=!0,hj=!1,wB="skip";function jB(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=BT(i),l=r?-1:1;s(e,void 0,[])();function s(c,u,f){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(p,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=FT,g,y,x;if((!t||a(c,u,f[f.length-1]||void 0))&&(m=SB(n(c,f)),m[0]===hj))return m;if("children"in c&&c.children){const v=c;if(v.children&&m[0]!==wB)for(y=(r?v.children.length:-1)+l,x=f.concat(v);y>-1&&y<v.children.length;){const b=v.children[y];if(g=s(b,y,x)(),g[0]===hj)return g;y=typeof g[1]=="number"?g[1]:y+l}}return m}}}function SB(e){return Array.isArray(e)?e:typeof e=="number"?[bB,e]:e==null?FT:[e]}function UT(e,t,n,r){let i,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,i=n):(a=t,l=n,i=r),jB(e,a,s,i);function s(c,u){const f=u[u.length-1],d=f?f.children.indexOf(c):void 0;return l(c,d,f)}}const Ov={}.hasOwnProperty,kB={};function CB(e,t){const n=t||kB,r=new Map,i=new Map,a=new Map,l={...oB,...n.handlers},s={all:u,applyData:EB,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:c,options:n,patch:PB,wrap:OB};return UT(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();d.has(p)||d.set(p,f)}}),s;function c(f,d){const p=f.type,m=s.handlers[p];if(Ov.call(s.handlers,p)&&m)return m(s,f,d);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in f){const{children:y,...x}=f,v=Pf(x);return v.children=s.all(f),v}return Pf(f)}return(s.options.unknownHandler||TB)(s,f,d)}function u(f){const d=[];if("children"in f){const p=f.children;let m=-1;for(;++m<p.length;){const g=s.one(p[m],f);if(g){if(m&&p[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=mj(g.value)),!Array.isArray(g)&&g.type==="element")){const y=g.children[0];y&&y.type==="text"&&(y.value=mj(y.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function PB(e,t){e.position&&(t.position=s$(e))}function EB(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 l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Pf(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function TB(e,t){const n=t.data||{},r="value"in t&&!(Ov.call(n,"hProperties")||Ov.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 OB(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 mj(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function gj(e,t){const n=CB(e,t),r=n.one(e,void 0),i=hB(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 AB(e,t){return e&&"run"in e?async function(n,r){const i=gj(n,{file:r,...t});await e.run(i,r)}:function(n,r){return gj(n,{file:r,...e||t})}}function vj(e){if(e)throw e}var qd=Object.prototype.hasOwnProperty,WT=Object.prototype.toString,yj=Object.defineProperty,xj=Object.getOwnPropertyDescriptor,bj=function(t){return typeof Array.isArray=="function"?Array.isArray(t):WT.call(t)==="[object Array]"},wj=function(t){if(!t||WT.call(t)!=="[object Object]")return!1;var n=qd.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&qd.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||qd.call(t,i)},jj=function(t,n){yj&&n.name==="__proto__"?yj(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Sj=function(t,n){if(n==="__proto__")if(qd.call(t,n)){if(xj)return xj(t,n).value}else return;return t[n]},IB=function e(){var t,n,r,i,a,l,s=arguments[0],c=1,u=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},c=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=Sj(s,n),i=Sj(t,n),s!==i&&(f&&i&&(wj(i)||(a=bj(i)))?(a?(a=!1,l=r&&bj(r)?r:[]):l=r&&wj(r)?r:{},jj(s,{name:n,newValue:e(f,l,i)})):typeof i<"u"&&jj(s,{name:n,newValue:i}));return s};const Um=zr(IB);function Av(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 NB(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);s(null,...i);function s(c,...u){const f=e[++a];let d=-1;if(c){l(c);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,f?_B(f,s)(...u):l(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 _B(e,t){let n;return r;function r(...l){const s=e.length>l.length;let c;s&&l.push(i);try{c=e.apply(this,l)}catch(u){const f=u;if(s&&n)throw f;return i(f)}s||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(l,...s){n||(n=!0,t(l,...s))}function a(l){i(null,l)}}const fi={basename:MB,dirname:RB,extname:DB,join:LB,sep:"/"};function MB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cu(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 l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function RB(e){if(cu(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 DB(e){cu(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===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 LB(...e){let t=-1,n;for(;++t<e.length;)cu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zB(n)}function zB(e){cu(e);const t=e.codePointAt(0)===47;let n=$B(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function $B(e,t){let n="",r=0,i=-1,a=0,l=-1,s,c;for(;++l<=e.length;){if(l<e.length)s=e.codePointAt(l);else{if(s===47)break;s=47}if(s===47){if(!(i===l-1||a===1))if(i!==l-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=l,a=0;continue}}else if(n.length>0){n="",r=0,i=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,a=0}else s===46&&a>-1?a++:a=-1}return n}function cu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const BB={cwd:FB};function FB(){return"/"}function Iv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function UB(e){if(typeof e=="string")e=new URL(e);else if(!Iv(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 WB(e)}function WB(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 Wm=["history","path","basename","stem","extname","dirname"];class KT{constructor(t){let n;t?Iv(t)?n={path:t}:typeof t=="string"||KB(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":BB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Wm.length;){const a=Wm[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)Wm.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?fi.basename(this.path):void 0}set basename(t){qm(t,"basename"),Km(t,"basename"),this.path=fi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fi.dirname(this.path):void 0}set dirname(t){kj(this.basename,"dirname"),this.path=fi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fi.extname(this.path):void 0}set extname(t){if(Km(t,"extname"),kj(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=fi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Iv(t)&&(t=UB(t)),qm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fi.basename(this.path,this.extname):void 0}set stem(t){qm(t,"stem"),Km(t,"stem"),this.path=fi.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 zn(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 Km(e,t){if(e&&e.includes(fi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fi.sep+"`")}function qm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function kj(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qB=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},HB={}.hasOwnProperty;class qx extends qB{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=NB()}copy(){const t=new qx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Um(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ym("data",this.frozen),this.namespace[t]=n,this):HB.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ym("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=cd(t),r=this.parser||this.Parser;return Hm("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Hm("process",this.parser||this.Parser),Vm("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,l){const s=cd(t),c=r.parse(s);r.run(c,s,function(f,d,p){if(f||!d||!p)return u(f);const m=d,g=r.stringify(m,p);GB(g)?p.value=g:p.result=g,u(f,p)});function u(f,d){f||!d?l(f):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Hm("processSync",this.parser||this.Parser),Vm("processSync",this.compiler||this.Compiler),this.process(t,i),Pj("processSync","process",n),r;function i(a,l){n=!0,vj(a),r=l}}run(t,n,r){Cj(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(l,s){const c=cd(n);i.run(t,c,u);function u(f,d,p){const m=d||t;f?s(f):l?l(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Pj("runSync","run",r),i;function a(l,s){vj(l),i=s,r=!0}}stringify(t,n){this.freeze();const r=cd(n),i=this.compiler||this.Compiler;return Vm("stringify",i),Cj(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Ym("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):l(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[f,...d]=u;c(f,d)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(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");s(u.plugins),u.settings&&(i.settings=Um(!0,i.settings,u.settings))}function s(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const d=u[f];a(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,f){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===u){p=d;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[m,...g]=f;const y=r[p][1];Av(y)&&Av(m)&&(m=Um(!0,y,m)),r[p]=[u,m,...g]}}}}const VB=new qx().freeze();function Hm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Vm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ym(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 Cj(e){if(!Av(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Pj(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function cd(e){return YB(e)?e:new KT(e)}function YB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function GB(e){return typeof e=="string"||XB(e)}function XB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ej=[],Tj={allowDangerousHtml:!0},JB=/^(https?|ircs?|mailto|xmpp)$/i,ZB=[{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 gc(e){const t=e8(e),n=t8(e);return n8(t.runSync(t.parse(n),n),e)}function e8(e){const t=e.rehypePlugins||Ej,n=e.remarkPlugins||Ej,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Tj}:Tj;return VB().use(M3).use(n).use(AB,r).use(t)}function t8(e){const t=e.children||"",n=new KT;return typeof t=="string"&&(n.value=t),n}function n8(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||r8;for(const f of ZB)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+QB+f.id,void 0);return UT(e,u),p$(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(f,d,p){if(f.type==="raw"&&p&&typeof d=="number")return l?p.children.splice(d,1):p.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let m;for(m in $m)if(Object.hasOwn($m,m)&&Object.hasOwn(f.properties,m)){const g=f.properties[m],y=$m[m];(y===null||y.includes(f.tagName))&&(f.properties[m]=c(String(g||""),m,f))}}if(f.type==="element"){let m=n?!n.includes(f.tagName):a?a.includes(f.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(f,d,p)),m&&p&&typeof d=="number")return s&&f.children?p.children.splice(d,1,...f.children):p.children.splice(d,1),d}}}function r8(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||JB.test(e.slice(0,t))?e:""}const re=(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},ie=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 s=await r.text(),c=new Error(s||r.statusText);throw c.status=401,c}const a=await r.text();let l=null;try{const s=JSON.parse(a);s.error&&(l=s.error)}catch{}throw new Error(l||a||r.statusText)}return r.status===204?void 0:(r.headers.get("content-type")||"").includes("application/json")?r.json():r.text()},H={getAuthStatus:()=>ie(re("/api/auth/status")),login:e=>ie(re("/api/auth/login"),{method:"POST",body:JSON.stringify({authCode:e})}),checkVersion:()=>ie(re("/api/version/check")),getVendors:()=>ie(re("/api/vendors")),createVendor:e=>ie(re("/api/vendors"),{method:"POST",body:JSON.stringify(e)}),updateVendor:(e,t)=>ie(re(`/api/vendors/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteVendor:e=>ie(re(`/api/vendors/${e}`),{method:"DELETE"}),getAPIServices:e=>ie(re("/api/services",e?{vendorId:e}:void 0)),createAPIService:e=>ie(re("/api/services"),{method:"POST",body:JSON.stringify(e)}),updateAPIService:(e,t)=>ie(re(`/api/services/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAPIService:e=>ie(re(`/api/services/${e}`),{method:"DELETE"}),getRoutes:()=>ie(re("/api/routes")),createRoute:e=>ie(re("/api/routes"),{method:"POST",body:JSON.stringify(e)}),updateRoute:(e,t)=>ie(re(`/api/routes/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRoute:e=>ie(re(`/api/routes/${e}`),{method:"DELETE"}),getToolBindings:()=>ie(re("/api/tool-bindings")),activateToolRoute:(e,t)=>ie(re("/api/tool-bindings/activate"),{method:"POST",body:JSON.stringify({tool:e,routeId:t})}),deactivateToolRoute:e=>ie(re("/api/tool-bindings/deactivate"),{method:"POST",body:JSON.stringify({tool:e})}),getRules:e=>ie(re("/api/rules",e?{routeId:e}:void 0)),createRule:e=>ie(re("/api/rules"),{method:"POST",body:JSON.stringify(e)}),updateRule:(e,t)=>ie(re(`/api/rules/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRule:e=>ie(re(`/api/rules/${e}`),{method:"DELETE"}),resetRuleTokens:e=>ie(re(`/api/rules/${e}/reset-tokens`),{method:"PUT"}),resetRuleRequests:e=>ie(re(`/api/rules/${e}/reset-requests`),{method:"PUT"}),clearRuleBlacklist:e=>ie(re(`/api/rules/${e}/clear-blacklist`),{method:"PUT"}),toggleRuleDisable:e=>ie(re(`/api/rules/${e}/toggle-disable`),{method:"PUT"}),clearRuleStatus:e=>ie(re(`/api/rules/${e}/clear-status`),{method:"POST"}),getRuleStatuses:()=>ie(re("/api/rules/status")),getRulesBlacklistStatus:e=>ie(re(`/api/rules/${e}/blacklist-status`)),getLogs:(e,t)=>ie(re("/api/logs",{limit:e,offset:t})),clearLogs:()=>ie(re("/api/logs"),{method:"DELETE"}),getErrorLogs:(e,t)=>ie(re("/api/error-logs",{limit:e,offset:t})),clearErrorLogs:()=>ie(re("/api/error-logs"),{method:"DELETE"}),getLogsCount:()=>ie(re("/api/logs/count")),getErrorLogsCount:()=>ie(re("/api/error-logs/count")),searchLogs:(e,t,n)=>ie(re("/api/logs/search",{query:e,limit:t,offset:n})),searchLogsCount:e=>ie(re("/api/logs/search/count",{query:e})),searchErrorLogs:(e,t,n)=>ie(re("/api/error-logs/search",{query:e,limit:t,offset:n})),searchErrorLogsCount:e=>ie(re("/api/error-logs/search/count",{query:e})),getStatistics:(e=30)=>ie(re("/api/statistics",{days:e})),resetStatistics:()=>ie(re("/api/statistics"),{method:"DELETE"}),getConfig:()=>ie(re("/api/config")),updateConfig:e=>ie(re("/api/config"),{method:"PUT",body:JSON.stringify(e)}),exportData:async e=>(await ie(re("/api/export"),{method:"POST",body:JSON.stringify({password:e})})).data,previewImportData:(e,t)=>ie(re("/api/import/preview"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),importData:(e,t)=>ie(re("/api/import"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),writeClaudeConfig:(e,t)=>ie(re("/api/write-config/claude"),{method:"POST",body:JSON.stringify({enableAgentTeams:e,enableBypassPermissionsSupport:t})}),writeCodexConfig:e=>ie(re("/api/write-config/codex"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e})}),restoreClaudeConfig:()=>ie(re("/api/restore-config/claude"),{method:"POST"}),restoreCodexConfig:()=>ie(re("/api/restore-config/codex"),{method:"POST"}),updateClaudeAgentTeams:e=>ie(re("/api/update-claude-agent-teams"),{method:"POST",body:JSON.stringify({enableAgentTeams:e})}),updateClaudeBypassPermissionsSupport:e=>ie(re("/api/update-claude-bypass-permissions-support"),{method:"POST",body:JSON.stringify({enableBypassPermissionsSupport:e})}),updateCodexReasoningEffort:e=>ie(re("/api/update-codex-reasoning-effort"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e})}),checkClaudeBackup:()=>ie(re("/api/check-backup/claude")),checkCodexBackup:()=>ie(re("/api/check-backup/codex")),checkClaudeVersion:()=>ie(re("/api/tools/status")),getClaudeConfigStatus:()=>ie(re("/api/config-status/claude")),getCodexConfigStatus:()=>ie(re("/api/config-status/codex")),getSessions:(e,t)=>ie(re("/api/sessions",{limit:e,offset:t})),getSessionsCount:()=>ie(re("/api/sessions/count")),getSession:e=>ie(re(`/api/sessions/${e}`)),getSessionLogs:(e,t)=>ie(re(`/api/sessions/${e}/logs`,{limit:t})),deleteSession:e=>ie(re(`/api/sessions/${e}`),{method:"DELETE"}),clearSessions:()=>ie(re("/api/sessions"),{method:"DELETE"}),cleanupSessions:(e,t)=>ie(re("/api/sessions/cleanup"),{method:"POST",body:JSON.stringify({beforeDays:e,onlyLogs:t})}),getRecommendVendorsMarkdown:()=>ie(re("/api/docs/recommend-vendors")),getReadmeMarkdown:()=>ie(re("/api/docs/readme")),getInstalledSkills:()=>ie(re("/api/skills/installed")),searchSkills:e=>ie(re("/api/skills/search"),{method:"POST",body:JSON.stringify({query:e})}),getSkillDetails:e=>ie(re(`/api/skills/${e}/details`)),installSkill:(e,t)=>ie(re("/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)=>ie(re(`/api/skills/${e}/enable`),{method:"POST",body:JSON.stringify({targetType:t})}),disableSkill:(e,t)=>ie(re(`/api/skills/${e}/disable`),{method:"POST",body:JSON.stringify({targetType:t})}),deleteSkill:e=>ie(re(`/api/skills/${e}`),{method:"DELETE"}),createLocalSkill:e=>ie(re("/api/skills/create-local"),{method:"POST",body:JSON.stringify(e)}),getUpgradeMarkdown:()=>ie(re("/api/docs/upgrade")),getUpgrade:()=>ie(re("/api/upgrade")),acknowledgeUpgrade:()=>ie(re("/api/upgrade/ack"),{method:"POST"}),getToolsStatus:()=>ie(re("/api/tools/status")),getMCPs:()=>ie(re("/api/mcps")),getMCP:e=>ie(re(`/api/mcps/${e}`)),createMCP:e=>ie(re("/api/mcps"),{method:"POST",body:JSON.stringify(e)}),updateMCP:(e,t)=>ie(re(`/api/mcps/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteMCP:e=>ie(re(`/api/mcps/${e}`),{method:"DELETE"}),bindSessionRoute:(e,t)=>ie(re(`/api/sessions/${e}/bind-route`),{method:"PUT",body:JSON.stringify({routeId:t})}),unbindSessionRoute:e=>ie(re(`/api/sessions/${e}/bind-route`),{method:"DELETE"}),getBoundSessions:e=>ie(re(`/api/routes/${e}/bound-sessions`)),migrationPreview:(e,t)=>ie(re(`/api/sessions/${e}/migration-preview`),{method:"POST",body:JSON.stringify(t)}),migrateSession:(e,t)=>ie(re(`/api/sessions/${e}/migrate`),{method:"POST",body:JSON.stringify(t)}),migrateLaunch:(e,t)=>ie(re(`/api/sessions/${e}/migrate-launch`),{method:"POST",body:JSON.stringify(t)}),getApiPathBindings:()=>ie(re("/api/api-path-bindings")),updateApiPathBindings:(e,t)=>ie(re("/api/api-path-bindings"),{method:"PUT",body:JSON.stringify({bindings:e,models:t})}),installTool:(e,t)=>{var u;console.log("[API Client] 开始安装工具:",e);const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,i=`${n}//${r}/api/tools/install`;console.log("[API Client] 连接 WebSocket:",i);let a=null;try{a=new WebSocket(i)}catch(f){return console.error("[API Client] 创建 WebSocket 失败:",f),(u=t.onError)==null||u.call(t,"创建 WebSocket 连接失败"),()=>{}}a.onopen=()=>{console.log("[API Client] WebSocket 连接已建立"),a==null||a.send(JSON.stringify({type:"install",tool:e}))},a.onmessage=f=>{var d,p,m,g,y,x,v,b,w;try{const j=JSON.parse(f.data);switch(console.log("[API Client] 收到消息:",j.type),j.type){case"start":console.log("[API Client] 安装开始:",j.data),(d=t.onStdout)==null||d.call(t,`
81
- ========== 开始安装 ${j.data.tool} ==========
82
- `),(p=t.onStdout)==null||p.call(t,`操作系统: ${j.data.os}
83
- `),(m=t.onStdout)==null||m.call(t,`执行命令: ${j.data.command}
84
- `),(g=t.onStdout)==null||g.call(t,`子进程已创建 (PID: ${j.data.pid})
85
- `),(y=t.onStdout)==null||y.call(t,`等待 npm 输出...
86
-
87
- `);break;case"stdout":(x=t.onStdout)==null||x.call(t,j.data);break;case"stderr":(v=t.onStderr)==null||v.call(t,j.data);break;case"close":console.log("[API Client] 安装完成:",j.data),(b=t.onClose)==null||b.call(t,j.data.code,j.data.success),setTimeout(()=>{a==null||a.close()},1e3);break;case"error":console.error("[API Client] 安装错误:",j.data),(w=t.onError)==null||w.call(t,j.data);break}}catch(j){console.error("[API Client] 解析消息失败:",j,f.data)}},a.onclose=f=>{var d;console.log("[API Client] WebSocket 连接关闭:",f.code,f.reason),f.wasClean||(d=t.onError)==null||d.call(t,"连接意外关闭")},a.onerror=f=>{var d;console.error("[API Client] WebSocket 错误:",f),(d=t.onError)==null||d.call(t,"WebSocket 连接错误")};const l=()=>{console.log("[API Client] 清理 WebSocket 连接"),a&&(a.close(),a=null)},s=f=>{a&&a.readyState===WebSocket.OPEN?(a.send(JSON.stringify({type:"input",data:f})),console.log("[API Client] 发送输入:",f.slice(0,10))):console.warn("[API Client] WebSocket 未连接,无法发送输入")},c=l;return c.sendInput=s,c},getAccessKeys:e=>ie(re("/api/access-keys",e)),createAccessKey:e=>ie(re("/api/access-keys"),{method:"POST",body:JSON.stringify(e)}),getAccessKey:e=>ie(re(`/api/access-keys/${e}`)),updateAccessKey:(e,t)=>ie(re(`/api/access-keys/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAccessKey:e=>ie(re(`/api/access-keys/${e}`),{method:"DELETE"}),regenerateAccessKey:e=>ie(re(`/api/access-keys/${e}/regenerate`),{method:"POST"}),batchUpdateAccessKeyStatus:(e,t)=>ie(re("/api/access-keys/batch/status"),{method:"PUT",body:JSON.stringify({keyIds:e,status:t})}),batchBindAccessKeyPolicy:(e,t)=>ie(re("/api/access-keys/batch/policy"),{method:"PUT",body:JSON.stringify({keyIds:e,policyId:t})}),batchDeleteAccessKeys:e=>ie(re("/api/access-keys/batch"),{method:"DELETE",body:JSON.stringify({keyIds:e})}),getAccessKeyUsage:e=>ie(re(`/api/access-keys/${e}/usage`)),getAccessKeyUsageTrend:(e,t)=>ie(re(`/api/access-keys/${e}/usage/trend`,{days:t})),getAccessKeyLogs:(e,t)=>ie(re(`/api/access-keys/${e}/logs`,t)),getAccessKeySessions:(e,t)=>ie(re(`/api/access-keys/${e}/sessions`,t)),getAccessKeySession:(e,t)=>ie(re(`/api/access-keys/${e}/sessions/${t}`)),getAccessKeySessionLogs:(e,t,n)=>ie(re(`/api/access-keys/${e}/sessions/${t}/logs`,{limit:n})),deleteAccessKeySession:(e,t)=>ie(re(`/api/access-keys/${e}/sessions/${t}`),{method:"DELETE"}),clearAccessKeySessions:e=>ie(re(`/api/access-keys/${e}/sessions`),{method:"DELETE"}),getAccessKeyGuide:(e,t,n)=>ie(re(`/api/access-keys/${e}/guide`,{host:t,port:n})),writeAccessKeyToLocal:(e,t)=>ie(re(`/api/access-keys/${e}/write-local`),{method:"POST",body:JSON.stringify({targets:t})}),getWriteLocalRecords:()=>ie(re("/api/write-local-records")),getPolicies:()=>ie(re("/api/policies")),createPolicy:e=>ie(re("/api/policies"),{method:"POST",body:JSON.stringify(e)}),getPolicy:e=>ie(re(`/api/policies/${e}`)),updatePolicy:(e,t)=>ie(re(`/api/policies/${e}`),{method:"PUT",body:JSON.stringify(t)}),deletePolicy:e=>ie(re(`/api/policies/${e}`),{method:"DELETE"}),duplicatePolicy:e=>ie(re(`/api/policies/${e}/duplicate`),{method:"POST"}),getPolicyKeys:e=>ie(re(`/api/policies/${e}/keys`)),getPolicyTemplates:()=>ie(re("/api/policies/templates")),getAccessKeyRanking:e=>ie(re("/api/statistics/access-keys",e)),getQuotaAlerts:()=>ie(re("/api/statistics/quota-alerts")),lanScan:()=>ie(re("/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=>ie(re("/api/lan/sync"),{method:"POST",body:JSON.stringify(e)})};var Zt=(e=>(e.AUTH_TOKEN="authorization",e.API_KEY="x-api-key",e.G_API_KEY="x-goog-api-key",e))(Zt||{});const In={aicodingbus:{name:"AICodingBus",description:"AICodingBus 是一个Token共享平台,用户可以在平台上分享和交换Token。",tags:["官方推荐"],link:"https://aicodingbus.24x7.to/",services:[{name:"Claude 标准接口",sourceType:"claude",apiUrl:"https://aicodingbus.24x7.to/v1",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/v1",models:""}],sortedGroup:-1},minimax:{name:"Minimax",description:"国内优秀的大模型",link:"https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link",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",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/",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/",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",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",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",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",services:[{name:"GPT官方接口",sourceType:"openai",apiUrl:"https://api.openai.com"}],sortedGroup:3},anthropic:{name:"Anthropic",description:"Anthropic 官方 API",link:"https://www.anthropic.com",services:[{name:"Claude官方接口",sourceType:"claude",apiUrl:"https://api.anthropic.com"}],sortedGroup:3},google:{name:"Google AI",description:"Gemini官方接口",services:[{name:"Gemini",sourceType:"gemini",apiUrl:"https://generativelanguage.googleapis.com"}],sortedGroup:3},openrouter:{name:"OpenRouter",description:"一站式 AI 模型路由平台",link:"https://openrouter.ai",services:[{name:"Claude Code专属接口",sourceType:"claude",apiUrl:"https://openrouter.ai/api",models:"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:"anthropic/claude-opus-4.6, anthropic/claude-sonnet-4.6, anthropic/claude-haiku-4.6, openai/gpt-5.3-codex, openai/gpt-5.4, openai/gpt-5.5, openai/gpt-5.4-mini, google/gemini-3-flash-preview, google/gemini-3-pro-preview"},{name:"Claude 标准接口",sourceType:"claude",apiUrl:"https://openrouter.ai/api",models:"anthropic/claude-opus-4.6, anthropic/claude-sonnet-4.6, anthropic/claude-haiku-4.6, openai/gpt-5.3-codex, openai/gpt-5.4, openai/gpt-5.5, openai/gpt-5.4-mini, google/gemini-3-flash-preview, google/gemini-3-pro-preview",authType:Zt.AUTH_TOKEN}],sortedGroup:3},agnes:{name:"Agnes",description:"优秀的模型厂商,拥有多种模型,提供免费 API 使用",tags:["永久免费"],link:"https://platform.agnes-ai.com",services:[{name:"Chat Completions 标准接口(免费)",sourceType:"openai-chat",apiUrl:"https://apihub.agnes-ai.com/v1/chat/completions",models:"agnes-2.0-flash, agnes-1.5-flash",authType:Zt.AUTH_TOKEN}],sortedGroup:-1}},Yl={"claude-code":"Claude Code",codex:"Codex"},ud={claude:"Claude","claude-chat":"Claude Chat",openai:"OpenAI","openai-chat":"OpenAI Chat",gemini:"Gemini","gemini-chat":"Gemini Chat"},i8={"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}会在实际运行时被替换,你只需要按此处的格式填写即可"},dd={[Zt.AUTH_TOKEN]:"AUTH_TOKEN",[Zt.API_KEY]:"API_KEY",[Zt.G_API_KEY]:"GOOGLE_API_KEY"},Gm={[Zt.AUTH_TOKEN]:"使用 Authorization: Bearer <token> 进行认证",[Zt.API_KEY]:"使用 x-api-key: <token> 进行认证",[Zt.G_API_KEY]:"使用 x-goog-api-key: <token> 进行认证"},a8=`#### 🚀 智谱 GLM Coding Plan
88
-
89
- > 价格便宜,国内速度快,支持多工具(Claude Code等 20+ 大编程工具),而且其中的GLM-4.7是目前国内最强编程模型。适合对模型有一定要求,同时又无法获取国外模型的朋友入手。
90
- >
91
- > 链接:[https://www.bigmodel.cn](https://www.bigmodel.cn/invite?icode=kgOTGFRH%2Ftc5Xkyu5N0wHOnfet45IvM%2BqDogImfeLyI%3D) | [一键配置](# "glm")
92
-
93
- #### 🌌 MiniMax Coding Plan
94
-
95
- > 国内优秀的大模型,支持Claude Code和Codex等编程工具,其中 M2.1 模型在大模型评测中获得非常高的分数。可作为国内大模型的备选方案。
96
- > 链接:[https://platform.minimaxi.com/subscribe/coding-plan](https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link) | [一键配置](# "minimax")
97
-
98
- #### 🧠 Mimo Coding Plan
99
-
100
- > 小米旗下 Mimo 国产大模型,支持 Claude Code 和 Codex 等编程工具,提供 Coding Plan 和付费 API 两种模式,涵盖 mimo-v2.5-pro、mimo-v2-pro、mimo-v2.5、mimo-v2-omni、mimo-v2-flash 等多个模型,性价比出色。
101
- > 链接:[https://platform.xiaomimimo.com](https://platform.xiaomimimo.com?ref=M8BFP3) | [一键配置](# "mimo")
102
- `;function qT(e,t){let n,r;const i=a=>a.replace(/!\[.*?\]\(.*?\)/g,l=>{var c;const s=(c=l.match(/\((.*?)\)/))==null?void 0:c[1];if((s==null?void 0:s.indexOf("public/"))===0){const u=s.replace("public/","/");return l.replace(s,u)}else return l});return function(){const[a,l]=h.useState(i(e));return h.useEffect(()=>{if(r){l(i(r));return}const s=c=>{c&&(r=c,l(i(c)))};n?n.then(s).catch(()=>{}):n=t().then(s).catch(()=>{})},[]),a}}const o8=qT(a8,H.getRecommendVendorsMarkdown),l8=qT("",H.getUpgradeMarkdown),HT=h.createContext(void 0);function uu(){const e=h.useContext(HT);if(!e)throw new Error("useConfirm must be used within ConfirmProvider");return e}let ro=null;function s8({children:e}){const[t,n]=h.useState(!1),[r,i]=h.useState({message:""}),a=f=>(i(f),n(!0),new Promise(d=>{ro=d})),l=()=>{n(!1),ro&&(ro(!0),ro=null)},s=()=>{n(!1),ro&&(ro(!1),ro=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(HT.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:s,children:r.cancelText||"取消"}),o.jsx("button",{className:`btn ${u.buttonClass}`,onClick:l,children:r.confirmText||"确认"})]})]})})})]})}let c8=0;const Nv=new Set;let Ef=[];function VT(){Nv.forEach(e=>e([...Ef]))}function fd(e,t,n=3e3){const r=++c8,i={id:r,message:e,type:t,duration:n};return Ef.push(i),VT(),n>0&&setTimeout(()=>{YT(r)},n),r}function YT(e){Ef=Ef.filter(t=>t.id!==e),VT()}const U={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 u8(){const[e,t]=h.useState([]);h.useEffect(()=>(Nv.add(t),()=>{Nv.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:`
103
- @keyframes slideIn {
104
- from {
105
- transform: translateX(50px);
106
- opacity: 0;
107
- }
108
- to {
109
- transform: translateX(0);
110
- opacity: 1;
111
- }
112
- }
113
- `}),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:()=>YT(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 GT({value:e,onChange:t,existingVendors:n=[],disabled:r=!1}){const[i,a]=h.useState(!1),l=h.useRef(null);h.useEffect(()=>{if(!i)return;const u=f=>{l.current&&!l.current.contains(f.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[i]);const s=h.useMemo(()=>{const u=Object.entries(In).map(([p,m])=>({key:p,name:m.name,sortedGroup:m.sortedGroup??0}));u.sort((p,m)=>p.sortedGroup-m.sortedGroup);const f=[];let d=null;for(const p of u)d!==null&&p.sortedGroup!==d&&f.push(null),f.push(p),d=p.sortedGroup;return f},[]),c=e?In[e]:null;return o.jsxs("div",{ref:l,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:s.map((u,f)=>{var g;if(!u)return o.jsx("div",{style:{height:"1px",background:"var(--border-primary)"}},`sep-${f}`);const d=In[u.key],p=n.some(y=>y.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)":p?"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:y=>{m||(y.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:y=>{m||(y.currentTarget.style.background=p?"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((y,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:y},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:p?"rgba(255, 167, 38, 0.15)":"rgba(76, 175, 80, 0.15)",color:p?"#e67e22":"#4caf50"},children:p?"已配置":"可用"})]},u.key)})})]})}function Oj(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 d8({value:e=[],onChange:t,placeholder:n,inputValue:r,onInputChange:i}){const a=s=>{if(s.key==="Enter"||s.key===","){s.preventDefault();const c=r.trim();c&&!e.includes(c)&&(t([...e,c]),i(""))}else s.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1))},l=s=>{t(e.filter((c,u)=>u!==s))};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((s,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:[s,o.jsx("button",{type:"button",onClick:()=>l(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:s=>i(s.target.value),onKeyDown:a,placeholder:n,style:{border:"none",outline:"none",flex:"1",minWidth:"120px",fontSize:"14px"}})]})})}function f8(){var ct,fn;const{confirm:e}=uu(),t=h.useRef(null),[n,r]=h.useState([]),[i,a]=h.useState(null),[l,s]=h.useState(!1),[c,u]=h.useState(!1),[f,d]=h.useState(!1),[p,m]=h.useState(!1),[g,y]=h.useState(null),[x,v]=h.useState(null),[b,w]=h.useState([]),[j,C]=h.useState(""),[S,E]=h.useState({}),[I,R]=h.useState(!1),[A,_]=h.useState(void 0),[N,Y]=h.useState(void 0),[K,O]=h.useState(void 0),[F,W]=h.useState(!1),[M,B]=h.useState(void 0),[k,L]=h.useState(void 0),[X,T]=h.useState(void 0),[ce,ge]=h.useState("openai-chat"),[Q,ae]=h.useState(!1),[fe,te]=h.useState(Zt.AUTH_TOKEN),[ee,le]=h.useState(""),[ne,Ae]=h.useState(!0),[be,Re]=h.useState(!0),[$e,xe]=h.useState(!0),Ie=V=>{if(ge(V),$e)return;let me;V==="gemini"||V==="gemini-chat"?me=Zt.G_API_KEY:V==="claude-chat"||V==="claude"?me=Zt.API_KEY:me=Zt.AUTH_TOKEN,te(me),t.current&&(t.current.value=me)},[Te,Ve]=h.useState(""),[Ge,Ke]=h.useState([]),[gt,Nt]=h.useState(""),Z=o8();h.useEffect(()=>{G()},[]),h.useEffect(()=>{const V=new Set(b),me={};Object.entries(S).forEach(([_e,nt])=>{V.has(_e)&&(me[_e]=nt)}),Object.keys(me).length!==Object.keys(S).length&&E(me)},[b]);const G=async()=>{const V=await H.getVendors();return r(V),V.length>0&&!i&&a(V[0]),V},oe=()=>{y(null),le(""),s(!0)},D=()=>{d(!0)},se=V=>{y(V),le(V.authType||""),s(!0)},he=async V=>{if(await e({message:"确定要删除此供应商吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const we=await H.getRules(),_e=(V.services||[]).map(bt=>bt.id),nt=we.filter(bt=>_e.includes(bt.targetServiceId)).length;if(!await e({message:`二次确认:删除供应商“${V.name}”后,将同时删除关联的 ${nt} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await H.deleteVendor(V.id),G(),i&&i.id===V.id&&a(null),U.success(`供应商已删除,关联规则清理 ${nt} 条`)}catch(we){const _e=we instanceof Error?we.message:"删除失败";U.error(_e)}},Ee=async V=>{V.preventDefault();const me=new FormData(V.currentTarget),we={name:me.get("name"),description:me.get("description"),apiKey:me.get("apiKey")||"",apiBaseUrl:me.get("apiBaseUrl")||"",authType:me.get("authType")||void 0,sortOrder:parseInt(me.get("sortOrder"))||0};g?await H.updateVendor(g.id,we):await H.createVendor({...we,services:[]}),s(!1);const _e=await G();if(i){const nt=_e.find(Ze=>Ze.id===i.id);nt&&a(nt)}},Pe=()=>{v(null),w([]),C(""),E({}),R(!1),_(void 0),Y(void 0),O(void 0),W(!1),B(void 0),L(void 0),T(void 0),ge("openai-chat"),te((i==null?void 0:i.authType)||Zt.AUTH_TOKEN),Ae(!!(i!=null&&i.apiKey)),Re(!!(i!=null&&i.apiBaseUrl)),xe(!!(i!=null&&i.authType)),ae(!1),u(!0)},De=V=>{v(V),w(V.supportedModels||[]),C(""),E(V.modelLimits||{}),R(V.enableTokenLimit||!1),_(V.tokenLimit),Y(V.tokenResetInterval),O(V.tokenResetBaseTime?new Date(V.tokenResetBaseTime):void 0),W(V.enableRequestLimit||!1),B(V.requestCountLimit),L(V.requestResetInterval),T(V.requestResetBaseTime?new Date(V.requestResetBaseTime):void 0);const me=V.sourceType||"openai-chat";if(ge(me),Ae(V.inheritVendorApiKey===!0),Re(V.inheritVendorApiBaseUrl===!0),xe(V.inheritVendorAuthType===!0),V.inheritVendorAuthType===!0){const we=(i==null?void 0:i.authType)||Zt.AUTH_TOKEN;te(we)}else if(V.authType)te(V.authType);else{let we;me==="gemini"||me==="gemini-chat"?we=Zt.G_API_KEY:me==="claude-chat"||me==="claude"?we=Zt.API_KEY:we=Zt.AUTH_TOKEN,te(we)}ae(V.isDowngradeCompatibility===!0),u(!0)},Le=async V=>{if(await e({message:"确定要删除此API服务吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const _e=(await H.getRules()).filter(bt=>bt.targetServiceId===V).length;if(!await e({message:`二次确认:删除该 API 服务后,将同时删除关联的 ${_e} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await H.deleteAPIService(V);const Ze=await G();if(i){const bt=Ze.find(jn=>jn.id===i.id);bt&&a(bt)}U.success(`API服务已删除,关联规则清理 ${_e} 条`)}catch(we){const _e=we instanceof Error?we.message:"删除失败";U.error(_e)}},We=async V=>{V.preventDefault();let me=[...b];if(j.trim()){const hn=j.split(",").map(ft=>ft.trim()).filter(ft=>ft&&!me.includes(ft));me=[...me,...hn]}const we=new FormData(V.currentTarget),_e=we.get("sourceType"),nt=we.get("inheritVendorApiBaseUrl")==="on",Ze=(we.get("apiUrl")||"").trim(),bt=nt?(x==null?void 0:x.apiUrl)||"":Ze,jn=we.get("inheritVendorApiKey")==="on",Qt=we.get("apiKey")||"",wr=jn?(x==null?void 0:x.apiKey)||"":Qt,Xn=we.get("inheritVendorAuthType")==="on",pn={};Object.entries(S).forEach(([hn,ft])=>{hn&&ft&&ft>0&&(pn[hn]=ft)});const $t={vendorId:i.id,name:we.get("name"),apiUrl:bt,apiKey:wr,inheritVendorApiKey:jn,inheritVendorApiBaseUrl:nt,inheritVendorAuthType:Xn,sourceType:_e,authType:Xn?(x==null?void 0:x.authType)||void 0:we.get("authType")||void 0,supportedModels:me.length>0?me:void 0,modelLimits:Object.keys(pn).length>0?pn:void 0,enableProxy:we.get("enableProxy")==="on",enableCodingPlan:we.get("enableCodingPlan")==="on",isDowngradeCompatibility:ce==="openai"?Q:void 0,enableTokenLimit:I,tokenLimit:A,tokenResetInterval:N,tokenResetBaseTime:K?K.getTime():void 0,enableRequestLimit:F,requestCountLimit:M,requestResetInterval:k,requestResetBaseTime:X?X.getTime():void 0};x?await H.updateAPIService(x.id,$t):await H.createAPIService($t),u(!1),w([]),C(""),E({}),R(!1),_(void 0),Y(void 0),O(void 0),W(!1),B(void 0),L(void 0),T(void 0),Ae(!0),Re(!0),ae(!1);const jr=await G();if(i){const hn=jr.find(ft=>ft.id===i.id);hn&&a(hn)}},Be=V=>{if(V){Ve(V);const me=In[V];me&&me.services.length>0&&Ke(me.services.map((we,_e)=>_e))}else Ve(""),Ke([]);Nt(""),m(!0)},Xe=async V=>{V.preventDefault();const me=new FormData(V.currentTarget),we=me.get("vendorKey"),_e=me.get("apiKey");if(!we||!_e){U.warning("请填写完整信息");return}if(Ge.length===0){U.warning("请至少选择一个源类型");return}const nt=In[we];if(!nt){U.error("未找到对应的供应商配置");return}try{const Ze=await H.createVendor({name:nt.name,description:nt.description,apiKey:_e,sortOrder:0,services:[]});if(console.log("[一键配置] 供应商创建成功:",Ze),console.log("[一键配置] 供应商 ID:",Ze==null?void 0:Ze.id),!Ze||!Ze.id)throw console.error("[一键配置] 供应商创建失败或缺少 ID:",Ze),new Error("供应商创建失败,缺少 ID");const bt=nt.services.filter(($t,jr)=>Ge.includes(jr));if(console.log("[一键配置] 准备创建服务:",bt.length,"个"),console.log("[一键配置] vendorId:",Ze.id),bt.length===0)throw new Error("没有选择任何服务");const jn=bt.map(async($t,jr)=>{const hn={vendorId:Ze.id,name:$t.name,apiUrl:$t.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:$t.sourceType,authType:$t.authType,supportedModels:$t.models?$t.models.split(",").map(Ii=>Ii.trim()):void 0,modelLimits:$t.modelLimits||{},enableCodingPlan:!0};console.log(`[一键配置] 创建服务 ${jr+1}/${bt.length}:`,{...hn,apiKey:"***"});const ft=await H.createAPIService(hn);return console.log(`[一键配置] 服务 ${jr+1} 创建成功,ID:`,ft.id),ft.vendorId||console.error(`[一键配置] 警告:服务 ${ft.id} 缺少 vendorId!`),ft}),Qt=await Promise.all(jn);console.log("[一键配置] 所有服务创建完成,数量:",Qt.length);const wr=Qt.filter($t=>!$t.vendorId);if(wr.length>0)throw console.error("[一键配置] 发现缺少 vendorId 的服务:",wr),new Error(`有 ${wr.length} 个服务缺少 vendorId`);const pn=(await G()).find($t=>$t.id===Ze.id);a(pn||{...Ze,services:Qt}),m(!1),U.success(`配置成功! 已创建 ${Ge.length} 个API服务`)}catch(Ze){console.error("一键配置失败:",Ze),U.error(`配置失败: ${Ze instanceof Error?Ze.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:D,children:"推荐"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>Be(),children:"一键配置"}),o.jsx("button",{className:"btn btn-primary",onClick:oe,children:"新增"})]})]}),n.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无供应商"})}):o.jsx("div",{style:{marginTop:"10px"},children:n.map(V=>o.jsx("div",{onClick:()=>a(V),style:{padding:"12px",marginBottom:"8px",backgroundColor:i&&i.id===V.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:V.name}),V.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:V.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:me=>{me.stopPropagation(),se(V)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:me=>{me.stopPropagation(),he(V)},children:"删除"})]})]})},V.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:Pe,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(V=>{var me;return o.jsxs("tr",{children:[o.jsx("td",{children:V.name}),o.jsx("td",{children:V.sourceType?ud[V.sourceType]:"-"}),o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:V.apiUrl,children:V.apiUrl}),o.jsx("td",{children:(me=V.supportedModels)!=null&&me.length?`${V.supportedModels.length}个`:"*"}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>De(V),children:"编辑"}),o.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>Le(V.id),children:"删除"})]})})]},V.id)})})]}):o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"请先选择一个供应商"})})]})]}),l&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>s(!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:Ee,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:V=>le(V.target.value),children:[o.jsx("option",{value:"",disabled:!0,children:"无"}),Object.keys(dd).map(V=>o.jsx("option",{value:V,children:dd[V]},V))]}),ee&&Gm[ee]&&o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Gm[ee]})]}),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:()=>s(!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:We,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:V=>Ie(V.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择源类型"}),Object.keys(ud).map(V=>o.jsx("option",{value:V,children:ud[V]},V))]}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:i8[ce]||""}),ce==="openai"&&o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",marginTop:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:Q,onChange:V=>ae(V.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:be,onChange:V=>Re(V.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API地址"})]}),!be&&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:ne,onChange:V=>Ae(V.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API密钥"})]}),!ne&&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:$e,onChange:V=>xe(V.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API认证方式"})]}),!$e&&o.jsxs(o.Fragment,{children:[o.jsx("select",{ref:t,name:"authType",defaultValue:x?x.authType||Zt.AUTH_TOKEN:fe,onChange:V=>te(V.target.value),children:Object.keys(dd).map(V=>o.jsx("option",{value:V,children:dd[V]},V))}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Gm[fe]||""})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"支持的模型列表"}),o.jsx(d8,{value:b,onChange:w,inputValue:j,onInputChange:C,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(V=>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:[V,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[V]||"",onChange:me=>{const we=me.target.value;if(we===""){const _e={...S};delete _e[V],E(_e)}else E({...S,[V]:parseInt(we)||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 me={...S};delete me[V],E(me)},style:{padding:"4px 8px",fontSize:"12px"},title:"移除此限制(模型仍在支持列表中)",children:"移除限制"})]},`sync-${V}`))]}),Object.keys(S).length>0&&o.jsx("div",{children:Object.entries(S).filter(([V])=>!b.includes(V)).map(([V,me])=>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:V,onChange:we=>{const _e={...S},nt=we.target.value;delete _e[V],_e[nt]=me,E(_e)},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:me,onChange:we=>{E({...S,[V]:parseInt(we.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 we={...S};delete we[V],E(we)},style:{padding:"4px 8px",fontSize:"12px"},children:"删除"})]},`custom-${V}`))})]}),o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>{const V=`model-${Date.now()}`;E({...S,[V]: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:I,onChange:V=>R(V.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Token超量限制"})]})}),I&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token超量值(单位:k)"}),o.jsx("input",{type:"number",value:A||"",onChange:V=>_(V.target.value?parseInt(V.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:N||"",onChange:V=>Y(V.target.value?parseInt(V.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:K?Oj(K):"",onChange:V=>{V.target.value?O(new Date(V.target.value)):O(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:F,onChange:V=>W(V.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"})]})}),F&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量值"}),o.jsx("input",{type:"number",value:M||"",onChange:V=>B(V.target.value?parseInt(V.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:k||"",onChange:V=>L(V.target.value?parseInt(V.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:X?Oj(X):"",onChange:V=>{V.target.value?T(new Date(V.target.value)):T(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:"保存"})]})]})]})})]}),f&&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(gc,{components:{a:({href:V,children:me,title:we})=>we&&In[we]?o.jsx("a",{href:"#",style:{color:"#2563EB",borderBottom:"solid 1px #2563EB",cursor:"pointer"},onClick:_e=>{_e.preventDefault(),d(!1),Be(we)},children:me}):o.jsx("a",{href:V,style:{color:"#2563EB",borderBottom:"solid 1px #2563EB"},target:"_blank",rel:"noopener noreferrer",children:me})},children:Z})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>d(!1),children:"关闭"})})]})})]}),p&&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(GT,{value:Te,onChange:V=>{if(Ve(V),V){const me=In[V];me&&me.services.length>0&&Ke(me.services.map((we,_e)=>_e))}else Ke([])},existingVendors:n})]}),(ct=In[Te])!=null&&ct.description?o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[In[Te].description,In[Te].link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:In[Te].link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const V=new URL(In[Te].link);return V.protocol+"//"+V.hostname}catch{return In[Te].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:Te?(fn=In[Te])==null?void 0:fn.services.map((V,me)=>{const we=Ge.includes(me);return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:we?"var(--accent-light)":"transparent",border:`2px solid ${we?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease",position:"relative",overflow:"hidden"},onMouseEnter:_e=>{we||(_e.currentTarget.style.background="var(--bg-hover)",_e.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:_e=>{we||(_e.currentTarget.style.background="transparent",_e.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"checkbox",checked:we,onChange:_e=>{_e.target.checked?Ke([...Ge,me]):Ke(Ge.filter(nt=>nt!==me))},style:{width:"18px",height:"18px",marginRight:"12px",cursor:"pointer",accentColor:"var(--accent-primary)"}}),o.jsxs("span",{style:{fontSize:"14px",fontWeight:we?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[V.name," - ",ud[V.sourceType]]}),we&&o.jsx("span",{style:{marginLeft:"auto",fontSize:"16px",color:"var(--text-primary)"},children:"✓"})]},me)}):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:gt,onChange:V=>Nt(V.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:"确认配置"})]})]})]})})]})]})}const p8={1:"选择节点",2:"Skills",3:"MCP",4:"供应商",5:"确认同步"};function h8({show:e,onClose:t,onComplete:n}){const[r,i]=h.useState(1),[a,l]=h.useState(!1),[s,c]=h.useState({current:0,total:0}),[u,f]=h.useState([]),[d,p]=h.useState(null),[m,g]=h.useState(""),[y,x]=h.useState("4567"),[v,b]=h.useState(!1),[w,j]=h.useState([]),[C,S]=h.useState(""),[E,I]=h.useState(4567),[R,A]=h.useState("scan"),[_,N]=h.useState([]),[Y,K]=h.useState(new Set),[O,F]=h.useState([]),[W,M]=h.useState(new Set),[B,k]=h.useState({}),[L,X]=h.useState(!1),[T,ce]=h.useState(""),[ge,Q]=h.useState(!1),[ae,fe]=h.useState(!1),[te,ee]=h.useState(!1),le=h.useCallback(()=>{i(1),l(!1),c({current:0,total:0}),f([]),p(null),g(""),x("4567"),b(!1),N([]),K(new Set),F([]),M(new Set),k({}),X(!1),ce(""),Q(!1),fe(!1),ee(!1),j([]),S(""),I(4567),A("scan")},[]);h.useEffect(()=>{e&&(le(),ne())},[e]);const ne=async()=>{try{const D=await H.lanScan();j(D.networkInterfaces||[]),I(D.port),D.networkInterfaces.length<=1,S(D.subnet),Ae(D.subnet,D.port,D.localIp)}catch(D){console.error("[LAN Scan] 获取网络信息失败:",D)}},Ae=async(D,se,he)=>{l(!0),f([]),c({current:0,total:0});const Ee=Date.now();try{const Pe=[];for(let We=1;We<=254;We++){const Be=`${D}.${We}`;Be!==he&&Pe.push(Be)}c({current:0,total:Pe.length});const De=30,Le=[];for(let We=0;We<Pe.length;We+=De){const Be=Pe.slice(We,We+De),Xe=await Promise.allSettled(Be.map(async ct=>{const fn=await H.lanDiscover(ct,se);return{ip:ct,port:se,data:fn}}));for(const ct of Xe)ct.status==="fulfilled"&&Le.push(ct.value);f([...Le]),c({current:Math.min(We+De,Pe.length),total:Pe.length})}c({current:Pe.length,total:Pe.length})}catch(Pe){console.error("[LAN Scan] 扫描失败:",Pe)}finally{const Pe=Date.now()-Ee;Pe<1e3&&await new Promise(De=>setTimeout(De,1e3-Pe)),l(!1),fe(!0)}},be=D=>{S(D);const se=w.find(he=>he.subnet===D);se&&Ae(se.subnet,E,se.address)},Re=()=>{const D=w.find(se=>se.subnet===C);D&&(p(null),Ae(D.subnet,E,D.address))},$e=async()=>{if(m.trim()){b(!0);try{const D=parseInt(y)||4567,se=await H.lanDiscover(m.trim(),D),he={ip:m.trim(),port:D,data:se};f(Ee=>Ee.some(Pe=>Pe.ip===m.trim()&&Pe.port===D)?Ee:[...Ee,he]),p(he),U.success("连接成功")}catch{U.error("无法连接,请检查 IP 和端口")}finally{b(!1)}}},xe=async()=>{if(d){ee(!0);try{let D=[],se=[];try{D=await H.getInstalledSkills()}catch{}try{se=await H.getMCPs()}catch(Le){console.error("[LAN Sync] 获取本地 MCPs 失败,重复检测可能不准确:",Le)}const he=new Set(D.map(Le=>Le.name)),Ee=new Set(se.map(Le=>Le.name)),Pe=(d.data.skills||[]).map(Le=>({...Le,isDuplicate:he.has(Le.name)}));N(Pe);const De=(d.data.mcps||[]).map(Le=>({...Le,isDuplicate:Ee.has(Le.name)}));F(De),i(2)}finally{ee(!1)}}},Ie=async()=>{if(!d)return;const D=Y.size>0,se=W.size>0;if(!(!D&&!se&&!L)){Q(!0);try{const he=await H.lanSync({remoteNode:{ip:d.ip,port:d.port,name:d.data.node.name},skills:_.filter(Ee=>Y.has(Ee.name)&&!Ee.isDuplicate).map(({isDuplicate:Ee,...Pe})=>Pe),mcps:O.filter(Ee=>W.has(Ee.name)&&!Ee.isDuplicate).map(({isDuplicate:Ee,...Pe})=>{const De=B[Pe.name];return De&&Pe.env?{...Pe,env:{...Pe.env,...De}}:Pe}),vendor:{enabled:L,apiKey:T||void 0}});he.success?(U.success("同步完成"),n(),setTimeout(()=>t(),500)):U.error("同步失败: "+(he.error||"未知错误"))}catch(he){U.error("同步失败: "+he.message)}finally{Q(!1)}}},Te=D=>D.env?Object.entries(D.env).filter(([,se])=>se==="***").map(([se])=>se):[],Ve=(D,se,he)=>{k(Ee=>({...Ee,[D]:{...Ee[D]||{},[se]:he}}))},Ge=D=>{const se=_.find(he=>he.name===D);se!=null&&se.isDuplicate||K(he=>{const Ee=new Set(he);return Ee.has(D)?Ee.delete(D):Ee.add(D),Ee})},Ke=()=>{const D=_.filter(he=>!he.isDuplicate),se=D.every(he=>Y.has(he.name));K(se?new Set:new Set(D.map(he=>he.name)))},gt=D=>{const se=O.find(he=>he.name===D);se!=null&&se.isDuplicate||M(he=>{const Ee=new Set(he);return Ee.has(D)?Ee.delete(D):Ee.add(D),Ee})},Nt=()=>{const D=O.filter(he=>!he.isDuplicate),se=D.every(he=>W.has(he.name));M(se?new Set:new Set(D.map(he=>he.name)))},Z=Y.size>0||W.size>0||L,G=_.filter(D=>!D.isDuplicate),oe=O.filter(D=>!D.isDuplicate);return e?o.jsxs("div",{className:"modal-overlay",onClick:D=>{D.target===D.currentTarget&&!ge&&t()},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>{ge||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(D=>o.jsxs("span",{style:{fontSize:"13px",color:r===D?"var(--primary-color)":D<r?"var(--text-secondary)":"var(--text-muted)",fontWeight:r===D?600:400,borderBottom:r===D?"2px solid var(--primary-color)":"2px solid transparent",paddingBottom:"10px",cursor:"default",whiteSpace:"nowrap"},children:[D<r?"✓ ":`${D} `,p8[D]]},D))}),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(D=>o.jsx("button",{type:"button",onClick:()=>A(D),style:{padding:"8px 4px",background:"none",border:"none",borderBottom:R===D?"2px solid var(--primary-color)":"none",color:R===D?"var(--primary-color)":"var(--text-muted)",fontWeight:R===D?500:400,fontSize:"14px",cursor:"pointer",transition:"all 0.2s"},children:D==="scan"?"局域网扫描":"手动添加"},D))}),R==="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(D=>D.address).join("、")," · ","端口 ",E,w.length>1&&o.jsxs(o.Fragment,{children:[" · ",w.map((D,se)=>o.jsxs("span",{children:[se>0?" / ":"",o.jsxs("button",{type:"button",onClick:()=>be(D.subnet),disabled:a,style:{padding:0,border:"none",background:"none",color:C===D.subnet?"var(--primary-color)":"var(--text-muted)",fontSize:"12px",fontWeight:C===D.subnet?600:400,cursor:a?"not-allowed":"pointer",textDecoration:C===D.subnet?"underline":"none"},children:[D.subnet,".0/",D.netmask]})]},D.subnet))]})]}),a&&o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["正在扫描 ",C,".0 网段... ",s.current,"/",s.total]}),o.jsx("div",{style:{width:"100%",height:"6px",background:"var(--bg-secondary)",borderRadius:"3px",overflow:"hidden"},children:o.jsx("div",{style:{width:s.total>0?`${s.current/s.total*100}%`:"0%",height:"100%",background:"var(--primary-color)",borderRadius:"3px",transition:"width 0.3s ease"}})})]}),!a&&ae&&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:Re,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&&ae&&o.jsx("button",{type:"button",className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:Re,children:"重新扫描"})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(D=>{var se,he;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===D.ip&&(d==null?void 0:d.port)===D.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===D.ip&&(d==null?void 0:d.port)===D.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>p(D),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===D.ip&&(d==null?void 0:d.port)===D.port,onChange:()=>p(D),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:D.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[D.ip,":",D.port,((se=D.data.skills)==null?void 0:se.length)>0&&` · ${D.data.skills.length} Skills`,((he=D.data.mcps)==null?void 0:he.length)>0&&` · ${D.data.mcps.length} MCP`]})]})]},`${D.ip}-${D.port}`)})})]})]}),te&&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); } }"})]}),R==="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:D=>g(D.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:y,onChange:D=>x(D.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:$e,disabled:v||!m.trim(),children:v?"连接中...":"连接"})]}),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(D=>{var se,he;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===D.ip&&(d==null?void 0:d.port)===D.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===D.ip&&(d==null?void 0:d.port)===D.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>p(D),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===D.ip&&(d==null?void 0:d.port)===D.port,onChange:()=>p(D),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:D.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[D.ip,":",D.port,((se=D.data.skills)==null?void 0:se.length)>0&&` · ${D.data.skills.length} Skills`,((he=D.data.mcps)==null?void 0:he.length)>0&&` · ${D.data.mcps.length} MCP`]})]})]},`${D.ip}-${D.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,")"]}),G.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:Ke,children:G.every(D=>Y.has(D.name))?"取消全选":"全选"})]}),o.jsx("p",{style:{fontSize:"15px",fontWeight:500,marginBottom:"12px"},children:"选择需要同步的 Skills:"}),_.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:_.map(D=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",border:`1px solid ${D.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",cursor:D.isDuplicate?"not-allowed":"pointer",opacity:D.isDuplicate?.7:1,background:D.isDuplicate?"var(--bg-secondary)":"transparent"},children:[o.jsx("input",{type:"checkbox",checked:Y.has(D.name),onChange:()=>Ge(D.name),disabled:D.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:D.name}),D.targets&&D.targets.length>0&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:D.targets.join(", ")})]}),D.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:D.description}),D.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]},D.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:"}),oe.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:Nt,children:oe.every(D=>W.has(D.name))?"取消全选":"全选"})]}),O.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:O.map(D=>{const se=Te(D),he=W.has(D.name),Ee=he&&se.length>0;return o.jsxs("div",{style:{border:`1px solid ${D.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",opacity:D.isDuplicate?.7:1,background:D.isDuplicate?"var(--bg-secondary)":"transparent",overflow:"hidden"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",cursor:D.isDuplicate?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:he,onChange:()=>gt(D.name),disabled:D.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:D.name}),o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:D.type}),se.length>0&&!D.isDuplicate&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"#fff3e0",color:"#e67e22"},children:"含敏感变量"})]}),D.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:D.description}),D.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]}),Ee&&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:"以下环境变量需要手动填写:"}),se.map(Pe=>{var De;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:Pe}),o.jsx("input",{type:"text",value:((De=B[D.name])==null?void 0:De[Pe])||"",onChange:Le=>Ve(D.name,Pe,Le.target.value),placeholder:`请输入 ${Pe}`,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"}})]},Pe)})]})]},D.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:L,onChange:()=>X(!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:!L,onChange:()=>X(!1),style:{accentColor:"var(--primary-color)"}}),o.jsx("span",{children:"否"})]})]}),L&&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:T,onChange:D=>ce(D.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:"不填写则使用空密钥连接。"})]}),L&&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)。"]}),!L&&o.jsx("p",{style:{fontSize:"13px",color:"#999"},children:"跳过供应商创建,仅同步 Skills 和 MCP 配置。"})]}),r===5&&!ge&&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(",Y.size," 项)"]}),Y.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:_.filter(D=>Y.has(D.name)).map(D=>{var se;return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",D.name," ",(se=D.targets)!=null&&se.length?`(${D.targets.join(", ")})`:""]},D.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["MCP(",W.size," 项)"]}),W.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:O.filter(D=>W.has(D.name)).map(D=>{const se=Te(D),he=se.some(Ee=>{var Pe,De;return!((De=(Pe=B[D.name])==null?void 0:Pe[Ee])!=null&&De.trim())});return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",D.name," (",D.type,")",se.length>0&&o.jsx("span",{style:{fontSize:"12px",color:he?"#e74c3c":"#e67e22",marginLeft:"6px"},children:he?`⚠ ${se.length} 个敏感变量未填写`:"✓ 敏感变量已填写"})]},D.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:"供应商"}),L?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:",T?"已填写":"未填写"]}),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:"不创建"})]}),!Z&&o.jsx("p",{style:{fontSize:"13px",color:"#e74c3c",textAlign:"center"},children:"未选择任何同步内容"})]}),r===5&&ge&&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||!ge)&&o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>i(r-1),disabled:ge,children:"← 上一步"}),o.jsx("div",{style:{flex:1}}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,disabled:ge,children:"取消"}),r===1&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:xe,disabled:!d||te,children:te?"加载中...":"下一步 →"}),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&&!ge&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:Ie,disabled:!Z,children:"同步"})]})]})})]}):null}const XT=h.createContext(null),m8=async e=>{try{await H.clearRuleStatus(e)}catch(t){throw console.error("[RulesStatus] 清除规则状态失败:",t),t}};function g8(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 v8({children:e}){const[t,n]=h.useState({}),r=h.useRef(null),i=h.useRef(null),a=h.useRef(Date.now());h.useEffect(()=>{let f=!0;const d=()=>{r.current&&(r.current.close(),r.current=null);const p=localStorage.getItem("auth_token"),m=p?`/api/rules/status/stream?token=${encodeURIComponent(p)}`:"/api/rules/status/stream",g=new EventSource(m);r.current=g,a.current=Date.now(),g.onmessage=y=>{a.current=Date.now();try{const x=JSON.parse(y.data);if(x.type==="init")n(g8(x.statuses));else if(x.type==="update"){const v=x.status;n(b=>({...b,[v.ruleId]:{status:v.status,totalTokensUsed:v.totalTokensUsed,totalRequestsUsed:v.totalRequestsUsed,errorMessage:v.errorMessage,errorType:v.errorType,lastUpdate:v.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(!f)return;const m=Date.now()-a.current;m>=15e3&&(console.warn(`[RulesStatus] 心跳超时(${Math.round(m/1e3)}秒无响应),重新连接 SSE...`),d())},3e3),()=>{f=!1,r.current&&(r.current.close(),r.current=null),i.current&&(clearInterval(i.current),i.current=null)}},[]),h.useEffect(()=>{},[]);const s={ruleStatuses:t,getRuleStatus:c=>t[c],clearRuleStatus:m8};return o.jsx(XT.Provider,{value:s,children:e})}function y8(){const e=h.useContext(XT);return e||{ruleStatuses:{},getRuleStatus:t=>{},clearRuleStatus:async t=>{}}}const x8=[{value:"codex",label:"Codex",icon:"🤖"},{value:"claude-code",label:"Claude Code",icon:"⚡"},{value:"api",label:"所有 API",icon:"🔗"}],b8={codex:" [Codex]","claude-code":" [Claude Code]",api:" [API]"},w8={"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 QT({show:e,onClose:t,onComplete:n}){const[r,i]=h.useState(""),[a,l]=h.useState(""),[s,c]=h.useState("codex"),[u,f]=h.useState(!1),[d,p]=h.useState([]),[m,g]=h.useState([]);h.useEffect(()=>{e&&(H.getVendors().then(p).catch(()=>{}),H.getRoutes().then(g).catch(()=>{}))},[e]);const y=r?In[r]:null,x=y?d.find(S=>S.name===y.name):null,v=!!(x!=null&&x.apiKey),b=!x||!v;if(!e)return null;const w=()=>{u||(i(""),l(""),c("codex"),t())},j=(S,E)=>H.createAPIService({vendorId:S,name:E.name,apiUrl:E.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:E.sourceType,authType:E.authType,supportedModels:E.models?E.models.split(",").map(I=>I.trim()):void 0,modelLimits:E.modelLimits||{},enableCodingPlan:!1}),C=async S=>{var I,R;if(S.preventDefault(),!r){U.warning("请选择供应商");return}if(b&&!a){U.warning("请填写 API Key");return}const E=In[r];if(!E){U.error("未找到对应的供应商配置");return}f(!0);try{let A,_;if(x){A=x.id,!v&&a&&await H.updateVendor(A,{...x,apiKey:a});const M=new Set((x.services||[]).map(L=>L.sourceType)),B=E.services.filter(L=>!M.has(L.sourceType)),k=B.length>0?await Promise.all(B.map(L=>j(A,L))):[];_=[...x.services||[],...k]}else{const M=await H.createVendor({name:E.name,description:E.description,apiKey:a,authType:Zt.AUTH_TOKEN,sortOrder:0,services:[]});if(!(M!=null&&M.id))throw new Error("供应商创建失败");A=M.id,_=await Promise.all(E.services.map(B=>j(A,B)))}const N=E.name+b8[s],Y=new Set(m.map(M=>M.name));let K=N;if(Y.has(K)){let M=2;for(;Y.has(`${N}-${M}`);)M++;K=`${N}-${M}`}const O=await H.createRoute({name:K,description:"由一键配置自动创建"});if(!(O!=null&&O.id))throw new Error("路由创建失败");const F=w8[s],W=(I=[..._].filter(M=>M.sourceType).map(M=>({service:M,priority:F[M.sourceType]??99})).sort((M,B)=>M.priority-B.priority)[0])==null?void 0:I.service;if(W){const M=(R=W.supportedModels)!=null&&R.length?W.supportedModels[0]:void 0;await H.createRule({routeId:O.id,contentType:"default",targetServiceId:W.id,targetModel:M,sortOrder:0})}if(s==="codex"||s==="claude-code")try{await H.activateToolRoute(s,O.id)}catch{}if(s==="api"){let M=null;try{M=await H.getApiPathBindings()}catch{}if(M!=null&&M.bindings){const B=M.bindings.map(k=>k.apiPath==="/v1/models"?k:{...k,routeId:O.id});try{await H.updateApiPathBindings(B,M.models||"")}catch{}}}U.success("一键配置完成!路由已激活,可以开始使用"),n==null||n(),w(),setTimeout(()=>{window.location.reload()},300)}catch(A){console.error("一键配置失败:",A),U.error(`配置失败: ${A instanceof Error?A.message:"未知错误"}`)}finally{f(!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:C,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(GT,{value:r,onChange:S=>i(S),existingVendors:d,disabled:u})]}),(y==null?void 0:y.description)&&o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[y.description,y.link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:y.link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const S=new URL(y.link);return S.protocol+"//"+S.hostname}catch{return y.link}})()})]})]}),b&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Key"}),o.jsx("input",{type:"password",value:a,onChange:S=>l(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:x8.map(S=>{const E=s===S.value;return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:E?"var(--accent-light)":"transparent",border:`2px solid ${E?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease"},onMouseEnter:I=>{E||(I.currentTarget.style.background="var(--bg-hover)",I.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:I=>{E||(I.currentTarget.style.background="transparent",I.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"radio",name:"setupTarget",value:S.value,checked:E,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:E?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[S.icon," ",S.label]}),E&&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 j8=""+new URL("openai-CPEiZpaN.webp",import.meta.url).href,S8=""+new URL("claude-XtpLmGtF.webp",import.meta.url).href,Aj=[{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:"默认"}],Ij={compact:0,"image-understanding":1,"high-iq":2,"long-context":3,thinking:4,background:5,"model-mapping":6,default:7},Nj={compact:"📦",background:"🧱",thinking:"💭","high-iq":"🧠","long-context":"📄","image-understanding":"🖼️","model-mapping":"🔄"},JT=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],ZT=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"max",label:"Max"}],k8=e=>JT.some(t=>t.value===e),C8=e=>ZT.some(t=>t.value===e),P8=e=>k8(e==null?void 0:e.codexModelReasoningEffort)?e.codexModelReasoningEffort:"high",E8=e=>C8(e==null?void 0:e.claudeEffortLevel)?e.claudeEffortLevel:"medium";function _j(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 Mj(){var u1,d1,f1,p1,h1,m1,g1,v1;const{confirm:e}=uu(),{ruleStatuses:t,clearRuleStatus:n}=y8(),[r,i]=h.useState([]),[a,l]=h.useState([]),[s,c]=h.useState([]),[u,f]=h.useState([]),[d,p]=h.useState([]),[m,g]=h.useState([]),[y,x]=h.useState([]),[v,b]=h.useState(null),[w,j]=h.useState([]),[C,S]=h.useState(""),[E,I]=h.useState(null),[R,A]=h.useState(!1),[_,N]=h.useState(!1),[Y,K]=h.useState(null),[O,F]=h.useState(null),[W,M]=h.useState(""),[B,k]=h.useState(""),[L,X]=h.useState(""),[T,ce]=h.useState(""),[ge,Q]=h.useState(0),[ae,fe]=h.useState((O==null?void 0:O.contentType)||""),[te,ee]=h.useState(void 0),[le,ne]=h.useState(void 0),[Ae,be]=h.useState(void 0),[Re,$e]=h.useState(void 0),[xe,Ie]=h.useState(""),[Te,Ve]=h.useState(void 0),[Ge,Ke]=h.useState(void 0),[gt,Nt]=h.useState(void 0),[Z,G]=h.useState(void 0),[oe,D]=h.useState(void 0),[se,he]=h.useState(null),[Ee,Pe]=h.useState(!1),[De,Le]=h.useState(!1),[We,Be]=h.useState(void 0),[Xe,ct]=h.useState(void 0),[fn,V]=h.useState({}),[me,we]=h.useState(!1),[_e,nt]=h.useState(""),[Ze,bt]=h.useState(1e3),[jn,Qt]=h.useState(!1),[wr,Xn]=h.useState(!1),[pn,$t]=h.useState(null),[jr,hn]=h.useState(!1),[ft,Ii]=h.useState(!1),[Qa,el]=h.useState(!1),[tl,la]=h.useState(!1),[nl,Ja]=h.useState(""),[sa,Ht]=h.useState(!1),[$,z]=h.useState(""),[ye,qe]=h.useState(!1),[Oe,pt]=h.useState(""),[Vt,Fr]=h.useState(!1),[Za,ws]=h.useState({}),[eo,js]=h.useState(null),[Fe,Bt]=h.useState([]),[oR,r1]=h.useState(!1),[i1,a1]=h.useState(null);h.useEffect(()=>{rl(),cm(),um(),pR(),ii(),$u(),o1(),dR(),c1()},[]);const o1=async()=>{try{const P=await H.getApiPathBindings();j(P.bindings||[]),S(P.models||"")}catch(P){console.error("Failed to load API path bindings:",P)}},l1=async(P,J)=>{try{const ue=await H.updateApiPathBindings(P,J);j(ue.bindings),U.success("路由映射已保存")}catch(ue){U.error(ue.message||"保存失败")}},lR=(P,J)=>{const ue=w.map(je=>je.apiPath===P?{...je,routeId:J}:je);j(ue),l1(ue,C)},sR=()=>{l1(w,C)};h.useEffect(()=>{E&&no(E.id)},[E]),h.useEffect(()=>{g(W?d.filter(P=>P.vendorId===W):[]),k(""),X("")},[W]);const rl=async()=>{const P=await H.getRoutes();i(P),P.length>0&&!E&&I(P[0]);const J={};for(const ue of P)try{const je=await H.getBoundSessions(ue.id);J[ue.id]=je.sessions.length}catch{J[ue.id]=0}ws(J)},cR=async P=>{js(P),r1(!0),Bt([]);try{const J=await H.getBoundSessions(P);Bt(J.sessions)}catch{Bt([])}finally{r1(!1)}},s1=()=>{js(null),Bt([])},uR=async P=>{if(await e({title:"确认解绑会话",message:"确定要解除该会话的路由绑定吗?解绑后,该会话的后续请求将不再使用此路由。",type:"danger",confirmText:"解绑",cancelText:"取消"})){a1(P);try{const ue=await H.unbindSessionRoute(P);ue.success?(U.success("已解除绑定"),Bt(je=>je.filter(rt=>rt.id!==P)),ws(je=>{const rt=eo;return!rt||!je[rt]?je:{...je,[rt]:Math.max(0,je[rt]-1)}})):U.error(ue.error||"解绑失败")}catch(ue){U.error(ue.message||"解绑失败")}finally{a1(null)}}},dR=async()=>{try{const P=await H.checkClaudeVersion();$t(P)}catch(P){console.error("Failed to check Claude version:",P)}},fR=(P,J)=>{if(!P)return-1;const ue=P.split(".").map(Number),je=J.split(".").map(Number);for(let rt=0;rt<3;rt++){const lt=ue[rt]||0,Tn=je[rt]||0;if(lt>Tn)return 1;if(lt<Tn)return-1}return 0},to=()=>{var P;return(P=pn==null?void 0:pn.claudeCode)!=null&&P.version?fR(pn.claudeCode.version,"2.1.32")>=0:!1},no=async P=>{const J=await H.getRules(P);if(l(J),c1(),P)try{const je=(await H.getRulesBlacklistStatus(P)).reduce((rt,lt)=>(rt[lt.ruleId]=lt,rt),{});V(je)}catch(ue){console.error("Failed to load blacklist status:",ue)}},c1=async()=>{try{const P=await H.getRules();c(P)}catch(P){console.error("Failed to load all rules:",P)}},cm=async()=>{const P=await H.getVendors();f(P)},um=async()=>{const P=await H.getAPIServices();p(P)},pR=async()=>{const P=await H.getMCPs();x(P)},[Ye,hR]=h.useState(null),[ri,zu]=h.useState(null),ii=async()=>{try{const P=await H.getConfig();b(P),Ja(P.claudeDefaultModel||""),Ht(!1),z(P.autocompactPctOverride!=null?String(P.autocompactPctOverride):""),qe(!1),pt(P.codexDefaultModel||""),Fr(!1),Ie(typeof P.ruleGlobalTimeout=="number"&&P.ruleGlobalTimeout>0?String(P.ruleGlobalTimeout):"")}catch(P){console.error("Failed to load app config:",P)}},$u=async()=>{try{const P=await H.getToolBindings();hR(P)}catch(P){console.error("Failed to load tool bindings:",P)}},Bu=async(P,J)=>{zu(P);try{(await H.activateToolRoute(P,J)).success?(await $u(),await rl(),U.success("路由已激活")):U.error("激活失败")}catch(ue){U.error(`激活失败: ${ue.message||"未知错误"}`)}finally{zu(null)}},Fu=async P=>{zu(P);try{(await H.deactivateToolRoute(P)).success?(await $u(),await rl(),U.success("路由已停用")):U.error("停用失败")}catch(J){U.error(`停用失败: ${J.message||"未知错误"}`)}finally{zu(null)}},mR=async P=>{P.preventDefault();const J=new FormData(P.currentTarget),ue={name:J.get("name"),description:J.get("description")};Y?await H.updateRoute(Y.id,ue):await H.createRoute(ue),A(!1),rl()},gR=async P=>{if(await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{await H.deleteRoute(P),rl(),E&&E.id===P&&(I(null),l([])),U.success("路由已删除")}catch(ue){U.error(ue.message||"删除失败")}},vR=async P=>{if(P.preventDefault(),ae==="image-understanding"&&me&&!_e){U.warning("请选择一个MCP工具");return}if(!me&&!B){U.warning("请选择供应商API服务");return}if(!me&&te!==void 0&&We!==void 0&&te>We){U.warning(`Token超量值 (${te}k) 不能超过API服务的限制 (${We}k)`);return}if(!me&&Te!==void 0&&Xe!==void 0&&Te>Xe){U.warning(`请求次数超量值 (${Te}) 不能超过API服务的限制 (${Xe})`);return}const J=new FormData(P.currentTarget),ue={routeId:E.id,contentType:J.get("contentType"),targetServiceId:me?"":B,targetModel:me?void 0:L||"",replacedModel:T||"",sortOrder:ge,timeout:Re?Re*1e3:void 0,tokenLimit:me?void 0:te||void 0,resetInterval:me?void 0:le,tokenResetBaseTime:me?void 0:Ae?Ae.getTime():void 0,requestCountLimit:me?void 0:Te,requestResetInterval:me?void 0:Ge,requestResetBaseTime:me?void 0:gt?gt.getTime():void 0,frequencyLimit:Z,frequencyWindow:oe,useMCP:ae==="image-understanding"?me:!1,mcpId:ae==="image-understanding"&&me?_e:void 0,sessionTokenThreshold:ae==="long-context"?Ze:void 0};O?await H.updateRule(O.id,ue):await H.createRule(ue),N(!1),E&&no(E.id)},yR=async P=>{await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"})&&(await H.deleteRule(P),E&&no(E.id),U.success("规则已删除"))},xR=async P=>{try{const J=await H.toggleRuleDisable(P);E&&no(E.id),U.success(J.isDisabled?"规则已屏蔽":"规则已启用")}catch(J){U.error("操作失败: "+J.message)}},bR=async P=>{var J,ue;try{const je=[];(J=fn[P])!=null&&J.isBlacklisted&&je.push(H.clearRuleBlacklist(P));const rt=(ue=t[P])==null?void 0:ue.status;(rt==="error"||rt==="suspended")&&je.push(n(P)),await Promise.all(je),E&&no(E.id),U.success("已恢复")}catch(je){U.error("恢复失败: "+je.message)}},wR=async P=>{try{const J=a.find(lt=>lt.id===P);if(!J)return;const ue=a.filter(lt=>lt.contentType===J.contentType),rt=Math.max(...ue.map(lt=>lt.sortOrder||0))+1;await H.updateRule(P,{sortOrder:rt}),E&&no(E.id),U.success("优先级已提升至最高")}catch(J){U.error("操作失败: "+J.message)}},jR=async P=>{try{if(!a.find(je=>je.id===P))return;await H.updateRule(P,{sortOrder:0}),E&&no(E.id),U.success("优先级已降至最低")}catch(J){U.error("操作失败: "+J.message)}},SR=async P=>{if(P&&!to()){U.error("当前 Claude Code 版本不支持 Agent Teams 功能,需要版本 ≥ 2.1.32");return}try{const J=v||{};await H.updateConfig({...J,enableAgentTeams:P}),U.success(P?"Agent Teams 设置已保存(重启 Claude Code 后生效)":"Agent Teams 设置已取消(重启 Claude Code 后生效)"),await ii()}catch(J){U.error("更新失败: "+J.message)}},kR=async P=>{try{const J=v||{};await H.updateConfig({...J,enableBypassPermissionsSupport:P}),U.success(P?"对 bypassPermissions 的支持设置已保存(重启 Claude Code 后生效)":"对 bypassPermissions 的支持设置已取消(重启 Claude Code 后生效)"),await ii()}catch(J){U.error("更新失败: "+J.message)}},CR=async P=>{try{el(!0);const J=v||{};await H.updateConfig({...J,codexModelReasoningEffort:P}),U.success("Reasoning Effort 设置已保存(重启 Codex 后生效)"),await ii()}catch(J){U.error("更新失败: "+J.message)}finally{el(!1)}},PR=async P=>{try{la(!0);const J=v||{};await H.updateConfig({...J,claudeEffortLevel:P}),U.success("Effort Level 设置已保存(重启 Claude Code 后生效)"),await ii()}catch(J){U.error("更新失败: "+J.message)}finally{la(!1)}},ER=async()=>{try{const P=v||{};await H.updateConfig({...P,claudeDefaultModel:nl.trim()||void 0}),U.success("默认模型已保存(重启 Claude Code 后生效)"),Ht(!1),await ii()}catch(P){U.error("保存失败: "+P.message)}},TR=async()=>{const P=$.trim();if(P===""){try{const ue=v||{};await H.updateConfig({...ue,autocompactPctOverride:void 0}),U.success("自动压缩百分比已清除(重启 Claude Code 后生效)"),qe(!1),await ii()}catch(ue){U.error("保存失败: "+ue.message)}return}const J=Number(P);if(!Number.isInteger(J)||J<1||J>100){U.error("自动压缩百分比必须为 1-100 的整数");return}try{const ue=v||{};await H.updateConfig({...ue,autocompactPctOverride:J}),U.success("自动压缩百分比已保存(重启 Claude Code 后生效)"),qe(!1),await ii()}catch(ue){U.error("保存失败: "+ue.message)}},OR=async()=>{try{const P=v||{};await H.updateConfig({...P,codexDefaultModel:Oe.trim()||void 0}),U.success("默认模型已保存(重启 Codex 后生效)"),Fr(!1),await ii()}catch(P){U.error("保存失败: "+P.message)}},AR=async()=>{try{const P=v||{},J=Number(xe),ue=Number.isFinite(J)&&J>0?J:void 0;await H.updateConfig({...P,ruleGlobalTimeout:ue}),U.success(ue?`规则全局超时时间已设置为 ${ue} 秒`:"规则全局超时时间已恢复为默认值(300秒)"),await ii()}catch(P){U.error("更新失败: "+P.message)}},IR=()=>Aj,NR=P=>{F(P),fe(P.contentType),we(P.useMCP||!1),nt(P.mcpId||"");const J=d.find(ue=>ue.id===P.targetServiceId);J?(J.vendorId&&(M(J.vendorId),g(d.filter(ue=>ue.vendorId===J.vendorId))),setTimeout(()=>{if(k(J.id),X(P.targetModel||""),ce(P.replacedModel||""),Q(P.sortOrder||0),$e(P.timeout?P.timeout/1e3:void 0),ee(P.tokenLimit||void 0),ne(P.resetInterval),be(P.tokenResetBaseTime?new Date(P.tokenResetBaseTime):void 0),Ve(P.requestCountLimit),Ke(P.requestResetInterval),Nt(P.requestResetBaseTime?new Date(P.requestResetBaseTime):void 0),G(P.frequencyLimit),D(P.frequencyWindow),J.enableTokenLimit&&J.tokenLimit){Be(J.tokenLimit);const ue=P.tokenLimit===J.tokenLimit&&P.resetInterval===(J.tokenResetInterval||void 0)&&P.tokenLimit!==null&&P.resetInterval!==null;Pe(ue)}else Be(void 0),Pe(!1);if(J.enableRequestLimit&&J.requestCountLimit){ct(J.requestCountLimit);const ue=P.requestCountLimit===J.requestCountLimit&&P.requestResetInterval===(J.requestResetInterval||void 0)&&P.requestCountLimit!==null&&P.requestResetInterval!==null;Le(ue)}else ct(void 0),Le(!1);Qt(!!P.tokenLimit),Xn(!!P.requestCountLimit),bt(P.sessionTokenThreshold??1e3)},0)):(P.useMCP&&(M(""),k(""),X(""),ce(""),Q(P.sortOrder||0),$e(P.timeout?P.timeout/1e3:void 0),Qt(!1),Xn(!1)),bt(P.sessionTokenThreshold??1e3)),N(!0)},_R=P=>s.some(J=>{var ue;return J.routeId===P&&((ue=t[J.id])==null?void 0:ue.status)==="in_use"}),MR=P=>{var Ss;const J=fn[P.id],ue=[],je=t[P.id];if((je==null?void 0:je.status)==="in_use")return{status:"in_use",label:"使用中",reason:"正在处理请求"};if((je==null?void 0:je.status)==="suspended"){const Ne=je.errorType==="timeout"?"超时":je.errorType==="http"?"HTTP错误":"错误";return{status:"suspended",label:"已挂起",reason:je.errorMessage||`${Ne}导致服务暂时不可用`}}if((je==null?void 0:je.status)==="error")return{status:"error",label:"请求失败",reason:je.errorMessage||"请求处理失败"};if(J!=null&&J.isBlacklisted){const Ne=J.blacklistEntry;(Ne==null?void 0:Ne.errorType)==="timeout"?ue.push("请求超时"):Ne!=null&&Ne.lastStatusCode&&ue.push(`HTTP ${Ne.lastStatusCode}错误`)}const rt=(je==null?void 0:je.totalTokensUsed)!==void 0?je.totalTokensUsed:P.totalTokensUsed;P.tokenLimit&&rt!==void 0&&rt>=P.tokenLimit*1e3&&ue.push("Token超限");const lt=(je==null?void 0:je.totalRequestsUsed)!==void 0?je.totalRequestsUsed:P.totalRequestsUsed;if(P.requestCountLimit&&lt!==void 0&&lt>=P.requestCountLimit&&ue.push("次数超限"),ue.length>0)return{status:"error",label:J!=null&&J.isBlacklisted?((Ss=J.blacklistEntry)==null?void 0:Ss.errorType)==="timeout"?"超时":"服务错误":ue[0],reason:ue.join(", ")};const Tn=[];if(P.tokenLimit&&rt!==void 0){const Ne=rt/(P.tokenLimit*1e3)*100;Ne>=80&&Tn.push(`Token ${Ne.toFixed(0)}%`)}if(P.requestCountLimit&&lt!==void 0){const Ne=lt/P.requestCountLimit*100;Ne>=80&&Tn.push(`次数 ${Ne.toFixed(0)}%`)}return Tn.length>0?{status:"warning",label:"接近限制",reason:Tn.join(", ")}:{status:"success",label:"正常",reason:""}},RR=()=>{F(null),fe("default"),M(""),k(""),X(""),ce(""),Q(0),$e(void 0),ee(void 0),ne(void 0),be(void 0),Ve(void 0),Ke(void 0),Nt(void 0),Pe(!1),Le(!1),Be(void 0),ct(void 0),Qt(!1),Xn(!1),we(!1),nt(""),bt(1e3),N(!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:()=>Ii(!0),style:{whiteSpace:"nowrap"},children:"局域网内同步配置"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>hn(!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:()=>A(!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(P=>{var J,ue,je,rt;return o.jsx("div",{className:_R(P.id)?"route-active-glow":void 0,onClick:()=>I(P),style:{padding:"12px",marginBottom:"8px",backgroundColor:E&&E.id===P.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:P.name}),o.jsxs("div",{style:{display:"flex",gap:"3px",alignItems:"center",flexShrink:0,marginLeft:"8px"},children:[Za[P.id]>0&&o.jsxs("div",{style:{position:"relative"},children:[o.jsx("div",{onClick:lt=>{lt.stopPropagation(),cR(P.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:Za[P.id]>99?"99+":Za[P.id]}),o.jsxs("span",{className:"route-icon-popover",children:[Za[P.id]," 个会话绑定此路由,点击查看"]})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:j8,alt:"Codex",onClick:lt=>{var Tn;lt.stopPropagation(),!ri&&(((Tn=Ye==null?void 0:Ye.codex)==null?void 0:Tn.routeId)===P.id?Fu("codex"):Bu("codex",P.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:ri?"wait":"pointer",opacity:((J=Ye==null?void 0:Ye.codex)==null?void 0:J.routeId)===P.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((ue=Ye==null?void 0:Ye.codex)==null?void 0:ue.routeId)===P.id?"Codex 已绑定此路由,点击解绑":"点击将 Codex 绑定到此路由"})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:S8,alt:"Claude Code",onClick:lt=>{var Tn;lt.stopPropagation(),!ri&&(((Tn=Ye==null?void 0:Ye["claude-code"])==null?void 0:Tn.routeId)===P.id?Fu("claude-code"):Bu("claude-code",P.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:ri?"wait":"pointer",opacity:((je=Ye==null?void 0:Ye["claude-code"])==null?void 0:je.routeId)===P.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((rt=Ye==null?void 0:Ye["claude-code"])==null?void 0:rt.routeId)===P.id?"Claude Code 已绑定此路由,点击解绑":"点击将 Claude Code 绑定到此路由"})]})]})]}),P.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-route-muted)",marginTop:"2px"},children:P.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:lt=>{lt.stopPropagation(),K(P),A(!0)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:lt=>{lt.stopPropagation(),gR(P.id)},children:"删除"})]})]})},P.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:"规则列表"}),E&&o.jsx("button",{className:"btn btn-primary",onClick:RR,children:"新建规则"})]}),E?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((P,J)=>{const ue=Ij[P.contentType]??999,je=Ij[J.contentType]??999;if(ue!==je)return ue-je;const rt=P.sortOrder||0;return(J.sortOrder||0)-rt}).map(P=>{var rt,lt,Tn,Ss;const J=d.find(Ne=>Ne.id===P.targetServiceId),ue=u.find(Ne=>Ne.id===(J==null?void 0:J.vendorId)),je=(rt=Aj.find(Ne=>Ne.value===P.contentType))==null?void 0:rt.label;return o.jsxs("tr",{children:[o.jsx("td",{className:"col-priority",style:P.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{className:"col-priority-box",children:[o.jsx("span",{children:P.sortOrder||0}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>jR(P.id),title:"降至最低优先级",children:"↓"}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>wR(P.id),title:"升至最高优先级",children:"↑"})]})}),o.jsx("td",{style:P.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{style:{fontSize:"12px",whiteSpace:"nowrap"},children:[P.contentType!=="default"&&Nj[P.contentType]&&o.jsx("span",{style:{fontSize:"14px"},children:Nj[P.contentType]}),o.jsx("span",{children:je}),P.contentType==="model-mapping"&&P.replacedModel&&o.jsxs("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:()=>he(P.id),onMouseLeave:()=>he(null),children:[o.jsx("span",{style:{cursor:"help",fontSize:"14px",color:"var(--text-info)",fontWeight:"bold"},children:"ⓘ"}),se===P.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:["被顶替的模型是: ",P.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:P.isDisabled?{opacity:.4}:void 0,children:o.jsx("div",{className:"vendor-sevices-col",style:{fontSize:"0.6em"},children:P.useMCP?o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["MCP:",((lt=y.find(Ne=>Ne.id===P.mcpId))==null?void 0:lt.name)||"Unknown"]}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"使用MCP工具"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["供应商:",ue?ue.name:"Unknown"]}),o.jsxs("div",{children:["服务:",J?J.name:"Unknown"]}),o.jsxs("div",{children:["模型:",P.targetModel||"透传模型"]})]})})}),o.jsx("td",{style:{whiteSpace:"nowrap",...P.isDisabled?{opacity:.4}:{}},children:(()=>{var y1,x1,b1,w1;const Ne=MR(P),Bn=fn[P.id],DR=(Bn==null?void 0:Bn.isBlacklisted)&&!((y1=Ne.reason)!=null&&y1.includes("Token超限"))&&!((x1=Ne.reason)!=null&&x1.includes("次数超限"));if(P.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 LR=DR||((b1=t[P.id])==null?void 0:b1.status)==="error"||((w1=t[P.id])==null?void 0:w1.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:[Ne.status==="success"&&o.jsx("span",{style:{color:"#28a745",fontWeight:"bold",fontSize:"14px"},children:"✓"}),Ne.status==="warning"&&o.jsx("span",{style:{color:"#ffc107",fontWeight:"bold",fontSize:"14px"},children:"⚠"}),Ne.status==="error"&&o.jsx("span",{style:{color:"#dc3545",fontWeight:"bold",fontSize:"14px"},children:"✗"}),Ne.status==="suspended"&&o.jsx("span",{style:{color:"#6f42c1",fontWeight:"bold",fontSize:"14px"},children:"⏸"}),Ne.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:Ne.status==="success"?"#28a745":Ne.status==="warning"?"#ffc107":Ne.status==="in_use"?"#007bff":Ne.status==="suspended"?"#6f42c1":"#dc3545",fontWeight:Ne.status!=="success"?"bold":"normal"},children:Ne.label}),Ne.reason&&o.jsxs("div",{style:{position:"relative",display:"inline-block",cursor:"help"},onMouseEnter:()=>he(P.id+"-status"),onMouseLeave:()=>he(null),children:[o.jsx("span",{style:{fontSize:"12px",color:"#999",marginLeft:"4px"},children:" ⓘ"}),se===P.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:[Ne.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)"}})]})]})]}),LR&&o.jsx("button",{className:"btn btn-info",style:{padding:"2px 8px",fontSize:"11px"},onClick:()=>bR(P.id),children:"恢复"})]})})()}),o.jsx("td",{style:P.isDisabled?{opacity:.4}:void 0,children:P.tokenLimit||P.requestCountLimit?o.jsxs("div",{style:{fontSize:"13px"},children:[P.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 Bn;const Ne=((Bn=t[P.id])==null?void 0:Bn.totalTokensUsed)??P.totalTokensUsed;return Ne&&P.tokenLimit&&Ne>=P.tokenLimit*1e3?"red":"inherit"})()},children:[(((((Tn=t[P.id])==null?void 0:Tn.totalTokensUsed)??P.totalTokensUsed)||0)/1e3).toFixed(1),"K/",P.tokenLimit.toFixed(0),"K"]}),(()=>{var Bn;const Ne=((Bn=t[P.id])==null?void 0:Bn.totalTokensUsed)??P.totalTokensUsed;return Ne&&P.tokenLimit&&Ne>=P.tokenLimit*1e3?o.jsx("span",{style:{color:"red",marginLeft:"4px",fontWeight:"bold",fontSize:"11px"},children:"超限"}):null})()]})]}),P.requestCountLimit&&o.jsxs("div",{style:{marginTop:P.tokenLimit?"6px":0},children:[o.jsx("span",{style:{fontWeight:"bold",fontSize:"12px"},children:"次数:"}),o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{color:(()=>{var Bn;const Ne=((Bn=t[P.id])==null?void 0:Bn.totalRequestsUsed)??P.totalRequestsUsed;return Ne&&P.requestCountLimit&&Ne>=P.requestCountLimit?"red":"inherit"})()},children:[(((Ss=t[P.id])==null?void 0:Ss.totalRequestsUsed)??P.totalTokensUsed)||0,"/",P.requestCountLimit]}),(()=>{var Bn;const Ne=((Bn=t[P.id])==null?void 0:Bn.totalRequestsUsed)??P.totalRequestsUsed;return Ne&&P.requestCountLimit&&Ne>=P.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 ${P.isDisabled?"btn-success":"btn-warning"}`,onClick:()=>xR(P.id),title:P.isDisabled?"启用规则":"临时屏蔽规则",children:P.isDisabled?"启用":"屏蔽"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>NR(P),children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>yR(P.id),children:"删除"})]})})]},P.id)})})]}):o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"请先选择一个路由"})}),E&&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:"先分类型,再排顺序,上主下备"})]})]}),E&&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:xe,onChange:P=>Ie(P.target.value),onBlur:()=>AR(),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(P=>{const J=P.apiPath==="/v1/models",ue=J?!!C.trim():!!P.routeId;return o.jsxs("div",{className:"api-binding-row",children:[o.jsx("span",{className:`api-binding-status ${ue?"api-binding-status--bound":""}`}),o.jsx("span",{className:"api-binding-path",children:P.apiPath==="/v1beta/models"?"/v1beta/models/{model}:{action}":P.apiPath}),o.jsx("span",{className:"api-binding-arrow",children:"→"}),o.jsx("div",{className:"api-binding-control",children:J?o.jsx("input",{type:"text",value:C,onChange:je=>S(je.target.value),onBlur:sR,placeholder:"自定义模型列表,英文逗号分隔,留空使用默认列表"}):o.jsxs("select",{value:P.routeId||"",onChange:je=>lR(P.apiPath,je.target.value||null),children:[o.jsx("option",{value:"",children:"无"}),r.map(je=>o.jsx("option",{value:je.id,children:je.name},je.id))]})})]},P.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:((u1=Ye==null?void 0:Ye["claude-code"])==null?void 0:u1.routeId)||"",onChange:P=>{const J=P.target.value||null;J&&Bu("claude-code",J)},disabled:ri==="claude-code",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(P=>{var J;return o.jsxs("option",{value:P.id,children:[P.name,((J=Ye==null?void 0:Ye["claude-code"])==null?void 0:J.routeId)===P.id?" (已激活)":""]},P.id)})]}),((d1=Ye==null?void 0:Ye["claude-code"])==null?void 0:d1.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Fu("claude-code"),disabled:ri==="claude-code",children:ri==="claude-code"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 Claude Code 代理请求。激活后,/claude-code/ 路径的请求将使用该路由的规则。"})]}),!to()&&((f1=pn==null?void 0:pn.claudeCode)==null?void 0:f1.version)&&o.jsxs("div",{style:{backgroundColor:"var(--bg-warning, #fff3cd)",border:"1px solid var(--border-warning, #ffc107)",borderRadius:"6px",padding:"12px",marginBottom:"12px",fontSize:"13px",color:"var(--text-warning, #856404)"},children:["⚠️ 当前 Claude Code 版本 (",pn.claudeCode.version,") 不支持 Agent Teams 功能。",o.jsx("br",{}),"Agent Teams 功能需要 Claude Code 版本 ≥ 2.1.32。请升级 Claude Code 后再使用此功能。"]}),o.jsxs("div",{style:{marginBottom:"20px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"agent-teams-toggle",checked:(v==null?void 0:v.enableAgentTeams)||!1,onChange:P=>SR(P.target.checked),disabled:!to(),style:{cursor:to()?"pointer":"not-allowed",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"agent-teams-toggle",style:{cursor:to()?"pointer":"not-allowed",fontSize:"14px",userSelect:"none",color:to()?"inherit":"var(--text-muted)"},children:"开启 Agent Teams 功能"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:to()?"开启后将启用 Agent Teams 实验性功能,并实时写入配置;重启 Claude Code 后生效。":"Agent Teams 功能需要 Claude Code 版本 ≥ 2.1.32。请升级 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:(v==null?void 0:v.enableBypassPermissionsSupport)||!1,onChange:P=>kR(P.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",{htmlFor:"claude-effort-level",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"Effort Level"}),o.jsx("select",{id:"claude-effort-level",value:E8(v),onChange:P=>PR(P.target.value),disabled:tl,style:{flex:1,minWidth:0},children:ZT.map(P=>o.jsx("option",{value:P.value,children:P.label},P.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:nl,onChange:P=>{Ja(P.target.value),Ht(P.target.value!==((v==null?void 0:v.claudeDefaultModel)||""))},onBlur:()=>{sa&&ER()},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:$,onChange:P=>{z(P.target.value),qe(P.target.value!==((v==null?void 0:v.autocompactPctOverride)!=null?String(v.autocompactPctOverride):""))},onBlur:()=>{ye&&TR()},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",{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:((p1=Ye==null?void 0:Ye.codex)==null?void 0:p1.routeId)||"",onChange:P=>{const J=P.target.value||null;J&&Bu("codex",J)},disabled:ri==="codex",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(P=>{var J;return o.jsxs("option",{value:P.id,children:[P.name,((J=Ye==null?void 0:Ye.codex)==null?void 0:J.routeId)===P.id?" (已激活)":""]},P.id)})]}),((h1=Ye==null?void 0:Ye.codex)==null?void 0:h1.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Fu("codex"),disabled:ri==="codex",children:ri==="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:P8(v),onChange:P=>CR(P.target.value),disabled:Qa,style:{flex:1,minWidth:0},children:JT.map(P=>o.jsx("option",{value:P.value,children:P.label},P.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:Oe,onChange:P=>{pt(P.target.value),Fr(P.target.value!==((v==null?void 0:v.codexDefaultModel)||""))},onBlur:()=>{Vt&&OR()},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",{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"]})]})]})]})]}),R&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>A(!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:Y?"编辑路由":"新建路由"})}),o.jsxs("form",{onSubmit:mR,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"路由名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:Y?Y.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"描述"}),o.jsx("textarea",{name:"description",rows:3,defaultValue:Y?Y.description:""})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>A(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),_&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>N(!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?"编辑规则":"新建规则"})}),o.jsxs("form",{onSubmit:vR,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"对象请求类型"}),o.jsx("select",{name:"contentType",value:ae,required:!0,onChange:P=>{fe(P.target.value)},children:IR().map(P=>o.jsx("option",{value:P.value,children:P.label},P.value))})]}),ae==="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] 接下来帮我解决一个简单的问题"})]})]}),ae==="model-mapping"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["被顶替模型 ",o.jsx("small",{children:"(可在日志中找出想要顶替的模型名)"})]}),o.jsx("input",{type:"text",value:T,onChange:P=>ce(P.target.value),placeholder:"例如:gpt-4"})]}),ae==="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:Ze??1e3,onChange:P=>bt(Number(P.target.value)),placeholder:"1000",min:"1"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["当前对话(session)的累积tokens数量超过 ",Ze??1e3,"k 时,该对话的新请求将走此规则"]})]}),ae==="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:me,onChange:P=>we(P.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服务"})]}),ae==="image-understanding"&&me&&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:y.length===0?o.jsx("div",{style:{padding:"12px",textAlign:"center",color:"var(--text-muted)"},children:"暂无MCP工具,请先在MCP管理页面添加"}):y.map(P=>o.jsxs("div",{onClick:()=>nt(P.id),style:{padding:"12px",marginBottom:"8px",border:`2px solid ${_e===P.id?"var(--primary-color)":"var(--border-primary)"}`,borderRadius:"6px",cursor:"pointer",backgroundColor:_e===P.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:P.name}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"11px"},children:P.type==="stdio"?"命令行":P.type.toUpperCase()})]}),P.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px"},children:P.description})]},P.id))})]}),!me&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsxs("select",{value:W,onChange:P=>M(P.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择供应商"}),u.map(P=>o.jsx("option",{value:P.id,children:P.name},P.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsxs("select",{value:B,onChange:P=>{const J=P.target.value;k(J),X("");const ue=d.find(je=>je.id===J);ue&&(ue.enableTokenLimit&&ue.tokenLimit?(ee(ue.tokenLimit),ne(ue.tokenResetInterval),be(ue.tokenResetBaseTime?new Date(ue.tokenResetBaseTime):void 0),Be(ue.tokenLimit),Pe(!0),Qt(!0)):(Be(void 0),Pe(!1),Qt(!1)),ue.enableRequestLimit&&ue.requestCountLimit?(Ve(ue.requestCountLimit),Ke(ue.requestResetInterval),Nt(ue.requestResetBaseTime?new Date(ue.requestResetBaseTime):void 0),ct(ue.requestCountLimit),Le(!0),Xn(!0)):(ct(void 0),Le(!1),Xn(!1)))},required:!0,disabled:!W,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择API服务"}),m.map(P=>o.jsx("option",{value:P.id,children:P.name},P.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsxs("select",{value:L,onChange:P=>X(P.target.value),disabled:!B,children:[o.jsx("option",{value:"",children:"透传模型名"}),(g1=(m1=d.find(P=>P.id===B))==null?void 0:m1.supportedModels)==null?void 0:g1.map(P=>o.jsx("option",{value:P,children:P},P))]})]}),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:Ee?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:jn,onChange:P=>Qt(P.target.checked),disabled:Ee,style:{marginRight:"8px",cursor:Ee?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Tokens超量限制"}),Ee&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),Ee&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>Pe(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),jn&&!Ee&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Tokens超量(单位:k)"}),o.jsx("input",{type:"number",value:te||"",onChange:P=>{const J=P.target.value?parseInt(P.target.value):void 0;if(J!==void 0&&We!==void 0&&J>We){U.warning(`Token超量值不能超过API服务的限制 (${We}k)`);return}ee(J),Ee&&J!==We&&Pe(!1)},min:"0",max:We,placeholder:We?`最大 ${We}k`:"不限制",disabled:Ee}),We&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",We,"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:le||"",onChange:P=>{ne(P.target.value?parseInt(P.target.value):void 0),Ee&&Pe(!1)},min:"1",placeholder:"不自动重置",disabled:Ee}),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:Ae?_j(Ae):"",onChange:P=>{P.target.value?be(new Date(P.target.value)):be(void 0),Ee&&Pe(!1)},disabled:!le||Ee,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:De?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:wr,onChange:P=>Xn(P.target.checked),disabled:De,style:{marginRight:"8px",cursor:De?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"}),De&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),De&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>Le(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),wr&&!De&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量"}),o.jsx("input",{type:"number",value:Te||"",onChange:P=>{const J=P.target.value?parseInt(P.target.value):void 0;if(J!==void 0&&Xe!==void 0&&J>Xe){U.warning(`请求次数超量值不能超过API服务的限制 (${Xe})`);return}Ve(J),De&&J!==Xe&&Le(!1)},min:"0",max:Xe,placeholder:Xe?`最大 ${Xe}`:"不限制",disabled:De}),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:Ge||"",onChange:P=>{Ke(P.target.value?parseInt(P.target.value):void 0),De&&Le(!1)},min:"1",placeholder:"不自动重置",disabled:De}),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:gt?_j(gt):"",onChange:P=>{P.target.value?Nt(new Date(P.target.value)):Nt(void 0),De&&Le(!1)},disabled:!Ge||De,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:!!Z,onChange:P=>{P.target.checked?(G(10),D(0)):(G(void 0),D(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:"启用后,当同一内容类型的请求频率超过限制时,系统会自动切换到其他同类型规则"})]}),Z&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制次数(并发数)"}),o.jsx("input",{type:"number",value:Z||"",onChange:P=>G(P.target.value?parseInt(P.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:oe===0?0:oe||"",onChange:P=>{const J=P.target.value?parseInt(P.target.value):void 0;D(J===0?0:J)},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:Re||"",onChange:P=>$e(P.target.value?parseInt(P.target.value):void 0),min:"1",placeholder:v!=null&&v.ruleGlobalTimeout?`全局${v.ruleGlobalTimeout}秒`:"默认300秒"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["设置此规则的API请求超时时间。不设置则使用全局超时配置(当前为",v!=null&&v.ruleGlobalTimeout?`${v.ruleGlobalTimeout}秒`:"默认300秒","),超时后自动触发故障切换"]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"排序(值越大优先级越高)"}),o.jsx("input",{type:"number",value:ge,onChange:P=>Q(parseInt(P.target.value)||0),min:"0",max:"1000"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>N(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),o.jsx(QT,{show:jr,onClose:()=>hn(!1),onComplete:()=>{rl(),cm(),um(),$u(),o1()}}),o.jsx(h8,{show:ft,onClose:()=>Ii(!1),onComplete:()=>{cm(),um()}}),eo&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:s1,"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:["绑定会话 - ",((v1=r.find(P=>P.id===eo))==null?void 0:v1.name)||eo]})}),o.jsxs("div",{className:"modal-body-scrollable",style:{maxHeight:"460px"},children:[oR?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"加载中..."}):Fe.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:["以下 ",Fe.length," 个会话绑定了此路由:"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[Fe.slice(0,50).map((P,J)=>{var ue;return o.jsxs("div",{style:{padding:"12px 0",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",borderBottom:J===Math.min(Fe.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:((ue=P.title)==null?void 0:ue.replace(/<\/?session>/g,"").trim())||P.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 ${P.targetType==="claude-code"?"badge-claude-code":"badge-codex"}`,style:{fontSize:"11px"},children:P.targetType==="claude-code"?"Claude Code":"Codex"}),o.jsxs("span",{children:[P.requestCount," 次请求"]}),o.jsxs("span",{children:[P.totalTokens.toLocaleString()," tokens"]})]})]}),o.jsx("button",{type:"button",className:"btn btn-danger",style:{flexShrink:0,padding:"4px 12px",fontSize:"12px"},disabled:i1===P.id,onClick:je=>{je.stopPropagation(),uR(P.id)},children:i1===P.id?"解绑中...":"解绑"})]},P.id)}),Fe.length>50&&o.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:"var(--text-tertiary)",padding:"8px"},children:["等共 ",Fe.length," 个会话"]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:s1,children:"关闭"})]})]})]})]})}var eO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ma,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",l="second",s="minute",c="hour",u="day",f="week",d="month",p="quarter",m="year",g="date",y="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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(K){var O=["th","st","nd","rd"],F=K%100;return"["+K+(O[(F-20)%10]||O[F]||O[0])+"]"}},w=function(K,O,F){var W=String(K);return!W||W.length>=O?K:""+Array(O+1-W.length).join(F)+K},j={s:w,z:function(K){var O=-K.utcOffset(),F=Math.abs(O),W=Math.floor(F/60),M=F%60;return(O<=0?"+":"-")+w(W,2,"0")+":"+w(M,2,"0")},m:function K(O,F){if(O.date()<F.date())return-K(F,O);var W=12*(F.year()-O.year())+(F.month()-O.month()),M=O.clone().add(W,d),B=F-M<0,k=O.clone().add(W+(B?-1:1),d);return+(-(W+(F-M)/(B?M-k:k-M))||0)},a:function(K){return K<0?Math.ceil(K)||0:Math.floor(K)},p:function(K){return{M:d,y:m,w:f,d:u,D:g,h:c,m:s,s:l,ms:a,Q:p}[K]||String(K||"").toLowerCase().replace(/s$/,"")},u:function(K){return K===void 0}},C="en",S={};S[C]=b;var E="$isDayjsObject",I=function(K){return K instanceof N||!(!K||!K[E])},R=function K(O,F,W){var M;if(!O)return C;if(typeof O=="string"){var B=O.toLowerCase();S[B]&&(M=B),F&&(S[B]=F,M=B);var k=O.split("-");if(!M&&k.length>1)return K(k[0])}else{var L=O.name;S[L]=O,M=L}return!W&&M&&(C=M),M||!W&&C},A=function(K,O){if(I(K))return K.clone();var F=typeof O=="object"?O:{};return F.date=K,F.args=arguments,new N(F)},_=j;_.l=R,_.i=I,_.w=function(K,O){return A(K,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var N=function(){function K(F){this.$L=R(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[E]=!0}var O=K.prototype;return O.parse=function(F){this.$d=function(W){var M=W.date,B=W.utc;if(M===null)return new Date(NaN);if(_.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var k=M.match(x);if(k){var L=k[2]-1||0,X=(k[7]||"0").substring(0,3);return B?new Date(Date.UTC(k[1],L,k[3]||1,k[4]||0,k[5]||0,k[6]||0,X)):new Date(k[1],L,k[3]||1,k[4]||0,k[5]||0,k[6]||0,X)}}return new Date(M)}(F),this.init()},O.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},O.$utils=function(){return _},O.isValid=function(){return this.$d.toString()!==y},O.isSame=function(F,W){var M=A(F);return this.startOf(W)<=M&&M<=this.endOf(W)},O.isAfter=function(F,W){return A(F)<this.startOf(W)},O.isBefore=function(F,W){return this.endOf(W)<A(F)},O.$g=function(F,W,M){return _.u(F)?this[W]:this.set(M,F)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(F,W){var M=this,B=!!_.u(W)||W,k=_.p(F),L=function(te,ee){var le=_.w(M.$u?Date.UTC(M.$y,ee,te):new Date(M.$y,ee,te),M);return B?le:le.endOf(u)},X=function(te,ee){return _.w(M.toDate()[te].apply(M.toDate("s"),(B?[0,0,0,0]:[23,59,59,999]).slice(ee)),M)},T=this.$W,ce=this.$M,ge=this.$D,Q="set"+(this.$u?"UTC":"");switch(k){case m:return B?L(1,0):L(31,11);case d:return B?L(1,ce):L(0,ce+1);case f:var ae=this.$locale().weekStart||0,fe=(T<ae?T+7:T)-ae;return L(B?ge-fe:ge+(6-fe),ce);case u:case g:return X(Q+"Hours",0);case c:return X(Q+"Minutes",1);case s:return X(Q+"Seconds",2);case l:return X(Q+"Milliseconds",3);default:return this.clone()}},O.endOf=function(F){return this.startOf(F,!1)},O.$set=function(F,W){var M,B=_.p(F),k="set"+(this.$u?"UTC":""),L=(M={},M[u]=k+"Date",M[g]=k+"Date",M[d]=k+"Month",M[m]=k+"FullYear",M[c]=k+"Hours",M[s]=k+"Minutes",M[l]=k+"Seconds",M[a]=k+"Milliseconds",M)[B],X=B===u?this.$D+(W-this.$W):W;if(B===d||B===m){var T=this.clone().set(g,1);T.$d[L](X),T.init(),this.$d=T.set(g,Math.min(this.$D,T.daysInMonth())).$d}else L&&this.$d[L](X);return this.init(),this},O.set=function(F,W){return this.clone().$set(F,W)},O.get=function(F){return this[_.p(F)]()},O.add=function(F,W){var M,B=this;F=Number(F);var k=_.p(W),L=function(ce){var ge=A(B);return _.w(ge.date(ge.date()+Math.round(ce*F)),B)};if(k===d)return this.set(d,this.$M+F);if(k===m)return this.set(m,this.$y+F);if(k===u)return L(1);if(k===f)return L(7);var X=(M={},M[s]=r,M[c]=i,M[l]=n,M)[k]||1,T=this.$d.getTime()+F*X;return _.w(T,this)},O.subtract=function(F,W){return this.add(-1*F,W)},O.format=function(F){var W=this,M=this.$locale();if(!this.isValid())return M.invalidDate||y;var B=F||"YYYY-MM-DDTHH:mm:ssZ",k=_.z(this),L=this.$H,X=this.$m,T=this.$M,ce=M.weekdays,ge=M.months,Q=M.meridiem,ae=function(ee,le,ne,Ae){return ee&&(ee[le]||ee(W,B))||ne[le].slice(0,Ae)},fe=function(ee){return _.s(L%12||12,ee,"0")},te=Q||function(ee,le,ne){var Ae=ee<12?"AM":"PM";return ne?Ae.toLowerCase():Ae};return B.replace(v,function(ee,le){return le||function(ne){switch(ne){case"YY":return String(W.$y).slice(-2);case"YYYY":return _.s(W.$y,4,"0");case"M":return T+1;case"MM":return _.s(T+1,2,"0");case"MMM":return ae(M.monthsShort,T,ge,3);case"MMMM":return ae(ge,T);case"D":return W.$D;case"DD":return _.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return ae(M.weekdaysMin,W.$W,ce,2);case"ddd":return ae(M.weekdaysShort,W.$W,ce,3);case"dddd":return ce[W.$W];case"H":return String(L);case"HH":return _.s(L,2,"0");case"h":return fe(1);case"hh":return fe(2);case"a":return te(L,X,!0);case"A":return te(L,X,!1);case"m":return String(X);case"mm":return _.s(X,2,"0");case"s":return String(W.$s);case"ss":return _.s(W.$s,2,"0");case"SSS":return _.s(W.$ms,3,"0");case"Z":return k}return null}(ee)||k.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(F,W,M){var B,k=this,L=_.p(W),X=A(F),T=(X.utcOffset()-this.utcOffset())*r,ce=this-X,ge=function(){return _.m(k,X)};switch(L){case m:B=ge()/12;break;case d:B=ge();break;case p:B=ge()/3;break;case f:B=(ce-T)/6048e5;break;case u:B=(ce-T)/864e5;break;case c:B=ce/i;break;case s:B=ce/r;break;case l:B=ce/n;break;default:B=ce}return M?B:_.a(B)},O.daysInMonth=function(){return this.endOf(d).$D},O.$locale=function(){return S[this.$L]},O.locale=function(F,W){if(!F)return this.$L;var M=this.clone(),B=R(F,W,!0);return B&&(M.$L=B),M},O.clone=function(){return _.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},K}(),Y=N.prototype;return A.prototype=Y,[["$ms",a],["$s",l],["$m",s],["$H",c],["$W",u],["$M",d],["$y",m],["$D",g]].forEach(function(K){Y[K[1]]=function(O){return this.$g(O,K[0],K[1])}}),A.extend=function(K,O){return K.$i||(K(O,N,A),K.$i=!0),A},A.locale=R,A.isDayjs=I,A.unix=function(K){return A(1e3*K)},A.en=S[C],A.Ls=S,A.p={},A})})(eO);var T8=eO.exports;const ut=zr(T8);var tO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ma,function(){return function(n,r,i){n=n||{};var a=r.prototype,l={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 s(u,f,d,p){return a.fromToBase(u,f,d,p)}i.en.relativeTime=l,a.fromToBase=function(u,f,d,p,m){for(var g,y,x,v=d.$locale().relativeTime||l,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 C=b[j];C.d&&(g=p?i(u).diff(d,C.d,!0):d.diff(u,C.d,!0));var S=(n.rounding||Math.round)(Math.abs(g));if(x=g>0,S<=C.r||!C.r){S<=1&&j>0&&(C=b[j-1]);var E=v[C.l];m&&(S=m(""+S)),y=typeof E=="string"?E.replace("%d",S):E(S,f,C.l,x);break}}if(f)return y;var I=x?v.future:v.past;return typeof I=="function"?I(y):I.replace("%s",y)},a.to=function(u,f){return s(u,f,this,!0)},a.from=function(u,f){return s(u,f,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)}}})})(tO);var O8=tO.exports;const Hx=zr(O8),$c=({currentPage:e,totalItems:t,pageSize:n,onPageChange:r,onPageSizeChange:i,pageSizeOptions:a=[10,20,50,100]})=>{const l=Math.max(1,Math.ceil(t/n)),s=e===1,c=e>=l,u=()=>{s||r(1)},f=()=>{s||r(e-1)},d=()=>{c||r(e+1)},p=()=>{c||r(l)},m=g=>{const y=parseInt(g.target.value,10);i(y)};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:s,children:"首页"}),o.jsx("button",{className:"pagination-btn",onClick:f,disabled:s,children:"上一页"}),o.jsxs("span",{className:"pagination-info",children:["第 ",e," / ",l," 页"]}),o.jsx("button",{className:"pagination-btn",onClick:d,disabled:c,children:"下一页"}),o.jsx("button",{className:"pagination-btn",onClick:p,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))}),"条"]})})]})},A8=["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"],I8=e=>{const t=e.toLowerCase();return!!(A8.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,""))))},N8=e=>!e||e.length<=8?"***":`${e.slice(0,4)}${"*".repeat(Math.min(e.length-8,20))}${e.slice(-4)}`,_v=e=>{if(e==null)return e;if(Array.isArray(e))return e.map(t=>_v(t));if(typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))I8(n)?t[n]=typeof r=="string"?N8(r):"***":typeof r=="object"?t[n]=_v(r):t[n]=r;return t}return e},Er=({data:e,title:t,collapsed:n=!1})=>{const[r,i]=h.useState(!n),[a,l]=h.useState(!1),s=f=>{try{let d;typeof f=="string"?d=JSON.parse(f):d=f;const p=_v(d);return JSON.stringify(p,null,2)}catch{return typeof f=="string"?f:String(f)}},c=()=>{const f=s(e);navigator.clipboard.writeText(f).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)}).catch(d=>{console.error("Failed to copy JSON:",d)})},u=s(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 du(e){const t=e.split(`
114
- `).map(r=>r.trim()).join(`
115
- `).split(`
116
-
117
- `).filter(r=>r.trim()),n=[];for(const r of t){let i="",a=[],l=0;r.split(`
118
- `).forEach(f=>{if(/^[a-z]+:/.test(f)){const d=f.indexOf(":"),p=f.slice(0,d).trim(),m=f.slice(d+1).trim();p==="event"?i=m:p==="data"?(a.push(m),l=1):a.length&&(l=-1)}else l===1&&a.push(f)});const c=a.length>0?a.join(`
119
- `).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 s,c;let n="",r="",i=!1,a=!1,l=!1;for(const u of e){const f=u.data;if(f){if(u.event==="content_block_start"&&f.content_block){const d=f.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"&&f.delta){f.delta.type==="text_delta"&&a?n+=f.delta.text||"":f.delta.type==="thinking_delta"&&i&&(r+=f.delta.thinking||"");continue}if(u.event==="response.reasoning_text.delta"&&f.delta!==void 0){r+=f.delta||"",l=!0;continue}if(u.event==="response.content_part.done"&&f.part){const d=f.part;d.type==="reasoning_text"&&d.text?l||(r=d.text):d.type==="output_text"&&d.text&&(n+=d.text);continue}if(!u.event&&f.choices){const d=(c=(s=f.choices)==null?void 0:s[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}(f.reasoning_content||f.thinking)&&(r+=f.reasoning_content||f.thinking||"")}}return{text:n,thinking:r}}function _8(e,t){if(!e||e.length===0)return{text:"",thinking:""};const n=du(e);return fu(n)}function nO(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}=_8(e.downstreamResponseBody,e.targetType);if(console.log("[assembleResponseBody] assembled text:",{textLength:r.length,thinkingLength:i.length}),e.targetType==="claude-code"){const l=[];i&&l.push({type:"thinking",thinking:i}),r&&l.push({type:"text",text:r}),l.length===0&&l.push({type:"text",text:"(空内容 - 可能响应未完成或解析失败)"});const s={type:"message",role:"assistant",content:l,model:e.targetModel||e.requestModel,usage:e.usage};return console.log("[assembleResponseBody] returning claude-code format with",l.length,"content blocks"),s}else if(e.targetType==="codex"){const l={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"),l}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 M8(e){const t=[];t.push(`# 请求日志详情
120
- `),t.push("## 基本信息"),t.push(`- **日志ID**: ${e.id}`),t.push(`- **时间**: ${ut(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${Yl[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=nO(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=du(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(`
121
- `)}function R8(e){const t=[];return t.push(`# 错误日志详情
122
- `),t.push("## 基本信息"),t.push(`- **ID**: ${e.id}`),t.push(`- **时间**: ${ut(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${Yl[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(`
123
- `)}const D8=1e6;function L8(e){return"errorMessage"in e}function z8({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 $8({log:e}){const[t,n]=h.useState(!1),[r,i]=h.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:ut(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:Yl[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,l)=>o.jsx("span",{style:{padding:"4px 12px",backgroundColor:"#3498db",color:"white",borderRadius:"12px",fontSize:"13px",fontWeight:"500"},children:a},l))})]}),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(Er,{data:e.headers,collapsed:!0})]}),e.body&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(Er,{data:e.body,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(Er,{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(Er,{data:e.responseHeaders,collapsed:!0})]}),(()=>{const a=nO(e);return console.log("[RequestLogDetail] assembledBody:",a),a?o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(Er,{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}
124
- 输出: ${e.usage.outputTokens}
125
- `+(e.usage.totalTokens!==void 0?`总计: ${e.usage.totalTokens}
126
- `:"")+(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(Er,{data:e.downstreamResponseBody,collapsed:!0})]}),(()=>{const a=e.downstreamResponseBody;if(!a||!(typeof a=="string"&&(a.includes("event:")||a.includes("data:"))))return null;const s=du(a);return o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["Stream Events (",s.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:s.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(Er,{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(z8,{events:s})})]})})()]})}function B8({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:ut(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:Yl[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(Er,{data:e.requestHeaders,collapsed:!0})]}),e.requestBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(Er,{data:e.requestBody,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(Er,{data:e.upstreamRequest})]}),e.responseHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应头"}),o.jsx(Er,{data:e.responseHeaders,collapsed:!0})]}),e.responseBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(Er,{data:e.responseBody})]})]})}function Tf({log:e,onClose:t,zIndex:n}){const r=n??D8,i=L8(e),a=()=>{const l=i?R8(e):M8(e);navigator.clipboard.writeText(l).then(()=>{U.success("复制成功")}).catch(()=>{U.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(B8,{log:e}):o.jsx($8,{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 F8=!1;ut.extend(Hx);function U8(){const{confirm:e}=uu(),[t,n]=h.useState("request"),[r,i]=h.useState([]),[a,l]=h.useState([]),[s,c]=h.useState(null),[u,f]=h.useState(null),[d,p]=h.useState(1),[m,g]=h.useState(20),[y,x]=h.useState(0),[v,b]=h.useState(1),[w,j]=h.useState(20),[C,S]=h.useState(0),[E,I]=h.useState(!1),[R,A]=h.useState(!1),[_,N]=h.useState(10),[Y,K]=h.useState([]),[O,F]=h.useState([]),[W,M]=h.useState(""),[B,k]=h.useState(""),[L,X]=h.useState(""),[T,ce]=h.useState(""),[ge,Q]=h.useState(""),[ae,fe]=h.useState("");h.useEffect(()=>{te()},[t,d,m,v,w,ge,ae]),h.useEffect(()=>{ee(),le()},[]),h.useEffect(()=>{let Z=null,G=null;return R&&(G=setInterval(()=>{N(oe=>oe<=1?10:oe-1)},1e3),Z=setInterval(()=>{te(),le()},1e4)),()=>{Z&&clearInterval(Z),G&&clearInterval(G)}},[R,t,d,m,v,w]);const te=async()=>{I(!0);try{if(t==="request"){const Z=(d-1)*m,[G,oe]=await Promise.all([ge.trim()?H.searchLogs(ge.trim(),m,Z):H.getLogs(m,Z),ge.trim()?H.searchLogsCount(ge.trim()):H.getLogsCount()]);i(G),x(oe.count)}else if(t==="error"){const Z=(v-1)*w,[G,oe]=await Promise.all([ae.trim()?H.searchErrorLogs(ae.trim(),w,Z):H.getErrorLogs(w,Z),ae.trim()?H.searchErrorLogsCount(ae.trim()):H.getErrorLogsCount()]);l(G),S(oe.count)}}catch(Z){console.error("Failed to load logs:",Z)}finally{I(!1)}},ee=async()=>{try{const[Z,G]=await Promise.all([H.getVendors(),H.getAPIServices()]);K(Z),F(G)}catch(Z){console.error("Failed to load vendors and services:",Z)}},le=async()=>{try{const[Z,G]=await Promise.all([H.getLogsCount(),H.getErrorLogsCount()]);x(Z.count),S(G.count)}catch(Z){console.error("Failed to load counts:",Z)}},ne=Z=>Z?Z>=200&&Z<300?"badge-success":Z>=400&&Z<500?"badge-warning":"badge-danger":"badge-danger",Ae=Z=>{k(Z),X(""),ce("")},be=Z=>{X(Z),ce("")},Re=()=>B?O.filter(Z=>Z.vendorId===B):[],$e=()=>{if(!L)return[];const Z=O.find(G=>G.id===L);return(Z==null?void 0:Z.supportedModels)||[]},Ie=(Z=>Z.filter(G=>!(W&&G.targetType!==W||B&&G.vendorId!==B||L&&G.targetServiceId!==L||T&&G.targetModel!==T)))(r),Te=Z=>{p(Z)},Ve=Z=>{g(Z),p(1)},Ge=Z=>{b(Z)},Ke=Z=>{j(Z),b(1)},gt=()=>Ie.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:Ie.map(Z=>o.jsxs("tr",{children:[o.jsx("td",{children:ut(Z.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:Yl[Z.targetType]?o.jsx("span",{className:`badge ${Z.targetType==="claude-code"?"badge-claude-code":Z.targetType==="codex"?"badge-codex":"badge-info"}`,children:Yl[Z.targetType]}):"-"}),o.jsx("td",{children:Z.path}),o.jsx("td",{children:o.jsx("span",{className:`badge ${ne(Z.statusCode)}`,children:Z.statusCode||"Error"})}),o.jsx("td",{children:Z.responseTime?`${Z.responseTime}ms`:"-"}),o.jsx("td",{children:Z.usage?o.jsxs("span",{children:[Z.usage.totalTokens?Z.usage.totalTokens:Z.usage.inputTokens+Z.usage.outputTokens," tokens"]}):"-"}),o.jsx("td",{children:o.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[(()=>{const G=Z.downstreamResponseBody;return typeof G=="string"&&(G.includes("event:")||G.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(Z),children:"详情"})]})})]},Z.id))})]}),Nt=()=>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(Z=>o.jsxs("tr",{children:[o.jsx("td",{children:ut(Z.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:Z.method})}),o.jsx("td",{children:Z.path}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:Z.statusCode||"-"})}),o.jsx("td",{style:{maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#e74c3c"},children:Z.errorMessage}),o.jsx("td",{children:o.jsx("button",{className:"btn btn-secondary",onClick:()=>f(Z),children:"详情"})})]},Z.id))})]});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请求日志"})]}),F8]})}),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:["请求日志 (",y,")"]}),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:["错误日志 (",C,")"]})]})}),o.jsxs("div",{className:"toolbar",children:[o.jsxs("h3",{children:[t==="error"&&"错误日志列表",t==="request"&&"请求日志列表"]}),o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[t==="request"&&o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("input",{type:"text",placeholder:"搜索日志内容...",value:ge,onChange:Z=>{Q(Z.target.value),p(1)},onKeyDown:Z=>{Z.key==="Enter"&&te()},style:{padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",width:"200px",fontSize:"14px"}}),ge&&o.jsx("button",{onClick:()=>{Q(""),p(1)},style:{padding:"6px 10px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",cursor:"pointer",fontSize:"13px"},children:"清除"})]}),t==="error"&&o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("input",{type:"text",placeholder:"搜索错误日志...",value:ae,onChange:Z=>{fe(Z.target.value),b(1)},onKeyDown:Z=>{Z.key==="Enter"&&te()},style:{padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",width:"200px",fontSize:"14px"}}),ae&&o.jsx("button",{onClick:()=>{fe(""),b(1)},style:{padding:"6px 10px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",cursor:"pointer",fontSize:"13px"},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:R,onChange:Z=>{A(Z.target.checked),Z.target.checked&&N(10)},style:{cursor:"pointer"}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",R&&`(⏱ ${_}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{te(),le(),N(10)},children:"刷新"})]})]}),t==="request"&&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:{fontWeight:"bold",color:"var(--text-primary)"},children:"来源类型:"}),o.jsxs("select",{value:W,onChange:Z=>M(Z.target.value),style:{padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},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:"8px"},children:[o.jsx("label",{style:{fontWeight:"bold",color:"var(--text-primary)"},children:"供应商:"}),o.jsxs("select",{value:B,onChange:Z=>Ae(Z.target.value),style:{padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",minWidth:"150px",background:"var(--bg-card)",color:"var(--text-primary)"},children:[o.jsx("option",{value:"",children:"全部供应商"}),Y.map(Z=>o.jsx("option",{value:Z.id,children:Z.name},Z.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:{fontWeight:"bold",color:"var(--text-primary)"},children:"API服务:"}),o.jsxs("select",{value:L,onChange:Z=>be(Z.target.value),disabled:!B,style:{padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",minWidth:"150px",background:B?"var(--bg-card)":"var(--bg-secondary)",color:"var(--text-primary)",cursor:B?"pointer":"not-allowed",opacity:B?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),Re().map(Z=>o.jsx("option",{value:Z.id,children:Z.name},Z.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:{fontWeight:"bold",color:"var(--text-primary)"},children:"模型:"}),o.jsxs("select",{value:T,onChange:Z=>ce(Z.target.value),disabled:!L,style:{padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",minWidth:"150px",background:L?"var(--bg-card)":"var(--bg-secondary)",color:"var(--text-primary)",cursor:L?"pointer":"not-allowed",opacity:L?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),$e().map(Z=>o.jsx("option",{value:Z,children:Z},Z))]})]}),(W||B||L||T)&&o.jsx("button",{onClick:()=>{M(""),k(""),X(""),ce("")},style:{padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--accent-danger)",background:"var(--accent-danger)",color:"white",cursor:"pointer",fontSize:"14px"},children:"清除筛选"})]}),t==="request"&&o.jsxs(o.Fragment,{children:[E?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):gt(),!E&&o.jsx($c,{currentPage:d,totalItems:y,pageSize:m,onPageChange:Te,onPageSizeChange:Ve})]}),t==="error"&&o.jsxs(o.Fragment,{children:[E?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):Nt(),!E&&o.jsx($c,{currentPage:v,totalItems:C,pageSize:w,onPageChange:Ge,onPageSizeChange:Ke})]})]}),s&&o.jsx(Tf,{log:s,onClose:()=>c(null)}),u&&o.jsx(Tf,{log:u,onClose:()=>f(null)})]})}function W8({session:e,onClose:t}){var _;const[n,r]=h.useState(e.targetType==="claude-code"?"codex":"claude-code"),[i,a]=h.useState(!1),[l,s]=h.useState(!0),[c,u]=h.useState(0),[f,d]=h.useState(!1),[p,m]=h.useState(null),[g,y]=h.useState(""),[x,v]=h.useState(null),[b,w]=h.useState(!1),j=e.targetType==="claude-code"?"Claude Code":"Codex",C=n==="claude-code"?"Claude Code":"Codex",S=(()=>{const N=e.lastRequestAt-e.firstRequestAt,Y=Math.floor(N/6e4);return Y<1?`${Math.max(1,Math.floor(N/1e3))}秒`:Y<60?`${Y}分钟`:`${Math.floor(Y/60)}小时${Y%60}分钟`})(),E=async()=>{d(!0),m(null),v(null);try{const N={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:l,maxRounds:c},Y=await H.migrationPreview(e.id,N);m(Y),y(Y.generatedPrompt)}catch(N){U.error(N.message||"预览失败")}finally{d(!1)}},I=async()=>{const N=g||(p==null?void 0:p.generatedPrompt)||"";try{await navigator.clipboard.writeText(N),U.success("已复制到剪贴板!请打开 "+C+",粘贴为第一条消息")}catch{const Y=document.querySelector(".migration-prompt-textarea");Y?(Y.select(),document.execCommand("copy"),U.success("已复制到剪贴板!")):U.error("复制失败,请手动选择内容复制")}},R=async()=>{if(x!=null&&x.command)try{await navigator.clipboard.writeText(x.command),U.success("命令已复制!请在终端中执行")}catch{U.error("复制失败")}},A=async()=>{w(!0),v(null);try{const N={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:l,maxRounds:c},Y=await H.migrateLaunch(e.id,N);v(Y),Y.success&&U.success(`已在新的终端窗口中启动 ${C}`)}catch(N){U.error(N.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," 会话迁移到 ",C]})]}),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:((_=e.title)==null?void 0:_.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"),v(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"),v(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:l,onChange:N=>s(N.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:N=>a(N.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:N=>u(Number(N.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:E,disabled:f,children:f?"加载中...":"预览迁移内容"})}),!p&&!f&&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 后即可启动目标工具或复制到剪贴板"})]})]}),p&&o.jsxs("div",{className:"migration-preview-section",style:{marginTop:"16px"},children:[o.jsx("textarea",{className:"migration-prompt-textarea",value:g,onChange:N=>y(N.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: ",p.estimatedTokens.toLocaleString(),p.warnings.map((N,Y)=>o.jsxs("span",{style:{color:"#e67e22",marginLeft:"12px"},children:["⚠ ",N]},Y)),p.content.extractedRounds>0&&o.jsxs("span",{style:{color:"var(--text-tertiary)",marginLeft:"12px"},children:[p.content.extractedRounds,"/",p.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:["✅ 已在新终端窗口中启动 ",C]}),o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:["请在新终端窗口中继续与 ",C," 交互"]})]}):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:R,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((N,Y)=>o.jsxs("div",{children:["• ",N]},Y))})]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:A,disabled:b||!p,title:p?"":"请先预览迁移内容",children:b?"启动中...":`🚀 启动 ${C}`}),o.jsx("button",{className:"btn btn-secondary",onClick:I,disabled:!p,title:p?"":"请先预览迁移内容",children:"📋 复制到剪贴板"}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"关闭"})]})]})]})}function K8({session:e,onClose:t,onBound:n}){var v;const[r,i]=h.useState([]),[a,l]=h.useState({}),[s,c]=h.useState(e.routeId||null),[u,f]=h.useState(!1),[d,p]=h.useState(!0),m=e.targetType==="claude-code"?"Claude Code":"Codex";h.useEffect(()=>{(async()=>{try{const w=await H.getRoutes();i(w);const j={};for(const C of w)try{const S=await H.getRules(C.id);j[C.id]=S.length}catch{j[C.id]=0}l(j)}catch{U.error("加载路由列表失败")}finally{p(!1)}})()},[]);const g=async()=>{if(s){f(!0);try{const b=await H.bindSessionRoute(e.id,s);b.success?(U.success("路由绑定成功"),n(),t()):U.error(b.error||"绑定失败")}catch(b){U.error(b.message||"绑定失败")}finally{f(!1)}}},y=async()=>{f(!0);try{const b=await H.unbindSessionRoute(e.id);b.success?(U.success("已解除路由绑定"),n(),t()):U.error(b.error||"解绑失败")}catch(b){U.error(b.message||"解绑失败")}finally{f(!1)}},x=s!==(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:((v=e.title)==null?void 0:v.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=s===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:y,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||!s||!x,children:u?"处理中...":"确认绑定"})]})]})]})}const q8=Array.from({length:15},(e,t)=>t+1);function H8({onClose:e,onCleared:t}){const[n,r]=h.useState(7),[i,a]=h.useState(!1),[l,s]=h.useState(!1),c=async()=>{s(!0);try{const f=await H.cleanupSessions(n,i);f.sessionsAffected===0?U.info("没有符合条件的会话需要清除"):i?U.success(`已清除 ${f.sessionsAffected} 个会话的日志(共 ${f.logsDeleted} 条),会话记录已保留`):U.success(`已清除 ${f.sessionsAffected} 个会话及其关联日志(共 ${f.logsDeleted} 条)`),t(),e()}catch(f){U.error(f.message||"清除会话失败")}finally{s(!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:f=>r(Number(f.target.value)),disabled:l,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:q8.map(f=>o.jsx("option",{value:f,children:f},f))}),o.jsx("span",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"天以前的会话"})]})]}),o.jsxs("div",{onClick:()=>!l&&a(f=>!f),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:l?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",opacity:l?.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:l,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:c,disabled:l,children:l?"处理中...":"确认清除"})]})]})]})}ut.extend(Hx);function V8(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 l=[];const s=()=>{l.length>0&&(i.push({role:"user",content:l.join(`
127
- `),timestamp:t,model:n}),l=[])};for(const c of a)if((c==null?void 0:c.type)==="text"&&(c!=null&&c.text))l.push(c.text);else if((c==null?void 0:c.type)==="image"||(c==null?void 0:c.type)==="image_url")l.push("[图片]");else if((c==null?void 0:c.type)==="tool_result"){s();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(`
128
- `):u=JSON.stringify(c.content));const f=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):"",p=f?`[工具结果: ${f}${d?` · ...${d}`:""}]`:d?`[工具结果: ...${d}]`:"[工具结果]";i.push({role:"user",type:"tool_result",header:p,content:u||p,timestamp:t,model:n})}s()}}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 l="",s="";for(const c of a)if(c.type==="text"&&c.text&&(l+=c.text),c.type==="thinking"&&c.thinking&&(s+=c.thinking),c.type==="tool_use"){(l||s)&&(i.push({role:"assistant",content:l,thinking:s||void 0,timestamp:t,model:n}),l="",s="");const u=c.name||"",f=c.id?c.id.slice(-8):"",d=u+(f?` · ...${f}`:""),p=c.input?JSON.stringify(c.input,null,2):"";i.push({role:"assistant",type:"tool_use",header:`[工具调用: ${d}]`,content:p||`[工具调用: ${d}]`,timestamp:t,model:n})}(l||s)&&i.push({role:"assistant",content:l||"",thinking:s||void 0,timestamp:t,model:n})}}return i}function Y8(e){var i,a,l,s,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=du(r),{text:f,thinking:d}=fu(u);if(f||d)return t.push({role:"assistant",content:f||"",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 f="",d="";for(const p of u.content)if(p.type==="text"&&p.text&&(f+=p.text),p.type==="thinking"&&p.thinking&&(d+=p.thinking),p.type==="tool_use"){(f||d)&&(t.push({role:"assistant",content:f,thinking:d||void 0,...n}),f="",d="");const m=p.name||"",g=p.id?p.id.slice(-8):"",y=m+(g?` · ...${g}`:""),x=p.input?JSON.stringify(p.input,null,2):"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${y}]`,content:x||`[工具调用: ${y}]`,...n})}if((f||d)&&t.push({role:"assistant",content:f||"",thinking:d||void 0,...n}),t.length>0)return t}if((l=(a=u.choices)==null?void 0:a[0])!=null&&l.message){const f=u.choices[0].message;if(f.content&&t.push({role:"assistant",content:f.content,...n}),f.tool_calls&&Array.isArray(f.tool_calls))for(const d of f.tool_calls){const p=((s=d.function)==null?void 0:s.name)||"",m=d.id?d.id.slice(-8):"",g=p+(m?` · ...${m}`:""),y=((c=d.function)==null?void 0:c.arguments)||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${g}]`,content:y||`[工具调用: ${g}]`,...n})}if(t.length>0)return t}if(u.output){let f="";const d=Array.isArray(u.output)?u.output:[u.output];for(const p of d){if(p.type==="message"&&p.content){const m=Array.isArray(p.content)?p.content:[p.content];for(const g of m)g.type==="output_text"&&g.text?f+=g.text:typeof g=="string"&&(f+=g)}if(p.type==="function_call"){f&&(t.push({role:"assistant",content:f,...n}),f="");const m=p.name||"",g=p.call_id?p.call_id.slice(-8):"",y=m+(g?` · ...${g}`:""),x=p.arguments||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${y}]`,content:x||`[工具调用: ${y}]`,...n})}}if(f&&t.push({role:"assistant",content:f,...n}),t.length>0)return t}}catch{}return t}function Vx(e){var i,a;const t=[];let n=0;const r=new Map;for(const l of e){const s=((i=l.body)==null?void 0:i.messages)||[];for(const c of s)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 l of e){const s=((a=l.body)==null?void 0:a.messages)||[],c=s.slice(n);n=s.length;for(const f of c){const d=V8(f,l.timestamp,l.requestModel,r);t.push(...d)}const u=Y8(l);t.push(...u)}return G8(t)}function G8(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,l=!!i.tokens;a&&!l&&(t[r]=n)}}return t}function yo(e){return(e||"").replace("<session>","").replace("</session>","").trim()||"(无标题)"}function X8({content:e,header:t,forceCollapsible:n,hideContentWhenCollapsed:r}){const i=e.split(`
129
- `),a=10,l=3,s=h.useRef(null),c=!!n,u=n||i.length>a,f=c?l:a,[d,p]=h.useState(!u),m=()=>{d?(requestAnimationFrame(()=>{const g=s.current,y=g==null?void 0:g.closest(".modal-body-scrollable");if(g&&y){const x=g.getBoundingClientRect(),v=y.getBoundingClientRect();(x.top<v.top||x.top>v.bottom)&&g.scrollIntoView({block:"start"})}}),p(!1)):p(!0)};return u?!d&&r?o.jsx("div",{className:"chat-collapsible-wrapper",ref:s,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:s,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,f).join(`
130
- `)}),!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 Q8({logs:e,onFetchNew:t}){const n=[...e].sort((m,g)=>m.timestamp-g.timestamp),[r,i]=h.useState(n),a=Vx(r),l=h.useRef(null),[s,c]=h.useState(!1),[u,f]=h.useState(!1);h.useEffect(()=>{i([...e].sort((m,g)=>m.timestamp-g.timestamp))},[e]),h.useEffect(()=>{var y;const m=(y=l.current)==null?void 0:y.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=l.current)==null?void 0:g.parentElement;m&&m.scrollTo({top:m.scrollHeight,behavior:"smooth"})},p=async()=>{if(s&&t){f(!0);try{const m=await t(),g=new Set(r.map(v=>v.id)),x=[...m].sort((v,b)=>v.timestamp-b.timestamp).filter(v=>!g.has(v.id));x.length>0&&(i(v=>[...v,...x]),requestAnimationFrame(()=>d()))}finally{f(!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:l,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(X8,{content:m.content,header:m.header,forceCollapsible:!!m.type,hideContentWhenCollapsed:m.type==="tool_use"})]}),!m.type&&o.jsxs("div",{className:"chat-meta",children:[ut(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:p,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 rO({session:e,logs:t,logsLoading:n,onRefreshLogs:r,onFetchNewLogs:i,onClose:a,onExport:l}){const[s,c]=h.useState("logs"),[u,f]=h.useState(null),d=(g,y)=>{const x=y-g;return x<6e4?`${Math.floor(x/1e3)}秒`:x<36e5?`${Math.floor(x/6e4)}分钟`:`${Math.floor(x/36e5)}小时`},p=g=>g>=1e6?(g/1e6).toFixed(1)+"M":g>=1e3?(g/1e3).toFixed(1)+"k":String(g),m=()=>{if(l){l(e,t,s);return}const y=`${yo(e.title)}.json`;if(s==="chat"){const x=Vx(t),v={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(C=>({role:C.role,type:C.type,header:C.header,content:C.content,thinking:C.thinking,timestamp:C.timestamp,model:C.model,tokens:C.tokens}))},b=new Blob([JSON.stringify(v,null,2)],{type:"application/json"}),w=URL.createObjectURL(b),j=document.createElement("a");j.href=w,j.download=y,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},v=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),b=URL.createObjectURL(v),w=document.createElement("a");w.href=b,w.download=y,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:s==="logs"?"active":"",onClick:()=>c("logs"),children:"日志"}),o.jsx("button",{className:s==="chat"?"active":"",onClick:()=>c("chat"),children:"对话"})]})]}),o.jsx("div",{className:"modal-body-scrollable",children:s==="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:yo(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"})," ",p(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:"首次请求"})," ",ut(e.firstRequestAt).format("YYYY-MM-DD HH:mm:ss")]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"最后请求"})," ",ut(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,y)=>g.timestamp-y.timestamp).map(g=>o.jsxs("tr",{children:[o.jsx("td",{children:ut(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:()=>f(g),children:"详情"})})]},g.id))})]})})]}):o.jsx(o.Fragment,{children:n?o.jsx("div",{style:{textAlign:"center",padding:"20px"},children:"加载中..."}):o.jsx(Q8,{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(Tf,{log:u,onClose:()=>f(null)})]})}ut.extend(Hx);function J8(){const[e,t]=h.useState([]),[n,r]=h.useState(0),[i,a]=h.useState(1),[l,s]=h.useState(20),[c,u]=h.useState(null),[f,d]=h.useState([]),[p,m]=h.useState(!1),[g,y]=h.useState(""),[x,v]=h.useState(""),[b,w]=h.useState(!1),[j,C]=h.useState(10),[S,E]=h.useState(null),[I,R]=h.useState(null),[A,_]=h.useState(!1);h.useEffect(()=>{Y()},[i,l]),h.useEffect(()=>{let k=null,L=null;return b&&(L=setInterval(()=>{C(X=>X<=1?10:X-1)},1e3),k=setInterval(()=>{Y()},1e4)),()=>{k&&clearInterval(k),L&&clearInterval(L)}},[b,i,l]);const N=e.filter(k=>{if(x&&k.targetType!==x)return!1;if(g.trim()){const L=g.trim().toLowerCase(),X=(k.title||"").toLowerCase(),T=k.id.toLowerCase();if(!X.includes(L)&&!T.includes(L))return!1}return!0}),Y=async()=>{try{const k=(i-1)*l,[L,X]=await Promise.all([H.getSessions(l,k),H.getSessionsCount()]);t(L),r(X.count)}catch(k){console.error("Failed to load sessions:",k)}},K=async k=>{u(k),m(!0);try{const L=await H.getSessionLogs(k.id,1e4);d(L)}catch(L){console.error("Failed to load session logs:",L)}finally{m(!1)}},O=(k,L)=>{const X=L-k;return X<6e4?`${Math.floor(X/1e3)}秒`:X<36e5?`${Math.floor(X/6e4)}分钟`:`${Math.floor(X/36e5)}小时`},F=k=>k==="claude-code"?o.jsx("span",{className:"badge badge-claude-code",children:"Claude Code"}):k==="codex"?o.jsx("span",{className:"badge badge-codex",children:"Codex"}):o.jsx("span",{className:"badge",children:k}),W=(k,L,X)=>{const T=k;if(X==="chat"){const ne=Vx(L).map((Te,Ve)=>({index:Ve+1,role:Te.role,type:Te.type||null,header:Te.header||null,content:Te.content,thinking:Te.thinking||null,timestamp:ut(Te.timestamp).format("YYYY-MM-DD HH:mm:ss"),model:Te.model||null,tokens:Te.tokens||null})),Ae={session:{id:T.id,title:yo(T.title),targetType:T.targetType,requestCount:T.requestCount,totalTokens:T.totalTokens,firstRequestAt:ut(T.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:ut(T.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:O(T.firstRequestAt,T.lastRequestAt)},messages:ne,exportedAt:ut().format("YYYY-MM-DD HH:mm:ss")},be=JSON.stringify(Ae,null,2),Re=new Blob([be],{type:"application/json;charset=utf-8"}),$e=URL.createObjectURL(Re),xe=document.createElement("a");xe.href=$e;const Ie=yo(T.title).replace(/[\\/:*?"<>|]/g,"_");xe.download=`${Ie}_对话.json`,document.body.appendChild(xe),xe.click(),document.body.removeChild(xe),URL.revokeObjectURL($e),U.success("对话数据已导出");return}const ce=L.map((le,ne)=>{var $e,xe,Ie,Te;const Ae=(($e=le.body)==null?void 0:$e.messages)||[];let be="";const Re=le.downstreamResponseBody;if(typeof Re=="string"&&(Re.includes("event:")||Re.includes("data:"))){const Ve=du(Re),{text:Ge,thinking:Ke}=fu(Ve),gt=[];Ke&&gt.push(`<details><summary>思考过程</summary>
131
-
132
- ${Ke}
133
-
134
- </details>`),Ge&&gt.push(Ge),be=gt.join(`
135
-
136
- `)}if(!be&&le.responseBody)try{const Ve=typeof le.responseBody=="string"?JSON.parse(le.responseBody):le.responseBody;if(Ve.content){if(Array.isArray(Ve.content)){const Ge=[];for(const Ke of Ve.content)Ke.type==="text"&&Ke.text?Ge.push(Ke.text):Ke.type==="thinking"&&Ke.thinking&&Ge.push(`<details><summary>思考过程</summary>
137
-
138
- ${Ke.thinking}
139
-
140
- </details>`);be=Ge.join(`
141
-
142
- `)}typeof Ve.content=="string"&&(be=Ve.content)}!be&&((Te=(Ie=(xe=Ve.choices)==null?void 0:xe[0])==null?void 0:Ie.message)!=null&&Te.content)&&(be=Ve.choices[0].message.content)}catch{}return{index:ne+1,timestamp:ut(le.timestamp).format("YYYY-MM-DD HH:mm:ss"),statusCode:le.statusCode||null,responseTime:le.responseTime||null,requestModel:le.requestModel||null,targetModel:le.targetModel||null,vendorName:le.vendorName||null,serviceName:le.targetServiceName||null,contentType:le.contentType||null,tags:le.tags||[],usage:le.usage||null,messages:Ae,response:be||null}}),ge={session:{id:T.id,title:T.title||null,targetType:T.targetType,requestCount:T.requestCount,totalTokens:T.totalTokens,model:T.model||null,vendorName:T.vendorName||null,serviceName:T.serviceName||null,firstRequestAt:ut(T.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:ut(T.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:O(T.firstRequestAt,T.lastRequestAt)},logs:ce,exportedAt:ut().format("YYYY-MM-DD HH:mm:ss")},Q=JSON.stringify(ge,null,2),ae=new Blob([Q],{type:"application/json;charset=utf-8"}),fe=URL.createObjectURL(ae),te=document.createElement("a");te.href=fe;const ee=yo(T.title).replace(/[\\/:*?"<>|]/g,"_");te.download=`${ee}.json`,document.body.appendChild(te),te.click(),document.body.removeChild(te),URL.revokeObjectURL(fe),U.success("导出成功")},M=k=>a(k),B=k=>{s(k),a(1)};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:()=>_(!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:"8px"},children:[o.jsx("input",{type:"text",placeholder:"搜索标题或ID...",value:g,onChange:k=>{y(k.target.value),a(1)},onKeyDown:k=>{k.key==="Enter"&&Y()},style:{padding:"6px 12px",border:"1px solid var(--border-primary)",borderRadius:"6px",fontSize:"14px",width:"200px",backgroundColor:"var(--input-bg)",color:"var(--text-primary)"}}),g&&o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>{y(""),a(1)},children:"清除"})]}),o.jsxs("select",{value:x,onChange:k=>{v(k.target.value),a(1)},style:{padding:"6px 12px",border:"1px solid var(--border-primary)",borderRadius:"6px",fontSize:"14px",backgroundColor:"var(--input-bg)",color:"var(--text-primary)"},children:[o.jsx("option",{value:"",children:"全部类型"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"})]}),(g||x)&&o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:"#e67e22",color:"white",border:"none"},onClick:()=>{y(""),v(""),a(1)},children:"清除筛选"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("input",{type:"checkbox",id:"auto-refresh",checked:b,onChange:k=>{w(k.target.checked),C(10)}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",b&&`(⏱ ${j}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{Y(),C(10)},children:"刷新"})]})]}),e.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无会话记录"})}):N.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"没有匹配的会话"})}):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:N.map(k=>o.jsxs("tr",{onClick:()=>K(k),style:{cursor:"pointer",backgroundColor:(c==null?void 0:c.id)===k.id?"var(--bg-selected)":void 0},children:[o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:yo(k.title)}),o.jsx("td",{children:F(k.targetType)}),o.jsx("td",{children:k.requestCount}),o.jsx("td",{children:k.totalTokens.toLocaleString()}),o.jsx("td",{children:ut(k.firstRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:ut(k.lastRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:O(k.firstRequestAt,k.lastRequestAt)}),o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",gap:"6px"},children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:L=>{L.stopPropagation(),K(k)},children:"查看"}),o.jsx("button",{className:"btn btn-sm btn-primary",onClick:L=>{L.stopPropagation(),u(k),m(!0),H.getSessionLogs(k.id,1e4).then(X=>d(X)).catch(console.error).finally(()=>m(!1))},children:"对话"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:"#8e44ad",color:"white",border:"none"},onClick:L=>{L.stopPropagation(),E(k)},title:"迁移到另一个工具",children:"迁移"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:k.routeId?"#27ae60":"#2980b9",color:"white",border:"none",minWidth:(k.routeId,void 0)},onClick:L=>{L.stopPropagation(),R(k)},title:k.routeId?`已绑定: ${k.routeName||k.routeId}`:"绑定路由",children:k.routeName?k.routeName.length>8?k.routeName.slice(0,8)+"…":k.routeName:"路由"})]})})]},k.id))})]}),o.jsx($c,{currentPage:i,pageSize:l,totalItems:n,onPageChange:M,onPageSizeChange:B})]})]}),c&&o.jsx(rO,{session:c,logs:f,logsLoading:p,onRefreshLogs:async()=>{if(c){m(!0);try{const k=await H.getSessionLogs(c.id,1e4);d(k)}catch(k){console.error("Failed to refresh session logs:",k)}finally{m(!1)}}},onFetchNewLogs:async()=>{if(!c)return[];const k=await H.getSessionLogs(c.id,1e4);return d(k),k},onClose:()=>{u(null),d([])},onExport:W}),S&&o.jsx(W8,{session:S,onClose:()=>E(null)}),I&&o.jsx(K8,{session:I,onClose:()=>R(null),onBound:()=>{Y()}}),A&&o.jsx(H8,{onClose:()=>_(!1),onCleared:()=>{a(1),Y()}})]})}function Bc({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 Rj({skillId:e,targetType:t,enabled:n,onChange:r,disabled:i}){const a=t==="claude-code"?"Claude Code":"Codex";return o.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:o.jsx(Bc,{checked:n,onChange:l=>r(e,t,l),disabled:i,label:a,labelPosition:"right"})})}function Z8(){var O,F,W,M,B,k;const[e,t]=h.useState(null),[n,r]=h.useState(!0),[i,a]=h.useState("10"),[l,s]=h.useState(""),[c,u]=h.useState(""),[f,d]=h.useState(""),[p,m]=h.useState({proxyEnabled:!1,proxyUrl:"",proxyUsername:"",proxyPassword:""}),[g,y]=h.useState(!1),[x,v]=h.useState(null),[b,w]=h.useState(!1),[j,C]=h.useState(!1);h.useEffect(()=>{S()},[]);const S=async()=>{const L=await H.getConfig();t(L),r(L.enableFailover!==!1),a(typeof L.failoverRecoverySeconds=="number"&&L.failoverRecoverySeconds>0?String(Math.floor(L.failoverRecoverySeconds)):"10"),m({proxyEnabled:L.proxyEnabled||!1,proxyUrl:L.proxyUrl||"",proxyUsername:L.proxyUsername||"",proxyPassword:L.proxyPassword||""}),y(L.enableLanDiscovery||!1)},E=async L=>{L.preventDefault();const X=Number(i),T=Number.isFinite(X)&&X>0?Math.floor(X):10,ce={...e,enableFailover:n,failoverRecoverySeconds:T};await H.updateConfig(ce)?(U.success("配置保存成功"),S()):U.error("配置保存失败")},I=async L=>{L.preventDefault();const X=new FormData(L.currentTarget),T={...e,enableLogging:X.get("enableLogging")==="true",logRetentionDays:parseInt(X.get("logRetentionDays")),maxLogSize:parseInt(X.get("maxLogSize"))};await H.updateConfig(T)?(U.success("日志配置保存成功"),S()):U.error("日志配置保存失败")},R=async L=>{L.preventDefault();const X=new FormData(L.currentTarget),T={...e,proxyEnabled:X.get("proxyEnabled")==="true",proxyUrl:X.get("proxyUrl"),proxyUsername:X.get("proxyUsername"),proxyPassword:X.get("proxyPassword")};await H.updateConfig(T)?(U.success("代理配置保存成功"),S()):U.error("代理配置保存失败")},A=async L=>{y(L);const X={...e,enableLanDiscovery:L};await H.updateConfig(X)?(U.success(L?"已开启局域网同步":"已关闭局域网同步"),S()):(y(!L),U.error("配置保存失败"))},_=async()=>{if(!l){U.warning("请输入密码");return}try{const L=await H.exportData(l);d(L),U.success("导出成功,请复制下方数据")}catch(L){U.error("导出失败: "+L.message)}},N=async()=>{if(!l||!c){U.warning("请输入密码和导入数据");return}w(!0);try{const L=await H.previewImportData(c,l);v(L),L.success||U.error(L.message||"预览失败")}catch(L){U.error("预览失败: "+L.message),v({success:!1,message:L.message})}finally{w(!1)}},Y=async()=>{if(!l||!c||!(x!=null&&x.success)){U.warning("请先预览数据并确认无误");return}C(!0);try{const L=await H.importData(c,l);L.success?(U.success(L.message+(L.details?` (${L.details})`:"")),u(""),s(""),v(null)):U.error(L.message+(L.details?`: ${L.details}`:""))}catch(L){U.error("导入失败: "+L.message)}finally{C(!1)}},K=()=>{v(null),u(""),s("")};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:E,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用智能故障切换"}),o.jsxs("select",{name:"enableFailover",value:n?"true":"false",onChange:L=>r(L.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:L=>a(L.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:I,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:R,children:[o.jsx("input",{type:"hidden",name:"proxyEnabled",value:p.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(Bc,{checked:p.proxyEnabled,onChange:L=>m(X=>({...X,proxyEnabled:L}))}),o.jsx("span",{style:{fontSize:"14px",color:"#666"},children:p.proxyEnabled?"已启用":"未启用"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理地址"}),o.jsx("input",{type:"text",name:"proxyUrl",value:p.proxyUrl,onChange:L=>m(X=>({...X,proxyUrl:L.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:p.proxyUsername,onChange:L=>m(X=>({...X,proxyUsername:L.target.value})),placeholder:"如果代理需要认证"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理密码(可选)"}),o.jsx("input",{type:"password",name:"proxyPassword",value:p.proxyPassword,onChange:L=>m(X=>({...X,proxyPassword:L.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(Bc,{checked:g,onChange:A}),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:l,onChange:L=>s(L.target.value),placeholder:"用于加密导出数据"})]}),o.jsx("button",{className:"btn btn-primary",onClick:_,children:"导出数据"}),f&&o.jsxs("div",{className:"form-group",style:{marginTop:"20px"},children:[o.jsx("label",{children:"导出的数据(请复制保存)"}),o.jsx("textarea",{rows:6,value:f,readOnly:!0,style:{fontFamily:"monospace",fontSize:"12px"}}),o.jsx("button",{className:"btn btn-secondary",style:{marginTop:"10px"},onClick:()=>{navigator.clipboard.writeText(f),U.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:((O=x.data)==null?void 0:O.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:((F=x.data)==null?void 0:F.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:((W=x.data)==null?void 0:W.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:((M=x.data)==null?void 0:M.rules)||0})]})]}),o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:[o.jsxs("div",{children:["数据版本: ",(B=x.data)==null?void 0:B.version]}),o.jsxs("div",{children:["导出时间: ",(k=x.data)!=null&&k.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:Y,disabled:j,children:j?"导入中...":"确认导入"}),o.jsx("button",{className:"btn btn-secondary",onClick:K,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:l,onChange:L=>s(L.target.value),placeholder:"用于解密导入数据"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"导入数据"}),o.jsx("textarea",{rows:6,value:c,onChange:L=>u(L.target.value),placeholder:"粘贴导出的加密数据",style:{fontFamily:"monospace",fontSize:"12px"}})]}),o.jsx("button",{className:"btn btn-primary",onClick:N,disabled:b||!l||!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 e5(){var p,m,g,y,x,v,b,w;const[e,t]=h.useState({claude:!1,codex:!1}),[n,r]=h.useState({claude:!1,codex:!1}),[i,a]=h.useState({claude:null,codex:null}),[l,s]=h.useState("");h.useEffect(()=>{c()},[]);const c=async()=>{try{const[j,C]=await Promise.all([H.getClaudeConfigStatus(),H.getCodexConfigStatus()]);a({claude:j,codex:C})}catch(j){console.error("Failed to check config status:",j)}},u=async j=>{t(C=>({...C,[j]:!0})),s("");try{(j==="claude"?await H.writeClaudeConfig():await H.writeCodexConfig())?(s(`${j==="claude"?"Claude Code":"Codex"}配置文件写入成功!原始文件已备份为 .aicodeswitch_backup 文件。`),await c()):s("写入失败: 操作未成功")}catch(C){s(`写入失败: ${C.message}`)}finally{t(C=>({...C,[j]:!1}))}},f=async j=>{r(C=>({...C,[j]:!0})),s("");try{(j==="claude"?await H.restoreClaudeConfig():await H.restoreCodexConfig())?(s(`${j==="claude"?"Claude Code":"Codex"}配置文件已从备份恢复!`),await c()):s("恢复失败: 操作未成功")}catch(C){s(`恢复失败: ${C.message}`)}finally{r(C=>({...C,[j]:!1}))}},d=j=>{const C=i[j];if(!C)return null;const S=j==="claude"?"Claude Code":"Codex";return C.isOverwritten&&C.isModified?o.jsxs("p",{style:{color:"#f39c12",fontSize:"12px",marginTop:"10px"},children:["⚠️ 检测到",S,"配置已被修改,但备份文件仍然存在。建议先恢复原始配置,再重新写入以确保配置正确。"]}):C.isOverwritten&&!C.isModified?o.jsxs("p",{style:{color:"#27ae60",fontSize:"12px",marginTop:"10px"},children:["✓ ",S,"配置已正确设置为代理模式,且未被修改。"]}):!C.isOverwritten&&C.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||(((p=i.claude)==null?void 0:p.isOverwritten)??!1),children:e.claude?"写入中...":"写入Claude Code配置"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>f("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)&&!((y=i.claude)!=null&&y.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:()=>f("codex"),disabled:n.codex||!(((v=i.codex)==null?void 0:v.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:"⚠️ 配置已被覆盖,如需重新写入请先恢复原始配置"})]}),l&&o.jsx("div",{style:{marginTop:"20px",padding:"10px",borderRadius:"4px",backgroundColor:l.includes("成功")?"#d4edda":"#f8d7da",color:l.includes("成功")?"#155724":"#721c24",border:`1px solid ${l.includes("成功")?"#c3e6cb":"#f5c6cb"}`},children:l})]})}const t5=`# AI Code Switch
143
-
144
- ## 简介
145
-
146
- AI Code Switch 是帮助你在本地管理 AI 编程工具接入大模型的工具。
147
- 它可以让你的 Claude Code、Codex 等工具不再局限于官方模型。
148
- 为所有编程工具提供本地API驱动,自动智能的切换不同场景下的模型。
149
-
150
- **而且它尽可能简单的帮你解决这件事。**
151
-
152
- - 视频演示:[https://www.bilibili.com/video/BV1uEznBuEJd/](https://www.bilibili.com/video/BV1uEznBuEJd/?from=github)
153
- - 1分钟让Claude Code接入GLM国产模型:[https://www.bilibili.com/video/BV1a865B8ErA/](https://www.bilibili.com/video/BV1a865B8ErA/)
154
- - 1分钟让Codex接入免费模型Agnes:[https://www.bilibili.com/video/BV1tQ7Q63Eva/](https://www.bilibili.com/video/BV1tQ7Q63Eva/) Codex接入Deepseek可参考该方法实现
155
-
156
- ## 功能要点
157
-
158
- * 可登记任意的大模型API接口服务,让你可以在一个面板管理你的大模型厂商
159
- * 一键切换模型:可以注册多个供应商的多个API接口,当想要切换模型时,只需要点击一个按钮就可以立即切换
160
- * 自动配置:无需你手动去修改claude code或codex的系统配置文件,aicodeswitch自动帮你修改,你只要启动它,无需配置claude code或codex就可以让它们正常工作
161
- * 一键配置供应商,省去复杂的供应商配置流程
162
- * 启动所有已知大模型接口标准,可接入任意客户端,包括但不限于openclaw、hermes、trae等,根据不同需要自主配置接口对应的大模型服务
163
- * API转流:将兼容openai接口标准的模型,轻松接入到claude code中,支持将符合openai、anthropic、gemini的数据格式转发给claude code或codex
164
- * 按需中转请求:根据请求类型,让不同的模型来处理不同的任务,节省成本,基于该特性,可以让glm等原生非多模态模型支持图像识别
165
- * 智能故障切换:当API服务发生故障时,智能切换到其他API服务进行尝试,无需手动切换,特别适用于中转服务商
166
- * 代理:针对无法直接访问的模型服务,例如地区被ban,支持设置代理来解决
167
- * tokens超量限制:避免其中一个服务商的用量超过限制,浪费了钱,适合有免费额度的服务商
168
- * 次数超量限制:次数到达一定量后,切换其他服务商,适合coding plan的服务商
169
- * 日志:超精细的日志记录和会话记录,帮助你发现编程工具本身的问题,以及专研工具的agent逻辑
170
- * 统计:丰富且详细的统计数据,用量信息快速掌握,发掘自己的编程习惯
171
- * Skills管理:一键搜索和安装Skills,一键启用skill到claude code或codex
172
- * MCP管理:一键安装预设MCP,一键启用MCP
173
- * 导入和导出:一键备份数据,在多太电脑间共享aicodeswitch配置
174
- * 服务端部署,自定义API Key,支持B/S架构,让aicodeswitch成为在线服务,提供给团队使用
175
- * 数据完全本地,自主可控
176
- * 特殊语法:在发送的提示词最前面添加\`[!]\`来直接切换为高智商模型服务(\`[x]\`关闭),简单快捷
177
-
178
- ## 桌面客户端
179
-
180
- [进入下载](https://github.com/tangshuang/aicodeswitch/releases)
181
-
182
- ## 命令行工具
183
-
184
- ### 安装
185
-
186
- \`\`\`
187
- npm install -g aicodeswitch
188
- \`\`\`
189
-
190
- ### 使用方法
191
-
192
- **启动服务**
193
-
194
- \`\`\`
195
- aicos start
196
- \`\`\`
197
-
198
- 或者直接运行
199
-
200
- \`\`\`
201
- aicos ui
202
- \`\`\`
203
-
204
- **停止服务**
205
-
206
- \`\`\`
207
- aicos stop
208
- \`\`\`
209
-
210
- **进入管理界面**
211
-
212
- \`\`\`
213
- # 自动启动服务和打开界面
214
- aicos ui
215
- \`\`\`
216
-
217
- \`\`\`
218
- # 手动在浏览器打开管理界面
219
- http://127.0.0.1:4567
220
- \`\`\`
221
-
222
- ## 管理界面
223
-
224
- **配置供应商**
225
-
226
- * 什么是供应商?
227
- * 供应商配置有什么用?
228
-
229
- 具体请看下方文档。
230
-
231
- **路由配置**
232
-
233
- * 什么是路由?
234
- * 什么是路由规则?
235
-
236
- 具体请看下方文档。
237
-
238
- **覆盖配置文件**
239
-
240
- 在aicodeswitch中,点击“写入Claude Code配置”按钮,它会修改Claude Code的配置文件,让Claude Code开始使用aicocdeswitch提供的模型API,而非直接连到官网的模型API。
241
-
242
- 你不用太担心,你可以在写入后,点击“恢复Claude Code配置”按钮,将Claude Code的配置文件恢复到原始状态。
243
-
244
- Codex的配置覆盖逻辑一模一样。
245
-
246
- **设置**
247
-
248
- 你可以在设置页面,对aicodedeswitch进行配置。
249
-
250
- 也可以导出配置数据,转移到其他电脑上导入。
251
-
252
- ## 配置供应商
253
-
254
- ### 什么是供应商?
255
-
256
- 所谓供应商,就是提供AI服务的上游服务商。可以是OpenAI、Claude、DeepSeek、GLM 官方服务,也可以是其他中转服务商。
257
-
258
- ### 供应商配置有什么用?
259
-
260
- 通过将你所有的AI服务商统一起来管理,可以帮你:
261
-
262
- 1. 避免频繁修改配置文件,通过aicodeswitch,可以一键切换到不同的供应商的AI服务API
263
- 2. 通过aicodeswitch,将不同供应商的接口数据,转换为工具可以正确使用的接口数据格式,也就是说,你可以将Claude Code接入遵循openai的接口数据协议的其他接口
264
- 3. 避免你忘记曾经注册过那些供应商
265
- 4. 充分榨干不怎么用的供应商的服务,避免充值后不怎么用浪费了
266
-
267
- ### 什么是API服务的“源类型”
268
-
269
- 供应商接口返回的数据格式标准类型,目前支持以下几种:
270
-
271
- * OpenAI(Responses API标准)
272
- * OpenAI Chat (Chat Completions API标准)
273
- * DeepSeek Chat(reasoning_content标准)
274
- * Claude
275
- * Claude Chat
276
- * Gemini
277
- * Gemini Chat
278
-
279
- **有什么用?**
280
-
281
- aicodeswitch内部,会根据“源类型”来转换数据。例如,你的供应商API服务接口是OpenAI Chat的数据格式,而你在路由中配置的“客户端工具“是Claude Code,那么就意味着,这个供应商API的数据,需要经过转换之后才能被Claude Code正确使用。
282
-
283
- ## 路由管理
284
-
285
- ### 什么是路由?
286
-
287
- 路由是aicodeswitch的核心功能,它负责将不同的对象工具(目前指Claude Code和Codex)的请求,路由到不同的供应商API服务上。
288
-
289
- ### 什么是“客户端工具”?
290
-
291
- 目前指Claude Code或Codex。
292
-
293
- ### 什么是“路由规则”?
294
-
295
- 以Claude Code为例,它的请求实际上并非铁板一块,可以被分为多种。比如它的深度思考、长文对话、图片理解等等,都是可以独立对待的。
296
-
297
- 路由规则的目的,就是让你的工具发出的请求,可以根据这个区分,发送给不同的服务商来处理。例如,你默认使用glm-4.7作为写代码的模型,但是,你可以把图片识别的请求发给doubao-code来进行,因为doubao-code的图片识别平均价格可以更低。同样的道理,不同目标的请求可以通过不同的规则来处理,以提升编程的质量和效果。
298
-
299
- 目前,我仅提供了几个比较容易区分的规则,以后,还会添加更多的规则。
300
-
301
- ### 激活路由
302
-
303
- 我们可以为Claude Code添加多个路由,但是,我们必须激活一个路由,才能开始使用。
304
- 而且,所有以Claude Code为对象的路由,在同一时间,只有一个可以被激活。
305
-
306
- ### 切换路由
307
-
308
- 你可以根据你的实际情况来实时切换路由,比如,你可以在发现自己的某个服务商处的余额较少时,立即切换到另外一个服务商。
309
-
310
- **智能故障切换机制**
311
-
312
- 当同一请求类型配置多个规则时,系统会按排序优先使用第一个,如果某个服务报错(4xx/5xx)或请求超时,将自动切换到下一个可用规则,确保你可以正常使用coding工具。
313
-
314
- ### 数据转流
315
-
316
- 支持将openai的流式响应数据转换成Claude Code的流式数据,并支持实时转换,从而可以让你使用支持openAI的API服务来在Claude Code中使用。
317
-
318
- *不过,需要注意,如果你的API服务商不支持tools,或者所支持的max_tokens太小,是无法在Claude Code中使用的。*
319
-
320
- ## Skills管理
321
-
322
- 你可以在 aicodeswitch 中集中统一管理 skills,把skills分发给claude code和codex,随时启用和停用skills。
323
- 另外,你可以基于自然语言搜索skills,找到skill之后,支持一键安装。
324
-
325
- ## MCP管理
326
-
327
- 你可以在 aicodeswitch 中集中统一管理 MCP,把MCP分发给claude code和codex,随时启用和停用MCP。
328
- 并且,你还可以通过MCP来实现图像理解。
329
-
330
- ## 日志
331
-
332
- 在**日志**页面,您可以查看:
333
-
334
- **请求日志**:所有 API 请求的详细记录
335
-
336
- * 请求来源和目标
337
- * 请求内容和响应
338
- * 耗时和状态码
339
- * 错误信息(如有)
340
-
341
- **错误日志**:错误和异常记录
342
-
343
- * 错误类型
344
- * 错误详情
345
- * 发生时间
346
-
347
- **会话日志**:按照会话session来汇集日志
348
-
349
- **日志筛选**
350
-
351
- 根据提供的选项进行筛选。
352
-
353
- ## 配置文件
354
-
355
- 作为 CLI 工具,你可以在 ~/.aicodeswitch/ 目录下找到工具的相关文件。里面有一个 aicodeswitch.conf 文件,可以进行配置。
356
- 目前仅支持以下配置:
357
-
358
- \`\`\`
359
- # aicodeswitch的服务IP
360
- HOST=127.0.0.1
361
- # aicodeswitch的服务端口
362
- PORT=4567
363
-
364
- # 如果提供AUTH,你无法直接登录用户界面,必须输入AUTH的值才能进入,相当于是一个登陆鉴权
365
- # 如果你在自己的服务器上使用,通过远程接入接口时,就必须提供这个值
366
- # AUTH=
367
- \`\`\`
368
-
369
- ## 常见问题
370
-
371
- ### 1\\. 如何切换供应商?
372
-
373
- 在路由管理页面修改规则的目标供应商,或调整优先级即可。
374
-
375
- ### 2\\. 如何查看失败的请求?
376
-
377
- 在请求日志页面,筛选状态码不为 200 的记录。
378
-
379
- ### 3\\. 如何备份配置?
380
-
381
- 在系统设置页面使用**导出配置**功能,然后将提供的数据保存到本地文件中。
382
-
383
- ### 4\\. 如何设置日志保留时间?
384
-
385
- 在系统设置页面修改**日志保留天数**配置。
386
-
387
- ## 我的开源
388
-
389
- * [PCM](https://github.com/tangshuang/pcm): 用户意图识别、精准上下文、多线对话的Agent系统
390
- * [Lan Transfer](https://github.com/tangshuang/lan-transfer): 免费高效的局域网文件互传工具
391
- * [MCP Bone](https://github.com/tangshuang/mcp-bone): 远程托管的MCP服管理工具
392
- * [Anys](https://github.com/tangshuang/anys): 免费前端监控kit
393
- * [WebCut](https://github.com/tangshuang/webcut): 免费开源的网页端视频剪辑UI框架
394
- * [indb](https://github.com/tangshuang/indb): 网页端轻量kv数据库操作库
395
- * [Formast](https://github.com/tangshuang/formast): 复杂业务场景下的企业级JSON驱动表单框架
396
-
397
- ## 关联资源
398
-
399
- * [Claude Code 深度教程](https://claudecode.tangshuang.net): 100%免费的Claude Code入门到精通教程
400
-
401
- ## 支持我
402
-
403
- ![](public/donate-to-me.png)
404
-
405
- 你的支持是我前进的动力!
406
-
407
- ## 许可
408
-
409
- 此项目采用双许可证模式:
410
-
411
- * **开源使用**:项目默认采用 GPL 3.0 许可证,允许个人免费使用、修改和分发,但所有衍生品必须开源。
412
- * **商业使用**:如果您希望商业化使用而不遵守 GPL 条款(例如闭源销售),请联系我们购买单独的商业许可证。
413
-
414
- ## 技术支持
415
-
416
- 如有问题或建议,请访问项目 [GitHub 仓库](https://github.com/tangshuang/aicodeswitch/issues)提交 Issue。
417
- `,n5=()=>o.jsx("div",{className:"markdown-content",children:o.jsx(gc,{children:t5})});function iO(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=iO(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function tt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=iO(e))&&(r&&(r+=" "),r+=t);return r}var r5=["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 Yx(e){if(typeof e!="string")return!1;var t=r5;return t.includes(e)}var i5=["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"],a5=new Set(i5);function aO(e){return typeof e!="string"?!1:a5.has(e)}function oO(e){return typeof e=="string"&&e.startsWith("data-")}function qn(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(aO(n)||oO(n))&&(t[n]=e[n]);return t}function Do(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return qn(t)}return typeof e=="object"&&!Array.isArray(e)?qn(e):null}function Ln(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(aO(n)||oO(n)||Yx(n))&&(t[n]=e[n]);return t}function o5(e){return e==null?null:h.isValidElement(e)?Ln(e.props):typeof e=="object"&&!Array.isArray(e)?Ln(e):null}var l5=["children","width","height","viewBox","className","style","title","desc"];function Mv(){return Mv=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},Mv.apply(null,arguments)}function s5(e,t){if(e==null)return{};var n,r,i=c5(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 c5(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 Gx=h.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:l,style:s,title:c,desc:u}=e,f=s5(e,l5),d=a||{width:r,height:i,x:0,y:0},p=tt("recharts-surface",l);return h.createElement("svg",Mv({},Ln(f),{className:p,width:r,height:i,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),h.createElement("title",null,c),h.createElement("desc",null,u),n)}),u5=["children","className"];function Rv(){return Rv=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},Rv.apply(null,arguments)}function d5(e,t){if(e==null)return{};var n,r,i=f5(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 f5(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 Lt=h.forwardRef((e,t)=>{var{children:n,className:r}=e,i=d5(e,u5),a=tt("recharts-layer",r);return h.createElement("g",Rv({className:a},Ln(i),{ref:t}),n)}),lO=h.createContext(null),p5=()=>h.useContext(lO);function wt(e){return function(){return e}}const sO=Math.cos,Of=Math.sin,ei=Math.sqrt,Af=Math.PI,Zp=2*Af,Dv=Math.PI,Lv=2*Dv,uo=1e-6,h5=Lv-uo;function cO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function m5(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return cO;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 g5{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?cO:m5(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,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+l}`}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 l=this._x1,s=this._y1,c=r-t,u=i-n,f=l-t,d=s-n,p=f*f+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(p>uo)if(!(Math.abs(d*c-u*f)>uo)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-l,g=i-s,y=c*c+u*u,x=m*m+g*g,v=Math.sqrt(y),b=Math.sqrt(p),w=a*Math.tan((Dv-Math.acos((y+p-x)/(2*v*b)))/2),j=w/b,C=w/v;Math.abs(j-1)>uo&&this._append`L${t+j*f},${n+j*d}`,this._append`A${a},${a},0,0,${+(d*m>f*g)},${this._x1=t+C*c},${this._y1=n+C*u}`}}arc(t,n,r,i,a,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),c=r*Math.sin(i),u=t+s,f=n+c,d=1^l,p=l?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>uo||Math.abs(this._y1-f)>uo)&&this._append`L${u},${f}`,r&&(p<0&&(p=p%Lv+Lv),p>h5?this._append`A${r},${r},0,1,${d},${t-s},${n-c}A${r},${r},0,1,${d},${this._x1=u},${this._y1=f}`:p>uo&&this._append`A${r},${r},0,${+(p>=Dv)},${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 Xx(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 g5(t)}function Qx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function uO(e){this._context=e}uO.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 eh(e){return new uO(e)}function dO(e){return e[0]}function fO(e){return e[1]}function pO(e,t){var n=wt(!0),r=null,i=eh,a=null,l=Xx(s);e=typeof e=="function"?e:e===void 0?dO:wt(e),t=typeof t=="function"?t:t===void 0?fO:wt(t);function s(c){var u,f=(c=Qx(c)).length,d,p=!1,m;for(r==null&&(a=i(m=l())),u=0;u<=f;++u)!(u<f&&n(d=c[u],u,c))===p&&((p=!p)?a.lineStart():a.lineEnd()),p&&a.point(+e(d,u,c),+t(d,u,c));if(m)return a=null,m+""||null}return s.x=function(c){return arguments.length?(e=typeof c=="function"?c:wt(+c),s):e},s.y=function(c){return arguments.length?(t=typeof c=="function"?c:wt(+c),s):t},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:wt(!!c),s):n},s.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),s):i},s.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),s):r},s}function pd(e,t,n){var r=null,i=wt(!0),a=null,l=eh,s=null,c=Xx(u);e=typeof e=="function"?e:e===void 0?dO:wt(+e),t=typeof t=="function"?t:wt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?fO:wt(+n);function u(d){var p,m,g,y=(d=Qx(d)).length,x,v=!1,b,w=new Array(y),j=new Array(y);for(a==null&&(s=l(b=c())),p=0;p<=y;++p){if(!(p<y&&i(x=d[p],p,d))===v)if(v=!v)m=p,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),g=p-1;g>=m;--g)s.point(w[g],j[g]);s.lineEnd(),s.areaEnd()}v&&(w[p]=+e(x,p,d),j[p]=+t(x,p,d),s.point(r?+r(x,p,d):w[p],n?+n(x,p,d):j[p]))}if(b)return s=null,b+""||null}function f(){return pO().defined(i).curve(l).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:wt(+d),r=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:wt(+d),u):e},u.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:wt(+d),u):r},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:wt(+d),n=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:wt(+d),u):t},u.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:wt(+d),u):n},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(n)},u.lineX1=function(){return f().x(r).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:wt(!!d),u):i},u.curve=function(d){return arguments.length?(l=d,a!=null&&(s=l(a)),u):l},u.context=function(d){return arguments.length?(d==null?a=s=null:s=l(a=d),u):a},u}class hO{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 v5(e){return new hO(e,!0)}function y5(e){return new hO(e,!1)}const Jx={draw(e,t){const n=ei(t/Af);e.moveTo(n,0),e.arc(0,0,n,0,Zp)}},x5={draw(e,t){const n=ei(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()}},mO=ei(1/3),b5=mO*2,w5={draw(e,t){const n=ei(t/b5),r=n*mO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},j5={draw(e,t){const n=ei(t),r=-n/2;e.rect(r,r,n,n)}},S5=.8908130915292852,gO=Of(Af/10)/Of(7*Af/10),k5=Of(Zp/10)*gO,C5=-sO(Zp/10)*gO,P5={draw(e,t){const n=ei(t*S5),r=k5*n,i=C5*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=Zp*a/5,s=sO(l),c=Of(l);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*i,c*r+s*i)}e.closePath()}},Xm=ei(3),E5={draw(e,t){const n=-ei(t/(Xm*3));e.moveTo(0,n*2),e.lineTo(-Xm*n,-n),e.lineTo(Xm*n,-n),e.closePath()}},Sr=-.5,kr=ei(3)/2,zv=1/ei(12),T5=(zv/2+1)*3,O5={draw(e,t){const n=ei(t/T5),r=n/2,i=n*zv,a=r,l=n*zv+n,s=-a,c=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(s,c),e.lineTo(Sr*r-kr*i,kr*r+Sr*i),e.lineTo(Sr*a-kr*l,kr*a+Sr*l),e.lineTo(Sr*s-kr*c,kr*s+Sr*c),e.lineTo(Sr*r+kr*i,Sr*i-kr*r),e.lineTo(Sr*a+kr*l,Sr*l-kr*a),e.lineTo(Sr*s+kr*c,Sr*c-kr*s),e.closePath()}};function A5(e,t){let n=null,r=Xx(i);e=typeof e=="function"?e:wt(e||Jx),t=typeof t=="function"?t:wt(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:wt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:wt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function If(){}function Nf(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 vO(e){this._context=e}vO.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:Nf(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:Nf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function I5(e){return new vO(e)}function yO(e){this._context=e}yO.prototype={areaStart:If,areaEnd:If,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:Nf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function N5(e){return new yO(e)}function xO(e){this._context=e}xO.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:Nf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _5(e){return new xO(e)}function bO(e){this._context=e}bO.prototype={areaStart:If,areaEnd:If,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 M5(e){return new bO(e)}function Dj(e){return e<0?-1:1}function Lj(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),s=(a*i+l*r)/(r+i);return(Dj(a)+Dj(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(s))||0}function zj(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Qm(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,l-s*n,a,l)}function _f(e){this._context=e}_f.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:Qm(this,this._t0,zj(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,Qm(this,zj(this,n=Lj(this,e,t)),n);break;default:Qm(this,this._t0,n=Lj(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function wO(e){this._context=new jO(e)}(wO.prototype=Object.create(_f.prototype)).point=function(e,t){_f.prototype.point.call(this,t,e)};function jO(e){this._context=e}jO.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 R5(e){return new _f(e)}function D5(e){return new wO(e)}function SO(e){this._context=e}SO.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=$j(e),i=$j(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[l],t[l]);(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 $j(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),l=new Array(n);for(i[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(l[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 L5(e){return new SO(e)}function th(e,t){this._context=e,this._t=t}th.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 z5(e){return new th(e,.5)}function $5(e){return new th(e,0)}function B5(e){return new th(e,1)}function Lo(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,s=a.length;n<l;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function $v(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function F5(e,t){return e[t]}function U5(e){const t=[];return t.key=e,t}function W5(){var e=wt([]),t=$v,n=Lo,r=F5;function i(a){var l=Array.from(e.apply(this,arguments),U5),s,c=l.length,u=-1,f;for(const d of a)for(s=0,++u;s<c;++s)(l[s][u]=[0,+r(d,l[s].key,u,a)]).data=d;for(s=0,f=Qx(t(l));s<c;++s)l[f[s]].index=s;return n(l,f),l}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:wt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:wt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?$v:typeof a=="function"?a:wt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Lo,i):n},i}function K5(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,l;i<a;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}Lo(e,t)}}function q5(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var l=0,s=0;l<i;++l)s+=e[l][n][1]||0;r[n][1]+=r[n][0]=-s/2}Lo(e,t)}}function H5(e,t){if(!(!((l=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,l;r<a;++r){for(var s=0,c=0,u=0;s<l;++s){for(var f=e[t[s]],d=f[r][1]||0,p=f[r-1][1]||0,m=(d-p)/2,g=0;g<s;++g){var y=e[t[g]],x=y[r][1]||0,v=y[r-1][1]||0;m+=x-v}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,Lo(e,t)}}var nh={},kO={};function V5(e){return e==="__proto__"}kO.isUnsafeProperty=V5;var Zx={};function Y5(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}Zx.isDeepKey=Y5;var rh={};function G5(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)}rh.toKey=G5;var ih={},CO={};function PO(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(PO).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}CO.toString=PO;const X5=rh,Q5=CO;function J5(e){if(Array.isArray(e))return e.map(X5.toKey);if(typeof e=="symbol")return[e];e=Q5.toString(e);const t=[],n=e.length;if(n===0)return t;let r=0,i="",a="",l=!1;for(e.charCodeAt(0)===46&&(t.push(""),r++);r<n;){const s=e[r];a?s==="\\"&&r+1<n?(r++,i+=e[r]):s===a?a="":i+=s:l?s==='"'||s==="'"?a=s:s==="]"?(l=!1,t.push(i),i=""):i+=s:s==="["?(l=!0,i&&(t.push(i),i="")):s==="."?i&&(t.push(i),i=""):i+=s,r++}return i&&t.push(i),t}ih.toPath=J5;const Bv=kO,Z5=Zx,eF=rh,tF=ih;function EO(e,t,n){if(e==null)return n;switch(typeof t){case"string":{if(Bv.isUnsafeProperty(t))return n;const r=e[t];return r===void 0?Z5.isDeepKey(t)?EO(e,tF.toPath(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=eF.toKey(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return nF(e,t,n);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),Bv.isUnsafeProperty(t))return n;const r=e[t];return r===void 0?n:r}}}function nF(e,t,n){if(t.length===0)return n;let r=e;for(let i=0;i<t.length;i++){if(r==null||Bv.isUnsafeProperty(t[i]))return n;r=r[t[i]]}return r===void 0?n:r}nh.get=EO;var rF=nh.get;const zo=zr(rF);var iF=4;function ja(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:iF,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Wt(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,l)=>{var s=n[l-1];return typeof s=="string"?i+s+a:s!==void 0?i+ja(s)+a:i+a},"")}var vn=e=>e===0?0:e>0?1:-1,Jr=e=>typeof e=="number"&&e!=+e,$o=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ve=e=>(typeof e=="number"||e instanceof Number)&&!Jr(e),Si=e=>ve(e)||typeof e=="string",aF=0,Fc=e=>{var t=++aF;return"".concat(e||"").concat(t)},Rn=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(!ve(t)&&typeof t!="string")return r;var a;if($o(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return Jr(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},TO=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 st(e,t,n){return ve(e)&&ve(t)?ja(e+n*(t-e)):t}function OO(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):zo(r,t))===n)}var Tt=e=>e===null||typeof e>"u",pu=e=>Tt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function tr(e){return e!=null}function qa(){}var oF=["type","size","sizeType"];function Fv(){return Fv=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},Fv.apply(null,arguments)}function Bj(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 Fj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bj(Object(n),!0).forEach(function(r){lF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lF(e,t,n){return(t=sF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sF(e){var t=cF(e,"string");return typeof t=="symbol"?t:t+""}function cF(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 uF(e,t){if(e==null)return{};var n,r,i=dF(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 dF(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 AO={symbolCircle:Jx,symbolCross:x5,symbolDiamond:w5,symbolSquare:j5,symbolStar:P5,symbolTriangle:E5,symbolWye:O5},fF=Math.PI/180,pF=e=>{var t="symbol".concat(pu(e));return AO[t]||Jx},hF=(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*fF;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}},mF=(e,t)=>{AO["symbol".concat(pu(e))]=t},e0=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=uF(e,oF),a=Fj(Fj({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var s=()=>{var p=pF(l),m=A5().type(p).size(hF(n,r,l)),g=m();if(g!==null)return g},{className:c,cx:u,cy:f}=a,d=Ln(a);return ve(u)&&ve(f)&&ve(n)?h.createElement("path",Fv({},d,{className:tt("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(f,")"),d:s()})):null};e0.registerSymbol=mF;var IO=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,t0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(h.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{Yx(i)&&typeof n[i]=="function"&&(r[i]=a=>n[i](n,a))}),r},gF=(e,t,n)=>r=>(e(t,n,r),null),hu=(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];Yx(i)&&typeof a=="function"&&(r||(r={}),r[i]=gF(a,t,n))}),r};function Uj(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?Uj(Object(n),!0).forEach(function(r){yF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yF(e,t,n){return(t=xF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xF(e){var t=bF(e,"string");return typeof t=="symbol"?t:t+""}function bF(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 Xt(e,t){var n=vF({},e),r=t,i=Object.keys(t),a=i.reduce((l,s)=>(l[s]===void 0&&r[s]!==void 0&&(l[s]=r[s]),l),n);return a}function Mf(){return Mf=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},Mf.apply(null,arguments)}function Wj(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 NO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wj(Object(n),!0).forEach(function(r){wF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wF(e,t,n){return(t=jF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jF(e){var t=SF(e,"string");return typeof t=="symbol"?t:t+""}function SF(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 Pr=32,kF={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function CF(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function PF(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Pr/2,a=Pr/6,l=Pr/3,s=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return h.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:CF(t.payload),x1:0,y1:i,x2:Pr,y2:i,className:"recharts-legend-icon"});if(c==="line")return h.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(i,"h").concat(l,`
418
- A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
419
- H`).concat(Pr,"M").concat(2*l,",").concat(i,`
420
- A`).concat(a,",").concat(a,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return h.createElement("path",{stroke:"none",fill:s,d:"M0,".concat(Pr/8,"h").concat(Pr,"v").concat(Pr*3/4,"h").concat(-Pr,"z"),className:"recharts-legend-icon"});if(h.isValidElement(t.legendIcon)){var u=NO({},t);return delete u.legendIcon,h.cloneElement(t.legendIcon,u)}return h.createElement(e0,{fill:s,cx:i,cy:i,size:Pr,sizeType:"diameter",type:c})}function EF(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:l,labelStyle:s}=e,c={x:0,y:0,width:Pr,height:Pr},u={display:r==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,p)=>{var m=d.formatter||i,g=tt({"recharts-legend-item":!0,["legend-item-".concat(p)]:!0,inactive:d.inactive});if(d.type==="none")return null;var y=typeof s=="object"?NO({},s):{};y.color=d.inactive?a:y.color||d.color;var x=m?m(d.value,d,p):d.value;return h.createElement("li",Mf({className:g,style:u,key:"legend-item-".concat(p)},hu(e,d,p)),h.createElement(Gx,{width:n,height:n,viewBox:c,style:f,"aria-label":"".concat(d.value," legend icon")},h.createElement(PF,{data:d,iconType:l,inactiveColor:a})),h.createElement("span",{className:"recharts-legend-item-text",style:y},x))})}var TF=e=>{var t=Xt(e,kF),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return h.createElement("ul",{className:"recharts-default-legend",style:a},h.createElement(EF,Mf({},t,{payload:n})))},_O={},MO={};function OF(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())}MO.uniqBy=OF;var RO={};function AF(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}RO.ary=AF;var n0={};function IF(e){return e}n0.identity=IF;var DO={},LO={};const NF=nh;function _F(e){return function(t){return NF.get(t,e)}}LO.property=_F;var zO={},$O={},mu={},r0={};function MF(e){return e==null||typeof e!="object"&&typeof e!="function"}r0.isPrimitive=MF;var BO={};function RF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}BO.isTypedArray=RF;var FO={};function DF(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}FO.getSymbols=DF;var ah={};function LF(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}ah.getTag=LF;var ht={};const zF="[object RegExp]",$F="[object String]",BF="[object Number]",FF="[object Boolean]",UF="[object Arguments]",WF="[object Symbol]",KF="[object Date]",qF="[object Map]",HF="[object Set]",VF="[object Array]",YF="[object Function]",GF="[object ArrayBuffer]",XF="[object Object]",QF="[object Error]",JF="[object DataView]",ZF="[object Uint8Array]",eU="[object Uint8ClampedArray]",tU="[object Uint16Array]",nU="[object Uint32Array]",rU="[object BigUint64Array]",iU="[object Int8Array]",aU="[object Int16Array]",oU="[object Int32Array]",lU="[object BigInt64Array]",sU="[object Float32Array]",cU="[object Float64Array]";ht.argumentsTag=UF;ht.arrayBufferTag=GF;ht.arrayTag=VF;ht.bigInt64ArrayTag=lU;ht.bigUint64ArrayTag=rU;ht.booleanTag=FF;ht.dataViewTag=JF;ht.dateTag=KF;ht.errorTag=QF;ht.float32ArrayTag=sU;ht.float64ArrayTag=cU;ht.functionTag=YF;ht.int16ArrayTag=aU;ht.int32ArrayTag=oU;ht.int8ArrayTag=iU;ht.mapTag=qF;ht.numberTag=BF;ht.objectTag=XF;ht.regexpTag=zF;ht.setTag=HF;ht.stringTag=$F;ht.symbolTag=WF;ht.uint16ArrayTag=tU;ht.uint32ArrayTag=nU;ht.uint8ArrayTag=ZF;ht.uint8ClampedArrayTag=eU;var UO={},WO={};const uU=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof Ma=="object"&&Ma||function(){return this}()||Function("return this")();WO.globalThis_=uU;const Kj=WO;function dU(e){return typeof Kj.globalThis_.Buffer<"u"&&Kj.globalThis_.Buffer.isBuffer(e)}UO.isBuffer=dU;const fU=r0,pU=BO,hU=FO,mU=ah,Ft=ht,gU=UO;function vU(e,t){return xo(e,void 0,e,new Map,t)}function xo(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(fU.isPrimitive(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const l=new Array(e.length);r.set(e,l);for(let s=0;s<e.length;s++)l[s]=xo(e[s],s,n,r,i);return Object.hasOwn(e,"index")&&(l.index=e.index),Object.hasOwn(e,"input")&&(l.input=e.input),l}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const l=new RegExp(e.source,e.flags);return l.lastIndex=e.lastIndex,l}if(e instanceof Map){const l=new Map;r.set(e,l);for(const[s,c]of e)l.set(s,xo(c,s,n,r,i));return l}if(e instanceof Set){const l=new Set;r.set(e,l);for(const s of e)l.add(xo(s,void 0,n,r,i));return l}if(gU.isBuffer(e))return e.subarray();if(pU.isTypedArray(e)){const l=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,l);for(let s=0;s<e.length;s++)l[s]=xo(e[s],s,n,r,i);return l}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const l=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,l),Ni(l,e,n,r,i),l}if(typeof File<"u"&&e instanceof File){const l=new File([e],e.name,{type:e.type});return r.set(e,l),Ni(l,e,n,r,i),l}if(typeof Blob<"u"&&e instanceof Blob){const l=new Blob([e],{type:e.type});return r.set(e,l),Ni(l,e,n,r,i),l}if(e instanceof Error){const l=structuredClone(e);return r.set(e,l),l.message=e.message,l.name=e.name,l.stack=e.stack,l.cause=e.cause,l.constructor=e.constructor,Ni(l,e,n,r,i),l}if(e instanceof Boolean){const l=new Boolean(e.valueOf());return r.set(e,l),Ni(l,e,n,r,i),l}if(e instanceof Number){const l=new Number(e.valueOf());return r.set(e,l),Ni(l,e,n,r,i),l}if(e instanceof String){const l=new String(e.valueOf());return r.set(e,l),Ni(l,e,n,r,i),l}if(typeof e=="object"&&yU(e)){const l=Object.create(Object.getPrototypeOf(e));return r.set(e,l),Ni(l,e,n,r,i),l}return e}function Ni(e,t,n=e,r,i){const a=[...Object.keys(t),...hU.getSymbols(t)];for(let l=0;l<a.length;l++){const s=a[l],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=xo(t[s],s,n,r,i))}}function yU(e){switch(mU.getTag(e)){case Ft.argumentsTag:case Ft.arrayTag:case Ft.arrayBufferTag:case Ft.dataViewTag:case Ft.booleanTag:case Ft.dateTag:case Ft.float32ArrayTag:case Ft.float64ArrayTag:case Ft.int8ArrayTag:case Ft.int16ArrayTag:case Ft.int32ArrayTag:case Ft.mapTag:case Ft.numberTag:case Ft.objectTag:case Ft.regexpTag:case Ft.setTag:case Ft.stringTag:case Ft.symbolTag:case Ft.uint8ArrayTag:case Ft.uint8ClampedArrayTag:case Ft.uint16ArrayTag:case Ft.uint32ArrayTag:return!0;default:return!1}}mu.cloneDeepWith=vU;mu.cloneDeepWithImpl=xo;mu.copyProperties=Ni;const xU=mu;function bU(e){return xU.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}$O.cloneDeep=bU;var i0={},KO={},a0={};function wU(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}a0.isEqualsSameValueZero=wU;var o0={};function jU(e){return e!==null&&(typeof e=="object"||typeof e=="function")}o0.isObject=jU;const qj=r0,Hj=a0,SU=o0;function qO(e,t,n){return typeof n!="function"?qO(e,t,()=>{}):Uv(e,t,function r(i,a,l,s,c,u){const f=n(i,a,l,s,c,u);return f!==void 0?!!f:Uv(i,a,r,u)},new Map)}function Uv(e,t,n,r){if(t===e)return!0;switch(typeof t){case"object":return kU(e,t,n,r);case"function":return Object.keys(t).length>0?Uv(e,{...t},n,r):Hj.isEqualsSameValueZero(e,t);default:return SU.isObject(e)?typeof t=="string"?t==="":!0:Hj.isEqualsSameValueZero(e,t)}}function kU(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return HO(e,t,n,r);if(t instanceof Map)return CU(e,t,n,r);if(t instanceof Set)return PU(e,t,n,r);const i=Object.keys(t);if(e==null||qj.isPrimitive(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 l=i[a];if(!qj.isPrimitive(e)&&!(l in e)||t[l]===void 0&&e[l]!==void 0||t[l]===null&&e[l]!==null||!n(e[l],t[l],l,e,t,r))return!1}return!0}finally{r==null||r.delete(t)}}function CU(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 HO(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 l=t[a];let s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;const u=e[c];let f=!1;if(n(u,l,a,e,t,r)&&(f=!0),f){i.add(c),s=!0;break}}if(!s)return!1}return!0}function PU(e,t,n,r){return t.size===0?!0:e instanceof Set?HO([...e],[...t],n,r):!1}KO.isMatchWith=qO;const EU=KO;function TU(e,t){return EU.isMatchWith(e,t,()=>{})}i0.isMatch=TU;const OU=$O,AU=i0;function IU(e){return e=OU.cloneDeep(e),t=>AU.isMatch(t,e)}zO.matches=IU;var VO={},YO={},GO={};const NU=ah,hd=ht,md=mu;function _U(e,t){return md.cloneDeepWith(e,(n,r,i,a)=>{const l=t==null?void 0:t(n,r,i,a);if(l!==void 0)return l;if(typeof e=="object"){if(NU.getTag(e)==="[object Object]"&&typeof e.constructor!="function"){const s={};return a.set(e,s),md.copyProperties(s,e,i,a),s}switch(Object.prototype.toString.call(e)){case hd.numberTag:case hd.stringTag:case hd.booleanTag:{const s=new e.constructor(e==null?void 0:e.valueOf());return md.copyProperties(s,e),s}case hd.argumentsTag:{const s={};return md.copyProperties(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}GO.cloneDeepWith=_U;const MU=GO;function RU(e){return MU.cloneDeepWith(e)}YO.cloneDeep=RU;var XO={},l0={};const DU=/^(?:0|[1-9]\d*)$/;function LU(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 DU.test(e)}}l0.isIndex=LU;var QO={};const zU=ah;function $U(e){return e!==null&&typeof e=="object"&&zU.getTag(e)==="[object Arguments]"}QO.isArguments=$U;const BU=Zx,FU=ih,UU=l0,WU=QO;function KU(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&BU.isDeepKey(t)&&(e==null?void 0:e[t])==null?n=FU.toPath(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)||WU.isArguments(r))&&UU.isIndex(a)&&a<r.length))return!1;r=r[a]}return!0}XO.has=KU;const qU=rh,HU=nh,VU=i0,YU=YO,GU=XO;function XU(e,t){switch(typeof e){case"object":Object.is(e==null?void 0:e.valueOf(),-0)&&(e="-0");break;case"number":e=qU.toKey(e);break}return t=YU.cloneDeep(t),function(n){const r=HU.get(n,e);return r===void 0?GU.has(n,e):t===void 0?r===void 0:VU.isMatch(r,t)}}VO.matchesProperty=XU;const QU=n0,JU=LO,ZU=zO,eW=VO;function tW(e){if(e==null)return QU.identity;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?eW.matchesProperty(e[0],e[1]):ZU.matches(e);case"string":case"symbol":case"number":return JU.property(e)}}DO.iteratee=tW;var JO={},s0={},ZO={};function nW(e){return Number.isSafeInteger(e)&&e>=0}ZO.isLength=nW;const rW=ZO;function iW(e){return e!=null&&typeof e!="function"&&rW.isLength(e.length)}s0.isArrayLike=iW;var eA={};function aW(e){return typeof e=="object"&&e!==null}eA.isObjectLike=aW;const oW=s0,lW=eA;function sW(e){return lW.isObjectLike(e)&&oW.isArrayLike(e)}JO.isArrayLikeObject=sW;const cW=MO,uW=RO,dW=n0,fW=DO,pW=JO;function hW(e,t=dW.identity){return pW.isArrayLikeObject(e)?cW.uniqBy(Array.from(e),uW.ary(fW.iteratee(t),1)):[]}_O.uniqBy=hW;var mW=_O.uniqBy;const Vj=zr(mW);function tA(e,t,n){return t===!0?Vj(e,n):typeof t=="function"?Vj(e,t):e}var nA={exports:{}},rA={},iA={exports:{}},aA={};/**
421
- * @license React
422
- * use-sync-external-store-shim.production.js
423
- *
424
- * Copyright (c) Meta Platforms, Inc. and affiliates.
425
- *
426
- * This source code is licensed under the MIT license found in the
427
- * LICENSE file in the root directory of this source tree.
428
- */var Gl=h;function gW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vW=typeof Object.is=="function"?Object.is:gW,yW=Gl.useState,xW=Gl.useEffect,bW=Gl.useLayoutEffect,wW=Gl.useDebugValue;function jW(e,t){var n=t(),r=yW({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return bW(function(){i.value=n,i.getSnapshot=t,Jm(i)&&a({inst:i})},[e,n,t]),xW(function(){return Jm(i)&&a({inst:i}),e(function(){Jm(i)&&a({inst:i})})},[e]),wW(n),n}function Jm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vW(e,n)}catch{return!0}}function SW(e,t){return t()}var kW=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?SW:jW;aA.useSyncExternalStore=Gl.useSyncExternalStore!==void 0?Gl.useSyncExternalStore:kW;iA.exports=aA;var CW=iA.exports;/**
429
- * @license React
430
- * use-sync-external-store-shim/with-selector.production.js
431
- *
432
- * Copyright (c) Meta Platforms, Inc. and affiliates.
433
- *
434
- * This source code is licensed under the MIT license found in the
435
- * LICENSE file in the root directory of this source tree.
436
- */var oh=h,PW=CW;function EW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var TW=typeof Object.is=="function"?Object.is:EW,OW=PW.useSyncExternalStore,AW=oh.useRef,IW=oh.useEffect,NW=oh.useMemo,_W=oh.useDebugValue;rA.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=AW(null);if(a.current===null){var l={hasValue:!1,value:null};a.current=l}else l=a.current;a=NW(function(){function c(m){if(!u){if(u=!0,f=m,m=r(m),i!==void 0&&l.hasValue){var g=l.value;if(i(g,m))return d=g}return d=m}if(g=d,TW(f,m))return g;var y=r(m);return i!==void 0&&i(g,y)?(f=m,g):(f=m,d=y)}var u=!1,f,d,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,i]);var s=OW(e,a[0],a[1]);return IW(function(){l.hasValue=!0,l.value=s},[s]),_W(s),s};nA.exports=rA;var MW=nA.exports,c0=h.createContext(null),RW=e=>e,mt=()=>{var e=h.useContext(c0);return e?e.store.dispatch:RW},Hd=()=>{},DW=()=>Hd,LW=(e,t)=>e===t;function ke(e){var t=h.useContext(c0),n=h.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Hd,[t,e]);return MW.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:DW,t?t.store.getState:Hd,t?t.store.getState:Hd,n,LW)}function zW(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function $W(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function BW(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 Yj=e=>Array.isArray(e)?e:[e];function FW(e){const t=Array.isArray(e[0])?e[0]:e;return BW(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function UW(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var WW=class{constructor(e){this.value=e}deref(){return this.value}},KW=typeof WeakRef<"u"?WeakRef:WW,qW=0,Gj=1;function gd(){return{s:qW,v:void 0,o:null,p:null}}function oA(e,t={}){let n=gd();const{resultEqualityCheck:r}=t;let i,a=0;function l(){var d;let s=n;const{length:c}=arguments;for(let p=0,m=c;p<m;p++){const g=arguments[p];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);const x=y.get(g);x===void 0?(s=gd(),y.set(g,s)):s=x}else{let y=s.p;y===null&&(s.p=y=new Map);const x=y.get(g);x===void 0?(s=gd(),y.set(g,s)):s=x}}const u=s;let f;if(s.s===Gj)f=s.v;else if(f=e.apply(null,arguments),a++,r){const p=((d=i==null?void 0:i.deref)==null?void 0:d.call(i))??i;p!=null&&r(p,f)&&(f=p,a!==0&&a--),i=typeof f=="object"&&f!==null||typeof f=="function"?new KW(f):f}return u.s=Gj,u.v=f,f}return l.clearCache=()=>{n=gd(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function HW(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,s,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),zW(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const f={...n,...c},{memoize:d,memoizeOptions:p=[],argsMemoize:m=oA,argsMemoizeOptions:g=[]}=f,y=Yj(p),x=Yj(g),v=FW(i),b=d(function(){return a++,u.apply(null,arguments)},...y),w=m(function(){l++;const C=UW(v,arguments);return s=b.apply(null,C),s},...x);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:v,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var q=HW(oA),VW=Object.assign((e,t=q)=>{$W(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((l,s,c)=>(l[n[c]]=s,l),{}))},{withTypes:()=>VW}),lA={},sA={};function YW(e,t=1){const n=[],r=Math.floor(t),i=(a,l)=>{for(let s=0;s<a.length;s++){const c=a[s];Array.isArray(c)&&l<r?i(c,l+1):n.push(c)}};return i(e,0),n}sA.flatten=YW;var u0={};const GW=a0,XW=s0,QW=o0,JW=l0;function ZW(e,t,n){return QW.isObject(n)&&(typeof t=="number"&&XW.isArrayLike(n)&&JW.isIndex(t)&&t<n.length||typeof t=="string"&&t in n)?GW.isEqualsSameValueZero(n[t],e):!1}u0.isIterateeCall=ZW;var cA={},uA={};function Xj(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const eK=(e,t,n)=>{if(e!==t){const r=Xj(e),i=Xj(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};uA.compareValues=eK;var dA={},d0={};function tK(e){return typeof e=="symbol"||e instanceof Symbol}d0.isSymbol=tK;const nK=d0,rK=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,iK=/^\w*$/;function aK(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||nK.isSymbol(e)?!0:typeof e=="string"&&(iK.test(e)||!rK.test(e))||t!=null&&Object.hasOwn(t,e)}dA.isKey=aK;const oK=ih,lK=uA,sK=dA;function cK(e,t,n,r){if(e==null)return[];n=r?void 0: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(s=>String(s));const i=(s,c)=>{let u=s;for(let f=0;f<c.length&&u!=null;++f)u=u[c[f]];return u},a=(s,c)=>c==null||s==null?c:typeof s=="object"&&"key"in s?Object.hasOwn(c,s.key)?c[s.key]:i(c,s.path):typeof s=="function"?s(c):Array.isArray(s)?i(c,s):typeof c=="object"?c[s]:c,l=t.map(s=>(Array.isArray(s)&&s.length===1&&(s=s[0]),s==null||typeof s=="function"||Array.isArray(s)||sK.isKey(s)?s:{key:s,path:oK.toPath(s)}));return e.map(s=>({original:s,criteria:l.map(c=>a(c,s))})).slice().sort((s,c)=>{for(let u=0;u<l.length;u++){const f=lK.compareValues(s.criteria[u],c.criteria[u],n[u]);if(f!==0)return f}return 0}).map(s=>s.original)}cA.orderBy=cK;const uK=sA,Qj=u0,dK=cA;function fK(e,...t){const n=t.length;return n>1&&Qj.isIterateeCall(e,t[0],t[1])?t=[]:n>2&&Qj.isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),dK.orderBy(e,uK.flatten(t),["asc"])}lA.sortBy=fK;var pK=lA.sortBy;const lh=zr(pK);var fA=e=>e.legend.settings,hK=e=>e.legend.size,mK=e=>e.legend.payload,gK=q([mK,fA],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?lh(r,n):r});function vK(){return ke(gK)}var vd=1;function pA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=h.useState({height:0,left:0,top:0,width:0}),r=h.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),l={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(l.height-t.height)>vd||Math.abs(l.left-t.left)>vd||Math.abs(l.top-t.top)>vd||Math.abs(l.width-t.width)>vd)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Sn(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 yK=typeof Symbol=="function"&&Symbol.observable||"@@observable",Jj=yK,Zm=()=>Math.random().toString(36).substring(7).split("").join("."),xK={INIT:`@@redux/INIT${Zm()}`,REPLACE:`@@redux/REPLACE${Zm()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Zm()}`},Rf=xK;function f0(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 hA(e,t,n){if(typeof e!="function")throw new Error(Sn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Sn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Sn(1));return n(hA)(e,t)}let r=e,i=t,a=new Map,l=a,s=0,c=!1;function u(){l===a&&(l=new Map,a.forEach((x,v)=>{l.set(v,x)}))}function f(){if(c)throw new Error(Sn(3));return i}function d(x){if(typeof x!="function")throw new Error(Sn(4));if(c)throw new Error(Sn(5));let v=!0;u();const b=s++;return l.set(b,x),function(){if(v){if(c)throw new Error(Sn(6));v=!1,u(),l.delete(b),a=null}}}function p(x){if(!f0(x))throw new Error(Sn(7));if(typeof x.type>"u")throw new Error(Sn(8));if(typeof x.type!="string")throw new Error(Sn(17));if(c)throw new Error(Sn(9));try{c=!0,i=r(i,x)}finally{c=!1}return(a=l).forEach(b=>{b()}),x}function m(x){if(typeof x!="function")throw new Error(Sn(10));r=x,p({type:Rf.REPLACE})}function g(){const x=d;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(Sn(11));function b(){const j=v;j.next&&j.next(f())}return b(),{unsubscribe:x(b)}},[Jj](){return this}}}return p({type:Rf.INIT}),{dispatch:p,subscribe:d,getState:f,replaceReducer:m,[Jj]:g}}function bK(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Rf.INIT})>"u")throw new Error(Sn(12));if(typeof n(void 0,{type:Rf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Sn(13))})}function mA(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const l=t[a];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{bK(n)}catch(a){i=a}return function(l={},s){if(i)throw i;let c=!1;const u={};for(let f=0;f<r.length;f++){const d=r[f],p=n[d],m=l[d],g=p(m,s);if(typeof g>"u")throw s&&s.type,new Error(Sn(14));u[d]=g,c=c||g!==m}return c=c||r.length!==Object.keys(l).length,c?u:l}}function Df(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function wK(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Sn(15))};const l={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},s=e.map(c=>c(l));return a=Df(...s)(i.dispatch),{...i,dispatch:a}}}function gA(e){return f0(e)&&"type"in e&&typeof e.type=="string"}var vA=Symbol.for("immer-nothing"),Zj=Symbol.for("immer-draftable"),Hn=Symbol.for("immer-state");function Hr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pr=Object,Xl=pr.getPrototypeOf,Lf="constructor",sh="prototype",Wv="configurable",zf="enumerable",Vd="writable",Uc="value",Yi=e=>!!e&&!!e[Hn];function Zr(e){var t;return e?yA(e)||uh(e)||!!e[Zj]||!!((t=e[Lf])!=null&&t[Zj])||dh(e)||fh(e):!1}var jK=pr[sh][Lf].toString(),eS=new WeakMap;function yA(e){if(!e||!p0(e))return!1;const t=Xl(e);if(t===null||t===pr[sh])return!0;const n=pr.hasOwnProperty.call(t,Lf)&&t[Lf];if(n===Object)return!0;if(!pl(n))return!1;let r=eS.get(n);return r===void 0&&(r=Function.toString.call(n),eS.set(n,r)),r===jK}function ch(e,t,n=!0){gu(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 gu(e){const t=e[Hn];return t?t.type_:uh(e)?1:dh(e)?2:fh(e)?3:0}var tS=(e,t,n=gu(e))=>n===2?e.has(t):pr[sh].hasOwnProperty.call(e,t),Kv=(e,t,n=gu(e))=>n===2?e.get(t):e[t],$f=(e,t,n,r=gu(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function SK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var uh=Array.isArray,dh=e=>e instanceof Map,fh=e=>e instanceof Set,p0=e=>typeof e=="object",pl=e=>typeof e=="function",eg=e=>typeof e=="boolean";function kK(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ri=e=>e.copy_||e.base_,h0=e=>e.modified_?e.copy_:e.base_;function qv(e,t){if(dh(e))return new Map(e);if(fh(e))return new Set(e);if(uh(e))return Array[sh].slice.call(e);const n=yA(e);if(t===!0||t==="class_only"&&!n){const r=pr.getOwnPropertyDescriptors(e);delete r[Hn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],s=r[l];s[Vd]===!1&&(s[Vd]=!0,s[Wv]=!0),(s.get||s.set)&&(r[l]={[Wv]:!0,[Vd]:!0,[zf]:s[zf],[Uc]:e[l]})}return pr.create(Xl(e),r)}else{const r=Xl(e);if(r!==null&&n)return{...e};const i=pr.create(r);return pr.assign(i,e)}}function m0(e,t=!1){return ph(e)||Yi(e)||!Zr(e)||(gu(e)>1&&pr.defineProperties(e,{set:yd,add:yd,clear:yd,delete:yd}),pr.freeze(e),t&&ch(e,(n,r)=>{m0(r,!0)},!1)),e}function CK(){Hr(2)}var yd={[Uc]:CK};function ph(e){return e===null||!p0(e)?!0:pr.isFrozen(e)}var Bf="MapSet",Hv="Patches",nS="ArrayMethods",xA={};function Bo(e){const t=xA[e];return t||Hr(0,e),t}var rS=e=>!!xA[e],Wc,bA=()=>Wc,PK=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:rS(Bf)?Bo(Bf):void 0,arrayMethodsPlugin_:rS(nS)?Bo(nS):void 0});function iS(e,t){t&&(e.patchPlugin_=Bo(Hv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Vv(e){Yv(e),e.drafts_.forEach(EK),e.drafts_=null}function Yv(e){e===Wc&&(Wc=e.parent_)}var aS=e=>Wc=PK(Wc,e);function EK(e){const t=e[Hn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function oS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Hn].modified_&&(Vv(t),Hr(4)),Zr(e)&&(e=lS(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Hn].base_,e,t)}else e=lS(t,n);return TK(t,e,!0),Vv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==vA?e:void 0}function lS(e,t){if(ph(t))return t;const n=t[Hn];if(!n)return Ff(t,e.handledSet_,e);if(!hh(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);SA(n,e)}return n.copy_}function TK(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&m0(t,n)}function wA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var hh=(e,t)=>e.scope_===t,OK=[];function jA(e,t,n,r){const i=Ri(e),a=e.type_;if(r!==void 0&&Kv(i,r,a)===t){$f(i,r,n,a);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;ch(i,(c,u)=>{if(Yi(u)){const f=s.get(u)||[];f.push(c),s.set(u,f)}})}const l=e.draftLocations_.get(t)??OK;for(const s of l)$f(i,s,n,a)}function AK(e,t,n){e.callbacks_.push(function(i){var s;const a=t;if(!a||!hh(a,i))return;(s=i.mapSetPlugin_)==null||s.fixSetContents(a);const l=h0(a);jA(e,a.draft_??a,l,n),SA(a,i)})}function SA(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)}wA(e)}}function IK(e,t,n){const{scope_:r}=e;if(Yi(n)){const i=n[Hn];hh(i,r)&&i.callbacks_.push(function(){Yd(e);const l=h0(i);jA(e,n,l,t)})}else Zr(n)&&e.callbacks_.push(function(){const a=Ri(e);e.type_===3?a.has(n)&&Ff(n,r.handledSet_,r):Kv(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ff(Kv(e.copy_,t,e.type_),r.handledSet_,r)})}function Ff(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Yi(e)||t.has(e)||!Zr(e)||ph(e)||(t.add(e),ch(e,(r,i)=>{if(Yi(i)){const a=i[Hn];if(hh(a,n)){const l=h0(a);$f(e,r,l,e.type_),wA(a)}}else Zr(i)&&Ff(i,t,n)})),e}function NK(e,t){const n=uh(e),r={type_:n?1:0,scope_:t?t.scope_:bA(),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=Uf;n&&(i=[r],a=Kc);const{revoke:l,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=l,[s,r]}var Uf={get(e,t){if(t===Hn)return e;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=Ri(e);if(!tS(i,t,e.type_))return _K(e,i,t);const a=i[t];if(e.finalized_||!Zr(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&kK(t))return a;if(a===tg(e.base_,t)){Yd(e);const l=e.type_===1?+t:t,s=Xv(e.scope_,a,e,l);return e.copy_[l]=s}return a},has(e,t){return t in Ri(e)},ownKeys(e){return Reflect.ownKeys(Ri(e))},set(e,t,n){const r=kA(Ri(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=tg(Ri(e),t),a=i==null?void 0:i[Hn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(SK(n,i)&&(n!==void 0||tS(e.base_,t,e.type_)))return!0;Yd(e),Gv(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),IK(e,t,n)),!0},deleteProperty(e,t){return Yd(e),tg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Gv(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ri(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Vd]:!0,[Wv]:e.type_!==1||t!=="length",[zf]:r[zf],[Uc]:n[t]}},defineProperty(){Hr(11)},getPrototypeOf(e){return Xl(e.base_)},setPrototypeOf(){Hr(12)}},Kc={};for(let e in Uf){let t=Uf[e];Kc[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Kc.deleteProperty=function(e,t){return Kc.set.call(this,e,t,void 0)};Kc.set=function(e,t,n){return Uf.set.call(this,e[0],t,n,e[0])};function tg(e,t){const n=e[Hn];return(n?Ri(n):e)[t]}function _K(e,t,n){var i;const r=kA(t,n);return r?Uc in r?r[Uc]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function kA(e,t){if(!(t in e))return;let n=Xl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Xl(n)}}function Gv(e){e.modified_||(e.modified_=!0,e.parent_&&Gv(e.parent_))}function Yd(e){e.copy_||(e.assigned_=new Map,e.copy_=qv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var MK=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(pl(n)&&!pl(r)){const l=r;r=n;const s=this;return function(u=l,...f){return s.produce(u,d=>r.call(this,d,...f))}}pl(r)||Hr(6),i!==void 0&&!pl(i)&&Hr(7);let a;if(Zr(n)){const l=aS(this),s=Xv(l,n,void 0);let c=!0;try{a=r(s),c=!1}finally{c?Vv(l):Yv(l)}return iS(l,i),oS(a,l)}else if(!n||!p0(n)){if(a=r(n),a===void 0&&(a=n),a===vA&&(a=void 0),this.autoFreeze_&&m0(a,!0),i){const l=[],s=[];Bo(Hv).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:s}),i(l,s)}return a}else Hr(1,n)},this.produceWithPatches=(n,r)=>{if(pl(n))return(s,...c)=>this.produceWithPatches(s,u=>n(u,...c));let i,a;return[this.produce(n,r,(s,c)=>{i=s,a=c}),i,a]},eg(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),eg(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),eg(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Zr(t)||Hr(8),Yi(t)&&(t=Nr(t));const n=aS(this),r=Xv(n,t,void 0);return r[Hn].isManual_=!0,Yv(n),r}finishDraft(t,n){const r=t&&t[Hn];(!r||!r.isManual_)&&Hr(9);const{scope_:i}=r;return iS(i,n),oS(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=Bo(Hv).applyPatches_;return Yi(t)?i(t,n):this.produce(t,a=>i(a,n))}};function Xv(e,t,n,r){const[i,a]=dh(t)?Bo(Bf).proxyMap_(t,n):fh(t)?Bo(Bf).proxySet_(t,n):NK(t,n);return((n==null?void 0:n.scope_)??bA()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?AK(n,a,r):a.callbacks_.push(function(c){var f;(f=c.mapSetPlugin_)==null||f.fixSetContents(a);const{patchPlugin_:u}=c;a.modified_&&u&&u.generatePatches_(a,[],c)}),i}function Nr(e){return Yi(e)||Hr(10,e),CA(e)}function CA(e){if(!Zr(e)||ph(e))return e;const t=e[Hn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=qv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=qv(e,!0);return ch(n,(i,a)=>{$f(n,i,CA(a))},r),t&&(t.finalized_=!1),n}var RK=new MK,PA=RK.produce;function EA(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var DK=EA(),LK=EA,zK=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Df:Df.apply(null,arguments)};function vr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(mr(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=>gA(r)&&r.type===e,n}var TA=class Qs extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Qs.prototype)}static get[Symbol.species](){return Qs}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Qs(...t[0].concat(this)):new Qs(...t.concat(this))}};function sS(e){return Zr(e)?PA(e,()=>{}):e}function xd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function $K(e){return typeof e=="boolean"}var BK=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new TA;return n&&($K(n)?l.push(DK):l.push(LK(n.extraArgument))),l},OA="RTK_autoBatch",Ct=()=>e=>({payload:e,meta:{[OA]:!0}}),cS=e=>t=>{setTimeout(t,e)},FK=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(l),n())},a=e(i),l=setTimeout(i,t)},AA=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?FK(window.requestAnimationFrame,100):cS(10):e.type==="callback"?e.queueNotification:cS(e.timeout),u=()=>{l=!1,a&&(a=!1,s.forEach(f=>f()))};return Object.assign({},r,{subscribe(f){const d=()=>i&&f(),p=r.subscribe(d);return s.add(f),()=>{p(),s.delete(f)}},dispatch(f){var d;try{return i=!((d=f==null?void 0:f.meta)!=null&&d[OA]),a=!i,a&&(l||(l=!0,c(u))),r.dispatch(f)}finally{i=!0}}})},UK=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new TA(e);return r&&i.push(AA(typeof r=="object"?r:void 0)),i};function WK(e){const t=BK(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let s;if(typeof n=="function")s=n;else if(f0(n))s=mA(n);else throw new Error(mr(1));let c;typeof r=="function"?c=r(t):c=t();let u=Df;i&&(u=zK({trace:!1,...typeof i=="object"&&i}));const f=wK(...c),d=UK(f);let p=typeof l=="function"?l(d):d();const m=u(...p);return hA(s,a,m)}function IA(e){const t={},n=[];let r;const i={addCase(a,l){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(mr(28));if(s in t)throw new Error(mr(29));return t[s]=l,i},addAsyncThunk(a,l){return l.pending&&(t[a.pending.type]=l.pending),l.rejected&&(t[a.rejected.type]=l.rejected),l.fulfilled&&(t[a.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:a.settled,reducer:l.settled}),i},addMatcher(a,l){return n.push({matcher:a,reducer:l}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function KK(e){return typeof e=="function"}function qK(e,t){let[n,r,i]=IA(t),a;if(KK(e))a=()=>sS(e());else{const s=sS(e);a=()=>s}function l(s=a(),c){let u=[n[c.type],...r.filter(({matcher:f})=>f(c)).map(({reducer:f})=>f)];return u.filter(f=>!!f).length===0&&(u=[i]),u.reduce((f,d)=>{if(d)if(Yi(f)){const m=d(f,c);return m===void 0?f:m}else{if(Zr(f))return PA(f,p=>d(p,c));{const p=d(f,c);if(p===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return f},s)}return l.getInitialState=a,l}var HK="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",VK=(e=21)=>{let t="",n=e;for(;n--;)t+=HK[Math.random()*64|0];return t},YK=Symbol.for("rtk-slice-createasyncthunk");function GK(e,t){return`${e}/${t}`}function XK({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[YK];return function(i){const{name:a,reducerPath:l=a}=i;if(!a)throw new Error(mr(11));const s=(typeof i.reducers=="function"?i.reducers(JK()):i.reducers)||{},c=Object.keys(s),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(j,C){const S=typeof j=="string"?j:j.type;if(!S)throw new Error(mr(12));if(S in u.sliceCaseReducersByType)throw new Error(mr(13));return u.sliceCaseReducersByType[S]=C,f},addMatcher(j,C){return u.sliceMatchers.push({matcher:j,reducer:C}),f},exposeAction(j,C){return u.actionCreators[j]=C,f},exposeCaseReducer(j,C){return u.sliceCaseReducersByName[j]=C,f}};c.forEach(j=>{const C=s[j],S={reducerName:j,type:GK(a,j),createNotation:typeof i.reducers=="function"};e9(C)?n9(S,C,f,t):ZK(S,C,f)});function d(){const[j={},C=[],S=void 0]=typeof i.extraReducers=="function"?IA(i.extraReducers):[i.extraReducers],E={...j,...u.sliceCaseReducersByType};return qK(i.initialState,I=>{for(let R in E)I.addCase(R,E[R]);for(let R of u.sliceMatchers)I.addMatcher(R.matcher,R.reducer);for(let R of C)I.addMatcher(R.matcher,R.reducer);S&&I.addDefaultCase(S)})}const p=j=>j,m=new Map,g=new WeakMap;let y;function x(j,C){return y||(y=d()),y(j,C)}function v(){return y||(y=d()),y.getInitialState()}function b(j,C=!1){function S(I){let R=I[j];return typeof R>"u"&&C&&(R=xd(g,S,v)),R}function E(I=p){const R=xd(m,C,()=>new WeakMap);return xd(R,I,()=>{const A={};for(const[_,N]of Object.entries(i.selectors??{}))A[_]=QK(N,I,()=>xd(g,I,v),C);return A})}return{reducerPath:j,getSelectors:E,get selectors(){return E(S)},selectSlice:S}}const w={name:a,reducer:x,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:v,...b(l),injectInto(j,{reducerPath:C,...S}={}){const E=C??l;return j.inject({reducerPath:E,reducer:x},S),{...w,...b(E,!0)}}};return w}}function QK(e,t,n,r){function i(a,...l){let s=t(a);return typeof s>"u"&&r&&(s=n()),e(s,...l)}return i.unwrapped=e,i}var $n=XK();function JK(){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,l;if("reducer"in r){if(n&&!t9(r))throw new Error(mr(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?vr(e,l):vr(e))}function e9(e){return e._reducerDefinitionType==="asyncThunk"}function t9(e){return e._reducerDefinitionType==="reducerWithPrepare"}function n9({type:e,reducerName:t},n,r,i){if(!i)throw new Error(mr(18));const{payloadCreator:a,fulfilled:l,pending:s,rejected:c,settled:u,options:f}=n,d=i(e,a,f);r.exposeAction(t,d),l&&r.addCase(d.fulfilled,l),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),u&&r.addMatcher(d.settled,u),r.exposeCaseReducer(t,{fulfilled:l||bd,pending:s||bd,rejected:c||bd,settled:u||bd})}function bd(){}var r9="task",NA="listener",_A="completed",g0="cancelled",i9=`task-${g0}`,a9=`task-${_A}`,Qv=`${NA}-${g0}`,o9=`${NA}-${_A}`,mh=class{constructor(e){Uu(this,"code");Uu(this,"name","TaskAbortError");Uu(this,"message");this.code=e,this.message=`${r9} ${g0} (reason: ${e})`}},v0=(e,t)=>{if(typeof e!="function")throw new TypeError(mr(32))},Wf=()=>{},MA=(e,t=Wf)=>(e.catch(t),e),RA=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Eo=e=>{if(e.aborted)throw new mh(e.reason)};function DA(e,t){let n=Wf;return new Promise((r,i)=>{const a=()=>i(new mh(e.reason));if(e.aborted){a();return}n=RA(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Wf})}var l9=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof mh?"cancelled":"rejected",error:n}}finally{t==null||t()}},Kf=e=>t=>MA(DA(e,t).then(n=>(Eo(e),n))),LA=e=>{const t=Kf(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Dl}=Object,uS={},gh="listenerMiddleware",s9=(e,t)=>{const n=r=>RA(e,()=>r.abort(e.reason));return(r,i)=>{v0(r);const a=new AbortController;n(a);const l=l9(async()=>{Eo(e),Eo(a.signal);const s=await r({pause:Kf(a.signal),delay:LA(a.signal),signal:a.signal});return Eo(a.signal),s},()=>a.abort(a9));return i!=null&&i.autoJoin&&t.push(l.catch(Wf)),{result:Kf(e)(l),cancel(){a.abort(i9)}}}},c9=(e,t)=>{const n=async(r,i)=>{Eo(t);let a=()=>{};const s=[new Promise((c,u)=>{let f=e({predicate:r,effect:(d,p)=>{p.unsubscribe(),c([d,p.getState(),p.getOriginalState()])}});a=()=>{f(),u()}})];i!=null&&s.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await DA(t,Promise.race(s));return Eo(t),c}finally{a()}};return(r,i)=>MA(n(r,i))},zA=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=vr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(mr(21));return v0(a),{predicate:i,type:t,effect:a}},$A=Dl(e=>{const{type:t,predicate:n,effect:r}=zA(e);return{id:VK(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(mr(22))}}},{withTypes:()=>$A}),dS=(e,t)=>{const{type:n,effect:r,predicate:i}=zA(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Jv=e=>{e.pending.forEach(t=>{t.abort(Qv)})},u9=(e,t)=>()=>{for(const n of t.keys())Jv(n);e.clear()},fS=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},BA=Dl(vr(`${gh}/add`),{withTypes:()=>BA}),d9=vr(`${gh}/removeAll`),FA=Dl(vr(`${gh}/remove`),{withTypes:()=>FA}),f9=(...e)=>{console.error(`${gh}/error`,...e)},vu=(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:l=f9}=e;v0(l);const s=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),g=>{m.unsubscribe(),g!=null&&g.cancelActive&&Jv(m)}),c=m=>{const g=dS(t,m)??$A(m);return s(g)};Dl(c,{withTypes:()=>c});const u=m=>{const g=dS(t,m);return g&&(g.unsubscribe(),m.cancelActive&&Jv(g)),!!g};Dl(u,{withTypes:()=>u});const f=async(m,g,y,x)=>{const v=new AbortController,b=c9(c,v.signal),w=[];try{m.pending.add(v),r(m),await Promise.resolve(m.effect(g,Dl({},y,{getOriginalState:x,condition:(j,C)=>b(j,C).then(Boolean),take:b,delay:LA(v.signal),pause:Kf(v.signal),extra:a,signal:v.signal,fork:s9(v.signal,w),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((j,C,S)=>{j!==v&&(j.abort(Qv),S.delete(j))})},cancel:()=>{v.abort(Qv),m.pending.delete(v)},throwIfCancelled:()=>{Eo(v.signal)}})))}catch(j){j instanceof mh||fS(l,j,{raisedBy:"effect"})}finally{await Promise.all(w),v.abort(o9),i(m),m.pending.delete(v)}},d=u9(t,n);return{middleware:m=>g=>y=>{if(!gA(y))return g(y);if(BA.match(y))return c(y.payload);if(d9.match(y)){d();return}if(FA.match(y))return u(y.payload);let x=m.getState();const v=()=>{if(x===uS)throw new Error(mr(23));return x};let b;try{if(b=g(y),t.size>0){const w=m.getState(),j=Array.from(t.values());for(const C of j){let S=!1;try{S=C.predicate(y,w,x)}catch(E){S=!1,fS(l,E,{raisedBy:"predicate"})}S&&f(C,y,m,v)}}}finally{x=uS}return b},startListening:c,stopListening:u,clearListeners:d}};function mr(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 p9={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},UA=$n({name:"chartLayout",initialState:p9,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}}}),{setMargin:h9,setLayout:m9,setChartSize:g9,setScale:v9}=UA.actions,y9=UA.reducer;function WA(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ue(e){return Number.isFinite(e)}function ki(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function pS(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 Pl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pS(Object(n),!0).forEach(function(r){x9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function x9(e,t,n){return(t=b9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b9(e){var t=w9(e,"string");return typeof t=="symbol"?t:t+""}function w9(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 it(e,t,n){return Tt(e)||Tt(t)?n:Si(t)?zo(e,t,n):typeof t=="function"?t(e):n}var j9=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:l,layout:s}=t;if((s==="vertical"||s==="horizontal"&&l==="middle")&&a!=="center"&&ve(e[a]))return Pl(Pl({},e),{},{[a]:e[a]+(r||0)});if((s==="horizontal"||s==="vertical"&&a==="center")&&l!=="middle"&&ve(e[l]))return Pl(Pl({},e),{},{[l]:e[l]+(i||0)})}return e},ti=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",KA=(e,t,n,r)=>{if(r)return e.map(s=>s.coordinate);var i,a,l=e.map(s=>(s.coordinate===t&&(i=!0),s.coordinate===n&&(a=!0),s.coordinate));return i||l.push(t),a||l.push(n),l},qA=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:l,realScaleType:s,isCategorical:c,categoricalDomain:u,tickCount:f,ticks:d,niceTicks:p,axisType:m}=e;if(!l)return null;var g=s==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,y=i==="category"&&l.bandwidth?l.bandwidth()/g:0;if(y=m==="angleAxis"&&a&&a.length>=2?vn(a[0]-a[1])*2*y:y,d||p){var x=(d||p||[]).map((v,b)=>{var w=r?r.indexOf(v):v,j=l.map(w);return Ue(j)?{coordinate:j+y,value:v,offset:y,index:b}:null}).filter(tr);return x}return c&&u?u.map((v,b)=>{var w=l.map(v);return Ue(w)?{coordinate:w+y,value:v,index:b,offset:y}:null}).filter(tr):l.ticks&&f!=null?l.ticks(f).map((v,b)=>{var w=l.map(v);return Ue(w)?{coordinate:w+y,value:v,index:b,offset:y}:null}).filter(tr):l.domain().map((v,b)=>{var w=l.map(v);return Ue(w)?{coordinate:w+y,value:r?r[v]:v,index:b,offset:y}:null}).filter(tr)},S9=(e,t)=>{if(!t||t.length!==2||!ve(t[0])||!ve(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(!ve(e[0])||e[0]<n)&&(i[0]=n),(!ve(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},k9=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,l=0,s=0;s<n;++s){var c=e[s],u=c==null?void 0:c[i];if(u!=null){var f=u[1],d=u[0],p=Jr(f)?d:f;p>=0?(u[0]=a,a+=p,u[1]=a):(u[0]=l,l+=p,u[1]=l)}}}},C9=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,l=0;l<n;++l){var s=e[l],c=s==null?void 0:s[i];if(c!=null){var u=Jr(c[1])?c[0]:c[1];u>=0?(c[0]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},P9={sign:k9,expand:K5,none:Lo,silhouette:q5,wiggle:H5,positive:C9},E9=(e,t,n)=>{var r,i=(r=P9[n])!==null&&r!==void 0?r:Lo,a=W5().keys(t).value((s,c)=>Number(it(s,c,0))).order($v).offset(i),l=a(e);return l.forEach((s,c)=>{s.forEach((u,f)=>{var d=it(e[f],t[c],0);Array.isArray(d)&&d.length===2&&ve(d[0])&&ve(d[1])&&(u[0]=d[0],u[1]=d[1])})}),l};function HA(e){return e==null?void 0:String(e)}function qf(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Tt(i[t.dataKey])){var s=OO(n,"value",i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=it(i,Tt(l)?t.dataKey:l),u=t.scale.map(c);return ve(u)?u:null}var hS=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:l}=e;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var s=it(a,t.dataKey,t.scale.domain()[l]);if(Tt(s))return null;var c=t.scale.map(s);return ve(c)?c-i/2+r:null},T9=e=>{var{numericAxis:t}=e,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]},O9=e=>{var t=e.flat(2).filter(ve);return[Math.min(...t),Math.max(...t)]},A9=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],I9=(e,t,n)=>{if(e!=null)return A9(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:l}=a,s=l.reduce((c,u)=>{var f=WA(u,t,n),d=O9(f);return!Ue(d[0])||!Ue(d[1])?c:[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},mS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,La=(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=lh(t,f=>f.coordinate),a=1/0,l=1,s=i.length;l<s;l++){var c=i[l],u=i[l-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 vS(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Pl(Pl({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Ha(e,t){if(e)return String(e);if(typeof t=="string")return t}var N9=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},_9=(e,t)=>t==="centric"?e.angle:e.radius,ta=e=>e.layout.width,na=e=>e.layout.height,M9=e=>e.layout.scale,VA=e=>e.layout.margin,vh=q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),yh=q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),YA="data-recharts-item-index",GA="data-recharts-item-id",yu=60;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 wd(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){R9(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 R9(e,t,n){return(t=D9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D9(e){var t=L9(e,"string");return typeof t=="symbol"?t:t+""}function L9(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 z9=e=>e.brush.height;function $9(e){var t=yh(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:yu;return n+i}return n},0)}function B9(e){var t=yh(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:yu;return n+i}return n},0)}function F9(e){var t=vh(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function U9(e){var t=vh(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var cn=q([ta,na,VA,z9,$9,B9,F9,U9,fA,hK],(e,t,n,r,i,a,l,s,c,u)=>{var f={left:(n.left||0)+i,right:(n.right||0)+a},d={top:(n.top||0)+l,bottom:(n.bottom||0)+s},p=wd(wd({},d),f),m=p.bottom;p.bottom+=r,p=j9(p,c,u);var g=e-p.left-p.right,y=t-p.top-p.bottom;return wd(wd({brushBottom:m},p),{},{width:Math.max(g,0),height:Math.max(y,0)})}),W9=q(cn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),y0=q(ta,na,(e,t)=>({x:0,y:0,width:e,height:t})),K9=h.createContext(null),xn=()=>h.useContext(K9)!=null,xh=e=>e.brush,bh=q([xh,cn,VA],(e,t,n)=>({height:e.height,x:ve(e.x)?e.x:t.left,y:ve(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:ve(e.width)?e.width:t.width})),XA={},QA={},JA={};function q9(e,t,{signal:n,edges:r}={}){let i,a=null;const l=r!=null&&r.includes("leading"),s=r==null||r.includes("trailing"),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},u=()=>{s&&c(),m()};let f=null;const d=()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,u()},t)},p=()=>{f!==null&&(clearTimeout(f),f=null)},m=()=>{p(),i=void 0,a=null},g=()=>{c()},y=function(...x){if(n!=null&&n.aborted)return;i=this,a=x;const v=f==null;d(),l&&v&&c()};return y.schedule=d,y.cancel=m,y.flush=g,n==null||n.addEventListener("abort",m,{once:!0}),y}JA.debounce=q9;const H9=JA;function V9(e,t=0,n={}){typeof n!="object"&&(n={});const{leading:r=!1,trailing:i=!0,maxWait:a}=n,l=Array(2);r&&(l[0]="leading"),i&&(l[1]="trailing");let s,c=null;const u=H9.debounce(function(...p){s=e.apply(this,p),c=null},t,{edges:l}),f=function(...p){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,p),c=Date.now(),u.cancel(),u.schedule(),s):(u.apply(this,p),s)},d=()=>(u.flush(),s);return f.cancel=u.cancel,f.flush=d,f}QA.debounce=V9;const Y9=QA;function G9(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return Y9.debounce(e,t,{leading:r,maxWait:t,trailing:i})}XA.throttle=G9;var X9=XA.throttle;const Q9=zr(X9);var Hf=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 l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},gi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},ZA=(e,t,n)=>{var{width:r=gi.width,height:i=gi.height,aspect:a,maxHeight:l}=n,s=$o(r)?e:Number(r),c=$o(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),l&&c!=null&&c>l&&(c=l)),{calculatedWidth:s,calculatedHeight:c}},J9={width:0,height:0,overflow:"visible"},Z9={width:0,overflowX:"visible"},eq={height:0,overflowY:"visible"},tq={},nq=e=>{var{width:t,height:n}=e,r=$o(t),i=$o(n);return r&&i?J9:r?Z9:i?eq:tq};function rq(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=gi.width,a=gi.height):i===void 0?i=r&&r>0?void 0:gi.width:a===void 0&&(a=r&&r>0?void 0:gi.height),{width:i,height:a}}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 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 bS(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){iq(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 iq(e,t,n){return(t=aq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aq(e){var t=oq(e,"string");return typeof t=="symbol"?t:t+""}function oq(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 eI=h.createContext(gi.initialDimension);function lq(e){return ki(e.width)&&ki(e.height)}function tI(e){var{children:t,width:n,height:r}=e,i=h.useMemo(()=>({width:n,height:r}),[n,r]);return lq(i)?h.createElement(eI.Provider,{value:i},t):null}var x0=()=>h.useContext(eI),sq=h.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=gi.initialDimension,width:i,height:a,minWidth:l=gi.minWidth,minHeight:s,maxHeight:c,children:u,debounce:f=gi.debounce,id:d,className:p,onResize:m,style:g={}}=e,y=h.useRef(null),x=h.useRef();x.current=m,h.useImperativeHandle(t,()=>y.current);var[v,b]=h.useState({containerWidth:r.width,containerHeight:r.height}),w=h.useCallback((I,R)=>{b(A=>{var _=Math.round(I),N=Math.round(R);return A.containerWidth===_&&A.containerHeight===N?A:{containerWidth:_,containerHeight:N}})},[]);h.useEffect(()=>{if(y.current==null||typeof ResizeObserver>"u")return qa;var I=N=>{var Y,K=N[0];if(K!=null){var{width:O,height:F}=K.contentRect;w(O,F),(Y=x.current)===null||Y===void 0||Y.call(x,O,F)}};f>0&&(I=Q9(I,f,{trailing:!0,leading:!1}));var R=new ResizeObserver(I),{width:A,height:_}=y.current.getBoundingClientRect();return w(A,_),R.observe(y.current),()=>{R.disconnect()}},[w,f]);var{containerWidth:j,containerHeight:C}=v;Hf(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:S,calculatedHeight:E}=ZA(j,C,{width:i,height:a,aspect:n,maxHeight:c});return Hf(S!=null&&S>0||E!=null&&E>0,`The width(%s) and height(%s) of chart should be greater than 0,
437
- please check the style of container, or the props width(%s) and height(%s),
438
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
439
- height and width.`,S,E,i,a,l,s,n),h.createElement("div",{id:d?"".concat(d):void 0,className:tt("recharts-responsive-container",p),style:bS(bS({},g),{},{width:i,height:a,minWidth:l,minHeight:s,maxHeight:c}),ref:y},h.createElement("div",{style:nq({width:i,height:a})},h.createElement(tI,{width:S,height:E},u)))}),Ms=h.forwardRef((e,t)=>{var n=x0();if(ki(n.width)&&ki(n.height))return e.children;var{width:r,height:i}=rq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=ZA(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ve(a)&&ve(l)?h.createElement(tI,{width:a,height:l},e.children):h.createElement(sq,Zv({},e,{width:r,height:i,ref:t}))});function b0(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 wh=()=>{var e,t=xn(),n=ke(W9),r=ke(bh),i=(e=ke(xh))===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}},cq={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},nI=()=>{var e;return(e=ke(cn))!==null&&e!==void 0?e:cq},w0=()=>ke(ta),j0=()=>ke(na),uq=()=>ke(e=>e.layout.margin),Je=e=>e.layout.layoutType,Va=()=>ke(Je),S0=()=>{var e=Va();if(e==="horizontal"||e==="vertical")return e},rI=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},dq=()=>{var e=Va();return e!==void 0},xu=e=>{var t=mt(),n=xn(),{width:r,height:i}=e,a=x0(),l=r,s=i;return a&&(l=a.width>0?a.width:r,s=a.height>0?a.height:i),h.useEffect(()=>{!n&&ki(l)&&ki(s)&&t(g9({width:l,height:s}))},[t,n,l,s]),null},iI=Symbol.for("immer-nothing"),wS=Symbol.for("immer-draftable"),yr=Symbol.for("immer-state");function Vr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var qc=Object.getPrototypeOf;function Ql(e){return!!e&&!!e[yr]}function Fo(e){var t;return e?aI(e)||Array.isArray(e)||!!e[wS]||!!((t=e.constructor)!=null&&t[wS])||bu(e)||Sh(e):!1}var fq=Object.prototype.constructor.toString(),jS=new WeakMap;function aI(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=jS.get(n);return r===void 0&&(r=Function.toString.call(n),jS.set(n,r)),r===fq}function Vf(e,t,n=!0){jh(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function jh(e){const t=e[yr];return t?t.type_:Array.isArray(e)?1:bu(e)?2:Sh(e)?3:0}function ey(e,t){return jh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function oI(e,t,n){const r=jh(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function pq(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function bu(e){return e instanceof Map}function Sh(e){return e instanceof Set}function fo(e){return e.copy_||e.base_}function ty(e,t){if(bu(e))return new Map(e);if(Sh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=aI(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[yr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],s=r[l];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[l]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[l]})}return Object.create(qc(e),r)}else{const r=qc(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function k0(e,t=!1){return kh(e)||Ql(e)||!Fo(e)||(jh(e)>1&&Object.defineProperties(e,{set:jd,add:jd,clear:jd,delete:jd}),Object.freeze(e),t&&Object.values(e).forEach(n=>k0(n,!0))),e}function hq(){Vr(2)}var jd={value:hq};function kh(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var mq={};function Uo(e){const t=mq[e];return t||Vr(0,e),t}var Hc;function lI(){return Hc}function gq(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function SS(e,t){t&&(Uo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ny(e){ry(e),e.drafts_.forEach(vq),e.drafts_=null}function ry(e){e===Hc&&(Hc=e.parent_)}function kS(e){return Hc=gq(Hc,e)}function vq(e){const t=e[yr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function CS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[yr].modified_&&(ny(t),Vr(4)),Fo(e)&&(e=Yf(t,e),t.parent_||Gf(t,e)),t.patches_&&Uo("Patches").generateReplacementPatches_(n[yr].base_,e,t.patches_,t.inversePatches_)):e=Yf(t,n,[]),ny(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==iI?e:void 0}function Yf(e,t,n){if(kh(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[yr];if(!i)return Vf(t,(a,l)=>PS(e,i,t,a,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Gf(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let l=a,s=!1;i.type_===3&&(l=new Set(a),a.clear(),s=!0),Vf(l,(c,u)=>PS(e,i,a,c,u,n,s),r),Gf(e,a,!1),n&&e.patches_&&Uo("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function PS(e,t,n,r,i,a,l){if(i==null||typeof i!="object"&&!l)return;const s=kh(i);if(!(s&&!l)){if(Ql(i)){const c=a&&t&&t.type_!==3&&!ey(t.assigned_,r)?a.concat(r):void 0,u=Yf(e,i,c);if(oI(n,r,u),Ql(u))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(Fo(i)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&s)return;Yf(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(bu(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Gf(e,i)}}}function Gf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&k0(t,n)}function yq(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:lI(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=C0;n&&(i=[r],a=Vc);const{revoke:l,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=l,s}var C0={get(e,t){if(t===yr)return e;const n=fo(e);if(!ey(n,t))return xq(e,n,t);const r=n[t];return e.finalized_||!Fo(r)?r:r===ng(e.base_,t)?(rg(e),e.copy_[t]=ay(r,e)):r},has(e,t){return t in fo(e)},ownKeys(e){return Reflect.ownKeys(fo(e))},set(e,t,n){const r=sI(fo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ng(fo(e),t),a=i==null?void 0:i[yr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(pq(n,i)&&(n!==void 0||ey(e.base_,t)))return!0;rg(e),iy(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ng(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,rg(e),iy(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=fo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Vr(11)},getPrototypeOf(e){return qc(e.base_)},setPrototypeOf(){Vr(12)}},Vc={};Vf(C0,(e,t)=>{Vc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Vc.deleteProperty=function(e,t){return Vc.set.call(this,e,t,void 0)};Vc.set=function(e,t,n){return C0.set.call(this,e[0],t,n,e[0])};function ng(e,t){const n=e[yr];return(n?fo(n):e)[t]}function xq(e,t,n){var i;const r=sI(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function sI(e,t){if(!(t in e))return;let n=qc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=qc(n)}}function iy(e){e.modified_||(e.modified_=!0,e.parent_&&iy(e.parent_))}function rg(e){e.copy_||(e.copy_=ty(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var bq=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const l=this;return function(c=a,...u){return l.produce(c,f=>n.call(this,f,...u))}}typeof n!="function"&&Vr(6),r!==void 0&&typeof r!="function"&&Vr(7);let i;if(Fo(t)){const a=kS(this),l=ay(t,void 0);let s=!0;try{i=n(l),s=!1}finally{s?ny(a):ry(a)}return SS(a,r),CS(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===iI&&(i=void 0),this.autoFreeze_&&k0(i,!0),r){const a=[],l=[];Uo("Patches").generateReplacementPatches_(t,i,a,l),r(a,l)}return i}else Vr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...s)=>this.produceWithPatches(l,c=>t(c,...s));let r,i;return[this.produce(t,n,(l,s)=>{r=l,i=s}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Fo(e)||Vr(8),Ql(e)&&(e=wq(e));const t=kS(this),n=ay(e,void 0);return n[yr].isManual_=!0,ry(t),n}finishDraft(e,t){const n=e&&e[yr];(!n||!n.isManual_)&&Vr(9);const{scope_:r}=n;return SS(r,t),CS(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=Uo("Patches").applyPatches_;return Ql(e)?r(e,t):this.produce(e,i=>r(i,t))}};function ay(e,t){const n=bu(e)?Uo("MapSet").proxyMap_(e,t):Sh(e)?Uo("MapSet").proxySet_(e,t):yq(e,t);return(t?t.scope_:lI()).drafts_.push(n),n}function wq(e){return Ql(e)||Vr(10,e),cI(e)}function cI(e){if(!Fo(e)||kh(e))return e;const t=e[yr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ty(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ty(e,!0);return Vf(n,(i,a)=>{oI(n,i,cI(a))},r),t&&(t.finalized_=!1),n}var jq=new bq;jq.produce;var Sq={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},uI=$n({name:"legend",initialState:Sq,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(t.payload)},prepare:Ct()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Nr(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Ct()},removeLegendPayload:{reducer(e,t){var n=Nr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Ct()}}}),{setLegendSize:ES,setLegendSettings:kq,addLegendPayload:dI,replaceLegendPayload:fI,removeLegendPayload:pI}=uI.actions,Cq=uI.reducer,Pq={};/**
440
- * @license React
441
- * use-sync-external-store-with-selector.production.js
442
- *
443
- * Copyright (c) Meta Platforms, Inc. and affiliates.
444
- *
445
- * This source code is licensed under the MIT license found in the
446
- * LICENSE file in the root directory of this source tree.
447
- */var wu=h;function Eq(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tq=typeof Object.is=="function"?Object.is:Eq,Oq=wu.useSyncExternalStore,Aq=wu.useRef,Iq=wu.useEffect,Nq=wu.useMemo,_q=wu.useDebugValue;Pq.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=Aq(null);if(a.current===null){var l={hasValue:!1,value:null};a.current=l}else l=a.current;a=Nq(function(){function c(m){if(!u){if(u=!0,f=m,m=r(m),i!==void 0&&l.hasValue){var g=l.value;if(i(g,m))return d=g}return d=m}if(g=d,Tq(f,m))return g;var y=r(m);return i!==void 0&&i(g,y)?(f=m,g):(f=m,d=y)}var u=!1,f,d,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,i]);var s=Oq(e,a[0],a[1]);return Iq(function(){l.hasValue=!0,l.value=s},[s]),_q(s),s};function Mq(e){e()}function Rq(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Mq(()=>{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 TS={notify(){},get:()=>[]};function Dq(e,t){let n,r=TS,i=0,a=!1;function l(y){f();const x=r.subscribe(y);let v=!1;return()=>{v||(v=!0,x(),d())}}function s(){r.notify()}function c(){g.onStateChange&&g.onStateChange()}function u(){return a}function f(){i++,n||(n=e.subscribe(c),r=Rq())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=TS)}function p(){a||(a=!0,f())}function m(){a&&(a=!1,d())}const g={addNestedSub:l,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:u,trySubscribe:p,tryUnsubscribe:m,getListeners:()=>r};return g}var Lq=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",zq=Lq(),$q=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Bq=$q(),Fq=()=>zq||Bq?h.useLayoutEffect:h.useEffect,Uq=Fq();function OS(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Wq(e,t){if(OS(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])||!OS(e[n[i]],t[n[i]]))return!1;return!0}var ig=Symbol.for("react-redux-context"),ag=typeof globalThis<"u"?globalThis:{};function Kq(){if(!h.createContext)return{};const e=ag[ig]??(ag[ig]=new Map);let t=e.get(h.createContext);return t||(t=h.createContext(null),e.set(h.createContext,t)),t}var qq=Kq();function Hq(e){const{children:t,context:n,serverState:r,store:i}=e,a=h.useMemo(()=>{const c=Dq(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),l=h.useMemo(()=>i.getState(),[i]);Uq(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),l!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,l]);const s=n||qq;return h.createElement(s.Provider,{value:a},t)}var Vq=Hq,Yq=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Gq(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Xo(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Yq.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Wq(e[r],t[r]))return!1}else if(!Gq(e[r],t[r]))return!1;return!0}var Xq=["contextPayload"];function oy(){return oy=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},oy.apply(null,arguments)}function AS(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 Jl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AS(Object(n),!0).forEach(function(r){Qq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qq(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=Zq(e,"string");return typeof t=="symbol"?t:t+""}function Zq(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 eH(e,t){if(e==null)return{};var n,r,i=tH(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 tH(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 nH(e){return e.value}function rH(e){var{contextPayload:t}=e,n=eH(e,Xq),r=tA(t,e.payloadUniqBy,nH),i=Jl(Jl({},n),{},{payload:r});return h.isValidElement(e.content)?h.cloneElement(e.content,i):typeof e.content=="function"?h.createElement(e.content,i):h.createElement(TF,i)}function iH(e,t,n,r,i,a){var{layout:l,align:s,verticalAlign:c}=t,u,f;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(s==="center"&&l==="vertical"?u={left:((r||0)-a.width)/2}:u=s==="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"?f={top:((i||0)-a.height)/2}:f=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Jl(Jl({},u),f)}function aH(e){var t=mt();return h.useEffect(()=>{t(kq(e))},[t,e]),null}function oH(e){var t=mt();return h.useEffect(()=>(t(ES(e)),()=>{t(ES({width:0,height:0}))}),[t,e]),null}function lH(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var sH={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function cH(e){var t=Xt(e,sH),n=vK(),r=p5(),i=uq(),{width:a,height:l,wrapperStyle:s,portal:c}=t,[u,f]=pA([n]),d=w0(),p=j0();if(d==null||p==null)return null;var m=d-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),g=lH(t.layout,l,a,m),y=c?s:Jl(Jl({position:"absolute",width:(g==null?void 0:g.width)||a||"auto",height:(g==null?void 0:g.height)||l||"auto"},iH(s,t,i,d,p,u)),s),x=c??r;if(x==null||n==null)return null;var v=h.createElement("div",{className:"recharts-legend-wrapper",style:y,ref:f},h.createElement(aH,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&h.createElement(oH,{width:u.width,height:u.height}),h.createElement(rH,oy({},t,g,{margin:i,chartWidth:d,chartHeight:p,contextPayload:n})));return Wp.createPortal(v,x)}var Js=h.memo(cH,Xo);Js.displayName="Legend";function ly(){return ly=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},ly.apply(null,arguments)}function IS(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?IS(Object(n),!0).forEach(function(r){uH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uH(e,t,n){return(t=dH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dH(e){var t=fH(e,"string");return typeof t=="symbol"?t:t+""}function fH(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 pH(e){return Array.isArray(e)&&Si(e[0])&&Si(e[1])?e.join(" ~ "):e}var ol={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 hH(e,t){return t==null?e:lh(e,t)}var mH=e=>{var{separator:t=ol.separator,contentStyle:n,itemStyle:r,labelStyle:i=ol.labelStyle,payload:a,formatter:l,itemSorter:s,wrapperClassName:c,labelClassName:u,label:f,labelFormatter:d,accessibilityLayer:p=ol.accessibilityLayer}=e,m=()=>{if(a&&a.length){var C={padding:0,margin:0},S=hH(a,s),E=S.map((I,R)=>{if(!I||I.type==="none")return null;var A=I.formatter||l||pH,{value:_,name:N}=I,Y=_,K=N;if(A){var O=A(_,N,I,R,a);if(Array.isArray(O))[Y,K]=O;else if(O!=null)Y=O;else return null}var F=Rs(Rs({},ol.itemStyle),{},{color:I.color||ol.itemStyle.color},r);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:F},Si(K)?h.createElement("span",{className:"recharts-tooltip-item-name"},K):null,Si(K)?h.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,h.createElement("span",{className:"recharts-tooltip-item-value"},Y),h.createElement("span",{className:"recharts-tooltip-item-unit"},I.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:C},E)}return null},g=Rs(Rs({},ol.contentStyle),n),y=Rs({margin:0},i),x=!Tt(f),v=x?f:"",b=tt("recharts-default-tooltip",c),w=tt("recharts-tooltip-label",u);x&&d&&a!==void 0&&a!==null&&(v=d(f,a));var j=p?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",ly({className:b,style:g},j),h.createElement("p",{className:w,style:y},h.isValidElement(v)?v:"".concat(v)),m())},Ds="recharts-tooltip-wrapper",gH={visibility:"hidden"};function vH(e){var{coordinate:t,translateX:n,translateY:r}=e;return tt(Ds,{["".concat(Ds,"-right")]:ve(n)&&t&&ve(t.x)&&n>=t.x,["".concat(Ds,"-left")]:ve(n)&&t&&ve(t.x)&&n<t.x,["".concat(Ds,"-bottom")]:ve(r)&&t&&ve(t.y)&&r>=t.y,["".concat(Ds,"-top")]:ve(r)&&t&&ve(t.y)&&r<t.y})}function NS(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:l,tooltipDimension:s,viewBox:c,viewBoxDimension:u}=e;if(a&&ve(a[r]))return a[r];var f=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return l[r]?f:d;var p=c[r];if(p==null)return 0;if(l[r]){var m=f,g=p;return m<g?Math.max(d,p):Math.max(f,p)}if(u==null)return 0;var y=d+s,x=p+u;return y>x?Math.max(f,p):Math.max(d,p)}function yH(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function xH(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:l,tooltipBox:s,useTranslate3d:c,viewBox:u}=e,f,d,p;return s.height>0&&s.width>0&&n?(d=NS({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:s.width,viewBox:u,viewBoxDimension:u.width}),p=NS({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:s.height,viewBox:u,viewBoxDimension:u.height}),f=yH({translateX:d,translateY:p,useTranslate3d:c})):f=gH,{cssProperties:f,cssClasses:vH({translateX:d,translateY:p,coordinate:n})}}var bH=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),ju={isSsr:bH()};function hI(){var[e,t]=h.useState(()=>ju.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return h.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function _S(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 ll(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_S(Object(n),!0).forEach(function(r){wH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_S(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wH(e,t,n){return(t=jH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jH(e){var t=SH(e,"string");return typeof t=="symbol"?t:t+""}function SH(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 kH(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function CH(e){var t,n,r,i,a,l,s=hI(),[c,u]=h.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));h.useEffect(()=>{var g=y=>{if(y.key==="Escape"){var x,v,b,w;u({dismissed:!0,dismissedAtCoordinate:{x:(x=(v=e.coordinate)===null||v===void 0?void 0:v.x)!==null&&x!==void 0?x:0,y:(b=(w=e.coordinate)===null||w===void 0?void 0:w.y)!==null&&b!==void 0?b:0}})}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),c.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==c.dismissedAtCoordinate.x||((a=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&a!==void 0?a:0)!==c.dismissedAtCoordinate.y)&&u(ll(ll({},c),{},{dismissed:!1}));var{cssClasses:f,cssProperties:d}=xH({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}),p=e.hasPortalFromProps?{}:ll(ll({transition:kH({prefersReducedMotion:s,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},d),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),m=ll(ll({},p),{},{visibility:!c.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:f,style:m,ref:e.innerRef},e.children)}var PH=h.memo(CH),mI=()=>{var e;return(e=ke(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function sy(){return sy=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},sy.apply(null,arguments)}function MS(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?MS(Object(n),!0).forEach(function(r){EH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EH(e,t,n){return(t=TH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TH(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)}var DS={curveBasisClosed:N5,curveBasisOpen:_5,curveBasis:I5,curveBumpX:v5,curveBumpY:y5,curveLinearClosed:M5,curveLinear:eh,curveMonotoneX:R5,curveMonotoneY:D5,curveNatural:L5,curveStep:z5,curveStepAfter:B5,curveStepBefore:$5},Xf=e=>Ue(e.x)&&Ue(e.y),LS=e=>e.base!=null&&Xf(e.base)&&Xf(e),Ls=e=>e.x,zs=e=>e.y,AH=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(pu(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=DS["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return DS[n]||eh},zS={connectNulls:!1,type:"linear"},IH=e=>{var{type:t=zS.type,points:n=[],baseLine:r,layout:i,connectNulls:a=zS.connectNulls}=e,l=AH(t,i),s=a?n.filter(Xf):n;if(Array.isArray(r)){var c,u=n.map((g,y)=>RS(RS({},g),{},{base:r[y]}));i==="vertical"?c=pd().y(zs).x1(Ls).x0(g=>g.base.x):c=pd().x(Ls).y1(zs).y0(g=>g.base.y);var f=c.defined(LS).curve(l),d=a?u.filter(LS):u;return f(d)}var p;i==="vertical"&&ve(r)?p=pd().y(zs).x1(Ls).x0(r):ve(r)?p=pd().x(Ls).y1(zs).y0(r):p=pO().x(Ls).y(zs);var m=p.defined(Xf).curve(l);return m(s)},Ll=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Va();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?IH(l):r;return h.createElement("path",sy({},qn(e),t0(e),{className:tt("recharts-curve",t),d:s===null?void 0:s,ref:i}))},NH=["x","y","top","left","width","height","className"];function cy(){return cy=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},cy.apply(null,arguments)}function $S(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 _H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$S(Object(n),!0).forEach(function(r){MH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$S(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MH(e,t,n){return(t=RH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RH(e){var t=DH(e,"string");return typeof t=="symbol"?t:t+""}function DH(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 LH(e,t){if(e==null)return{};var n,r,i=zH(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 zH(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 $H=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),BH=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:s}=e,c=LH(e,NH),u=_H({x:t,y:n,top:r,left:i,width:a,height:l},c);return!ve(t)||!ve(n)||!ve(a)||!ve(l)||!ve(r)||!ve(i)?null:h.createElement("path",cy({},Ln(u),{className:tt("recharts-cross",s),d:$H(t,n,a,l,r,i)}))};function FH(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}}function BS(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 FS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BS(Object(n),!0).forEach(function(r){UH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UH(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=KH(e,"string");return typeof t=="symbol"?t:t+""}function KH(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 qH=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),gI=(e,t,n)=>e.map(r=>"".concat(qH(r)," ").concat(t,"ms ").concat(n)).join(","),HH=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Yc=(e,t)=>Object.keys(t).reduce((n,r)=>FS(FS({},n),{},{[r]:e(r,t[r])}),{});function US(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 ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?US(Object(n),!0).forEach(function(r){VH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):US(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VH(e,t,n){return(t=YH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YH(e){var t=GH(e,"string");return typeof t=="symbol"?t:t+""}function GH(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 Qf=(e,t,n)=>e+(t-e)*n,uy=e=>{var{from:t,to:n}=e;return t!==n},vI=(e,t,n)=>{var r=Yc((i,a)=>{if(uy(a)){var[l,s]=e(a.from,a.to,a.velocity);return ln(ln({},a),{},{from:l,velocity:s})}return a},t);return n<1?Yc((i,a)=>uy(a)&&r[i]!=null?ln(ln({},a),{},{velocity:Qf(a.velocity,r[i].velocity,n),from:Qf(a.from,r[i].from,n)}):a,t):vI(e,r,n-1)};function XH(e,t,n,r,i,a){var l,s=r.reduce((p,m)=>ln(ln({},p),{},{[m]:{from:e[m],velocity:0,to:t[m]}}),{}),c=()=>Yc((p,m)=>m.from,s),u=()=>!Object.values(s).filter(uy).length,f=null,d=p=>{l||(l=p);var m=p-l,g=m/n.dt;s=vI(n,s,g),i(ln(ln(ln({},e),t),c())),l=p,u()||(f=a.setTimeout(d))};return()=>(f=a.setTimeout(d),()=>{var p;(p=f)===null||p===void 0||p()})}function QH(e,t,n,r,i,a,l){var s=null,c=i.reduce((d,p)=>{var m=e[p],g=t[p];return m==null||g==null?d:ln(ln({},d),{},{[p]:[m,g]})},{}),u,f=d=>{u||(u=d);var p=(d-u)/r,m=Yc((y,x)=>Qf(...x,n(p)),c);if(a(ln(ln(ln({},e),t),m)),p<1)s=l.setTimeout(f);else{var g=Yc((y,x)=>Qf(...x,n(1)),c);a(ln(ln(ln({},e),t),g))}};return()=>(s=l.setTimeout(f),()=>{var d;(d=s)===null||d===void 0||d()})}const JH=(e,t,n,r,i,a)=>{var l=HH(e,t);return n==null?()=>(i(ln(ln({},e),t)),()=>{}):n.isStepper===!0?XH(e,t,n,l,i,a):QH(e,t,n,r,l,i,a)};var Jf=1e-4,yI=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],xI=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),WS=(e,t)=>n=>{var r=yI(e,t);return xI(r,n)},ZH=(e,t)=>n=>{var r=yI(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return xI(i,n)},e7=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]]},t7=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=e7(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},n7=(e,t,n,r)=>{var i=WS(e,n),a=WS(t,r),l=ZH(e,n),s=u=>u>1?1:u<0?0:u,c=u=>{for(var f=u>1?1:u,d=f,p=0;p<8;++p){var m=i(d)-f,g=l(d);if(Math.abs(m-f)<Jf||g<Jf)return a(d);d=s(d-m/g)}return a(d)};return c.isStepper=!1,c},KS=function(){return n7(...t7(...arguments))},r7=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(l,s,c)=>{var u=-(l-s)*n,f=c*r,d=c+(u-f)*i/1e3,p=c*i/1e3+l;return Math.abs(p-s)<Jf&&Math.abs(d)<Jf?[s,0]:[p,d]};return a.isStepper=!0,a.dt=i,a},i7=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return KS(e);case"spring":return r7();default:if(e.split("(")[0]==="cubic-bezier")return KS(e)}return typeof e=="function"?e:null};function a7(e){var t,n=()=>null,r=!1,i=null,a=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var s=l,[c,...u]=s;if(typeof c=="number"){i=e.setTimeout(a.bind(null,u),c);return}a(c),i=e.setTimeout(a.bind(null,u));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),a(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class o7{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function l7(){return a7(new o7)}var s7=h.createContext(l7);function c7(e,t){var n=h.useContext(s7);return h.useMemo(()=>t??n(e),[e,t,n])}var u7={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},qS={t:0},og={t:1};function ds(e){var t=Xt(e,u7),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:s,onAnimationStart:c,children:u}=t,f=hI(),d=n==="auto"?!ju.isSsr&&!f:n,p=c7(t.animationId,t.animationManager),[m,g]=h.useState(d?qS:og),y=h.useRef(null);return h.useEffect(()=>{d||g(og)},[d]),h.useEffect(()=>{if(!d||!r)return qa;var x=JH(qS,og,i7(a),i,g,p.getTimeoutController()),v=()=>{y.current=x()};return p.start([c,l,v,i,s]),()=>{p.stop(),y.current&&y.current(),s()}},[d,r,i,a,l,c,s,p]),u(m.t)}function fs(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=h.useRef(Fc(t)),r=h.useRef(e);return r.current!==e&&(n.current=Fc(t),r.current=e),n.current}var d7=["radius"],f7=["radius"],HS,VS,YS,GS,XS,QS,JS,ZS,ek,tk;function nk(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 rk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nk(Object(n),!0).forEach(function(r){p7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p7(e,t,n){return(t=h7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h7(e){var t=m7(e,"string");return typeof t=="symbol"?t:t+""}function m7(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 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 ik(e,t){if(e==null)return{};var n,r,i=g7(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 g7(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 li(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ak=(e,t,n,r,i)=>{var a=ja(n),l=ja(r),s=Math.min(Math.abs(a)/2,Math.abs(l)/2),c=l>=0?1:-1,u=a>=0?1:-1,f=l>=0&&a>=0||l<0&&a<0?1:0,d;if(s>0&&Array.isArray(i)){for(var p=[0,0,0,0],m=0,g=4;m<g;m++){var y,x=(y=i[m])!==null&&y!==void 0?y:0;p[m]=x>s?s:x}d=Wt(HS||(HS=li(["M",",",""])),e,t+c*p[0]),p[0]>0&&(d+=Wt(VS||(VS=li(["A ",",",",0,0,",",",",",""])),p[0],p[0],f,e+u*p[0],t)),d+=Wt(YS||(YS=li(["L ",",",""])),e+n-u*p[1],t),p[1]>0&&(d+=Wt(GS||(GS=li(["A ",",",",0,0,",`,
448
- `,",",""])),p[1],p[1],f,e+n,t+c*p[1])),d+=Wt(XS||(XS=li(["L ",",",""])),e+n,t+r-c*p[2]),p[2]>0&&(d+=Wt(QS||(QS=li(["A ",",",",0,0,",`,
449
- `,",",""])),p[2],p[2],f,e+n-u*p[2],t+r)),d+=Wt(JS||(JS=li(["L ",",",""])),e+u*p[3],t+r),p[3]>0&&(d+=Wt(ZS||(ZS=li(["A ",",",",0,0,",`,
450
- `,",",""])),p[3],p[3],f,e,t+r-c*p[3])),d+="Z"}else if(s>0&&i===+i&&i>0){var v=Math.min(s,i);d=Wt(ek||(ek=li(["M ",",",`
451
- A `,",",",0,0,",",",",",`
452
- L `,",",`
453
- A `,",",",0,0,",",",",",`
454
- L `,",",`
455
- A `,",",",0,0,",",",",",`
456
- L `,",",`
457
- A `,",",",0,0,",",",","," Z"])),e,t+c*v,v,v,f,e+u*v,t,e+n-u*v,t,v,v,f,e+n,t+c*v,e+n,t+r-c*v,v,v,f,e+n-u*v,t+r,e+u*v,t+r,v,v,f,e,t+r-c*v)}else d=Wt(tk||(tk=li(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},ok={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bI=e=>{var t=Xt(e,ok),n=h.useRef(null),[r,i]=h.useState(-1);h.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var W=n.current.getTotalLength();W&&i(W)}catch{}},[]);var{x:a,y:l,width:s,height:c,radius:u,className:f}=t,{animationEasing:d,animationDuration:p,animationBegin:m,isAnimationActive:g,isUpdateAnimationActive:y}=t,x=h.useRef(s),v=h.useRef(c),b=h.useRef(a),w=h.useRef(l),j=h.useMemo(()=>({x:a,y:l,width:s,height:c,radius:u}),[a,l,s,c,u]),C=fs(j,"rectangle-");if(a!==+a||l!==+l||s!==+s||c!==+c||s===0||c===0)return null;var S=tt("recharts-rectangle",f);if(!y){var E=Ln(t),{radius:I}=E,R=ik(E,d7);return h.createElement("path",Zf({},R,{x:ja(a),y:ja(l),width:ja(s),height:ja(c),radius:typeof u=="number"?u:void 0,className:S,d:ak(a,l,s,c,u)}))}var A=x.current,_=v.current,N=b.current,Y=w.current,K="0px ".concat(r===-1?1:r,"px"),O="".concat(r,"px ").concat(r,"px"),F=gI(["strokeDasharray"],p,typeof d=="string"?d:ok.animationEasing);return h.createElement(ds,{animationId:C,key:C,canBegin:r>0,duration:p,easing:d,isActive:y,begin:m},W=>{var M=st(A,s,W),B=st(_,c,W),k=st(N,a,W),L=st(Y,l,W);n.current&&(x.current=M,v.current=B,b.current=k,w.current=L);var X;g?W>0?X={transition:F,strokeDasharray:O}:X={strokeDasharray:K}:X={strokeDasharray:O};var T=Ln(t),{radius:ce}=T,ge=ik(T,f7);return h.createElement("path",Zf({},ge,{radius:typeof u=="number"?u:void 0,className:S,d:ak(k,L,M,B,u),ref:n,style:rk(rk({},X),t.style)}))})};function lk(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 sk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lk(Object(n),!0).forEach(function(r){v7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function v7(e,t,n){return(t=y7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y7(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)}var ep=Math.PI/180,b7=e=>e*180/Math.PI,tn=(e,t,n,r)=>({x:e+Math.cos(-ep*r)*n,y:t+Math.sin(-ep*r)*n}),wI=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},w7=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},j7=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=w7({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var s=(n-i)/l,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:l,angle:b7(c),angleInRadian:c}},S7=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},k7=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},C7=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=j7({x:n,y:r},t),{innerRadius:l,outerRadius:s}=t;if(i<l||i>s||i===0)return null;var{startAngle:c,endAngle:u}=S7(t),f=a,d;if(c<=u){for(;f>u;)f-=360;for(;f<c;)f+=360;d=f>=c&&f<=u}else{for(;f>c;)f-=360;for(;f<u;)f+=360;d=f>=u&&f<=c}return d?sk(sk({},t),{},{radius:i,angle:k7(f,t)}):null};function jI(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,l=tn(t,n,r,i),s=tn(t,n,r,a);return{points:[l,s],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var ck,uk,dk,fk,pk,hk,mk;function dy(){return dy=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},dy.apply(null,arguments)}function bo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var P7=(e,t)=>{var n=vn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Sd=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:l,cornerRadius:s,cornerIsExternal:c}=e,u=s*(l?1:-1)+r,f=Math.asin(s/u)/ep,d=c?i:i+a*f,p=tn(t,n,u,d),m=tn(t,n,r,d),g=c?i-a*f:i,y=tn(t,n,u*Math.cos(f*ep),g);return{center:p,circleTangency:m,lineTangency:y,theta:f}},SI=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,s=P7(a,l),c=a+s,u=tn(t,n,i,a),f=tn(t,n,i,c),d=Wt(ck||(ck=bo(["M ",",",`
458
- A `,",",`,0,
459
- `,",",`,
460
- `,",",`
461
- `])),u.x,u.y,i,i,+(Math.abs(s)>180),+(a>c),f.x,f.y);if(r>0){var p=tn(t,n,r,a),m=tn(t,n,r,c);d+=Wt(uk||(uk=bo(["L ",",",`
462
- A `,",",`,0,
463
- `,",",`,
464
- `,","," Z"])),m.x,m.y,r,r,+(Math.abs(s)>180),+(a<=c),p.x,p.y)}else d+=Wt(dk||(dk=bo(["L ",","," Z"])),t,n);return d},E7=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:l,cornerIsExternal:s,startAngle:c,endAngle:u}=e,f=vn(u-c),{circleTangency:d,lineTangency:p,theta:m}=Sd({cx:t,cy:n,radius:i,angle:c,sign:f,cornerRadius:a,cornerIsExternal:s}),{circleTangency:g,lineTangency:y,theta:x}=Sd({cx:t,cy:n,radius:i,angle:u,sign:-f,cornerRadius:a,cornerIsExternal:s}),v=s?Math.abs(c-u):Math.abs(c-u)-m-x;if(v<0)return l?Wt(fk||(fk=bo(["M ",",",`
465
- a`,",",",0,0,1,",`,0
466
- a`,",",",0,0,1,",`,0
467
- `])),p.x,p.y,a,a,a*2,a,a,-a*2):SI({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var b=Wt(pk||(pk=bo(["M ",",",`
468
- A`,",",",0,0,",",",",",`
469
- A`,",",",0,",",",",",",",`
470
- A`,",",",0,0,",",",",",`
471
- `])),p.x,p.y,a,a,+(f<0),d.x,d.y,i,i,+(v>180),+(f<0),g.x,g.y,a,a,+(f<0),y.x,y.y);if(r>0){var{circleTangency:w,lineTangency:j,theta:C}=Sd({cx:t,cy:n,radius:r,angle:c,sign:f,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),{circleTangency:S,lineTangency:E,theta:I}=Sd({cx:t,cy:n,radius:r,angle:u,sign:-f,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),R=s?Math.abs(c-u):Math.abs(c-u)-C-I;if(R<0&&a===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=Wt(hk||(hk=bo(["L",",",`
472
- A`,",",",0,0,",",",",",`
473
- A`,",",",0,",",",",",",",`
474
- A`,",",",0,0,",",",",","Z"])),E.x,E.y,a,a,+(f<0),S.x,S.y,r,r,+(R>180),+(f>0),w.x,w.y,a,a,+(f<0),j.x,j.y)}else b+=Wt(mk||(mk=bo(["L",",","Z"])),t,n);return b},T7={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},kI=e=>{var t=Xt(e,T7),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:l,forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:f,className:d}=t;if(a<i||u===f)return null;var p=tt("recharts-sector",d),m=a-i,g=Rn(l,m,0,!0),y;return g>0&&Math.abs(u-f)<360?y=E7({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,m/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:f}):y=SI({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f}),h.createElement("path",dy({},Ln(t),{className:p,d:y}))};function O7(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(IO(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:l,angle:s}=t,c=tn(r,i,a,s),u=tn(r,i,l,s);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return jI(t)}}var CI={},PI={},EI={};const A7=d0;function I7(e){return A7.isSymbol(e)?NaN:Number(e)}EI.toNumber=I7;const N7=EI;function _7(e){return e?(e=N7.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}PI.toFinite=_7;const lg=PI,M7=u0;function R7(e,t,n){n&&typeof n!="number"&&M7.isIterateeCall(e,t,n)&&(t=n=void 0),e=lg.toFinite(e),t===void 0?(t=e,e=0):t=lg.toFinite(t),n=n===void 0?e<t?1:-1:lg.toFinite(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}CI.range=R7;var D7=CI.range;const TI=zr(D7);var ni=e=>e.chartData,Su=q([ni],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),ku=(e,t,n,r)=>r?Su(e):ni(e),OI=(e,t,n)=>n?Su(e):ni(e),L7=q([ku],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),z7=q([Su],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),$7=q([ni],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function bi(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Ue(t)&&Ue(n))return!0}return!1}function gk(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function AI(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Ue(n))i=n;else if(typeof n=="function")return;if(Ue(r))a=r;else if(typeof r=="function")return;var l=[i,a];if(bi(l))return l}}function B7(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(bi(r))return gk(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,l,s;if(i==="auto")t!=null&&(l=Math.min(...t));else if(ve(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&mS.test(i)){var c=mS.exec(i);if(c==null||c[1]==null||t==null)l=void 0;else{var u=+c[1];l=t[0]-u}}else l=t==null?void 0:t[0];if(a==="auto")t!=null&&(s=Math.max(...t));else if(ve(a))s=a;else if(typeof a=="function")try{t!=null&&(s=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&gS.test(a)){var f=gS.exec(a);if(f==null||f[1]==null||t==null)s=void 0;else{var d=+f[1];s=t[1]+d}}else s=t==null?void 0:t[1];var p=[l,s];if(bi(p))return t==null?p:gk(p,t,n)}}}var ps=1e9,F7={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},E0,It=!0,Lr="[DecimalError] ",To=Lr+"Invalid argument: ",P0=Lr+"Exponent out of range: ",hs=Math.floor,po=Math.pow,U7=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ur,mn=1e7,Pt=7,II=9007199254740991,tp=hs(II/Pt),Ce={};Ce.absoluteValue=Ce.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ce.comparedTo=Ce.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};Ce.decimalPlaces=Ce.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Pt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ce.dividedBy=Ce.div=function(e){return Ui(this,new this.constructor(e))};Ce.dividedToIntegerBy=Ce.idiv=function(e){var t=this,n=t.constructor;return yt(Ui(t,new n(e),0,1),n.precision)};Ce.equals=Ce.eq=function(e){return!this.cmp(e)};Ce.exponent=function(){return nn(this)};Ce.greaterThan=Ce.gt=function(e){return this.cmp(e)>0};Ce.greaterThanOrEqualTo=Ce.gte=function(e){return this.cmp(e)>=0};Ce.isInteger=Ce.isint=function(){return this.e>this.d.length-2};Ce.isNegative=Ce.isneg=function(){return this.s<0};Ce.isPositive=Ce.ispos=function(){return this.s>0};Ce.isZero=function(){return this.s===0};Ce.lessThan=Ce.lt=function(e){return this.cmp(e)<0};Ce.lessThanOrEqualTo=Ce.lte=function(e){return this.cmp(e)<1};Ce.logarithm=Ce.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(ur))throw Error(Lr+"NaN");if(n.s<1)throw Error(Lr+(n.s?"NaN":"-Infinity"));return n.eq(ur)?new r(0):(It=!1,t=Ui(Gc(n,a),Gc(e,a),a),It=!0,yt(t,i))};Ce.minus=Ce.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?MI(t,e):NI(t,(e.s=-e.s,e))};Ce.modulo=Ce.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Lr+"NaN");return n.s?(It=!1,t=Ui(n,e,0,1).times(e),It=!0,n.minus(t)):yt(new r(n),i)};Ce.naturalExponential=Ce.exp=function(){return _I(this)};Ce.naturalLogarithm=Ce.ln=function(){return Gc(this)};Ce.negated=Ce.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ce.plus=Ce.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?NI(t,e):MI(t,(e.s=-e.s,e))};Ce.precision=Ce.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(To+e);if(t=nn(i)+1,r=i.d.length-1,n=r*Pt+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};Ce.squareRoot=Ce.sqrt=function(){var e,t,n,r,i,a,l,s=this,c=s.constructor;if(s.s<1){if(!s.s)return new c(0);throw Error(Lr+"NaN")}for(e=nn(s),It=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=vi(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=hs((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=l=n+3;;)if(a=r,r=a.plus(Ui(s,a,l+2)).times(.5),vi(a.d).slice(0,l)===(t=vi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(yt(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if(t!="9999")break;l+=4}return It=!0,yt(r,n)};Ce.times=Ce.mul=function(e){var t,n,r,i,a,l,s,c,u,f=this,d=f.constructor,p=f.d,m=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,n=f.e+e.e,c=p.length,u=m.length,c<u&&(a=p,p=m,m=a,l=c,c=u,u=l),a=[],l=c+u,r=l;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+m[r]*p[i-r-1]+t,a[i--]=s%mn|0,t=s/mn|0;a[i]=(a[i]+t)%mn|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,It?yt(e,d.precision):e};Ce.toDecimalPlaces=Ce.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ci(e,0,ps),t===void 0?t=r.rounding:Ci(t,0,8),yt(n,e+nn(n)+1,t))};Ce.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Wo(r,!0):(Ci(e,0,ps),t===void 0?t=i.rounding:Ci(t,0,8),r=yt(new i(r),e+1,t),n=Wo(r,!0,e+1)),n};Ce.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Wo(i):(Ci(e,0,ps),t===void 0?t=a.rounding:Ci(t,0,8),r=yt(new a(i),e+nn(i)+1,t),n=Wo(r.abs(),!1,e+nn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ce.toInteger=Ce.toint=function(){var e=this,t=e.constructor;return yt(new t(e),nn(e)+1,t.rounding)};Ce.toNumber=function(){return+this};Ce.toPower=Ce.pow=function(e){var t,n,r,i,a,l,s=this,c=s.constructor,u=12,f=+(e=new c(e));if(!e.s)return new c(ur);if(s=new c(s),!s.s){if(e.s<1)throw Error(Lr+"Infinity");return s}if(s.eq(ur))return s;if(r=c.precision,e.eq(ur))return yt(s,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=s.s,l){if((n=f<0?-f:f)<=II){for(i=new c(ur),t=Math.ceil(r/Pt+4),It=!1;n%2&&(i=i.times(s),yk(i.d,t)),n=hs(n/2),n!==0;)s=s.times(s),yk(s.d,t);return It=!0,e.s<0?new c(ur).div(i):yt(i,r)}}else if(a<0)throw Error(Lr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,It=!1,i=e.times(Gc(s,r+u)),It=!0,i=_I(i),i.s=a,i};Ce.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=nn(i),r=Wo(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ci(e,1,ps),t===void 0?t=a.rounding:Ci(t,0,8),i=yt(new a(i),e,t),n=nn(i),r=Wo(i,e<=n||n<=a.toExpNeg,e)),r};Ce.toSignificantDigits=Ce.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ci(e,1,ps),t===void 0?t=r.rounding:Ci(t,0,8)),yt(new r(n),e,t)};Ce.toString=Ce.valueOf=Ce.val=Ce.toJSON=Ce[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=nn(e),n=e.constructor;return Wo(e,t<=n.toExpNeg||t>=n.toExpPos)};function NI(e,t){var n,r,i,a,l,s,c,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),It?yt(t,d):t;if(c=e.d,u=t.d,l=e.e,i=t.e,c=c.slice(),a=l-i,a){for(a<0?(r=c,a=-a,s=u.length):(r=u,i=l,s=c.length),l=Math.ceil(d/Pt),s=l>s?l+1:s+1,a>s&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(s=c.length,a=u.length,s-a<0&&(a=s,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/mn|0,c[a]%=mn;for(n&&(c.unshift(n),++i),s=c.length;c[--s]==0;)c.pop();return t.d=c,t.e=i,It?yt(t,d):t}function Ci(e,t,n){if(e!==~~e||e<t||e>n)throw Error(To+e)}function vi(e){var t,n,r,i=e.length-1,a="",l=e[0];if(i>0){for(a+=l,t=1;t<i;t++)r=e[t]+"",n=Pt-r.length,n&&(a+=ha(n)),a+=r;l=e[t],r=l+"",n=Pt-r.length,n&&(a+=ha(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var Ui=function(){function e(r,i){var a,l=0,s=r.length;for(r=r.slice();s--;)a=r[s]*i+l,r[s]=a%mn|0,l=a/mn|0;return l&&r.unshift(l),r}function t(r,i,a,l){var s,c;if(a!=l)c=a>l?1:-1;else for(s=c=0;s<a;s++)if(r[s]!=i[s]){c=r[s]>i[s]?1:-1;break}return c}function n(r,i,a){for(var l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*mn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var s,c,u,f,d,p,m,g,y,x,v,b,w,j,C,S,E,I,R=r.constructor,A=r.s==i.s?1:-1,_=r.d,N=i.d;if(!r.s)return new R(r);if(!i.s)throw Error(Lr+"Division by zero");for(c=r.e-i.e,E=N.length,C=_.length,m=new R(A),g=m.d=[],u=0;N[u]==(_[u]||0);)++u;if(N[u]>(_[u]||0)&&--c,a==null?b=a=R.precision:l?b=a+(nn(r)-nn(i))+1:b=a,b<0)return new R(0);if(b=b/Pt+2|0,u=0,E==1)for(f=0,N=N[0],b++;(u<C||f)&&b--;u++)w=f*mn+(_[u]||0),g[u]=w/N|0,f=w%N|0;else{for(f=mn/(N[0]+1)|0,f>1&&(N=e(N,f),_=e(_,f),E=N.length,C=_.length),j=E,y=_.slice(0,E),x=y.length;x<E;)y[x++]=0;I=N.slice(),I.unshift(0),S=N[0],N[1]>=mn/2&&++S;do f=0,s=t(N,y,E,x),s<0?(v=y[0],E!=x&&(v=v*mn+(y[1]||0)),f=v/S|0,f>1?(f>=mn&&(f=mn-1),d=e(N,f),p=d.length,x=y.length,s=t(d,y,p,x),s==1&&(f--,n(d,E<p?I:N,p))):(f==0&&(s=f=1),d=N.slice()),p=d.length,p<x&&d.unshift(0),n(y,d,x),s==-1&&(x=y.length,s=t(N,y,E,x),s<1&&(f++,n(y,E<x?I:N,x))),x=y.length):s===0&&(f++,y=[0]),g[u++]=f,s&&y[0]?y[x++]=_[j]||0:(y=[_[j]],x=1);while((j++<C||y[0]!==void 0)&&b--)}return g[0]||g.shift(),m.e=c,yt(m,l?a+nn(m)+1:a)}}();function _I(e,t){var n,r,i,a,l,s,c=0,u=0,f=e.constructor,d=f.precision;if(nn(e)>16)throw Error(P0+nn(e));if(!e.s)return new f(ur);for(It=!1,s=d,l=new f(.03125);e.abs().gte(.1);)e=e.times(l),u+=5;for(r=Math.log(po(2,u))/Math.LN10*2+5|0,s+=r,n=i=a=new f(ur),f.precision=s;;){if(i=yt(i.times(e),s),n=n.times(++c),l=a.plus(Ui(i,n,s)),vi(l.d).slice(0,s)===vi(a.d).slice(0,s)){for(;u--;)a=yt(a.times(a),s);return f.precision=d,t==null?(It=!0,yt(a,d)):a}a=l}}function nn(e){for(var t=e.e*Pt,n=e.d[0];n>=10;n/=10)t++;return t}function sg(e,t,n){if(t>e.LN10.sd())throw It=!0,n&&(e.precision=n),Error(Lr+"LN10 precision limit exceeded");return yt(new e(e.LN10),t)}function ha(e){for(var t="";e--;)t+="0";return t}function Gc(e,t){var n,r,i,a,l,s,c,u,f,d=1,p=10,m=e,g=m.d,y=m.constructor,x=y.precision;if(m.s<1)throw Error(Lr+(m.s?"NaN":"-Infinity"));if(m.eq(ur))return new y(0);if(t==null?(It=!1,u=x):u=t,m.eq(10))return t==null&&(It=!0),sg(y,u);if(u+=p,y.precision=u,n=vi(g),r=n.charAt(0),a=nn(m),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=vi(m.d),r=n.charAt(0),d++;a=nn(m),r>1?(m=new y("0."+n),a++):m=new y(r+"."+n.slice(1))}else return c=sg(y,u+2,x).times(a+""),m=Gc(new y(r+"."+n.slice(1)),u-p).plus(c),y.precision=x,t==null?(It=!0,yt(m,x)):m;for(s=l=m=Ui(m.minus(ur),m.plus(ur),u),f=yt(m.times(m),u),i=3;;){if(l=yt(l.times(f),u),c=s.plus(Ui(l,new y(i),u)),vi(c.d).slice(0,u)===vi(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(sg(y,u+2,x).times(a+""))),s=Ui(s,new y(d),u),y.precision=x,t==null?(It=!0,yt(s,x)):s;s=c,i+=2}}function vk(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=hs(n/Pt),e.d=[],r=(n+1)%Pt,n<0&&(r+=Pt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Pt;r<i;)e.d.push(+t.slice(r,r+=Pt));t=t.slice(r),r=Pt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),It&&(e.e>tp||e.e<-tp))throw Error(P0+n)}else e.s=0,e.e=0,e.d=[0];return e}function yt(e,t,n){var r,i,a,l,s,c,u,f,d=e.d;for(l=1,a=d[0];a>=10;a/=10)l++;if(r=t-l,r<0)r+=Pt,i=t,u=d[f=0];else{if(f=Math.ceil((r+1)/Pt),a=d.length,f>=a)return e;for(u=a=d[f],l=1;a>=10;a/=10)l++;r%=Pt,i=r-Pt+l}if(n!==void 0&&(a=po(10,l-i-1),s=u/a%10|0,c=t<0||d[f+1]!==void 0||u%a,c=n<4?(s||c)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||c||n==6&&(r>0?i>0?u/po(10,l-i):0:d[f-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=nn(e),d.length=1,t=t-a-1,d[0]=po(10,(Pt-t%Pt)%Pt),e.e=hs(-t/Pt)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(r==0?(d.length=f,a=1,f--):(d.length=f+1,a=po(10,Pt-r),d[f]=i>0?(u/po(10,l-i)%po(10,i)|0)*a:0),c)for(;;)if(f==0){(d[0]+=a)==mn&&(d[0]=1,++e.e);break}else{if(d[f]+=a,d[f]!=mn)break;d[f--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if(It&&(e.e>tp||e.e<-tp))throw Error(P0+nn(e));return e}function MI(e,t){var n,r,i,a,l,s,c,u,f,d,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),It?yt(t,m):t;if(c=e.d,d=t.d,r=t.e,u=e.e,c=c.slice(),l=u-r,l){for(f=l<0,f?(n=c,l=-l,s=d.length):(n=d,r=u,s=c.length),i=Math.max(Math.ceil(m/Pt),s)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=c.length,s=d.length,f=i<s,f&&(s=i),i=0;i<s;i++)if(c[i]!=d[i]){f=c[i]<d[i];break}l=0}for(f&&(n=c,c=d,d=n,t.s=-t.s),s=c.length,i=d.length-s;i>0;--i)c[s++]=0;for(i=d.length;i>l;){if(c[--i]<d[i]){for(a=i;a&&c[--a]===0;)c[a]=mn-1;--c[a],c[i]+=mn}c[i]-=d[i]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,It?yt(t,m):t):new p(0)}function Wo(e,t,n){var r,i=nn(e),a=vi(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+ha(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ha(-i-1)+a,n&&(r=n-l)>0&&(a+=ha(r))):i>=l?(a+=ha(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+ha(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=ha(r))),e.s<0?"-"+a:a}function yk(e,t){if(e.length>t)return e.length=t,!0}function RI(e){var t,n,r;function i(a){var l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,a instanceof i){l.s=a.s,l.e=a.e,l.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(To+a);if(a>0)l.s=1;else if(a<0)a=-a,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(a===~~a&&a<1e7){l.e=0,l.d=[a];return}return vk(l,a.toString())}else if(typeof a!="string")throw Error(To+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,U7.test(a))vk(l,a);else throw Error(To+a)}if(i.prototype=Ce,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=RI,i.config=i.set=W7,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 W7(e){if(!e||typeof e!="object")throw Error(Lr+"Object expected");var t,n,r,i=["precision",1,ps,"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(hs(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(To+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(To+n+": "+r);return this}var E0=RI(F7);ur=new E0(1);const Qe=E0;function DI(e){var t;return e===0?t=1:t=Math.floor(new Qe(e).abs().log(10).toNumber())+1,t}function LI(e,t,n){for(var r=new Qe(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var zI=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},T0=(e,t,n)=>{if(e.lte(0))return new Qe(0);var r=DI(e.toNumber()),i=new Qe(10).pow(r),a=e.div(i),l=r!==1?.05:.1,s=new Qe(Math.ceil(a.div(l).toNumber())).add(n).mul(l),c=s.mul(i);return t?new Qe(c.toNumber()):new Qe(Math.ceil(c.toNumber()))},$I=(e,t,n)=>{var r;if(e.lte(0))return new Qe(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new Qe(a).abs().log(10).toNumber()),s=new Qe(10).pow(l),c=e.div(s).toNumber(),u=i.findIndex(m=>m>=c-1e-10);if(u===-1&&(s=s.mul(10),u=0),u+=n,u>=i.length){var f=Math.floor(u/i.length);u%=i.length,s=s.mul(new Qe(10).pow(f))}var d=(r=i[u])!==null&&r!==void 0?r:1,p=new Qe(d).mul(s);return t?p:new Qe(Math.ceil(p.toNumber()))},K7=(e,t,n)=>{var r=new Qe(1),i=new Qe(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Qe(10).pow(DI(e)-1),i=new Qe(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Qe(Math.floor(e)))}else e===0?i=new Qe(Math.floor((t-1)/2)):n||(i=new Qe(Math.floor(e)));for(var l=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new Qe(c-l).mul(r)).toNumber());return s},BI=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:T0;if(!Number.isFinite((n-t)/(r-1)))return{step:new Qe(0),tickMin:new Qe(0),tickMax:new Qe(0)};var s=l(new Qe(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new Qe(0):(c=new Qe(t).add(n).div(2),c=c.sub(new Qe(c).mod(s)));var u=Math.ceil(c.sub(t).div(s).toNumber()),f=Math.ceil(new Qe(n).sub(c).div(s).toNumber()),d=u+f+1;return d>r?BI(t,n,r,i,a+1,l):(d<r&&(f=n>0?f+(r-d):f,u=n>0?u:u+(r-d)),{step:s,tickMin:c.sub(new Qe(u).mul(s)),tickMax:c.add(new Qe(f).mul(s))})},xk=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",s=Math.max(i,2),[c,u]=zI([n,r]);if(c===-1/0||u===1/0){var f=u===1/0?[c,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),u];return n>r?f.reverse():f}if(c===u)return K7(c,i,a);var d=l==="snap125"?$I:T0,{step:p,tickMin:m,tickMax:g}=BI(c,u,s,a,0,d),y=LI(m,g.add(new Qe(.1).mul(p)),p);return n>r?y.reverse():y},bk=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[s,c]=zI([r,i]);if(s===-1/0||c===1/0)return[r,i];if(s===c)return[s];var u=l==="snap125"?$I:T0,f=Math.max(n,2),d=u(new Qe(c).sub(s).div(f-1),a,0),p=[...LI(new Qe(s),new Qe(c),d),c];return a===!1&&(p=p.map(m=>Math.round(m))),r>i?p.reverse():p},FI=e=>e.rootProps.maxBarSize,q7=e=>e.rootProps.barGap,UI=e=>e.rootProps.barCategoryGap,H7=e=>e.rootProps.barSize,Cu=e=>e.rootProps.stackOffset,WI=e=>e.rootProps.reverseStackOrder,O0=e=>e.options.chartName,A0=e=>e.rootProps.syncId,KI=e=>e.rootProps.syncMethod,I0=e=>e.options.eventEmitter,V7=e=>e.rootProps.baseValue,Gt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},io={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},si={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Ch=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Ph(e,t,n){if(n!=="auto")return n;if(e!=null)return ti(e,t)?"category":"number"}function wk(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 np(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wk(Object(n),!0).forEach(function(r){Y7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wk(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)}var jk={allowDataOverflow:io.allowDataOverflow,allowDecimals:io.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:io.angleAxisId,includeHidden:!1,name:void 0,reversed:io.reversed,scale:io.scale,tick:io.tick,tickCount:void 0,ticks:void 0,type:io.type,unit:void 0,niceTicks:"auto"},Sk={allowDataOverflow:si.allowDataOverflow,allowDecimals:si.allowDecimals,allowDuplicatedCategory:si.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:si.radiusAxisId,includeHidden:si.includeHidden,name:void 0,reversed:si.reversed,scale:si.scale,tick:si.tick,tickCount:si.tickCount,ticks:void 0,type:si.type,unit:void 0,niceTicks:"auto"},Q7=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},N0=q([Q7,rI],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ph(t,"angleAxis",jk.type))!==null&&n!==void 0?n:"category";return np(np({},jk),{},{type:r})}),J7=(e,t)=>e.polarAxis.radiusAxis[t],_0=q([J7,rI],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ph(t,"radiusAxis",Sk.type))!==null&&n!==void 0?n:"category";return np(np({},Sk),{},{type:r})}),Eh=e=>e.polarOptions,M0=q([ta,na,cn],wI),qI=q([Eh,M0],(e,t)=>{if(e!=null)return Rn(e.innerRadius,t,0)}),HI=q([Eh,M0],(e,t)=>{if(e!=null)return Rn(e.outerRadius,t,t*.8)}),Z7=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},VI=q([Eh],Z7);q([N0,VI],Ch);var YI=q([M0,qI,HI],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});q([_0,YI],Ch);var GI=q([Je,Eh,qI,HI,ta,na],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:s,startAngle:c,endAngle:u}=t;return{cx:Rn(l,i,i/2),cy:Rn(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),zt=(e,t)=>t,Pu=(e,t,n)=>n;function Th(e){return e==null?void 0:e.id}function XI(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,l=new Map;return e.forEach(s=>{var c,u=(c=s.data)!==null&&c!==void 0?c:r;if(!(u==null||u.length===0)){var f=Th(s);u.forEach((d,p)=>{var m=a==null||i?p:String(it(d,a,null)),g=it(d,s.dataKey,0),y;l.has(m)?y=l.get(m):y={},Object.assign(y,{[f]:g}),l.set(m,y)})}}),Array.from(l.values())}function Oh(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Ah=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Ih(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function eV(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 bn=e=>{var t=Je(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},ms=e=>e.tooltip.settings.axisId;function R0(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 l(){return a.apply(this,arguments)}return l.toString=function(){return a.toString()},l}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var l=i[0],s=i[1];return l<=s?a>=l&&a<=s:a>=s&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var s=e(a);if(s!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var c=e.bandwidth();switch(l.position){case"middle":s+=c/2;break;case"end":s+=c;break}}return s}}}}}var QI=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!bi(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Ue(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 Na(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function tV(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function D0(e){let t,n,r;e.length!==2?(t=Na,n=(s,c)=>Na(e(s),c),r=(s,c)=>e(s)-c):(t=e===Na||e===tV?e:nV,n=e,r=e);function i(s,c,u=0,f=s.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;n(s[d],c)<0?u=d+1:f=d}while(u<f)}return u}function a(s,c,u=0,f=s.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;n(s[d],c)<=0?u=d+1:f=d}while(u<f)}return u}function l(s,c,u=0,f=s.length){const d=i(s,c,u,f-1);return d>u&&r(s[d-1],c)>-r(s[d],c)?d-1:d}return{left:i,center:l,right:a}}function nV(){return 0}function JI(e){return e===null?NaN:+e}function*rV(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const iV=D0(Na),Eu=iV.right;D0(JI).center;class kk extends Map{constructor(t,n=lV){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(Ck(this,t))}has(t){return super.has(Ck(this,t))}set(t,n){return super.set(aV(this,t),n)}delete(t){return super.delete(oV(this,t))}}function Ck({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function aV({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function oV({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function lV(e){return e!==null&&typeof e=="object"?e.valueOf():e}function sV(e=Na){if(e===Na)return ZI;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 ZI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const cV=Math.sqrt(50),uV=Math.sqrt(10),dV=Math.sqrt(2);function rp(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=cV?10:a>=uV?5:a>=dV?2:1;let s,c,u;return i<0?(u=Math.pow(10,-i)/l,s=Math.round(e*u),c=Math.round(t*u),s/u<e&&++s,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*l,s=Math.round(e/u),c=Math.round(t/u),s*u<e&&++s,c*u>t&&--c),c<s&&.5<=n&&n<2?rp(e,t,n*2):[s,c,u]}function fy(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,l]=r?rp(t,e,n):rp(e,t,n);if(!(a>=i))return[];const s=a-i+1,c=new Array(s);if(r)if(l<0)for(let u=0;u<s;++u)c[u]=(a-u)/-l;else for(let u=0;u<s;++u)c[u]=(a-u)*l;else if(l<0)for(let u=0;u<s;++u)c[u]=(i+u)/-l;else for(let u=0;u<s;++u)c[u]=(i+u)*l;return c}function py(e,t,n){return t=+t,e=+e,n=+n,rp(e,t,n)[2]}function hy(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?py(t,e,n):py(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Pk(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Ek(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function eN(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?ZI:sV(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),m=Math.max(n,Math.floor(t-u*d/c+p)),g=Math.min(r,Math.floor(t+(c-u)*d/c+p));eN(e,t,m,g,i)}const a=e[t];let l=n,s=r;for($s(e,n,t),i(e[r],a)>0&&$s(e,n,r);l<s;){for($s(e,l,s),++l,--s;i(e[l],a)<0;)++l;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?$s(e,n,s):(++s,$s(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function $s(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function fV(e,t,n){if(e=Float64Array.from(rV(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Ek(e);if(t>=1)return Pk(e);var r,i=(r-1)*t,a=Math.floor(i),l=Pk(eN(e,a).subarray(0,a+1)),s=Ek(e.subarray(a+1));return l+(s-l)*(i-a)}}function pV(e,t,n=JI){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),l=+n(e[a],a,e),s=+n(e[a+1],a+1,e);return l+(s-l)*(i-a)}}function hV(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 $r(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ra(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 my=Symbol("implicit");function L0(){var e=new kk,t=[],n=[],r=my;function i(a){let l=e.get(a);if(l===void 0){if(r!==my)return r;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new kk;for(const l of a)e.has(l)||e.set(l,t.push(l)-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 L0(t,n).unknown(r)},$r.apply(i,arguments),i}function z0(){var e=L0().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,s=!1,c=0,u=0,f=.5;delete e.unknown;function d(){var p=t().length,m=i<r,g=m?i:r,y=m?r:i;a=(y-g)/Math.max(1,p-c+u*2),s&&(a=Math.floor(a)),g+=(y-g-a*(p-c))*f,l=a*(1-c),s&&(g=Math.round(g),l=Math.round(l));var x=hV(p).map(function(v){return g+a*v});return n(m?x.reverse():x)}return e.domain=function(p){return arguments.length?(t(p),d()):t()},e.range=function(p){return arguments.length?([r,i]=p,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(p){return[r,i]=p,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(p){return arguments.length?(s=!!p,d()):s},e.padding=function(p){return arguments.length?(c=Math.min(1,u=+p),d()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),d()):c},e.paddingOuter=function(p){return arguments.length?(u=+p,d()):u},e.align=function(p){return arguments.length?(f=Math.max(0,Math.min(1,p)),d()):f},e.copy=function(){return z0(t(),[r,i]).round(s).paddingInner(c).paddingOuter(u).align(f)},$r.apply(d(),arguments)}function tN(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return tN(t())},e}function mV(){return tN(z0.apply(null,arguments).paddingInner(1))}function $0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Tu(){}var Xc=.7,ip=1/Xc,zl="\\s*([+-]?\\d+)\\s*",Qc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gV=/^#([0-9a-f]{3,8})$/,vV=new RegExp(`^rgb\\(${zl},${zl},${zl}\\)$`),yV=new RegExp(`^rgb\\(${wi},${wi},${wi}\\)$`),xV=new RegExp(`^rgba\\(${zl},${zl},${zl},${Qc}\\)$`),bV=new RegExp(`^rgba\\(${wi},${wi},${wi},${Qc}\\)$`),wV=new RegExp(`^hsl\\(${Qc},${wi},${wi}\\)$`),jV=new RegExp(`^hsla\\(${Qc},${wi},${wi},${Qc}\\)$`),Tk={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};$0(Tu,Jc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ok,formatHex:Ok,formatHex8:SV,formatHsl:kV,formatRgb:Ak,toString:Ak});function Ok(){return this.rgb().formatHex()}function SV(){return this.rgb().formatHex8()}function kV(){return rN(this).formatHsl()}function Ak(){return this.rgb().formatRgb()}function Jc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gV.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ik(t):n===3?new nr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?kd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?kd(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=vV.exec(e))?new nr(t[1],t[2],t[3],1):(t=yV.exec(e))?new nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xV.exec(e))?kd(t[1],t[2],t[3],t[4]):(t=bV.exec(e))?kd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=wV.exec(e))?Mk(t[1],t[2]/100,t[3]/100,1):(t=jV.exec(e))?Mk(t[1],t[2]/100,t[3]/100,t[4]):Tk.hasOwnProperty(e)?Ik(Tk[e]):e==="transparent"?new nr(NaN,NaN,NaN,0):null}function Ik(e){return new nr(e>>16&255,e>>8&255,e&255,1)}function kd(e,t,n,r){return r<=0&&(e=t=n=NaN),new nr(e,t,n,r)}function CV(e){return e instanceof Tu||(e=Jc(e)),e?(e=e.rgb(),new nr(e.r,e.g,e.b,e.opacity)):new nr}function gy(e,t,n,r){return arguments.length===1?CV(e):new nr(e,t,n,r??1)}function nr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}$0(nr,gy,nN(Tu,{brighter(e){return e=e==null?ip:Math.pow(ip,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xc:Math.pow(Xc,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nr(Oo(this.r),Oo(this.g),Oo(this.b),ap(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:Nk,formatHex:Nk,formatHex8:PV,formatRgb:_k,toString:_k}));function Nk(){return`#${wo(this.r)}${wo(this.g)}${wo(this.b)}`}function PV(){return`#${wo(this.r)}${wo(this.g)}${wo(this.b)}${wo((isNaN(this.opacity)?1:this.opacity)*255)}`}function _k(){const e=ap(this.opacity);return`${e===1?"rgb(":"rgba("}${Oo(this.r)}, ${Oo(this.g)}, ${Oo(this.b)}${e===1?")":`, ${e})`}`}function ap(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Oo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wo(e){return e=Oo(e),(e<16?"0":"")+e.toString(16)}function Mk(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Yr(e,t,n,r)}function rN(e){if(e instanceof Yr)return new Yr(e.h,e.s,e.l,e.opacity);if(e instanceof Tu||(e=Jc(e)),!e)return new Yr;if(e instanceof Yr)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),l=NaN,s=a-i,c=(a+i)/2;return s?(t===a?l=(n-r)/s+(n<r)*6:n===a?l=(r-t)/s+2:l=(t-n)/s+4,s/=c<.5?a+i:2-a-i,l*=60):s=c>0&&c<1?0:l,new Yr(l,s,c,e.opacity)}function EV(e,t,n,r){return arguments.length===1?rN(e):new Yr(e,t,n,r??1)}function Yr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}$0(Yr,EV,nN(Tu,{brighter(e){return e=e==null?ip:Math.pow(ip,e),new Yr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xc:Math.pow(Xc,e),new Yr(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 nr(cg(e>=240?e-240:e+120,i,r),cg(e,i,r),cg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Yr(Rk(this.h),Cd(this.s),Cd(this.l),ap(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=ap(this.opacity);return`${e===1?"hsl(":"hsla("}${Rk(this.h)}, ${Cd(this.s)*100}%, ${Cd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Rk(e){return e=(e||0)%360,e<0?e+360:e}function Cd(e){return Math.max(0,Math.min(1,e||0))}function cg(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 B0=e=>()=>e;function TV(e,t){return function(n){return e+n*t}}function OV(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 AV(e){return(e=+e)==1?iN:function(t,n){return n-t?OV(t,n,e):B0(isNaN(t)?n:t)}}function iN(e,t){var n=t-e;return n?TV(e,n):B0(isNaN(e)?t:e)}const Dk=function e(t){var n=AV(t);function r(i,a){var l=n((i=gy(i)).r,(a=gy(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),u=iN(i.opacity,a.opacity);return function(f){return i.r=l(f),i.g=s(f),i.b=c(f),i.opacity=u(f),i+""}}return r.gamma=e,r}(1);function IV(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 NV(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _V(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=gs(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(s){for(l=0;l<r;++l)a[l]=i[l](s);return a}}function MV(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function op(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function RV(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]=gs(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var vy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ug=new RegExp(vy.source,"g");function DV(e){return function(){return e}}function LV(e){return function(t){return e(t)+""}}function zV(e,t){var n=vy.lastIndex=ug.lastIndex=0,r,i,a,l=-1,s=[],c=[];for(e=e+"",t=t+"";(r=vy.exec(e))&&(i=ug.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[l]?s[l]+=a:s[++l]=a),(r=r[0])===(i=i[0])?s[l]?s[l]+=i:s[++l]=i:(s[++l]=null,c.push({i:l,x:op(r,i)})),n=ug.lastIndex;return n<t.length&&(a=t.slice(n),s[l]?s[l]+=a:s[++l]=a),s.length<2?c[0]?LV(c[0].x):DV(t):(t=c.length,function(u){for(var f=0,d;f<t;++f)s[(d=c[f]).i]=d.x(u);return s.join("")})}function gs(e,t){var n=typeof t,r;return t==null||n==="boolean"?B0(t):(n==="number"?op:n==="string"?(r=Jc(t))?(t=r,Dk):zV:t instanceof Jc?Dk:t instanceof Date?MV:NV(t)?IV:Array.isArray(t)?_V:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?RV:op)(e,t)}function F0(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function $V(e,t){t===void 0&&(t=e,e=gs);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(l){var s=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[s](l-s)}}function BV(e){return function(){return e}}function lp(e){return+e}var Lk=[0,1];function Wn(e){return e}function yy(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:BV(isNaN(t)?NaN:.5)}function FV(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function UV(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=yy(i,r),a=n(l,a)):(r=yy(r,i),a=n(a,l)),function(s){return a(r(s))}}function WV(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=yy(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(s){var c=Eu(e,s,1,r)-1;return a[c](i[c](s))}}function Ou(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Nh(){var e=Lk,t=Lk,n=gs,r,i,a,l=Wn,s,c,u;function f(){var p=Math.min(e.length,t.length);return l!==Wn&&(l=FV(e[0],e[p-1])),s=p>2?WV:UV,c=u=null,d}function d(p){return p==null||isNaN(p=+p)?a:(c||(c=s(e.map(r),t,n)))(r(l(p)))}return d.invert=function(p){return l(i((u||(u=s(t,e.map(r),op)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,lp),f()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),n=F0,f()},d.clamp=function(p){return arguments.length?(l=p?!0:Wn,f()):l!==Wn},d.interpolate=function(p){return arguments.length?(n=p,f()):n},d.unknown=function(p){return arguments.length?(a=p,d):a},function(p,m){return r=p,i=m,f()}}function U0(){return Nh()(Wn,Wn)}function KV(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function sp(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 Zl(e){return e=sp(Math.abs(e)),e?e[1]:NaN}function qV(e,t){return function(n,r){for(var i=n.length,a=[],l=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[l=(l+1)%e.length];return a.reverse().join(t)}}function HV(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var VV=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zc(e){if(!(t=VV.exec(e)))throw new Error("invalid format: "+e);var t;return new W0({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]})}Zc.prototype=W0.prototype;function W0(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+""}W0.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 YV(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 cp;function GV(e,t){var n=sp(e,t);if(!n)return cp=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(cp=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+sp(e,Math.max(0,t+a-1))[0]}function zk(e,t){var n=sp(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 $k={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:KV,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)=>zk(e*100,t),r:zk,s:GV,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Bk(e){return e}var Fk=Array.prototype.map,Uk=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XV(e){var t=e.grouping===void 0||e.thousands===void 0?Bk:qV(Fk.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?Bk:HV(Fk.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,p){d=Zc(d);var m=d.fill,g=d.align,y=d.sign,x=d.symbol,v=d.zero,b=d.width,w=d.comma,j=d.precision,C=d.trim,S=d.type;S==="n"?(w=!0,S="g"):$k[S]||(j===void 0&&(j=12),C=!0,S="g"),(v||m==="0"&&g==="=")&&(v=!0,m="0",g="=");var E=(p&&p.prefix!==void 0?p.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),I=(x==="$"?r:/[%p]/.test(S)?l:"")+(p&&p.suffix!==void 0?p.suffix:""),R=$k[S],A=/[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 _(N){var Y=E,K=I,O,F,W;if(S==="c")K=R(N)+K,N="";else{N=+N;var M=N<0||1/N<0;if(N=isNaN(N)?c:R(Math.abs(N),j),C&&(N=YV(N)),M&&+N==0&&y!=="+"&&(M=!1),Y=(M?y==="("?y:s:y==="-"||y==="("?"":y)+Y,K=(S==="s"&&!isNaN(N)&&cp!==void 0?Uk[8+cp/3]:"")+K+(M&&y==="("?")":""),A){for(O=-1,F=N.length;++O<F;)if(W=N.charCodeAt(O),48>W||W>57){K=(W===46?i+N.slice(O+1):N.slice(O))+K,N=N.slice(0,O);break}}}w&&!v&&(N=t(N,1/0));var B=Y.length+N.length+K.length,k=B<b?new Array(b-B+1).join(m):"";switch(w&&v&&(N=t(k+N,k.length?b-K.length:1/0),k=""),g){case"<":N=Y+N+K+k;break;case"=":N=Y+k+N+K;break;case"^":N=k.slice(0,B=k.length>>1)+Y+N+K+k.slice(B);break;default:N=k+Y+N+K;break}return a(N)}return _.toString=function(){return d+""},_}function f(d,p){var m=Math.max(-8,Math.min(8,Math.floor(Zl(p)/3)))*3,g=Math.pow(10,-m),y=u((d=Zc(d),d.type="f",d),{suffix:Uk[8+m/3]});return function(x){return y(g*x)}}return{format:u,formatPrefix:f}}var Pd,K0,aN;QV({thousands:",",grouping:[3],currency:["$",""]});function QV(e){return Pd=XV(e),K0=Pd.format,aN=Pd.formatPrefix,Pd}function JV(e){return Math.max(0,-Zl(Math.abs(e)))}function ZV(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zl(t)/3)))*3-Zl(Math.abs(e)))}function eY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Zl(t)-Zl(e))+1}function oN(e,t,n,r){var i=hy(e,t,n),a;switch(r=Zc(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=ZV(i,l))&&(r.precision=a),aN(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=eY(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=JV(i))&&(r.precision=a-(r.type==="%")*2);break}}return K0(r)}function Ya(e){var t=e.domain;return e.ticks=function(n){var r=t();return fy(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return oN(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,l=r[i],s=r[a],c,u,f=10;for(s<l&&(u=l,l=s,s=u,u=i,i=a,a=u);f-- >0;){if(u=py(l,s,n),u===c)return r[i]=l,r[a]=s,t(r);if(u>0)l=Math.floor(l/u)*u,s=Math.ceil(s/u)*u;else if(u<0)l=Math.ceil(l*u)/u,s=Math.floor(s*u)/u;else break;c=u}return e},e}function lN(){var e=U0();return e.copy=function(){return Ou(e,lN())},$r.apply(e,arguments),Ya(e)}function sN(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,lp),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return sN(e).unknown(t)},e=arguments.length?Array.from(e,lp):[0,1],Ya(n)}function cN(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],l;return a<i&&(l=n,n=r,r=l,l=i,i=a,a=l),e[n]=t.floor(i),e[r]=t.ceil(a),e}function Wk(e){return Math.log(e)}function Kk(e){return Math.exp(e)}function tY(e){return-Math.log(-e)}function nY(e){return-Math.exp(-e)}function rY(e){return isFinite(e)?+("1e"+e):e<0?0:e}function iY(e){return e===10?rY:e===Math.E?Math.exp:t=>Math.pow(e,t)}function aY(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 qk(e){return(t,n)=>-e(-t,n)}function q0(e){const t=e(Wk,Kk),n=t.domain;let r=10,i,a;function l(){return i=aY(r),a=iY(r),n()[0]<0?(i=qk(i),a=qk(a),e(tY,nY)):e(Wk,Kk),t}return t.base=function(s){return arguments.length?(r=+s,l()):r},t.domain=function(s){return arguments.length?(n(s),l()):n()},t.ticks=s=>{const c=n();let u=c[0],f=c[c.length-1];const d=f<u;d&&([u,f]=[f,u]);let p=i(u),m=i(f),g,y;const x=s==null?10:+s;let v=[];if(!(r%1)&&m-p<x){if(p=Math.floor(p),m=Math.ceil(m),u>0){for(;p<=m;++p)for(g=1;g<r;++g)if(y=p<0?g/a(-p):g*a(p),!(y<u)){if(y>f)break;v.push(y)}}else for(;p<=m;++p)for(g=r-1;g>=1;--g)if(y=p>0?g/a(-p):g*a(p),!(y<u)){if(y>f)break;v.push(y)}v.length*2<x&&(v=fy(u,f,x))}else v=fy(p,m,Math.min(m-p,x)).map(a);return d?v.reverse():v},t.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Zc(c)).precision==null&&(c.trim=!0),c=K0(c)),s===1/0)return c;const u=Math.max(1,r*s/t.ticks().length);return f=>{let d=f/a(Math.round(i(f)));return d*r<r-.5&&(d*=r),d<=u?c(f):""}},t.nice=()=>n(cN(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function uN(){const e=q0(Nh()).domain([1,10]);return e.copy=()=>Ou(e,uN()).base(e.base()),$r.apply(e,arguments),e}function Hk(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Vk(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function H0(e){var t=1,n=e(Hk(t),Vk(t));return n.constant=function(r){return arguments.length?e(Hk(t=+r),Vk(t)):t},Ya(n)}function dN(){var e=H0(Nh());return e.copy=function(){return Ou(e,dN()).constant(e.constant())},$r.apply(e,arguments)}function Yk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function lY(e){return e<0?-e*e:e*e}function V0(e){var t=e(Wn,Wn),n=1;function r(){return n===1?e(Wn,Wn):n===.5?e(oY,lY):e(Yk(n),Yk(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Ya(t)}function Y0(){var e=V0(Nh());return e.copy=function(){return Ou(e,Y0()).exponent(e.exponent())},$r.apply(e,arguments),e}function sY(){return Y0.apply(null,arguments).exponent(.5)}function Gk(e){return Math.sign(e)*e*e}function cY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function fN(){var e=U0(),t=[0,1],n=!1,r;function i(a){var l=cY(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(Gk(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,lp)).map(Gk)),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 fN(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},$r.apply(i,arguments),Ya(i)}function pN(){var e=[],t=[],n=[],r;function i(){var l=0,s=Math.max(1,t.length);for(n=new Array(s-1);++l<s;)n[l-1]=pV(e,l/s);return a}function a(l){return l==null||isNaN(l=+l)?r:t[Eu(n,l)]}return a.invertExtent=function(l){var s=t.indexOf(l);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let s of l)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Na),i()},a.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},a.unknown=function(l){return arguments.length?(r=l,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return pN().domain(e).range(t).unknown(r)},$r.apply(a,arguments)}function hN(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(c){return c!=null&&c<=c?i[Eu(r,c,0,n)]:a}function s(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return l}return l.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,s()):[e,t]},l.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,s()):i.slice()},l.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]]},l.unknown=function(c){return arguments.length&&(a=c),l},l.thresholds=function(){return r.slice()},l.copy=function(){return hN().domain([e,t]).range(i).unknown(a)},$r.apply(Ya(l),arguments)}function mN(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Eu(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 l=t.indexOf(a);return[e[l-1],e[l]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return mN().domain(e).range(t).unknown(n)},$r.apply(i,arguments)}const dg=new Date,fg=new Date;function un(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 l=i(a),s=i.ceil(a);return a-l<s-a?l:s},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,s)=>{const c=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<l)||!(s>0))return c;let u;do c.push(u=new Date(+a)),t(a,s),e(a);while(u<a&&a<l);return c},i.filter=a=>un(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,s)=>{if(l>=l)if(s<0)for(;++s<=0;)for(;t(l,-1),!a(l););else for(;--s>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(dg.setTime(+a),fg.setTime(+l),e(dg),e(fg),Math.floor(n(dg,fg))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?l=>r(l)%a===0:l=>i.count(0,l)%a===0):i)),i}const up=un(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);up.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?un(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):up);up.range;const $i=1e3,_r=$i*60,Bi=_r*60,Gi=Bi*24,G0=Gi*7,Xk=Gi*30,pg=Gi*365,jo=un(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*$i)},(e,t)=>(t-e)/$i,e=>e.getUTCSeconds());jo.range;const X0=un(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$i)},(e,t)=>{e.setTime(+e+t*_r)},(e,t)=>(t-e)/_r,e=>e.getMinutes());X0.range;const Q0=un(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*_r)},(e,t)=>(t-e)/_r,e=>e.getUTCMinutes());Q0.range;const J0=un(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$i-e.getMinutes()*_r)},(e,t)=>{e.setTime(+e+t*Bi)},(e,t)=>(t-e)/Bi,e=>e.getHours());J0.range;const Z0=un(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Bi)},(e,t)=>(t-e)/Bi,e=>e.getUTCHours());Z0.range;const Au=un(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*_r)/Gi,e=>e.getDate()-1);Au.range;const _h=un(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Gi,e=>e.getUTCDate()-1);_h.range;const gN=un(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Gi,e=>Math.floor(e/Gi));gN.range;function Qo(e){return un(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())*_r)/G0)}const Mh=Qo(0),dp=Qo(1),uY=Qo(2),dY=Qo(3),es=Qo(4),fY=Qo(5),pY=Qo(6);Mh.range;dp.range;uY.range;dY.range;es.range;fY.range;pY.range;function Jo(e){return un(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)/G0)}const Rh=Jo(0),fp=Jo(1),hY=Jo(2),mY=Jo(3),ts=Jo(4),gY=Jo(5),vY=Jo(6);Rh.range;fp.range;hY.range;mY.range;ts.range;gY.range;vY.range;const eb=un(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());eb.range;const tb=un(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());tb.range;const Xi=un(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());Xi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:un(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)});Xi.range;const Qi=un(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());Qi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:un(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)});Qi.range;function vN(e,t,n,r,i,a){const l=[[jo,1,$i],[jo,5,5*$i],[jo,15,15*$i],[jo,30,30*$i],[a,1,_r],[a,5,5*_r],[a,15,15*_r],[a,30,30*_r],[i,1,Bi],[i,3,3*Bi],[i,6,6*Bi],[i,12,12*Bi],[r,1,Gi],[r,2,2*Gi],[n,1,G0],[t,1,Xk],[t,3,3*Xk],[e,1,pg]];function s(u,f,d){const p=f<u;p&&([u,f]=[f,u]);const m=d&&typeof d.range=="function"?d:c(u,f,d),g=m?m.range(u,+f+1):[];return p?g.reverse():g}function c(u,f,d){const p=Math.abs(f-u)/d,m=D0(([,,x])=>x).right(l,p);if(m===l.length)return e.every(hy(u/pg,f/pg,d));if(m===0)return up.every(Math.max(hy(u,f,d),1));const[g,y]=l[p/l[m-1][2]<l[m][2]/p?m-1:m];return g.every(y)}return[s,c]}const[yY,xY]=vN(Qi,tb,Rh,gN,Z0,Q0),[bY,wY]=vN(Xi,eb,Mh,Au,J0,X0);function hg(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 mg(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 Bs(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function jY(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,s=e.months,c=e.shortMonths,u=Fs(i),f=Us(i),d=Fs(a),p=Us(a),m=Fs(l),g=Us(l),y=Fs(s),x=Us(s),v=Fs(c),b=Us(c),w={a:W,A:M,b:B,B:k,c:null,d:nC,e:nC,f:qY,g:tG,G:rG,H:UY,I:WY,j:KY,L:yN,m:HY,M:VY,p:L,q:X,Q:aC,s:oC,S:YY,u:GY,U:XY,V:QY,w:JY,W:ZY,x:null,X:null,y:eG,Y:nG,Z:iG,"%":iC},j={a:T,A:ce,b:ge,B:Q,c:null,d:rC,e:rC,f:sG,g:yG,G:bG,H:aG,I:oG,j:lG,L:bN,m:cG,M:uG,p:ae,q:fe,Q:aC,s:oC,S:dG,u:fG,U:pG,V:hG,w:mG,W:gG,x:null,X:null,y:vG,Y:xG,Z:wG,"%":iC},C={a:A,A:_,b:N,B:Y,c:K,d:eC,e:eC,f:zY,g:Zk,G:Jk,H:tC,I:tC,j:MY,L:LY,m:_Y,M:RY,p:R,q:NY,Q:BY,s:FY,S:DY,u:EY,U:TY,V:OY,w:PY,W:AY,x:O,X:F,y:Zk,Y:Jk,Z:IY,"%":$Y};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(te,ee){return function(le){var ne=[],Ae=-1,be=0,Re=te.length,$e,xe,Ie;for(le instanceof Date||(le=new Date(+le));++Ae<Re;)te.charCodeAt(Ae)===37&&(ne.push(te.slice(be,Ae)),(xe=Qk[$e=te.charAt(++Ae)])!=null?$e=te.charAt(++Ae):xe=$e==="e"?" ":"0",(Ie=ee[$e])&&($e=Ie(le,xe)),ne.push($e),be=Ae+1);return ne.push(te.slice(be,Ae)),ne.join("")}}function E(te,ee){return function(le){var ne=Bs(1900,void 0,1),Ae=I(ne,te,le+="",0),be,Re;if(Ae!=le.length)return null;if("Q"in ne)return new Date(ne.Q);if("s"in ne)return new Date(ne.s*1e3+("L"in ne?ne.L:0));if(ee&&!("Z"in ne)&&(ne.Z=0),"p"in ne&&(ne.H=ne.H%12+ne.p*12),ne.m===void 0&&(ne.m="q"in ne?ne.q:0),"V"in ne){if(ne.V<1||ne.V>53)return null;"w"in ne||(ne.w=1),"Z"in ne?(be=mg(Bs(ne.y,0,1)),Re=be.getUTCDay(),be=Re>4||Re===0?fp.ceil(be):fp(be),be=_h.offset(be,(ne.V-1)*7),ne.y=be.getUTCFullYear(),ne.m=be.getUTCMonth(),ne.d=be.getUTCDate()+(ne.w+6)%7):(be=hg(Bs(ne.y,0,1)),Re=be.getDay(),be=Re>4||Re===0?dp.ceil(be):dp(be),be=Au.offset(be,(ne.V-1)*7),ne.y=be.getFullYear(),ne.m=be.getMonth(),ne.d=be.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),Re="Z"in ne?mg(Bs(ne.y,0,1)).getUTCDay():hg(Bs(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(Re+5)%7:ne.w+ne.U*7-(Re+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,mg(ne)):hg(ne)}}function I(te,ee,le,ne){for(var Ae=0,be=ee.length,Re=le.length,$e,xe;Ae<be;){if(ne>=Re)return-1;if($e=ee.charCodeAt(Ae++),$e===37){if($e=ee.charAt(Ae++),xe=C[$e in Qk?ee.charAt(Ae++):$e],!xe||(ne=xe(te,le,ne))<0)return-1}else if($e!=le.charCodeAt(ne++))return-1}return ne}function R(te,ee,le){var ne=u.exec(ee.slice(le));return ne?(te.p=f.get(ne[0].toLowerCase()),le+ne[0].length):-1}function A(te,ee,le){var ne=m.exec(ee.slice(le));return ne?(te.w=g.get(ne[0].toLowerCase()),le+ne[0].length):-1}function _(te,ee,le){var ne=d.exec(ee.slice(le));return ne?(te.w=p.get(ne[0].toLowerCase()),le+ne[0].length):-1}function N(te,ee,le){var ne=v.exec(ee.slice(le));return ne?(te.m=b.get(ne[0].toLowerCase()),le+ne[0].length):-1}function Y(te,ee,le){var ne=y.exec(ee.slice(le));return ne?(te.m=x.get(ne[0].toLowerCase()),le+ne[0].length):-1}function K(te,ee,le){return I(te,t,ee,le)}function O(te,ee,le){return I(te,n,ee,le)}function F(te,ee,le){return I(te,r,ee,le)}function W(te){return l[te.getDay()]}function M(te){return a[te.getDay()]}function B(te){return c[te.getMonth()]}function k(te){return s[te.getMonth()]}function L(te){return i[+(te.getHours()>=12)]}function X(te){return 1+~~(te.getMonth()/3)}function T(te){return l[te.getUTCDay()]}function ce(te){return a[te.getUTCDay()]}function ge(te){return c[te.getUTCMonth()]}function Q(te){return s[te.getUTCMonth()]}function ae(te){return i[+(te.getUTCHours()>=12)]}function fe(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var ee=S(te+="",w);return ee.toString=function(){return te},ee},parse:function(te){var ee=E(te+="",!1);return ee.toString=function(){return te},ee},utcFormat:function(te){var ee=S(te+="",j);return ee.toString=function(){return te},ee},utcParse:function(te){var ee=E(te+="",!0);return ee.toString=function(){return te},ee}}}var Qk={"-":"",_:" ",0:"0"},wn=/^\s*\d+/,SY=/^%/,kY=/[\\^$*+?|[\]().{}]/g;function at(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 CY(e){return e.replace(kY,"\\$&")}function Fs(e){return new RegExp("^(?:"+e.map(CY).join("|")+")","i")}function Us(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function PY(e,t,n){var r=wn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function EY(e,t,n){var r=wn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function TY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function OY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function AY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Jk(e,t,n){var r=wn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Zk(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function IY(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 NY(e,t,n){var r=wn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function _Y(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function eC(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function MY(e,t,n){var r=wn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function tC(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function RY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function DY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function LY(e,t,n){var r=wn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function zY(e,t,n){var r=wn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function $Y(e,t,n){var r=SY.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function BY(e,t,n){var r=wn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function FY(e,t,n){var r=wn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function nC(e,t){return at(e.getDate(),t,2)}function UY(e,t){return at(e.getHours(),t,2)}function WY(e,t){return at(e.getHours()%12||12,t,2)}function KY(e,t){return at(1+Au.count(Xi(e),e),t,3)}function yN(e,t){return at(e.getMilliseconds(),t,3)}function qY(e,t){return yN(e,t)+"000"}function HY(e,t){return at(e.getMonth()+1,t,2)}function VY(e,t){return at(e.getMinutes(),t,2)}function YY(e,t){return at(e.getSeconds(),t,2)}function GY(e){var t=e.getDay();return t===0?7:t}function XY(e,t){return at(Mh.count(Xi(e)-1,e),t,2)}function xN(e){var t=e.getDay();return t>=4||t===0?es(e):es.ceil(e)}function QY(e,t){return e=xN(e),at(es.count(Xi(e),e)+(Xi(e).getDay()===4),t,2)}function JY(e){return e.getDay()}function ZY(e,t){return at(dp.count(Xi(e)-1,e),t,2)}function eG(e,t){return at(e.getFullYear()%100,t,2)}function tG(e,t){return e=xN(e),at(e.getFullYear()%100,t,2)}function nG(e,t){return at(e.getFullYear()%1e4,t,4)}function rG(e,t){var n=e.getDay();return e=n>=4||n===0?es(e):es.ceil(e),at(e.getFullYear()%1e4,t,4)}function iG(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+at(t/60|0,"0",2)+at(t%60,"0",2)}function rC(e,t){return at(e.getUTCDate(),t,2)}function aG(e,t){return at(e.getUTCHours(),t,2)}function oG(e,t){return at(e.getUTCHours()%12||12,t,2)}function lG(e,t){return at(1+_h.count(Qi(e),e),t,3)}function bN(e,t){return at(e.getUTCMilliseconds(),t,3)}function sG(e,t){return bN(e,t)+"000"}function cG(e,t){return at(e.getUTCMonth()+1,t,2)}function uG(e,t){return at(e.getUTCMinutes(),t,2)}function dG(e,t){return at(e.getUTCSeconds(),t,2)}function fG(e){var t=e.getUTCDay();return t===0?7:t}function pG(e,t){return at(Rh.count(Qi(e)-1,e),t,2)}function wN(e){var t=e.getUTCDay();return t>=4||t===0?ts(e):ts.ceil(e)}function hG(e,t){return e=wN(e),at(ts.count(Qi(e),e)+(Qi(e).getUTCDay()===4),t,2)}function mG(e){return e.getUTCDay()}function gG(e,t){return at(fp.count(Qi(e)-1,e),t,2)}function vG(e,t){return at(e.getUTCFullYear()%100,t,2)}function yG(e,t){return e=wN(e),at(e.getUTCFullYear()%100,t,2)}function xG(e,t){return at(e.getUTCFullYear()%1e4,t,4)}function bG(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ts(e):ts.ceil(e),at(e.getUTCFullYear()%1e4,t,4)}function wG(){return"+0000"}function iC(){return"%"}function aC(e){return+e}function oC(e){return Math.floor(+e/1e3)}var sl,jN,SN;jG({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 jG(e){return sl=jY(e),jN=sl.format,sl.parse,SN=sl.utcFormat,sl.utcParse,sl}function SG(e){return new Date(e)}function kG(e){return e instanceof Date?+e:+new Date(+e)}function nb(e,t,n,r,i,a,l,s,c,u){var f=U0(),d=f.invert,p=f.domain,m=u(".%L"),g=u(":%S"),y=u("%I:%M"),x=u("%I %p"),v=u("%a %d"),b=u("%b %d"),w=u("%B"),j=u("%Y");function C(S){return(c(S)<S?m:s(S)<S?g:l(S)<S?y:a(S)<S?x:r(S)<S?i(S)<S?v:b:n(S)<S?w:j)(S)}return f.invert=function(S){return new Date(d(S))},f.domain=function(S){return arguments.length?p(Array.from(S,kG)):p().map(SG)},f.ticks=function(S){var E=p();return e(E[0],E[E.length-1],S??10)},f.tickFormat=function(S,E){return E==null?C:u(E)},f.nice=function(S){var E=p();return(!S||typeof S.range!="function")&&(S=t(E[0],E[E.length-1],S??10)),S?p(cN(E,S)):f},f.copy=function(){return Ou(f,nb(e,t,n,r,i,a,l,s,c,u))},f}function CG(){return $r.apply(nb(bY,wY,Xi,eb,Mh,Au,J0,X0,jo,jN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function PG(){return $r.apply(nb(yY,xY,Qi,tb,Rh,_h,Z0,Q0,jo,SN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Dh(){var e=0,t=1,n,r,i,a,l=Wn,s=!1,c;function u(d){return d==null||isNaN(d=+d)?c:l(i===0?.5:(d=(a(d)-n)*i,s?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?(s=!!d,u):s},u.interpolator=function(d){return arguments.length?(l=d,u):l};function f(d){return function(p){var m,g;return arguments.length?([m,g]=p,l=d(m,g),u):[l(0),l(1)]}}return u.range=f(gs),u.rangeRound=f(F0),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 Ga(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function kN(){var e=Ya(Dh()(Wn));return e.copy=function(){return Ga(e,kN())},ra.apply(e,arguments)}function CN(){var e=q0(Dh()).domain([1,10]);return e.copy=function(){return Ga(e,CN()).base(e.base())},ra.apply(e,arguments)}function PN(){var e=H0(Dh());return e.copy=function(){return Ga(e,PN()).constant(e.constant())},ra.apply(e,arguments)}function rb(){var e=V0(Dh());return e.copy=function(){return Ga(e,rb()).exponent(e.exponent())},ra.apply(e,arguments)}function EG(){return rb.apply(null,arguments).exponent(.5)}function EN(){var e=[],t=Wn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Eu(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(Na),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)=>fV(e,a/r))},n.copy=function(){return EN(t).domain(e)},ra.apply(n,arguments)}function Lh(){var e=0,t=.5,n=1,r=1,i,a,l,s,c,u=Wn,f,d=!1,p;function m(y){return isNaN(y=+y)?p:(y=.5+((y=+f(y))-a)*(r*y<r*a?s:c),u(d?Math.max(0,Math.min(1,y)):y))}m.domain=function(y){return arguments.length?([e,t,n]=y,i=f(e=+e),a=f(t=+t),l=f(n=+n),s=i===a?0:.5/(a-i),c=a===l?0:.5/(l-a),r=a<i?-1:1,m):[e,t,n]},m.clamp=function(y){return arguments.length?(d=!!y,m):d},m.interpolator=function(y){return arguments.length?(u=y,m):u};function g(y){return function(x){var v,b,w;return arguments.length?([v,b,w]=x,u=$V(y,[v,b,w]),m):[u(0),u(.5),u(1)]}}return m.range=g(gs),m.rangeRound=g(F0),m.unknown=function(y){return arguments.length?(p=y,m):p},function(y){return f=y,i=y(e),a=y(t),l=y(n),s=i===a?0:.5/(a-i),c=a===l?0:.5/(l-a),r=a<i?-1:1,m}}function TN(){var e=Ya(Lh()(Wn));return e.copy=function(){return Ga(e,TN())},ra.apply(e,arguments)}function ON(){var e=q0(Lh()).domain([.1,1,10]);return e.copy=function(){return Ga(e,ON()).base(e.base())},ra.apply(e,arguments)}function AN(){var e=H0(Lh());return e.copy=function(){return Ga(e,AN()).constant(e.constant())},ra.apply(e,arguments)}function ib(){var e=V0(Lh());return e.copy=function(){return Ga(e,ib()).exponent(e.exponent())},ra.apply(e,arguments)}function TG(){return ib.apply(null,arguments).exponent(.5)}const IN=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:z0,scaleDiverging:TN,scaleDivergingLog:ON,scaleDivergingPow:ib,scaleDivergingSqrt:TG,scaleDivergingSymlog:AN,scaleIdentity:sN,scaleImplicit:my,scaleLinear:lN,scaleLog:uN,scaleOrdinal:L0,scalePoint:mV,scalePow:Y0,scaleQuantile:pN,scaleQuantize:hN,scaleRadial:fN,scaleSequential:kN,scaleSequentialLog:CN,scaleSequentialPow:rb,scaleSequentialQuantile:EN,scaleSequentialSqrt:EG,scaleSequentialSymlog:PN,scaleSqrt:sY,scaleSymlog:dN,scaleThreshold:mN,scaleTime:CG,scaleUtc:PG,tickFormat:oN},Symbol.toStringTag,{value:"Module"}));function OG(e){var t=IN;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(pu(e));if(n in t&&typeof t[n]=="function")return t[n]()}function lC(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=OG(e);if(r!=null)return r.domain(t).range(n),r}}function ab(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?lC(e.scale,n,r):lC(t,n,r)}function AG(e){return"scale".concat(pu(e))}function IG(e){return AG(e)in IN}var NN=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;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 IG(r)?r:"point"}};function NG(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 _N(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var l;return(l=e(a))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var l,s,c=NG(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var u=(l=r[c-1])!==null&&l!==void 0?l:0,f=(s=r[c])!==null&&s!==void 0?s:0;return Math.abs(a-u)<=Math.abs(a-f)?n[c-1]:n[c]}}}function _G(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):_N(e,void 0)}function sC(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 pp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sC(Object(n),!0).forEach(function(r){MG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MG(e,t,n){return(t=RG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RG(e){var t=DG(e,"string");return typeof t=="symbol"?t:t+""}function DG(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 xy=[0,"auto"],rn={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"},MN=(e,t)=>e.cartesianAxis.xAxis[t],ia=(e,t)=>{var n=MN(e,t);return n??rn},an={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:xy,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:yu},RN=(e,t)=>e.cartesianAxis.yAxis[t],aa=(e,t)=>{var n=RN(e,t);return n??an},LG={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:""},ob=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??LG},qt=(e,t,n)=>{switch(t){case"xAxis":return ia(e,n);case"yAxis":return aa(e,n);case"zAxis":return ob(e,n);case"angleAxis":return N0(e,n);case"radiusAxis":return _0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},zG=(e,t,n)=>{switch(t){case"xAxis":return ia(e,n);case"yAxis":return aa(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},vs=(e,t,n)=>{switch(t){case"xAxis":return ia(e,n);case"yAxis":return aa(e,n);case"angleAxis":return N0(e,n);case"radiusAxis":return _0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},DN=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function lb(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 Iu=e=>e.graphicalItems.cartesianItems,$G=q([zt,Pu],lb),sb=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),ys=q([Iu,qt,$G],sb,{memoizeOptions:{resultEqualityCheck:Ih}}),LN=q([ys],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Oh)),zN=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),BG=q([ys],zN),cb=e=>e.map(t=>t.data).filter(Boolean).flat(1),FG=q([ys],e=>e.some(t=>!t.data)),$N=q([ys],cb,{memoizeOptions:{resultEqualityCheck:Ih}}),ub=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},db=q([$N,ku],ub),BN=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:it(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:it(i,r)}))):e.map(r=>({value:r})),FN=(e,t,n,r,i,a)=>{var{chartData:l=[],dataStartIndex:s,dataEndIndex:c}=r,u=BN(e,t,n);if(i&&(t==null?void 0:t.dataKey)!=null&&a.length>0){var f=l.slice(s,c+1),d=f.map(p=>({value:it(p,t.dataKey)})).filter(p=>p.value!=null);return[...d,...u]}return u},Nu=q([db,qt,ys,ku,FG,$N],FN);function $l(e){if(Si(e)||e instanceof Date){var t=Number(e);if(Ue(t))return t}}function cC(e){if(Array.isArray(e)){var t=[$l(e[0]),$l(e[1])];return bi(t)?t:void 0}var n=$l(e);if(n!=null)return[n,n]}function Pi(e){return e.map($l).filter(tr)}function UG(e,t){var n=$l(e),r=$l(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var WG=q([Nu],e=>e==null?void 0:e.map(t=>t.value).sort(UG));function UN(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function KG(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Jr(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 l=it(e,a.dataKey),s,c;if(Array.isArray(l)?[s,c]=l:s=c=l,!(!Ue(s)||!Ue(c)))return[r-s,r+c]}))}var dn=e=>{var t=bn(e),n=ms(e);return vs(e,t,n)},ns=q([dn],e=>e==null?void 0:e.dataKey),qG=q([LN,ku,dn],XI),WN=(e,t,n,r)=>{var i={},a=t.reduce((l,s)=>{if(s.stackId==null)return l;var c=l[s.stackId];return c==null&&(c=[]),c.push(s),l[s.stackId]=c,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var[s,c]=l,u=r?[...c].reverse():c,f=u.map(Th);return[s,{stackedData:E9(e,f,n),graphicalItems:u}]}))},hp=q([qG,LN,Cu,WI],WN),KN=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=I9(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},HG=q([qt],e=>e.allowDataOverflow),fb=e=>{var t;if(e==null||!("domain"in e))return xy;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:xy},pb=q([qt],fb),hb=q([pb,HG],AI),VG=q([hp,ni,zt,hb],KN,{memoizeOptions:{resultEqualityCheck:Ah}}),zh=e=>e.errorBars,YG=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>UN(n,r)),mp=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(),l=Math.min(...a),s=Math.max(...a);return[l,s]}},mb=function(t,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],s,c;if(r.length>0&&r.forEach(u=>{var f,d=u.data!=null?[...u.data]:l,p=(f=i[u.id])===null||f===void 0?void 0:f.filter(m=>UN(a,m));d.forEach(m=>{var g,y=it(m,(g=n.dataKey)!==null&&g!==void 0?g:u.dataKey),x=KG(m,y,p);if(x.length>=2){var v=Math.min(...x),b=Math.max(...x);(s==null||v<s)&&(s=v),(c==null||b>c)&&(c=b)}var w=cC(y);w!=null&&(s=s==null?w[0]:Math.min(s,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 f=cC(it(u,n.dataKey));f!=null&&(s=s==null?f[0]:Math.min(s,f[0]),c=c==null?f[1]:Math.max(c,f[1]))}),Ue(s)&&Ue(c))return[s,c]},GG=q([db,qt,BG,zh,zt,L7],mb,{memoizeOptions:{resultEqualityCheck:Ah}});function XG(e){var{value:t}=e;if(Si(t)||t instanceof Date)return t}var QG=(e,t,n)=>{var r=e.map(XG).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&TO(r))?TI(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},qN=e=>e.referenceElements.dots,xs=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),JG=q([qN,zt,Pu],xs),HN=e=>e.referenceElements.areas,ZG=q([HN,zt,Pu],xs),VN=e=>e.referenceElements.lines,eX=q([VN,zt,Pu],xs),YN=(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)]}},tX=q(JG,zt,YN),GN=(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)]}},nX=q([ZG,zt],GN);function rX(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 iX(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 XN=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?rX(r):iX(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},aX=q([eX,zt],XN),oX=q(tX,aX,nX,(e,t,n)=>mp(e,n,t)),gb=(e,t,n,r,i,a,l,s)=>{if(n!=null)return n;var c=l==="vertical"&&s==="xAxis"||l==="horizontal"&&s==="yAxis",u=c?mp(r,a,i):mp(a,i);return B7(t,u,e.allowDataOverflow)},lX=q([qt,pb,hb,VG,GG,oX,Je,zt],gb,{memoizeOptions:{resultEqualityCheck:Ah}}),sX=[0,1],vb=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:s,type:c}=e,u=ti(t,a);if(u&&s==null){var f;return TI(0,(f=n==null?void 0:n.length)!==null&&f!==void 0?f:0)}return c==="category"?QG(r,e,u):i==="expand"&&!u?sX:l}},yb=q([qt,Je,db,Nu,Cu,zt,lX],vb),Xa=q([qt,DN,O0],NN),xb=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=fb(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&bi(e)){if(a)return xk(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return bk(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&bi(e))return xk(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&bi(e))return bk(e,t.tickCount,t.allowDecimals,"adaptive")}}},bb=q([yb,vs,Xa],xb),wb=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&bi(t)&&Array.isArray(n)&&n.length>0){var i,a,l=t[0],s=(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(l,s),Math.max(c,u)]}return t},cX=q([qt,yb,bb,zt],wb),uX=q(Nu,qt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Pi(e.map(d=>d.value))).sort((d,p)=>d-p),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var l=a-i;if(l===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],u=r[s+1];if(!(c==null||u==null)){var f=u-c;n=Math.min(n,f)}}return n/l}}),QN=q(uX,Je,UI,cn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ue(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=Rn(n,e*a),s=e*a/2;return s-l-(s-l)/a*l}return 0}),dX=(e,t,n)=>{var r=ia(e,t);return r==null||typeof r.padding!="string"?0:QN(e,"xAxis",t,n,r.padding)},fX=(e,t,n)=>{var r=aa(e,t);return r==null||typeof r.padding!="string"?0:QN(e,"yAxis",t,n,r.padding)},pX=q(ia,dX,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;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}}),hX=q(aa,fX,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;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}}),mX=q([cn,pX,bh,xh,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),gX=q([cn,Je,hX,bh,xh,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:l}=i;return a?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),_u=(e,t,n,r)=>{var i;switch(t){case"xAxis":return mX(e,n,r);case"yAxis":return gX(e,n,r);case"zAxis":return(i=ob(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return VI(e);case"radiusAxis":return YI(e,n);default:return}},JN=q([qt,_u],Ch),vX=q([Xa,cX],QI),jb=q([qt,Xa,vX,JN],ab),ZN=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,l=ti(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(s=>s.value)}},Sb=q([Je,Nu,vs,zt],ZN),$h=q([jb],R0);q([jb],_G);q([jb,WG],_N);q([ys,zh,zt],YG);function e_(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Bh=(e,t)=>t,Fh=(e,t,n)=>n,yX=q(vh,Bh,Fh,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(e_)),xX=q(yh,Bh,Fh,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(e_)),t_=(e,t)=>({width:e.width,height:t.height}),bX=(e,t)=>{var n=typeof t.width=="number"?t.width:yu;return{width:n,height:e.height}},n_=q(cn,ia,t_),wX=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},jX=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},SX=q(na,cn,yX,Bh,Fh,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=t_(t,s);l==null&&(l=wX(t,r,e));var u=r==="top"&&!i||r==="bottom"&&i;a[s.id]=l-Number(u)*c.height,l+=(u?-1:1)*c.height}),a}),kX=q(ta,cn,xX,Bh,Fh,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=bX(t,s);l==null&&(l=jX(t,r,e));var u=r==="left"&&!i||r==="right"&&i;a[s.id]=l-Number(u)*c.width,l+=(u?-1:1)*c.width}),a}),CX=(e,t)=>{var n=ia(e,t);if(n!=null)return SX(e,n.orientation,n.mirror)},PX=q([cn,ia,CX,(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}}}),EX=(e,t)=>{var n=aa(e,t);if(n!=null)return kX(e,n.orientation,n.mirror)},TX=q([cn,aa,EX,(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}}}),r_=q(cn,aa,(e,t)=>{var n=typeof t.width=="number"?t.width:yu;return{width:n,height:e.height}}),uC=(e,t,n)=>{switch(t){case"xAxis":return n_(e,n).width;case"yAxis":return r_(e,n).height;default:return}},i_=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:l}=n,s=ti(e,r),c=t.map(f=>f.value),u=c.filter(f=>f!=null);if(l&&s&&a==="category"&&i&&TO(u))return c}},kb=q([Je,Nu,qt,zt],i_),dC=q([Je,zG,Xa,$h,kb,Sb,_u,bb,zt],(e,t,n,r,i,a,l,s,c)=>{if(t!=null){var u=ti(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:s,range:l,realScaleType:n,scale:r}}}),OX=(e,t,n,r,i,a,l,s,c)=>{if(!(t==null||r==null)){var u=ti(e,c),{type:f,ticks:d,tickCount:p}=t,m=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,g=f==="category"&&r.bandwidth?r.bandwidth()/m:0;g=c==="angleAxis"&&a!=null&&a.length>=2?vn(a[0]-a[1])*2*g:g;var y=d||i;return y?y.map((x,v)=>{var b=l?l.indexOf(x):x,w=r.map(b);return Ue(w)?{index:v,coordinate:w+g,value:x,offset:g}:null}).filter(tr):u&&s?s.map((x,v)=>{var b=r.map(x);return Ue(b)?{coordinate:b+g,value:x,index:v,offset:g}:null}).filter(tr):r.ticks?r.ticks(p).map((x,v)=>{var b=r.map(x);return Ue(b)?{coordinate:b+g,value:x,index:v,offset:g}:null}).filter(tr):r.domain().map((x,v)=>{var b=r.map(x);return Ue(b)?{coordinate:b+g,value:l?l[x]:x,index:v,offset:g}:null}).filter(tr)}},a_=q([Je,vs,Xa,$h,bb,_u,kb,Sb,zt],OX),AX=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=ti(e,l),{tickCount:c}=t,u=0;return u=l==="angleAxis"&&(r==null?void 0:r.length)>=2?vn(r[0]-r[1])*2*u:u,s&&a?a.map((f,d)=>{var p=n.map(f);return Ue(p)?{coordinate:p+u,value:f,index:d,offset:u}:null}).filter(tr):n.ticks?n.ticks(c).map((f,d)=>{var p=n.map(f);return Ue(p)?{coordinate:p+u,value:f,index:d,offset:u}:null}).filter(tr):n.domain().map((f,d)=>{var p=n.map(f);return Ue(p)?{coordinate:p+u,value:i?i[f]:f,index:d,offset:u}:null}).filter(tr)}},Ei=q([Je,vs,$h,_u,kb,Sb,zt],AX),Ti=q(qt,$h,(e,t)=>{if(!(e==null||t==null))return pp(pp({},e),{},{scale:t})}),IX=q([qt,Xa,yb,JN],ab),NX=q([IX],R0);q((e,t,n)=>ob(e,n),NX,(e,t)=>{if(!(e==null||t==null))return pp(pp({},e),{},{scale:t})});var _X=q([Je,vh,yh],(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}}),MX=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};q([MX],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var l=Math.abs(a.coordinate-t);l<r&&(r=l,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var o_=e=>e.options.defaultTooltipEventType,l_=e=>e.options.validateTooltipEventTypes;function s_(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Mu(e,t){var n=o_(e),r=l_(e);return s_(t,n,r)}function RX(e){return ke(t=>Mu(t,e))}var c_=(e,t)=>{var n,r=Number(t);if(!(Jr(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},DX=e=>e.tooltip.settings,ya={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},LX={itemInteraction:{click:ya,hover:ya},axisInteraction:{click:ya,hover:ya},keyboardInteraction:ya,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}},u_=$n({name:"tooltip",initialState:LX,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Ct()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Nr(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Ct()},removeTooltipEntrySettings:{reducer(e,t){var n=Nr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Ct()},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}}}),{addTooltipEntrySettings:zX,replaceTooltipEntrySettings:$X,removeTooltipEntrySettings:BX,setTooltipSettingsState:FX,setActiveMouseOverItemIndex:d_,mouseLeaveItem:UX,mouseLeaveChart:f_,setActiveClickItemIndex:WX,setMouseOverAxisIndex:p_,setMouseClickAxisIndex:KX,setSyncInteraction:Zs,setKeyboardInteraction:gp}=u_.actions,qX=u_.reducer;function fC(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 Ed(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fC(Object(n),!0).forEach(function(r){HX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HX(e,t,n){return(t=VX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VX(e){var t=YX(e,"string");return typeof t=="symbol"?t:t+""}function YX(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 GX(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function XX(e){return e.index!=null}var h_=(e,t,n,r)=>{if(t==null)return ya;var i=GX(e,t,n);if(i==null)return ya;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(XX(i)){if(a)return Ed(Ed({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Ed(Ed({},ya),{},{coordinate:i.coordinate})};function QX(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 JX(e,t){var n=QX(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),l=Math.max(r,i);return n>=a&&n<=l}function ZX(e,t,n){if(n==null||t==null)return!0;var r=it(e,t);return r==null||!bi(n)?!0:JX(r,n)}var vc=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Ue(a))return i;var l=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(l,Math.min(a,s)),u=t[c];return u==null||ZX(u,n,r)?String(c):null},m_=(e,t,n,r,i,a,l)=>{if(a!=null){var s=l[0],c=s==null?void 0:s.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}}}},g_=(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(l=>{var s;return((s=l.settings)===null||s===void 0?void 0:s.graphicalItemId)===i})},v_=e=>e.options.tooltipPayloadSearcher,bs=e=>e.tooltip;function pC(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 hC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pC(Object(n),!0).forEach(function(r){eQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eQ(e,t,n){return(t=tQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tQ(e){var t=nQ(e,"string");return typeof t=="symbol"?t:t+""}function nQ(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 rQ(e){if(typeof e=="string"||typeof e=="number")return e}function iQ(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function aQ(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function mC(e){if(typeof e=="string")return e}function oQ(e){if(!(e==null||typeof e!="object")){var t="name"in e?rQ(e.name):void 0,n="unit"in e?iQ(e.unit):void 0,r="dataKey"in e?aQ(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?mC(e.color):void 0,l="fill"in e?mC(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function lQ(e,t){return e??t}var y_=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var{chartData:s,computedData:c,dataStartIndex:u,dataEndIndex:f}=n,d=[];return e.reduce((p,m)=>{var g,{dataDefinedOnItem:y,settings:x}=m,v=lQ(y,s),b=Array.isArray(v)?WA(v,u,f):v,w=(g=x==null?void 0:x.dataKey)!==null&&g!==void 0?g:r,j=x==null?void 0:x.nameKey,C;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&l==="axis"?C=OO(b,r,i):C=a(b,t,c,j),Array.isArray(C))C.forEach(E=>{var I,R,A=oQ(E),_=A==null?void 0:A.name,N=A==null?void 0:A.dataKey,Y=A==null?void 0:A.payload,K=hC(hC({},x),{},{name:_,unit:A==null?void 0:A.unit,color:(I=A==null?void 0:A.color)!==null&&I!==void 0?I:x==null?void 0:x.color,fill:(R=A==null?void 0:A.fill)!==null&&R!==void 0?R:x==null?void 0:x.fill});p.push(vS({tooltipEntrySettings:K,dataKey:N,payload:Y,value:it(Y,N),name:_==null?void 0:String(_)}))});else{var S;p.push(vS({tooltipEntrySettings:x,dataKey:w,payload:C,value:it(C,w),name:(S=it(C,j))!==null&&S!==void 0?S:x==null?void 0:x.name}))}return p},d)}},Cb=q([dn,DN,O0],NN),sQ=q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),cQ=q([bn,ms],lb),Zo=q([sQ,dn,cQ],sb,{memoizeOptions:{resultEqualityCheck:Ih}}),uQ=q([Zo],e=>e.filter(Oh)),x_=q([Zo],cb,{memoizeOptions:{resultEqualityCheck:Ih}}),dQ=q([Zo],e=>e.some(t=>!t.data)),Ko=q([x_,ni],ub),fQ=q([uQ,ni,dn],XI),Pb=q([Ko,dn,Zo,ni,dQ,x_],FN),b_=q([dn],fb),pQ=q([dn],e=>e.allowDataOverflow),w_=q([b_,pQ],AI),hQ=q([Zo],e=>e.filter(Oh)),mQ=q([fQ,hQ,Cu,WI],WN),gQ=q([mQ,ni,bn,w_],KN),vQ=q([Zo],zN),yQ=q([Ko,dn,vQ,zh,bn,$7],mb,{memoizeOptions:{resultEqualityCheck:Ah}}),xQ=q([qN,bn,ms],xs),bQ=q([xQ,bn],YN),wQ=q([HN,bn,ms],xs),jQ=q([wQ,bn],GN),SQ=q([VN,bn,ms],xs),kQ=q([SQ,bn],XN),CQ=q([bQ,kQ,jQ],mp),PQ=q([dn,b_,w_,gQ,yQ,CQ,Je,bn],gb),rs=q([dn,Je,Ko,Pb,Cu,bn,PQ],vb),EQ=q([rs,dn,Cb],xb),TQ=q([dn,rs,EQ,bn],wb),j_=e=>{var t=bn(e),n=ms(e),r=!1;return _u(e,t,n,r)},S_=q([dn,j_],Ch),OQ=q([dn,Cb,TQ,S_],ab),k_=q([OQ],R0),AQ=q([Je,Pb,dn,bn],i_),IQ=q([Je,Pb,dn,bn],ZN),NQ=(e,t,n,r,i,a,l,s)=>{if(t){var{type:c}=t,u=ti(e,s);if(r){var f=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,d=c==="category"&&r.bandwidth?r.bandwidth()/f:0;return d=s==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?vn(i[0]-i[1])*2*d:d,u&&l?l.map((p,m)=>{var g=r.map(p);return Ue(g)?{coordinate:g+d,value:p,index:m,offset:d}:null}).filter(tr):r.domain().map((p,m)=>{var g=r.map(p);return Ue(g)?{coordinate:g+d,value:a?a[p]:p,index:m,offset:d}:null}).filter(tr)}}},oa=q([Je,dn,Cb,k_,j_,AQ,IQ,bn],NQ),Eb=q([o_,l_,DX],(e,t,n)=>s_(n.shared,e,t)),C_=e=>e.tooltip.settings.trigger,Tb=e=>e.tooltip.settings.defaultIndex,Ru=q([bs,Eb,C_,Tb],h_),za=q([Ru,Ko,ns,rs],vc),P_=q([oa,za],c_),Ob=q([Ru],e=>{if(e)return e.dataKey}),E_=q([Ru],e=>{if(e)return e.graphicalItemId}),T_=q([bs,Eb,C_,Tb],g_),_Q=q([ta,na,Je,cn,oa,Tb,T_],m_),MQ=q([Ru,_Q],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),RQ=q([Ru],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),DQ=q([T_,za,ni,ns,P_,v_,Eb],y_),LQ=q([DQ],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function gC(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 vC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gC(Object(n),!0).forEach(function(r){zQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zQ(e,t,n){return(t=$Q(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Q(e){var t=BQ(e,"string");return typeof t=="symbol"?t:t+""}function BQ(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 FQ=()=>ke(dn),UQ=()=>{var e=FQ(),t=ke(oa),n=ke(k_);return La(!e||!n?void 0:vC(vC({},e),{},{scale:n}),t)};function yC(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 cl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yC(Object(n),!0).forEach(function(r){WQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WQ(e,t,n){return(t=KQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KQ(e){var t=qQ(e,"string");return typeof t=="symbol"?t:t+""}function qQ(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 HQ=(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}},VQ=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:l}=r;return cl(cl(cl({},r),tn(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var s=i.coordinate,{angle:c}=r;return cl(cl(cl({},r),tn(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function YQ(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var O_=(e,t,n,r,i)=>{var a,l=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var s=0;s<l;s++){var c,u,f,d,p,m=s>0?(c=n[s-1])===null||c===void 0?void 0:c.coordinate:(u=n[l-1])===null||u===void 0?void 0:u.coordinate,g=(f=n[s])===null||f===void 0?void 0:f.coordinate,y=s>=l-1?(d=n[0])===null||d===void 0?void 0:d.coordinate:(p=n[s+1])===null||p===void 0?void 0:p.coordinate,x=void 0;if(!(m==null||g==null||y==null))if(vn(g-m)!==vn(y-g)){var v=[];if(vn(y-g)===vn(i[1]-i[0])){x=y;var b=g+i[1]-i[0];v[0]=Math.min(b,(b+m)/2),v[1]=Math.max(b,(b+m)/2)}else{x=m;var w=y+i[1]-i[0];v[0]=Math.min(g,(w+g)/2),v[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>=v[0]&&e<=v[1]){var C;return(C=n[s])===null||C===void 0?void 0:C.index}}else{var S=Math.min(m,y),E=Math.max(m,y);if(e>(S+g)/2&&e<=(E+g)/2){var I;return(I=n[s])===null||I===void 0?void 0:I.index}}}else if(t)for(var R=0;R<l;R++){var A=t[R];if(A!=null){var _=t[R+1],N=t[R-1];if(R===0&&_!=null&&e<=(A.coordinate+_.coordinate)/2||R===l-1&&N!=null&&e>(A.coordinate+N.coordinate)/2||R>0&&R<l-1&&N!=null&&_!=null&&e>(A.coordinate+N.coordinate)/2&&e<=(A.coordinate+_.coordinate)/2)return A.index}}return-1},A_=()=>ke(O0),Ab=(e,t)=>t,I_=(e,t,n)=>n,Ib=(e,t,n,r)=>r,GQ=q(oa,e=>lh(e,t=>t.coordinate)),Nb=q([bs,Ab,I_,Ib],h_),_b=q([Nb,Ko,ns,rs],vc),XQ=(e,t,n)=>{if(t!=null){var r=bs(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},N_=q([bs,Ab,I_,Ib],g_),vp=q([ta,na,Je,cn,oa,Ib,N_],m_),QQ=q([Nb,vp],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),__=q([oa,_b],c_),JQ=q([N_,_b,ni,ns,__,v_,Ab],y_),ZQ=q([Nb,_b],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),eJ=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&YQ(e,l)){var s=N9(e,t),c=O_(s,a,i,n,r),u=HQ(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},tJ=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var s=C7(e,n);if(s){var c=_9(s,t),u=O_(c,l,a,r,i),f=VQ(t,a,u,s);return{activeIndex:String(u),activeCoordinate:f}}}},nJ=(e,t,n,r,i,a,l,s)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?eJ(e,t,r,i,a,l,s):tJ(e,t,n,r,i,a,l)},rJ=q(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}}),iJ=q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Gt)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:eV}});function xC(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 bC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xC(Object(n),!0).forEach(function(r){aJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aJ(e,t,n){return(t=oJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oJ(e){var t=lJ(e,"string");return typeof t=="symbol"?t:t+""}function lJ(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 sJ={},cJ={zIndexMap:Object.values(Gt).reduce((e,t)=>bC(bC({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),sJ)},uJ=new Set(Object.values(Gt));function dJ(e){return uJ.has(e)}var M_=$n({name:"zIndex",initialState:cJ,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Ct()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!dJ(n)&&delete e.zIndexMap[n])},prepare:Ct()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:Ct()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:Ct()}}}),{registerZIndexPortal:fJ,unregisterZIndexPortal:gg,registerZIndexPortalElement:pJ,unregisterZIndexPortalElement:hJ}=M_.actions,mJ=M_.reducer;function Gn(e){var{zIndex:t,children:n}=e,r=dq(),i=r&&t!==void 0&&t!==0,a=xn(),l=h.useRef(void 0),s=h.useRef(new Set),c=mt(),u=ke(d=>rJ(d,t,a));if(h.useLayoutEffect(()=>{if(!i){var d=s.current;d.forEach(m=>{c(gg({zIndex:m}))}),d.clear(),l.current=void 0;return}if(s.current.has(t)||(c(fJ({zIndex:t})),s.current.add(t)),u){l.current=u;var p=s.current;p.forEach(m=>{m!==t&&(c(gg({zIndex:m})),p.delete(m))})}},[c,t,i,u]),h.useLayoutEffect(()=>{var d=s.current;return()=>{d.forEach(p=>{c(gg({zIndex:p}))}),d.clear()}},[c]),!i)return n;var f=u??l.current;return f?Wp.createPortal(n,f):null}function by(){return by=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},by.apply(null,arguments)}function wC(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 Td(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wC(Object(n),!0).forEach(function(r){gJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gJ(e,t,n){return(t=vJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vJ(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)}function xJ(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return h.isValidElement(t)?h.cloneElement(t,r):h.createElement(n,r)}function bJ(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:l,layout:s,cursor:c,tooltipEventType:u,chartName:f}=e,d=n,p=r,m=i;if(!c||!d||f!=="ScatterChart"&&u!=="axis")return null;var g,y,x;if(f==="ScatterChart")g=d,y=BH,x=Gt.cursorLine;else if(f==="BarChart")g=FH(s,d,a,l),y=bI,x=Gt.cursorRectangle;else if(s==="radial"&&IO(d)){var{cx:v,cy:b,radius:w,startAngle:j,endAngle:C}=jI(d);g={cx:v,cy:b,startAngle:j,endAngle:C,innerRadius:w,outerRadius:w},y=kI,x=Gt.cursorLine}else g={points:O7(s,d,a)},y=Ll,x=Gt.cursorLine;var S=typeof c=="object"&&"className"in c?c.className:void 0,E=Td(Td(Td(Td({stroke:"#ccc",pointerEvents:"none"},a),g),Do(c)),{},{payload:p,payloadIndex:m,className:tt("recharts-tooltip-cursor",S)});return h.createElement(Gn,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:x},h.createElement(xJ,{cursor:c,cursorComp:y,cursorProps:E}))}function wJ(e){var t=UQ(),n=nI(),r=Va(),i=A_();return t==null||n==null||r==null||i==null?null:h.createElement(bJ,by({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var R_=h.createContext(null),jJ=()=>h.useContext(R_),D_={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,f){this.fn=c,this.context=u,this.once=f||!1}function a(c,u,f,d,p){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new i(f,d||c,p),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 l(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)t.call(f,d)&&u.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},s.prototype.listeners=function(u){var f=n?n+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var p=0,m=d.length,g=new Array(m);p<m;p++)g[p]=d[p].fn;return g},s.prototype.listenerCount=function(u){var f=n?n+u:u,d=this._events[f];return d?d.fn?1:d.length:0},s.prototype.emit=function(u,f,d,p,m,g){var y=n?n+u:u;if(!this._events[y])return!1;var x=this._events[y],v=arguments.length,b,w;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),v){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,f),!0;case 3:return x.fn.call(x.context,f,d),!0;case 4:return x.fn.call(x.context,f,d,p),!0;case 5:return x.fn.call(x.context,f,d,p,m),!0;case 6:return x.fn.call(x.context,f,d,p,m,g),!0}for(w=1,b=new Array(v-1);w<v;w++)b[w-1]=arguments[w];x.fn.apply(x.context,b)}else{var j=x.length,C;for(w=0;w<j;w++)switch(x[w].once&&this.removeListener(u,x[w].fn,void 0,!0),v){case 1:x[w].fn.call(x[w].context);break;case 2:x[w].fn.call(x[w].context,f);break;case 3:x[w].fn.call(x[w].context,f,d);break;case 4:x[w].fn.call(x[w].context,f,d,p);break;default:if(!b)for(C=1,b=new Array(v-1);C<v;C++)b[C-1]=arguments[C];x[w].fn.apply(x[w].context,b)}}return!0},s.prototype.on=function(u,f,d){return a(this,u,f,d,!1)},s.prototype.once=function(u,f,d){return a(this,u,f,d,!0)},s.prototype.removeListener=function(u,f,d,p){var m=n?n+u:u;if(!this._events[m])return this;if(!f)return l(this,m),this;var g=this._events[m];if(g.fn)g.fn===f&&(!p||g.once)&&(!d||g.context===d)&&l(this,m);else{for(var y=0,x=[],v=g.length;y<v;y++)(g[y].fn!==f||p&&!g[y].once||d&&g[y].context!==d)&&x.push(g[y]);x.length?this._events[m]=x.length===1?x[0]:x:l(this,m)}return this},s.prototype.removeAllListeners=function(u){var f;return u?(f=n?n+u:u,this._events[f]&&l(this,f)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(D_);var SJ=D_.exports;const kJ=zr(SJ);var eu=new kJ,wy="recharts.syncEvent.tooltip",jC="recharts.syncEvent.brush",Uh=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Jr(n))return e[n]}},CJ={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},L_=$n({name:"options",initialState:CJ,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),PJ=L_.reducer,{createEventEmitter:EJ}=L_.actions;function TJ(e){return e.tooltip.syncInteraction}var OJ={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},z_=$n({name:"chartData",initialState:OJ,reducers:{setChartData(e,t){if(e.chartData=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{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:SC,setDataStartEndIndexes:AJ,setComputedData:tle}=z_.actions,IJ=z_.reducer,NJ=["x","y"];function kC(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 ul(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kC(Object(n),!0).forEach(function(r){_J(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _J(e,t,n){return(t=MJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MJ(e){var t=RJ(e,"string");return typeof t=="symbol"?t:t+""}function RJ(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 DJ(e,t){if(e==null)return{};var n,r,i=LJ(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 LJ(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 zJ(){var e=ke(A0),t=ke(I0),n=mt(),r=ke(KI),i=ke(oa),a=Va(),l=wh(),s=ke(c=>c.rootProps.className);h.useEffect(()=>{if(e==null)return qa;var c=(u,f,d)=>{if(t!==d&&e===u){if(f.payload.active===!1){n(Zs({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var p;if(l&&f!==null&&f!==void 0&&(p=f.payload)!==null&&p!==void 0&&p.coordinate&&f.payload.sourceViewBox){var m=f.payload.coordinate,{x:g,y}=m,x=DJ(m,NJ),{x:v,y:b,width:w,height:j}=f.payload.sourceViewBox,C=ul(ul({},x),{},{x:l.x+(w?(g-v)/w:0)*l.width,y:l.y+(j?(y-b)/j:0)*l.height});n(ul(ul({},f),{},{payload:ul(ul({},f.payload),{},{coordinate:C})}))}else n(f);return}if(i!=null){var S;if(typeof r=="function"){var E={activeTooltipIndex:f.payload.index==null?void 0:Number(f.payload.index),isTooltipActive:f.payload.active,activeIndex:f.payload.index==null?void 0:Number(f.payload.index),activeLabel:f.payload.label,activeDataKey:f.payload.dataKey,activeCoordinate:f.payload.coordinate},I=r(i,E);S=i[I]}else r==="value"&&(S=i.find(F=>String(F.value)===f.payload.label));var{coordinate:R}=f.payload;if(R==null||l==null){n(Zs({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(S==null){n(Zs({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:f.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:A,y:_}=R,N=Math.min(A,l.x+l.width),Y=Math.min(_,l.y+l.height),K={x:a==="horizontal"?S.coordinate:N,y:a==="horizontal"?Y:S.coordinate},O=Zs({active:f.payload.active,coordinate:K,dataKey:f.payload.dataKey,index:String(S.index),label:f.payload.label,sourceViewBox:f.payload.sourceViewBox,graphicalItemId:f.payload.graphicalItemId});n(O)}}};return eu.on(wy,c),()=>{eu.off(wy,c)}},[s,n,t,e,r,i,a,l])}function $J(){var e=ke(A0),t=ke(I0),n=mt();h.useEffect(()=>{if(e==null)return qa;var r=(i,a,l)=>{t!==l&&e===i&&n(AJ(a))};return eu.on(jC,r),()=>{eu.off(jC,r)}},[n,t,e])}function BJ(){var e=mt();h.useEffect(()=>{e(EJ())},[e]),zJ(),$J()}function FJ(e,t,n,r,i,a){var l=ke(g=>XQ(g,e,t)),s=ke(E_),c=ke(I0),u=ke(A0),f=ke(KI),d=ke(TJ),p=(d==null?void 0:d.sourceViewBox)!=null,m=wh();h.useEffect(()=>{if(!p&&u!=null&&c!=null){var g=Zs({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:m,graphicalItemId:s});eu.emit(wy,u,g,c)}},[p,n,l,s,i,r,c,u,f,a,m])}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 PC(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){UJ(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 UJ(e,t,n){return(t=WJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WJ(e){var t=KJ(e,"string");return typeof t=="symbol"?t:t+""}function KJ(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 qJ(e){return e.dataKey}function HJ(e,t){return h.isValidElement(e)?h.cloneElement(e,t):typeof e=="function"?h.createElement(e,t):h.createElement(mH,t)}var EC=[],VJ={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 Ws(e){var t,n,r=Xt(e,VJ),{active:i,allowEscapeViewBox:a,animationDuration:l,animationEasing:s,content:c,filterNull:u,isAnimationActive:f,offset:d,payloadUniqBy:p,position:m,reverseDirection:g,useTranslate3d:y,wrapperStyle:x,cursor:v,shared:b,trigger:w,defaultIndex:j,portal:C,axisId:S}=r,E=mt(),I=typeof j=="number"?String(j):j;h.useEffect(()=>{E(FX({shared:b,trigger:w,axisId:S,active:i,defaultIndex:I}))},[E,b,w,S,i,I]);var R=wh(),A=mI(),_=RX(b),{activeIndex:N,isActive:Y}=(t=ke(fe=>ZQ(fe,_,w,I)))!==null&&t!==void 0?t:{},K=ke(fe=>JQ(fe,_,w,I)),O=ke(fe=>__(fe,_,w,I)),F=ke(fe=>QQ(fe,_,w,I)),W=K,M=jJ(),B=(n=i??Y)!==null&&n!==void 0?n:!1,[k,L]=pA([W,B]),X=_==="axis"?O:void 0;FJ(_,w,F,X,N,B);var T=C??M;if(T==null||R==null||_==null)return null;var ce=W??EC;B||(ce=EC),u&&ce.length&&(ce=tA(ce.filter(fe=>fe.value!=null&&(fe.hide!==!0||r.includeHidden)),p,qJ));var ge=ce.length>0,Q=PC(PC({},r),{},{payload:ce,label:X,active:B,activeIndex:N,coordinate:F,accessibilityLayer:A}),ae=h.createElement(PH,{allowEscapeViewBox:a,animationDuration:l,animationEasing:s,isAnimationActive:f,active:B,coordinate:F,hasPayload:ge,offset:d,position:m,reverseDirection:g,useTranslate3d:y,viewBox:R,wrapperStyle:x,lastBoundingBox:k,innerRef:L,hasPortalFromProps:!!C},HJ(c,Q));return h.createElement(h.Fragment,null,Wp.createPortal(ae,T),B&&h.createElement(wJ,{cursor:v,tooltipEventType:_,coordinate:F,payload:ce,index:N}))}var Du=e=>null;Du.displayName="Cell";function YJ(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=XJ(e,"string");return typeof t=="symbol"?t:t+""}function XJ(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 QJ{constructor(t){YJ(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 TC(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 JJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TC(Object(n),!0).forEach(function(r){ZJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZJ(e,t,n){return(t=eZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eZ(e){var t=tZ(e,"string");return typeof t=="symbol"?t:t+""}function tZ(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 nZ={cacheSize:2e3,enableCache:!0},$_=JJ({},nZ),OC=new QJ($_.cacheSize),rZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},AC="recharts_measurement_span";function iZ(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",s=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(s)}var IC=(e,t)=>{try{var n=document.getElementById(AC);n||(n=document.createElement("span"),n.setAttribute("id",AC),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,rZ,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},yc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ju.isSsr)return{width:0,height:0};if(!$_.enableCache)return IC(t,n);var r=iZ(t,n),i=OC.get(r);if(i)return i;var a=IC(t,n);return OC.set(r,a),a},B_;function aZ(e,t,n){return(t=oZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oZ(e){var t=lZ(e,"string");return typeof t=="symbol"?t:t+""}function lZ(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=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,_C=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,sZ=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,cZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,uZ={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},dZ=["cm","mm","pt","pc","in","Q","px"];function fZ(e){return dZ.includes(e)}var El="NaN";function pZ(e,t){return e*uZ[t]}class Cn{static parse(t){var n,[,r,i]=(n=cZ.exec(t))!==null&&n!==void 0?n:[];return r==null?Cn.NaN:new Cn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Jr(t)&&(this.unit=""),n!==""&&!sZ.test(n)&&(this.num=NaN,this.unit=""),fZ(n)&&(this.num=pZ(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Cn(NaN,""):new Cn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Cn(NaN,""):new Cn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Cn(NaN,""):new Cn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Cn(NaN,""):new Cn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Jr(this.num)}}B_=Cn;aZ(Cn,"NaN",new B_(NaN,""));function F_(e){if(e==null||e.includes(El))return El;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=NC.exec(t))!==null&&n!==void 0?n:[],l=Cn.parse(r??""),s=Cn.parse(a??""),c=i==="*"?l.multiply(s):l.divide(s);if(c.isNaN())return El;t=t.replace(NC,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,f,d,p]=(u=_C.exec(t))!==null&&u!==void 0?u:[],m=Cn.parse(f??""),g=Cn.parse(p??""),y=d==="+"?m.add(g):m.subtract(g);if(y.isNaN())return El;t=t.replace(_C,y.toString())}return t}var MC=/\(([^()]*)\)/;function hZ(e){for(var t=e,n;(n=MC.exec(t))!=null;){var[,r]=n;t=t.replace(MC,F_(r))}return t}function mZ(e){var t=e.replace(/\s+/g,"");return t=hZ(t),t=F_(t),t}function gZ(e){try{return mZ(e)}catch{return El}}function vg(e){var t=gZ(e.slice(5,-1));return t===El?"":t}var vZ=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],yZ=["dx","dy","angle","className","breakAll"];function jy(){return jy=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},jy.apply(null,arguments)}function RC(e,t){if(e==null)return{};var n,r,i=xZ(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 xZ(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 U_=/[ \f\n\r\t\v\u2028\u2029]+/,W_=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Tt(t)||(n?i=t.toString().split(""):i=t.toString().split(U_));var a=i.map(s=>({word:s,width:yc(s,r).width})),l=n?0:yc(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function K_(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function bZ(e){return Tt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var q_=(e,t,n,r)=>e.reduce((i,a)=>{var{word:l,width:s}=a,c=i[i.length-1];if(c&&s!=null&&(t==null||r||c.width+s+n<Number(t)))c.words.push(l),c.width+=s+n;else{var u={words:[l],width:s};i.push(u)}return i},[]),H_=e=>e.reduce((t,n)=>t.width>n.width?t:n),wZ="…",DC=(e,t,n,r,i,a,l,s)=>{var c=e.slice(0,t),u=W_({breakAll:n,style:r,children:c+wZ});if(!u)return[!1,[]];var f=q_(u.wordsWithComputedWidth,a,l,s),d=f.length>i||H_(f).width>Number(a);return[d,f]},jZ=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:s,breakAll:c}=e,u=ve(a),f=String(l),d=q_(t,r,n,i);if(!u||i)return d;var p=d.length>a||H_(d).width>Number(r);if(!p)return d;for(var m=0,g=f.length-1,y=0,x;m<=g&&y<=f.length-1;){var v=Math.floor((m+g)/2),b=v-1,[w,j]=DC(f,b,c,s,a,r,n,i),[C]=DC(f,v,c,s,a,r,n,i);if(!w&&!C&&(m=v+1),w&&C&&(g=v-1),!w&&C){x=j;break}y++}return x||d},LC=e=>{var t=Tt(e)?[]:e.toString().split(U_);return[{words:t,width:void 0}]},SZ=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!ju.isSsr){var s,c,u=W_({breakAll:a,children:r,style:i});if(u){var{wordsWithComputedWidth:f,spaceWidth:d}=u;s=f,c=d}else return LC(r);return jZ({breakAll:a,children:r,maxLines:l,style:i},s,c,t,!!n)}return LC(r)},V_="#808080",kZ={angle:0,breakAll:!1,capHeight:"0.71em",fill:V_,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Wh=h.forwardRef((e,t)=>{var n=Xt(e,kZ),{x:r,y:i,lineHeight:a,capHeight:l,fill:s,scaleToFit:c,textAnchor:u,verticalAnchor:f}=n,d=RC(n,vZ),p=h.useMemo(()=>SZ({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]),{dx:m,dy:g,angle:y,className:x,breakAll:v}=d,b=RC(d,yZ);if(!Si(r)||!Si(i)||p.length===0)return null;var w=Number(r)+(ve(m)?m:0),j=Number(i)+(ve(g)?g:0);if(!Ue(w)||!Ue(j))return null;var C;switch(f){case"start":C=vg("calc(".concat(l,")"));break;case"middle":C=vg("calc(".concat((p.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:C=vg("calc(".concat(p.length-1," * -").concat(a,")"));break}var S=[],E=p[0];if(c&&E!=null){var I=E.width,{width:R}=d;S.push("scale(".concat(ve(R)&&ve(I)?R/I:1,")"))}return y&&S.push("rotate(".concat(y,", ").concat(w,", ").concat(j,")")),S.length&&(b.transform=S.join(" ")),h.createElement("text",jy({},Ln(b),{ref:t,x:w,y:j,className:tt("recharts-text",x),textAnchor:u,fill:s.includes("url")?V_:s}),p.map((A,_)=>{var N=A.words.join(v?"":" ");return h.createElement("tspan",{x:w,dy:_===0?C:a,key:"".concat(N,"-").concat(_)},N)}))});Wh.displayName="Text";function zC(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 ci(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zC(Object(n),!0).forEach(function(r){CZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CZ(e,t,n){return(t=PZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PZ(e){var t=EZ(e,"string");return typeof t=="symbol"?t:t+""}function EZ(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 TZ=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:l,height:s,upperWidth:c,lowerWidth:u}=b0(t),f=a,d=a+(c-u)/2,p=(f+d)/2,m=(c+u)/2,g=f+c/2,y=s>=0?1:-1,x=y*r,v=y>0?"end":"start",b=y>0?"start":"end",w=c>=0?1:-1,j=w*r,C=w>0?"end":"start",S=w>0?"start":"end",E=i;if(n==="top"){var I={x:f+c/2,y:l-x,horizontalAnchor:"middle",verticalAnchor:v};return E&&(I.height=Math.max(l-E.y,0),I.width=c),I}if(n==="bottom"){var R={x:d+u/2,y:l+s+x,horizontalAnchor:"middle",verticalAnchor:b};return E&&(R.height=Math.max(E.y+E.height-(l+s),0),R.width=u),R}if(n==="left"){var A={x:p-j,y:l+s/2,horizontalAnchor:C,verticalAnchor:"middle"};return E&&(A.width=Math.max(A.x-E.x,0),A.height=s),A}if(n==="right"){var _={x:p+m+j,y:l+s/2,horizontalAnchor:S,verticalAnchor:"middle"};return E&&(_.width=Math.max(E.x+E.width-_.x,0),_.height=s),_}var N=E?{width:m,height:s}:{};return n==="insideLeft"?ci({x:p+j,y:l+s/2,horizontalAnchor:S,verticalAnchor:"middle"},N):n==="insideRight"?ci({x:p+m-j,y:l+s/2,horizontalAnchor:C,verticalAnchor:"middle"},N):n==="insideTop"?ci({x:f+c/2,y:l+x,horizontalAnchor:"middle",verticalAnchor:b},N):n==="insideBottom"?ci({x:d+u/2,y:l+s-x,horizontalAnchor:"middle",verticalAnchor:v},N):n==="insideTopLeft"?ci({x:f+j,y:l+x,horizontalAnchor:S,verticalAnchor:b},N):n==="insideTopRight"?ci({x:f+c-j,y:l+x,horizontalAnchor:C,verticalAnchor:b},N):n==="insideBottomLeft"?ci({x:d+j,y:l+s-x,horizontalAnchor:S,verticalAnchor:v},N):n==="insideBottomRight"?ci({x:d+u-j,y:l+s-x,horizontalAnchor:C,verticalAnchor:v},N):n&&typeof n=="object"&&(ve(n.x)||$o(n.x))&&(ve(n.y)||$o(n.y))?ci({x:a+Rn(n.x,m),y:l+Rn(n.y,s),horizontalAnchor:"end",verticalAnchor:"end"},N):ci({x:g,y:l+s/2,horizontalAnchor:"middle",verticalAnchor:"middle"},N)},OZ=["labelRef"],AZ=["content"];function $C(e,t){if(e==null)return{};var n,r,i=IZ(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 IZ(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 BC(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 ec(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BC(Object(n),!0).forEach(function(r){NZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NZ(e,t,n){return(t=_Z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Z(e){var t=MZ(e,"string");return typeof t=="symbol"?t:t+""}function MZ(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 Di(){return Di=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},Di.apply(null,arguments)}var Y_=h.createContext(null),RZ=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l,children:s}=e,c=h.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l}),[t,n,r,i,a,l]);return h.createElement(Y_.Provider,{value:c},s)},G_=()=>{var e=h.useContext(Y_),t=wh();return e||(t?b0(t):void 0)},DZ=h.createContext(null),LZ=()=>{var e=h.useContext(DZ),t=ke(GI);return e||t},zZ=e=>{var{value:t,formatter:n}=e,r=Tt(e.children)?t:e.children;return typeof n=="function"?n(r):r},Mb=e=>e!=null&&typeof e=="function",$Z=(e,t)=>{var n=vn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},BZ=(e,t,n,r,i)=>{var{offset:a,className:l}=e,{cx:s,cy:c,innerRadius:u,outerRadius:f,startAngle:d,endAngle:p,clockWise:m}=i,g=(u+f)/2,y=$Z(d,p),x=y>=0?1:-1,v,b;switch(t){case"insideStart":v=d+x*a,b=m;break;case"insideEnd":v=p-x*a,b=!m;break;case"end":v=p+x*a,b=m;break;default:throw new Error("Unsupported position ".concat(t))}b=y<=0?b:!b;var w=tn(s,c,g,v),j=tn(s,c,g,v+(b?1:-1)*359),C="M".concat(w.x,",").concat(w.y,`
475
- A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
476
- `).concat(j.x,",").concat(j.y),S=Tt(e.id)?Fc("recharts-radial-line-"):e.id;return h.createElement("text",Di({},r,{dominantBaseline:"central",className:tt("recharts-radial-bar-label",l)}),h.createElement("defs",null,h.createElement("path",{id:S,d:C})),h.createElement("textPath",{xlinkHref:"#".concat(S)},n))},FZ=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:l,startAngle:s,endAngle:c}=e,u=(s+c)/2;if(n==="outside"){var{x:f,y:d}=tn(r,i,l+t,u);return{x:f,y:d,textAnchor:f>=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 p=(a+l)/2,{x:m,y:g}=tn(r,i,p,u);return{x:m,y:g,textAnchor:"middle",verticalAnchor:"middle"}},Gd=e=>e!=null&&"cx"in e&&ve(e.cx),UZ={angle:0,offset:5,zIndex:Gt.label,position:"middle",textBreakAll:!1};function WZ(e){if(!Gd(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function ma(e){var t=Xt(e,UZ),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:s,className:c="",textBreakAll:u,labelRef:f}=t,d=LZ(),p=G_(),m=i==="center"?p:d??p,g,y,x;n==null?g=m:Gd(n)?g=n:g=b0(n);var v=WZ(g);if(!g||Tt(a)&&Tt(l)&&!h.isValidElement(s)&&typeof s!="function")return null;var b=ec(ec({},t),{},{viewBox:g});if(h.isValidElement(s)){var{labelRef:w}=b,j=$C(b,OZ);return h.cloneElement(s,j)}if(typeof s=="function"){var{content:C}=b,S=$C(b,AZ);if(y=h.createElement(s,S),h.isValidElement(y))return y}else y=zZ(t);var E=Ln(t);if(Gd(g)){if(i==="insideStart"||i==="insideEnd"||i==="end")return BZ(t,i,y,E,g);x=FZ(g,t.offset,t.position)}else{if(!v)return null;var I=TZ({viewBox:v,position:i,offset:t.offset,parentViewBox:Gd(r)?void 0:r});x=ec(ec({x:I.x,y:I.y,textAnchor:I.horizontalAnchor,verticalAnchor:I.verticalAnchor},I.width!==void 0?{width:I.width}:{}),I.height!==void 0?{height:I.height}:{})}return h.createElement(Gn,{zIndex:t.zIndex},h.createElement(Wh,Di({ref:f,className:tt("recharts-label",c)},E,x,{textAnchor:K_(E.textAnchor)?E.textAnchor:x.textAnchor,breakAll:u}),y))}ma.displayName="Label";var KZ=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?h.createElement(ma,Di({key:"label-implicit"},r)):Si(e)?h.createElement(ma,Di({key:"label-implicit",value:e},r)):h.isValidElement(e)?e.type===ma?h.cloneElement(e,ec({key:"label-implicit"},r)):h.createElement(ma,Di({key:"label-implicit",content:e},r)):Mb(e)?h.createElement(ma,Di({key:"label-implicit",content:e},r)):e&&typeof e=="object"?h.createElement(ma,Di({},e,{key:"label-implicit"},r)):null};function qZ(e){var{label:t,labelRef:n}=e,r=G_();return KZ(t,r,n)||null}var HZ=["valueAccessor"],VZ=["dataKey","clockWise","id","textBreakAll","zIndex"];function yp(){return yp=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},yp.apply(null,arguments)}function FC(e,t){if(e==null)return{};var n,r,i=YZ(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 YZ(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 GZ=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(bZ(t))return t},X_=h.createContext(void 0),Rb=X_.Provider,Q_=h.createContext(void 0),XZ=Q_.Provider;function QZ(){return h.useContext(X_)}function JZ(){return h.useContext(Q_)}function Xd(e){var{valueAccessor:t=GZ}=e,n=FC(e,HZ),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:s}=n,c=FC(n,VZ),u=QZ(),f=JZ(),d=u||f;return!d||!d.length?null:h.createElement(Gn,{zIndex:s??Gt.label},h.createElement(Lt,{className:"recharts-label-list"},d.map((p,m)=>{var g,y=Tt(r)?t(p,m):it(p.payload,r),x=Tt(a)?{}:{id:"".concat(a,"-").concat(m)};return h.createElement(ma,yp({key:"label-".concat(m)},Ln(p),c,x,{fill:(g=n.fill)!==null&&g!==void 0?g:p.fill,parentViewBox:p.parentViewBox,value:y,textBreakAll:l,viewBox:p.viewBox,index:m,zIndex:0}))})))}Xd.displayName="LabelList";function Kh(e){var{label:t}=e;return t?t===!0?h.createElement(Xd,{key:"labelList-implicit"}):h.isValidElement(t)||Mb(t)?h.createElement(Xd,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(Xd,yp({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Sy(){return Sy=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},Sy.apply(null,arguments)}var J_=e=>{var{cx:t,cy:n,r,className:i}=e,a=tt("recharts-dot",i);return ve(t)&&ve(n)&&ve(r)?h.createElement("circle",Sy({},qn(e),t0(e),{className:a,cx:t,cy:n,r})):null},Z_=e=>e.graphicalItems.polarItems,ZZ=q([zt,Pu],lb),qh=q([Z_,qt,ZZ],sb),eee=q([qh],cb),Hh=q([eee,Su],ub),tee=q([Hh,qt,qh],BN);q([Hh,qt,qh],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,l=it(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:l,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:it(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var UC=()=>{},nee=q([Hh,qt,qh,zh,zt,z7],mb),ree=q([qt,pb,hb,UC,nee,UC,Je,zt],gb),eM=q([qt,Je,Hh,tee,Cu,zt,ree],vb),iee=q([eM,vs,Xa],xb),aee=q([qt,eM,iee,zt],wb);q([Xa,aee],QI);var oee={radiusAxis:{},angleAxis:{}},tM=$n({name:"polarAxis",initialState:oee,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:nle,removeRadiusAxis:rle,addAngleAxis:ile,removeAngleAxis:ale}=tM.actions,lee=tM.reducer;function nM(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function WC(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 KC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WC(Object(n),!0).forEach(function(r){see(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function see(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=uee(e,"string");return typeof t=="symbol"?t:t+""}function uee(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 dee=(e,t)=>t,Db=q([Z_,dee],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),fee=[],Lb=(e,t,n)=>(n==null?void 0:n.length)===0?fee:n,rM=q([Su,Db,Lb],(e,t,n)=>{var{chartData:r}=e;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=>KC(KC({},t.presentationProps),a.props))),i!=null)return i}}),pee=q([rM,Db,Lb],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,l=it(r,t.nameKey,t.name),s;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?s=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?s=r.fill:s=t.fill,{value:Ha(l,t.dataKey),color:s,payload:r,type:t.legendType}})}),hee=q([rM,Db,Lb,cn],(e,t,n,r)=>{if(!(t==null||e==null))return vte({offset:r,pieSettings:t,displayedData:e,cells:n})}),iM={exports:{}},xt={};/**
477
- * @license React
478
- * react-is.production.js
479
- *
480
- * Copyright (c) Meta Platforms, Inc. and affiliates.
481
- *
482
- * This source code is licensed under the MIT license found in the
483
- * LICENSE file in the root directory of this source tree.
484
- */var zb=Symbol.for("react.transitional.element"),$b=Symbol.for("react.portal"),Vh=Symbol.for("react.fragment"),Yh=Symbol.for("react.strict_mode"),Gh=Symbol.for("react.profiler"),Xh=Symbol.for("react.consumer"),Qh=Symbol.for("react.context"),Jh=Symbol.for("react.forward_ref"),Zh=Symbol.for("react.suspense"),em=Symbol.for("react.suspense_list"),tm=Symbol.for("react.memo"),nm=Symbol.for("react.lazy"),mee=Symbol.for("react.view_transition"),gee=Symbol.for("react.client.reference");function Br(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case zb:switch(e=e.type,e){case Vh:case Gh:case Yh:case Zh:case em:case mee:return e;default:switch(e=e&&e.$$typeof,e){case Qh:case Jh:case nm:case tm:return e;case Xh:return e;default:return t}}case $b:return t}}}xt.ContextConsumer=Xh;xt.ContextProvider=Qh;xt.Element=zb;xt.ForwardRef=Jh;xt.Fragment=Vh;xt.Lazy=nm;xt.Memo=tm;xt.Portal=$b;xt.Profiler=Gh;xt.StrictMode=Yh;xt.Suspense=Zh;xt.SuspenseList=em;xt.isContextConsumer=function(e){return Br(e)===Xh};xt.isContextProvider=function(e){return Br(e)===Qh};xt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===zb};xt.isForwardRef=function(e){return Br(e)===Jh};xt.isFragment=function(e){return Br(e)===Vh};xt.isLazy=function(e){return Br(e)===nm};xt.isMemo=function(e){return Br(e)===tm};xt.isPortal=function(e){return Br(e)===$b};xt.isProfiler=function(e){return Br(e)===Gh};xt.isStrictMode=function(e){return Br(e)===Yh};xt.isSuspense=function(e){return Br(e)===Zh};xt.isSuspenseList=function(e){return Br(e)===em};xt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Vh||e===Gh||e===Yh||e===Zh||e===em||typeof e=="object"&&e!==null&&(e.$$typeof===nm||e.$$typeof===tm||e.$$typeof===Qh||e.$$typeof===Xh||e.$$typeof===Jh||e.$$typeof===gee||e.getModuleId!==void 0)};xt.typeOf=Br;iM.exports=xt;var vee=iM.exports,qC=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",HC=null,yg=null,aM=e=>{if(e===HC&&Array.isArray(yg))return yg;var t=[];return h.Children.forEach(e,n=>{Tt(n)||(vee.isFragment(n)?t=t.concat(aM(n.props.children)):t.push(n))}),yg=t,HC=e,t};function Bb(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>qC(i)):r=[qC(t)],aM(e).forEach(i=>{var a=zo(i,"type.displayName")||zo(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var Fb=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,oM={};function yee(e){var n;if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!((n=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))!=null&&n.writable)?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}oM.isPlainObject=yee;var xee=oM.isPlainObject;const bee=zr(xee);var VC,YC,GC,XC,QC;function JC(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 ZC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JC(Object(n),!0).forEach(function(r){wee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wee(e,t,n){return(t=jee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jee(e){var t=See(e,"string");return typeof t=="symbol"?t:t+""}function See(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 xp(){return xp=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},xp.apply(null,arguments)}function Ks(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var eP=(e,t,n,r,i)=>{var a=n-r,l;return l=Wt(VC||(VC=Ks(["M ",",",""])),e,t),l+=Wt(YC||(YC=Ks(["L ",",",""])),e+n,t),l+=Wt(GC||(GC=Ks(["L ",",",""])),e+n-a/2,t+i),l+=Wt(XC||(XC=Ks(["L ",",",""])),e+n-a/2-r,t+i),l+=Wt(QC||(QC=Ks(["L ",","," Z"])),e,t),l},kee={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Cee=e=>{var t=Xt(e,kee),{x:n,y:r,upperWidth:i,lowerWidth:a,height:l,className:s}=t,{animationEasing:c,animationDuration:u,animationBegin:f,isUpdateAnimationActive:d}=t,p=h.useRef(null),[m,g]=h.useState(-1),y=h.useRef(i),x=h.useRef(a),v=h.useRef(l),b=h.useRef(n),w=h.useRef(r),j=fs(e,"trapezoid-");if(h.useEffect(()=>{if(p.current&&p.current.getTotalLength)try{var K=p.current.getTotalLength();K&&g(K)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||l!==+l||i===0&&a===0||l===0)return null;var C=tt("recharts-trapezoid",s);if(!d)return h.createElement("g",null,h.createElement("path",xp({},Ln(t),{className:C,d:eP(n,r,i,a,l)})));var S=y.current,E=x.current,I=v.current,R=b.current,A=w.current,_="0px ".concat(m===-1?1:m,"px"),N="".concat(m,"px ").concat(m,"px"),Y=gI(["strokeDasharray"],u,c);return h.createElement(ds,{animationId:j,key:j,canBegin:m>0,duration:u,easing:c,isActive:d,begin:f},K=>{var O=st(S,i,K),F=st(E,a,K),W=st(I,l,K),M=st(R,n,K),B=st(A,r,K);p.current&&(y.current=O,x.current=F,v.current=W,b.current=M,w.current=B);var k=K>0?{transition:Y,strokeDasharray:N}:{strokeDasharray:_};return h.createElement("path",xp({},Ln(t),{className:C,d:eP(M,B,O,F,W),ref:p,style:ZC(ZC({},k),t.style)}))})},Pee=["option","shapeType","activeClassName","inActiveClassName"];function Eee(e,t){if(e==null)return{};var n,r,i=Tee(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 Tee(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 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 bp(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){Oee(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 Oee(e,t,n){return(t=Aee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aee(e){var t=Iee(e,"string");return typeof t=="symbol"?t:t+""}function Iee(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 Nee(e,t){return bp(bp({},t),e)}function _ee(e,t){return e==="symbols"}function nP(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return h.createElement(bI,n);case"trapezoid":return h.createElement(Cee,n);case"sector":return h.createElement(kI,n);case"symbols":if(_ee(t))return h.createElement(e0,n);break;case"curve":return h.createElement(Ll,n);default:return null}}function Mee(e){return h.isValidElement(e)?e.props:e}function Ub(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=Eee(e,Pee),l;if(h.isValidElement(t))l=h.cloneElement(t,bp(bp({},a),Mee(t)));else if(typeof t=="function")l=t(a,a.index);else if(bee(t)&&typeof t!="boolean"){var s=Nee(t,a);l=h.createElement(nP,{shapeType:n,elementProps:s})}else{var c=a;l=h.createElement(nP,{shapeType:n,elementProps:c})}return a.isActive?h.createElement(Lt,{className:r},l):h.createElement(Lt,{className:i},l)}var Wb=(e,t,n)=>{var r=mt();return(i,a)=>l=>{e==null||e(i,a,l),r(d_({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Kb=e=>{var t=mt();return(n,r)=>i=>{e==null||e(n,r,i),t(UX())}},qb=(e,t,n)=>{var r=mt();return(i,a)=>l=>{e==null||e(i,a,l),r(WX({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function rm(e){var{tooltipEntrySettings:t}=e,n=mt(),r=xn(),i=h.useRef(null);return h.useLayoutEffect(()=>{r||(i.current===null?n(zX(t)):i.current!==t&&n($X({prev:i.current,next:t})),i.current=t)},[t,n,r]),h.useLayoutEffect(()=>()=>{i.current&&(n(BX(i.current)),i.current=null)},[n]),null}function Hb(e){var{legendPayload:t}=e,n=mt(),r=xn(),i=h.useRef(null);return h.useLayoutEffect(()=>{r||(i.current===null?n(dI(t)):i.current!==t&&n(fI({prev:i.current,next:t})),i.current=t)},[n,r,t]),h.useLayoutEffect(()=>()=>{i.current&&(n(pI(i.current)),i.current=null)},[n]),null}function Ree(e){var{legendPayload:t}=e,n=mt(),r=ke(Je),i=h.useRef(null);return h.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(dI(t)):i.current!==t&&n(fI({prev:i.current,next:t})),i.current=t)},[n,r,t]),h.useLayoutEffect(()=>()=>{i.current&&(n(pI(i.current)),i.current=null)},[n]),null}var xg,Dee=()=>{var[e]=h.useState(()=>Fc("uid-"));return e},Lee=(xg=GP.useId)!==null&&xg!==void 0?xg:Dee;function zee(e,t){var n=Lee();return t||(e?"".concat(e,"-").concat(n):n)}var $ee=h.createContext(void 0),im=e=>{var{id:t,type:n,children:r}=e,i=zee("recharts-".concat(n),t);return h.createElement($ee.Provider,{value:i},r(i))},Bee={cartesianItems:[],polarItems:[]},lM=$n({name:"graphicalItems",initialState:Bee,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Ct()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Nr(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Ct()},removeCartesianGraphicalItem:{reducer(e,t){var n=Nr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Ct()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Ct()},removePolarGraphicalItem:{reducer(e,t){var n=Nr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Ct()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Nr(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Ct()}}}),{addCartesianGraphicalItem:Fee,replaceCartesianGraphicalItem:Uee,removeCartesianGraphicalItem:Wee,addPolarGraphicalItem:Kee,removePolarGraphicalItem:qee,replacePolarGraphicalItem:Hee}=lM.actions,Vee=lM.reducer,Yee=e=>{var t=mt(),n=h.useRef(null);return h.useLayoutEffect(()=>{n.current===null?t(Fee(e)):n.current!==e&&t(Uee({prev:n.current,next:e})),n.current=e},[t,e]),h.useLayoutEffect(()=>()=>{n.current&&(t(Wee(n.current)),n.current=null)},[t]),null},Vb=h.memo(Yee),Gee=e=>{var t=mt(),n=h.useRef(null);return h.useLayoutEffect(()=>{n.current===null?t(Kee(e)):n.current!==e&&t(Hee({prev:n.current,next:e})),n.current=e},[t,e]),h.useLayoutEffect(()=>()=>{n.current&&(t(qee(n.current)),n.current=null)},[t]),null},Xee=h.memo(Gee),Qee=["key"],Jee=["onMouseEnter","onClick","onMouseLeave"],Zee=["id"],ete=["id"];function $a(){return $a=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},$a.apply(null,arguments)}function am(e,t){if(e==null)return{};var n,r,i=tte(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 tte(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 rP(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 Ot(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rP(Object(n),!0).forEach(function(r){nte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nte(e,t,n){return(t=rte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rte(e){var t=ite(e,"string");return typeof t=="symbol"?t:t+""}function ite(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 ate(e){var t=h.useMemo(()=>Bb(e.children,Du),[e.children]),n=ke(r=>pee(r,e.id,t));return n==null?null:h.createElement(Ree,{legendPayload:n})}function ote(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(h.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var lte=h.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:l,name:s,hide:c,tooltipType:u,id:f,activeShape:d}=e,p=ote(d),m=r.map(y=>{var x=y.tooltipPayload;return p==null||x==null?x:x.map(v=>Ot(Ot({},v),{},{color:p,fill:p}))}),g={dataDefinedOnItem:m,getPosition:y=>{var x;return(x=r[Number(y)])===null||x===void 0?void 0:x.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:l,dataKey:t,nameKey:n,name:Ha(s,t),hide:c,type:u,color:l,unit:"",graphicalItemId:f}};return h.createElement(rm,{tooltipEntrySettings:g})}),ste=(e,t)=>e>t?"start":e<t?"end":"middle",cte=(e,t,n)=>Rn(typeof t=="function"?t(e):t,n,n*.8),ute=(e,t,n)=>{var{top:r,left:i,width:a,height:l}=t,s=wI(a,l),c=i+Rn(e.cx,a,a/2),u=r+Rn(e.cy,l,l/2),f=Rn(e.innerRadius,s,0),d=cte(n,e.outerRadius,s),p=e.maxRadius||Math.sqrt(a*a+l*l)/2;return{cx:c,cy:u,innerRadius:f,outerRadius:d,maxRadius:p}},dte=(e,t)=>{var n=vn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},fte=(e,t)=>{if(h.isValidElement(e))return h.cloneElement(e,t);if(typeof e=="function")return e(t);var n=tt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=am(t,Qee);return h.createElement(Ll,$a({},i,{type:"linear",className:n}))},pte=(e,t,n)=>{if(h.isValidElement(e))return h.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),h.isValidElement(r)))return r;var i=tt("recharts-pie-label-text",nM(e));return h.createElement(Wh,$a({},t,{alignmentBaseline:"middle",className:i}),r)};function hte(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:l}=n;if(!r||!i||!t)return null;var s=qn(n),c=Do(i),u=Do(a),f=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,d=t.map((p,m)=>{var g=(p.startAngle+p.endAngle)/2,y=tn(p.cx,p.cy,p.outerRadius+f,g),x=Ot(Ot(Ot(Ot({},s),p),{},{stroke:"none"},c),{},{index:m,textAnchor:ste(y.x,p.cx)},y),v=Ot(Ot(Ot(Ot({},s),p),{},{fill:"none",stroke:p.fill},u),{},{index:m,points:[tn(p.cx,p.cy,p.outerRadius,g),y],key:"line"});return h.createElement(Gn,{zIndex:Gt.label,key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(m)},h.createElement(Lt,null,a&&fte(a,v),pte(i,x,it(p,l))))});return h.createElement(Lt,{className:"recharts-pie-labels"},d)}function mte(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?h.createElement(Kh,{label:i}):h.createElement(hte,{sectors:t,props:n,showLabels:r})}function gte(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:l}=e,s=ke(za),c=ke(Ob),u=ke(E_),{onMouseEnter:f,onClick:d,onMouseLeave:p}=i,m=am(i,Jee),g=Wb(f,i.dataKey,l),y=Kb(p),x=qb(d,i.dataKey,l);return t==null||t.length===0?null:h.createElement(h.Fragment,null,t.map((v,b)=>{if((v==null?void 0:v.startAngle)===0&&(v==null?void 0:v.endAngle)===0&&t.length!==1)return null;var w=u==null||u===l,j=String(b)===s&&(c==null||i.dataKey===c)&&w,C=s?r:null,S=n&&j?n:C,E=Ot(Ot({},v),{},{stroke:v.stroke,tabIndex:-1,[YA]:b,[GA]:l});return h.createElement(Lt,$a({key:"sector-".concat(v==null?void 0:v.startAngle,"-").concat(v==null?void 0:v.endAngle,"-").concat(v.midAngle,"-").concat(b),tabIndex:-1,className:"recharts-pie-sector"},hu(m,v,b),{onMouseEnter:g(v,b),onMouseLeave:y(v,b),onClick:x(v,b)}),h.createElement(Ub,$a({option:a??S,index:b,shapeType:"sector",isActive:j},E)))}))}function vte(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:l,startAngle:s,endAngle:c,dataKey:u,nameKey:f,tooltipType:d}=n,p=Math.abs(n.minAngle),m=dte(s,c),g=Math.abs(m),y=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,x=r.filter(I=>it(I,u,0)!==0).length,v=(g>=360?x:x-1)*y,b=r.reduce((I,R)=>{var A=it(R,u,0);return I+(ve(A)?A:0)},0),w=p>0&&b>0&&r.some(I=>{var R=it(I,u,0),A=(ve(R)?R:0)/b;return R!==0&&A*g<p}),j=w?p:0,C=g-x*j-v,S;if(b>0){var E;S=r.map((I,R)=>{var A=it(I,u,0),_=it(I,f,R),N=ute(n,a,I),Y=(ve(A)?A:0)/b,K,O=Ot(Ot({},I),i&&i[R]&&i[R].props),F=O!=null&&"fill"in O&&typeof O.fill=="string"?O.fill:n.fill;R?K=E.endAngle+vn(m)*y*(A!==0?1:0):K=s;var W=K+vn(m)*((A!==0?j:0)+Y*C),M=(K+W)/2,B=(N.innerRadius+N.outerRadius)/2,k=[{name:_,value:A,payload:O,dataKey:u,type:d,color:F,fill:F,graphicalItemId:n.id}],L=tn(N.cx,N.cy,B,M);return E=Ot(Ot(Ot(Ot({},n.presentationProps),{},{percent:Y,cornerRadius:typeof l=="string"?parseFloat(l):l,name:_,tooltipPayload:k,midAngle:M,middleRadius:B,tooltipPosition:L},O),N),{},{value:A,dataKey:u,startAngle:K,endAngle:W,payload:O,paddingAngle:A!==0?vn(m)*y:0}),E})}return S}function yte(e){var{showLabels:t,sectors:n,children:r}=e,i=h.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 h.createElement(XZ,{value:t?i:void 0},r)}function xte(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:l,animationDuration:s,animationEasing:c,activeShape:u,inactiveShape:f,onAnimationStart:d,onAnimationEnd:p}=t,m=fs(t,"recharts-pie-"),g=n.current,[y,x]=h.useState(!1),v=h.useCallback(()=>{typeof p=="function"&&p(),x(!1)},[p]),b=h.useCallback(()=>{typeof d=="function"&&d(),x(!0)},[d]);return h.createElement(yte,{showLabels:!y,sectors:i},h.createElement(ds,{animationId:m,begin:l,duration:s,isActive:a,easing:c,onAnimationStart:b,onAnimationEnd:v,key:m},w=>{var j,C=[],S=i&&i[0],E=(j=S==null?void 0:S.startAngle)!==null&&j!==void 0?j:0;return i==null||i.forEach((I,R)=>{var A=g&&g[R],_=R>0?zo(I,"paddingAngle",0):0;if(A){var N=st(A.endAngle-A.startAngle,I.endAngle-I.startAngle,w),Y=Ot(Ot({},I),{},{startAngle:E+_,endAngle:E+N+_});C.push(Y),E=Y.endAngle}else{var{endAngle:K,startAngle:O}=I,F=st(0,K-O,w),W=Ot(Ot({},I),{},{startAngle:E+_,endAngle:E+F+_});C.push(W),E=W.endAngle}}),n.current=C,h.createElement(Lt,null,h.createElement(gte,{sectors:C,activeShape:u,inactiveShape:f,allOtherPieProps:t,shape:t.shape,id:r}))}),h.createElement(mte,{showLabels:!y,sectors:i,props:t}),t.children)}var bte={animationBegin:400,animationDuration:1500,animationEasing:"ease",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,startAngle:0,stroke:"#fff",zIndex:Gt.area};function wte(e){var{id:t}=e,n=am(e,Zee),{hide:r,className:i,rootTabIndex:a}=e,l=h.useMemo(()=>Bb(e.children,Du),[e.children]),s=ke(f=>hee(f,t,l)),c=h.useRef(null),u=tt("recharts-pie",i);return r||s==null?(c.current=null,h.createElement(Lt,{tabIndex:a,className:u})):h.createElement(Gn,{zIndex:e.zIndex},h.createElement(lte,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:s,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),h.createElement(Lt,{tabIndex:a,className:u},h.createElement(xte,{props:Ot(Ot({},n),{},{sectors:s}),previousSectorsRef:c,id:t})))}function jte(e){var t=Xt(e,bte),{id:n}=t,r=am(t,ete),i=qn(r);return h.createElement(im,{id:n,type:"pie"},a=>h.createElement(h.Fragment,null,h.createElement(Xee,{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}),h.createElement(ate,$a({},r,{id:a})),h.createElement(wte,$a({},r,{id:a}))))}var sM=jte;sM.displayName="Pie";var Ste=["points"];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 bg(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){kte(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 kte(e,t,n){return(t=Cte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cte(e){var t=Pte(e,"string");return typeof t=="symbol"?t:t+""}function Pte(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 wp(){return wp=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},wp.apply(null,arguments)}function Ete(e,t){if(e==null)return{};var n,r,i=Tte(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 Tte(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 Ote(e){var{option:t,dotProps:n,className:r}=e;if(h.isValidElement(t))return h.cloneElement(t,n);if(typeof t=="function")return t(n);var i=tt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:l}=a,s=Ete(a,Ste);return h.createElement(J_,wp({},s,{className:i}))}function Ate(e,t){return e==null?!1:t?!0:e.length===1}function cM(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:l,needClip:s,clipPathId:c,zIndex:u=Gt.scatter}=e;if(!Ate(t,n))return null;var f=Fb(n),d=o5(n),p=t.map((g,y)=>{var x,v,b=bg(bg(bg({r:3},l),d),{},{index:y,cx:(x=g.x)!==null&&x!==void 0?x:void 0,cy:(v=g.y)!==null&&v!==void 0?v:void 0,dataKey:a,value:g.value,payload:g.payload,points:t});return h.createElement(Ote,{key:"dot-".concat(y),option:n,dotProps:b,className:i})}),m={};return s&&c!=null&&(m.clipPath="url(#clipPath-".concat(f?"":"dots-").concat(c,")")),h.createElement(Gn,{zIndex:u},h.createElement(Lt,wp({className:r},m),p))}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 oP(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){Ite(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 Ite(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=_te(e,"string");return typeof t=="symbol"?t:t+""}function _te(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 uM=0,Mte={xAxis:{},yAxis:{},zAxis:{}},dM=$n({name:"cartesianAxis",initialState:Mte,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Ct()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:Ct()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Ct()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Ct()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:Ct()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Ct()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Ct()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:Ct()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Ct()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((a=l[0])!==null&&a!==void 0?a:0))<=1)return;var s=[...l,r].slice(-3);e.yAxis[n]=oP(oP({},i),{},{width:r,widthHistory:s})}}}}),{addXAxis:Rte,replaceXAxis:Dte,removeXAxis:Lte,addYAxis:zte,replaceYAxis:$te,removeYAxis:Bte,addZAxis:ole,replaceZAxis:lle,removeZAxis:sle,updateYAxisWidth:Fte}=dM.actions,Ute=dM.reducer,Wte=q([cn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Kte=q([Wte,ta,na],(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)}}),om=()=>ke(Kte),qte=()=>ke(LQ);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 wg(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){Hte(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 Hte(e,t,n){return(t=Vte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vte(e){var t=Yte(e,"string");return typeof t=="symbol"?t:t+""}function Yte(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 Gte=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var s={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=wg(wg(wg({},s),Do(i)),t0(i)),u;return h.isValidElement(i)?u=h.cloneElement(i,c):typeof i=="function"?u=i(c):u=h.createElement(J_,c),h.createElement(Lt,{className:"recharts-active-dot",clipPath:l},u)};function ky(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:l=Gt.activeDot}=e,s=ke(za),c=qte();if(t==null||c==null)return null;var u=t.find(f=>c.includes(f.payload));return Tt(u)?null:h.createElement(Gn,{zIndex:l},h.createElement(Gte,{point:u,childIndex:Number(s),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var sP=(e,t,n)=>{var r=n??e;if(!Tt(r))return Rn(r,t,0)},Xte=(e,t,n)=>{var r={},i=e.filter(Oh),a=e.filter(u=>u.stackId==null),l=i.reduce((u,f)=>{var d=u[f.stackId];return d==null&&(d=[]),d.push(f),u[f.stackId]=d,u},r),s=Object.entries(l).map(u=>{var f,[d,p]=u,m=p.map(y=>y.dataKey),g=sP(t,n,(f=p[0])===null||f===void 0?void 0:f.barSize);return{stackId:d,dataKeys:m,barSize:g}}),c=a.map(u=>{var f=[u.dataKey].filter(p=>p!=null),d=sP(t,n,u.barSize);return{stackId:void 0,dataKeys:f,barSize:d}});return[...s,...c]};function cP(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 Od(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cP(Object(n),!0).forEach(function(r){Qte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qte(e,t,n){return(t=Jte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jte(e){var t=Zte(e,"string");return typeof t=="symbol"?t:t+""}function Zte(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 ene(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var s=Rn(e,n,0,!0),c,u=[];if(Ue((a=r[0])===null||a===void 0?void 0:a.barSize)){var f=!1,d=n/l,p=r.reduce((b,w)=>b+(w.barSize||0),0);p+=(l-1)*s,p>=n&&(p-=(l-1)*s,s=0),p>=n&&d>0&&(f=!0,d*=.9,p=l*d);var m=(n-p)/2>>0,g={offset:m-s,size:0};c=r.reduce((b,w)=>{var j,C={stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:g.offset+g.size+s,size:f?d:(j=w.barSize)!==null&&j!==void 0?j:0}},S=[...b,C];return g=C.position,S},u)}else{var y=Rn(t,n,0,!0);n-2*y-(l-1)*s<=0&&(s=0);var x=(n-2*y-(l-1)*s)/l;x>1&&(x>>=0);var v=Ue(i)?Math.min(x,i):x;c=r.reduce((b,w,j)=>[...b,{stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:y+(x+s)*j+(x-v)/2,size:v}}],u)}return c}}var tne=(e,t,n,r,i,a,l)=>{var s=Tt(l)?t:l,c=ene(n,r,i!==a?i:a,e,s);return i!==a&&c!=null&&(c=c.map(u=>Od(Od({},u),{},{position:Od(Od({},u.position),{},{offset:u.position.offset-i/2})}))),c},nne=(e,t)=>{var n=Th(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(l=>l.key===n)}}}},rne=(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 ine(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ue(e.zIndex)?e.zIndex:t}var fM=e=>{var{chartData:t}=e,n=mt(),r=xn();return h.useEffect(()=>r?()=>{}:(n(SC(t)),()=>{n(SC(void 0))}),[t,n,r]),null},uP={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},pM=$n({name:"brush",initialState:uP,reducers:{setBrushSettings(e,t){return t.payload==null?uP:t.payload}}}),{setBrushSettings:cle}=pM.actions,ane=pM.reducer;function one(e){return(e%180+180)%180}var lne=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=one(i),l=a*Math.PI/180,s=Math.atan(r/n),c=l>s&&l<Math.PI-s?r/Math.sin(l):n/Math.cos(l);return Math.abs(c)},sne={dots:[],areas:[],lines:[]},hM=$n({name:"referenceElements",initialState:sne,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Nr(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=Nr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=Nr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:ule,removeDot:dle,addArea:fle,removeArea:ple,addLine:hle,removeLine:mle}=hM.actions,cne=hM.reducer,une=h.createContext(void 0),dne=e=>{var{children:t}=e,[n]=h.useState("".concat(Fc("recharts"),"-clip")),r=om();if(r==null)return null;var{x:i,y:a,width:l,height:s}=r;return h.createElement(une.Provider,{value:n},h.createElement("defs",null,h.createElement("clipPath",{id:n},h.createElement("rect",{x:i,y:a,height:s,width:l}))),t)};function mM(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 fne(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return lne(r,n)}function pne(e,t,n){var r=n==="width",{x:i,y:a,width:l,height:s}=e;return t===1?{start:r?i:a,end:r?i+l:a+s}:{start:r?i+l:a+s,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 hne(e,t){return mM(e,t+1)}function mne(e,t,n,r,i){for(var a=(r||[]).slice(),{start:l,end:s}=t,c=0,u=1,f=l,d=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:mM(r,u)};var y=c,x,v=()=>(x===void 0&&(x=n(g,y)),x),b=g.coordinate,w=c===0||tu(e,b,v,f,s);w||(c=0,f=l,u+=1),w&&(f=b+e*(v()/2+i),c+=u)},p;u<=a.length;)if(p=d(),p)return p.v;return[]}function gne(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var{start:s,end:c}=t,u=1;u<=l;u++){for(var f=(l-1)%u,d=s,p=!0,m=function(){var j=r[y];if(j==null)return 0;var C=y,S,E=()=>(S===void 0&&(S=n(j,C)),S),I=j.coordinate,R=y===f||tu(e,I,E,d,c);if(!R)return p=!1,1;R&&(d=I+e*(E()/2+i))},g,y=f;y<l&&(g=m(),!(g!==0&&g===1));y+=u);if(p){for(var x=[],v=f;v<l;v+=u){var b=r[v];b!=null&&x.push(b)}return x}}return[]}function dP(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 Nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dP(Object(n),!0).forEach(function(r){vne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vne(e,t,n){return(t=yne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yne(e){var t=xne(e,"string");return typeof t=="symbol"?t:t+""}function xne(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 bne(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,{start:s}=t,{end:c}=t,u=function(p){var m=a[p];if(m==null)return 1;var g=m,y,x=()=>(y===void 0&&(y=n(m,p)),y);if(p===l-1){var v=e*(g.coordinate+e*x()/2-c);a[p]=g=Nn(Nn({},g),{},{tickCoord:v>0?g.coordinate-v*e:g.coordinate})}else a[p]=g=Nn(Nn({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var b=tu(e,g.tickCoord,x,s,c);b&&(c=g.tickCoord-e*(x()/2+i),a[p]=Nn(Nn({},g),{},{isShow:!0}))}},f=l-1;f>=0;f--)u(f);return a}function wne(e,t,n,r,i,a){var l=(r||[]).slice(),s=l.length,{start:c,end:u}=t;if(a){var f=r[s-1];if(f!=null){var d=n(f,s-1),p=e*(f.coordinate+e*d/2-u);if(l[s-1]=f=Nn(Nn({},f),{},{tickCoord:p>0?f.coordinate-p*e:f.coordinate}),f.tickCoord!=null){var m=tu(e,f.tickCoord,()=>d,c,u);m&&(u=f.tickCoord-e*(d/2+i),l[s-1]=Nn(Nn({},f),{},{isShow:!0}))}}}for(var g=a?s-1:s,y=function(b){var w=l[b];if(w==null)return 1;var j=w,C,S=()=>(C===void 0&&(C=n(w,b)),C);if(b===0){var E=e*(j.coordinate-e*S()/2-c);l[b]=j=Nn(Nn({},j),{},{tickCoord:E<0?j.coordinate-E*e:j.coordinate})}else l[b]=j=Nn(Nn({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var I=tu(e,j.tickCoord,S,c,u);I&&(c=j.tickCoord+e*(S()/2+i),l[b]=Nn(Nn({},j),{},{isShow:!0}))}},x=0;x<g;x++)y(x);return l}function Yb(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:l,orientation:s,interval:c,tickFormatter:u,unit:f,angle:d}=e;if(!i||!i.length||!r)return[];if(ve(c)||ju.isSsr){var p;return(p=hne(i,ve(c)?c:0))!==null&&p!==void 0?p:[]}var m=[],g=s==="top"||s==="bottom"?"width":"height",y=f&&g==="width"?yc(f,{fontSize:t,letterSpacing:n}):{width:0,height:0},x=(C,S)=>{var E=typeof u=="function"?u(C.value,S):C.value;return g==="width"?fne(yc(E,{fontSize:t,letterSpacing:n}),y,d):yc(E,{fontSize:t,letterSpacing:n})[g]},v=i[0],b=i[1],w=i.length>=2&&v!=null&&b!=null?vn(b.coordinate-v.coordinate):1,j=pne(a,w,g);return c==="equidistantPreserveStart"?mne(w,j,x,i,l):c==="equidistantPreserveEnd"?gne(w,j,x,i,l):(c==="preserveStart"||c==="preserveStartEnd"?m=wne(w,j,x,i,l,c==="preserveStartEnd"):m=bne(w,j,x,i,l),m.filter(C=>C.isShow))}var jne=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,l=0;if(t){Array.from(t).forEach(f=>{if(f){var d=f.getBoundingClientRect();d.width>l&&(l=d.width)}});var s=n?n.getBoundingClientRect().width:0,c=i+a,u=l+c+s+(n?r:0);return Math.round(u)}return 0},Sne={xAxis:{},yAxis:{}},gM=$n({name:"renderedTicks",initialState:Sne,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:kne,removeRenderedTicks:Cne}=gM.actions,Pne=gM.reducer,Ene=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Tne(e,t){if(e==null)return{};var n,r,i=One(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 One(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 qo(){return qo=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},qo.apply(null,arguments)}function fP(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 Ut(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fP(Object(n),!0).forEach(function(r){Ane(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ane(e,t,n){return(t=Ine(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ine(e){var t=Nne(e,"string");return typeof t=="symbol"?t:t+""}function Nne(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 Wi={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:Gt.axis};function _ne(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:l,axisLine:s,otherSvgProps:c}=e;if(!s)return null;var u=Ut(Ut(Ut({},c),qn(s)),{},{fill:"none"});if(a==="top"||a==="bottom"){var f=+(a==="top"&&!l||a==="bottom"&&l);u=Ut(Ut({},u),{},{x1:t,y1:n+f*i,x2:t+r,y2:n+f*i})}else{var d=+(a==="left"&&!l||a==="right"&&l);u=Ut(Ut({},u),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return h.createElement("line",qo({},u,{className:tt("recharts-cartesian-axis-line",zo(s,"className"))}))}function Mne(e,t,n,r,i,a,l,s,c){var u,f,d,p,m,g,y=s?-1:1,x=e.tickSize||l,v=ve(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=f=e.coordinate,p=n+ +!s*i,d=p-y*x,g=d-y*c,m=v;break;case"left":d=p=e.coordinate,f=t+ +!s*r,u=f-y*x,m=u-y*c,g=v;break;case"right":d=p=e.coordinate,f=t+ +s*r,u=f+y*x,m=u+y*c,g=v;break;default:u=f=e.coordinate,p=n+ +s*i,d=p+y*x,g=d+y*c,m=v;break}return{line:{x1:u,y1:d,x2:f,y2:p},tick:{x:m,y:g}}}function Rne(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Dne(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Lne(e){var{option:t,tickProps:n,value:r}=e,i,a=tt(n.className,"recharts-cartesian-axis-tick-value");if(h.isValidElement(t))i=h.cloneElement(t,Ut(Ut({},n),{},{className:a}));else if(typeof t=="function")i=t(Ut(Ut({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=tt(l,nM(t))),i=h.createElement(Wh,qo({},n,{className:l}),r)}return i}function zne(e){var{ticks:t,axisType:n,axisId:r}=e,i=mt();return h.useEffect(()=>{if(r==null||n==null)return qa;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(kne({ticks:a,axisId:r,axisType:n})),()=>{i(Cne({axisId:r,axisType:n}))}},[i,t,r,n]),null}var $ne=h.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:l,unit:s,padding:c,tickTextProps:u,orientation:f,mirror:d,x:p,y:m,width:g,height:y,tickSize:x,tickMargin:v,fontSize:b,letterSpacing:w,getTicksConfig:j,events:C,axisType:S,axisId:E}=e,I=Yb(Ut(Ut({},j),{},{ticks:n}),b,w),R=qn(j),A=Do(r),_=K_(R.textAnchor)?R.textAnchor:Rne(f,d),N=Dne(f,d),Y={};typeof i=="object"&&(Y=i);var K=Ut(Ut({},R),{},{fill:"none"},Y),O=I.map(M=>Ut({entry:M},Mne(M,p,m,g,y,f,x,d,v))),F=O.map(M=>{var{entry:B,line:k}=M;return h.createElement(Lt,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(B.value,"-").concat(B.coordinate,"-").concat(B.tickCoord)},i&&h.createElement("line",qo({},K,k,{className:tt("recharts-cartesian-axis-tick-line",zo(i,"className"))})))}),W=O.map((M,B)=>{var k,L,{entry:X,tick:T}=M,ce=Ut(Ut(Ut(Ut({verticalAnchor:N},R),{},{textAnchor:_,stroke:"none",fill:a},T),{},{index:B,payload:X,visibleTicksCount:I.length,tickFormatter:l,padding:c},u),{},{angle:(k=(L=u==null?void 0:u.angle)!==null&&L!==void 0?L:R.angle)!==null&&k!==void 0?k:0}),ge=Ut(Ut({},ce),A);return h.createElement(Lt,qo({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(X.value,"-").concat(X.coordinate,"-").concat(X.tickCoord)},hu(C,X,B)),r&&h.createElement(Lne,{option:r,tickProps:ge,value:"".concat(typeof l=="function"?l(X.value,B):X.value).concat(s||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(S,"-ticks")},h.createElement(zne,{ticks:I,axisId:E,axisType:S}),W.length>0&&h.createElement(Gn,{zIndex:Gt.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(S,"-tick-labels"),ref:t},W)),F.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(S,"-tick-lines")},F))}),Bne=h.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:s,axisType:c,axisId:u}=e,f=Tne(e,Ene),[d,p]=h.useState(""),[m,g]=h.useState(""),y=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return jne({ticks:y.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var x=h.useCallback(v=>{if(v){var b=v.getElementsByClassName("recharts-cartesian-axis-tick-value");y.current=b;var w=b[0];if(w){var j=window.getComputedStyle(w),C=j.fontSize,S=j.letterSpacing;(C!==d||S!==m)&&(p(C),g(S))}}},[d,m]);return l||r!=null&&r<=0||i!=null&&i<=0?null:h.createElement(Gn,{zIndex:e.zIndex},h.createElement(Lt,{className:tt("recharts-cartesian-axis",a)},h.createElement(_ne,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:qn(e)}),h.createElement($ne,{ref:x,axisType:c,events:f,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:m,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:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),h.createElement(RZ,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(qZ,{label:e.label,labelRef:e.labelRef}),e.children)))}),Gb=h.forwardRef((e,t)=>{var n=Xt(e,Wi);return h.createElement(Bne,qo({},n,{ref:t}))});Gb.displayName="CartesianAxis";var Fne=["x1","y1","x2","y2","key"],Une=["offset"],Wne=["xAxisId","yAxisId"],Kne=["xAxisId","yAxisId"];function pP(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 Mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pP(Object(n),!0).forEach(function(r){qne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qne(e,t,n){return(t=Hne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hne(e){var t=Vne(e,"string");return typeof t=="symbol"?t:t+""}function Vne(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 So(){return So=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},So.apply(null,arguments)}function jp(e,t){if(e==null)return{};var n,r,i=Yne(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 Yne(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 Gne=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:l,ry:s}=e;return h.createElement("rect",{x:r,y:i,ry:s,width:a,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function vM(e){var{option:t,lineItemProps:n}=e,r;if(h.isValidElement(t))r=h.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:l,x2:s,y2:c,key:u}=n,f=jp(n,Fne),d=(i=qn(f))!==null&&i!==void 0?i:{},{offset:p}=d,m=jp(d,Une);r=h.createElement("line",So({},m,{x1:a,y1:l,x2:s,y2:c,fill:"none",key:u}))}return r}function Xne(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,s=jp(e,Wne),c=i.map((u,f)=>{var d=Mn(Mn({},s),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(f),index:f});return h.createElement(vM,{key:"line-".concat(f),option:r,lineItemProps:d})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function Qne(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,s=jp(e,Kne),c=i.map((u,f)=>{var d=Mn(Mn({},s),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(f),index:f});return h.createElement(vM,{option:r,lineItemProps:d,key:"line-".concat(f)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function Jne(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:l,horizontalPoints:s,horizontal:c=!0}=e;if(!c||!t||!t.length||s==null)return null;var u=s.map(d=>Math.round(d+i-i)).sort((d,p)=>d-p);i!==u[0]&&u.unshift(0);var f=u.map((d,p)=>{var m=u[p+1],g=m==null,y=g?i+l-d:m-d;if(y<=0)return null;var x=p%t.length;return h.createElement("rect",{key:"react-".concat(p),y:d,x:r,height:y,width:a,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Zne(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:l,height:s,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var u=c.map(d=>Math.round(d+i-i)).sort((d,p)=>d-p);i!==u[0]&&u.unshift(0);var f=u.map((d,p)=>{var m=u[p+1],g=m==null,y=g?i+l-d:m-d;if(y<=0)return null;var x=p%n.length;return h.createElement("rect",{key:"react-".concat(p),x:d,y:a,width:y,height:s,stroke:"none",fill:n[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var ere=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return KA(Yb(Mn(Mn(Mn({},Wi),n),{},{ticks:qA(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},tre=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return KA(Yb(Mn(Mn(Mn({},Wi),n),{},{ticks:qA(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},nre={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Gt.grid};function tc(e){var t=w0(),n=j0(),r=nI(),i=Mn(Mn({},Xt(e,nre)),{},{x:ve(e.x)?e.x:r.left,y:ve(e.y)?e.y:r.top,width:ve(e.width)?e.width:r.width,height:ve(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:l,x:s,y:c,width:u,height:f,syncWithTicks:d,horizontalValues:p,verticalValues:m}=i,g=xn(),y=ke(R=>dC(R,"xAxis",a,g)),x=ke(R=>dC(R,"yAxis",l,g));if(!ki(u)||!ki(f)||!ve(s)||!ve(c))return null;var v=i.verticalCoordinatesGenerator||ere,b=i.horizontalCoordinatesGenerator||tre,{horizontalPoints:w,verticalPoints:j}=i;if((!w||!w.length)&&typeof b=="function"){var C=p&&p.length,S=b({yAxis:x?Mn(Mn({},x),{},{ticks:C?p:x.ticks}):void 0,width:t??u,height:n??f,offset:r},C?!0:d);Hf(Array.isArray(S),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof S,"]")),Array.isArray(S)&&(w=S)}if((!j||!j.length)&&typeof v=="function"){var E=m&&m.length,I=v({xAxis:y?Mn(Mn({},y),{},{ticks:E?m:y.ticks}):void 0,width:t??u,height:n??f,offset:r},E?!0:d);Hf(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof I,"]")),Array.isArray(I)&&(j=I)}return h.createElement(Gn,{zIndex:i.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(Gne,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),h.createElement(Jne,So({},i,{horizontalPoints:w})),h.createElement(Zne,So({},i,{verticalPoints:j})),h.createElement(Xne,So({},i,{offset:r,horizontalPoints:w,xAxis:y,yAxis:x})),h.createElement(Qne,So({},i,{offset:r,verticalPoints:j,xAxis:y,yAxis:x}))))}tc.displayName="CartesianGrid";var rre={},yM=$n({name:"errorBars",initialState:rre,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:gle,replaceErrorBar:vle,removeErrorBar:yle}=yM.actions,ire=yM.reducer,are=["children"];function ore(e,t){if(e==null)return{};var n,r,i=lre(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 lre(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 sre={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},cre=h.createContext(sre);function xM(e){var{children:t}=e,n=ore(e,are);return h.createElement(cre.Provider,{value:n},t)}function lm(e,t){var n,r,i=ke(u=>ia(u,e)),a=ke(u=>aa(u,t)),l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:rn.allowDataOverflow,s=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:an.allowDataOverflow,c=l||s;return{needClip:c,needClipX:l,needClipY:s}}function Xb(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=om(),{needClipX:a,needClipY:l,needClip:s}=lm(t,n);if(!s||!i)return null;var{x:c,y:u,width:f,height:d}=i;return h.createElement("clipPath",{id:"clipPath-".concat(r)},h.createElement("rect",{x:a?c:c-f/2,y:l?u:u-d/2,width:a?f:f*2,height:l?d:d*2}))}var bM=(e,t,n,r)=>Ti(e,"xAxis",t,r),wM=(e,t,n,r)=>Ei(e,"xAxis",t,r),jM=(e,t,n,r)=>Ti(e,"yAxis",n,r),SM=(e,t,n,r)=>Ei(e,"yAxis",n,r),ure=q([Je,bM,jM,wM,SM],(e,t,n,r,i)=>ti(e,"xAxis")?La(t,r,!1):La(n,i,!1)),dre=(e,t,n,r,i)=>i;function fre(e){return e.type==="line"}var pre=q([Iu,dre],(e,t)=>e.filter(fre).find(n=>n.id===t)),hre=q([Je,bM,jM,wM,SM,pre,ure,ku],(e,t,n,r,i,a,l,s)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:f}=s;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:d,data:p}=a,m;if(p!=null&&p.length>0?m=p:m=c==null?void 0:c.slice(u,f+1),m!=null)return Mre({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:l,displayedData:m})}});function kM(e){var t=Do(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,l=Number(i),s=Number(a);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(s)||s<0)&&(s=r),{r:l,strokeWidth:s}}return{r:n,strokeWidth:r}}var mre=["id"],gre=["type","layout","connectNulls","needClip","shape"],vre=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function nu(){return nu=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},nu.apply(null,arguments)}function hP(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 pi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hP(Object(n),!0).forEach(function(r){yre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yre(e,t,n){return(t=xre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xre(e){var t=bre(e,"string");return typeof t=="symbol"?t:t+""}function bre(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 Qb(e,t){if(e==null)return{};var n,r,i=wre(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 wre(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 jre=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ha(n,t),payload:e}]},Sre=h.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:s,unit:c,tooltipType:u,id:f}=e,d={dataDefinedOnItem:n,getPosition:qa,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Ha(l,t),hide:s,type:u,color:r,unit:c,graphicalItemId:f}};return h.createElement(rm,{tooltipEntrySettings:d})}),CM=(e,t)=>"".concat(t,"px ").concat(e,"px");function kre(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var Cre=(e,t,n)=>{var r=n.reduce((p,m)=>p+m,0);if(!r)return CM(t,e);for(var i=Math.floor(e/r),a=e%r,l=[],s=0,c=0;s<n.length;c+=(u=n[s])!==null&&u!==void 0?u:0,++s){var u,f=n[s];if(f!=null&&c+f>a){l=[...n.slice(0,s),a-c];break}}var d=l.length%2===0?[0,t]:[t];return[...kre(n,i),...l,...d].map(p=>"".concat(p,"px")).join(", ")};function Pre(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:l}=r,{id:s}=r,c=Qb(r,mre),u=qn(c);return h.createElement(cM,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:l,clipPathId:t})}function Ere(e){var{showLabels:t,children:n,points:r}=e,i=h.useMemo(()=>r==null?void 0:r.map(a=>{var l,s,c={x:(l=a.x)!==null&&l!==void 0?l:0,y:(s=a.y)!==null&&s!==void 0?s:0,width:0,lowerWidth:0,upperWidth:0,height:0};return pi(pi({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return h.createElement(Rb,{value:t?i:void 0},n)}function mP(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:l,layout:s,connectNulls:c,needClip:u,shape:f}=a,d=Qb(a,gre),p=pi(pi({},Ln(d)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:r,type:l,layout:s,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return h.createElement(h.Fragment,null,(r==null?void 0:r.length)>1&&h.createElement(Ub,nu({shapeType:"curve",option:f},p,{pathRef:n})),h.createElement(Pre,{points:r,clipPathId:t,props:a}))}function Tre(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Ore(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:l,strokeDasharray:s,isAnimationActive:c,animationBegin:u,animationDuration:f,animationEasing:d,animateNewValues:p,width:m,height:g,onAnimationEnd:y,onAnimationStart:x}=n,v=i.current,b=fs(l,"recharts-line-"),w=h.useRef(b),[j,C]=h.useState(!1),S=!j,E=h.useCallback(()=>{typeof y=="function"&&y(),C(!1)},[y]),I=h.useCallback(()=>{typeof x=="function"&&x(),C(!0)},[x]),R=Tre(r.current),A=h.useRef(0);w.current!==b&&(A.current=a.current,w.current=b);var _=A.current;return h.createElement(Ere,{points:l,showLabels:S},n.children,h.createElement(ds,{animationId:b,begin:u,duration:f,isActive:c,easing:d,onAnimationEnd:E,onAnimationStart:I,key:b},N=>{var Y=st(_,R+_,N),K=Math.min(Y,R),O;if(c)if(s){var F="".concat(s).split(/[,\s]+/gim).map(B=>parseFloat(B));O=Cre(K,R,F)}else O=CM(R,K);else O=s==null?void 0:String(s);if(N>0&&R>0&&(i.current=l,a.current=Math.max(a.current,K)),v){var W=v.length/l.length,M=N===1?l:l.map((B,k)=>{var L=Math.floor(k*W);if(v[L]){var X=v[L];return pi(pi({},B),{},{x:st(X.x,B.x,N),y:st(X.y,B.y,N)})}return p?pi(pi({},B),{},{x:st(m*2,B.x,N),y:st(g/2,B.y,N)}):pi(pi({},B),{},{x:B.x,y:B.y})});return i.current=M,h.createElement(mP,{props:n,points:M,clipPathId:t,pathRef:r,strokeDasharray:O})}return h.createElement(mP,{props:n,points:l,clipPathId:t,pathRef:r,strokeDasharray:O})}),h.createElement(Kh,{label:n.label}))}function Are(e){var{clipPathId:t,props:n}=e,r=h.useRef(null),i=h.useRef(0),a=h.useRef(null);return h.createElement(Ore,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var Ire=(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:it(e.payload,t)}};class Nre extends h.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:l,top:s,left:c,width:u,height:f,id:d,needClip:p,zIndex:m}=this.props;if(t)return null;var g=tt("recharts-line",i),y=d,{r:x,strokeWidth:v}=kM(n),b=Fb(n),w=x*2+v,j=p?"url(#clipPath-".concat(b?"":"dots-").concat(y,")"):void 0;return h.createElement(Gn,{zIndex:m},h.createElement(Lt,{className:g},p&&h.createElement("defs",null,h.createElement(Xb,{clipPathId:y,xAxisId:a,yAxisId:l}),!b&&h.createElement("clipPath",{id:"clipPath-dots-".concat(y)},h.createElement("rect",{x:c-w/2,y:s-w/2,width:u+w,height:f+w}))),h.createElement(xM,{xAxisId:a,yAxisId:l,data:r,dataPointFormatter:Ire,errorBarOffset:0},h.createElement(Are,{props:this.props,clipPathId:y}))),h.createElement(ky,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:j}))}}var PM={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Gt.line,type:"linear"};function _re(e){var t=Xt(e,PM),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,connectNulls:s,dot:c,hide:u,isAnimationActive:f,label:d,legendType:p,xAxisId:m,yAxisId:g,id:y}=t,x=Qb(t,vre),{needClip:v}=lm(m,g),b=om(),w=Va(),j=xn(),C=ke(A=>hre(A,m,g,j,y));if(w!=="horizontal"&&w!=="vertical"||C==null||b==null)return null;var{height:S,width:E,x:I,y:R}=b;return h.createElement(Nre,nu({},x,{id:y,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,isAnimationActive:f,hide:u,label:d,legendType:p,xAxisId:m,yAxisId:g,points:C,layout:w,height:S,width:E,left:I,top:R,needClip:v}))}function Mre(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:l,bandSize:s,displayedData:c}=e;return c.map((u,f)=>{var d=it(u,l);if(t==="horizontal"){var p=qf({axis:n,ticks:i,bandSize:s,entry:u,index:f}),m=Tt(d)?null:r.scale.map(d);return{x:p,y:m??null,value:d,payload:u}}var g=Tt(d)?null:n.scale.map(d),y=qf({axis:r,ticks:a,bandSize:s,entry:u,index:f});return g==null||y==null?null:{x:g,y,value:d,payload:u}}).filter(Boolean)}function Rre(e){var t=Xt(e,PM),n=xn();return h.createElement(im,{id:t.id,type:"line"},r=>h.createElement(h.Fragment,null,h.createElement(Hb,{legendPayload:jre(t)}),h.createElement(Sre,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),h.createElement(Vb,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),h.createElement(_re,nu({},t,{id:r}))))}var Qd=h.memo(Rre,Xo);Qd.displayName="Line";function Oi(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:uM}function Ai(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:uM}var EM=(e,t,n)=>Ti(e,"xAxis",Oi(e,t),n),TM=(e,t,n)=>Ei(e,"xAxis",Oi(e,t),n),OM=(e,t,n)=>Ti(e,"yAxis",Ai(e,t),n),AM=(e,t,n)=>Ei(e,"yAxis",Ai(e,t),n),Dre=q([Je,EM,OM,TM,AM],(e,t,n,r,i)=>ti(e,"xAxis")?La(t,r,!1):La(n,i,!1)),Lre=(e,t)=>t,IM=q([Iu,Lre],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),NM=e=>{var t=Je(e),n=ti(t,"xAxis");return n?"yAxis":"xAxis"},zre=(e,t)=>{var n=NM(e);return n==="yAxis"?Ai(e,t):Oi(e,t)},$re=(e,t,n)=>hp(e,NM(e),zre(e,t),n),Bre=q([IM,$re],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=Th(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=a==null?void 0:a.find(s=>s.key===i);if(l!=null)return l.map(s=>[s[0],s[1]])}}}),Fre=q([Je,EM,OM,TM,AM,Bre,OI,Dre,IM,V7],(e,t,n,r,i,a,l,s,c,u)=>{var{chartData:f,dataStartIndex:d,dataEndIndex:p}=l;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var{data:m}=c,g;if(m&&m.length>0?g=m:g=f==null?void 0:f.slice(d,p+1),g!=null)return lie({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:g,chartBaseValue:u,bandSize:s})}}),Ure=["id"],Wre=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Ao(){return Ao=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},Ao.apply(null,arguments)}function _M(e,t){if(e==null)return{};var n,r,i=Kre(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 Kre(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){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 Tl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gP(Object(n),!0).forEach(function(r){qre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qre(e,t,n){return(t=Hre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hre(e){var t=Vre(e,"string");return typeof t=="symbol"?t:t+""}function Vre(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 Sp(e,t){return e&&e!=="none"?e:t}var Yre=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:l}=e;return[{inactive:l,dataKey:t,type:a,color:Sp(r,i),value:Ha(n,t),payload:e}]},Gre=h.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:s,unit:c,tooltipType:u,id:f}=e,d={dataDefinedOnItem:n,getPosition:qa,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Ha(l,t),hide:s,type:u,color:Sp(r,a),unit:c,graphicalItemId:f}};return h.createElement(rm,{tooltipEntrySettings:d})});function Xre(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:l}=r,s=qn(r);return h.createElement(cM,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:s,needClip:i,clipPathId:t})}function Qre(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var l,s,c={x:(l=a.x)!==null&&l!==void 0?l:0,y:(s=a.y)!==null&&s!==void 0?s:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Tl(Tl({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return h.createElement(Rb,{value:t?i:void 0},n)}function vP(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:l,type:s,stroke:c,connectNulls:u,isRange:f}=a,{id:d}=a,p=_M(a,Ure),m=qn(p),g=Ln(p);return h.createElement(h.Fragment,null,(t==null?void 0:t.length)>1&&h.createElement(Lt,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},h.createElement(Ll,Ao({},g,{id:d,points:t,connectNulls:u,type:s,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),c!=="none"&&h.createElement(Ll,Ao({},m,{className:"recharts-area-curve",layout:l,type:s,connectNulls:u,fill:"none",points:t})),c!=="none"&&f&&Array.isArray(n)&&h.createElement(Ll,Ao({},m,{className:"recharts-area-curve",layout:l,type:s,connectNulls:u,fill:"none",points:n}))),h.createElement(Xre,{points:t,props:p,clipPathId:i}))}function Jre(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,s=(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(!Ue(s)||!Ue(c))return null;var u=r*Math.abs(s-c),f=Math.max(...a.map(d=>d.x||0));return ve(i)?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(...i.map(d=>d.x||0),f)),ve(f)?h.createElement("rect",{x:0,y:s<c?s:s-u,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(u)}):null}function Zre(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,s=(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(!Ue(s)||!Ue(c))return null;var u=r*Math.abs(s-c),f=Math.max(...a.map(d=>d.y||0));return ve(i)?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(...i.map(d=>d.y||0),f)),ve(f)?h.createElement("rect",{x:s<c?s:s-u,y:0,width:u,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}function eie(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?h.createElement(Jre,{alpha:t,points:r,baseLine:i,strokeWidth:a}):h.createElement(Zre,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function tie(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:l,baseLine:s,isAnimationActive:c,animationBegin:u,animationDuration:f,animationEasing:d,onAnimationStart:p,onAnimationEnd:m}=r,g=h.useMemo(()=>({points:l,baseLine:s}),[l,s]),y=fs(g,"recharts-area-"),x=S0(),[v,b]=h.useState(!1),w=!v,j=h.useCallback(()=>{typeof m=="function"&&m(),b(!1)},[m]),C=h.useCallback(()=>{typeof p=="function"&&p(),b(!0)},[p]);if(x==null)return null;var S=i.current,E=a.current;return h.createElement(Qre,{showLabels:w,points:l},r.children,h.createElement(ds,{animationId:y,begin:u,duration:f,isActive:c,easing:d,onAnimationEnd:j,onAnimationStart:C,key:y},I=>{if(S){var R=S.length/l.length,A=I===1?l:l.map((N,Y)=>{var K=Math.floor(Y*R);if(S[K]){var O=S[K];return Tl(Tl({},N),{},{x:st(O.x,N.x,I),y:st(O.y,N.y,I)})}return N}),_;return ve(s)?_=st(E,s,I):Tt(s)||Jr(s)?_=st(E,0,I):_=s.map((N,Y)=>{var K=Math.floor(Y*R);if(Array.isArray(E)&&E[K]){var O=E[K];return Tl(Tl({},N),{},{x:st(O.x,N.x,I),y:st(O.y,N.y,I)})}return N}),I>0&&(i.current=A,a.current=_),h.createElement(vP,{points:A,baseLine:_,needClip:t,clipPathId:n,props:r})}return I>0&&(i.current=l,a.current=s),h.createElement(Lt,null,c&&h.createElement("defs",null,h.createElement("clipPath",{id:"animationClipPath-".concat(n)},h.createElement(eie,{alpha:I,points:l,baseLine:s,layout:x,strokeWidth:r.strokeWidth}))),h.createElement(Lt,{clipPath:"url(#animationClipPath-".concat(n,")")},h.createElement(vP,{points:l,baseLine:s,needClip:t,clipPathId:n,props:r})))}),h.createElement(Kh,{label:r.label}))}function nie(e){var{needClip:t,clipPathId:n,props:r}=e,i=h.useRef(null),a=h.useRef();return h.createElement(tie,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class rie extends h.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:l,needClip:s,xAxisId:c,yAxisId:u,width:f,height:d,id:p,baseLine:m,zIndex:g}=this.props;if(t)return null;var y=tt("recharts-area",i),x=p,{r:v,strokeWidth:b}=kM(n),w=Fb(n),j=v*2+b,C=s?"url(#clipPath-".concat(w?"":"dots-").concat(x,")"):void 0;return h.createElement(Gn,{zIndex:g},h.createElement(Lt,{className:y},s&&h.createElement("defs",null,h.createElement(Xb,{clipPathId:x,xAxisId:c,yAxisId:u}),!w&&h.createElement("clipPath",{id:"clipPath-dots-".concat(x)},h.createElement("rect",{x:l-j/2,y:a-j/2,width:f+j,height:d+j}))),h.createElement(nie,{needClip:s,clipPathId:x,props:this.props})),h.createElement(ky,{points:r,mainColor:Sp(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}),this.props.isRange&&Array.isArray(m)&&h.createElement(ky,{points:m,mainColor:Sp(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}))}}var iie={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Gt.area};function aie(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:l,dot:s,fill:c,fillOpacity:u,hide:f,isAnimationActive:d,legendType:p,stroke:m,xAxisId:g,yAxisId:y}=e,x=_M(e,Wre),v=Va(),b=A_(),{needClip:w}=lm(g,y),j=xn(),{points:C,isRange:S,baseLine:E}=(t=ke(Y=>Fre(Y,e.id,j)))!==null&&t!==void 0?t:{},I=om();if(v!=="horizontal"&&v!=="vertical"||I==null||b!=="AreaChart"&&b!=="ComposedChart")return null;var{height:R,width:A,x:_,y:N}=I;return!C||!C.length?null:h.createElement(rie,Ao({},x,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:E,connectNulls:l,dot:s,fill:c,fillOpacity:u,height:R,hide:f,layout:v,isAnimationActive:d,isRange:S,legendType:p,needClip:w,points:C,stroke:m,width:A,left:_,top:N,xAxisId:g,yAxisId:y}))}var oie=(e,t,n,r,i)=>{var a=n??t;if(ve(a))return a;var l=e==="horizontal"?i:r,s=l.scale.domain();if(l.type==="number"){var c=Math.max(s[0],s[1]),u=Math.min(s[0],s[1]);return a==="dataMin"?u:a==="dataMax"||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a==="dataMin"?s[0]:a==="dataMax"?s[1]:s[0]};function lie(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:l,xAxis:s,yAxis:c,displayedData:u,dataStartIndex:f,xAxisTicks:d,yAxisTicks:p,bandSize:m}=e,g=i&&i.length,y=oie(a,l,n,s,c),x=a==="horizontal",v=!1,b=u.map((j,C)=>{var S,E,I,R;if(g)R=i[f+C];else{var A=it(j,r);Array.isArray(A)?(R=A,v=!0):R=[y,A]}var _=(S=(E=R)===null||E===void 0?void 0:E[1])!==null&&S!==void 0?S:null,N=_==null||g&&!t&&it(j,r)==null;if(x){var Y;return{x:qf({axis:s,ticks:d,bandSize:m,entry:j,index:C}),y:N?null:(Y=c.scale.map(_))!==null&&Y!==void 0?Y:null,value:R,payload:j}}return{x:N?null:(I=s.scale.map(_))!==null&&I!==void 0?I:null,y:qf({axis:c,ticks:p,bandSize:m,entry:j,index:C}),value:R,payload:j}}),w;return g||v?w=b.map(j=>{var C,S=Array.isArray(j.value)?j.value[0]:null;if(x){var E;return{x:j.x,y:S!=null&&j.y!=null&&(E=c.scale.map(S))!==null&&E!==void 0?E:null,payload:j.payload}}return{x:S!=null&&(C=s.scale.map(S))!==null&&C!==void 0?C:null,y:j.y,payload:j.payload}}):w=x?c.scale.map(y):s.scale.map(y),{points:b,baseLine:w??0,isRange:v}}function sie(e){var t=Xt(e,iie),n=xn();return h.createElement(im,{id:t.id,type:"area"},r=>h.createElement(h.Fragment,null,h.createElement(Hb,{legendPayload:Yre(t)}),h.createElement(Gre,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),h.createElement(Vb,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:HA(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),h.createElement(aie,Ao({},t,{id:r}))))}var Cy=h.memo(sie,Xo);Cy.displayName="Area";var cie="Invariant failed";function uie(e,t){throw new Error(cie)}function Py(){return Py=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},Py.apply(null,arguments)}function Jb(e){return h.createElement(Ub,Py({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var die=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(ve(t))return t;var a=ve(r)||Tt(r);return a?t(r,i):(a||uie(),n)}},fie=(e,t,n)=>n,pie=(e,t)=>t,Lu=q([Iu,pie],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),hie=q([Lu],e=>e==null?void 0:e.maxBarSize),mie=(e,t,n,r)=>r,gie=q([Je,Iu,Oi,Ai,fie],(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")),vie=(e,t,n)=>{var r=Je(e),i=Oi(e,t),a=Ai(e,t);if(!(i==null||a==null))return r==="horizontal"?hp(e,"yAxis",a,n):hp(e,"xAxis",i,n)},yie=(e,t)=>{var n=Je(e),r=Oi(e,t),i=Ai(e,t);if(!(r==null||i==null))return n==="horizontal"?uC(e,"xAxis",r):uC(e,"yAxis",i)},xie=q([gie,H7,yie],Xte),bie=(e,t,n)=>{var r,i,a=Lu(e,t);if(a==null)return 0;var l=Oi(e,t),s=Ai(e,t);if(l==null||s==null)return 0;var c=Je(e),u=FI(e),{maxBarSize:f}=a,d=Tt(f)?u:f,p,m;return c==="horizontal"?(p=Ti(e,"xAxis",l,n),m=Ei(e,"xAxis",l,n)):(p=Ti(e,"yAxis",s,n),m=Ei(e,"yAxis",s,n)),(r=(i=La(p,m,!0))!==null&&i!==void 0?i:d)!==null&&r!==void 0?r:0},MM=(e,t,n)=>{var r=Je(e),i=Oi(e,t),a=Ai(e,t);if(!(i==null||a==null)){var l,s;return r==="horizontal"?(l=Ti(e,"xAxis",i,n),s=Ei(e,"xAxis",i,n)):(l=Ti(e,"yAxis",a,n),s=Ei(e,"yAxis",a,n)),La(l,s)}},wie=q([xie,FI,q7,UI,bie,MM,hie],tne),jie=(e,t,n)=>{var r=Oi(e,t);if(r!=null)return Ti(e,"xAxis",r,n)},Sie=(e,t,n)=>{var r=Ai(e,t);if(r!=null)return Ti(e,"yAxis",r,n)},kie=(e,t,n)=>{var r=Oi(e,t);if(r!=null)return Ei(e,"xAxis",r,n)},Cie=(e,t,n)=>{var r=Ai(e,t);if(r!=null)return Ei(e,"yAxis",r,n)},Pie=q([wie,Lu],rne),Eie=q([vie,Lu],nne),Tie=q([cn,y0,jie,Sie,kie,Cie,Pie,Je,OI,MM,Eie,Lu,mie],(e,t,n,r,i,a,l,s,c,u,f,d,p)=>{var{chartData:m,dataStartIndex:g,dataEndIndex:y}=c;if(!(d==null||l==null||t==null||s!=="horizontal"&&s!=="vertical"||n==null||r==null||i==null||a==null||u==null)){var{data:x}=d,v;if(x!=null&&x.length>0?v=x:v=m==null?void 0:m.slice(g,y+1),v!=null)return nae({layout:s,barSettings:d,pos:l,parentViewBox:t,bandSize:u,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:f,displayedData:v,offset:e,cells:p,dataStartIndex:g})}}),Oie=["index"];function Ey(){return Ey=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},Ey.apply(null,arguments)}function Aie(e,t){if(e==null)return{};var n,r,i=Iie(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 Iie(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 RM=h.createContext(void 0),Nie=e=>{var t=h.useContext(RM);if(t!=null)return t.stackId;if(e!=null)return HA(e)},_ie=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),Mie=e=>{var t=h.useContext(RM);if(t!=null){var{stackId:n}=t;return"url(#".concat(_ie(n,e),")")}},DM=e=>{var{index:t}=e,n=Aie(e,Oie),r=Mie(t);return h.createElement(Lt,Ey({className:"recharts-bar-stack-layer",clipPath:r},n))},Rie=["onMouseEnter","onMouseLeave","onClick"],Die=["value","background","tooltipPosition"],Lie=["id"],zie=["onMouseEnter","onClick","onMouseLeave"];function Ba(){return Ba=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},Ba.apply(null,arguments)}function yP(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 Un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yP(Object(n),!0).forEach(function(r){$ie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ie(e,t,n){return(t=Bie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bie(e){var t=Fie(e,"string");return typeof t=="symbol"?t:t+""}function Fie(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 kp(e,t){if(e==null)return{};var n,r,i=Uie(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 Uie(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 Wie=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ha(n,t),payload:e}]},Kie=h.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:l,unit:s,tooltipType:c,id:u}=e,f={dataDefinedOnItem:void 0,getPosition:qa,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Ha(a,t),hide:l,type:c,color:i,unit:s,graphicalItemId:u}};return h.createElement(rm,{tooltipEntrySettings:f})});function qie(e){var t=ke(za),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:s,onClick:c}=a,u=kp(a,Rie),f=Wb(l,r,a.id),d=Kb(s),p=qb(c,r,a.id);if(!i||n==null)return null;var m=Do(i);return h.createElement(Gn,{zIndex:ine(i,Gt.barBackground)},n.map((g,y)=>{var{value:x,background:v,tooltipPosition:b}=g,w=kp(g,Die);if(!v)return null;var j=f(g,y),C=d(g,y),S=p(g,y),E=Un(Un(Un(Un(Un({option:i,isActive:String(y)===t},w),{},{fill:"#eee"},v),m),hu(u,g,y)),{},{onMouseEnter:j,onMouseLeave:C,onClick:S,dataKey:r,index:y,className:"recharts-bar-background-rectangle"});return h.createElement(Jb,Ba({key:"background-bar-".concat(y)},E))}))}function Hie(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(a=>{var l={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Un(Un({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return h.createElement(Rb,{value:t?i:void 0},n)}function Vie(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,s=ke(za),c=ke(Ob),u=n&&String(i.originalDataIndex)===s&&(c==null||l===c),[f,d]=h.useState(!1),[p,m]=h.useState(!1);h.useEffect(()=>{var w;return u?(d(!0),w=requestAnimationFrame(()=>{m(!0)})):m(!1),()=>{cancelAnimationFrame(w)}},[u]);var g=h.useCallback(()=>{u||d(!1)},[u]),y=u&&p,x=u||f,v;u?n===!0?v=t:v=n:v=t;var b=h.createElement(Jb,Ba({},r,{name:String(r.name)},i,{isActive:y,option:v,index:a,dataKey:l,onTransitionEnd:g}));return x?h.createElement(Gn,{zIndex:Gt.activeBar},h.createElement(DM,{index:i.originalDataIndex},b)):b}function Yie(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return h.createElement(Jb,Ba({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function Gie(e){var t,{data:n,props:r}=e,i=(t=qn(r))!==null&&t!==void 0?t:{},{id:a}=i,l=kp(i,Lie),{shape:s,dataKey:c,activeBar:u}=r,{onMouseEnter:f,onClick:d,onMouseLeave:p}=r,m=kp(r,zie),g=Wb(f,c,a),y=Kb(p),x=qb(d,c,a);return n?h.createElement(h.Fragment,null,n.map((v,b)=>h.createElement(DM,Ba({index:v.originalDataIndex,key:"rectangle-".concat(v==null?void 0:v.x,"-").concat(v==null?void 0:v.y,"-").concat(v==null?void 0:v.value,"-").concat(b),className:"recharts-bar-rectangle"},hu(m,v,b),{onMouseEnter:g(v,b),onMouseLeave:y(v,b),onClick:x(v,b)}),u?h.createElement(Vie,{shape:s,activeBar:u,baseProps:l,entry:v,index:b,dataKey:c}):h.createElement(Yie,{shape:s,baseProps:l,entry:v,index:b,dataKey:c})))):null}function Xie(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:l,animationDuration:s,animationEasing:c,onAnimationEnd:u,onAnimationStart:f}=t,d=n.current,p=fs(t,"recharts-bar-"),[m,g]=h.useState(!1),y=!m,x=h.useCallback(()=>{typeof u=="function"&&u(),g(!1)},[u]),v=h.useCallback(()=>{typeof f=="function"&&f(),g(!0)},[f]);return h.createElement(Hie,{showLabels:y,rects:r},h.createElement(ds,{animationId:p,begin:l,duration:s,isActive:a,easing:c,onAnimationEnd:x,onAnimationStart:v,key:p},b=>{var w=b===1?r:r==null?void 0:r.map((j,C)=>{var S=d&&d[C];if(S)return Un(Un({},j),{},{x:st(S.x,j.x,b),y:st(S.y,j.y,b),width:st(S.width,j.width,b),height:st(S.height,j.height,b)});if(i==="horizontal"){var E=st(0,j.height,b),I=st(j.stackedBarStart,j.y,b);return Un(Un({},j),{},{y:I,height:E})}var R=st(0,j.width,b),A=st(j.stackedBarStart,j.x,b);return Un(Un({},j),{},{width:R,x:A})});return b>0&&(n.current=w??null),w==null?null:h.createElement(Lt,null,h.createElement(Gie,{props:t,data:w}))}),h.createElement(Kh,{label:t.label}),t.children)}function Qie(e){var t=h.useRef(null);return h.createElement(Xie,{previousRectanglesRef:t,props:e})}var LM=0,Jie=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:it(e,t)}};class Zie extends h.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:l,needClip:s,background:c,id:u}=this.props;if(t||n==null)return null;var f=tt("recharts-bar",i),d=u;return h.createElement(Lt,{className:f,id:u},s&&h.createElement("defs",null,h.createElement(Xb,{clipPathId:d,xAxisId:a,yAxisId:l})),h.createElement(Lt,{className:"recharts-bar-rectangles",clipPath:s?"url(#clipPath-".concat(d,")"):void 0},h.createElement(qie,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),h.createElement(Qie,this.props)))}}var eae={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:LM,xAxisId:0,yAxisId:0,zIndex:Gt.bar};function tae(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:s,animationDuration:c,animationEasing:u,isAnimationActive:f}=e,{needClip:d}=lm(t,n),p=Va(),m=xn(),g=Bb(e.children,Du),y=ke(b=>Tie(b,e.id,m,g));if(p!=="vertical"&&p!=="horizontal")return null;var x,v=y==null?void 0:y[0];return v==null||v.height==null||v.width==null?x=0:x=p==="vertical"?v.height/2:v.width/2,h.createElement(xM,{xAxisId:t,yAxisId:n,data:y,dataPointFormatter:Jie,errorBarOffset:x},h.createElement(Zie,Ba({},e,{layout:p,needClip:d,data:y,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:s,animationDuration:c,animationEasing:u,isAnimationActive:f})))}function nae(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:l,xAxis:s,yAxis:c,xAxisTicks:u,yAxisTicks:f,stackedData:d,displayedData:p,offset:m,cells:g,parentViewBox:y,dataStartIndex:x}=e,v=t==="horizontal"?c:s,b=d?v.scale.domain():null,w=T9({numericAxis:v}),j=v.scale.map(w);return p.map((C,S)=>{var E,I,R,A,_,N;if(d){var Y=d[S+x];if(Y==null)return null;E=S9(Y,b)}else E=it(C,n),Array.isArray(E)||(E=[w,E]);var K=die(r,LM)(E[1],S);if(t==="horizontal"){var O,F=c.scale.map(E[0]),W=c.scale.map(E[1]);if(F==null||W==null)return null;I=hS({axis:s,ticks:u,bandSize:l,offset:a.offset,entry:C,index:S}),R=(O=W??F)!==null&&O!==void 0?O:void 0,A=a.size;var M=F-W;if(_=Jr(M)?0:M,N={x:I,y:m.top,width:A,height:m.height},Math.abs(K)>0&&Math.abs(_)<Math.abs(K)){var B=vn(_||K)*(Math.abs(K)-Math.abs(_));R-=B,_+=B}}else{var k=s.scale.map(E[0]),L=s.scale.map(E[1]);if(k==null||L==null)return null;if(I=k,R=hS({axis:c,ticks:f,bandSize:l,offset:a.offset,entry:C,index:S}),A=L-k,_=a.size,N={x:m.left,y:R,width:m.width,height:_},Math.abs(K)>0&&Math.abs(A)<Math.abs(K)){var X=vn(A||K)*(Math.abs(K)-Math.abs(A));A+=X}}if(I==null||R==null||A==null||_==null||!i&&(A===0||_===0))return null;var T=Un(Un({},C),{},{stackedBarStart:j,x:I,y:R,width:A,height:_,value:d?E:E[1],payload:C,background:N,tooltipPosition:{x:I+A/2,y:R+_/2},parentViewBox:y,originalDataIndex:S},g&&g[S]&&g[S].props);return T}).filter(Boolean)}function rae(e){var t=Xt(e,eae),n=Nie(t.stackId),r=xn();return h.createElement(im,{id:t.id,type:"bar"},i=>h.createElement(h.Fragment,null,h.createElement(Hb,{legendPayload:Wie(t)}),h.createElement(Kie,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),h.createElement(Vb,{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}),h.createElement(Gn,{zIndex:t.zIndex},h.createElement(tae,Ba({},t,{id:i})))))}var zM=h.memo(rae,Xo);zM.displayName="Bar";var iae=["domain","range"],aae=["domain","range"];function xP(e,t){if(e==null)return{};var n,r,i=oae(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 oae(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 bP(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 $M(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=xP(e,iae),{domain:a,range:l}=t,s=xP(t,aae);return!bP(n,a)||!bP(r,l)?!1:Xo(i,s)}var lae=["type"],sae=["dangerouslySetInnerHTML","ticks","scale"],cae=["id","scale"];function Ty(){return Ty=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},Ty.apply(null,arguments)}function wP(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 jP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wP(Object(n),!0).forEach(function(r){uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uae(e,t,n){return(t=dae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dae(e){var t=fae(e,"string");return typeof t=="symbol"?t:t+""}function fae(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 Oy(e,t){if(e==null)return{};var n,r,i=pae(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 pae(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 hae(e){var t=mt(),n=h.useRef(null),r=S0(),{type:i}=e,a=Oy(e,lae),l=Ph(r,"xAxis",i),s=h.useMemo(()=>{if(l!=null)return jP(jP({},a),{},{type:l})},[a,l]);return h.useLayoutEffect(()=>{s!=null&&(n.current===null?t(Rte(s)):n.current!==s&&t(Dte({prev:n.current,next:s})),n.current=s)},[s,t]),h.useLayoutEffect(()=>()=>{n.current&&(t(Lte(n.current)),n.current=null)},[t]),null}var mae=e=>{var{xAxisId:t,className:n}=e,r=ke(y0),i=xn(),a="xAxis",l=ke(v=>a_(v,a,t,i)),s=ke(v=>n_(v,t)),c=ke(v=>PX(v,t)),u=ke(v=>MN(v,t));if(s==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:f,ticks:d,scale:p}=e,m=Oy(e,sae),{id:g,scale:y}=u,x=Oy(u,cae);return h.createElement(Gb,Ty({},m,x,{x:c.x,y:c.y,width:s.width,height:s.height,className:tt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},gae={allowDataOverflow:rn.allowDataOverflow,allowDecimals:rn.allowDecimals,allowDuplicatedCategory:rn.allowDuplicatedCategory,angle:rn.angle,axisLine:Wi.axisLine,height:rn.height,hide:!1,includeHidden:rn.includeHidden,interval:rn.interval,label:!1,minTickGap:rn.minTickGap,mirror:rn.mirror,orientation:rn.orientation,padding:rn.padding,reversed:rn.reversed,scale:rn.scale,tick:rn.tick,tickCount:rn.tickCount,tickLine:Wi.tickLine,tickSize:Wi.tickSize,type:rn.type,niceTicks:rn.niceTicks,xAxisId:0},vae=e=>{var t=Xt(e,gae);return h.createElement(h.Fragment,null,h.createElement(hae,{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}),h.createElement(mae,t))},nc=h.memo(vae,$M);nc.displayName="XAxis";var yae=["type"],xae=["dangerouslySetInnerHTML","ticks","scale"],bae=["id","scale"];function Ay(){return Ay=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},Ay.apply(null,arguments)}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 kP(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){wae(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 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 Iy(e,t){if(e==null)return{};var n,r,i=kae(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 kae(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 Cae(e){var t=mt(),n=h.useRef(null),r=S0(),{type:i}=e,a=Iy(e,yae),l=Ph(r,"yAxis",i),s=h.useMemo(()=>{if(l!=null)return kP(kP({},a),{},{type:l})},[l,a]);return h.useLayoutEffect(()=>{s!=null&&(n.current===null?t(zte(s)):n.current!==s&&t($te({prev:n.current,next:s})),n.current=s)},[s,t]),h.useLayoutEffect(()=>()=>{n.current&&(t(Bte(n.current)),n.current=null)},[t]),null}function Pae(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=h.useRef(null),l=h.useRef(null),s=ke(y0),c=xn(),u=mt(),f="yAxis",d=ke(S=>r_(S,t)),p=ke(S=>TX(S,t)),m=ke(S=>a_(S,f,t,c)),g=ke(S=>RN(S,t));if(h.useLayoutEffect(()=>{if(!(r!=="auto"||!d||Mb(i)||h.isValidElement(i)||g==null)){var S=a.current;if(S){var E=S.getCalculatedWidth();Math.round(d.width)!==Math.round(E)&&u(Fte({id:t,width:E}))}}},[m,d,u,i,t,r,g]),d==null||p==null||g==null)return null;var{dangerouslySetInnerHTML:y,ticks:x,scale:v}=e,b=Iy(e,xae),{id:w,scale:j}=g,C=Iy(g,bae);return h.createElement(Gb,Ay({},b,C,{ref:a,labelRef:l,x:p.x,y:p.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:d.width,height:d.height,className:tt("recharts-".concat(f," ").concat(f),n),viewBox:s,ticks:m,axisType:f,axisId:t}))}var Eae={allowDataOverflow:an.allowDataOverflow,allowDecimals:an.allowDecimals,allowDuplicatedCategory:an.allowDuplicatedCategory,angle:an.angle,axisLine:Wi.axisLine,hide:!1,includeHidden:an.includeHidden,interval:an.interval,label:!1,minTickGap:an.minTickGap,mirror:an.mirror,orientation:an.orientation,padding:an.padding,reversed:an.reversed,scale:an.scale,tick:an.tick,tickCount:an.tickCount,tickLine:Wi.tickLine,tickSize:Wi.tickSize,type:an.type,niceTicks:an.niceTicks,width:an.width,yAxisId:0},Tae=e=>{var t=Xt(e,Eae);return h.createElement(h.Fragment,null,h.createElement(Cae,{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}),h.createElement(Pae,t))},rc=h.memo(Tae,$M);rc.displayName="YAxis";var Oae=(e,t)=>t,Zb=q([Oae,Je,GI,bn,S_,oa,GQ,cn],nJ);function Aae(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function e1(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Aae(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 l=(s,c)=>({relativeX:Math.round((s-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(s=>l(s.clientX,s.clientY)):l(e.clientX,e.clientY)}var BM=vr("mouseClick"),FM=vu();FM.startListening({actionCreator:BM,effect:(e,t)=>{var n=e.payload,r=Zb(t.getState(),e1(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(KX({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Ny=vr("mouseMove"),UM=vu(),dl=null,ao=null,jg=null;UM.startListening({actionCreator:Ny,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||(a==null?void 0:a.includes("mousemove"));dl!==null&&(cancelAnimationFrame(dl),dl=null),ao!==null&&(typeof i!="number"||!l)&&(clearTimeout(ao),ao=null),jg=e1(n);var s=()=>{var c=t.getState(),u=Mu(c,c.tooltip.settings.shared);if(!jg){dl=null,ao=null;return}if(u==="axis"){var f=Zb(c,jg);(f==null?void 0:f.activeIndex)!=null?t.dispatch(p_({activeIndex:f.activeIndex,activeDataKey:void 0,activeCoordinate:f.activeCoordinate})):t.dispatch(f_())}dl=null,ao=null};if(!l){s();return}i==="raf"?dl=requestAnimationFrame(s):typeof i=="number"&&ao===null&&(ao=setTimeout(s,i))}});function Iae(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 CP={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},WM=$n({name:"rootProps",initialState:CP,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:CP.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}}}),Nae=WM.reducer,{updateOptions:_ae}=WM.actions,Mae=null,Rae={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)},KM=$n({name:"polarOptions",initialState:Mae,reducers:Rae}),{updatePolarOptions:Dae}=KM.actions,Lae=KM.reducer,qM=vr("keyDown"),HM=vr("focus"),VM=vr("blur"),sm=vu(),fl=null,oo=null,Ad=null;sm.startListening({actionCreator:qM,effect:(e,t)=>{Ad=e.payload,fl!==null&&(cancelAnimationFrame(fl),fl=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");oo!==null&&(typeof r!="number"||!a)&&(clearTimeout(oo),oo=null);var l=()=>{try{var s=t.getState(),c=s.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=s.tooltip,f=Ad;if(f!=="ArrowRight"&&f!=="ArrowLeft"&&f!=="Enter")return;var d=vc(u,Ko(s),ns(s),rs(s)),p=d==null?-1:Number(d),m=!Number.isFinite(p)||p<0,g=oa(s),y=Ko(s),x=Mu(s,s.tooltip.settings.shared);if(f==="Enter"){if(m)return;var v=vp(s,x,"hover",String(u.index));t.dispatch(gp({active:!u.active,activeIndex:u.index,activeCoordinate:v}));return}var b=_X(s),w=b==="left-to-right"?1:-1,j=f==="ArrowRight"?1:-1,C;if(m){var S=ns(s),E=rs(s),I=j*w,R=K=>({active:!1,index:String(K),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(C=-1,I>0){for(var A=0;A<y.length;A++)if(vc(R(A),y,S,E)!=null){C=A;break}}else for(var _=y.length-1;_>=0;_--)if(vc(R(_),y,S,E)!=null){C=_;break}if(C<0)return}else{C=p+j*w;var N=(g==null?void 0:g.length)||y.length;if(N===0||C>=N||C<0)return}var Y=vp(s,x,"hover",String(C));t.dispatch(gp({active:!0,activeIndex:C.toString(),activeCoordinate:Y}))}finally{fl=null,oo=null}};if(!a){l();return}r==="raf"?fl=requestAnimationFrame(l):typeof r=="number"&&oo===null&&(l(),Ad=null,oo=setTimeout(()=>{Ad?l():(oo=null,fl=null)},r))}});sm.startListening({actionCreator:HM,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",l=Mu(n,n.tooltip.settings.shared),s=vp(n,l,"hover",String(a));t.dispatch(gp({active:!0,activeIndex:a,activeCoordinate:s}))}}}});sm.startListening({actionCreator:VM,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(gp({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function YM(e){e.persist();var{currentTarget:t}=e;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 Cr=vr("externalEvent"),GM=vu(),Id=new Map,qs=new Map,Sg=new Map;GM.startListening({actionCreator:Cr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=YM(r);Sg.set(i,{handler:n,reactEvent:a});var l=Id.get(i);l!==void 0&&(cancelAnimationFrame(l),Id.delete(i));var s=t.getState(),{throttleDelay:c,throttledEvents:u}=s.eventSettings,f=u,d=f==="all"||(f==null?void 0:f.includes(i)),p=qs.get(i);p!==void 0&&(typeof c!="number"||!d)&&(clearTimeout(p),qs.delete(i));var m=()=>{var x=Sg.get(i);try{if(!x)return;var{handler:v,reactEvent:b}=x,w=t.getState(),j={activeCoordinate:MQ(w),activeDataKey:Ob(w),activeIndex:za(w),activeLabel:P_(w),activeTooltipIndex:za(w),isTooltipActive:RQ(w)};v&&v(j,b)}finally{Id.delete(i),qs.delete(i),Sg.delete(i)}};if(!d){m();return}if(c==="raf"){var g=requestAnimationFrame(m);Id.set(i,g)}else if(typeof c=="number"){if(!qs.has(i)){m();var y=setTimeout(m,c);qs.set(i,y)}}else m()}}});var zae=q([bs],e=>e.tooltipItemPayloads),$ae=q([zae,(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{getPosition:i}=r;if(i!=null)return i(t)}}}),XM=vr("touchMove"),QM=vu(),lo=null,da=null,PP=null,Hs=null;QM.startListening({actionCreator:XM,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Hs=YM(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a.includes("touchmove");lo!==null&&(cancelAnimationFrame(lo),lo=null),da!==null&&(typeof i!="number"||!l)&&(clearTimeout(da),da=null),PP=Array.from(n.touches).map(c=>e1({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var s=()=>{if(Hs!=null){var c=t.getState(),u=Mu(c,c.tooltip.settings.shared);if(u==="axis"){var f,d=(f=PP)===null||f===void 0?void 0:f[0];if(d==null){lo=null,da=null;return}var p=Zb(c,d);(p==null?void 0:p.activeIndex)!=null&&t.dispatch(p_({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate}))}else if(u==="item"){var m,g=Hs.touches[0];if(document.elementFromPoint==null||g==null)return;var y=document.elementFromPoint(g.clientX,g.clientY);if(!y||!y.getAttribute)return;var x=y.getAttribute(YA),v=(m=y.getAttribute(GA))!==null&&m!==void 0?m:void 0,b=Zo(c).find(C=>C.id===v);if(x==null||b==null||v==null)return;var{dataKey:w}=b,j=$ae(c,x,v);t.dispatch(d_({activeDataKey:w,activeIndex:x,activeCoordinate:j,activeGraphicalItemId:v}))}lo=null,da=null}};if(!l){s();return}i==="raf"?lo=requestAnimationFrame(s):typeof i=="number"&&da===null&&(s(),Hs=null,da=setTimeout(()=>{Hs?s():(da=null,lo=null)},i))}}});var t1={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},JM=$n({name:"eventSettings",initialState:t1,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Bae}=JM.actions,Fae=JM.reducer,Uae=mA({brush:ane,cartesianAxis:Ute,chartData:IJ,errorBars:ire,eventSettings:Fae,graphicalItems:Vee,layout:y9,legend:Cq,options:PJ,polarAxis:lee,polarOptions:Lae,referenceElements:cne,renderedTicks:Pne,rootProps:Nae,tooltip:qX,zIndex:mJ}),Wae=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return WK({reducer:Uae,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([FM.middleware,UM.middleware,sm.middleware,GM.middleware,QM.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(AA({type:"raf"}))},devTools:{serialize:{replacer:Iae},name:"recharts-".concat(n)}})};function ZM(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=xn(),a=h.useRef(null);if(i)return n;a.current==null&&(a.current=Wae(t,r));var l=c0;return h.createElement(Vq,{context:l,store:a.current},n)}function Kae(e){var{layout:t,margin:n}=e,r=mt(),i=xn();return h.useEffect(()=>{i||(r(m9(t)),r(h9(n)))},[r,i,t,n]),null}var eR=h.memo(Kae,Xo);function tR(e){var t=mt();return h.useEffect(()=>{t(_ae(e))},[t,e]),null}var qae=e=>{var t=mt();return h.useEffect(()=>{t(Bae(e))},[t,e]),null},nR=h.memo(qae,Xo);function EP(e){var{zIndex:t,isPanorama:n}=e,r=h.useRef(null),i=mt();return h.useLayoutEffect(()=>(r.current&&i(pJ({zIndex:t,element:r.current,isPanorama:n})),()=>{i(hJ({zIndex:t,isPanorama:n}))}),[i,t,n]),h.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function TP(e){var{children:t,isPanorama:n}=e,r=ke(iJ);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),a=r.filter(l=>l>0);return h.createElement(h.Fragment,null,i.map(l=>h.createElement(EP,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>h.createElement(EP,{key:l,zIndex:l,isPanorama:n})))}var Hae=["children"];function Vae(e,t){if(e==null)return{};var n,r,i=Yae(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 Yae(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 Cp(){return Cp=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},Cp.apply(null,arguments)}var Gae={width:"100%",height:"100%",display:"block"},Xae=h.forwardRef((e,t)=>{var n=w0(),r=j0(),i=mI();if(!ki(n)||!ki(r))return null;var{children:a,otherAttributes:l,title:s,desc:c}=e,u,f;return l!=null&&(typeof l.tabIndex=="number"?u=l.tabIndex:u=i?0:void 0,typeof l.role=="string"?f=l.role:f=i?"application":void 0),h.createElement(Gx,Cp({},l,{title:s,desc:c,role:f,tabIndex:u,width:n,height:r,style:Gae,ref:t}),a)}),Qae=e=>{var{children:t}=e,n=ke(bh);if(!n)return null;var{width:r,height:i,y:a,x:l}=n;return h.createElement(Gx,{width:r,height:i,x:l,y:a},t)},OP=h.forwardRef((e,t)=>{var{children:n}=e,r=Vae(e,Hae),i=xn();return i?h.createElement(Qae,null,h.createElement(TP,{isPanorama:!0},n)):h.createElement(Xae,Cp({ref:t},r),h.createElement(TP,{isPanorama:!1},n))});function Jae(){var e=mt(),[t,n]=h.useState(null),r=ke(M9);return h.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Ue(a)&&a!==r&&e(v9(a))}},[t,e,r]),n}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 Zae(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){eoe(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 eoe(e,t,n){return(t=toe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function toe(e){var t=noe(e,"string");return typeof t=="symbol"?t:t+""}function noe(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 _a(){return _a=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},_a.apply(null,arguments)}var roe=()=>(BJ(),null);function Pp(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var ioe=h.forwardRef((e,t)=>{var n,r,i=h.useRef(null),[a,l]=h.useState({containerWidth:Pp((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Pp((r=e.style)===null||r===void 0?void 0:r.height)}),s=h.useCallback((u,f)=>{l(d=>{var p=Math.round(u),m=Math.round(f);return d.containerWidth===p&&d.containerHeight===m?d:{containerWidth:p,containerHeight:m}})},[]),c=h.useCallback(u=>{if(typeof t=="function"&&t(u),i.current!=null&&(i.current.disconnect(),i.current=null),u!=null&&typeof ResizeObserver<"u"){var{width:f,height:d}=u.getBoundingClientRect();s(f,d);var p=g=>{var y=g[0];if(y!=null){var{width:x,height:v}=y.contentRect;s(x,v)}},m=new ResizeObserver(p);m.observe(u),i.current=m}},[t,s]);return h.useEffect(()=>()=>{var u=i.current;u!=null&&u.disconnect()},[s]),h.createElement(h.Fragment,null,h.createElement(xu,{width:a.containerWidth,height:a.containerHeight}),h.createElement("div",_a({ref:c},e)))}),aoe=h.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=h.useState({containerWidth:Pp(n),containerHeight:Pp(r)}),l=h.useCallback((c,u)=>{a(f=>{var d=Math.round(c),p=Math.round(u);return f.containerWidth===d&&f.containerHeight===p?f:{containerWidth:d,containerHeight:p}})},[]),s=h.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:f}=c.getBoundingClientRect();l(u,f)}},[t,l]);return h.createElement(h.Fragment,null,h.createElement(xu,{width:i.containerWidth,height:i.containerHeight}),h.createElement("div",_a({ref:s},e)))}),ooe=h.forwardRef((e,t)=>{var{width:n,height:r}=e;return h.createElement(h.Fragment,null,h.createElement(xu,{width:n,height:r}),h.createElement("div",_a({ref:t},e)))}),loe=h.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?h.createElement(aoe,_a({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?h.createElement(ooe,_a({},e,{width:n,height:r,ref:t})):h.createElement(h.Fragment,null,h.createElement(xu,{width:n,height:r}),h.createElement("div",_a({ref:t},e)))});function soe(e){return e?ioe:loe}var coe=h.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:l,onDoubleClick:s,onMouseDown:c,onMouseEnter:u,onMouseLeave:f,onMouseMove:d,onMouseUp:p,onTouchEnd:m,onTouchMove:g,onTouchStart:y,style:x,width:v,responsive:b,dispatchTouchEvents:w=!0}=e,j=h.useRef(null),C=mt(),[S,E]=h.useState(null),[I,R]=h.useState(null),A=Jae(),_=x0(),N=(_==null?void 0:_.width)>0?_.width:v,Y=(_==null?void 0:_.height)>0?_.height:i,K=h.useCallback(ee=>{A(ee),typeof t=="function"&&t(ee),E(ee),R(ee),ee!=null&&(j.current=ee)},[A,t,E,R]),O=h.useCallback(ee=>{C(BM(ee)),C(Cr({handler:a,reactEvent:ee}))},[C,a]),F=h.useCallback(ee=>{C(Ny(ee)),C(Cr({handler:u,reactEvent:ee}))},[C,u]),W=h.useCallback(ee=>{C(f_()),C(Cr({handler:f,reactEvent:ee}))},[C,f]),M=h.useCallback(ee=>{C(Ny(ee)),C(Cr({handler:d,reactEvent:ee}))},[C,d]),B=h.useCallback(()=>{C(HM())},[C]),k=h.useCallback(()=>{C(VM())},[C]),L=h.useCallback(ee=>{C(qM(ee.key))},[C]),X=h.useCallback(ee=>{C(Cr({handler:l,reactEvent:ee}))},[C,l]),T=h.useCallback(ee=>{C(Cr({handler:s,reactEvent:ee}))},[C,s]),ce=h.useCallback(ee=>{C(Cr({handler:c,reactEvent:ee}))},[C,c]),ge=h.useCallback(ee=>{C(Cr({handler:p,reactEvent:ee}))},[C,p]),Q=h.useCallback(ee=>{C(Cr({handler:y,reactEvent:ee}))},[C,y]),ae=h.useCallback(ee=>{w&&C(XM(ee)),C(Cr({handler:g,reactEvent:ee}))},[C,w,g]),fe=h.useCallback(ee=>{C(Cr({handler:m,reactEvent:ee}))},[C,m]),te=soe(b);return h.createElement(R_.Provider,{value:S},h.createElement(lO.Provider,{value:I},h.createElement(te,{width:N??(x==null?void 0:x.width),height:Y??(x==null?void 0:x.height),className:tt("recharts-wrapper",r),style:Zae({position:"relative",cursor:"default",width:N,height:Y},x),onClick:O,onContextMenu:X,onDoubleClick:T,onFocus:B,onBlur:k,onKeyDown:L,onMouseDown:ce,onMouseEnter:F,onMouseLeave:W,onMouseMove:M,onMouseUp:ge,onTouchEnd:fe,onTouchMove:ae,onTouchStart:Q,ref:K},h.createElement(roe,null),n)))}),uoe=["width","height","responsive","children","className","style","compact","title","desc"];function doe(e,t){if(e==null)return{};var n,r,i=foe(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 foe(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 rR=h.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:l,style:s,compact:c,title:u,desc:f}=e,d=doe(e,uoe),p=qn(d);return c?h.createElement(h.Fragment,null,h.createElement(xu,{width:n,height:r}),h.createElement(OP,{otherAttributes:p,title:u,desc:f},a)):h.createElement(coe,{className:l,style:s,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},h.createElement(OP,{otherAttributes:p,title:u,desc:f,ref:t},h.createElement(dne,null,a)))});function _y(){return _y=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},_y.apply(null,arguments)}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 poe(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){hoe(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 hoe(e,t,n){return(t=moe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function moe(e){var t=goe(e,"string");return typeof t=="symbol"?t:t+""}function goe(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 voe={top:5,right:5,bottom:5,left:5},yoe=poe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:voe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},t1),n1=h.forwardRef(function(t,n){var r,i=Xt(t.categoricalChartProps,yoe),{chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:s,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,f={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:s,tooltipPayloadSearcher:c,eventEmitter:void 0};return h.createElement(ZM,{preloadedState:{options:f},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},h.createElement(fM,{chartData:u.data}),h.createElement(eR,{layout:i.layout,margin:i.margin}),h.createElement(nR,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),h.createElement(tR,{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}),h.createElement(rR,_y({},i,{ref:n})))}),xoe=["axis"],NP=h.forwardRef((e,t)=>h.createElement(n1,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:xoe,tooltipPayloadSearcher:Uh,categoricalChartProps:e,ref:t})),boe=["axis","item"],woe=h.forwardRef((e,t)=>h.createElement(n1,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:boe,tooltipPayloadSearcher:Uh,categoricalChartProps:e,ref:t}));function joe(e){var t=mt();return h.useEffect(()=>{t(Dae(e))},[t,e]),null}var Soe=["layout"];function My(){return My=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},My.apply(null,arguments)}function koe(e,t){if(e==null)return{};var n,r,i=Coe(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 Coe(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 _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 Poe(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){Eoe(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 Eoe(e,t,n){return(t=Toe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Toe(e){var t=Ooe(e,"string");return typeof t=="symbol"?t:t+""}function Ooe(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 Aoe={top:5,right:5,bottom:5,left:5},iR=Poe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Aoe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},t1),Ioe=h.forwardRef(function(t,n){var r,i=Xt(t.categoricalChartProps,iR),{layout:a}=i,l=koe(i,Soe),{chartName:s,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f}=t,d={chartName:s,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return h.createElement(ZM,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:s},h.createElement(fM,{chartData:i.data}),h.createElement(eR,{layout:a,margin:i.margin}),h.createElement(nR,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),h.createElement(tR,{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}),h.createElement(joe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),h.createElement(rR,My({},l,{ref:n})))});function MP(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 RP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MP(Object(n),!0).forEach(function(r){Noe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Noe(e,t,n){return(t=_oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _oe(e){var t=Moe(e,"string");return typeof t=="symbol"?t:t+""}function Moe(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 Roe=["item"],Doe=RP(RP({},iR),{},{layout:"centric",startAngle:0,endAngle:360}),Loe=h.forwardRef((e,t)=>{var n=Xt(e,Doe);return h.createElement(Ioe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Roe,tooltipPayloadSearcher:Uh,categoricalChartProps:n,ref:t})}),zoe=["axis"],$oe=h.forwardRef((e,t)=>h.createElement(n1,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:zoe,tooltipPayloadSearcher:Uh,categoricalChartProps:e,ref:t}));const DP=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#f97316"];function Boe(){const[e,t]=h.useState(null),[n,r]=h.useState(!0),[i,a]=h.useState(30);h.useEffect(()=>{l()},[i]);const l=async()=>{try{r(!0);const d=await H.getStatistics(i);t(d)}catch(d){console.error("Failed to load statistics:",d)}finally{r(!1)}},s=d=>d>=1e6?`${(d/1e6).toFixed(1)}M`:d>=1e3?`${(d/1e3).toFixed(1)}K`:d.toString(),c=d=>{if(d>=60){const p=Math.floor(d/60),m=d%60;return`${p}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:"默认请求"},f=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:l,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:s(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:s(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(Ms,{width:"100%",height:300,children:o.jsxs($oe,{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(tc,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(nc,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>ut(d).format("MM/DD")}),o.jsx(rc,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Ws,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>ut(d).format("YYYY-MM-DD")}),o.jsx(Js,{}),o.jsx(Cy,{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(Ms,{width:"100%",height:300,children:o.jsxs(NP,{data:e.timeline,children:[o.jsx(tc,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(nc,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>ut(d).format("MM/DD")}),o.jsx(rc,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d?s(Number(d)):""}),o.jsx(Ws,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>ut(d).format("YYYY-MM-DD"),formatter:d=>d?s(Number(d)):""}),o.jsx(Js,{}),o.jsx(Qd,{type:"monotone",dataKey:"totalInputTokens",name:"输入 Tokens",stroke:"#10b981",strokeWidth:2,dot:!1}),o.jsx(Qd,{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(Ms,{width:"100%",height:300,children:o.jsxs(NP,{data:f,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(tc,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(nc,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>ut(d).format("MM/DD")}),o.jsx(rc,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d!=null?d>=60?`${Math.round(Number(d)/60)}h`:`${Number(d)}m`:""}),o.jsx(Ws,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>ut(d).format("YYYY-MM-DD"),formatter:d=>d!=null?c(Number(d)):""}),o.jsx(Js,{}),o.jsx(Cy,{type:"monotone",dataKey:"codingTime",name:"编程时长",stroke:"#8b5cf6",fillOpacity:1,fill:"url(#colorCodingTime)"}),o.jsx(Qd,{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(Ms,{width:"100%",height:300,children:o.jsxs(woe,{data:e.byVendor,children:[o.jsx(tc,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(nc,{dataKey:"vendorName",stroke:"var(--text-muted)",fontSize:12,angle:-45,textAnchor:"end",height:80}),o.jsx(rc,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Ws,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"}}),o.jsx(Js,{}),o.jsx(zM,{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(Ms,{width:"100%",height:300,children:o.jsxs(Loe,{children:[o.jsx(sM,{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,p)=>o.jsx(Du,{fill:DP[p%DP.length]},`cell-${p}`))}),o.jsx(Ws,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},formatter:(d,p,m)=>{var b,w;const g=d??0,y=((b=m.payload)==null?void 0:b.percentage)??0,x=((w=m.payload)==null?void 0:w.contentType)||"",v=u[x]||x;return`${g} (${y}%) - ${v}`}})]})})]})]}),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":"Codex"}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:s(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:s(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:s(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:s(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:s(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:s(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:s(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:s(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:s(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:s(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 估算"})]})]})]})]})]})}function LP({isOpen:e,onClose:t,title:n,children:r,showCloseButton:i=!0,closeOnOverlayClick:a=!1,maxWidth:l="600px"}){return e?o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},onClick:s=>{a||s.stopPropagation()},children:[i&&o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:l,width:"90%"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:n})}),r]})})]}):null}function Foe(){const[e,t]=h.useState(!1),[n,r]=h.useState([]),[i,a]=h.useState(!0),[l,s]=h.useState({skillId:null,skillName:"",isDeleting:!1}),[c,u]=h.useState(!1),[f,d]=h.useState({name:"",description:"",instruction:"",link:"",targets:[]}),[p,m]=h.useState(!1),[g,y]=h.useState(!1),[x,v]=h.useState(""),[b,w]=h.useState(""),[j,C]=h.useState(!1),[S,E]=h.useState([]),[I,R]=h.useState(!1),[A,_]=h.useState({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}),N=async()=>{try{a(!0);const Q=await H.getInstalledSkills();r(Q)}catch(Q){console.error("Failed to load installed skills:",Q),U.error("加载已安装 Skills 失败")}finally{a(!1)}};h.useEffect(()=>{N()},[]);const Y=async()=>{const Q=b.trim();if(!Q){U.warning("请输入需求描述后再搜索");return}try{C(!0),R(!0);const fe=(await H.searchSkills(Q)).sort((te,ee)=>{const le=te.stars??0;return(ee.stars??0)-le});E(fe)}catch(ae){console.error("Failed to search skills:",ae),U.error("搜索失败,请稍后重试")}finally{C(!1)}},K=Q=>{_({skill:Q,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},O=()=>{A.isInstalling||_({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},F=(Q,ae)=>{_(fe=>({...fe,selectedTargets:ae?[...fe.selectedTargets,Q]:fe.selectedTargets.filter(te=>te!==Q)}))},W=async()=>{var Q;if(A.skill)try{_(fe=>({...fe,isInstalling:!0,status:"preparing",message:"正在准备安装...",progress:0})),_(fe=>({...fe,status:"downloading",message:"正在从GitHub下载..."}));const ae=await H.installSkill(A.skill,A.selectedTargets[0]);if(ae.success){const fe=A.selectedTargets,te=(Q=ae.installedSkill)==null?void 0:Q.id;if(!te){_(le=>({...le,status:"error",message:"安装返回数据异常"})),U.error("安装返回数据异常");return}let ee=0;for(const le of fe)(await H.enableSkill(te,le)).success&&ee++;_(le=>({...le,status:"completed",message:fe.length>0?`安装完成!已启用 ${ee}/${fe.length} 个目标`:"安装完成!可在列表中启用目标",progress:100})),fe.length>0?U.success(`已安装到 ${fe.map(le=>le==="claude-code"?"Claude Code":"Codex").join(", ")}`):U.success("安装完成!可在列表中启用目标"),await N()}else _(fe=>({...fe,status:"error",message:ae.message?`${ae.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试"})),U.error(ae.message?`${ae.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试")}catch(ae){console.error("Failed to install skill:",ae),_(fe=>({...fe,status:"error",message:"安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理"})),U.error("安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理")}finally{setTimeout(()=>{_(ae=>({...ae,skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}))},2e3)}},M=async(Q,ae,fe)=>{try{fe?(await H.enableSkill(Q,ae),U.success(`已启用 ${ae==="claude-code"?"Claude Code":"Codex"}`)):(await H.disableSkill(Q,ae),U.success(`已禁用 ${ae==="claude-code"?"Claude Code":"Codex"}`)),await N()}catch(te){console.error("Failed to toggle skill:",te),U.error("操作失败,请稍后重试")}},B=Q=>{s({skillId:Q.id,skillName:Q.name,isDeleting:!1})},k=()=>{l.isDeleting||s({skillId:null,skillName:"",isDeleting:!1})},L=async()=>{if(l.skillId)try{s(Q=>({...Q,isDeleting:!0})),await H.deleteSkill(l.skillId),U.success("已删除 Skill"),await N(),k()}catch(Q){console.error("Failed to delete skill:",Q),U.error("删除失败,请稍后重试"),s(ae=>({...ae,isDeleting:!1}))}},X=()=>{try{const Q=x.trim();if(!Q){U.error("请粘贴 SKILL.md 内容");return}let ae="",fe="",te=Q;if(Q.startsWith("---")){const ee=Q.indexOf("---",3);if(ee!==-1){const le=Q.slice(3,ee),ne=Q.match(/^#\s+(.+)$/m);ae=ne?ne[1].trim():"";const Ae=le.split(`
485
- `);for(const be of Ae)be.startsWith("name:")?ae=be.replace("name:","").trim():be.startsWith("description:")&&(fe=be.replace("description:","").trim());te=Q.slice(ee+3).trim(),te=te.replace(/^##\s+指令\n*/,"").trim()}}else{const ee=Q.match(/^#\s+(.+)$/m);ee&&(ae=ee[1].trim())}if(!ae){U.error("无法解析 Skill 名称");return}d(ee=>({...ee,name:ae,description:fe||ee.description,instruction:te||ee.instruction})),y(!1),v(""),U.success("解析成功")}catch(Q){console.error("Failed to parse skill:",Q),U.error("解析失败,请检查格式")}},T=async Q=>{var ae;if(Q.preventDefault(),!f.name.trim()){U.error("请填写 Skill 名称");return}if(!f.description.trim()){U.error("请填写描述");return}if(!f.instruction.trim()){U.error("请填写指令");return}try{m(!0);const fe=await H.createLocalSkill({name:f.name.trim(),description:f.description.trim(),instruction:f.instruction.trim(),link:f.link.trim()||void 0,targets:f.targets});if(fe.success){U.success("Skill 创建成功"),u(!1),d({name:"",description:"",instruction:"",link:"",targets:[]}),await N();for(const te of f.targets)(ae=fe.installedSkill)!=null&&ae.id&&await H.enableSkill(fe.installedSkill.id,te)}else U.error(fe.message||"创建失败")}catch(fe){console.error("Failed to create skill:",fe),U.error("创建失败,请稍后重试")}finally{m(!1)}},ce=()=>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:()=>B(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(Rj,{skillId:Q.id,targetType:"claude-code",enabled:Q.enabledTargets.includes("claude-code"),onChange:M}),o.jsx(Rj,{skillId:Q.id,targetType:"codex",enabled:Q.enabledTargets.includes("codex"),onChange:M})]})]},Q.id))}),ge=()=>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:Y,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&&I&&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(ae=>o.jsx("span",{className:"badge badge-secondary",children:ae},ae))}),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:()=>K(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?ge():ce(),A.skill&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:O,disabled:A.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:A.status==="idle"?"选择安装目标":A.status==="completed"?"安装完成":A.status==="error"?"安装失败":"正在安装"})}),o.jsx("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:A.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{style:{marginBottom:"12px",color:"var(--text-muted)"},children:["即将安装:",o.jsx("strong",{children:A.skill.name})]}),A.skill.description&&o.jsx("p",{style:{marginBottom:"12px",color:"var(--text-muted)",fontSize:"14px"},children:A.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:A.selectedTargets.includes("claude-code"),onChange:Q=>F("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:A.selectedTargets.includes("codex"),onChange:Q=>F("codex",Q.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"Codex"})]})]})]})]}):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:`${A.progress}%`,height:"100%",backgroundColor:A.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:A.message}),A.status==="error"&&o.jsx("p",{style:{textAlign:"center",color:"var(--error)",fontSize:"14px"},children:A.message})]})}),o.jsx("div",{className:"modal-footer",style:{justifyContent:A.status!=="idle"?"center":"space-between"},children:A.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"btn btn-secondary",onClick:O,disabled:A.isInstalling,children:"取消"}),o.jsx("button",{className:"btn btn-primary",onClick:W,disabled:A.isInstalling,children:"确定安装"})]}):A.status==="completed"||A.status==="error"?o.jsx("button",{className:"btn btn-primary",onClick:O,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:"正在处理..."})]})})]})})]}),l.skillId&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000001},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:k,disabled:l.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:l.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:k,disabled:l.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:L,disabled:l.isDeleting,children:l.isDeleting?"删除中...":"确认删除"})]})]})})]}),c&&o.jsx(LP,{isOpen:c,onClose:()=>u(!1),title:"新增 Skill",closeOnOverlayClick:!1,children:o.jsxs("form",{onSubmit:T,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:()=>y(!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:f.name,onChange:Q=>d(ae=>({...ae,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:f.description,onChange:Q=>d(ae=>({...ae,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:f.instruction,onChange:Q=>d(ae=>({...ae,instruction:Q.target.value})),placeholder:`当这个 Skill 被触发时,你希望模型遵循哪些规则或信息,例如:
486
- # codemap
487
- ## 命令
488
- ## 使用场景
489
- ## 输出解释
490
- ## 示例`,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:f.link,onChange:Q=>d(ae=>({...ae,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:f.targets.includes("claude-code"),onChange:Q=>{Q.target.checked?d(ae=>({...ae,targets:[...ae.targets,"claude-code"]})):d(ae=>({...ae,targets:ae.targets.filter(fe=>fe!=="claude-code")}))}}),"Claude Code"]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:f.targets.includes("codex"),onChange:Q=>{Q.target.checked?d(ae=>({...ae,targets:[...ae.targets,"codex"]})):d(ae=>({...ae,targets:ae.targets.filter(fe=>fe!=="codex")}))}}),"Codex"]})]})]}),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/",f.name||"skill-name"]})," 路径对 Skill 内容进行二次编辑"]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>u(!1),disabled:p,children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",disabled:p,children:p?"创建中...":"确认创建"})]})]})}),g&&o.jsxs(LP,{isOpen:g,onClose:()=>{y(!1),v("")},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=>v(Q.target.value),placeholder:`---
491
- name: skill-name
492
- description: Skill 描述
493
- ---
494
-
495
- # Skill 名称
496
-
497
- Skill 描述
498
-
499
- ## 指令
500
-
501
- 技能指令内容...`,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:()=>{y(!1),v("")},children:"取消"}),o.jsx("button",{type:"button",className:"btn btn-primary",onClick:X,children:"解析并填充"})]})]})]})}const Uoe=[{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 Woe(){var Y,K;const[e,t]=h.useState([]),[n,r]=h.useState(!0),[i,a]=h.useState(!1),[l,s]=h.useState(null),[c,u]=h.useState({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),[f,d]=h.useState(!1),[p,m]=h.useState({mcpId:null,mcpName:"",isDeleting:!1}),[g,y]=h.useState({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null}),x=async()=>{try{r(!0);const O=await H.getMCPs();t(O)}catch(O){console.error("Failed to load MCPs:",O),U.error("加载 MCP 工具失败")}finally{r(!1)}};h.useEffect(()=>{x()},[]);const v=()=>{s(null),u({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),a(!0)},b=O=>{s(O),u({name:O.name,description:O.description||"",type:O.type,command:O.command||"",args:O.args?O.args.join(" "):"",url:O.url||"",headers:O.headers?JSON.stringify(O.headers,null,2):"",env:O.env?JSON.stringify(O.env,null,2):"",targets:O.targets||[]}),a(!0)},w=()=>{f||(a(!1),s(null))},j=async O=>{var F,W;if(O.preventDefault(),!c.name.trim()){U.error("请填写 MCP 名称");return}if(c.type==="stdio"&&!c.command){U.error("请填写命令");return}if((c.type==="http"||c.type==="sse")&&!c.url){U.error("请填写 URL");return}try{d(!0);const M={},B={};if(c.env)try{Object.assign(M,JSON.parse(c.env))}catch{U.error("环境变量格式错误,请使用有效的 JSON 格式");return}if(c.headers)try{Object.assign(B,JSON.parse(c.headers))}catch{U.error("请求头格式错误,请使用有效的 JSON 格式");return}const k={name:c.name.trim(),description:c.description.trim(),type:c.type,command:(F=c.command)==null?void 0:F.trim(),args:c.args?c.args.trim().split(/\s+/):void 0,url:(W=c.url)==null?void 0:W.trim(),headers:Object.keys(B).length>0?B:void 0,env:Object.keys(M).length>0?M:void 0,targets:c.targets};l?(await H.updateMCP(l.id,k),U.success("MCP 工具已更新")):(await H.createMCP(k),U.success("MCP 工具已添加")),a(!1),s(null),await x()}catch(M){console.error("Failed to save MCP:",M),U.error("保存失败,请稍后重试")}finally{d(!1)}},C=O=>{m({mcpId:O.id,mcpName:O.name,isDeleting:!1})},S=()=>{p.isDeleting||m({mcpId:null,mcpName:"",isDeleting:!1})},E=async()=>{if(p.mcpId)try{m(O=>({...O,isDeleting:!0})),await H.deleteMCP(p.mcpId),U.success("已删除 MCP 工具"),await x(),S()}catch(O){console.error("Failed to delete MCP:",O),U.error("删除失败,请稍后重试"),m(F=>({...F,isDeleting:!1}))}},I=()=>{y({isOpen:!0,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},R=()=>{g.installingMCPName||y({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},A=O=>{y(F=>({...F,step:"input-api-key",selectedDefinition:O}))},_=async()=>{var O;if(!g.apiKey.trim()){U.error("请填写 API Key");return}if(g.selectedDefinition)try{const F=g.selectedDefinition;y(ce=>({...ce,step:"installing",message:"正在安装...",installingMCPName:F.name}));const W=F.apiKeyEnvName||"Z_AI_API_KEY",M=F.apiKeyIn==="env",B=[];F.env&&Object.entries(F.env).forEach(([ce,ge])=>{ge!==void 0&&B.push([ce,ge])}),M&&B.push([W,g.apiKey.trim()]);const k=B.length>0?Object.fromEntries(B):void 0,X=F.apiKeyIn==="headers"?{Authorization:`Bearer ${g.apiKey.trim()}`}:void 0,T={name:F.name,description:F.description,type:F.type,command:F.command,args:F.args,url:F.url,env:k,headers:X,targets:["claude-code","codex"]};await H.createMCP(T),y(ce=>({...ce,step:"completed",message:`成功安装 ${F.name}`,installingMCPName:null})),U.success(`已安装 ${F.name}`),await x()}catch(F){console.error(`Failed to install ${(O=g.selectedDefinition)==null?void 0:O.id}:`,F),y(W=>({...W,step:"error",message:"安装失败,请稍后重试",installingMCPName:null})),U.error("安装失败,请稍后重试")}},N=O=>{switch(O){case"stdio":return"命令行";case"http":return"HTTP";case"sse":return"SSE";default:return O}};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:I,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:v,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(O=>{var F,W,M;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:O.name}),o.jsx("div",{className:"badge badge-secondary",children:N(O.type)})]}),o.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>b(O),style:{padding:"6px 14px",fontSize:"13px"},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>C(O),style:{padding:"6px 14px",fontSize:"13px"},children:"删除"})]})]}),O.description&&o.jsx("div",{className:"mcp-description",style:{marginTop:"12px",color:"var(--text-muted)",fontSize:"14px"},children:O.description}),o.jsxs("div",{style:{marginTop:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(O.createdAt).toLocaleDateString("zh-CN")]}),O.type==="stdio"&&O.command&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",fontFamily:"monospace",color:"var(--text-muted)"},children:["命令: ",O.command," ",(F=O.args)==null?void 0:F.join(" ")]}),(O.type==="http"||O.type==="sse")&&O.url&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["URL: ",O.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(Bc,{checked:((W=O.targets)==null?void 0:W.includes("claude-code"))??!1,onChange:async B=>{const k=O.targets||[],L=B?[...k,"claude-code"]:k.filter(X=>X!=="claude-code");await H.updateMCP(O.id,{targets:L}),await x()},label:"Claude Code",labelPosition:"right"}),o.jsx(Bc,{checked:((M=O.targets)==null?void 0:M.includes("codex"))??!1,onChange:async B=>{const k=O.targets||[],L=B?[...k,"codex"]:k.filter(X=>X!=="codex");await H.updateMCP(O.id,{targets:L}),await x()},label:"Codex",labelPosition:"right"})]})})]},O.id)})}),i&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:w,disabled:f,"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:l?"编辑 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:O=>u({...c,name:O.target.value}),placeholder:"例如:GLM 视觉理解",disabled:f})]}),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:O=>u({...c,description:O.target.value}),placeholder:"描述该 MCP 工具的功能",disabled:f})]}),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:O=>u({...c,type:O.target.value}),disabled:f,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:O=>u({...c,command:O.target.value}),placeholder:"例如:npx",disabled:f})]}),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:O=>u({...c,args:O.target.value}),placeholder:"例如:-y @z_ai/mcp-server",disabled:f})]})]}),(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:O=>u({...c,url:O.target.value}),placeholder:"例如:https://api.example.com/mcp",disabled:f})]}),(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:O=>u({...c,headers:O.target.value}),placeholder:'{\\n "Authorization": "Bearer your-token"\\n}',disabled:f,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:O=>u({...c,env:O.target.value}),placeholder:'{\\n "API_KEY": "your-key"\\n}',disabled:f,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:O=>u({...c,targets:O.target.checked?[...c.targets,"claude-code"]:c.targets.filter(F=>F!=="claude-code")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:f}),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:O=>u({...c,targets:O.target.checked?[...c.targets,"codex"]:c.targets.filter(F=>F!=="codex")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:f}),o.jsx("span",{children:"Codex"})]})]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",type:"button",onClick:w,disabled:f,children:"取消"}),o.jsx("button",{className:"btn btn-primary",type:"submit",disabled:f,children:f?"保存中...":l?"保存":"添加"})]})]})]})})]}),p.mcpId&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000001},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:S,disabled:p.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:p.mcpName}),'" 吗?此操作无法撤销。']})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:S,disabled:p.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:E,disabled:p.isDeleting,children:p.isDeleting?"删除中...":"删除"})]})]})})]}),g.isOpen&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000002},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:R,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:Uoe.map(O=>{const F=e.some(W=>W.name===O.name);return o.jsxs("div",{className:"card",style:{padding:"16px",cursor:F?"not-allowed":"pointer",transition:"all 0.2s ease",opacity:F?.7:1},onClick:()=>!F&&A(O),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:O.name}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[F&&o.jsx("div",{className:"badge badge-success",style:{fontSize:"12px"},children:"已安装"}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"12px"},children:N(O.type)})]})]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-muted)",marginBottom:"12px"},children:O.description}),o.jsx("button",{className:"btn btn-primary",style:{width:"100%"},disabled:F,children:F?"已安装":"安装"})]},O.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:(Y=g.selectedDefinition)==null?void 0:Y.name}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)"},children:(K=g.selectedDefinition)==null?void 0:K.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:O=>y({...g,apiKey:O.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:()=>y(O=>({...O,step:"select",selectedDefinition:null})),disabled:g.installingMCPName!==null,children:"返回"}),o.jsx("button",{className:"btn btn-primary",onClick:_,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:R,children:"关闭"})})]})})]})]})}function aR({keyName:e,apiKey:t,guide:n,onClose:r}){const i=a=>{navigator.clipboard.writeText(a).then(()=>U.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(s=>Object.keys(s.envVars||{})),l=Math.max(...a.map(s=>s.length),0);return o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginBottom:"20px"},children:Object.entries(n).map(([s,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(([f,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:`${l*8.5}px`},children:f}),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:"复制"})]},f))})]},s)})})})():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:`
502
- .ak-guide-section {
503
- border-radius: 10px;
504
- border: 1px solid var(--border-primary);
505
- overflow: hidden;
506
- background: var(--bg-primary-solid);
507
- }
508
- .ak-guide-section-header {
509
- padding: 10px 16px;
510
- border-bottom: 1px solid var(--border-primary);
511
- background: var(--bg-secondary);
512
- fontWeight: 600;
513
- font-size: 14px;
514
- }
515
- .ak-guide-env-name {
516
- color: var(--color-accent, #8b5cf6);
517
- fontWeight: 600;
518
- fontFamily: "SF Mono", "Fira Code", monospace;
519
- flexShrink: 0;
520
- }
521
- .ak-guide-env-value {
522
- flex: 1;
523
- padding: 6px 10px;
524
- border-radius: 5px;
525
- background: var(--bg-secondary);
526
- wordBreak: break-all;
527
- fontSize: 12px;
528
- fontFamily: "SF Mono", "Fira Code", monospace;
529
- }
530
- [data-theme="dark"] .ak-guide-section {
531
- background: #0C1F12;
532
- border-color: rgba(167, 243, 208, 0.15);
533
- }
534
- [data-theme="dark"] .ak-guide-section-header {
535
- background: rgba(30, 58, 40, 0.95);
536
- border-color: rgba(167, 243, 208, 0.15);
537
- }
538
- [data-theme="dark"] .ak-guide-env-value {
539
- background: rgba(30, 58, 40, 0.95);
540
- }
541
- `})]})}function Koe(){const[e,t]=h.useState([]),[n,r]=h.useState([]),[i,a]=h.useState([]),[l,s]=h.useState([]),[c,u]=h.useState([]),[f,d]=h.useState(0),[p,m]=h.useState(1),g=20,[y,x]=h.useState(!0),[v,b]=h.useState(""),[w,j]=h.useState(""),[C,S]=h.useState(new Set),[E,I]=h.useState(!1),[R,A]=h.useState(null),[_,N]=h.useState(""),[Y,K]=h.useState(""),[O,F]=h.useState(""),[W,M]=h.useState(!1),[B,k]=h.useState(()=>localStorage.getItem("policies-panel-open")==="true"),[L,X]=h.useState(null),[T,ce]=h.useState(!1),[ge,Q]=h.useState(""),[ae,fe]=h.useState(""),[te,ee]=h.useState("system"),[le,ne]=h.useState(""),[Ae,be]=h.useState(""),[Re,$e]=h.useState(""),[xe,Ie]=h.useState(""),[Te,Ve]=h.useState(""),[Ge,Ke]=h.useState([]),[gt,Nt]=h.useState([]),[Z,G]=h.useState("none"),[oe,D]=h.useState(""),[se,he]=h.useState([]),[Ee,Pe]=h.useState(!1),De=h.useRef(null),{confirm:Le}=uu(),We=h.useRef(null);h.useEffect(()=>{if(!W)return;const $=z=>{We.current&&!We.current.contains(z.target)&&M(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[W]);const Be=async()=>{x(!0);try{const $=await H.getAccessKeys({page:p,pageSize:g,status:v||void 0,search:w||void 0});t($.data),d($.total)}catch($){U.error("加载密钥列表失败: "+$.message)}finally{x(!1)}},Xe=async()=>{try{const[$,z,ye]=await Promise.all([H.getPolicies().catch(()=>[]),H.getRoutes().catch(()=>[]),H.getPolicyTemplates().catch(()=>[])]);r($),a(z),s(ye)}catch{}};h.useEffect(()=>{Be()},[p,v,w]),h.useEffect(()=>{Xe()},[]),h.useEffect(()=>{H.getWriteLocalRecords().then(u).catch(()=>{})},[e]);const ct=async()=>{if(!_.trim()){U.error("请输入密钥名称");return}try{const $=await H.createAccessKey({name:_.trim(),remark:Y||void 0,policyId:O||void 0});I(!1),A($),N(""),K(""),F(""),Be()}catch($){U.error("创建失败: "+$.message)}},fn=async $=>{try{await H.updateAccessKey($.id,{status:$.status==="active"?"disabled":"active"}),U.success($.status==="active"?"已停用":"已启用"),Be()}catch(z){U.error("操作失败: "+z.message)}},V=async $=>{if(await Le({message:`确定删除密钥「${$.name}」吗?`}))try{await H.deleteAccessKey($.id),U.success("已删除"),Be()}catch(ye){U.error("删除失败: "+ye.message)}},me=async $=>{if(await Le({message:"重新生成后旧密钥将立即失效,确定继续吗?"}))try{const ye=await H.regenerateAccessKey($.id);A({key:{...$,apiKey:ye.apiKey},apiKey:ye.apiKey}),Be()}catch(ye){U.error("重新生成失败: "+ye.message)}},[we,_e]=h.useState(null),nt=async $=>{try{const z=await H.getAccessKeyGuide($.id);_e({key:$,guide:z})}catch(z){U.error("获取指引失败: "+z.message)}},Ze=async $=>{if(C.size!==0)try{await H.batchUpdateAccessKeyStatus(Array.from(C),$),U.success(`已批量${$==="active"?"启用":"停用"} ${C.size} 个密钥`),S(new Set),M(!1),Be()}catch(z){U.error("批量操作失败: "+z.message)}},bt=async()=>{if(!(C.size===0||!await Le({message:`确定删除选中的 ${C.size} 个密钥吗?`})))try{await H.batchDeleteAccessKeys(Array.from(C)),U.success(`已删除 ${C.size} 个密钥`),S(new Set),M(!1),Be()}catch(z){U.error("批量删除失败: "+z.message)}},jn=async $=>{if(!(C.size===0||!$))try{await H.batchBindAccessKeyPolicy(Array.from(C),$),U.success("已批量绑定策略"),S(new Set),M(!1),Be()}catch(z){U.error("批量绑定失败: "+z.message)}},Qt=$=>{const z=new Set(C);z.has($)?z.delete($):z.add($),S(z)},wr=()=>S(C.size===e.length?new Set:new Set(e.map($=>$.id))),Xn=$=>navigator.clipboard.writeText($).then(()=>U.success("已复制")),pn=()=>{Q(""),fe(""),ee(""),ne(""),be(""),$e(""),Ie(""),Ve(""),Ke([]),Nt([]),G("none"),D("")},$t=$=>{var z,ye,qe,Oe,pt,Vt,Fr;$?(X($),Q($.name),fe($.description||""),ee($.routeId||"system"),ne(((z=$.dailyTokenLimit)==null?void 0:z.toString())||""),be(((ye=$.monthlyTokenLimit)==null?void 0:ye.toString())||""),$e(((qe=$.dailyRequestLimit)==null?void 0:qe.toString())||""),Ie(((Oe=$.rpmLimit)==null?void 0:Oe.toString())||""),Ve(((pt=$.concurrentLimit)==null?void 0:pt.toString())||""),Ke($.allowedModels||[]),Nt($.blockedModels||[]),G((Vt=$.allowedModels)!=null&&Vt.length?"allow":(Fr=$.blockedModels)!=null&&Fr.length?"block":"none")):(X(null),pn()),ce(!0),jr()},jr=async()=>{try{const $=await H.getVendors(),z=new Map;($||[]).forEach(ye=>{const qe=ye.name||"";(ye.services||[]).forEach(Oe=>{(Oe.supportedModels||[]).forEach(pt=>{z.has(pt)||z.set(pt,new Set),z.get(pt).add(qe)})})}),he(Array.from(z.entries()).map(([ye,qe])=>({name:ye,vendors:Array.from(qe)})).sort((ye,qe)=>ye.name.localeCompare(qe.name)))}catch{}},hn=Z==="allow"?Ge:gt,ft=oe.trim()?se.filter($=>$.name.toLowerCase().includes(oe.toLowerCase())&&!hn.includes($.name)):se.filter($=>!hn.includes($.name)),Ii=$=>{var ye,qe,Oe,pt,Vt;const z=$.config;Q(z.name||""),fe($.description),ne(((ye=z.dailyTokenLimit)==null?void 0:ye.toString())||""),be(((qe=z.monthlyTokenLimit)==null?void 0:qe.toString())||""),$e(((Oe=z.dailyRequestLimit)==null?void 0:Oe.toString())||""),Ie(((pt=z.rpmLimit)==null?void 0:pt.toString())||""),Ve(((Vt=z.concurrentLimit)==null?void 0:Vt.toString())||""),U.success(`已应用模板: ${$.name}`)},Qa=async()=>{if(!ge.trim()){U.error("请输入策略名称");return}const $={name:ge.trim(),description:ae||void 0,routeId:te==="system"?"system":te||void 0,dailyTokenLimit:le?Number(le):void 0,monthlyTokenLimit:Ae?Number(Ae):void 0,dailyRequestLimit:Re?Number(Re):void 0,rpmLimit:xe?Number(xe):void 0,concurrentLimit:Te?Number(Te):void 0,allowedModels:Z==="allow"?Ge:void 0,blockedModels:Z==="block"?gt:void 0};try{L?(await H.updatePolicy(L.id,$),U.success("策略已更新")):(await H.createPolicy($),U.success("策略已创建")),ce(!1),Xe(),Be()}catch(z){U.error("保存失败: "+z.message)}},el=async $=>{if($.keyCount&&$.keyCount>0){U.error(`有 ${$.keyCount} 个密钥正在使用此策略,请先解除绑定`);return}if(await Le({message:`确定删除策略「${$.name}」吗?`}))try{await H.deletePolicy($.id),U.success("已删除"),Xe(),Be()}catch(ye){U.error("删除失败: "+ye.message)}},tl=async $=>{try{await H.duplicatePolicy($.id),U.success("已复制"),Xe()}catch(z){U.error("复制失败: "+z.message)}},la=($,z)=>{const ye=oe.trim();ye&&!$.includes(ye)&&(z([...$,ye]),D(""))},nl=$=>{var z;return(z=i.find(ye=>ye.id===$))==null?void 0:z.name},Ja=$=>{const z=[];return $.dailyTokenLimit&&z.push(`日${$.dailyTokenLimit}k`),$.monthlyTokenLimit&&z.push(`月${$.monthlyTokenLimit}k`),$.dailyRequestLimit&&z.push(`日${$.dailyRequestLimit}次`),$.rpmLimit&&z.push(`RPM ${$.rpmLimit}`),$.concurrentLimit&&z.push(`并发${$.concurrentLimit}`),z.length>0?z.join(", "):"无限制"},sa=Math.ceil(f/g),Ht={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:()=>{I(!0),Xe()},style:{height:"45px"},children:"+ 创建密钥"}),o.jsxs("button",{className:`btn ${B?"btn-primary":"btn-secondary"}`,onClick:()=>{const $=!B;k($),localStorage.setItem("policies-panel-open",String($)),$&&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:B?"var(--color-success, #22c55e)":"transparent",flexShrink:0,transition:"all 0.25s"},children:B&&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:B?"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:v,onChange:$=>{b($.target.value),m(1)},style:Ht,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:$=>{j($.target.value),m(1)},style:{...Ht,minWidth:"200px"}})]}),C.size>0&&o.jsxs("div",{ref:We,style:{position:"relative",flexShrink:0},children:[o.jsxs("button",{className:"ak-action-btn",onClick:()=>M(!W),children:["批量操作 (",C.size,") ▾"]}),W&&o.jsxs("div",{className:"ak-dropdown-menu",children:[o.jsx("button",{className:"dropdown-btn",onClick:()=>Ze("active"),children:"批量启用"}),o.jsx("button",{className:"dropdown-btn",onClick:()=>Ze("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:$=>{$.target.value&&jn($.target.value)},children:[o.jsx("option",{value:"",children:"批量绑定策略..."}),n.map($=>o.jsx("option",{value:$.id,children:$.name},$.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:bt,children:"批量删除"})]})]})]}),y?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:C.size===e.length&&e.length>0,onChange:wr})}),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:f===0?"暂无密钥,点击「创建密钥」开始":"无匹配结果"})}):e.map($=>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:C.has($.id),onChange:()=>Qt($.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/${$.id}`,style:{color:"var(--color-primary)",textDecoration:"none",fontWeight:500},children:$.name}),(()=>{const z=c.find(ye=>ye.accessKeyId===$.id);return z?z.targets.map(ye=>o.jsx("span",{style:{display:"inline-block",padding:"1px 6px",borderRadius:"8px",fontSize:"11px",lineHeight:"16px",background:ye==="claude-code"?"#cc7832":"#000",color:"#fff"},children:ye==="claude-code"?"Claude Code":"Codex"},ye)):null})()]}),$.remark&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:$.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:$.apiKey})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px"},children:$.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:$.status==="active"?"#22c55e":"var(--text-tertiary)"},title:$.status==="active"?"启用":"停用"})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:new Date($.createdAt).toLocaleDateString()}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:$.lastActiveAt?new Date($.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:()=>nt($),title:"接入指引",children:"📋"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>fn($),title:$.status==="active"?"停用":"启用",children:$.status==="active"?"⏸":"▶"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>me($),title:"重新生成",children:"🔄"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>V($),title:"删除",children:"✕"})]})})]},$.id))})]})}),sa>1&&o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"8px",marginTop:"16px"},children:[o.jsx("button",{className:"btn btn-sm",disabled:p<=1,onClick:()=>m(p-1),children:"‹"}),o.jsxs("span",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:[p,"/",sa," · 共 ",f," 个"]}),o.jsx("button",{className:"btn btn-sm",disabled:p>=sa,onClick:()=>m(p+1),children:"›"})]})]})}),o.jsx("div",{style:{width:B?"480px":"0",overflow:"hidden",transition:"width 0.35s ease, opacity 0.35s ease",opacity:B?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:()=>$t(),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($=>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:["📋 ",$.name]}),$.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"12px"},children:$.description})]}),o.jsxs("div",{style:{display:"flex",gap:"4px"},children:[o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>$t($),children:"编辑"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>tl($),children:"复制"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>el($),children:"删除"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"16px",fontSize:"12px",color:"var(--text-secondary)"},children:[o.jsxs("span",{children:["🔗 路由: ",$.routeId&&$.routeId!=="system"?nl($.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: ",$.keyCount||0]}),o.jsxs("span",{children:["📊 配额: ",Ja($)]})]})]},$.id))})})]})})})]}),E&&o.jsx("div",{className:"modal-overlay",onClick:()=>I(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"480px",padding:"28px"},onClick:$=>$.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>I(!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:_,onChange:$=>N($.target.value),placeholder:"例如:张三 - 前端组",autoFocus:!0,style:{...Ht,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:Y,onChange:$=>K($.target.value),placeholder:"补充说明信息",style:{...Ht,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:O,onChange:$=>F($.target.value),style:{...Ht,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"",children:"稍后配置"}),n.map($=>o.jsx("option",{value:$.id,children:$.name},$.id))]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>I(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:ct,className:"ak-modal-btn-primary",children:"创建密钥"})]})]})}),R&&o.jsx("div",{className:"modal-overlay",onClick:()=>A(null),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:$=>$.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>A(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:R.apiKey})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[o.jsx("button",{onClick:()=>Xn(R.apiKey),className:"ak-modal-btn-primary",children:"📋 复制 Key"}),o.jsx("button",{onClick:()=>A(null),className:"ak-modal-btn-secondary",children:"完成"})]})]})}),T&&o.jsx("div",{className:"modal-overlay",onClick:()=>ce(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:$=>$.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>ce(!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:L?"编辑策略":"创建策略"}),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:ge,onChange:$=>Q($.target.value),placeholder:"例如:中度限制策略",style:{...Ht,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:ae,onChange:$=>fe($.target.value),placeholder:"适合普通开发者使用",style:{...Ht,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:te,onChange:$=>ee($.target.value),style:{...Ht,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"system",children:"按系统默认"}),i.map($=>o.jsx("option",{value:$.id,children:$.name},$.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:"配额限制"}),!L&&l.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:$=>{$.target.value&&(Ii(l[Number($.target.value)]),$.target.value="")},children:[o.jsx("option",{value:"",children:"📋 使用模板..."}),l.map(($,z)=>o.jsxs("option",{value:String(z),children:[$.name," — ",$.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:le,onChange:$=>ne($.target.value),placeholder:"不限",style:{...Ht,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:Ae,onChange:$=>be($.target.value),placeholder:"不限",style:{...Ht,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:Re,onChange:$=>$e($.target.value),placeholder:"不限",style:{...Ht,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:xe,onChange:$=>Ie($.target.value),placeholder:"不限",style:{...Ht,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:Te,onChange:$=>Ve($.target.value),placeholder:"不限",style:{...Ht,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:Z!=="none"?"12px":"0"},children:[{value:"none",label:"不限制",desc:"允许所有模型"},{value:"allow",label:"白名单",desc:"仅允许指定模型"},{value:"block",label:"黑名单",desc:"禁止指定模型"}].map($=>o.jsxs("label",{className:`policy-model-opt ${Z===$.value?"policy-model-opt--active":""}`,children:[o.jsx("input",{type:"radio",name:"modelMode",value:$.value,checked:Z===$.value,onChange:()=>G($.value),style:{display:"none"}}),o.jsx("div",{style:{fontWeight:600,fontSize:"14px",marginBottom:"2px"},children:$.label}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)"},children:$.desc})]},$.value))}),Z!=="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:De,type:"text",value:oe,onChange:$=>{D($.target.value),Pe(!0)},onFocus:()=>Pe(!0),onBlur:()=>setTimeout(()=>Pe(!1),150),placeholder:se.length>0?"搜索或输入模型名...":"输入模型名,回车确认...",autoFocus:!0,onKeyDown:$=>{$.key==="Enter"&&($.preventDefault(),la(Z==="allow"?Ge:gt,Z==="allow"?Ke:Nt)),$.key==="Escape"&&Pe(!1)},style:{...Ht,width:"100%",padding:"8px 12px",borderRadius:"6px",fontSize:"13px"}}),Ee&&ft.length>0&&o.jsx("div",{className:"ak-model-suggest",children:ft.map($=>o.jsxs("button",{className:"ak-model-suggest-item",onMouseDown:z=>{var Oe;z.preventDefault();const ye=Z==="allow"?Ge:gt,qe=Z==="allow"?Ke:Nt;ye.includes($.name)||qe([...ye,$.name]),D(""),Pe(!1),(Oe=De.current)==null||Oe.focus()},children:[o.jsx("span",{children:$.name}),o.jsx("span",{children:$.vendors.join(", ")})]},$.name))})]}),o.jsx("button",{className:"btn btn-primary btn-sm",style:{padding:"8px 14px",borderRadius:"6px"},onClick:()=>la(Z==="allow"?Ge:gt,Z==="allow"?Ke:Nt),children:"添加"})]}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",minHeight:"24px"},children:[(Z==="allow"?Ge:gt).length===0&&o.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)",padding:"4px 0"},children:Z==="allow"?"尚未添加模型,至少需要添加一个模型才能生效":"尚未添加模型,不添加则不对任何模型进行屏蔽"}),(Z==="allow"?Ge:gt).map(($,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:[$,o.jsx("button",{style:{border:"none",background:"none",cursor:"pointer",padding:"0 2px",color:"var(--text-tertiary)",fontSize:"14px",lineHeight:1},onClick:()=>{(Z==="allow"?Ke:Nt)((Z==="allow"?Ge:gt).filter((Oe,pt)=>pt!==z))},children:"×"})]},z))]})]})]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>ce(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Qa,className:"ak-modal-btn-primary",children:L?"保存修改":"创建策略"})]})]})}),we&&o.jsx(aR,{keyName:we.key.name,apiKey:we.key.apiKey,guide:we.guide,onClose:()=>_e(null)}),o.jsx("style",{children:`
542
- .dropdown-btn {
543
- display: block; width: 100%; padding: 6px 10px; text-align: left;
544
- border: none; background: none; cursor: pointer; font-size: 13px;
545
- color: var(--text-primary);
546
- }
547
- .dropdown-btn:hover { background: var(--bg-secondary); }
548
-
549
- /* 操作按钮 - 列表/策略面板中的小按钮 */
550
- .ak-action-btn {
551
- padding: 4px 10px; border-radius: 6px;
552
- border: 1px solid var(--border-primary);
553
- background: var(--bg-secondary);
554
- color: var(--text-secondary);
555
- cursor: pointer; font-size: 13px;
556
- transition: all 0.15s;
557
- }
558
- .ak-action-btn:hover {
559
- background: var(--bg-route-item-hover);
560
- border-color: var(--text-secondary);
561
- }
562
- .ak-action-btn--danger {
563
- color: var(--accent-danger);
564
- }
565
- .ak-action-btn--danger:hover {
566
- background: rgba(220, 38, 38, 0.1);
567
- border-color: var(--accent-danger);
568
- }
569
-
570
- /* 模型自动补全下拉 */
571
- .ak-model-suggest {
572
- position: absolute; left: 0; right: 0; bottom: 100%; z-index: 50;
573
- margin-top: 4px; max-height: 240px; overflow-y: auto;
574
- background: var(--bg-primary-solid); border: 1px solid var(--border-primary);
575
- border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
576
- padding: 4px 0;
577
- }
578
- .ak-model-suggest-item {
579
- display: flex; justify-content: space-between; align-items: center; gap: 8px;
580
- width: 100%; padding: 7px 12px;
581
- border: none; background: none; cursor: pointer;
582
- font-size: 13px; color: var(--text-primary); text-align: left;
583
- }
584
- .ak-model-suggest-item > span:first-child {
585
- font-family: "SF Mono", "Fira Code", monospace;
586
- white-space: nowrap;
587
- }
588
- .ak-model-suggest-item > span:last-child {
589
- color: #999; font-size: 11px; white-space: nowrap; flex-shrink: 0;
590
- }
591
- [data-theme="dark"] .ak-model-suggest-item > span:last-child {
592
- color: #888;
593
- }
594
- .ak-model-suggest-item:hover {
595
- background: var(--bg-secondary);
596
- }
597
- [data-theme="dark"] .ak-model-suggest {
598
- background: #0C1F12;
599
- border-color: rgba(167, 243, 208, 0.2);
600
- }
601
- [data-theme="dark"] .ak-model-suggest-item:hover {
602
- background: rgba(30, 58, 40, 0.95);
603
- }
604
-
605
- /* 批量操作按钮 */
606
- .ak-action-btn[onClick] {
607
- padding: 6px 12px;
608
- }
609
-
610
- /* 下拉菜单 */
611
- .ak-dropdown-menu {
612
- position: absolute; right: 0; top: 100%; z-index: 100;
613
- background: var(--bg-primary-solid);
614
- border: 1px solid var(--border-primary);
615
- border-radius: 6px;
616
- box-shadow: 0 4px 12px rgba(0,0,0,0.15);
617
- min-width: 140px; padding: 4px 0;
618
- }
619
-
620
- /* 弹窗按钮 */
621
- .ak-modal-btn-primary {
622
- padding: 10px 28px; border-radius: 8px; border: none;
623
- background: var(--color-primary, #3b82f6); color: #fff;
624
- cursor: pointer; font-size: 14px; font-weight: 600;
625
- transition: opacity 0.15s;
626
- }
627
- .ak-modal-btn-primary:hover { opacity: 0.9; }
628
-
629
- .ak-modal-btn-secondary {
630
- padding: 10px 24px; border-radius: 8px;
631
- border: 1px solid var(--border-primary);
632
- background: var(--bg-secondary);
633
- color: var(--text-primary);
634
- cursor: pointer; font-size: 14px; font-weight: 500;
635
- transition: all 0.15s;
636
- }
637
- .ak-modal-btn-secondary:hover {
638
- background: var(--bg-route-item-hover);
639
- }
640
-
641
- /* 模型过滤选项 */
642
- .policy-model-opt {
643
- cursor: pointer; padding: 10px 14px; border-radius: 8px;
644
- flex: 1; text-align: center; transition: all 0.2s;
645
- border: 1px solid var(--border-primary);
646
- background: transparent;
647
- }
648
- .policy-model-opt:hover {
649
- background: rgba(59,130,246,0.05);
650
- }
651
- .policy-model-opt--active {
652
- border: 2px solid var(--color-primary, #3b82f6);
653
- background: rgba(59,130,246,0.12);
654
- }
655
- .policy-model-opt--active:hover {
656
- background: rgba(59,130,246,0.18);
657
- }
658
-
659
- /* ========== 深色模式 ========== */
660
- [data-theme="dark"] .ak-action-btn {
661
- background: rgba(30, 58, 40, 0.95);
662
- border-color: rgba(167, 243, 208, 0.2);
663
- color: #A7F3D0;
664
- }
665
- [data-theme="dark"] .ak-action-btn:hover {
666
- background: rgba(40, 75, 52, 0.95);
667
- border-color: rgba(167, 243, 208, 0.4);
668
- }
669
- [data-theme="dark"] .ak-action-btn--danger {
670
- color: #EF4444;
671
- }
672
- [data-theme="dark"] .ak-action-btn--danger:hover {
673
- background: rgba(239, 68, 68, 0.15);
674
- border-color: rgba(239, 68, 68, 0.5);
675
- }
676
- [data-theme="dark"] .ak-dropdown-menu {
677
- background: #0C1F12;
678
- border-color: rgba(167, 243, 208, 0.2);
679
- }
680
- [data-theme="dark"] .ak-modal-btn-secondary {
681
- background: rgba(30, 58, 40, 0.95);
682
- border-color: rgba(167, 243, 208, 0.2);
683
- color: #ECFEF5;
684
- }
685
- [data-theme="dark"] .ak-modal-btn-secondary:hover {
686
- background: rgba(40, 75, 52, 0.95);
687
- border-color: rgba(167, 243, 208, 0.35);
688
- }
689
- [data-theme="dark"] .policy-model-opt:hover {
690
- background: rgba(96,165,250,0.12);
691
- }
692
- [data-theme="dark"] .policy-model-opt--active {
693
- background: rgba(96,165,250,0.28);
694
- border-color: #60a5fa;
695
- }
696
- [data-theme="dark"] .policy-model-opt--active:hover {
697
- background: rgba(96,165,250,0.38);
698
- }
699
- [data-theme="dark"] .page-container select option {
700
- background: #0C1F12;
701
- color: #ECFEF5;
702
- }
703
- [data-theme="dark"] .page-container textarea,
704
- [data-theme="dark"] .page-container input[type="text"],
705
- [data-theme="dark"] .page-container input[type="number"] {
706
- color-scheme: dark;
707
- }
708
- `})]})}function qoe(){var Ja,sa,Ht,$;const{id:e}=Bz(),t=Vp(),{confirm:n}=uu(),[r,i]=h.useState(null),[a,l]=h.useState([]),[s,c]=h.useState([]),[u,f]=h.useState(!0),[d,p]=h.useState("info"),[m,g]=h.useState(null),[y,x]=h.useState([]),[v,b]=h.useState(30),[w,j]=h.useState([]),[C,S]=h.useState(0),[E,I]=h.useState(1),[R,A]=h.useState(20),[_,N]=h.useState(""),[Y,K]=h.useState(""),[O,F]=h.useState(""),[W,M]=h.useState(""),[B,k]=h.useState(null),[L,X]=h.useState(!1),[T,ce]=h.useState(10),ge=h.useRef(null),[Q,ae]=h.useState(!1),[fe,te]=h.useState(""),[ee,le]=h.useState(""),[ne,Ae]=h.useState(""),[be,Re]=h.useState(null),[$e,xe]=h.useState(!1),[Ie,Te]=h.useState({"claude-code":!0,codex:!0}),[Ve,Ge]=h.useState(!1),[Ke,gt]=h.useState([]),[Nt,Z]=h.useState(0),[G,oe]=h.useState(1),[D,se]=h.useState(20),[he,Ee]=h.useState(""),[Pe,De]=h.useState(""),[Le,We]=h.useState(null),[Be,Xe]=h.useState([]),[ct,fn]=h.useState(!1),[V,me]=h.useState(!1),[we,_e]=h.useState(10),nt=h.useRef(null),Ze=h.useCallback(async()=>{if(e)try{const[z,ye,qe]=await Promise.all([H.getAccessKey(e).catch(()=>null),H.getPolicies().catch(()=>[]),H.getRoutes().catch(()=>[])]);if(!z){U.error("密钥不存在"),t("/access-keys");return}i(z),l(ye),c(qe),te(z.name),le(z.remark||""),Ae(z.policyId||"")}catch(z){U.error("加载数据失败: "+z.message)}finally{f(!1)}},[e,t]),bt=h.useCallback(async()=>{if(e)try{const[z,ye]=await Promise.all([H.getAccessKeyUsage(e).catch(()=>null),H.getAccessKeyUsageTrend(e,v).catch(()=>[])]);g(z),x(ye)}catch{}},[e,v]),jn=h.useCallback(async()=>{if(e)try{const z=await H.getAccessKeyLogs(e,{page:E,pageSize:R,startDate:_||void 0,endDate:Y||void 0,contentType:O||void 0,search:W||void 0});j(z.data),S(z.total)}catch{}},[e,E,R,_,Y,O,W]),Qt=h.useCallback(async()=>{if(e)try{const z=await H.getAccessKeySessions(e,{page:G,pageSize:D,targetType:Pe||void 0,search:he||void 0});gt(z.data),Z(z.total)}catch{}},[e,G,D,Pe,he]);h.useEffect(()=>{Ze()},[Ze]),h.useEffect(()=>{d==="stats"&&bt(),d==="logs"&&jn(),d==="sessions"&&Qt()},[d,bt,jn,Qt]),h.useEffect(()=>{if(L&&d==="logs")return ge.current=setInterval(()=>{ce(z=>z<=1?(jn(),10):z-1)},1e3),()=>{ge.current&&clearInterval(ge.current)};ge.current&&clearInterval(ge.current),ce(10)},[L,d,jn]),h.useEffect(()=>{if(V&&d==="sessions")return nt.current=setInterval(()=>{_e(z=>z<=1?(Qt(),10):z-1)},1e3),()=>{nt.current&&clearInterval(nt.current)};nt.current&&clearInterval(nt.current),_e(10)},[V,d,Qt]);const wr=async()=>{if(!(!e||!fe.trim()))try{await H.updateAccessKey(e,{name:fe.trim(),remark:ee||void 0,policyId:ne||void 0}),U.success("已保存"),ae(!1),Ze()}catch(z){U.error("保存失败: "+z.message)}},Xn=async()=>{if(r)try{await H.updateAccessKey(r.id,{status:r.status==="active"?"disabled":"active"}),U.success(r.status==="active"?"已停用":"已启用"),Ze()}catch(z){U.error("操作失败: "+z.message)}},pn=async()=>{if(!(!r||!await n({message:"确定删除此密钥吗?删除后不可恢复。"})))try{await H.deleteAccessKey(r.id),U.success("已删除"),t("/access-keys")}catch(ye){U.error("删除失败: "+ye.message)}},$t=async()=>{if(r)try{const z=await H.getAccessKeyGuide(r.id);Re({key:r,guide:z})}catch(z){U.error("获取指引失败: "+z.message)}},jr=async()=>{var z,ye;if(r)try{const qe=await H.getAccessKeyGuide(r.id),Oe=((ye=(z=qe==null?void 0:qe.claudeCode)==null?void 0:z.envVars)==null?void 0:ye.ANTHROPIC_AUTH_TOKEN)||r.apiKey;await navigator.clipboard.writeText(Oe),U.success("已复制到剪贴板")}catch{try{await navigator.clipboard.writeText(r.apiKey),U.success("已复制到剪贴板")}catch{U.error("复制失败")}}},hn=async()=>{if(!r)return;const z=Object.entries(Ie).filter(([,ye])=>ye).map(([ye])=>ye);if(z.length===0){U.error("请选择至少一个目标");return}Ge(!0);try{await H.writeAccessKeyToLocal(r.id,z),U.success("已写入本地配置文件"),xe(!1)}catch(ye){U.error("写入失败: "+(ye.message||"未知错误"))}finally{Ge(!1)}},ft=z=>z>=1e6?(z/1e6).toFixed(1)+"M":z>=1e3?(z/1e3).toFixed(1)+"k":String(z),Ii=z=>z?new Date(z).toLocaleString():"-",Qa={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 el=m&&m.lifetime.totalRequests>0?((m.lifetime.totalRequests-m.lifetime.errorCount)/m.lifetime.totalRequests*100).toFixed(1):"-",tl=Math.max(...y.map(z=>z.tokens),1),la=Math.max(...y.map(z=>z.requests),1),nl=[{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:()=>ae(!0),children:"编辑"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:()=>xe(!0),children:"💾 写入本地"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:Xn,children:r.status==="active"?"停用":"启用"}),o.jsx("button",{className:"ak-action-btn ak-action-btn--danger",style:{padding:"6px 14px"},onClick:pn,children:"删除"})]}),o.jsx("div",{className:"ak-tab-bar",style:{display:"flex",gap:"0",borderBottom:"2px solid var(--border-primary)",marginBottom:"20px"},children:nl.map(z=>o.jsx("button",{className:`ak-tab-btn ${d===z.key?"ak-tab-btn--active":""}`,onClick:()=>p(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:jr,title:"复制",children:"📋"}),o.jsx("button",{className:"ak-action-btn",onClick:$t,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:Ii(r.createdAt)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"最后活跃"}),o.jsx("div",{style:{fontSize:"14px"},children:Ii(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:ft(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 Fr,Za,ws,eo,js;const z=a.find(Fe=>Fe.id===r.policyId),ye=z!=null&&z.routeId&&z.routeId!=="system"?(Fr=s.find(Fe=>Fe.id===z.routeId))==null?void 0:Fr.name:void 0,qe=Fe=>{const Bt=[];return Fe.dailyTokenLimit&&Bt.push(`日 ${Fe.dailyTokenLimit}k Token`),Fe.weeklyTokenLimit&&Bt.push(`周 ${Fe.weeklyTokenLimit}k Token`),Fe.monthlyTokenLimit&&Bt.push(`月 ${Fe.monthlyTokenLimit}k Token`),Fe.customTokenLimit&&Fe.customTokenResetHours&&Bt.push(`${Fe.customTokenResetHours}h ${Fe.customTokenLimit}k Token`),Fe.dailyRequestLimit&&Bt.push(`日 ${Fe.dailyRequestLimit} 次请求`),Fe.weeklyRequestLimit&&Bt.push(`周 ${Fe.weeklyRequestLimit} 次请求`),Fe.monthlyRequestLimit&&Bt.push(`月 ${Fe.monthlyRequestLimit} 次请求`),Fe.customRequestLimit&&Fe.customRequestResetHours&&Bt.push(`${Fe.customRequestResetHours}h ${Fe.customRequestLimit} 次请求`),Fe.rpmLimit&&Bt.push(`RPM ${Fe.rpmLimit}`),Fe.concurrentLimit&&Bt.push(`并发 ${Fe.concurrentLimit}`),Bt.length>0?Bt:null},Oe=(Za=z==null?void 0:z.allowedModels)!=null&&Za.length?z.allowedModels:(ws=z==null?void 0:z.blockedModels)!=null&&ws.length?z.blockedModels:null,pt=(eo=z==null?void 0:z.allowedModels)!=null&&eo.length?"allow":(js=z==null?void 0:z.blockedModels)!=null&&js.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 Vt=qe(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:ye?o.jsx("span",{children:ye}):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:"📊 配额限制"}),Vt?o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:Vt.map((Fe,Bt)=>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:Fe},Bt))}):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:"🏷️ 模型过滤"}),pt==="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:pt==="allow"?"✅ 白名单模式 — 仅允许以下模型":"🚫 黑名单模式 — 禁止以下模型"}),o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Oe.map((Fe,Bt)=>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:Fe},Bt))})]})]})]})})(),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:ft(m.lifetime.totalTokens)},{label:"累计请求",value:String(m.lifetime.totalRequests)},{label:"成功率",value:el+"%"},{label:"错误数",value:String(m.lifetime.errorCount)},{label:"输入 Token",value:ft(m.lifetime.inputTokens)},{label:"输出 Token",value:ft(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 ${v===z?"ak-action-btn--active":""}`,style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>b(z),children:[z,"天"]},z))})]}),y.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:y.slice(-v).map((z,ye)=>o.jsx("div",{style:{flex:1,minWidth:0,height:tl>0?`${Math.max(2,z.tokens/tl*100)}%`:"2px",background:"var(--color-primary, #3b82f6)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${ft(z.tokens)}`},ye))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(Ja=y[0])==null?void 0:Ja.date}),o.jsx("span",{children:(sa=y[y.length-1])==null?void 0:sa.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:y.slice(-v).map((z,ye)=>o.jsx("div",{style:{flex:1,minWidth:0,height:la>0?`${Math.max(2,z.requests/la*100)}%`:"2px",background:"var(--color-success, #22c55e)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${z.requests} 请求`},ye))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(Ht=y[0])==null?void 0:Ht.date}),o.jsx("span",{children:($=y[y.length-1])==null?void 0:$.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:y.slice(-v).map((z,ye)=>{const qe=Math.max(...y.map(Oe=>Oe.errors),1);return o.jsx("div",{style:{flex:1,minWidth:0,height:qe>0?`${Math.max(2,z.errors/qe*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} 错误`},ye)})})]})]})]})]}),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:W,onChange:z=>{M(z.target.value),I(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:O,onChange:z=>{F(z.target.value),I(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:_,onChange:z=>{N(z.target.value),I(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:Y,onChange:z=>{K(z.target.value),I(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:L,onChange:z=>X(z.target.checked)}),"自动刷新 ",L&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",T,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>jn(),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 Oe,pt,Vt;const ye=((Oe=z.usage)==null?void 0:Oe.totalTokens)||(((pt=z.usage)==null?void 0:pt.inputTokens)||0)+(((Vt=z.usage)==null?void 0:Vt.outputTokens)||0),qe=(z.statusCode||200)<400;return o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>k(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.requestModel||z.targetModel||"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:ft(ye)}),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:qe?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",color:qe?"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:Fr=>{Fr.stopPropagation(),k(z)},children:"详情"})})]},z.id)})})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx($c,{currentPage:E,totalItems:C,pageSize:R,onPageChange:I,onPageSizeChange:z=>{A(z),I(1)}})})]})})]}),d==="sessions"&&(()=>{const z=(Oe,pt)=>{const Vt=pt-Oe;return Vt<6e4?`${Math.floor(Vt/1e3)}秒`:Vt<36e5?`${Math.floor(Vt/6e4)}分钟`:`${Math.floor(Vt/36e5)}小时`},ye=async Oe=>{We(Oe),fn(!0);try{const pt=await H.getAccessKeySessionLogs(e,Oe.id,1e4);Xe(pt)}catch{U.error("加载会话日志失败")}finally{fn(!1)}},qe=async()=>{if(!(!Le||ct)){fn(!0);try{const Oe=await H.getAccessKeySessionLogs(e,Le.id,1e4);Xe(Oe)}catch{}finally{fn(!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:he,onChange:Oe=>{Ee(Oe.target.value),oe(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:Pe,onChange:Oe=>{De(Oe.target.value),oe(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:V,onChange:Oe=>me(Oe.target.checked)}),"自动刷新 ",V&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",we,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>Qt(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:Ke.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:Ke.map(Oe=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>ye(Oe),children:[o.jsx("td",{style:{padding:"8px 6px",maxWidth:"250px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:yo(Oe.title)}),o.jsx("td",{style:{padding:"8px 6px"},children:o.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",background:Oe.targetType==="claude-code"?"rgba(59,130,246,0.1)":"rgba(34,197,94,0.1)",color:Oe.targetType==="claude-code"?"var(--color-primary, #3b82f6)":"var(--color-success, #22c55e)"},children:Oe.targetType==="claude-code"?"Claude Code":"Codex"})}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:Oe.requestCount}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:ft(Oe.totalTokens)}),o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(Oe.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(Oe.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(Oe.firstRequestAt,Oe.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:pt=>{pt.stopPropagation(),ye(Oe)},children:"详情"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px",marginLeft:"4px"},onClick:pt=>{pt.stopPropagation(),We(Oe),fn(!0),H.getAccessKeySessionLogs(e,Oe.id,1e4).then(Vt=>{Xe(Vt),fn(!1)}).catch(()=>fn(!1))},children:"对话"})]})]},Oe.id))})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx($c,{currentPage:G,totalItems:Nt,pageSize:D,onPageChange:oe,onPageSizeChange:Oe=>{se(Oe),oe(1)}})})]})}),Le&&o.jsx(rO,{session:Le,logs:Be,logsLoading:ct,onRefreshLogs:qe,onFetchNewLogs:async()=>Le?await H.getAccessKeySessionLogs(e,Le.id,1e4):[],onClose:()=>{We(null),Xe([])}})]})})(),Q&&o.jsx("div",{className:"modal-overlay",onClick:()=>ae(!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:()=>ae(!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:fe,onChange:z=>te(z.target.value),style:Qa})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"备注"}),o.jsx("textarea",{value:ee,onChange:z=>le(z.target.value),style:{...Qa,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:ne,onChange:z=>Ae(z.target.value),style:{...Qa,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:()=>ae(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:wr,className:"ak-modal-btn-primary",children:"保存"})]})]})}),B&&o.jsx(Tf,{log:B,onClose:()=>k(null)}),be&&o.jsx(aR,{keyName:be.key.name,apiKey:be.key.apiKey,guide:be.guide,onClose:()=>Re(null)}),$e&&o.jsx("div",{className:"modal-overlay",onClick:()=>xe(!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:()=>xe(!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:Ie[z.key]?"var(--bg-secondary)":"transparent",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:Ie[z.key],onChange:ye=>Te(qe=>({...qe,[z.key]:ye.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:()=>xe(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:hn,className:"ak-modal-btn-primary",disabled:Ve,children:Ve?"写入中...":"确认写入"})]})]})}),o.jsx("style",{children:`
709
- .ak-tab-btn {
710
- padding: 10px 24px;
711
- border: none;
712
- background: transparent;
713
- color: var(--text-tertiary);
714
- font-size: 14px;
715
- font-weight: 500;
716
- cursor: pointer;
717
- border-bottom: 2px solid transparent;
718
- margin-bottom: -2px;
719
- transition: all 0.15s;
720
- }
721
- .ak-tab-btn:hover {
722
- color: var(--text-secondary);
723
- }
724
- .ak-tab-btn--active {
725
- color: var(--color-primary, #3b82f6);
726
- border-bottom-color: var(--color-primary, #3b82f6);
727
- font-weight: 600;
728
- }
729
- .ak-action-btn {
730
- padding: 4px 10px; border-radius: 6px;
731
- border: 1px solid var(--border-primary);
732
- background: var(--bg-secondary);
733
- color: var(--text-secondary);
734
- cursor: pointer; font-size: 13px;
735
- transition: all 0.15s;
736
- }
737
- .ak-action-btn:hover {
738
- background: var(--bg-route-item-hover);
739
- border-color: var(--text-secondary);
740
- }
741
- .ak-action-btn--active {
742
- background: var(--color-primary, #3b82f6);
743
- color: #fff;
744
- border-color: var(--color-primary, #3b82f6);
745
- }
746
- .ak-action-btn--danger {
747
- color: var(--accent-danger);
748
- }
749
- .ak-action-btn--danger:hover {
750
- background: rgba(220, 38, 38, 0.1);
751
- border-color: var(--accent-danger);
752
- }
753
- .ak-modal-btn-primary {
754
- padding: 10px 28px; border-radius: 8px; border: none;
755
- background: var(--color-primary, #3b82f6); color: #fff;
756
- cursor: pointer; font-size: 14px; font-weight: 600;
757
- transition: opacity 0.15s;
758
- }
759
- .ak-modal-btn-primary:hover { opacity: 0.9; }
760
- .ak-modal-btn-secondary {
761
- padding: 10px 24px; border-radius: 8px;
762
- border: 1px solid var(--border-primary);
763
- background: var(--bg-secondary);
764
- color: var(--text-primary);
765
- cursor: pointer; font-size: 14px; font-weight: 500;
766
- transition: all 0.15s;
767
- }
768
- .ak-modal-btn-secondary:hover {
769
- background: var(--bg-route-item-hover);
770
- }
771
-
772
- /* 深色模式 */
773
- [data-theme="dark"] .ak-action-btn {
774
- background: rgba(30, 58, 40, 0.95);
775
- border-color: rgba(167, 243, 208, 0.2);
776
- color: #A7F3D0;
777
- }
778
- [data-theme="dark"] .ak-action-btn:hover {
779
- background: rgba(40, 75, 52, 0.95);
780
- border-color: rgba(167, 243, 208, 0.4);
781
- }
782
- [data-theme="dark"] .ak-action-btn--danger {
783
- color: #EF4444;
784
- }
785
- [data-theme="dark"] .ak-action-btn--danger:hover {
786
- background: rgba(239, 68, 68, 0.15);
787
- border-color: rgba(239, 68, 68, 0.5);
788
- }
789
- [data-theme="dark"] .ak-modal-btn-secondary {
790
- background: rgba(30, 58, 40, 0.95);
791
- border-color: rgba(167, 243, 208, 0.2);
792
- color: #ECFEF5;
793
- }
794
- [data-theme="dark"] .ak-modal-btn-secondary:hover {
795
- background: rgba(40, 75, 52, 0.95);
796
- border-color: rgba(167, 243, 208, 0.35);
797
- }
798
- [data-theme="dark"] .page-container select option {
799
- background: #0C1F12;
800
- color: #ECFEF5;
801
- }
802
- [data-theme="dark"] .page-container textarea,
803
- [data-theme="dark"] .page-container input[type="text"],
804
- [data-theme="dark"] .page-container input[type="date"] {
805
- color-scheme: dark;
806
- }
807
- `})]})}function Hoe({output:e,onInput:t,readOnly:n=!0,placeholder:r="$ ",waitingForInput:i=!1}){const a=h.useRef(null),l=h.useRef(null),[s,c]=h.useState("");h.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[e,s]),h.useEffect(()=>{i&&!n&&l.current&&l.current.focus()},[i,n]);const u=f=>{if(f.key==="Enter"&&t){const d=s;d.trim()&&(t(d+`
808
- `),c(""))}};return o.jsxs("div",{ref:a,style:{backgroundColor:"#1e1e1e",color:"#d4d4d4",fontFamily:'Consolas, "Courier New", monospace',fontSize:"14px",padding:"16px",borderRadius:"8px",overflow:"auto",maxHeight:"400px",minHeight:"200px",border:i?"2px solid #4ec9b0":"1px solid #3e3e3e",cursor:"text",transition:"border-color 0.3s"},children:[e.map((f,d)=>o.jsx("div",{style:{marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:f},d)),!n&&t&&o.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:"8px"},children:[o.jsx("span",{style:{marginRight:"8px",color:"#4ec9b0"},children:r}),o.jsx("input",{ref:l,type:"password",value:s,onChange:f=>c(f.target.value),onKeyDown:u,style:{backgroundColor:"transparent",border:"none",color:"#d4d4d4",fontFamily:'Consolas, "Courier New", monospace',fontSize:"14px",outline:"none",flex:1},autoFocus:!0,placeholder:i?"请输入密码...":""})]}),i&&o.jsx("div",{style:{marginTop:"8px",fontSize:"12px",color:"#4ec9b0"},children:"💡 请输入您的系统密码以继续安装"})]})}function Voe({status:e,onClose:t,onInstallComplete:n}){const[r,i]=h.useState("idle"),[a,l]=h.useState(null),[s,c]=h.useState([]),[u,f]=h.useState(""),[d,p]=h.useState(!1),m=h.useRef(null);h.useEffect(()=>()=>{m.current&&m.current()},[]);const g=h.useCallback(()=>{i("idle"),l(null),c([]),f(""),p(!1)},[]),y=h.useCallback(I=>{const R=I==="claude-code"?"@anthropic-ai/claude-code":"@openai/codex",A=window.navigator.platform;let _=[];return A.includes("Win")?_=["打开命令提示符(CMD)或 PowerShell","执行以下命令:",`npm install -g ${R}`]:_=["打开终端","执行以下命令(需要输入管理员密码):",`sudo npm install -g ${R}`,"输入您的系统密码"],_},[]),x=h.useCallback(I=>{if(r!=="installing"){console.log(`[Frontend] 开始安装 ${I}`),l(I),i("installing"),f(""),p(!1),c([`正在连接到服务器...
809
- `,`准备安装 ${I==="claude-code"?"Claude Code":"Codex"}...
810
- `,`请稍候...
811
- `]);try{m.current=H.installTool(I,{onStdout:A=>{console.log("[Frontend] stdout:",A),c(_=>[..._,A])},onStderr:A=>{console.log("[Frontend] stderr:",A),c(_=>[..._,A]),(A.includes("password")||A.includes("Password")||A.includes("密码"))&&p(!0)},onClose:(A,_)=>{console.log(`[Frontend] 安装完成,退出码: ${A}, 成功: ${_}`),p(!1),c(N=>[...N,_?`
812
- ✓ 安装成功!`:`
813
- ✗ 安装失败 (退出码: ${A})`]),i(_?"completed":"error"),f(_?"":`安装失败,退出码: ${A}`),_&&setTimeout(()=>{n()},1500)},onError:A=>{console.error("[Frontend] 安装错误:",A),c(_=>[..._,`[ERROR] ${A}`]),p(!1),i("error"),f(A)}});const R=setTimeout(()=>{i(A=>A==="installing"&&s.length<=3?(console.error("[Frontend] 连接超时"),c(_=>[..._,`
814
- [ERROR] 连接服务器超时!`]),f("连接服务器超时"),"error"):A)},15e3);m.current||(m.current=()=>clearTimeout(R))}catch(R){console.error("[Frontend] 启动安装失败:",R),c(A=>[...A,`[ERROR] 启动安装失败: ${R}`]),i("error"),f(String(R))}}},[r,n]),v=h.useCallback(I=>{var R;console.log("[Frontend] 发送用户输入:",I.slice(0,10)),(R=m.current)!=null&&R.sendInput&&(m.current.sendInput(I),c(A=>[...A,`
815
- $ ${"•".repeat(I.length)}
816
- `]),p(!1))},[]),b=!e.claudeCode.installed||!e.codex.installed,w=r==="idle",j=r==="installing",C=r==="completed",S=r==="error",E=a?y(a):[];return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",disabled:j,style:j?{opacity:.3,cursor:"not-allowed"}:void 0,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.jsxs("div",{style:{padding:"20px 0"},children:[w&&o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6",color:"var(--text-secondary)"},children:"检测到您的系统中缺少以下 AI 编程工具。"}),o.jsxs("div",{style:{marginBottom:"20px"},children:[o.jsx("div",{style:{padding:"12px",marginBottom:"12px",borderRadius:"6px",backgroundColor:e.claudeCode.installed?"#f0fdf4":"#fef3c7",border:`1px solid ${e.claudeCode.installed?"#86efac":"#fbbf24"}`},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:"500",marginBottom:"4px"},children:["Claude Code ",e.claudeCode.installed&&`(${e.claudeCode.version})`]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:e.claudeCode.installed?"✓ 已安装":"✗ 未安装"})]}),!e.claudeCode.installed&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>x("claude-code"),disabled:j,style:{fontSize:"13px",padding:"6px 12px"},children:"安装"})]})}),o.jsx("div",{style:{padding:"12px",borderRadius:"6px",backgroundColor:e.codex.installed?"#f0fdf4":"#fef3c7",border:`1px solid ${e.codex.installed?"#86efac":"#fbbf24"}`},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:"500",marginBottom:"4px"},children:["Codex ",e.codex.installed&&`(${e.codex.version})`]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:e.codex.installed?"✓ 已安装":"✗ 未安装"})]}),!e.codex.installed&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>x("codex"),disabled:j,style:{fontSize:"13px",padding:"6px 12px"},children:"安装"})]})})]}),b&&o.jsxs("div",{style:{padding:"12px",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fbbf24",fontSize:"13px",lineHeight:"1.6"},children:[o.jsx("strong",{children:"⚠️ 注意:"}),o.jsxs("ul",{style:{margin:"8px 0 0 0",paddingLeft:"20px"},children:[o.jsx("li",{children:"在 macOS 和 Linux 上安装需要管理员权限,可能需要输入 sudo 密码"}),o.jsx("li",{children:"如果提示输入密码,请在下方的终端输入框中输入"}),o.jsx("li",{children:"Windows 用户通常会自动完成安装"}),o.jsx("li",{children:"安装过程可能需要几分钟时间,请耐心等待"})]})]})]}),(j||S)&&o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6"},children:S?o.jsxs(o.Fragment,{children:["安装 ",o.jsx("strong",{children:a==="claude-code"?"Claude Code":"Codex"})," 时出错"]}):o.jsxs(o.Fragment,{children:["正在安装 ",o.jsx("strong",{children:a==="claude-code"?"Claude Code":"Codex"}),"..."]})}),o.jsx(Hoe,{output:s,readOnly:!1,onInput:v,waitingForInput:d,placeholder:d?"密码:":"$ "}),S&&E.length>0&&o.jsxs("div",{style:{marginTop:"16px",padding:"16px",borderRadius:"6px",backgroundColor:"#f0f9ff",border:"1px solid #7dd3fc"},children:[o.jsx("div",{style:{fontWeight:"600",marginBottom:"12px",color:"#0369a1"},children:"📖 手动安装步骤"}),o.jsx("ol",{style:{margin:0,paddingLeft:"20px",lineHeight:"1.8"},children:E.map((I,R)=>o.jsx("li",{style:{marginBottom:R<E.length-1?"8px":"0"},children:I},R))}),o.jsx("div",{style:{marginTop:"12px",fontSize:"13px",color:"#0369a1"},children:"💡 如果自动安装失败,您可以在终端中手动执行上述命令来安装工具。"})]}),S&&u&&o.jsxs("div",{style:{marginTop:"12px",padding:"12px",borderRadius:"6px",backgroundColor:"#fee",border:"1px solid #fcc",fontSize:"13px"},children:[o.jsx("strong",{children:"错误:"})," ",u]})]}),C&&o.jsxs("div",{style:{padding:"20px",borderRadius:"6px",backgroundColor:"#f0fdf4",border:"1px solid #86efac",textAlign:"center"},children:[o.jsx("div",{style:{fontSize:"48px",marginBottom:"12px"},children:"✓"}),o.jsx("div",{style:{fontWeight:"500",marginBottom:"8px"},children:"安装完成!"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"您现在可以正常使用 AI Code Switch 了"})]})]}),w&&o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"稍后安装"}),o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>{e.claudeCode.installed?e.codex.installed||x("codex"):x("claude-code")},disabled:e.claudeCode.installed&&e.codex.installed,children:"一键安装所需工具"})]}),C&&o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:t,children:"完成"})}),S&&o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"关闭"}),o.jsx("button",{type:"button",className:"btn btn-primary",onClick:g,children:"重试"})]})]})}),o.jsx("style",{children:`
817
- @keyframes spin {
818
- 0% { transform: rotate(0deg); }
819
- 100% { transform: rotate(360deg); }
820
- }
821
- `})]})}function Yoe({toolName:e="both",onInstallClick:t,onClose:n}){const[r,i]=h.useState(!1),a=()=>{i(!0),setTimeout(()=>{n()},300)},l=()=>e==="claude-code"?"Claude Code":e==="codex"?"Codex":"Claude Code / Codex";return o.jsx("div",{className:`notification-bar ${r?"notification-bar-closing":""}`,style:{position:"fixed",top:"20px",right:"20px",backgroundColor:"#fef3c7",border:"1px solid #fbbf24",borderRadius:"8px",padding:"16px 20px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,maxWidth:"400px",transition:"all 0.3s ease",opacity:r?0:1,transform:r?"translateX(100%)":"translateX(0)"},children:o.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[o.jsx("div",{style:{fontSize:"24px",flexShrink:0},children:"⚠️"}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:"600",marginBottom:"4px",fontSize:"15px"},children:"工具未安装"}),o.jsxs("div",{style:{fontSize:"13px",color:"#666",marginBottom:"12px",lineHeight:"1.5"},children:["检测到您的系统中缺少 ",o.jsx("strong",{children:l()}),"。"]}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[o.jsx("button",{type:"button",className:"btn btn-primary",onClick:t,style:{fontSize:"13px",padding:"6px 14px"},children:"立即安装"}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:a,style:{fontSize:"13px",padding:"6px 14px"},children:"稍后"})]})]}),o.jsx("button",{type:"button",onClick:a,style:{background:"none",border:"none",fontSize:"20px",color:"#999",cursor:"pointer",padding:"0",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#f0f0f0"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:"×"})]})})}function ui({children:e,text:t,showTooltip:n}){const[r,i]=h.useState(!1);return o.jsxs("div",{className:"nav-item-with-tooltip",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[e,n&&r&&o.jsx("div",{className:"nav-tooltip",children:t})]})}const Goe=""+new URL("logo-CRx_w1Ov.png",import.meta.url).href,Xoe="升级到 v5.0.0 版本将会有破坏性影响,你需要注意:\n\n* 我们移除了 `Deepseek` 类型的服务,它原本的 `reasoning_content` 特殊字段已被合并进入 `chat completions` 类型,升级会自动完成数据库迁移,你不需要手动修改。\n* 我们启用了新的数据流格式转化器,请你实时关注新版本,如遇到问题,我们会实时修复发布新版本。\n* 我们对路由管理进行了升级,现在你可以将 aicodeswitch 使用于其他**任意的编程工具**,之需要填写对应的 API 即可。升级后,路由本身不再绑定claude-code/codex,你需要在Claude Code配置、Codex配置中,激活想要用来服务的路由,让这两个最重要的编程工具能够正常工作(我们会在升级过程中帮你自动迁移数据库,因此,你不需要手动处理)。\n\n";function Qoe(){const e=Vp(),[t,n]=h.useState("light"),[r,i]=h.useState(!1),[a,l]=h.useState(!1),[s,c]=h.useState(!1),[u,f]=h.useState(!1),[d,p]=h.useState(!1),[m,g]=h.useState(null),[y,x]=h.useState(null),[v,b]=h.useState(!1),w=l8(),[j,C]=h.useState(!1),[S,E]=h.useState(!1),[I,R]=h.useState(""),[A,_]=h.useState(""),[N,Y]=h.useState(!0),[K,O]=h.useState(!1),[F,W]=h.useState(""),[M,B]=h.useState(!1),[k,L]=h.useState(!1),[X,T]=h.useState(!1),[ce,ge]=h.useState(null),[Q,ae]=h.useState(!1);h.useEffect(()=>{const xe=localStorage.getItem("theme")||"light";n(xe),document.documentElement.setAttribute("data-theme",xe),localStorage.getItem("sidebar-collapsed")==="true"&&f(!0)},[]),h.useEffect(()=>{const xe=async()=>{try{const Te=await H.checkVersion();p(Te.hasUpdate),g(Te.latestVersion),x(Te.currentVersion)}catch(Te){console.error("Failed to check version:",Te)}};xe();const Ie=setInterval(xe,6e4);return()=>clearInterval(Ie)},[]),h.useEffect(()=>{(async()=>{try{const Ie=await H.getAuthStatus();if(C(Ie.enabled),!Ie.enabled){E(!0),Y(!1);return}if(!localStorage.getItem("auth_token")){Y(!1);return}try{await H.getVendors(),E(!0)}catch{}}catch(Ie){console.error("Failed to check auth status:",Ie)}finally{Y(!1)}})()},[]),h.useEffect(()=>{(async()=>{if(!M)try{const Ie=await H.getUpgrade();Ie.shouldShow&&Ie.content&&(W(Ie.content),O(!0)),B(!0)}catch(Ie){console.error("Failed to check upgrade:",Ie)}})()},[M]),h.useEffect(()=>{const xe=async()=>{if(Q)return;if(localStorage.getItem("tools_install_completed")==="true"){ae(!0);return}try{const Te=await H.getToolsStatus();ge(Te),!Te.claudeCode.installed||!Te.codex.installed?T(!0):localStorage.setItem("tools_install_completed","true"),ae(!0)}catch(Te){console.error("Failed to check tools status:",Te),ae(!0)}};(!N&&S||!N&&!j)&&xe()},[Q,N,S,j]),h.useEffect(()=>{(async()=>{try{(await H.getVendors()).length===0&&!a&&(i(!0),l(!0))}catch(Ie){console.error("Failed to check vendors:",Ie)}})()},[a]);const fe=()=>{const xe=t==="light"?"dark":"light";n(xe),document.documentElement.setAttribute("data-theme",xe),localStorage.setItem("theme",xe)},te=()=>{f(!u),localStorage.setItem("sidebar-collapsed",(!u).toString())},ee=()=>{i(!1),e("/vendors")},le=async()=>{try{await H.acknowledgeUpgrade()}catch(xe){console.error("Failed to acknowledge upgrade:",xe)}O(!1)},ne=()=>{T(!1)},Ae=()=>{T(!1),L(!0)},be=()=>{L(!1)},Re=async()=>{try{const xe=await H.getToolsStatus();ge(xe),xe.claudeCode.installed&&xe.codex.installed&&(localStorage.setItem("tools_install_completed","true"),T(!1)),setTimeout(()=>{L(!1),(!xe.claudeCode.installed||!xe.codex.installed)&&T(!0)},500)}catch(xe){console.error("Failed to refresh tools status:",xe)}},$e=async xe=>{if(xe.preventDefault(),_(""),!I.trim()){_("请输入鉴权码");return}try{const Ie=await H.login(I);localStorage.setItem("auth_token",Ie.token),E(!0),R("")}catch(Ie){Ie instanceof Error?_(Ie.message||"登录失败,请检查鉴权码"):_("登录失败,请检查鉴权码")}};return N?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:$e,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:I,onChange:xe=>R(xe.target.value),placeholder:"请输入鉴权码",style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-color)",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box"},autoFocus:!0})]}),A&&o.jsx("div",{style:{padding:"10px 12px",backgroundColor:"#fee",border:"1px solid #fcc",borderRadius:"6px",color:"#c33",fontSize:"14px",marginBottom:"16px"},children:A})]}),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:Goe,alt:"AI Code Switch Logo",className:"logo-image"}),o.jsx("h2",{children:"AI Code Switch"})]}),o.jsxs("ul",{className:"nav-menu",children:[o.jsx("li",{children:o.jsx(ui,{text:"路由管理",showTooltip:u,children:o.jsxs(oi,{to:"/",children:[o.jsx("span",{className:"nav-icon",children:"🌏"}),o.jsx("span",{className:"nav-text",children:"路由管理"})]})})}),o.jsx("li",{children:o.jsx(ui,{text:"供应商管理",showTooltip:u,children:o.jsxs(oi,{to:"/vendors",children:[o.jsx("span",{className:"nav-icon",children:"🏭"}),o.jsx("span",{className:"nav-text",children:"供应商管理"})]})})}),o.jsx("li",{children:o.jsx(ui,{text:"Skills 管理",showTooltip:u,children:o.jsxs(oi,{to:"/skills",children:[o.jsx("span",{className:"nav-icon",children:"🧩"}),o.jsx("span",{className:"nav-text",children:"Skills 管理"})]})})}),o.jsx("li",{children:o.jsx(ui,{text:"MCP 管理",showTooltip:u,children:o.jsxs(oi,{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(ui,{text:"API Key",showTooltip:u,children:o.jsxs(oi,{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(ui,{text:"数据统计",showTooltip:u,children:o.jsxs(oi,{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(ui,{text:"会话",showTooltip:u,children:o.jsxs(oi,{to:"/sessions",children:[o.jsx("span",{className:"nav-icon",children:"💬"}),o.jsx("span",{className:"nav-text",children:"会话"})]})})}),o.jsx("li",{children:o.jsx(ui,{text:"日志",showTooltip:u,children:o.jsxs(oi,{to:"/logs",children:[o.jsx("span",{className:"nav-icon",children:"🪵"}),o.jsx("span",{className:"nav-text",children:"日志"})]})})})]}),o.jsx("li",{children:o.jsx(ui,{text:"设置",showTooltip:u,children:o.jsxs(oi,{to:"/settings",children:[o.jsx("span",{className:"nav-icon",children:"⚙️"}),o.jsx("span",{className:"nav-text",children:"设置"})]})})}),o.jsx("li",{children:o.jsx(ui,{text:"使用说明",showTooltip:u,children:o.jsxs(oi,{to:"/usage",children:[o.jsx("span",{className:"nav-icon",children:"📖"}),o.jsx("span",{className:"nav-text",children:"使用说明"})]})})})]}),o.jsxs("div",{className:"theme-toggle",children:[o.jsx("button",{onClick:fe,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"})})}),y&&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",y,d&&o.jsx("span",{className:"version-badge"})]})}),o.jsx("button",{onClick:te,className:"sidebar-toggle-btn",title:u?"展开侧边栏":"收起侧边栏",children:u?"»":"«"})]})]}),o.jsx("main",{className:"main-content",children:o.jsxs(n4,{children:[o.jsx(Qn,{path:"/",element:o.jsx(Mj,{})}),o.jsx(Qn,{path:"/statistics",element:o.jsx(Boe,{})}),o.jsx(Qn,{path:"/routes",element:o.jsx(Mj,{})}),o.jsx(Qn,{path:"/vendors",element:o.jsx(f8,{})}),o.jsx(Qn,{path:"/skills",element:o.jsx(Foe,{})}),o.jsx(Qn,{path:"/mcp",element:o.jsx(Woe,{})}),o.jsx(Qn,{path:"/access-keys",element:j?o.jsx(Koe,{}):o.jsx(od,{to:"/"})}),o.jsx(Qn,{path:"/access-keys/:id",element:j?o.jsx(qoe,{}):o.jsx(od,{to:"/"})}),o.jsx(Qn,{path:"/sessions",element:j?o.jsx(od,{to:"/"}):o.jsx(J8,{})}),o.jsx(Qn,{path:"/logs",element:j?o.jsx(od,{to:"/"}):o.jsx(U8,{})}),o.jsx(Qn,{path:"/write-config",element:o.jsx(e5,{})}),o.jsx(Qn,{path:"/settings",element:o.jsx(Z8,{})}),o.jsx(Qn,{path:"/usage",element:o.jsx(n5,{})})]})}),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:ee,children:"前往供应商管理"})]})]})]})})]}),o.jsx(QT,{show:s,onClose:()=>c(!1),onComplete:()=>l(!0)}),K&&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(gc,{children:F})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:le,children:"我知道了"})})]})})}),X&&ce&&o.jsx(Yoe,{toolName:!ce.claudeCode.installed&&!ce.codex.installed?"both":ce.claudeCode.installed?"codex":"claude-code",onInstallClick:Ae,onClose:ne}),k&&ce&&o.jsx(Voe,{status:ce,onClose:be,onInstallComplete:Re}),v&&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",y]})]}),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(gc,{children:w})}):null:o.jsxs("div",{className:"markdown-content",children:[o.jsx("h4",{style:{marginBottom:12},children:"当前版本提示:"}),o.jsx(gc,{children:Xoe})]})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>b(!1),children:"关闭"})})]})})]})]})}function Joe(){return o.jsx(u4,{children:o.jsx(s8,{children:o.jsxs(v8,{children:[o.jsx(Qoe,{}),o.jsx(u8,{})]})})})}kg.createRoot(document.getElementById("root")).render(o.jsx(YP.StrictMode,{children:o.jsx(Joe,{})}));