aicodeswitch 5.2.4 → 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.
- package/README.md +1 -0
- package/bin/utils/config-helpers.js +2 -1
- package/bin/utils/managed-fields.js +1 -1
- package/dist/server/config-managed-fields.js +1 -1
- package/dist/server/config-merge.js +2 -1
- package/dist/server/conversions/detector.js +13 -0
- package/dist/server/conversions/index.js +2 -1
- package/dist/server/conversions/pairs/responses-responses/request.js +7 -8
- package/dist/server/fs-database.js +179 -0
- package/dist/server/main.js +39 -9
- package/dist/server/proxy-server.js +10 -6
- package/dist/ui/assets/index-KBja3wfR.js +822 -0
- package/dist/ui/assets/index-MjMlew6J.css +1 -0
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/index-Cws89pD2.js +0 -828
- package/dist/ui/assets/index-CzfKxImD.css +0 -1
|
@@ -1,828 +0,0 @@
|
|
|
1
|
-
var RR=Object.defineProperty;var DR=(e,t,n)=>t in e?RR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Uu=(e,t,n)=>DR(e,typeof t!="symbol"?t+"":t,n);function LR(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 DP={exports:{}},Ep={},LP={exports:{}},Ke={};/**
|
|
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 nu=Symbol.for("react.element"),zR=Symbol.for("react.portal"),$R=Symbol.for("react.fragment"),BR=Symbol.for("react.strict_mode"),FR=Symbol.for("react.profiler"),UR=Symbol.for("react.provider"),WR=Symbol.for("react.context"),KR=Symbol.for("react.forward_ref"),qR=Symbol.for("react.suspense"),HR=Symbol.for("react.memo"),VR=Symbol.for("react.lazy"),b1=Symbol.iterator;function YR(e){return e===null||typeof e!="object"?null:(e=b1&&e[b1]||e["@@iterator"],typeof e=="function"?e:null)}var zP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$P=Object.assign,BP={};function is(e,t,n){this.props=e,this.context=t,this.refs=BP,this.updater=n||zP}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 FP(){}FP.prototype=is.prototype;function Ry(e,t,n){this.props=e,this.context=t,this.refs=BP,this.updater=n||zP}var Dy=Ry.prototype=new FP;Dy.constructor=Ry;$P(Dy,is.prototype);Dy.isPureReactComponent=!0;var w1=Array.isArray,UP=Object.prototype.hasOwnProperty,Ly={current:null},WP={key:!0,ref:!0,__self:!0,__source:!0};function KP(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)UP.call(t,r)&&!WP.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:nu,type:e,key:a,ref:l,props:i,_owner:Ly.current}}function GR(e,t){return{$$typeof:nu,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===nu}function XR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var j1=/\/+/g;function dm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?XR(""+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 nu:case zR:l=!0}}if(l)return l=e,i=i(l),e=r===""?"."+dm(l,0):r,w1(i)?(n="",e!=null&&(n=e.replace(j1,"$&/")+"/"),Nd(i,t,n,"",function(u){return u})):i!=null&&(zy(i)&&(i=GR(i,n+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(j1,"$&/")+"/")+e)),t.push(i)),1;if(l=0,r=r===""?".":r+":",w1(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=YR(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 QR(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},JR={ReactCurrentDispatcher:Vn,ReactCurrentBatchConfig:_d,ReactCurrentOwner:Ly};function qP(){throw Error("act(...) is not supported in production builds of React.")}Ke.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}};Ke.Component=is;Ke.Fragment=$R;Ke.Profiler=FR;Ke.PureComponent=Ry;Ke.StrictMode=BR;Ke.Suspense=qR;Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=JR;Ke.act=qP;Ke.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=$P({},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)UP.call(t,c)&&!WP.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:nu,type:e.type,key:i,ref:a,props:r,_owner:l}};Ke.createContext=function(e){return e={$$typeof:WR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:UR,_context:e},e.Consumer=e};Ke.createElement=KP;Ke.createFactory=function(e){var t=KP.bind(null,e);return t.type=e,t};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(e){return{$$typeof:KR,render:e}};Ke.isValidElement=zy;Ke.lazy=function(e){return{$$typeof:VR,_payload:{_status:-1,_result:e},_init:QR}};Ke.memo=function(e,t){return{$$typeof:HR,type:e,compare:t===void 0?null:t}};Ke.startTransition=function(e){var t=_d.transition;_d.transition={};try{e()}finally{_d.transition=t}};Ke.unstable_act=qP;Ke.useCallback=function(e,t){return Vn.current.useCallback(e,t)};Ke.useContext=function(e){return Vn.current.useContext(e)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(e){return Vn.current.useDeferredValue(e)};Ke.useEffect=function(e,t){return Vn.current.useEffect(e,t)};Ke.useId=function(){return Vn.current.useId()};Ke.useImperativeHandle=function(e,t,n){return Vn.current.useImperativeHandle(e,t,n)};Ke.useInsertionEffect=function(e,t){return Vn.current.useInsertionEffect(e,t)};Ke.useLayoutEffect=function(e,t){return Vn.current.useLayoutEffect(e,t)};Ke.useMemo=function(e,t){return Vn.current.useMemo(e,t)};Ke.useReducer=function(e,t,n){return Vn.current.useReducer(e,t,n)};Ke.useRef=function(e){return Vn.current.useRef(e)};Ke.useState=function(e){return Vn.current.useState(e)};Ke.useSyncExternalStore=function(e,t,n){return Vn.current.useSyncExternalStore(e,t,n)};Ke.useTransition=function(){return Vn.current.useTransition()};Ke.version="18.3.1";LP.exports=Ke;var h=LP.exports;const HP=zr(h),VP=LR({__proto__:null,default:HP},[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 ZR=h,eD=Symbol.for("react.element"),tD=Symbol.for("react.fragment"),nD=Object.prototype.hasOwnProperty,rD=ZR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,iD={key:!0,ref:!0,__self:!0,__source:!0};function YP(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)nD.call(t,r)&&!iD.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:eD,type:e,key:a,ref:l,props:i,_owner:rD.current}}Ep.Fragment=tD;Ep.jsx=YP;Ep.jsxs=YP;DP.exports=Ep;var o=DP.exports,kg={},GP={exports:{}},xr={},XP={exports:{}},QP={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(T,z){var P=T.length;T.push(z);e:for(;0<P;){var $=P-1>>>1,ee=T[$];if(0<i(ee,z))T[$]=z,T[P]=ee,P=$;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var z=T[0],P=T.pop();if(P!==z){T[0]=P;e:for(var $=0,ee=T.length,N=ee>>>1;$<N;){var le=2*($+1)-1,me=T[le],X=le+1,ne=T[X];if(0>i(me,P))X<ee&&0>i(ne,me)?(T[$]=ne,T[X]=P,$=X):(T[$]=me,T[le]=P,$=le);else if(X<ee&&0>i(ne,P))T[$]=ne,T[X]=P,$=X;else break e}}return z}function i(T,z){var P=T.sortIndex-z.sortIndex;return P!==0?P:T.id-z.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(T){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=T)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function j(T){if(y=!1,w(T),!g)if(n(c)!==null)g=!0,U(k);else{var z=n(u);z!==null&&K(j,z.startTime-T)}}function k(T,z){g=!1,y&&(y=!1,v(I),I=-1),m=!0;var P=p;try{for(w(z),d=n(c);d!==null&&(!(d.expirationTime>z)||T&&!_());){var $=d.callback;if(typeof $=="function"){d.callback=null,p=d.priorityLevel;var ee=$(d.expirationTime<=z);z=e.unstable_now(),typeof ee=="function"?d.callback=ee:d===n(c)&&r(c),w(z)}else r(c);d=n(c)}if(d!==null)var N=!0;else{var le=n(u);le!==null&&K(j,le.startTime-z),N=!1}return N}finally{d=null,p=P,m=!1}}var S=!1,E=null,I=-1,D=5,O=-1;function _(){return!(e.unstable_now()-O<D)}function M(){if(E!==null){var T=e.unstable_now();O=T;var z=!0;try{z=E(!0,T)}finally{z?G():(S=!1,E=null)}}else S=!1}var G;if(typeof b=="function")G=function(){b(M)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,A=q.port2;q.port1.onmessage=M,G=function(){A.postMessage(null)}}else G=function(){x(M,0)};function U(T){E=T,S||(S=!0,G())}function K(T,z){I=x(function(){T(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,U(k))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(T){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var P=p;p=z;try{return T()}finally{p=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,z){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var P=p;p=T;try{return z()}finally{p=P}},e.unstable_scheduleCallback=function(T,z,P){var $=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?$+P:$):P=$,T){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=P+ee,T={id:f++,callback:z,priorityLevel:T,startTime:P,expirationTime:ee,sortIndex:-1},P>$?(T.sortIndex=P,t(u,T),n(c)===null&&T===n(u)&&(y?(v(I),I=-1):y=!0,K(j,P-$))):(T.sortIndex=ee,t(c,T),g||m||(g=!0,U(k))),T},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(T){var z=p;return function(){var P=p;p=z;try{return T.apply(this,arguments)}finally{p=P}}}})(QP);XP.exports=QP;var aD=XP.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 oD=h,gr=aD;function se(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 JP=new Set,yc={};function qo(e,t){Bl(e,t),Bl(e+"Capture",t)}function Bl(e,t){for(yc[e]=t,e=0;e<t.length;e++)JP.add(t[e])}var Ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cg=Object.prototype.hasOwnProperty,lD=/^[: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]*$/,S1={},k1={};function sD(e){return Cg.call(k1,e)?!0:Cg.call(S1,e)?!1:lD.test(e)?k1[e]=!0:(S1[e]=!0,!1)}function cD(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 uD(e,t,n,r){if(t===null||typeof t>"u"||cD(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")&&(uD(t,n,i,r)&&(n=null),r||i===null?sD(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=oD.__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"),ZP=Symbol.for("react.provider"),eE=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"),tE=Symbol.for("react.offscreen"),C1=Symbol.iterator;function Ss(e){return e===null||typeof e!="object"?null:(e=C1&&e[C1]||e["@@iterator"],typeof e=="function"?e:null)}var Dt=Object.assign,fm;function Hs(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:"")?Hs(e):""}function dD(e){switch(e.tag){case 5:return Hs(e.type);case 16:return Hs("Lazy");case 13:return Hs("Suspense");case 19:return Hs("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 eE:return(e.displayName||"Context")+".Consumer";case ZP: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 fD(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 nE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pD(e){var t=nE(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=pD(e))}function rE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=nE(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 P1(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 iE(e,t){t=t.checked,t!=null&&Fy(e,"checked",t,!1)}function Ig(e,t){iE(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 E1(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 Vs=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(se(91));return Dt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function T1(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(se(92));if(Vs(n)){if(1<n.length)throw Error(se(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ra(n)}}function aE(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 O1(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function oE(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"?oE(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hu,lE=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 xc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rc={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},hD=["Webkit","ms","Moz","O"];Object.keys(rc).forEach(function(e){hD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),rc[t]=rc[e]})});function sE(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||rc.hasOwnProperty(e)&&rc[e]?(""+t).trim():t+"px"}function cE(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=sE(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var mD=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(mD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(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 A1(e){if(e=au(e)){if(typeof zg!="function")throw Error(se(280));var t=e.stateNode;t&&(t=Np(t),zg(e.stateNode,e.type,t))}}function uE(e){Al?Il?Il.push(e):Il=[e]:Al=e}function dE(){if(Al){var e=Al,t=Il;if(Il=Al=null,A1(e),t)for(e=0;e<t.length;e++)A1(t[e])}}function fE(e,t){return e(t)}function pE(){}var mm=!1;function hE(e,t,n){if(mm)return e(t,n);mm=!0;try{return fE(e,t,n)}finally{mm=!1,(Al!==null||Il!==null)&&(pE(),dE())}}function bc(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(se(231,t,typeof n));return n}var $g=!1;if(Ki)try{var ks={};Object.defineProperty(ks,"passive",{get:function(){$g=!0}}),window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{$g=!1}function gD(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 ic=!1,Zd=null,ef=!1,Bg=null,vD={onError:function(e){ic=!0,Zd=e}};function yD(e,t,n,r,i,a,l,s,c){ic=!1,Zd=null,gD.apply(vD,arguments)}function xD(e,t,n,r,i,a,l,s,c){if(yD.apply(this,arguments),ic){if(ic){var u=Zd;ic=!1,Zd=null}else throw Error(se(198));ef||(ef=!0,Bg=u)}}function Ho(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 mE(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 I1(e){if(Ho(e)!==e)throw Error(se(188))}function bD(e){var t=e.alternate;if(!t){if(t=Ho(e),t===null)throw Error(se(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 I1(i),e;if(a===r)return I1(i),t;a=a.sibling}throw Error(se(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(se(189))}}if(n.alternate!==r)throw Error(se(190))}if(n.tag!==3)throw Error(se(188));return n.stateNode.current===n?e:t}function gE(e){return e=bD(e),e!==null?vE(e):null}function vE(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=vE(e);if(t!==null)return t;e=e.sibling}return null}var yE=gr.unstable_scheduleCallback,N1=gr.unstable_cancelCallback,wD=gr.unstable_shouldYield,jD=gr.unstable_requestPaint,Yt=gr.unstable_now,SD=gr.unstable_getCurrentPriorityLevel,Hy=gr.unstable_ImmediatePriority,xE=gr.unstable_UserBlockingPriority,tf=gr.unstable_NormalPriority,kD=gr.unstable_LowPriority,bE=gr.unstable_IdlePriority,Tp=null,yi=null;function CD(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:TD,PD=Math.log,ED=Math.LN2;function TD(e){return e>>>=0,e===0?32:31-(PD(e)/ED|0)|0}var Vu=64,Yu=4194304;function Ys(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=Ys(s):(a&=l,a!==0&&(r=Ys(a)))}else l=n&~i,l!==0?r=Ys(l):a!==0&&(r=Ys(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 OD(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 AD(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]=OD(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 wE(){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 ru(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 ID(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 ct=0;function jE(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var SE,Yy,kE,CE,PE,Ug=!1,Gu=[],Sa=null,ka=null,Ca=null,wc=new Map,jc=new Map,ga=[],ND="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 _1(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":wc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jc.delete(t.pointerId)}}function Cs(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=au(t),t!==null&&Yy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function _D(e,t,n,r,i){switch(t){case"focusin":return Sa=Cs(Sa,e,t,n,r,i),!0;case"dragenter":return ka=Cs(ka,e,t,n,r,i),!0;case"mouseover":return Ca=Cs(Ca,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return wc.set(a,Cs(wc.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,jc.set(a,Cs(jc.get(a)||null,e,t,n,r,i)),!0}return!1}function EE(e){var t=ho(e.target);if(t!==null){var n=Ho(t);if(n!==null){if(t=n.tag,t===13){if(t=mE(n),t!==null){e.blockedOn=t,PE(e.priority,function(){kE(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=au(n),t!==null&&Yy(t),e.blockedOn=n,!1;t.shift()}return!0}function M1(e,t,n){Md(e)&&n.delete(t)}function MD(){Ug=!1,Sa!==null&&Md(Sa)&&(Sa=null),ka!==null&&Md(ka)&&(ka=null),Ca!==null&&Md(Ca)&&(Ca=null),wc.forEach(M1),jc.forEach(M1)}function Ps(e,t){e.blockedOn===t&&(e.blockedOn=null,Ug||(Ug=!0,gr.unstable_scheduleCallback(gr.unstable_NormalPriority,MD)))}function Sc(e){function t(i){return Ps(i,e)}if(0<Gu.length){Ps(Gu[0],e);for(var n=1;n<Gu.length;n++){var r=Gu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Sa!==null&&Ps(Sa,e),ka!==null&&Ps(ka,e),Ca!==null&&Ps(Ca,e),wc.forEach(t),jc.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);)EE(n),n.blockedOn===null&&ga.shift()}var Nl=Ji.ReactCurrentBatchConfig,rf=!0;function RD(e,t,n,r){var i=ct,a=Nl.transition;Nl.transition=null;try{ct=1,Gy(e,t,n,r)}finally{ct=i,Nl.transition=a}}function DD(e,t,n,r){var i=ct,a=Nl.transition;Nl.transition=null;try{ct=4,Gy(e,t,n,r)}finally{ct=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),_1(e,r);else if(_D(i,e,t,n,r))r.stopPropagation();else if(_1(e,r),t&4&&-1<ND.indexOf(e)){for(;i!==null;){var a=au(i);if(a!==null&&SE(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=ho(e),e!==null)if(t=Ho(e),t===null)e=null;else if(n=t.tag,n===13){if(e=mE(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 TE(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(SD()){case Hy:return 1;case xE:return 4;case tf:case kD:return 16;case bE:return 536870912;default:return 16}default:return 16}}var xa=null,Xy=null,Rd=null;function OE(){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 R1(){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:R1,this.isPropagationStopped=R1,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),iu=Dt({},as,{view:0,detail:0}),LD=br(iu),vm,ym,Es,Op=Dt({},iu,{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!==Es&&(Es&&e.type==="mousemove"?(vm=e.screenX-Es.screenX,ym=e.screenY-Es.screenY):ym=vm=0,Es=e),vm)},movementY:function(e){return"movementY"in e?e.movementY:ym}}),D1=br(Op),zD=Dt({},Op,{dataTransfer:0}),$D=br(zD),BD=Dt({},iu,{relatedTarget:0}),xm=br(BD),FD=Dt({},as,{animationName:0,elapsedTime:0,pseudoElement:0}),UD=br(FD),WD=Dt({},as,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),KD=br(WD),qD=Dt({},as,{data:0}),L1=br(qD),HD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VD={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"},YD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=YD[e])?!!t[e]:!1}function Jy(){return GD}var XD=Dt({},iu,{key:function(e){if(e.key){var t=HD[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"?VD[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}}),QD=br(XD),JD=Dt({},Op,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),z1=br(JD),ZD=Dt({},iu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jy}),eL=br(ZD),tL=Dt({},as,{propertyName:0,elapsedTime:0,pseudoElement:0}),nL=br(tL),rL=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}),iL=br(rL),aL=[9,13,27,32],Zy=Ki&&"CompositionEvent"in window,ac=null;Ki&&"documentMode"in document&&(ac=document.documentMode);var oL=Ki&&"TextEvent"in window&&!ac,AE=Ki&&(!Zy||ac&&8<ac&&11>=ac),$1=" ",B1=!1;function IE(e,t){switch(e){case"keyup":return aL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function NE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gl=!1;function lL(e,t){switch(e){case"compositionend":return NE(t);case"keypress":return t.which!==32?null:(B1=!0,$1);case"textInput":return e=t.data,e===$1&&B1?null:e;default:return null}}function sL(e,t){if(gl)return e==="compositionend"||!Zy&&IE(e,t)?(e=OE(),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 AE&&t.locale!=="ko"?null:t.data;default:return null}}var cL={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 F1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cL[e.type]:t==="textarea"}function _E(e,t,n,r){uE(r),t=of(t,"onChange"),0<t.length&&(n=new Qy("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var oc=null,kc=null;function uL(e){KE(e,0)}function Ap(e){var t=xl(e);if(rE(t))return e}function dL(e,t){if(e==="change")return t}var ME=!1;if(Ki){var bm;if(Ki){var wm="oninput"in document;if(!wm){var U1=document.createElement("div");U1.setAttribute("oninput","return;"),wm=typeof U1.oninput=="function"}bm=wm}else bm=!1;ME=bm&&(!document.documentMode||9<document.documentMode)}function W1(){oc&&(oc.detachEvent("onpropertychange",RE),kc=oc=null)}function RE(e){if(e.propertyName==="value"&&Ap(kc)){var t=[];_E(t,kc,e,qy(e)),hE(uL,t)}}function fL(e,t,n){e==="focusin"?(W1(),oc=t,kc=n,oc.attachEvent("onpropertychange",RE)):e==="focusout"&&W1()}function pL(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ap(kc)}function hL(e,t){if(e==="click")return Ap(t)}function mL(e,t){if(e==="input"||e==="change")return Ap(t)}function gL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qr=typeof Object.is=="function"?Object.is:gL;function Cc(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 K1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function q1(e,t){var n=K1(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=K1(n)}}function DE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?DE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function LE(){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 vL(e){var t=LE(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&DE(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=q1(n,a);var l=q1(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 yL=Ki&&"documentMode"in document&&11>=document.documentMode,vl=null,Kg=null,lc=null,qg=!1;function H1(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}),lc&&Cc(lc,r)||(lc=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={},zE={};Ki&&(zE=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 zE)return jm[e]=t[n];return e}var $E=Ip("animationend"),BE=Ip("animationiteration"),FE=Ip("animationstart"),UE=Ip("transitionend"),WE=new Map,V1="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){WE.set(e,t),qo(t,[e])}for(var Sm=0;Sm<V1.length;Sm++){var km=V1[Sm],xL=km.toLowerCase(),bL=km[0].toUpperCase()+km.slice(1);Fa(xL,"on"+bL)}Fa($E,"onAnimationEnd");Fa(BE,"onAnimationIteration");Fa(FE,"onAnimationStart");Fa("dblclick","onDoubleClick");Fa("focusin","onFocus");Fa("focusout","onBlur");Fa(UE,"onTransitionEnd");Bl("onMouseEnter",["mouseout","mouseover"]);Bl("onMouseLeave",["mouseout","mouseover"]);Bl("onPointerEnter",["pointerout","pointerover"]);Bl("onPointerLeave",["pointerout","pointerover"]);qo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qo("onBeforeInput",["compositionend","keypress","textInput","paste"]);qo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gs="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(" "),wL=new Set("cancel close invalid load scroll toggle".split(" ").concat(Gs));function Y1(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,xD(r,t,void 0,e),e.currentTarget=null}function KE(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;Y1(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;Y1(i,s,u),a=c}}}if(ef)throw e=Bg,ef=!1,Bg=null,e}function St(e,t){var n=t[Xg];n===void 0&&(n=t[Xg]=new Set);var r=e+"__bubble";n.has(r)||(qE(t,e,2,!1),n.add(r))}function Cm(e,t,n){var r=0;t&&(r|=4),qE(n,e,r,t)}var Ju="_reactListening"+Math.random().toString(36).slice(2);function Pc(e){if(!e[Ju]){e[Ju]=!0,JP.forEach(function(n){n!=="selectionchange"&&(wL.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 qE(e,t,n,r){switch(TE(t)){case 1:var i=RD;break;case 4:i=DD;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=ho(s),l===null)return;if(c=l.tag,c===5||c===6){r=a=l;continue e}s=s.parentNode}}r=r.return}hE(function(){var u=a,f=qy(n),d=[];e:{var p=WE.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=QD;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=D1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=$D;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=eL;break;case $E:case BE:case FE:m=UD;break;case UE:m=nL;break;case"scroll":m=LD;break;case"wheel":m=iL;break;case"copy":case"cut":case"paste":m=KD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=z1}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=bc(b,v),j!=null&&y.push(Ec(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)&&(ho(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?ho(g):null,g!==null&&(x=Ho(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(y=D1,j="onMouseLeave",v="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(y=z1,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,ho(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&&G1(d,p,m,y,!1),g!==null&&x!==null&&G1(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 k=dL;else if(F1(p))if(ME)k=mL;else{k=pL;var S=fL}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(k=hL);if(k&&(k=k(e,u))){_E(d,k,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":(F1(S)||S.contentEditable==="true")&&(vl=S,Kg=u,lc=null);break;case"focusout":lc=Kg=vl=null;break;case"mousedown":qg=!0;break;case"contextmenu":case"mouseup":case"dragend":qg=!1,H1(d,n,f);break;case"selectionchange":if(yL)break;case"keydown":case"keyup":H1(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?IE(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(AE&&n.locale!=="ko"&&(gl||I!=="onCompositionStart"?I==="onCompositionEnd"&&gl&&(E=OE()):(xa=f,Xy="value"in xa?xa.value:xa.textContent,gl=!0)),S=of(u,I),0<S.length&&(I=new L1(I,e,null,n,f),d.push({event:I,listeners:S}),E?I.data=E:(E=NE(n),E!==null&&(I.data=E)))),(E=oL?lL(e,n):sL(e,n))&&(u=of(u,"onBeforeInput"),0<u.length&&(f=new L1("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:u}),f.data=E))}KE(d,t)})}function Ec(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=bc(e,n),a!=null&&r.unshift(Ec(e,a,i)),a=bc(e,t),a!=null&&r.push(Ec(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 G1(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=bc(n,a),c!=null&&l.unshift(Ec(n,c,s))):i||(c=bc(n,a),c!=null&&l.push(Ec(n,c,s)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var jL=/\r\n?/g,SL=/\u0000|\uFFFD/g;function X1(e){return(typeof e=="string"?e:""+e).replace(jL,`
|
|
38
|
-
`).replace(SL,"")}function Zu(e,t,n){if(t=X1(t),X1(e)!==t&&n)throw Error(se(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,kL=typeof clearTimeout=="function"?clearTimeout:void 0,Q1=typeof Promise=="function"?Promise:void 0,CL=typeof queueMicrotask=="function"?queueMicrotask:typeof Q1<"u"?function(e){return Q1.resolve(null).then(e).catch(PL)}:Gg;function PL(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),Sc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Sc(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 J1(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,Tc="__reactProps$"+os,qi="__reactContainer$"+os,Xg="__reactEvents$"+os,EL="__reactListeners$"+os,TL="__reactHandles$"+os;function ho(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=J1(e);e!==null;){if(n=e[hi])return n;e=J1(e)}return t}e=n,n=e.parentNode}return null}function au(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(se(33))}function Np(e){return e[Tc]||null}var Qg=[],bl=-1;function Ua(e){return{current:e}}function Pt(e){0>bl||(e.current=Qg[bl],Qg[bl]=null,bl--)}function bt(e,t){bl++,Qg[bl]=e.current,e.current=t}var Da={},Dn=Ua(Da),rr=Ua(!1),Ao=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(){Pt(rr),Pt(Dn)}function Z1(e,t,n){if(Dn.current!==Da)throw Error(se(168));bt(Dn,t),bt(rr,n)}function HE(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(se(108,fD(e)||"Unknown",i));return Dt({},n,r)}function cf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Da,Ao=Dn.current,bt(Dn,e),bt(rr,rr.current),!0}function ew(e,t,n){var r=e.stateNode;if(!r)throw Error(se(169));n?(e=HE(e,t,Ao),r.__reactInternalMemoizedMergedChildContext=e,Pt(rr),Pt(Dn),bt(Dn,e)):Pt(rr),bt(rr,n)}var Mi=null,_p=!1,Tm=!1;function VE(e){Mi===null?Mi=[e]:Mi.push(e)}function OL(e){_p=!0,VE(e)}function Wa(){if(!Tm&&Mi!==null){Tm=!0;var e=0,t=ct;try{var n=Mi;for(ct=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)),yE(Hy,Wa),i}finally{ct=t,Tm=!1}}return null}var wl=[],jl=0,uf=null,df=0,Tr=[],Or=0,Io=null,Li=1,zi="";function lo(e,t){wl[jl++]=df,wl[jl++]=uf,uf=e,df=t}function YE(e,t,n){Tr[Or++]=Li,Tr[Or++]=zi,Tr[Or++]=Io,Io=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&&(lo(e,1),YE(e,1,0))}function nx(e){for(;e===uf;)uf=wl[--jl],wl[jl]=null,df=wl[--jl],wl[jl]=null;for(;e===Io;)Io=Tr[--Or],Tr[Or]=null,zi=Tr[--Or],Tr[Or]=null,Li=Tr[--Or],Tr[Or]=null}var hr=null,dr=null,Ot=!1,qr=null;function GE(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 tw(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=Io!==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(Ot){var t=dr;if(t){var n=t;if(!tw(e,t)){if(Jg(e))throw Error(se(418));t=Pa(n.nextSibling);var r=hr;t&&tw(e,t)?GE(r,n):(e.flags=e.flags&-4097|2,Ot=!1,hr=e)}}else{if(Jg(e))throw Error(se(418));e.flags=e.flags&-4097|2,Ot=!1,hr=e}}}function nw(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(!Ot)return nw(e),Ot=!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 XE(),Error(se(418));for(;t;)GE(e,t),t=Pa(t.nextSibling)}if(nw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(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 XE(){for(var e=dr;e;)e=Pa(e.nextSibling)}function Ul(){dr=hr=null,Ot=!1}function rx(e){qr===null?qr=[e]:qr.push(e)}var AL=Ji.ReactCurrentBatchConfig;function Ts(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(se(309));var r=n.stateNode}if(!r)throw Error(se(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(se(284));if(!n._owner)throw Error(se(290,e))}return e}function td(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function rw(e){var t=e._init;return t(e._payload)}function QE(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 k=w.type;return k===ml?f(v,b,w.props.children,j,w.key):b!==null&&(b.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===fa&&rw(k)===b.type)?(j=i(b,w.props),j.ref=Ts(v,b,w),j.return=v,j):(j=Wd(w.type,w.key,w.props,null,v.mode,j),j.ref=Ts(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,k){return b===null||b.tag!==7?(b=ko(w,v.mode,j,k),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=Ts(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(Vs(b)||Ss(b))return b=ko(b,v.mode,w,null),b.return=v,b;td(v,b)}return null}function p(v,b,w,j){var k=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return k!==null?null:s(v,b,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ku:return w.key===k?c(v,b,w,j):null;case hl:return w.key===k?u(v,b,w,j):null;case fa:return k=w._init,p(v,b,k(w._payload),j)}if(Vs(w)||Ss(w))return k!==null?null:f(v,b,w,j,null);td(v,w)}return null}function m(v,b,w,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return v=v.get(w)||null,s(b,v,""+j,k);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,k);case hl:return v=v.get(j.key===null?w:j.key)||null,u(b,v,j,k);case fa:var S=j._init;return m(v,b,w,S(j._payload),k)}if(Vs(j)||Ss(j))return v=v.get(w)||null,f(b,v,j,k,null);td(b,j)}return null}function g(v,b,w,j){for(var k=null,S=null,E=b,I=b=0,D=null;E!==null&&I<w.length;I++){E.index>I?(D=E,E=null):D=E.sibling;var O=p(v,E,w[I],j);if(O===null){E===null&&(E=D);break}e&&E&&O.alternate===null&&t(v,E),b=a(O,b,I),S===null?k=O:S.sibling=O,S=O,E=D}if(I===w.length)return n(v,E),Ot&&lo(v,I),k;if(E===null){for(;I<w.length;I++)E=d(v,w[I],j),E!==null&&(b=a(E,b,I),S===null?k=E:S.sibling=E,S=E);return Ot&&lo(v,I),k}for(E=r(v,E);I<w.length;I++)D=m(E,v,I,w[I],j),D!==null&&(e&&D.alternate!==null&&E.delete(D.key===null?I:D.key),b=a(D,b,I),S===null?k=D:S.sibling=D,S=D);return e&&E.forEach(function(_){return t(v,_)}),Ot&&lo(v,I),k}function y(v,b,w,j){var k=Ss(w);if(typeof k!="function")throw Error(se(150));if(w=k.call(w),w==null)throw Error(se(151));for(var S=k=null,E=b,I=b=0,D=null,O=w.next();E!==null&&!O.done;I++,O=w.next()){E.index>I?(D=E,E=null):D=E.sibling;var _=p(v,E,O.value,j);if(_===null){E===null&&(E=D);break}e&&E&&_.alternate===null&&t(v,E),b=a(_,b,I),S===null?k=_:S.sibling=_,S=_,E=D}if(O.done)return n(v,E),Ot&&lo(v,I),k;if(E===null){for(;!O.done;I++,O=w.next())O=d(v,O.value,j),O!==null&&(b=a(O,b,I),S===null?k=O:S.sibling=O,S=O);return Ot&&lo(v,I),k}for(E=r(v,E);!O.done;I++,O=w.next())O=m(E,v,I,O.value,j),O!==null&&(e&&O.alternate!==null&&E.delete(O.key===null?I:O.key),b=a(O,b,I),S===null?k=O:S.sibling=O,S=O);return e&&E.forEach(function(M){return t(v,M)}),Ot&&lo(v,I),k}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 k=w.key,S=b;S!==null;){if(S.key===k){if(k=w.type,k===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===k||typeof k=="object"&&k!==null&&k.$$typeof===fa&&rw(k)===S.type){n(v,S.sibling),b=i(S,w.props),b.ref=Ts(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=ko(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=Ts(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(Vs(w))return g(v,b,w,j);if(Ss(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=QE(!0),JE=QE(!1),ff=Ua(null),pf=null,Sl=null,ix=null;function ax(){ix=Sl=pf=null}function ox(e){var t=ff.current;Pt(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(se(308));Sl=e,pf.dependencies={lanes:0,firstContext:e}}else Sl=Sl.next=e;return t}var mo=null;function lx(e){mo===null?mo=[e]:mo.push(e)}function ZE(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 e2(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,Je&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 iw(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);_o|=l,e.lanes=l,e.memoizedState=d}}function aw(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(se(191,i));i.call(r)}}}var ou={},xi=Ua(ou),Oc=Ua(ou),Ac=Ua(ou);function go(e){if(e===ou)throw Error(se(174));return e}function cx(e,t){switch(bt(Ac,t),bt(Oc,e),bt(xi,ou),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)}Pt(xi),bt(xi,t)}function Kl(){Pt(xi),Pt(Oc),Pt(Ac)}function t2(e){go(Ac.current);var t=go(xi.current),n=Mg(t,e.type);t!==n&&(bt(Oc,e),bt(xi,n))}function ux(e){Oc.current===e&&(Pt(xi),Pt(Oc))}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,No=0,Mt=null,on=null,gn=null,gf=!1,sc=!1,Ic=0,IL=0;function On(){throw Error(se(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(No=a,Mt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,zd.current=e===null||e.memoizedState===null?RL:DL,e=n(r,i),sc){a=0;do{if(sc=!1,Ic=0,25<=a)throw Error(se(301));a+=1,gn=on=null,t.updateQueue=null,zd.current=LL,e=n(r,i)}while(sc)}if(zd.current=vf,t=on!==null&&on.next!==null,No=0,gn=on=Mt=null,gf=!1,t)throw Error(se(300));return e}function hx(){var e=Ic!==0;return Ic=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(se(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 Nc(e,t){return typeof t=="function"?t(e):t}function Im(e){var t=Dr(),n=t.queue;if(n===null)throw Error(se(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((No&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,_o|=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,_o|=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(se(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 n2(){}function r2(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(o2.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||gn!==null&&gn.memoizedState.tag&1){if(n.flags|=2048,_c(9,a2.bind(null,n,r,i,t),void 0,null),yn===null)throw Error(se(349));No&30||i2(n,t,i)}return i}function i2(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 a2(e,t,n,r){t.value=n,t.getSnapshot=r,l2(t)&&s2(e)}function o2(e,t,n){return n(function(){l2(t)&&s2(e)})}function l2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qr(e,n)}catch{return!0}}function s2(e){var t=Hi(e,1);t!==null&&Xr(t,e,1,-1)}function ow(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:Nc,lastRenderedState:e},t.queue=e,e=e.dispatch=ML.bind(null,Mt,e),[t.memoizedState,e]}function _c(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 c2(){return Dr().memoizedState}function $d(e,t,n,r){var i=di();Mt.flags|=e,i.memoizedState=_c(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=_c(t,n,a,r);return}}Mt.flags|=e,i.memoizedState=_c(1|t,n,a,r)}function lw(e,t){return $d(8390656,8,e,t)}function mx(e,t){return Mp(2048,8,e,t)}function u2(e,t){return Mp(4,2,e,t)}function d2(e,t){return Mp(4,4,e,t)}function f2(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 p2(e,t,n){return n=n!=null?n.concat([e]):null,Mp(4,4,f2.bind(null,t,e),n)}function gx(){}function h2(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 m2(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 g2(e,t,n){return No&21?(Qr(n,t)||(n=wE(),Mt.lanes|=n,_o|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,er=!0),e.memoizedState=n)}function NL(e,t){var n=ct;ct=n!==0&&4>n?n:4,e(!0);var r=Am.transition;Am.transition={};try{e(!1),t()}finally{ct=n,Am.transition=r}}function v2(){return Dr().memoizedState}function _L(e,t,n){var r=Oa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},y2(e))x2(t,n);else if(n=ZE(e,t,n,r),n!==null){var i=Kn();Xr(n,e,r,i),b2(n,t,r)}}function ML(e,t,n){var r=Oa(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(y2(e))x2(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=ZE(e,t,i,r),n!==null&&(i=Kn(),Xr(n,e,r,i),b2(n,t,r))}}function y2(e){var t=e.alternate;return e===Mt||t!==null&&t===Mt}function x2(e,t){sc=gf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function b2(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},RL={readContext:Rr,useCallback:function(e,t){return di().memoizedState=[e,t===void 0?null:t],e},useContext:Rr,useEffect:lw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$d(4194308,4,f2.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=_L.bind(null,Mt,e),[r.memoizedState,e]},useRef:function(e){var t=di();return e={current:e},t.memoizedState=e},useState:ow,useDebugValue:gx,useDeferredValue:function(e){return di().memoizedState=e},useTransition:function(){var e=ow(!1),t=e[0];return e=NL.bind(null,e[1]),di().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Mt,i=di();if(Ot){if(n===void 0)throw Error(se(407));n=n()}else{if(n=t(),yn===null)throw Error(se(349));No&30||i2(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,lw(o2.bind(null,r,a,e),[e]),r.flags|=2048,_c(9,a2.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=di(),t=yn.identifierPrefix;if(Ot){var n=zi,r=Li;n=(r&~(1<<32-Gr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ic++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=IL++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},DL={readContext:Rr,useCallback:h2,useContext:Rr,useEffect:mx,useImperativeHandle:p2,useInsertionEffect:u2,useLayoutEffect:d2,useMemo:m2,useReducer:Im,useRef:c2,useState:function(){return Im(Nc)},useDebugValue:gx,useDeferredValue:function(e){var t=Dr();return g2(t,on.memoizedState,e)},useTransition:function(){var e=Im(Nc)[0],t=Dr().memoizedState;return[e,t]},useMutableSource:n2,useSyncExternalStore:r2,useId:v2,unstable_isNewReconciler:!1},LL={readContext:Rr,useCallback:h2,useContext:Rr,useEffect:mx,useImperativeHandle:p2,useInsertionEffect:u2,useLayoutEffect:d2,useMemo:m2,useReducer:Nm,useRef:c2,useState:function(){return Nm(Nc)},useDebugValue:gx,useDeferredValue:function(e){var t=Dr();return on===null?t.memoizedState=e:g2(t,on.memoizedState,e)},useTransition:function(){var e=Nm(Nc)[0],t=Dr().memoizedState;return[e,t]},useMutableSource:n2,useSyncExternalStore:r2,useId:v2,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)?Ho(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 sw(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?!Cc(n,r)||!Cc(i,a):!0}function w2(e,t,n){var r=!1,i=Da,a=t.contextType;return typeof a=="object"&&a!==null?a=Rr(a):(i=ir(t)?Ao: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 cw(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)?Ao: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+=dD(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 zL=typeof WeakMap=="function"?WeakMap:Map;function j2(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 S2(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 uw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zL;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=JL.bind(null,e,t,n),t.then(e,e))}function dw(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 fw(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 $L=Ji.ReactCurrentOwner,er=!1;function Fn(e,t,n,r){t.child=e===null?JE(t,null,n,r):Wl(t,e.child,n,r)}function pw(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)):(Ot&&n&&tx(t),t.flags|=1,Fn(e,t,r,i),t.child)}function hw(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,k2(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:Cc,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 k2(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cc(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 C2(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},bt(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,bt(Cl,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,bt(Cl,cr),cr|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,bt(Cl,cr),cr|=r;return Fn(e,t,i,n),t.child}function P2(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)?Ao: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)):(Ot&&r&&tx(t),t.flags|=1,Fn(e,t,n,i),t.child)}function mw(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),w2(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)?Ao: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)&&cw(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||sw(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,e2(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)?Ao: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)&&cw(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||sw(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){P2(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return i&&ew(t,n,!1),Vi(e,t,a);r=t.stateNode,$L.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&&ew(t,n,!0),t.child}function E2(e){var t=e.stateNode;t.pendingContext?Z1(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Z1(e,t.context,!1),cx(e,t.containerInfo)}function gw(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 T2(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),bt(_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=ko(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 BL(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=ko(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 BL(e,t,n,r,i,a,l){if(n)return t.flags&256?(t.flags&=-257,r=_m(Error(se(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=ko(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(se(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(se(421))),nd(e,t,l,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=ZL.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,dr=Pa(i.nextSibling),hr=t,Ot=!0,qr=null,e!==null&&(Tr[Or++]=Li,Tr[Or++]=zi,Tr[Or++]=Io,Li=e.id,zi=e.overflow,Io=t),t=vx(t,r.children),t.flags|=4096,t)}function vw(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 O2(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&&vw(e,n,t);else if(e.tag===19)vw(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(bt(_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),_o|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(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 FL(e,t,n){switch(t.tag){case 3:E2(t),Ul();break;case 5:t2(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;bt(ff,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(bt(_t,_t.current&1),t.flags|=128,null):n&t.child.childLanes?T2(e,t,n):(bt(_t,_t.current&1),e=Vi(e,t,n),e!==null?e.sibling:null);bt(_t,_t.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return O2(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),bt(_t,_t.current),r)break;return null;case 22:case 23:return t.lanes=0,C2(e,t,n)}return Vi(e,t,n)}var A2,sv,I2,N2;A2=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(){};I2=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,go(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"&&(yc.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"&&(yc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&St("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)}};N2=function(e,t,n,r){n!==r&&(t.flags|=4)};function Os(e,t){if(!Ot)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 UL(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(),Pt(rr),Pt(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=go(Ac.current);if(n=t.type,e!==null&&t.stateNode!=null)I2(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(se(166));return An(t),null}if(e=go(xi.current),ed(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[hi]=t,r[Tc]=a,e=(t.mode&1)!==0,n){case"dialog":St("cancel",r),St("close",r);break;case"iframe":case"object":case"embed":St("load",r);break;case"video":case"audio":for(i=0;i<Gs.length;i++)St(Gs[i],r);break;case"source":St("error",r);break;case"img":case"image":case"link":St("error",r),St("load",r);break;case"details":St("toggle",r);break;case"input":P1(r,a),St("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},St("invalid",r);break;case"textarea":T1(r,a),St("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]):yc.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&St("scroll",r)}switch(n){case"input":qu(r),E1(r,a,!0);break;case"textarea":qu(r),O1(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=oE(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[Tc]=r,A2(e,t,!1,!1),t.stateNode=e;e:{switch(l=Dg(n,r),n){case"dialog":St("cancel",e),St("close",e),i=r;break;case"iframe":case"object":case"embed":St("load",e),i=r;break;case"video":case"audio":for(i=0;i<Gs.length;i++)St(Gs[i],e);i=r;break;case"source":St("error",e),i=r;break;case"img":case"image":case"link":St("error",e),St("load",e),i=r;break;case"details":St("toggle",e),i=r;break;case"input":P1(e,r),i=Ag(e,r),St("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Dt({},r,{value:void 0}),St("invalid",e);break;case"textarea":T1(e,r),i=_g(e,r),St("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"?cE(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&lE(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&xc(e,c):typeof c=="number"&&xc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(yc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&St("scroll",e):c!=null&&Fy(e,a,c,l))}switch(n){case"input":qu(e),E1(e,r,!1);break;case"textarea":qu(e),O1(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)N2(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(se(166));if(n=go(Ac.current),go(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(Pt(_t),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ot&&dr!==null&&t.mode&1&&!(t.flags&128))XE(),Ul(),t.flags|=98560,a=!1;else if(a=ed(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(se(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(se(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&&Pc(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(Pt(_t),a=t.memoizedState,a===null)return An(t),null;if(r=(t.flags&128)!==0,l=a.rendering,l===null)if(r)Os(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,Os(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 bt(_t,_t.current&1|2),t.child}e=e.sibling}a.tail!==null&&Yt()>Hl&&(t.flags|=128,r=!0,Os(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),Os(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!Ot)return An(t),null}else 2*Yt()-a.renderingStartTime>Hl&&n!==1073741824&&(t.flags|=128,r=!0,Os(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,bt(_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(se(156,t.tag))}function WL(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(),Pt(rr),Pt(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(Pt(_t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));Ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pt(_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,KL=typeof WeakSet=="function"?WeakSet:Set,be=null;function kl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Wt(e,t,r)}else n.current=null}function cv(e,t,n){try{n()}catch(r){Wt(e,t,r)}}var yw=!1;function qL(e,t){if(Hg=rf,e=LE(),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,be=t;be!==null;)if(t=be,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,be=e;else for(;be!==null;){t=be;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(se(163))}}catch(j){Wt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,be=e;break}be=t.return}return g=yw,yw=!1,g}function cc(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 _2(e){var t=e.alternate;t!==null&&(e.alternate=null,_2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[hi],delete t[Tc],delete t[Xg],delete t[EL],delete t[TL])),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 M2(e){return e.tag===5||e.tag===3||e.tag===4}function xw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||M2(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;)R2(e,t,n),n=n.sibling}function R2(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),Sc(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){Wt(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 bw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new KL),t.forEach(function(r){var i=ez.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(se(160));R2(a,l,i),kn=null,Kr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Wt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)D2(t,e),t=t.sibling}function D2(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{cc(3,e,e.return),Dp(3,e)}catch(y){Wt(e,e.return,y)}try{cc(5,e,e.return)}catch(y){Wt(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{xc(i,"")}catch(y){Wt(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&&iE(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"?cE(i,d):f==="dangerouslySetInnerHTML"?lE(i,d):f==="children"?xc(i,d):Fy(i,f,d,u)}switch(s){case"input":Ig(i,a);break;case"textarea":aE(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[Tc]=a}catch(y){Wt(e,e.return,y)}}break;case 6:if(Ur(t,e),ai(e),r&4){if(e.stateNode===null)throw Error(se(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){Wt(e,e.return,y)}}break;case 3:if(Ur(t,e),ai(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Sc(t.containerInfo)}catch(y){Wt(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&&bw(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(be=e,f=e.child;f!==null;){for(d=be=f;be!==null;){switch(p=be,m=p.child,p.tag){case 0:case 11:case 14:case 15:cc(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){Wt(r,n,y)}}break;case 5:kl(p,p.return);break;case 22:if(p.memoizedState!==null){jw(d);continue}}m!==null?(m.return=p,be=m):jw(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=sE("display",l))}catch(y){Wt(e,e.return,y)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){Wt(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&&bw(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(M2(n)){var r=n;break e}n=n.return}throw Error(se(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(xc(i,""),r.flags&=-33);var a=xw(e);fv(e,a,i);break;case 3:case 4:var l=r.stateNode.containerInfo,s=xw(e);dv(e,s,l);break;default:throw Error(se(161))}}catch(c){Wt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function HL(e,t,n){be=e,L2(e)}function L2(e,t,n){for(var r=(e.mode&1)!==0;be!==null;){var i=be,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(be=i;be!==null;)l=be,c=l.child,l.tag===22&&l.memoizedState!==null?Sw(i):c!==null?(c.return=l,be=c):Sw(i);for(;a!==null;)be=a,L2(a),a=a.sibling;be=i,rd=s,_n=u}ww(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,be=a):ww(e)}}function ww(e){for(;be!==null;){var t=be;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&&aw(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}aw(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&&Sc(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}_n||t.flags&512&&uv(t)}catch(p){Wt(t,t.return,p)}}if(t===e){be=null;break}if(n=t.sibling,n!==null){n.return=t.return,be=n;break}be=t.return}}function jw(e){for(;be!==null;){var t=be;if(t===e){be=null;break}var n=t.sibling;if(n!==null){n.return=t.return,be=n;break}be=t.return}}function Sw(e){for(;be!==null;){var t=be;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Dp(4,t)}catch(c){Wt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){Wt(t,i,c)}}var a=t.return;try{uv(t)}catch(c){Wt(t,a,c)}break;case 5:var l=t.return;try{uv(t)}catch(c){Wt(t,l,c)}}}catch(c){Wt(t,t.return,c)}if(t===e){be=null;break}var s=t.sibling;if(s!==null){s.return=t.return,be=s;break}be=t.return}}var VL=Math.ceil,yf=Ji.ReactCurrentDispatcher,yx=Ji.ReactCurrentOwner,Mr=Ji.ReactCurrentBatchConfig,Je=0,yn=null,en=null,Pn=0,cr=0,Cl=Ua(0),sn=0,Mc=null,_o=0,Lp=0,xx=0,uc=null,Zn=null,bx=0,Hl=1/0,_i=null,xf=!1,pv=null,Ta=null,id=!1,ba=null,bf=0,dc=0,hv=null,Fd=-1,Ud=0;function Kn(){return Je&6?Yt():Fd!==-1?Fd:Fd=Yt()}function Oa(e){return e.mode&1?Je&2&&Pn!==0?Pn&-Pn:AL.transition!==null?(Ud===0&&(Ud=wE()),Ud):(e=ct,e!==0||(e=window.event,e=e===void 0?16:TE(e.type)),e):1}function Xr(e,t,n,r){if(50<dc)throw dc=0,hv=null,Error(se(185));ru(e,n,r),(!(Je&2)||e!==yn)&&(e===yn&&(!(Je&2)&&(Lp|=n),sn===4&&va(e,Pn)),ar(e,r),n===1&&Je===0&&!(t.mode&1)&&(Hl=Yt()+500,_p&&Wa()))}function ar(e,t){var n=e.callbackNode;AD(e,t);var r=nf(e,e===yn?Pn:0);if(r===0)n!==null&&N1(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&N1(n),t===1)e.tag===0?OL(kw.bind(null,e)):VE(kw.bind(null,e)),CL(function(){!(Je&6)&&Wa()}),n=null;else{switch(jE(r)){case 1:n=Hy;break;case 4:n=xE;break;case 16:n=tf;break;case 536870912:n=bE;break;default:n=tf}n=q2(n,z2.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function z2(e,t){if(Fd=-1,Ud=0,Je&6)throw Error(se(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=Je;Je|=2;var a=B2();(yn!==e||Pn!==t)&&(_i=null,Hl=Yt()+500,So(e,t));do try{XL();break}catch(s){$2(e,s)}while(!0);ax(),yf.current=a,Je=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=Mc,So(e,0),va(e,r),ar(e,Yt()),n;if(t===6)va(e,r);else{if(i=e.current.alternate,!(r&30)&&!YL(i)&&(t=wf(e,r),t===2&&(a=Fg(e),a!==0&&(r=a,t=mv(e,a))),t===1))throw n=Mc,So(e,0),va(e,r),ar(e,Yt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(se(345));case 2:so(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(so.bind(null,e,Zn,_i),t);break}so(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*VL(r/1960))-r,10<r){e.timeoutHandle=Gg(so.bind(null,e,Zn,_i),r);break}so(e,Zn,_i);break;case 5:so(e,Zn,_i);break;default:throw Error(se(329))}}}return ar(e,Yt()),e.callbackNode===n?z2.bind(null,e):null}function mv(e,t){var n=uc;return e.current.memoizedState.isDehydrated&&(So(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 YL(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 kw(e){if(Je&6)throw Error(se(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=Mc,So(e,0),va(e,t),ar(e,Yt()),n;if(n===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,so(e,Zn,_i),ar(e,Yt()),null}function wx(e,t){var n=Je;Je|=1;try{return e(t)}finally{Je=n,Je===0&&(Hl=Yt()+500,_p&&Wa())}}function Mo(e){ba!==null&&ba.tag===0&&!(Je&6)&&Ml();var t=Je;Je|=1;var n=Mr.transition,r=ct;try{if(Mr.transition=null,ct=1,e)return e()}finally{ct=r,Mr.transition=n,Je=t,!(Je&6)&&Wa()}}function jx(){cr=Cl.current,Pt(Cl)}function So(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,kL(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(),Pt(rr),Pt(Dn),dx();break;case 5:ux(r);break;case 4:Kl();break;case 13:Pt(_t);break;case 19:Pt(_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,Mc=null,xx=Lp=_o=0,Zn=uc=null,mo!==null){for(t=0;t<mo.length;t++)if(n=mo[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}mo=null}return e}function $2(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(No=0,gn=on=Mt=null,sc=!1,Ic=0,yx.current=null,n===null||n.return===null){sn=1,Mc=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=dw(l);if(m!==null){m.flags&=-257,fw(m,l,s,a,t),m.mode&1&&uw(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)){uw(a,u,t),Sx();break e}c=Error(se(426))}}else if(Ot&&s.mode&1){var x=dw(l);if(x!==null){!(x.flags&65536)&&(x.flags|=256),fw(x,l,s,a,t),rx(ql(c,s));break e}}a=c=ql(c,s),sn!==4&&(sn=2),uc===null?uc=[a]:uc.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var v=j2(a,c,t);iw(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=S2(a,s,t);iw(a,j);break e}}a=a.return}while(a!==null)}U2(n)}catch(k){t=k,en===n&&n!==null&&(en=n=n.return);continue}break}while(!0)}function B2(){var e=yf.current;return yf.current=vf,e===null?vf:e}function Sx(){(sn===0||sn===3||sn===2)&&(sn=4),yn===null||!(_o&268435455)&&!(Lp&268435455)||va(yn,Pn)}function wf(e,t){var n=Je;Je|=2;var r=B2();(yn!==e||Pn!==t)&&(_i=null,So(e,t));do try{GL();break}catch(i){$2(e,i)}while(!0);if(ax(),Je=n,yf.current=r,en!==null)throw Error(se(261));return yn=null,Pn=0,sn}function GL(){for(;en!==null;)F2(en)}function XL(){for(;en!==null&&!wD();)F2(en)}function F2(e){var t=K2(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?U2(e):en=t,yx.current=null}function U2(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=WL(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=UL(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 so(e,t,n){var r=ct,i=Mr.transition;try{Mr.transition=null,ct=1,QL(e,t,n,r)}finally{Mr.transition=i,ct=r}return null}function QL(e,t,n,r){do Ml();while(ba!==null);if(Je&6)throw Error(se(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(se(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(ID(e,a),e===yn&&(en=yn=null,Pn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||id||(id=!0,q2(tf,function(){return Ml(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Mr.transition,Mr.transition=null;var l=ct;ct=1;var s=Je;Je|=4,yx.current=null,qL(e,n),D2(n,e),vL(Vg),rf=!!Hg,Vg=Hg=null,e.current=n,HL(n),jD(),Je=s,ct=l,Mr.transition=a}else e.current=n;if(id&&(id=!1,ba=e,bf=i),a=e.pendingLanes,a===0&&(Ta=null),CD(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?dc++:(dc=0,hv=e):dc=0,Wa(),null}function Ml(){if(ba!==null){var e=jE(bf),t=Mr.transition,n=ct;try{if(Mr.transition=null,ct=16>e?16:e,ba===null)var r=!1;else{if(e=ba,ba=null,bf=0,Je&6)throw Error(se(331));var i=Je;for(Je|=4,be=e.current;be!==null;){var a=be,l=a.child;if(be.flags&16){var s=a.deletions;if(s!==null){for(var c=0;c<s.length;c++){var u=s[c];for(be=u;be!==null;){var f=be;switch(f.tag){case 0:case 11:case 15:cc(8,f,a)}var d=f.child;if(d!==null)d.return=f,be=d;else for(;be!==null;){f=be;var p=f.sibling,m=f.return;if(_2(f),f===u){be=null;break}if(p!==null){p.return=m,be=p;break}be=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)}}be=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,be=l;else e:for(;be!==null;){if(a=be,a.flags&2048)switch(a.tag){case 0:case 11:case 15:cc(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,be=v;break e}be=a.return}}var b=e.current;for(be=b;be!==null;){l=be;var w=l.child;if(l.subtreeFlags&2064&&w!==null)w.return=l,be=w;else e:for(l=b;be!==null;){if(s=be,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:Dp(9,s)}}catch(k){Wt(s,s.return,k)}if(s===l){be=null;break e}var j=s.sibling;if(j!==null){j.return=s.return,be=j;break e}be=s.return}}if(Je=i,Wa(),yi&&typeof yi.onPostCommitFiberRoot=="function")try{yi.onPostCommitFiberRoot(Tp,e)}catch{}r=!0}return r}finally{ct=n,Mr.transition=t}}return!1}function Cw(e,t,n){t=ql(n,t),t=j2(e,t,1),e=Ea(e,t,1),t=Kn(),e!==null&&(ru(e,1,t),ar(e,t))}function Wt(e,t,n){if(e.tag===3)Cw(e,e,n);else for(;t!==null;){if(t.tag===3){Cw(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=S2(t,e,1),t=Ea(t,e,1),e=Kn(),t!==null&&(ru(t,1,e),ar(t,e));break}}t=t.return}}function JL(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?So(e,0):xx|=n),ar(e,t)}function W2(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&&(ru(e,t,n),ar(e,n))}function ZL(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),W2(e,n)}function ez(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(se(314))}r!==null&&r.delete(t),W2(e,n)}var K2;K2=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,FL(e,t,n);er=!!(e.flags&131072)}else er=!1,Ot&&t.flags&1048576&&YE(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,Ot&&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=nz(r),e=Wr(r,e),i){case 0:t=iv(null,t,r,e,n);break e;case 1:t=mw(null,t,r,e,n);break e;case 11:t=pw(null,t,r,e,n);break e;case 14:t=hw(null,t,r,Wr(r.type,e),n);break e}throw Error(se(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),mw(e,t,r,i,n);case 3:e:{if(E2(t),e===null)throw Error(se(387));r=t.pendingProps,a=t.memoizedState,i=a.element,e2(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(se(423)),t),t=gw(e,t,r,n,i);break e}else if(r!==i){i=ql(Error(se(424)),t),t=gw(e,t,r,n,i);break e}else for(dr=Pa(t.stateNode.containerInfo.firstChild),hr=t,Ot=!0,qr=null,n=JE(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 t2(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),P2(e,t),Fn(e,t,l,n),t.child;case 6:return e===null&&Zg(t),null;case 13:return T2(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),pw(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,bt(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(se(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),hw(e,t,r,i,n);case 15:return k2(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),w2(t,r,i),nv(t,r,i,n),av(null,t,r,!0,e,n);case 19:return O2(e,t,n);case 22:return C2(e,t,n)}throw Error(se(156,t.tag))};function q2(e,t){return yE(e,t)}function tz(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 tz(e,t,n,r)}function kx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nz(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 ko(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 tE:return zp(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ZP:l=10;break e;case eE: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(se(130,e==null?e:typeof e,""))}return t=Ir(l,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function ko(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=tE,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 rz(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 rz(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 iz(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 H2(e){if(!e)return Da;e=e._reactInternals;e:{if(Ho(e)!==e||e.tag!==1)throw Error(se(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(se(171))}if(e.tag===1){var n=e.type;if(ir(n))return HE(e,n,t)}return t}function V2(e,t,n,r,i,a,l,s,c){return e=Cx(n,r,!0,e,i,a,l,s,c),e.context=H2(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,ru(e,i,r),ar(e,r),e}function $p(e,t,n,r){var i=t.current,a=Kn(),l=Oa(i);return n=H2(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 Pw(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){Pw(e,t),(e=e.alternate)&&Pw(e,t)}function az(){return null}var Y2=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(se(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;Mo(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=CE();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&&EE(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 Ew(){}function oz(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=V2(t,r,e,0,null,!1,!1,"",Ew);return e._reactRootContainer=l,e[qi]=l.current,Pc(e.nodeType===8?e.parentNode:e),Mo(),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,"",Ew);return e._reactRootContainer=c,e[qi]=c.current,Pc(e.nodeType===8?e.parentNode:e),Mo(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=oz(n,t,e,i,r);return jf(l)}SE=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ys(t.pendingLanes);n!==0&&(Vy(t,n|1),ar(t,Yt()),!(Je&6)&&(Hl=Yt()+500,Wa()))}break;case 13:Mo(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)}};kE=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)}};CE=function(){return ct};PE=function(e,t){var n=ct;try{return ct=e,t()}finally{ct=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(se(90));rE(r),Ig(r,i)}}}break;case"textarea":aE(e,n);break;case"select":t=n.value,t!=null&&Ol(e,!!n.multiple,t,!1)}};fE=wx;pE=Mo;var lz={usingClientEntryPoint:!1,Events:[au,xl,Np,uE,dE,wx]},As={findFiberByHostInstance:ho,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},sz={bundleType:As.bundleType,version:As.version,rendererPackageName:As.rendererPackageName,rendererConfig:As.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=gE(e),e===null?null:e.stateNode},findFiberByHostInstance:As.findFiberByHostInstance||az,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(sz),yi=ad}catch{}}xr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lz;xr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tx(t))throw Error(se(200));return iz(e,t,null,n)};xr.createRoot=function(e,t){if(!Tx(e))throw Error(se(299));var n=!1,r="",i=Y2;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,Pc(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(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=gE(t),e=e===null?null:e.stateNode,e};xr.flushSync=function(e){return Mo(e)};xr.hydrate=function(e,t,n){if(!Fp(t))throw Error(se(200));return Up(null,e,t,!0,n)};xr.hydrateRoot=function(e,t,n){if(!Tx(e))throw Error(se(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",l=Y2;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=V2(t,null,e,1,n??null,i,!1,a,l),e[qi]=t.current,Pc(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(se(200));return Up(null,e,t,!1,n)};xr.unmountComponentAtNode=function(e){if(!Fp(e))throw Error(se(40));return e._reactRootContainer?(Mo(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(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return Up(e,t,n,!1,r)};xr.version="18.3.1-next-f1338f8080-20240426";function G2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(G2)}catch(e){console.error(e)}}G2(),GP.exports=xr;var Wp=GP.exports,Tw=Wp;kg.createRoot=Tw.createRoot,kg.hydrateRoot=Tw.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 Rc(){return Rc=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},Rc.apply(null,arguments)}var wa;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(wa||(wa={}));const Ow="popstate";function cz(e){e===void 0&&(e={});function t(i,a){let{pathname:l="/",search:s="",hash:c=""}=Vo(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 dz(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 uz(){return Math.random().toString(36).substr(2,8)}function Aw(e,t){return{usr:e.state,key:e.key,idx:t}}function vv(e,t,n,r){return n===void 0&&(n=null),Rc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Vo(t):t,{state:n,key:t&&t.key||r||uz()})}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 Vo(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 dz(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(Rc({},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=Aw(b,u),j=y.createHref(b);try{l.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;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=Aw(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(Ow,d),c=x,()=>{i.removeEventListener(Ow,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 Iw;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Iw||(Iw={}));function fz(e,t,n){return n===void 0&&(n="/"),pz(e,t,n)}function pz(e,t,n,r){let i=typeof t=="string"?Vo(t):t,a=Vl(i.pathname||"/",n);if(a==null)return null;let l=X2(e);hz(l);let s=null,c=Cz(a);for(let u=0;s==null&&u<l.length;++u)s=Sz(l[u],c);return s}function X2(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+'".')),X2(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:wz(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 Q2(a.path))i(a,l,c)}),t}function Q2(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=Q2(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 hz(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:jz(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const mz=/^:[\w-]+$/,gz=3,vz=2,yz=1,xz=10,bz=-2,Nw=e=>e==="*";function wz(e,t){let n=e.split("/"),r=n.length;return n.some(Nw)&&(r+=bz),t&&(r+=vz),n.filter(i=>!Nw(i)).reduce((i,a)=>i+(mz.test(a)?gz:a===""?yz:xz),r)}function jz(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 Sz(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:Az(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]=kz(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 kz(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 Cz(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 Pz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ez=e=>Pz.test(e);function Tz(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Vo(e):e,a;if(n)if(Ez(n))a=n;else{if(n.includes("//")){let l=n;n=J2(n),Kp(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?a=_w(n.substring(1),"/"):a=_w(n,t)}else a=t;return{pathname:a,search:Iz(r),hash:Nz(i)}}function _w(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 Oz(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ox(e,t){let n=Oz(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=Vo(e):(i=Rc({},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=Tz(i,s),u=l&&l!=="/"&&l.endsWith("/"),f=(a||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const J2=e=>e.replace(/\/\/+/g,"/"),Ia=e=>J2(e.join("/")),Az=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Iz=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nz=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _z(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Z2=["post","put","patch","delete"];new Set(Z2);const Mz=["get",...Z2];new Set(Mz);/**
|
|
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 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)}const qp=h.createContext(null),eT=h.createContext(null),Zi=h.createContext(null),Hp=h.createContext(null),ea=h.createContext({outlet:null,matches:[],isDataRoute:!1}),tT=h.createContext(null);function Rz(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 nT(e){h.useContext(Zi).static||h.useLayoutEffect(e)}function Vp(){let{isDataRoute:e}=h.useContext(ea);return e?Gz():Dz()}function Dz(){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 nT(()=>{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 Lz(){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 zz(e,t){return $z(e,t)}function $z(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"?Vo(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=fz(e,{pathname:m}),y=Kz(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:Dc({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:wa.Pop}},y):y}function Bz(){let e=Yz(),t=_z(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return 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 Fz=h.createElement(Bz,null);class Uz 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(tT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Wz(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 Kz(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||Fz,c&&(u<0&&p===0?(Xz("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(Wz,{match:d,routeContext:{outlet:f,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?h.createElement(Uz,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var rT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rT||{}),iT=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}(iT||{});function qz(e){let t=h.useContext(qp);return t||Rt(!1),t}function Hz(e){let t=h.useContext(eT);return t||Rt(!1),t}function Vz(e){let t=h.useContext(ea);return t||Rt(!1),t}function aT(e){let t=Vz(),n=t.matches[t.matches.length-1];return n.route.id||Rt(!1),n.route.id}function Yz(){var e;let t=h.useContext(tT),n=Hz(),r=aT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Gz(){let{router:e}=qz(rT.UseNavigateStable),t=aT(iT.UseNavigateStable),n=h.useRef(!1);return nT(()=>{n.current=!0}),h.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Dc({fromRouteId:t},a)))},[e,t])}const Mw={};function Xz(e,t,n){Mw[e]||(Mw[e]=!0)}function Qz(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 Jz(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:Dc({v7_relativeSplatPath:!1},s)}),[c,s,a,l]);typeof r=="string"&&(r=Vo(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 Zz(e){let{children:t,location:n}=e;return zz(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 oT(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 e$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function t$(e,t){return e.button===0&&(!t||t==="_self")&&!e$(e)}const n$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],r$=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],i$="6";try{window.__reactRouterVersion=i$}catch{}const a$=h.createContext({isTransitioning:!1}),o$="startTransition",Rw=VP[o$];function l$(e){let{basename:t,children:n,future:r,window:i}=e,a=h.useRef();a.current==null&&(a.current=cz({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&&Rw?Rw(()=>c(d)):c(d)},[c,u]);return h.useLayoutEffect(()=>l.listen(f),[l,f]),h.useEffect(()=>Qz(r),[r]),h.createElement(Jz,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const s$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",c$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,u$=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=oT(t,n$),{basename:m}=h.useContext(Zi),g,y=!1;if(typeof u=="string"&&c$.test(u)&&(g=u,s$))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=Vl(j.pathname,m);j.origin===w.origin&&k!=null?u=k+j.search+j.hash:y=!0}catch{}let x=Rz(u,{relative:i}),v=f$(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=oT(t,r$),p=Yp(c,{relative:d.relative}),m=ss(),g=h.useContext(eT),{navigator:y,basename:x}=h.useContext(Zi),v=g!=null&&p$(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 k=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let S=w===b||!l&&w.startsWith(b)&&w.charAt(k)==="/",E=j!=null&&(j===b||!l&&j.startsWith(b)&&j.charAt(b.length)==="/"),I={isActive:S,isPending:E,isTransitioning:v},D=S?r:void 0,O;typeof a=="function"?O=a(I):O=[a,S?"active":null,E?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let _=typeof s=="function"?s(I):s;return h.createElement(u$,kf({},d,{"aria-current":D,className:O,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 Dw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Dw||(Dw={}));function d$(e){let t=h.useContext(qp);return t||Rt(!1),t}function f$(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(t$(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 p$(e,t){t===void 0&&(t={});let n=h.useContext(a$);n==null&&Rt(!1);let{basename:r}=d$(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 h$(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const m$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,g$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v$={};function Lw(e,t){return(v$.jsx?g$:m$).test(e)}const y$=/[ \t\n\f\r]/g;function x$(e){return typeof e=="object"?e.type==="text"?zw(e.value):!1:zw(e)}function zw(e){return e.replace(y$,"")===""}class lu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}lu.prototype.normal={};lu.prototype.property={};lu.prototype.space=void 0;function lT(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new lu(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 b$=0;const Le=Yo(),Jt=Yo(),jv=Yo(),ce=Yo(),mt=Yo(),Co=Yo(),sr=Yo();function Yo(){return 2**++b$}const Sv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:Jt,commaOrSpaceSeparated:sr,commaSeparated:Co,number:ce,overloadedBoolean:jv,spaceSeparated:mt},Symbol.toStringTag,{value:"Module"})),zm=Object.keys(Sv);class Ix extends lr{constructor(t,n,r,i){let a=-1;if(super(t,n),$w(this,"space",i),typeof r=="number")for(;++a<zm.length;){const l=zm[a];$w(this,zm[a],(r&Sv[l])===Sv[l])}}}Ix.prototype.defined=!0;function $w(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 lu(t,n,e.space)}const sT=cs({properties:{ariaActiveDescendant:null,ariaAtomic:Jt,ariaAutoComplete:null,ariaBusy:Jt,ariaChecked:Jt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:mt,ariaCurrent:null,ariaDescribedBy:mt,ariaDetails:null,ariaDisabled:Jt,ariaDropEffect:mt,ariaErrorMessage:null,ariaExpanded:Jt,ariaFlowTo:mt,ariaGrabbed:Jt,ariaHasPopup:null,ariaHidden:Jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mt,ariaLevel:ce,ariaLive:null,ariaModal:Jt,ariaMultiLine:Jt,ariaMultiSelectable:Jt,ariaOrientation:null,ariaOwns:mt,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:Jt,ariaReadOnly:Jt,ariaRelevant:null,ariaRequired:Jt,ariaRoleDescription:mt,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:Jt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function cT(e,t){return t in e?e[t]:t}function uT(e,t){return cT(e,t.toLowerCase())}const w$=cs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Co,acceptCharset:mt,accessKey:mt,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alpha:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:mt,autoFocus:Le,autoPlay:Le,blocking:mt,capture:null,charSet:null,checked:Le,cite:null,className:mt,closedBy:null,colorSpace:null,cols:ce,colSpan:ce,command:null,commandFor:null,content:null,contentEditable:Jt,controls:Le,controlsList:mt,coords:ce|Co,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:jv,draggable:Jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:mt,height:ce,hidden:jv,high:ce,href:null,hrefLang:null,htmlFor:mt,httpEquiv:mt,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:mt,itemRef:mt,itemScope:Le,itemType:mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,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:Le,optimum:ce,pattern:null,ping:mt,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:mt,required:Le,reversed:Le,rows:ce,rowSpan:ce,sandbox:mt,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootCustomElementRegistry:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shadowRootSerializable:Le,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:Jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:Jt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mt,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:Jt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Le,disablePictureInPicture:Le,disableRemotePlayback:Le,exportParts:Co,part:mt,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:uT}),j$=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:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:mt,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:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,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:Co,g2:Co,glyphName:Co,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:sr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,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:ce,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:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,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:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:sr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sr,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,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:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:cT}),dT=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()}}),fT=cs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uT}),pT=cs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),S$={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"},k$=/[A-Z]/g,Bw=/-[a-z]/g,C$=/^data[-\w.:]+$/i;function P$(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"&&C$.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Bw,T$);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Bw.test(a)){let l=a.replace(k$,E$);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Ix}return new i(r,t)}function E$(e){return"-"+e.toLowerCase()}function T$(e){return e.charAt(1).toUpperCase()}const O$=lT([sT,w$,dT,fT,pT],"html"),Nx=lT([sT,j$,dT,fT,pT],"svg");function A$(e){return e.join(" ").trim()}var _x={},Fw=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,I$=/\n/g,N$=/^\s*/,_$=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,M$=/^:\s*/,R$=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,D$=/^[;\s]*/,L$=/^\s+|\s+$/g,z$=`
|
|
68
|
-
`,Uw="/",Ww="*",po="",$$="comment",B$="declaration";function F$(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(I$);y&&(n+=y.length);var x=g.lastIndexOf(z$);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(N$)}function f(g){var y;for(g=g||[];y=d();)y!==!1&&g.push(y);return g}function d(){var g=a();if(!(Uw!=e.charAt(0)||Ww!=e.charAt(1))){for(var y=2;po!=e.charAt(y)&&(Ww!=e.charAt(y)||Uw!=e.charAt(y+1));)++y;if(y+=2,po===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:$$,comment:x})}}function p(){var g=a(),y=c(_$);if(y){if(d(),!c(M$))return s("property missing ':'");var x=c(R$),v=g({type:B$,property:Kw(y[0].replace(Fw,po)),value:x?Kw(x[0].replace(Fw,po)):po});return c(D$),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 Kw(e){return e?e.replace(L$,po):po}var U$=F$,W$=Ma&&Ma.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_x,"__esModule",{value:!0});_x.default=q$;const K$=W$(U$);function q$(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,K$.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 H$=/^--[a-zA-Z0-9_-]+$/,V$=/-([a-z])/g,Y$=/^[^-]+$/,G$=/^-(webkit|moz|ms|o|khtml)-/,X$=/^-(ms)-/,Q$=function(e){return!e||Y$.test(e)||H$.test(e)},J$=function(e,t){return t.toUpperCase()},qw=function(e,t){return"".concat(t,"-")},Z$=function(e,t){return t===void 0&&(t={}),Q$(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(X$,qw):e=e.replace(G$,qw),e.replace(V$,J$))};Gp.camelCase=Z$;var e4=Ma&&Ma.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},t4=e4(_x),n4=Gp;function kv(e,t){var n={};return!e||typeof e!="string"||(0,t4.default)(e,function(r,i){r&&i&&(n[(0,n4.camelCase)(r,t)]=i)}),n}kv.default=kv;var r4=kv;const i4=zr(r4),hT=mT("end"),Mx=mT("start");function mT(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 a4(e){const t=Mx(e),n=hT(e);if(t&&n)return{start:t,end:n}}function fc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hw(e.position):"start"in e||"end"in e?Hw(e):"line"in e||"column"in e?Cv(e):""}function Cv(e){return Vw(e&&e.line)+":"+Vw(e&&e.column)}function Hw(e){return Cv(e&&e.start)+"-"+Cv(e&&e.end)}function Vw(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=fc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=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,o4=new Map,l4=/[A-Z]/g,s4=new Set(["table","tbody","thead","tfoot","tr"]),c4=new Set(["td","th"]),gT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function u4(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=y4(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=v4(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:O$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=vT(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function vT(e,t,n){if(t.type==="element")return d4(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return f4(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return h4(e,t,n);if(t.type==="mdxjsEsm")return p4(e,t);if(t.type==="root")return m4(e,t,n);if(t.type==="text")return g4(e,t)}function d4(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=xT(e,t.tagName,!1),l=x4(e,t);let s=Lx(e,t);return s4.has(t.tagName)&&(s=s.filter(function(c){return typeof c=="string"?!x$(c):!0})),yT(e,l,a,t),Dx(l,s),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function f4(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)}Lc(e,t.position)}function p4(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lc(e,t.position)}function h4(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:xT(e,t.name,!0),l=b4(e,t),s=Lx(e,t);return yT(e,l,a,t),Dx(l,s),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function m4(e,t,n){const r={};return Dx(r,Lx(e,t)),e.create(t,e.Fragment,r,n)}function g4(e,t){return t.value}function yT(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 v4(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 y4(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 x4(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Rx.call(t.properties,i)){const a=w4(e,i,t.properties[i]);if(a){const[l,s]=a;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&c4.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 b4(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 Lc(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 Lc(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:o4;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=vT(e,a,l);s!==void 0&&n.push(s)}return n}function w4(e,t,n){const r=P$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?h$(n):A$(n)),r.property==="style"){let i=typeof n=="object"?n:j4(e,String(n));return e.stylePropertyNameCase==="css"&&(i=S4(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?S$[r.property]||r.property:r.attribute,n]}}function j4(e,t){try{return i4(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=gT+"#cannot-parse-style-attribute",i}}function xT(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=Lw(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=Lw(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);Lc(e)}function Lc(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=gT+"#cannot-handle-mdx-estrees-without-createevaluater",n}function S4(e){const t={};let n;for(n in e)Rx.call(e,n)&&(t[k4(n)]=e[n]);return t}function k4(e){let t=e.replace(l4,C4);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function C4(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"]},P4={};function E4(e,t){const n=P4,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bT(e,r,i)}function bT(e,t,n){if(T4(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 Yw(e.children,t,n)}return Array.isArray(e)?Yw(e,t,n):""}function Yw(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=bT(e[i],t,n);return r.join("")}function T4(e){return!!(e&&typeof e=="object")}const Gw=document.createElement("i");function zx(e){const t="&"+e+";";Gw.innerHTML=t;const n=Gw.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 Xw={}.hasOwnProperty;function O4(e){const t={};let n=-1;for(;++n<e.length;)A4(t,e[n]);return t}function A4(e,t){let n;for(n in t){const i=(Xw.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Xw.call(i,l)||(i[l]=[]);const s=a[l];I4(i[l],Array.isArray(s)?s:s?[s]:[])}}}function I4(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 wT(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]/),N4=Ka(/[#-'*+\--9=?A-Z^-~]/);function Pv(e){return e!==null&&(e<32||e===127)}const Ev=Ka(/\d/),_4=Ka(/[\dA-Fa-f]/),M4=Ka(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function or(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const R4=Ka(new RegExp("\\p{P}|\\p{S}","u")),D4=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 wt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(c){return it(c)?(e.enter(n),s(c)):t(c)}function s(c){return it(c)&&a++<i?(e.consume(c),s):(e.exit(n),t(c))}}const L4={tokenize:z4};function z4(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"),wt(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 $4={tokenize:B4},Qw={tokenize:F4};function B4(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 k=j,S;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){S=t.events[k][1].end;break}v(r);let E=j;for(;E<t.events.length;)t.events[E][1].end={...S},E++;return ji(t.events,k+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(Qw,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(Qw,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 k=t.sliceStream(w);if(j&&k.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<l&&(!i.events[S][1].end||i.events[S][1].end.offset>l))return;const E=t.events.length;let I=E,D,O;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(D){O=t.events[I][1].end;break}D=!0}for(v(r),S=E;S<t.events.length;)t.events[S][1].end={...O},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 k=n[j];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function F4(e,t,n){return wt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Jw(e){if(e===null||or(e)||D4(e))return 1;if(R4(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:U4,tokenize:W4};function U4(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};Zw(d,-c),Zw(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 W4(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Jw(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=Jw(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 Zw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const K4={name:"autolink",tokenize:q4};function q4(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):N4(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:H4};function H4(e,t,n){return r;function r(a){return it(a)?wt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Me(a)?t(a):n(a)}}const jT={continuation:{tokenize:Y4},exit:G4,name:"blockQuote",tokenize:V4};function V4(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 it(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Y4(e,t,n){const r=this;return i;function i(l){return it(l)?wt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(jT,t,n)(l)}}function G4(e){e.exit("blockQuote")}const ST={name:"characterEscape",tokenize:X4};function X4(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 M4(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const kT={name:"characterReference",tokenize:Q4};function Q4(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=_4,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 ej={partial:!0,tokenize:Z4},tj={concrete:!0,name:"codeFenced",tokenize:J4};function J4(e,t,n){const r=this,i={partial:!0,tokenize:k};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"),it(S)?wt(e,d,"whitespace")(S):d(S))}function d(S){return S===null||Me(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(ej,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)):it(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),wt(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&&it(S)?wt(e,b,"linePrefix",a+1)(S):b(S)}function b(S){return S===null||Me(S)?e.check(ej,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 k(S,E,I){let D=0;return O;function O(A){return S.enter("lineEnding"),S.consume(A),S.exit("lineEnding"),_}function _(A){return S.enter("codeFencedFence"),it(A)?wt(S,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):M(A)}function M(A){return A===s?(S.enter("codeFencedFenceSequence"),G(A)):I(A)}function G(A){return A===s?(D++,S.consume(A),G):D>=l?(S.exit("codeFencedFenceSequence"),it(A)?wt(S,q,"whitespace")(A):q(A)):I(A)}function q(A){return A===null||Me(A)?(S.exit("codeFencedFence"),E(A)):I(A)}}}function Z4(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:t6},e6={partial:!0,tokenize:n6};function t6(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),wt(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(e6,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 n6(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):wt(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 r6={name:"codeText",previous:a6,resolve:i6,tokenize:o6};function i6(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 a6(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function o6(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 l6{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&&Is(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),Is(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Is(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);Is(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Is(this.left,n.reverse())}}}function Is(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 CT(e){const t={};let n=-1,r,i,a,l,s,c,u;const f=new l6(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,s6(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 s6(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 c6={resolve:d6,tokenize:f6},u6={partial:!0,tokenize:p6};function d6(e){return CT(e),e}function f6(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(u6,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 p6(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),wt(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 PT(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 ET(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=!it(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function TT(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"),wt(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 pc(e,t){let n;return r;function r(i){return Me(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):it(i)?wt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const h6={name:"definition",tokenize:g6},m6={partial:!0,tokenize:v6};function g6(e,t,n){const r=this;let i;return a;function a(m){return e.enter("definition"),l(m)}function l(m){return ET.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)?pc(e,u)(m):u(m)}function u(m){return PT(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(m6,d,d)(m)}function d(m){return it(m)?wt(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 v6(e,t,n){return r;function r(s){return or(s)?pc(e,i)(s):n(s)}function i(s){return TT(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return it(s)?wt(e,l,"whitespace")(s):l(s)}function l(s){return s===null||Me(s)?t(s):n(s)}}const y6={name:"hardBreakEscape",tokenize:x6};function x6(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 b6={name:"headingAtx",resolve:w6,tokenize:j6};function w6(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 j6(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)):it(f)?wt(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 S6=["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"],nj=["pre","script","style","textarea"],k6={concrete:!0,name:"htmlFlow",resolveTo:E6,tokenize:T6},C6={partial:!0,tokenize:A6},P6={partial:!0,tokenize:O6};function E6(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 T6(e,t,n){const r=this;let i,a,l,s,c;return u;function u(N){return f(N)}function f(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),a=!0,y):N===63?(e.consume(N),i=3,r.interrupt?t:P):mi(N)?(e.consume(N),l=String.fromCharCode(N),x):n(N)}function p(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,s=0,g):mi(N)?(e.consume(N),i=4,r.interrupt?t:P):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:P):n(N)}function g(N){const le="CDATA[";return N===le.charCodeAt(s++)?(e.consume(N),s===le.length?r.interrupt?t:M:g):n(N)}function y(N){return mi(N)?(e.consume(N),l=String.fromCharCode(N),x):n(N)}function x(N){if(N===null||N===47||N===62||or(N)){const le=N===47,me=l.toLowerCase();return!le&&!a&&nj.includes(me)?(i=1,r.interrupt?t(N):M(N)):S6.includes(l.toLowerCase())?(i=6,le?(e.consume(N),v):r.interrupt?t(N):M(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):a?b(N):w(N))}return N===45||fr(N)?(e.consume(N),l+=String.fromCharCode(N),x):n(N)}function v(N){return N===62?(e.consume(N),r.interrupt?t:M):n(N)}function b(N){return it(N)?(e.consume(N),b):O(N)}function w(N){return N===47?(e.consume(N),O):N===58||N===95||mi(N)?(e.consume(N),j):it(N)?(e.consume(N),w):O(N)}function j(N){return N===45||N===46||N===58||N===95||fr(N)?(e.consume(N),j):k(N)}function k(N){return N===61?(e.consume(N),S):it(N)?(e.consume(N),k):w(N)}function S(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),c=N,E):it(N)?(e.consume(N),S):I(N)}function E(N){return N===c?(e.consume(N),c=null,D):N===null||Me(N)?n(N):(e.consume(N),E)}function I(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||or(N)?k(N):(e.consume(N),I)}function D(N){return N===47||N===62||it(N)?w(N):n(N)}function O(N){return N===62?(e.consume(N),_):n(N)}function _(N){return N===null||Me(N)?M(N):it(N)?(e.consume(N),_):n(N)}function M(N){return N===45&&i===2?(e.consume(N),U):N===60&&i===1?(e.consume(N),K):N===62&&i===4?(e.consume(N),$):N===63&&i===3?(e.consume(N),P):N===93&&i===5?(e.consume(N),z):Me(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(C6,ee,G)(N)):N===null||Me(N)?(e.exit("htmlFlowData"),G(N)):(e.consume(N),M)}function G(N){return e.check(P6,q,ee)(N)}function q(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),A}function A(N){return N===null||Me(N)?G(N):(e.enter("htmlFlowData"),M(N))}function U(N){return N===45?(e.consume(N),P):M(N)}function K(N){return N===47?(e.consume(N),l="",T):M(N)}function T(N){if(N===62){const le=l.toLowerCase();return nj.includes(le)?(e.consume(N),$):M(N)}return mi(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),T):M(N)}function z(N){return N===93?(e.consume(N),P):M(N)}function P(N){return N===62?(e.consume(N),$):N===45&&i===2?(e.consume(N),P):M(N)}function $(N){return N===null||Me(N)?(e.exit("htmlFlowData"),ee(N)):(e.consume(N),$)}function ee(N){return e.exit("htmlFlow"),t(N)}}function O6(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 A6(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Xp,t,n)}}const I6={name:"htmlText",tokenize:N6};function N6(e,t,n){const r=this;let i,a,l;return s;function s(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),c}function c(P){return P===33?(e.consume(P),u):P===47?(e.consume(P),k):P===63?(e.consume(P),w):mi(P)?(e.consume(P),I):n(P)}function u(P){return P===45?(e.consume(P),f):P===91?(e.consume(P),a=0,g):mi(P)?(e.consume(P),b):n(P)}function f(P){return P===45?(e.consume(P),m):n(P)}function d(P){return P===null?n(P):P===45?(e.consume(P),p):Me(P)?(l=d,K(P)):(e.consume(P),d)}function p(P){return P===45?(e.consume(P),m):d(P)}function m(P){return P===62?U(P):P===45?p(P):d(P)}function g(P){const $="CDATA[";return P===$.charCodeAt(a++)?(e.consume(P),a===$.length?y:g):n(P)}function y(P){return P===null?n(P):P===93?(e.consume(P),x):Me(P)?(l=y,K(P)):(e.consume(P),y)}function x(P){return P===93?(e.consume(P),v):y(P)}function v(P){return P===62?U(P):P===93?(e.consume(P),v):y(P)}function b(P){return P===null||P===62?U(P):Me(P)?(l=b,K(P)):(e.consume(P),b)}function w(P){return P===null?n(P):P===63?(e.consume(P),j):Me(P)?(l=w,K(P)):(e.consume(P),w)}function j(P){return P===62?U(P):w(P)}function k(P){return mi(P)?(e.consume(P),S):n(P)}function S(P){return P===45||fr(P)?(e.consume(P),S):E(P)}function E(P){return Me(P)?(l=E,K(P)):it(P)?(e.consume(P),E):U(P)}function I(P){return P===45||fr(P)?(e.consume(P),I):P===47||P===62||or(P)?D(P):n(P)}function D(P){return P===47?(e.consume(P),U):P===58||P===95||mi(P)?(e.consume(P),O):Me(P)?(l=D,K(P)):it(P)?(e.consume(P),D):U(P)}function O(P){return P===45||P===46||P===58||P===95||fr(P)?(e.consume(P),O):_(P)}function _(P){return P===61?(e.consume(P),M):Me(P)?(l=_,K(P)):it(P)?(e.consume(P),_):D(P)}function M(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),i=P,G):Me(P)?(l=M,K(P)):it(P)?(e.consume(P),M):(e.consume(P),q)}function G(P){return P===i?(e.consume(P),i=void 0,A):P===null?n(P):Me(P)?(l=G,K(P)):(e.consume(P),G)}function q(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||or(P)?D(P):(e.consume(P),q)}function A(P){return P===47||P===62||or(P)?D(P):n(P)}function U(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function K(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),T}function T(P){return it(P)?wt(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):z(P)}function z(P){return e.enter("htmlTextData"),l(P)}}const Bx={name:"labelEnd",resolveAll:D6,resolveTo:L6,tokenize:z6},_6={tokenize:$6},M6={tokenize:B6},R6={tokenize:F6};function D6(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 L6(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 z6(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(_6,f,l?f:d)(p):p===91?e.attempt(M6,f,l?u:d)(p):l?f(p):d(p)}function u(p){return e.attempt(R6,f,d)(p)}function f(p){return t(p)}function d(p){return a._balanced=!0,n(p)}}function $6(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)?pc(e,a)(d):a(d)}function a(d){return d===41?f(d):PT(e,l,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function l(d){return or(d)?pc(e,c)(d):f(d)}function s(d){return n(d)}function c(d){return d===34||d===39||d===40?TT(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return or(d)?pc(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 B6(e,t,n){const r=this;return i;function i(s){return ET.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 F6(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 U6={name:"labelStartImage",resolveAll:Bx.resolveAll,tokenize:W6};function W6(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 K6={name:"labelStartLink",resolveAll:Bx.resolveAll,tokenize:q6};function q6(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:H6};function H6(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),wt(e,t,"linePrefix")}}const Kd={name:"thematicBreak",tokenize:V6};function V6(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"),it(u)?wt(e,s,"whitespace")(u):s(u))}}const Jn={continuation:{tokenize:Q6},exit:Z6,name:"list",tokenize:X6},Y6={partial:!0,tokenize:e3},G6={partial:!0,tokenize:J6};function X6(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(Y6,p,d))}function f(m){return r.containerState.initialBlankLine=!0,a++,p(m)}function d(m){return it(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 Q6(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,wt(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!it(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(G6,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,wt(e,e.attempt(Jn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function J6(e,t,n){const r=this;return wt(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 Z6(e){e.exit(this.containerState.type)}function e3(e,t,n){const r=this;return wt(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!it(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const rj={name:"setextUnderline",resolveTo:t3,tokenize:n3};function t3(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 n3(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"),it(u)?wt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Me(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const r3={tokenize:i3};function i3(e){const t=this,n=e.attempt(Xp,r,e.attempt(this.parser.constructs.flowInitial,i,wt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(c6,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 a3={resolveAll:AT()},o3=OT("string"),l3=OT("text");function OT(e){return{resolveAll:AT(e==="text"?s3: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 AT(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 s3(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 c3={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:jT},u3={91:h6},d3={[-2]:Bm,[-1]:Bm,32:Bm},f3={35:b6,42:Kd,45:[rj,Kd],60:k6,61:rj,95:Kd,96:tj,126:tj},p3={38:kT,92:ST},h3={[-5]:Fm,[-4]:Fm,[-3]:Fm,33:U6,38:kT,42:Tv,60:[K4,I6],91:K6,92:[y6,ST],93:Bx,95:Tv,96:r6},m3={null:[Tv,a3]},g3={null:[42,95]},v3={null:[]},y3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:g3,contentInitial:u3,disable:v3,document:c3,flow:f3,flowInitial:d3,insideSpan:m3,string:p3,text:h3},Symbol.toStringTag,{value:"Module"}));function x3(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(k),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(_,M){return w3(m(_),M)}function m(_){return b3(l,_)}function g(){const{_bufferIndex:_,_index:M,line:G,column:q,offset:A}=r;return{_bufferIndex:_,_index:M,line:G,column:q,offset:A}}function y(_){i[_.line]=_.column,O()}function x(){let _;for(;r._index<l.length;){const M=l[r._index];if(typeof M=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<M.length;)v(M.charCodeAt(r._bufferIndex));else v(M)}}function v(_){f=f(_)}function b(_){Me(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,O()):_!==-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(_,M){const G=M||{};return G.type=_,G.start=g(),u.events.push(["enter",G,u]),s.push(G),G}function j(_){const M=s.pop();return M.end=g(),u.events.push(["exit",M,u]),M}function k(_,M){I(_,M.from)}function S(_,M){M.restore()}function E(_,M){return G;function G(q,A,U){let K,T,z,P;return Array.isArray(q)?ee(q):"tokenize"in q?ee([q]):$(q);function $(X){return ne;function ne(ue){const Q=ue!==null&&X[ue],Z=ue!==null&&X.null,he=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(Z)?Z:Z?[Z]:[]];return ee(he)(ue)}}function ee(X){return K=X,T=0,X.length===0?U:N(X[T])}function N(X){return ne;function ne(ue){return P=D(),z=X,X.partial||(u.currentConstruct=X),X.name&&u.parser.constructs.disable.null.includes(X.name)?me():X.tokenize.call(M?Object.assign(Object.create(u),M):u,c,le,me)(ue)}}function le(X){return _(z,P),A}function me(X){return P.restore(),++T<K.length?N(K[T]):U}}}function I(_,M){_.resolveAll&&!a.includes(_)&&a.push(_),_.resolve&&ji(u.events,M,u.events.length-M,_.resolve(u.events.slice(M),u)),_.resolveTo&&(u.events=_.resolveTo(u.events,u))}function D(){const _=g(),M=u.previous,G=u.currentConstruct,q=u.events.length,A=Array.from(s);return{from:q,restore:U};function U(){r=_,u.previous=M,u.currentConstruct=G,u.events.length=q,s=A,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function b3(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 w3(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 j3(e){const r={constructs:O4([y3,...(e||{}).extensions||[]]),content:i(L4),defined:[],document:i($4),flow:i(r3),lazy:{},string:i(o3),text:i(l3)};return r;function i(a){return l;function l(s){return x3(r,a,s)}}}function S3(e){for(;!CT(e););return e}const ij=/[\0\t\n\r]/g;function k3(){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(ij.lastIndex=d,u=ij.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 C3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function P3(e){return e.replace(C3,E3)}function E3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return wT(n.slice(a?2:1),a?16:10)}return zx(n)||e}const IT={}.hasOwnProperty;function T3(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),O3(n)(S3(j3(n).document().write(k3()(e,t,!0))))}function O3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ie),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(_e),blockQuote:a(Z),characterEscape:D,characterReference:D,codeFenced:a(he),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(he,l),codeText:a(te,l),codeTextData:D,data:D,codeFlowValue:D,definition:a(Ee),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(ke),hardBreakEscape:a(ze),hardBreakTrailing:a(ze),htmlFlow:a(ge,l),htmlFlowData:D,htmlText:a(ge,l),htmlTextData:D,image:a(Te),label:l,link:a(Ie),listItem:a(et),listItemValue:p,listOrdered:a(Ge,d),listUnordered:a(Ge),paragraph:a(ht),reference:N,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(_e),strong:a(It),thematicBreak:a(Xe)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:Q,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:X,characterReference:ne,codeFenced:c(x),codeFencedFence:y,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:O,codeIndented:c(v),codeText:c(A),codeTextData:O,data:O,definition:c(),definitionDestinationString:j,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(M),hardBreakTrailing:c(M),htmlFlow:c(G),htmlFlowData:O,htmlText:c(q),htmlTextData:O,image:c(K),label:z,labelText:T,lineEnding:_,link:c(U),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:le,resourceDestinationString:P,resourceTitleString:$,resource:ee,setextHeading:c(I),setextHeadingLineSequence:E,setextHeadingText:S,strong:c(),thematicBreak:c()}};NT(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(L){let ae={type:"root",children:[]};const R={stack:[ae],tokenStack:[],config:t,enter:s,exit:u,buffer:l,resume:f,data:n},oe=[];let fe=-1;for(;++fe<L.length;)if(L[fe][1].type==="listOrdered"||L[fe][1].type==="listUnordered")if(L[fe][0]==="enter")oe.push(fe);else{const Ce=oe.pop();fe=i(L,Ce,fe)}for(fe=-1;++fe<L.length;){const Ce=t[L[fe][0]];IT.call(Ce,L[fe][1].type)&&Ce[L[fe][1].type].call(Object.assign({sliceSerialize:L[fe][2].sliceSerialize},R),L[fe][1])}if(R.tokenStack.length>0){const Ce=R.tokenStack[R.tokenStack.length-1];(Ce[1]||aj).call(R,void 0,Ce[0])}for(ae.position={start:ua(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:ua(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe<t.transforms.length;)ae=t.transforms[fe](ae)||ae;return ae}function i(L,ae,R){let oe=ae-1,fe=-1,Ce=!1,Se,Re,De,Fe;for(;++oe<=R;){const $e=L[oe];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?fe++:fe--,Fe=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(Se&&!Fe&&!fe&&!De&&(De=oe),Fe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Fe=void 0}if(!fe&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||fe===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(Se){let He=oe;for(Re=void 0;He--;){const lt=L[He];if(lt[1].type==="lineEnding"||lt[1].type==="lineEndingBlank"){if(lt[0]==="exit")continue;Re&&(L[Re][1].type="lineEndingBlank",Ce=!0),lt[1].type="lineEnding",Re=He}else if(!(lt[1].type==="linePrefix"||lt[1].type==="blockQuotePrefix"||lt[1].type==="blockQuotePrefixWhitespace"||lt[1].type==="blockQuoteMarker"||lt[1].type==="listItemIndent"))break}De&&(!Re||De<Re)&&(Se._spread=!0),Se.end=Object.assign({},Re?L[Re][1].start:$e[1].end),L.splice(Re||oe,0,["exit",Se,$e[2]]),oe++,R++}if($e[1].type==="listItemPrefix"){const He={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};Se=He,L.splice(oe,0,["enter",He,$e[2]]),oe++,R++,De=void 0,Fe=!0}}}return L[ae][1]._spread=Ce,R}function a(L,ae){return R;function R(oe){s.call(this,L(oe),oe),ae&&ae.call(this,oe)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(L,ae,R){this.stack[this.stack.length-1].children.push(L),this.stack.push(L),this.tokenStack.push([ae,R||void 0]),L.position={start:ua(ae.start),end:void 0}}function c(L){return ae;function ae(R){L&&L.call(this,R),u.call(this,R)}}function u(L,ae){const R=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==L.type&&(ae?ae.call(this,L,oe[0]):(oe[1]||aj).call(this,L,oe[0]));else throw new Error("Cannot close `"+L.type+"` ("+fc({start:L.start,end:L.end})+"): it’s not open");R.position.end=ua(L.end)}function f(){return E4(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(L){if(this.data.expectingFirstListItemValue){const ae=this.stack[this.stack.length-2];ae.start=Number.parseInt(this.sliceSerialize(L),10),this.data.expectingFirstListItemValue=void 0}}function m(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.lang=L}function g(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.meta=L}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.value=L.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.value=L.replace(/(\r?\n|\r)$/g,"")}function b(L){const ae=this.resume(),R=this.stack[this.stack.length-1];R.label=ae,R.identifier=Rl(this.sliceSerialize(L)).toLowerCase()}function w(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.title=L}function j(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.url=L}function k(L){const ae=this.stack[this.stack.length-1];if(!ae.depth){const R=this.sliceSerialize(L).length;ae.depth=R}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function E(L){const ae=this.stack[this.stack.length-1];ae.depth=this.sliceSerialize(L).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function D(L){const R=this.stack[this.stack.length-1].children;let oe=R[R.length-1];(!oe||oe.type!=="text")&&(oe=Nt(),oe.position={start:ua(L.start),end:void 0},R.push(oe)),this.stack.push(oe)}function O(L){const ae=this.stack.pop();ae.value+=this.sliceSerialize(L),ae.position.end=ua(L.end)}function _(L){const ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const R=ae.children[ae.children.length-1];R.position.end=ua(L.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ae.type)&&(D.call(this,L),O.call(this,L))}function M(){this.data.atHardBreak=!0}function G(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.value=L}function q(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.value=L}function A(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.value=L}function U(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=ae,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function K(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=ae,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function T(L){const ae=this.sliceSerialize(L),R=this.stack[this.stack.length-2];R.label=P3(ae),R.identifier=Rl(ae).toLowerCase()}function z(){const L=this.stack[this.stack.length-1],ae=this.resume(),R=this.stack[this.stack.length-1];if(this.data.inReference=!0,R.type==="link"){const oe=L.children;R.children=oe}else R.alt=ae}function P(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.url=L}function $(){const L=this.resume(),ae=this.stack[this.stack.length-1];ae.title=L}function ee(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function le(L){const ae=this.resume(),R=this.stack[this.stack.length-1];R.label=ae,R.identifier=Rl(this.sliceSerialize(L)).toLowerCase(),this.data.referenceType="full"}function me(L){this.data.characterReferenceType=L.type}function X(L){const ae=this.sliceSerialize(L),R=this.data.characterReferenceType;let oe;R?(oe=wT(ae,R==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=zx(ae);const fe=this.stack[this.stack.length-1];fe.value+=oe}function ne(L){const ae=this.stack.pop();ae.position.end=ua(L.end)}function ue(L){O.call(this,L);const ae=this.stack[this.stack.length-1];ae.url=this.sliceSerialize(L)}function Q(L){O.call(this,L);const ae=this.stack[this.stack.length-1];ae.url="mailto:"+this.sliceSerialize(L)}function Z(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function te(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function ge(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function Ie(){return{type:"link",title:null,url:"",children:[]}}function Ge(L){return{type:"list",ordered:L.type==="listOrdered",start:null,spread:L._spread,children:[]}}function et(L){return{type:"listItem",spread:L._spread,checked:null,children:[]}}function ht(){return{type:"paragraph",children:[]}}function It(){return{type:"strong",children:[]}}function Nt(){return{type:"text",value:""}}function Xe(){return{type:"thematicBreak"}}}function ua(e){return{line:e.line,column:e.column,offset:e.offset}}function NT(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?NT(e,r):A3(e,r)}}function A3(e,t){let n;for(n in t)if(IT.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 aj(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fc({start:t.start,end:t.end})+") is still open")}function I3(e){const t=this;t.parser=n;function n(r){return T3(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function N3(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 _3(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
71
|
-
`}]}function M3(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 R3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function L3(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 z3(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 $3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function _T(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 B3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _T(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 F3(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 U3(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 W3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _T(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 K3(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 q3(e,t,n){const r=e.all(t),i=n?H3(n):MT(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 H3(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=MT(n[r])}return t}function MT(e){const t=e.spread;return t??e.children.length>1}function V3(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 Y3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function G3(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function X3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q3(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=hT(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 J3(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 Z3(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const oj=9,lj=32;function eB(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(sj(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(sj(t.slice(i),i>0,!1)),a.join("")}function sj(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===oj||a===lj;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===oj||a===lj;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function tB(e,t){const n={type:"text",value:eB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rB={blockquote:N3,break:_3,code:M3,delete:R3,emphasis:D3,footnoteReference:L3,heading:z3,html:$3,imageReference:B3,image:F3,inlineCode:U3,linkReference:W3,link:K3,listItem:q3,list:V3,paragraph:Y3,root:G3,strong:X3,table:Q3,tableCell:Z3,tableRow:J3,text:tB,thematicBreak:nB,toml:ld,yaml:ld,definition:ld,footnoteDefinition:ld};function ld(){}const RT=-1,Qp=0,hc=1,Cf=2,Fx=3,Ux=4,Wx=5,Kx=6,DT=7,LT=8,iB=typeof self=="object"?self:globalThis,cj=(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 iB[e](t)},aB=(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 RT:return n(l,i);case hc:{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 DT:{const{name:s,message:c}=l;return n(cj(s,c),i)}case LT: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(cj(a,l),i)};return r},uj=e=>aB(new Map,e)(0),al="",{toString:oB}={},{keys:lB}=Object,Ns=e=>{const t=typeof e;if(t!=="object"||!e)return[Qp,t];const n=oB.call(e).slice(8,-1);switch(n){case"Array":return[hc,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[hc,n]}return n.includes("Array")?[hc,n]:n.includes("Error")?[DT,n]:[Cf,n]},sd=([e,t])=>e===Qp&&(t==="function"||t==="symbol"),sB=(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]=Ns(l);switch(s){case Qp:{let f=l;switch(c){case"bigint":s=LT,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);f=null;break;case"undefined":return i([RT],l)}return i([s,f],l)}case hc:{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 lB(l))(e||!sd(Ns(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(Ns(p))||sd(Ns(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(Ns(p)))&&f.push(a(p));return d}}const{message:u}=l;return i([s,{name:c,message:u}],l)};return a},dj=(e,{json:t,lossy:n}={})=>{const r=[];return sB(!(t||n),!!t,new Map,r)(e),r},Pf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?uj(dj(e,t)):structuredClone(e):(e,t)=>uj(dj(e,t));function cB(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 uB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function dB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||cB,r=e.options.footnoteBackLabel||uB,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 zT=function(e){if(e==null)return mB;if(typeof e=="function")return Jp(e);if(typeof e=="object")return Array.isArray(e)?fB(e):pB(e);if(typeof e=="string")return hB(e);throw new Error("Expected function, string, or object as test")};function fB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zT(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 pB(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 hB(e){return Jp(t);function t(n){return n&&n.type===e}}function Jp(e){return t;function t(n,r,i){return!!(gB(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function mB(){return!0}function gB(e){return e!==null&&typeof e=="object"&&"type"in e}const $T=[],vB=!0,fj=!1,yB="skip";function xB(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=zT(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=$T,g,y,x;if((!t||a(c,u,f[f.length-1]||void 0))&&(m=bB(n(c,f)),m[0]===fj))return m;if("children"in c&&c.children){const v=c;if(v.children&&m[0]!==yB)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]===fj)return g;y=typeof g[1]=="number"?g[1]:y+l}}return m}}}function bB(e){return Array.isArray(e)?e:typeof e=="number"?[vB,e]:e==null?$T:[e]}function BT(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),xB(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,wB={};function jB(e,t){const n=t||wB,r=new Map,i=new Map,a=new Map,l={...rB,...n.handlers},s={all:u,applyData:kB,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:c,options:n,patch:SB,wrap:PB};return BT(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||CB)(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=pj(g.value)),!Array.isArray(g)&&g.type==="element")){const y=g.children[0];y&&y.type==="text"&&(y.value=pj(y.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function SB(e,t){e.position&&(t.position=a4(e))}function kB(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 CB(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 PB(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 pj(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function hj(e,t){const n=jB(e,t),r=n.one(e,void 0),i=dB(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 EB(e,t){return e&&"run"in e?async function(n,r){const i=hj(n,{file:r,...t});await e.run(i,r)}:function(n,r){return hj(n,{file:r,...e||t})}}function mj(e){if(e)throw e}var qd=Object.prototype.hasOwnProperty,FT=Object.prototype.toString,gj=Object.defineProperty,vj=Object.getOwnPropertyDescriptor,yj=function(t){return typeof Array.isArray=="function"?Array.isArray(t):FT.call(t)==="[object Array]"},xj=function(t){if(!t||FT.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)},bj=function(t,n){gj&&n.name==="__proto__"?gj(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},wj=function(t,n){if(n==="__proto__")if(qd.call(t,n)){if(vj)return vj(t,n).value}else return;return t[n]},TB=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=wj(s,n),i=wj(t,n),s!==i&&(f&&i&&(xj(i)||(a=yj(i)))?(a?(a=!1,l=r&&yj(r)?r:[]):l=r&&xj(r)?r:{},bj(s,{name:n,newValue:e(f,l,i)})):typeof i<"u"&&bj(s,{name:n,newValue:i}));return s};const Um=zr(TB);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 OB(){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?AB(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 AB(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:IB,dirname:NB,extname:_B,join:MB,sep:"/"};function IB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');su(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 NB(e){if(su(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 _B(e){su(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 MB(...e){let t=-1,n;for(;++t<e.length;)su(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":RB(n)}function RB(e){su(e);const t=e.codePointAt(0)===47;let n=DB(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function DB(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 su(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const LB={cwd:zB};function zB(){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 $B(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 BB(e)}function BB(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 UT{constructor(t){let n;t?Iv(t)?n={path:t}:typeof t=="string"||FB(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":LB.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){jj(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"),jj(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=$B(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 jj(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function FB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UB=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},WB={}.hasOwnProperty;class qx extends UB{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=OB()}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):WB.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);HB(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),kj("processSync","process",n),r;function i(a,l){n=!0,mj(a),r=l}}run(t,n,r){Sj(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),kj("runSync","run",r),i;function a(l,s){mj(l),i=s,r=!0}}stringify(t,n){this.freeze();const r=cd(n),i=this.compiler||this.Compiler;return Vm("stringify",i),Sj(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 KB=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 Sj(e){if(!Av(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function kj(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function cd(e){return qB(e)?e:new UT(e)}function qB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function HB(e){return typeof e=="string"||VB(e)}function VB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const YB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cj=[],Pj={allowDangerousHtml:!0},GB=/^(https?|ircs?|mailto|xmpp)$/i,XB=[{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 mc(e){const t=QB(e),n=JB(e);return ZB(t.runSync(t.parse(n),n),e)}function QB(e){const t=e.rehypePlugins||Cj,n=e.remarkPlugins||Cj,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Pj}:Pj;return KB().use(I3).use(n).use(EB,r).use(t)}function JB(e){const t=e.children||"",n=new UT;return typeof t=="string"&&(n.value=t),n}function ZB(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||e8;for(const f of XB)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+YB+f.id,void 0);return BT(e,u),u4(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 e8(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||GB.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()},V={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"}),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"},t8={"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> 进行认证"},n8=`#### 🚀 智谱 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 WT(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 r8=WT(n8,V.getRecommendVendorsMarkdown),i8=WT("",V.getUpgradeMarkdown),KT=h.createContext(void 0);function cu(){const e=h.useContext(KT);if(!e)throw new Error("useConfirm must be used within ConfirmProvider");return e}let no=null;function a8({children:e}){const[t,n]=h.useState(!1),[r,i]=h.useState({message:""}),a=f=>(i(f),n(!0),new Promise(d=>{no=d})),l=()=>{n(!1),no&&(no(!0),no=null)},s=()=>{n(!1),no&&(no(!1),no=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(KT.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 o8=0;const Nv=new Set;let Ef=[];function qT(){Nv.forEach(e=>e([...Ef]))}function fd(e,t,n=3e3){const r=++o8,i={id:r,message:e,type:t,duration:n};return Ef.push(i),qT(),n>0&&setTimeout(()=>{HT(r)},n),r}function HT(e){Ef=Ef.filter(t=>t.id!==e),qT()}const W={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 l8(){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:()=>HT(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 VT({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 Ej(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 s8({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 c8(){var lt,fn;const{confirm:e}=cu(),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,k]=h.useState(""),[S,E]=h.useState({}),[I,D]=h.useState(!1),[O,_]=h.useState(void 0),[M,G]=h.useState(void 0),[q,A]=h.useState(void 0),[U,K]=h.useState(!1),[T,z]=h.useState(void 0),[P,$]=h.useState(void 0),[ee,N]=h.useState(void 0),[le,me]=h.useState("openai-chat"),[X,ne]=h.useState(!1),[ue,Q]=h.useState(Zt.AUTH_TOKEN),[Z,he]=h.useState(""),[te,Ee]=h.useState(!0),[ke,_e]=h.useState(!0),[ze,ge]=h.useState(!0),Te=Y=>{if(me(Y),ze)return;let pe;Y==="gemini"||Y==="gemini-chat"?pe=Zt.G_API_KEY:Y==="claude-chat"||Y==="claude"?pe=Zt.API_KEY:pe=Zt.AUTH_TOKEN,Q(pe),t.current&&(t.current.value=pe)},[Ie,Ge]=h.useState(""),[et,ht]=h.useState([]),[It,Nt]=h.useState(""),Xe=r8();h.useEffect(()=>{L()},[]),h.useEffect(()=>{const Y=new Set(b),pe={};Object.entries(S).forEach(([Ne,tt])=>{Y.has(Ne)&&(pe[Ne]=tt)}),Object.keys(pe).length!==Object.keys(S).length&&E(pe)},[b]);const L=async()=>{const Y=await V.getVendors();return r(Y),Y.length>0&&!i&&a(Y[0]),Y},ae=()=>{y(null),he(""),s(!0)},R=()=>{d(!0)},oe=Y=>{y(Y),he(Y.authType||""),s(!0)},fe=async Y=>{if(await e({message:"确定要删除此供应商吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const xe=await V.getRules(),Ne=(Y.services||[]).map(yt=>yt.id),tt=xe.filter(yt=>Ne.includes(yt.targetServiceId)).length;if(!await e({message:`二次确认:删除供应商“${Y.name}”后,将同时删除关联的 ${tt} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await V.deleteVendor(Y.id),L(),i&&i.id===Y.id&&a(null),W.success(`供应商已删除,关联规则清理 ${tt} 条`)}catch(xe){const Ne=xe instanceof Error?xe.message:"删除失败";W.error(Ne)}},Ce=async Y=>{Y.preventDefault();const pe=new FormData(Y.currentTarget),xe={name:pe.get("name"),description:pe.get("description"),apiKey:pe.get("apiKey")||"",apiBaseUrl:pe.get("apiBaseUrl")||"",authType:pe.get("authType")||void 0,sortOrder:parseInt(pe.get("sortOrder"))||0};g?await V.updateVendor(g.id,xe):await V.createVendor({...xe,services:[]}),s(!1);const Ne=await L();if(i){const tt=Ne.find(Qe=>Qe.id===i.id);tt&&a(tt)}},Se=()=>{v(null),w([]),k(""),E({}),D(!1),_(void 0),G(void 0),A(void 0),K(!1),z(void 0),$(void 0),N(void 0),me("openai-chat"),Q((i==null?void 0:i.authType)||Zt.AUTH_TOKEN),Ee(!!(i!=null&&i.apiKey)),_e(!!(i!=null&&i.apiBaseUrl)),ge(!!(i!=null&&i.authType)),ne(!1),u(!0)},Re=Y=>{v(Y),w(Y.supportedModels||[]),k(""),E(Y.modelLimits||{}),D(Y.enableTokenLimit||!1),_(Y.tokenLimit),G(Y.tokenResetInterval),A(Y.tokenResetBaseTime?new Date(Y.tokenResetBaseTime):void 0),K(Y.enableRequestLimit||!1),z(Y.requestCountLimit),$(Y.requestResetInterval),N(Y.requestResetBaseTime?new Date(Y.requestResetBaseTime):void 0);const pe=Y.sourceType||"openai-chat";if(me(pe),Ee(Y.inheritVendorApiKey===!0),_e(Y.inheritVendorApiBaseUrl===!0),ge(Y.inheritVendorAuthType===!0),Y.inheritVendorAuthType===!0){const xe=(i==null?void 0:i.authType)||Zt.AUTH_TOKEN;Q(xe)}else if(Y.authType)Q(Y.authType);else{let xe;pe==="gemini"||pe==="gemini-chat"?xe=Zt.G_API_KEY:pe==="claude-chat"||pe==="claude"?xe=Zt.API_KEY:xe=Zt.AUTH_TOKEN,Q(xe)}ne(Y.isDowngradeCompatibility===!0),u(!0)},De=async Y=>{if(await e({message:"确定要删除此API服务吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const Ne=(await V.getRules()).filter(yt=>yt.targetServiceId===Y).length;if(!await e({message:`二次确认:删除该 API 服务后,将同时删除关联的 ${Ne} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await V.deleteAPIService(Y);const Qe=await L();if(i){const yt=Qe.find(jn=>jn.id===i.id);yt&&a(yt)}W.success(`API服务已删除,关联规则清理 ${Ne} 条`)}catch(xe){const Ne=xe instanceof Error?xe.message:"删除失败";W.error(Ne)}},Fe=async Y=>{Y.preventDefault();let pe=[...b];if(j.trim()){const hn=j.split(",").map(ut=>ut.trim()).filter(ut=>ut&&!pe.includes(ut));pe=[...pe,...hn]}const xe=new FormData(Y.currentTarget),Ne=xe.get("sourceType"),tt=xe.get("inheritVendorApiBaseUrl")==="on",Qe=(xe.get("apiUrl")||"").trim(),yt=tt?(x==null?void 0:x.apiUrl)||"":Qe,jn=xe.get("inheritVendorApiKey")==="on",Qt=xe.get("apiKey")||"",wr=jn?(x==null?void 0:x.apiKey)||"":Qt,Xn=xe.get("inheritVendorAuthType")==="on",pn={};Object.entries(S).forEach(([hn,ut])=>{hn&&ut&&ut>0&&(pn[hn]=ut)});const $t={vendorId:i.id,name:xe.get("name"),apiUrl:yt,apiKey:wr,inheritVendorApiKey:jn,inheritVendorApiBaseUrl:tt,inheritVendorAuthType:Xn,sourceType:Ne,authType:Xn?(x==null?void 0:x.authType)||void 0:xe.get("authType")||void 0,supportedModels:pe.length>0?pe:void 0,modelLimits:Object.keys(pn).length>0?pn:void 0,enableProxy:xe.get("enableProxy")==="on",enableCodingPlan:xe.get("enableCodingPlan")==="on",isDowngradeCompatibility:le==="openai"?X:void 0,enableTokenLimit:I,tokenLimit:O,tokenResetInterval:M,tokenResetBaseTime:q?q.getTime():void 0,enableRequestLimit:U,requestCountLimit:T,requestResetInterval:P,requestResetBaseTime:ee?ee.getTime():void 0};x?await V.updateAPIService(x.id,$t):await V.createAPIService($t),u(!1),w([]),k(""),E({}),D(!1),_(void 0),G(void 0),A(void 0),K(!1),z(void 0),$(void 0),N(void 0),Ee(!0),_e(!0),ne(!1);const jr=await L();if(i){const hn=jr.find(ut=>ut.id===i.id);hn&&a(hn)}},$e=Y=>{if(Y){Ge(Y);const pe=In[Y];pe&&pe.services.length>0&&ht(pe.services.map((xe,Ne)=>Ne))}else Ge(""),ht([]);Nt(""),m(!0)},He=async Y=>{Y.preventDefault();const pe=new FormData(Y.currentTarget),xe=pe.get("vendorKey"),Ne=pe.get("apiKey");if(!xe||!Ne){W.warning("请填写完整信息");return}if(et.length===0){W.warning("请至少选择一个源类型");return}const tt=In[xe];if(!tt){W.error("未找到对应的供应商配置");return}try{const Qe=await V.createVendor({name:tt.name,description:tt.description,apiKey:Ne,sortOrder:0,services:[]});if(console.log("[一键配置] 供应商创建成功:",Qe),console.log("[一键配置] 供应商 ID:",Qe==null?void 0:Qe.id),!Qe||!Qe.id)throw console.error("[一键配置] 供应商创建失败或缺少 ID:",Qe),new Error("供应商创建失败,缺少 ID");const yt=tt.services.filter(($t,jr)=>et.includes(jr));if(console.log("[一键配置] 准备创建服务:",yt.length,"个"),console.log("[一键配置] vendorId:",Qe.id),yt.length===0)throw new Error("没有选择任何服务");const jn=yt.map(async($t,jr)=>{const hn={vendorId:Qe.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}/${yt.length}:`,{...hn,apiKey:"***"});const ut=await V.createAPIService(hn);return console.log(`[一键配置] 服务 ${jr+1} 创建成功,ID:`,ut.id),ut.vendorId||console.error(`[一键配置] 警告:服务 ${ut.id} 缺少 vendorId!`),ut}),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 L()).find($t=>$t.id===Qe.id);a(pn||{...Qe,services:Qt}),m(!1),W.success(`配置成功! 已创建 ${et.length} 个API服务`)}catch(Qe){console.error("一键配置失败:",Qe),W.error(`配置失败: ${Qe instanceof Error?Qe.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:R,children:"推荐"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>$e(),children:"一键配置"}),o.jsx("button",{className:"btn btn-primary",onClick:ae,children:"新增"})]})]}),n.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无供应商"})}):o.jsx("div",{style:{marginTop:"10px"},children:n.map(Y=>o.jsx("div",{onClick:()=>a(Y),style:{padding:"12px",marginBottom:"8px",backgroundColor:i&&i.id===Y.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:Y.name}),Y.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Y.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:pe=>{pe.stopPropagation(),oe(Y)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:pe=>{pe.stopPropagation(),fe(Y)},children:"删除"})]})]})},Y.id))})]}),o.jsxs("div",{className:"card",style:{flex:1},children:[o.jsxs("div",{className:"toolbar",children:[o.jsxs("h3",{children:["供应商",i?`(${i.name})`:null,"API服务"]}),i&&o.jsx("button",{className:"btn btn-primary",onClick:Se,children:"新增服务"})]}),i?!i.services||i.services.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无API服务"})}):o.jsxs("table",{style:{fontSize:"smaller"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{whiteSpace:"nowrap"},children:"服务名称"}),o.jsx("th",{children:"源类型"}),o.jsx("th",{children:"API地址"}),o.jsx("th",{children:"模型"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:i.services.map(Y=>{var pe;return o.jsxs("tr",{children:[o.jsx("td",{children:Y.name}),o.jsx("td",{children:Y.sourceType?ud[Y.sourceType]:"-"}),o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:Y.apiUrl,children:Y.apiUrl}),o.jsx("td",{children:(pe=Y.supportedModels)!=null&&pe.length?`${Y.supportedModels.length}个`:"*"}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>Re(Y),children:"编辑"}),o.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>De(Y.id),children:"删除"})]})})]},Y.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:Ce,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:Y=>he(Y.target.value),children:[o.jsx("option",{value:"",disabled:!0,children:"无"}),Object.keys(dd).map(Y=>o.jsx("option",{value:Y,children:dd[Y]},Y))]}),Z&&Gm[Z]&&o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Gm[Z]})]}),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:Fe,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:Y=>Te(Y.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择源类型"}),Object.keys(ud).map(Y=>o.jsx("option",{value:Y,children:ud[Y]},Y))]}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:t8[le]||""}),le==="openai"&&o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",marginTop:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:X,onChange:Y=>ne(Y.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px",marginTop:"2px"}}),o.jsxs("span",{children:[o.jsx("span",{style:{fontWeight:500},children:"降级兼容"}),o.jsx("br",{}),o.jsx("small",{style:{color:"var(--text-muted)"},children:"通过降级请求格式来确保非 OpenAI 官方的 Responses 接口可以被 Codex 正确使用。"})]})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API地址"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorApiBaseUrl",checked:ke,onChange:Y=>_e(Y.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API地址"})]}),!ke&&o.jsx("input",{type:"url",name:"apiUrl",defaultValue:x?x.apiUrl:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API密钥"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorApiKey",checked:te,onChange:Y=>Ee(Y.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API密钥"})]}),!te&&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:ze,onChange:Y=>ge(Y.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API认证方式"})]}),!ze&&o.jsxs(o.Fragment,{children:[o.jsx("select",{ref:t,name:"authType",defaultValue:x?x.authType||Zt.AUTH_TOKEN:ue,onChange:Y=>Q(Y.target.value),children:Object.keys(dd).map(Y=>o.jsx("option",{value:Y,children:dd[Y]},Y))}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Gm[ue]||""})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"支持的模型列表"}),o.jsx(s8,{value:b,onChange:w,inputValue:j,onInputChange:k,placeholder:"输入模型名,按Enter或逗号添加"},(x==null?void 0:x.id)||"new"),o.jsx("div",{style:{display:"block",width:"100%"},children:o.jsx("small",{style:{fontSize:"10px"},children:"留空表示支持所有模型,路由配置中,可直接将模型透传给该供应商服务接口。"})})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["模型输出限制 ",o.jsx("small",{children:"为支持的模型配置最大输出tokens"})]}),o.jsxs("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"16px",background:"var(--bg-secondary)",maxHeight:"300px",overflowY:"auto"},children:[Object.keys(S).length===0&&b.length===0?o.jsx("div",{style:{color:"var(--text-muted)",textAlign:"center",padding:"20px",fontSize:"14px"},children:"暂无模型限制配置,可点击下方按钮添加"}):o.jsxs("div",{children:[b.length>0&&o.jsxs("div",{style:{marginBottom:"12px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginBottom:"8px",fontWeight:500},children:'来自"支持的模型列表"(自动同步)'}),b.map(Y=>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:[Y,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[Y]||"",onChange:pe=>{const xe=pe.target.value;if(xe===""){const Ne={...S};delete Ne[Y],E(Ne)}else E({...S,[Y]:parseInt(xe)||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 pe={...S};delete pe[Y],E(pe)},style:{padding:"4px 8px",fontSize:"12px"},title:"移除此限制(模型仍在支持列表中)",children:"移除限制"})]},`sync-${Y}`))]}),Object.keys(S).length>0&&o.jsx("div",{children:Object.entries(S).filter(([Y])=>!b.includes(Y)).map(([Y,pe])=>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:Y,onChange:xe=>{const Ne={...S},tt=xe.target.value;delete Ne[Y],Ne[tt]=pe,E(Ne)},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:pe,onChange:xe=>{E({...S,[Y]:parseInt(xe.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 xe={...S};delete xe[Y],E(xe)},style:{padding:"4px 8px",fontSize:"12px"},children:"删除"})]},`custom-${Y}`))})]}),o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>{const Y=`model-${Date.now()}`;E({...S,[Y]: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:Y=>D(Y.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:O||"",onChange:Y=>_(Y.target.value?parseInt(Y.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:M||"",onChange:Y=>G(Y.target.value?parseInt(Y.target.value):void 0),min:"1",placeholder:"例如:720表示30天,168表示7天"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:q?Ej(q):"",onChange:Y=>{Y.target.value?A(new Date(Y.target.value)):A(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:U,onChange:Y=>K(Y.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"})]})}),U&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量值"}),o.jsx("input",{type:"number",value:T||"",onChange:Y=>z(Y.target.value?parseInt(Y.target.value):void 0),min:"1",placeholder:"例如:100"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:P||"",onChange:Y=>$(Y.target.value?parseInt(Y.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:ee?Ej(ee):"",onChange:Y=>{Y.target.value?N(new Date(Y.target.value)):N(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(mc,{components:{a:({href:Y,children:pe,title:xe})=>xe&&In[xe]?o.jsx("a",{href:"#",style:{color:"#2563EB",borderBottom:"solid 1px #2563EB",cursor:"pointer"},onClick:Ne=>{Ne.preventDefault(),d(!1),$e(xe)},children:pe}):o.jsx("a",{href:Y,style:{color:"#2563EB",borderBottom:"solid 1px #2563EB"},target:"_blank",rel:"noopener noreferrer",children:pe})},children:Xe})})}),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:He,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(VT,{value:Ie,onChange:Y=>{if(Ge(Y),Y){const pe=In[Y];pe&&pe.services.length>0&&ht(pe.services.map((xe,Ne)=>Ne))}else ht([])},existingVendors:n})]}),(lt=In[Ie])!=null&<.description?o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[In[Ie].description,In[Ie].link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:In[Ie].link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const Y=new URL(In[Ie].link);return Y.protocol+"//"+Y.hostname}catch{return In[Ie].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:Ie?(fn=In[Ie])==null?void 0:fn.services.map((Y,pe)=>{const xe=et.includes(pe);return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:xe?"var(--accent-light)":"transparent",border:`2px solid ${xe?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease",position:"relative",overflow:"hidden"},onMouseEnter:Ne=>{xe||(Ne.currentTarget.style.background="var(--bg-hover)",Ne.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:Ne=>{xe||(Ne.currentTarget.style.background="transparent",Ne.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"checkbox",checked:xe,onChange:Ne=>{Ne.target.checked?ht([...et,pe]):ht(et.filter(tt=>tt!==pe))},style:{width:"18px",height:"18px",marginRight:"12px",cursor:"pointer",accentColor:"var(--accent-primary)"}}),o.jsxs("span",{style:{fontSize:"14px",fontWeight:xe?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[Y.name," - ",ud[Y.sourceType]]}),xe&&o.jsx("span",{style:{marginLeft:"auto",fontSize:"16px",color:"var(--text-primary)"},children:"✓"})]},pe)}):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:It,onChange:Y=>Nt(Y.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 u8={1:"选择节点",2:"Skills",3:"MCP",4:"供应商",5:"确认同步"};function d8({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([]),[k,S]=h.useState(""),[E,I]=h.useState(4567),[D,O]=h.useState("scan"),[_,M]=h.useState([]),[G,q]=h.useState(new Set),[A,U]=h.useState([]),[K,T]=h.useState(new Set),[z,P]=h.useState({}),[$,ee]=h.useState(!1),[N,le]=h.useState(""),[me,X]=h.useState(!1),[ne,ue]=h.useState(!1),[Q,Z]=h.useState(!1),he=h.useCallback(()=>{i(1),l(!1),c({current:0,total:0}),f([]),p(null),g(""),x("4567"),b(!1),M([]),q(new Set),U([]),T(new Set),P({}),ee(!1),le(""),X(!1),ue(!1),Z(!1),j([]),S(""),I(4567),O("scan")},[]);h.useEffect(()=>{e&&(he(),te())},[e]);const te=async()=>{try{const R=await V.lanScan();j(R.networkInterfaces||[]),I(R.port),R.networkInterfaces.length<=1,S(R.subnet),Ee(R.subnet,R.port,R.localIp)}catch(R){console.error("[LAN Scan] 获取网络信息失败:",R)}},Ee=async(R,oe,fe)=>{l(!0),f([]),c({current:0,total:0});const Ce=Date.now();try{const Se=[];for(let Fe=1;Fe<=254;Fe++){const $e=`${R}.${Fe}`;$e!==fe&&Se.push($e)}c({current:0,total:Se.length});const Re=30,De=[];for(let Fe=0;Fe<Se.length;Fe+=Re){const $e=Se.slice(Fe,Fe+Re),He=await Promise.allSettled($e.map(async lt=>{const fn=await V.lanDiscover(lt,oe);return{ip:lt,port:oe,data:fn}}));for(const lt of He)lt.status==="fulfilled"&&De.push(lt.value);f([...De]),c({current:Math.min(Fe+Re,Se.length),total:Se.length})}c({current:Se.length,total:Se.length})}catch(Se){console.error("[LAN Scan] 扫描失败:",Se)}finally{const Se=Date.now()-Ce;Se<1e3&&await new Promise(Re=>setTimeout(Re,1e3-Se)),l(!1),ue(!0)}},ke=R=>{S(R);const oe=w.find(fe=>fe.subnet===R);oe&&Ee(oe.subnet,E,oe.address)},_e=()=>{const R=w.find(oe=>oe.subnet===k);R&&(p(null),Ee(R.subnet,E,R.address))},ze=async()=>{if(m.trim()){b(!0);try{const R=parseInt(y)||4567,oe=await V.lanDiscover(m.trim(),R),fe={ip:m.trim(),port:R,data:oe};f(Ce=>Ce.some(Se=>Se.ip===m.trim()&&Se.port===R)?Ce:[...Ce,fe]),p(fe),W.success("连接成功")}catch{W.error("无法连接,请检查 IP 和端口")}finally{b(!1)}}},ge=async()=>{if(d){Z(!0);try{let R=[],oe=[];try{R=await V.getInstalledSkills()}catch{}try{oe=await V.getMCPs()}catch(De){console.error("[LAN Sync] 获取本地 MCPs 失败,重复检测可能不准确:",De)}const fe=new Set(R.map(De=>De.name)),Ce=new Set(oe.map(De=>De.name)),Se=(d.data.skills||[]).map(De=>({...De,isDuplicate:fe.has(De.name)}));M(Se);const Re=(d.data.mcps||[]).map(De=>({...De,isDuplicate:Ce.has(De.name)}));U(Re),i(2)}finally{Z(!1)}}},Te=async()=>{if(!d)return;const R=G.size>0,oe=K.size>0;if(!(!R&&!oe&&!$)){X(!0);try{const fe=await V.lanSync({remoteNode:{ip:d.ip,port:d.port,name:d.data.node.name},skills:_.filter(Ce=>G.has(Ce.name)&&!Ce.isDuplicate).map(({isDuplicate:Ce,...Se})=>Se),mcps:A.filter(Ce=>K.has(Ce.name)&&!Ce.isDuplicate).map(({isDuplicate:Ce,...Se})=>{const Re=z[Se.name];return Re&&Se.env?{...Se,env:{...Se.env,...Re}}:Se}),vendor:{enabled:$,apiKey:N||void 0}});fe.success?(W.success("同步完成"),n(),setTimeout(()=>t(),500)):W.error("同步失败: "+(fe.error||"未知错误"))}catch(fe){W.error("同步失败: "+fe.message)}finally{X(!1)}}},Ie=R=>R.env?Object.entries(R.env).filter(([,oe])=>oe==="***").map(([oe])=>oe):[],Ge=(R,oe,fe)=>{P(Ce=>({...Ce,[R]:{...Ce[R]||{},[oe]:fe}}))},et=R=>{const oe=_.find(fe=>fe.name===R);oe!=null&&oe.isDuplicate||q(fe=>{const Ce=new Set(fe);return Ce.has(R)?Ce.delete(R):Ce.add(R),Ce})},ht=()=>{const R=_.filter(fe=>!fe.isDuplicate),oe=R.every(fe=>G.has(fe.name));q(oe?new Set:new Set(R.map(fe=>fe.name)))},It=R=>{const oe=A.find(fe=>fe.name===R);oe!=null&&oe.isDuplicate||T(fe=>{const Ce=new Set(fe);return Ce.has(R)?Ce.delete(R):Ce.add(R),Ce})},Nt=()=>{const R=A.filter(fe=>!fe.isDuplicate),oe=R.every(fe=>K.has(fe.name));T(oe?new Set:new Set(R.map(fe=>fe.name)))},Xe=G.size>0||K.size>0||$,L=_.filter(R=>!R.isDuplicate),ae=A.filter(R=>!R.isDuplicate);return e?o.jsxs("div",{className:"modal-overlay",onClick:R=>{R.target===R.currentTarget&&!me&&t()},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>{me||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(R=>o.jsxs("span",{style:{fontSize:"13px",color:r===R?"var(--primary-color)":R<r?"var(--text-secondary)":"var(--text-muted)",fontWeight:r===R?600:400,borderBottom:r===R?"2px solid var(--primary-color)":"2px solid transparent",paddingBottom:"10px",cursor:"default",whiteSpace:"nowrap"},children:[R<r?"✓ ":`${R} `,u8[R]]},R))}),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(R=>o.jsx("button",{type:"button",onClick:()=>O(R),style:{padding:"8px 4px",background:"none",border:"none",borderBottom:D===R?"2px solid var(--primary-color)":"none",color:D===R?"var(--primary-color)":"var(--text-muted)",fontWeight:D===R?500:400,fontSize:"14px",cursor:"pointer",transition:"all 0.2s"},children:R==="scan"?"局域网扫描":"手动添加"},R))}),D==="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(R=>R.address).join("、")," · ","端口 ",E,w.length>1&&o.jsxs(o.Fragment,{children:[" · ",w.map((R,oe)=>o.jsxs("span",{children:[oe>0?" / ":"",o.jsxs("button",{type:"button",onClick:()=>ke(R.subnet),disabled:a,style:{padding:0,border:"none",background:"none",color:k===R.subnet?"var(--primary-color)":"var(--text-muted)",fontSize:"12px",fontWeight:k===R.subnet?600:400,cursor:a?"not-allowed":"pointer",textDecoration:k===R.subnet?"underline":"none"},children:[R.subnet,".0/",R.netmask]})]},R.subnet))]})]}),a&&o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["正在扫描 ",k,".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&&ne&&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:_e,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&&ne&&o.jsx("button",{type:"button",className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:_e,children:"重新扫描"})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(R=>{var oe,fe;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===R.ip&&(d==null?void 0:d.port)===R.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===R.ip&&(d==null?void 0:d.port)===R.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>p(R),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===R.ip&&(d==null?void 0:d.port)===R.port,onChange:()=>p(R),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:R.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[R.ip,":",R.port,((oe=R.data.skills)==null?void 0:oe.length)>0&&` · ${R.data.skills.length} Skills`,((fe=R.data.mcps)==null?void 0:fe.length)>0&&` · ${R.data.mcps.length} MCP`]})]})]},`${R.ip}-${R.port}`)})})]})]}),Q&&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); } }"})]}),D==="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:R=>g(R.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:R=>x(R.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:ze,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(R=>{var oe,fe;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===R.ip&&(d==null?void 0:d.port)===R.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===R.ip&&(d==null?void 0:d.port)===R.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>p(R),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===R.ip&&(d==null?void 0:d.port)===R.port,onChange:()=>p(R),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:R.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[R.ip,":",R.port,((oe=R.data.skills)==null?void 0:oe.length)>0&&` · ${R.data.skills.length} Skills`,((fe=R.data.mcps)==null?void 0:fe.length)>0&&` · ${R.data.mcps.length} MCP`]})]})]},`${R.ip}-${R.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,")"]}),L.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:ht,children:L.every(R=>G.has(R.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(R=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",border:`1px solid ${R.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",cursor:R.isDuplicate?"not-allowed":"pointer",opacity:R.isDuplicate?.7:1,background:R.isDuplicate?"var(--bg-secondary)":"transparent"},children:[o.jsx("input",{type:"checkbox",checked:G.has(R.name),onChange:()=>et(R.name),disabled:R.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:R.name}),R.targets&&R.targets.length>0&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:R.targets.join(", ")})]}),R.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:R.description}),R.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]},R.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:"}),ae.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:Nt,children:ae.every(R=>K.has(R.name))?"取消全选":"全选"})]}),A.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:A.map(R=>{const oe=Ie(R),fe=K.has(R.name),Ce=fe&&oe.length>0;return o.jsxs("div",{style:{border:`1px solid ${R.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",opacity:R.isDuplicate?.7:1,background:R.isDuplicate?"var(--bg-secondary)":"transparent",overflow:"hidden"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",cursor:R.isDuplicate?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:fe,onChange:()=>It(R.name),disabled:R.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:R.name}),o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:R.type}),oe.length>0&&!R.isDuplicate&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"#fff3e0",color:"#e67e22"},children:"含敏感变量"})]}),R.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:R.description}),R.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]}),Ce&&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:"以下环境变量需要手动填写:"}),oe.map(Se=>{var Re;return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"6px"},children:[o.jsx("span",{style:{fontSize:"12px",color:"#666",minWidth:"120px",fontFamily:"monospace"},children:Se}),o.jsx("input",{type:"text",value:((Re=z[R.name])==null?void 0:Re[Se])||"",onChange:De=>Ge(R.name,Se,De.target.value),placeholder:`请输入 ${Se}`,style:{flex:1,padding:"4px 8px",borderRadius:"4px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, #fff)",color:"var(--text-primary)",fontSize:"12px"}})]},Se)})]})]},R.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:$,onChange:()=>ee(!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:!$,onChange:()=>ee(!1),style:{accentColor:"var(--primary-color)"}}),o.jsx("span",{children:"否"})]})]}),$&&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:N,onChange:R=>le(R.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:"不填写则使用空密钥连接。"})]}),$&&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)。"]}),!$&&o.jsx("p",{style:{fontSize:"13px",color:"#999"},children:"跳过供应商创建,仅同步 Skills 和 MCP 配置。"})]}),r===5&&!me&&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(",G.size," 项)"]}),G.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:_.filter(R=>G.has(R.name)).map(R=>{var oe;return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",R.name," ",(oe=R.targets)!=null&&oe.length?`(${R.targets.join(", ")})`:""]},R.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["MCP(",K.size," 项)"]}),K.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:A.filter(R=>K.has(R.name)).map(R=>{const oe=Ie(R),fe=oe.some(Ce=>{var Se,Re;return!((Re=(Se=z[R.name])==null?void 0:Se[Ce])!=null&&Re.trim())});return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",R.name," (",R.type,")",oe.length>0&&o.jsx("span",{style:{fontSize:"12px",color:fe?"#e74c3c":"#e67e22",marginLeft:"6px"},children:fe?`⚠ ${oe.length} 个敏感变量未填写`:"✓ 敏感变量已填写"})]},R.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:"供应商"}),$?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:",N?"已填写":"未填写"]}),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:"不创建"})]}),!Xe&&o.jsx("p",{style:{fontSize:"13px",color:"#e74c3c",textAlign:"center"},children:"未选择任何同步内容"})]}),r===5&&me&&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||!me)&&o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>i(r-1),disabled:me,children:"← 上一步"}),o.jsx("div",{style:{flex:1}}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,disabled:me,children:"取消"}),r===1&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:ge,disabled:!d||Q,children:Q?"加载中...":"下一步 →"}),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&&!me&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:Te,disabled:!Xe,children:"同步"})]})]})})]}):null}const YT=h.createContext(null),f8=async e=>{try{await V.clearRuleStatus(e)}catch(t){throw console.error("[RulesStatus] 清除规则状态失败:",t),t}};function p8(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 h8({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(p8(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:f8};return o.jsx(YT.Provider,{value:s,children:e})}function m8(){const e=h.useContext(YT);return e||{ruleStatuses:{},getRuleStatus:t=>{},clearRuleStatus:async t=>{}}}const g8=[{value:"codex",label:"Codex",icon:"🤖"},{value:"claude-code",label:"Claude Code",icon:"⚡"},{value:"api",label:"所有 API",icon:"🔗"}],v8={codex:" [Codex]","claude-code":" [Claude Code]",api:" [API]"},y8={"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 GT({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&&(V.getVendors().then(p).catch(()=>{}),V.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)=>V.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}),k=async S=>{var I,D;if(S.preventDefault(),!r){W.warning("请选择供应商");return}if(b&&!a){W.warning("请填写 API Key");return}const E=In[r];if(!E){W.error("未找到对应的供应商配置");return}f(!0);try{let O,_;if(x){O=x.id,!v&&a&&await V.updateVendor(O,{...x,apiKey:a});const T=new Set((x.services||[]).map($=>$.sourceType)),z=E.services.filter($=>!T.has($.sourceType)),P=z.length>0?await Promise.all(z.map($=>j(O,$))):[];_=[...x.services||[],...P]}else{const T=await V.createVendor({name:E.name,description:E.description,apiKey:a,authType:Zt.AUTH_TOKEN,sortOrder:0,services:[]});if(!(T!=null&&T.id))throw new Error("供应商创建失败");O=T.id,_=await Promise.all(E.services.map(z=>j(O,z)))}const M=E.name+v8[s],G=new Set(m.map(T=>T.name));let q=M;if(G.has(q)){let T=2;for(;G.has(`${M}-${T}`);)T++;q=`${M}-${T}`}const A=await V.createRoute({name:q,description:"由一键配置自动创建"});if(!(A!=null&&A.id))throw new Error("路由创建失败");const U=y8[s],K=(I=[..._].filter(T=>T.sourceType).map(T=>({service:T,priority:U[T.sourceType]??99})).sort((T,z)=>T.priority-z.priority)[0])==null?void 0:I.service;if(K){const T=(D=K.supportedModels)!=null&&D.length?K.supportedModels[0]:void 0;await V.createRule({routeId:A.id,contentType:"default",targetServiceId:K.id,targetModel:T,sortOrder:0})}if(s==="codex"||s==="claude-code")try{await V.activateToolRoute(s,A.id)}catch{}if(s==="api"){let T=null;try{T=await V.getApiPathBindings()}catch{}if(T!=null&&T.bindings){const z=T.bindings.map(P=>P.apiPath==="/v1/models"?P:{...P,routeId:A.id});try{await V.updateApiPathBindings(z,T.models||"")}catch{}}}W.success("一键配置完成!路由已激活,可以开始使用"),n==null||n(),w(),setTimeout(()=>{window.location.reload()},300)}catch(O){console.error("一键配置失败:",O),W.error(`配置失败: ${O instanceof Error?O.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:k,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(VT,{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:g8.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 x8=""+new URL("openai-CPEiZpaN.webp",import.meta.url).href,b8=""+new URL("claude-XtpLmGtF.webp",import.meta.url).href,Tj=[{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:"默认"}],Oj={compact:0,"image-understanding":1,"high-iq":2,"long-context":3,thinking:4,background:5,"model-mapping":6,default:7},Aj={compact:"📦",background:"🧱",thinking:"💭","high-iq":"🧠","long-context":"📄","image-understanding":"🖼️","model-mapping":"🔄"},XT=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],QT=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"max",label:"Max"}],w8=e=>XT.some(t=>t.value===e),j8=e=>QT.some(t=>t.value===e),S8=e=>w8(e==null?void 0:e.codexModelReasoningEffort)?e.codexModelReasoningEffort:"high",k8=e=>j8(e==null?void 0:e.claudeEffortLevel)?e.claudeEffortLevel:"medium";function Ij(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 Nj(){var s1,c1,u1,d1,f1,p1,h1,m1;const{confirm:e}=cu(),{ruleStatuses:t,clearRuleStatus:n}=m8(),[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([]),[k,S]=h.useState(""),[E,I]=h.useState(null),[D,O]=h.useState(!1),[_,M]=h.useState(!1),[G,q]=h.useState(null),[A,U]=h.useState(null),[K,T]=h.useState(""),[z,P]=h.useState(""),[$,ee]=h.useState(""),[N,le]=h.useState(""),[me,X]=h.useState(0),[ne,ue]=h.useState((A==null?void 0:A.contentType)||""),[Q,Z]=h.useState(void 0),[he,te]=h.useState(void 0),[Ee,ke]=h.useState(void 0),[_e,ze]=h.useState(void 0),[ge,Te]=h.useState(""),[Ie,Ge]=h.useState(void 0),[et,ht]=h.useState(void 0),[It,Nt]=h.useState(void 0),[Xe,L]=h.useState(void 0),[ae,R]=h.useState(void 0),[oe,fe]=h.useState(null),[Ce,Se]=h.useState(!1),[Re,De]=h.useState(!1),[Fe,$e]=h.useState(void 0),[He,lt]=h.useState(void 0),[fn,Y]=h.useState({}),[pe,xe]=h.useState(!1),[Ne,tt]=h.useState(""),[Qe,yt]=h.useState(1e3),[jn,Qt]=h.useState(!1),[wr,Xn]=h.useState(!1),[pn,$t]=h.useState(null),[jr,hn]=h.useState(!1),[ut,Ii]=h.useState(!1),[Qa,Zo]=h.useState(!1),[el,la]=h.useState(!1),[tl,Ja]=h.useState(""),[sa,qt]=h.useState(!1),[F,B]=h.useState(""),[ye,We]=h.useState(!1),[Oe,dt]=h.useState(""),[Ht,Fr]=h.useState(!1),[Za,Lu]=h.useState({}),[nl,ws]=h.useState(null),[Ue,Vt]=h.useState([]),[iR,r1]=h.useState(!1);h.useEffect(()=>{rl(),cm(),um(),uR(),ii(),$u(),i1(),sR(),l1()},[]);const i1=async()=>{try{const C=await V.getApiPathBindings();j(C.bindings||[]),S(C.models||"")}catch(C){console.error("Failed to load API path bindings:",C)}},a1=async(C,J)=>{try{const de=await V.updateApiPathBindings(C,J);j(de.bindings),W.success("路由映射已保存")}catch(de){W.error(de.message||"保存失败")}},aR=(C,J)=>{const de=w.map(Pe=>Pe.apiPath===C?{...Pe,routeId:J}:Pe);j(de),a1(de,k)},oR=()=>{a1(w,k)};h.useEffect(()=>{E&&to(E.id)},[E]),h.useEffect(()=>{g(K?d.filter(C=>C.vendorId===K):[]),P(""),ee("")},[K]);const rl=async()=>{const C=await V.getRoutes();i(C),C.length>0&&!E&&I(C[0]);const J={};for(const de of C)try{const Pe=await V.getBoundSessions(de.id);J[de.id]=Pe.sessions.length}catch{J[de.id]=0}Lu(J)},lR=async C=>{ws(C),r1(!0),Vt([]);try{const J=await V.getBoundSessions(C);Vt(J.sessions)}catch{Vt([])}finally{r1(!1)}},o1=()=>{ws(null),Vt([])},sR=async()=>{try{const C=await V.checkClaudeVersion();$t(C)}catch(C){console.error("Failed to check Claude version:",C)}},cR=(C,J)=>{if(!C)return-1;const de=C.split(".").map(Number),Pe=J.split(".").map(Number);for(let jt=0;jt<3;jt++){const at=de[jt]||0,Tn=Pe[jt]||0;if(at>Tn)return 1;if(at<Tn)return-1}return 0},eo=()=>{var C;return(C=pn==null?void 0:pn.claudeCode)!=null&&C.version?cR(pn.claudeCode.version,"2.1.32")>=0:!1},to=async C=>{const J=await V.getRules(C);if(l(J),l1(),C)try{const Pe=(await V.getRulesBlacklistStatus(C)).reduce((jt,at)=>(jt[at.ruleId]=at,jt),{});Y(Pe)}catch(de){console.error("Failed to load blacklist status:",de)}},l1=async()=>{try{const C=await V.getRules();c(C)}catch(C){console.error("Failed to load all rules:",C)}},cm=async()=>{const C=await V.getVendors();f(C)},um=async()=>{const C=await V.getAPIServices();p(C)},uR=async()=>{const C=await V.getMCPs();x(C)},[qe,dR]=h.useState(null),[ri,zu]=h.useState(null),ii=async()=>{try{const C=await V.getConfig();b(C),Ja(C.claudeDefaultModel||""),qt(!1),B(C.autocompactPctOverride!=null?String(C.autocompactPctOverride):""),We(!1),dt(C.codexDefaultModel||""),Fr(!1),Te(typeof C.ruleGlobalTimeout=="number"&&C.ruleGlobalTimeout>0?String(C.ruleGlobalTimeout):"")}catch(C){console.error("Failed to load app config:",C)}},$u=async()=>{try{const C=await V.getToolBindings();dR(C)}catch(C){console.error("Failed to load tool bindings:",C)}},Bu=async(C,J)=>{zu(C);try{(await V.activateToolRoute(C,J)).success?(await $u(),await rl(),W.success("路由已激活")):W.error("激活失败")}catch(de){W.error(`激活失败: ${de.message||"未知错误"}`)}finally{zu(null)}},Fu=async C=>{zu(C);try{(await V.deactivateToolRoute(C)).success?(await $u(),await rl(),W.success("路由已停用")):W.error("停用失败")}catch(J){W.error(`停用失败: ${J.message||"未知错误"}`)}finally{zu(null)}},fR=async C=>{C.preventDefault();const J=new FormData(C.currentTarget),de={name:J.get("name"),description:J.get("description")};G?await V.updateRoute(G.id,de):await V.createRoute(de),O(!1),rl()},pR=async C=>{if(await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{await V.deleteRoute(C),rl(),E&&E.id===C&&(I(null),l([])),W.success("路由已删除")}catch(de){W.error(de.message||"删除失败")}},hR=async C=>{if(C.preventDefault(),ne==="image-understanding"&&pe&&!Ne){W.warning("请选择一个MCP工具");return}if(!pe&&!z){W.warning("请选择供应商API服务");return}if(!pe&&Q!==void 0&&Fe!==void 0&&Q>Fe){W.warning(`Token超量值 (${Q}k) 不能超过API服务的限制 (${Fe}k)`);return}if(!pe&&Ie!==void 0&&He!==void 0&&Ie>He){W.warning(`请求次数超量值 (${Ie}) 不能超过API服务的限制 (${He})`);return}const J=new FormData(C.currentTarget),de={routeId:E.id,contentType:J.get("contentType"),targetServiceId:pe?"":z,targetModel:pe?void 0:$||"",replacedModel:N||"",sortOrder:me,timeout:_e?_e*1e3:void 0,tokenLimit:pe?void 0:Q||void 0,resetInterval:pe?void 0:he,tokenResetBaseTime:pe?void 0:Ee?Ee.getTime():void 0,requestCountLimit:pe?void 0:Ie,requestResetInterval:pe?void 0:et,requestResetBaseTime:pe?void 0:It?It.getTime():void 0,frequencyLimit:Xe,frequencyWindow:ae,useMCP:ne==="image-understanding"?pe:!1,mcpId:ne==="image-understanding"&&pe?Ne:void 0,sessionTokenThreshold:ne==="long-context"?Qe:void 0};A?await V.updateRule(A.id,de):await V.createRule(de),M(!1),E&&to(E.id)},mR=async C=>{await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"})&&(await V.deleteRule(C),E&&to(E.id),W.success("规则已删除"))},gR=async C=>{try{const J=await V.toggleRuleDisable(C);E&&to(E.id),W.success(J.isDisabled?"规则已屏蔽":"规则已启用")}catch(J){W.error("操作失败: "+J.message)}},vR=async C=>{var J,de;try{const Pe=[];(J=fn[C])!=null&&J.isBlacklisted&&Pe.push(V.clearRuleBlacklist(C));const jt=(de=t[C])==null?void 0:de.status;(jt==="error"||jt==="suspended")&&Pe.push(n(C)),await Promise.all(Pe),E&&to(E.id),W.success("已恢复")}catch(Pe){W.error("恢复失败: "+Pe.message)}},yR=async C=>{try{const J=a.find(at=>at.id===C);if(!J)return;const de=a.filter(at=>at.contentType===J.contentType),jt=Math.max(...de.map(at=>at.sortOrder||0))+1;await V.updateRule(C,{sortOrder:jt}),E&&to(E.id),W.success("优先级已提升至最高")}catch(J){W.error("操作失败: "+J.message)}},xR=async C=>{try{if(!a.find(Pe=>Pe.id===C))return;await V.updateRule(C,{sortOrder:0}),E&&to(E.id),W.success("优先级已降至最低")}catch(J){W.error("操作失败: "+J.message)}},bR=async C=>{if(C&&!eo()){W.error("当前 Claude Code 版本不支持 Agent Teams 功能,需要版本 ≥ 2.1.32");return}try{const J=v||{};await V.updateConfig({...J,enableAgentTeams:C}),W.success(C?"Agent Teams 设置已保存(重启 Claude Code 后生效)":"Agent Teams 设置已取消(重启 Claude Code 后生效)"),await ii()}catch(J){W.error("更新失败: "+J.message)}},wR=async C=>{try{const J=v||{};await V.updateConfig({...J,enableBypassPermissionsSupport:C}),W.success(C?"对 bypassPermissions 的支持设置已保存(重启 Claude Code 后生效)":"对 bypassPermissions 的支持设置已取消(重启 Claude Code 后生效)"),await ii()}catch(J){W.error("更新失败: "+J.message)}},jR=async C=>{try{Zo(!0);const J=v||{};await V.updateConfig({...J,codexModelReasoningEffort:C}),W.success("Reasoning Effort 设置已保存(重启 Codex 后生效)"),await ii()}catch(J){W.error("更新失败: "+J.message)}finally{Zo(!1)}},SR=async C=>{try{la(!0);const J=v||{};await V.updateConfig({...J,claudeEffortLevel:C}),W.success("Effort Level 设置已保存(重启 Claude Code 后生效)"),await ii()}catch(J){W.error("更新失败: "+J.message)}finally{la(!1)}},kR=async()=>{try{const C=v||{};await V.updateConfig({...C,claudeDefaultModel:tl.trim()||void 0}),W.success("默认模型已保存(重启 Claude Code 后生效)"),qt(!1),await ii()}catch(C){W.error("保存失败: "+C.message)}},CR=async()=>{const C=F.trim();if(C===""){try{const de=v||{};await V.updateConfig({...de,autocompactPctOverride:void 0}),W.success("自动压缩百分比已清除(重启 Claude Code 后生效)"),We(!1),await ii()}catch(de){W.error("保存失败: "+de.message)}return}const J=Number(C);if(!Number.isInteger(J)||J<1||J>100){W.error("自动压缩百分比必须为 1-100 的整数");return}try{const de=v||{};await V.updateConfig({...de,autocompactPctOverride:J}),W.success("自动压缩百分比已保存(重启 Claude Code 后生效)"),We(!1),await ii()}catch(de){W.error("保存失败: "+de.message)}},PR=async()=>{try{const C=v||{};await V.updateConfig({...C,codexDefaultModel:Oe.trim()||void 0}),W.success("默认模型已保存(重启 Codex 后生效)"),Fr(!1),await ii()}catch(C){W.error("保存失败: "+C.message)}},ER=async()=>{try{const C=v||{},J=Number(ge),de=Number.isFinite(J)&&J>0?J:void 0;await V.updateConfig({...C,ruleGlobalTimeout:de}),W.success(de?`规则全局超时时间已设置为 ${de} 秒`:"规则全局超时时间已恢复为默认值(300秒)"),await ii()}catch(C){W.error("更新失败: "+C.message)}},TR=()=>Tj,OR=C=>{U(C),ue(C.contentType),xe(C.useMCP||!1),tt(C.mcpId||"");const J=d.find(de=>de.id===C.targetServiceId);J?(J.vendorId&&(T(J.vendorId),g(d.filter(de=>de.vendorId===J.vendorId))),setTimeout(()=>{if(P(J.id),ee(C.targetModel||""),le(C.replacedModel||""),X(C.sortOrder||0),ze(C.timeout?C.timeout/1e3:void 0),Z(C.tokenLimit||void 0),te(C.resetInterval),ke(C.tokenResetBaseTime?new Date(C.tokenResetBaseTime):void 0),Ge(C.requestCountLimit),ht(C.requestResetInterval),Nt(C.requestResetBaseTime?new Date(C.requestResetBaseTime):void 0),L(C.frequencyLimit),R(C.frequencyWindow),J.enableTokenLimit&&J.tokenLimit){$e(J.tokenLimit);const de=C.tokenLimit===J.tokenLimit&&C.resetInterval===(J.tokenResetInterval||void 0)&&C.tokenLimit!==null&&C.resetInterval!==null;Se(de)}else $e(void 0),Se(!1);if(J.enableRequestLimit&&J.requestCountLimit){lt(J.requestCountLimit);const de=C.requestCountLimit===J.requestCountLimit&&C.requestResetInterval===(J.requestResetInterval||void 0)&&C.requestCountLimit!==null&&C.requestResetInterval!==null;De(de)}else lt(void 0),De(!1);Qt(!!C.tokenLimit),Xn(!!C.requestCountLimit),yt(C.sessionTokenThreshold??1e3)},0)):(C.useMCP&&(T(""),P(""),ee(""),le(""),X(C.sortOrder||0),ze(C.timeout?C.timeout/1e3:void 0),Qt(!1),Xn(!1)),yt(C.sessionTokenThreshold??1e3)),M(!0)},AR=C=>s.some(J=>{var de;return J.routeId===C&&((de=t[J.id])==null?void 0:de.status)==="in_use"}),IR=C=>{var js;const J=fn[C.id],de=[],Pe=t[C.id];if((Pe==null?void 0:Pe.status)==="in_use")return{status:"in_use",label:"使用中",reason:"正在处理请求"};if((Pe==null?void 0:Pe.status)==="suspended"){const Ae=Pe.errorType==="timeout"?"超时":Pe.errorType==="http"?"HTTP错误":"错误";return{status:"suspended",label:"已挂起",reason:Pe.errorMessage||`${Ae}导致服务暂时不可用`}}if((Pe==null?void 0:Pe.status)==="error")return{status:"error",label:"请求失败",reason:Pe.errorMessage||"请求处理失败"};if(J!=null&&J.isBlacklisted){const Ae=J.blacklistEntry;(Ae==null?void 0:Ae.errorType)==="timeout"?de.push("请求超时"):Ae!=null&&Ae.lastStatusCode&&de.push(`HTTP ${Ae.lastStatusCode}错误`)}const jt=(Pe==null?void 0:Pe.totalTokensUsed)!==void 0?Pe.totalTokensUsed:C.totalTokensUsed;C.tokenLimit&&jt!==void 0&&jt>=C.tokenLimit*1e3&&de.push("Token超限");const at=(Pe==null?void 0:Pe.totalRequestsUsed)!==void 0?Pe.totalRequestsUsed:C.totalRequestsUsed;if(C.requestCountLimit&&at!==void 0&&at>=C.requestCountLimit&&de.push("次数超限"),de.length>0)return{status:"error",label:J!=null&&J.isBlacklisted?((js=J.blacklistEntry)==null?void 0:js.errorType)==="timeout"?"超时":"服务错误":de[0],reason:de.join(", ")};const Tn=[];if(C.tokenLimit&&jt!==void 0){const Ae=jt/(C.tokenLimit*1e3)*100;Ae>=80&&Tn.push(`Token ${Ae.toFixed(0)}%`)}if(C.requestCountLimit&&at!==void 0){const Ae=at/C.requestCountLimit*100;Ae>=80&&Tn.push(`次数 ${Ae.toFixed(0)}%`)}return Tn.length>0?{status:"warning",label:"接近限制",reason:Tn.join(", ")}:{status:"success",label:"正常",reason:""}},NR=()=>{U(null),ue("default"),T(""),P(""),ee(""),le(""),X(0),ze(void 0),Z(void 0),te(void 0),ke(void 0),Ge(void 0),ht(void 0),Nt(void 0),Se(!1),De(!1),$e(void 0),lt(void 0),Qt(!1),Xn(!1),xe(!1),tt(""),yt(1e3),M(!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:()=>O(!0),children:"新建"})]}),r.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无路由规则"})}):o.jsx("div",{style:{marginTop:"10px"},children:r.map(C=>{var J,de,Pe,jt;return o.jsx("div",{className:AR(C.id)?"route-active-glow":void 0,onClick:()=>I(C),style:{padding:"12px",marginBottom:"8px",backgroundColor:E&&E.id===C.id?"var(--bg-route-item-selected)":"var(--bg-route-item)",borderRadius:"8px",cursor:"pointer",border:"1px solid var(--border-primary)",position:"relative"},children:o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[o.jsx("div",{style:{fontWeight:500,flex:1,minWidth:0},children:C.name}),o.jsxs("div",{style:{display:"flex",gap:"3px",alignItems:"center",flexShrink:0,marginLeft:"8px"},children:[Za[C.id]>0&&o.jsxs("div",{style:{position:"relative"},children:[o.jsx("div",{onClick:at=>{at.stopPropagation(),lR(C.id)},style:{width:"18px",height:"18px",borderRadius:"50%",border:"2px solid var(--color-primary, #2980b9)",boxSizing:"border-box",backgroundColor:"transparent",color:"var(--color-primary, #2980b9)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:700,cursor:"pointer",flexShrink:0},children:Za[C.id]>99?"99+":Za[C.id]}),o.jsxs("span",{className:"route-icon-popover",children:[Za[C.id]," 个会话绑定此路由,点击查看"]})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:x8,alt:"Codex",onClick:at=>{var Tn;at.stopPropagation(),!ri&&(((Tn=qe==null?void 0:qe.codex)==null?void 0:Tn.routeId)===C.id?Fu("codex"):Bu("codex",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:ri?"wait":"pointer",opacity:((J=qe==null?void 0:qe.codex)==null?void 0:J.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((de=qe==null?void 0:qe.codex)==null?void 0:de.routeId)===C.id?"Codex 已绑定此路由,点击解绑":"点击将 Codex 绑定到此路由"})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:b8,alt:"Claude Code",onClick:at=>{var Tn;at.stopPropagation(),!ri&&(((Tn=qe==null?void 0:qe["claude-code"])==null?void 0:Tn.routeId)===C.id?Fu("claude-code"):Bu("claude-code",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:ri?"wait":"pointer",opacity:((Pe=qe==null?void 0:qe["claude-code"])==null?void 0:Pe.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((jt=qe==null?void 0:qe["claude-code"])==null?void 0:jt.routeId)===C.id?"Claude Code 已绑定此路由,点击解绑":"点击将 Claude Code 绑定到此路由"})]})]})]}),C.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-route-muted)",marginTop:"2px"},children:C.description}),o.jsxs("div",{className:"action-buttons",style:{marginTop:"8px"},children:[o.jsx("button",{className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:at=>{at.stopPropagation(),q(C),O(!0)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:at=>{at.stopPropagation(),pR(C.id)},children:"删除"})]})]})},C.id)})})]}),o.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:o.jsxs("div",{className:"card",style:{flex:1},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"规则列表"}),E&&o.jsx("button",{className:"btn btn-primary",onClick:NR,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((C,J)=>{const de=Oj[C.contentType]??999,Pe=Oj[J.contentType]??999;if(de!==Pe)return de-Pe;const jt=C.sortOrder||0;return(J.sortOrder||0)-jt}).map(C=>{var jt,at,Tn,js;const J=d.find(Ae=>Ae.id===C.targetServiceId),de=u.find(Ae=>Ae.id===(J==null?void 0:J.vendorId)),Pe=(jt=Tj.find(Ae=>Ae.value===C.contentType))==null?void 0:jt.label;return o.jsxs("tr",{children:[o.jsx("td",{className:"col-priority",style:C.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{className:"col-priority-box",children:[o.jsx("span",{children:C.sortOrder||0}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>xR(C.id),title:"降至最低优先级",children:"↓"}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>yR(C.id),title:"升至最高优先级",children:"↑"})]})}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{style:{fontSize:"12px",whiteSpace:"nowrap"},children:[C.contentType!=="default"&&Aj[C.contentType]&&o.jsx("span",{style:{fontSize:"14px"},children:Aj[C.contentType]}),o.jsx("span",{children:Pe}),C.contentType==="model-mapping"&&C.replacedModel&&o.jsxs("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:()=>fe(C.id),onMouseLeave:()=>fe(null),children:[o.jsx("span",{style:{cursor:"help",fontSize:"14px",color:"var(--text-info)",fontWeight:"bold"},children:"ⓘ"}),oe===C.id&&o.jsxs("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"calc(100% + 8px)",backgroundColor:"var(--bg-popover, #333)",color:"var(--text-popover, #fff)",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:["被顶替的模型是: ",C.replacedModel,o.jsx("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"-4px",width:"0",height:"0",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid var(--bg-popover, #333)"}})]})]})]})}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:o.jsx("div",{className:"vendor-sevices-col",style:{fontSize:"0.6em"},children:C.useMCP?o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["MCP:",((at=y.find(Ae=>Ae.id===C.mcpId))==null?void 0:at.name)||"Unknown"]}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"使用MCP工具"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["供应商:",de?de.name:"Unknown"]}),o.jsxs("div",{children:["服务:",J?J.name:"Unknown"]}),o.jsxs("div",{children:["模型:",C.targetModel||"透传模型"]})]})})}),o.jsx("td",{style:{whiteSpace:"nowrap",...C.isDisabled?{opacity:.4}:{}},children:(()=>{var g1,v1,y1,x1;const Ae=IR(C),Bn=fn[C.id],_R=(Bn==null?void 0:Bn.isBlacklisted)&&!((g1=Ae.reason)!=null&&g1.includes("Token超限"))&&!((v1=Ae.reason)!=null&&v1.includes("次数超限"));if(C.isDisabled)return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("span",{style:{color:"#6c757d",fontWeight:"bold",fontSize:"14px"},children:"⊘"}),o.jsx("span",{style:{fontSize:"13px",color:"#6c757d",fontWeight:"bold"},children:"已屏蔽"})]});const MR=_R||((y1=t[C.id])==null?void 0:y1.status)==="error"||((x1=t[C.id])==null?void 0:x1.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:[Ae.status==="success"&&o.jsx("span",{style:{color:"#28a745",fontWeight:"bold",fontSize:"14px"},children:"✓"}),Ae.status==="warning"&&o.jsx("span",{style:{color:"#ffc107",fontWeight:"bold",fontSize:"14px"},children:"⚠"}),Ae.status==="error"&&o.jsx("span",{style:{color:"#dc3545",fontWeight:"bold",fontSize:"14px"},children:"✗"}),Ae.status==="suspended"&&o.jsx("span",{style:{color:"#6f42c1",fontWeight:"bold",fontSize:"14px"},children:"⏸"}),Ae.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:Ae.status==="success"?"#28a745":Ae.status==="warning"?"#ffc107":Ae.status==="in_use"?"#007bff":Ae.status==="suspended"?"#6f42c1":"#dc3545",fontWeight:Ae.status!=="success"?"bold":"normal"},children:Ae.label}),Ae.reason&&o.jsxs("div",{style:{position:"relative",display:"inline-block",cursor:"help"},onMouseEnter:()=>fe(C.id+"-status"),onMouseLeave:()=>fe(null),children:[o.jsx("span",{style:{fontSize:"12px",color:"#999",marginLeft:"4px"},children:" ⓘ"}),oe===C.id+"-status"&&o.jsxs("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"calc(100% + 8px)",backgroundColor:"var(--bg-popover, #333)",color:"var(--text-popover, #fff)",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:[Ae.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)"}})]})]})]}),MR&&o.jsx("button",{className:"btn btn-info",style:{padding:"2px 8px",fontSize:"11px"},onClick:()=>vR(C.id),children:"恢复"})]})})()}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:C.tokenLimit||C.requestCountLimit?o.jsxs("div",{style:{fontSize:"13px"},children:[C.tokenLimit&&o.jsxs("div",{style:{whiteSpace:"nowrap"},children:[o.jsx("span",{style:{fontWeight:"bold",fontSize:"12px"},children:"Tokens:"}),o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{color:(()=>{var Bn;const Ae=((Bn=t[C.id])==null?void 0:Bn.totalTokensUsed)??C.totalTokensUsed;return Ae&&C.tokenLimit&&Ae>=C.tokenLimit*1e3?"red":"inherit"})()},children:[(((((Tn=t[C.id])==null?void 0:Tn.totalTokensUsed)??C.totalTokensUsed)||0)/1e3).toFixed(1),"K/",C.tokenLimit.toFixed(0),"K"]}),(()=>{var Bn;const Ae=((Bn=t[C.id])==null?void 0:Bn.totalTokensUsed)??C.totalTokensUsed;return Ae&&C.tokenLimit&&Ae>=C.tokenLimit*1e3?o.jsx("span",{style:{color:"red",marginLeft:"4px",fontWeight:"bold",fontSize:"11px"},children:"超限"}):null})()]})]}),C.requestCountLimit&&o.jsxs("div",{style:{marginTop:C.tokenLimit?"6px":0},children:[o.jsx("span",{style:{fontWeight:"bold",fontSize:"12px"},children:"次数:"}),o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{color:(()=>{var Bn;const Ae=((Bn=t[C.id])==null?void 0:Bn.totalRequestsUsed)??C.totalRequestsUsed;return Ae&&C.requestCountLimit&&Ae>=C.requestCountLimit?"red":"inherit"})()},children:[(((js=t[C.id])==null?void 0:js.totalRequestsUsed)??C.totalTokensUsed)||0,"/",C.requestCountLimit]}),(()=>{var Bn;const Ae=((Bn=t[C.id])==null?void 0:Bn.totalRequestsUsed)??C.totalRequestsUsed;return Ae&&C.requestCountLimit&&Ae>=C.requestCountLimit?o.jsx("span",{style:{color:"red",marginLeft:"4px",fontWeight:"bold",fontSize:"11px"},children:"超限"}):null})()]})]})]}):o.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"不限制"})}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",style:{justifyContent:"flex-end"},children:[o.jsx("button",{className:`btn ${C.isDisabled?"btn-success":"btn-warning"}`,onClick:()=>gR(C.id),title:C.isDisabled?"启用规则":"临时屏蔽规则",children:C.isDisabled?"启用":"屏蔽"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>OR(C),children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>mR(C.id),children:"删除"})]})})]},C.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:ge,onChange:C=>Te(C.target.value),onBlur:()=>ER(),min:"1",placeholder:"默认300秒",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置规则的全局超时时间。当单个规则未配置超时时间时,将使用此值作为超时上限。 不设置则默认为300秒(5分钟)。超时后会自动触发故障切换到下一个可用规则。"})]})]}),o.jsxs("div",{className:"card api-binding-card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"api-binding-header",children:o.jsx("h3",{children:"API 路径路由映射"})}),o.jsx("p",{className:"api-binding-desc",children:"将标准 API 路径绑定到路由,使任何兼容该 API 的编程工具都可以通过对应路径使用服务。"}),o.jsxs("div",{className:"api-binding-baseurl-row",children:[o.jsx("span",{className:"api-binding-baseurl-prefix",children:"Base URL"}),o.jsx("span",{className:"api-binding-baseurl-value",children:window.location.origin})]}),o.jsx("div",{className:"api-binding-list",children:w.map(C=>{const J=C.apiPath==="/v1/models",de=J?!!k.trim():!!C.routeId;return o.jsxs("div",{className:"api-binding-row",children:[o.jsx("span",{className:`api-binding-status ${de?"api-binding-status--bound":""}`}),o.jsx("span",{className:"api-binding-path",children:C.apiPath==="/v1beta/models"?"/v1beta/models/{model}:{action}":C.apiPath}),o.jsx("span",{className:"api-binding-arrow",children:"→"}),o.jsx("div",{className:"api-binding-control",children:J?o.jsx("input",{type:"text",value:k,onChange:Pe=>S(Pe.target.value),onBlur:oR,placeholder:"自定义模型列表,英文逗号分隔,留空使用默认列表"}):o.jsxs("select",{value:C.routeId||"",onChange:Pe=>aR(C.apiPath,Pe.target.value||null),children:[o.jsx("option",{value:"",children:"无"}),r.map(Pe=>o.jsx("option",{value:Pe.id,children:Pe.name},Pe.id))]})})]},C.apiPath)})})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"Claude Code 全局配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"tool-binding-block",children:[o.jsxs("div",{className:"tool-binding-label",children:[o.jsx("span",{className:"tool-binding-label-icon",children:"⚡"}),"激活路由"]}),o.jsxs("div",{className:"tool-binding-row",children:[o.jsxs("select",{id:"claude-route-binding",value:((s1=qe==null?void 0:qe["claude-code"])==null?void 0:s1.routeId)||"",onChange:C=>{const J=C.target.value||null;J&&Bu("claude-code",J)},disabled:ri==="claude-code",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var J;return o.jsxs("option",{value:C.id,children:[C.name,((J=qe==null?void 0:qe["claude-code"])==null?void 0:J.routeId)===C.id?" (已激活)":""]},C.id)})]}),((c1=qe==null?void 0:qe["claude-code"])==null?void 0:c1.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/ 路径的请求将使用该路由的规则。"})]}),!eo()&&((u1=pn==null?void 0:pn.claudeCode)==null?void 0:u1.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:C=>bR(C.target.checked),disabled:!eo(),style:{cursor:eo()?"pointer":"not-allowed",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"agent-teams-toggle",style:{cursor:eo()?"pointer":"not-allowed",fontSize:"14px",userSelect:"none",color:eo()?"inherit":"var(--text-muted)"},children:"开启 Agent Teams 功能"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:eo()?"开启后将启用 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:C=>wR(C.target.checked),style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"bypass-permissions-support-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启对 bypassPermissions 的支持"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后默认编辑跳过危险模式权限提示,你可以切换到其他模式。该设置会实时写入配置文件,重启 Claude Code 后生效。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-effort-level",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"Effort Level"}),o.jsx("select",{id:"claude-effort-level",value:k8(v),onChange:C=>SR(C.target.value),disabled:el,style:{flex:1,minWidth:0},children:QT.map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"该设置会实时写入 ~/.claude/settings.json,重启 Claude Code 后生效。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"claude-default-model",type:"text",value:tl,onChange:C=>{Ja(C.target.value),qt(C.target.value!==((v==null?void 0:v.claudeDefaultModel)||""))},onBlur:()=>{sa&&kR()},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:F,onChange:C=>{B(C.target.value),We(C.target.value!==((v==null?void 0:v.autocompactPctOverride)!=null?String(v.autocompactPctOverride):""))},onBlur:()=>{ye&&CR()},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:((d1=qe==null?void 0:qe.codex)==null?void 0:d1.routeId)||"",onChange:C=>{const J=C.target.value||null;J&&Bu("codex",J)},disabled:ri==="codex",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var J;return o.jsxs("option",{value:C.id,children:[C.name,((J=qe==null?void 0:qe.codex)==null?void 0:J.routeId)===C.id?" (已激活)":""]},C.id)})]}),((f1=qe==null?void 0:qe.codex)==null?void 0:f1.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:S8(v),onChange:C=>jR(C.target.value),disabled:Qa,style:{flex:1,minWidth:0},children:XT.map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"该设置会实时写入 ~/.codex/config.toml,重启 Codex 后生效。"}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"codex-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"codex-default-model",type:"text",value:Oe,onChange:C=>{dt(C.target.value),Fr(C.target.value!==((v==null?void 0:v.codexDefaultModel)||""))},onBlur:()=>{Ht&&PR()},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"]})]})]})]})]}),D&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>O(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:G?"编辑路由":"新建路由"})}),o.jsxs("form",{onSubmit:fR,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:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>O(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),_&&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:A?"编辑规则":"新建规则"})}),o.jsxs("form",{onSubmit:hR,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"对象请求类型"}),o.jsx("select",{name:"contentType",value:ne,required:!0,onChange:C=>{ue(C.target.value)},children:TR().map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),ne==="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] 接下来帮我解决一个简单的问题"})]})]}),ne==="model-mapping"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["被顶替模型 ",o.jsx("small",{children:"(可在日志中找出想要顶替的模型名)"})]}),o.jsx("input",{type:"text",value:N,onChange:C=>le(C.target.value),placeholder:"例如:gpt-4"})]}),ne==="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:Qe??1e3,onChange:C=>yt(Number(C.target.value)),placeholder:"1000",min:"1"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["当前对话(session)的累积tokens数量超过 ",Qe??1e3,"k 时,该对话的新请求将走此规则"]})]}),ne==="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:pe,onChange:C=>xe(C.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用MCP"})]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"开启后,将使用MCP工具处理图像理解请求,而不是直接调用API服务"})]}),ne==="image-understanding"&&pe&&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(C=>o.jsxs("div",{onClick:()=>tt(C.id),style:{padding:"12px",marginBottom:"8px",border:`2px solid ${Ne===C.id?"var(--primary-color)":"var(--border-primary)"}`,borderRadius:"6px",cursor:"pointer",backgroundColor:Ne===C.id?"var(--bg-info-blue)":"var(--bg-card)",transition:"all 0.2s ease"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:C.name}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"11px"},children:C.type==="stdio"?"命令行":C.type.toUpperCase()})]}),C.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px"},children:C.description})]},C.id))})]}),!pe&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsxs("select",{value:K,onChange:C=>T(C.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择供应商"}),u.map(C=>o.jsx("option",{value:C.id,children:C.name},C.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsxs("select",{value:z,onChange:C=>{const J=C.target.value;P(J),ee("");const de=d.find(Pe=>Pe.id===J);de&&(de.enableTokenLimit&&de.tokenLimit?(Z(de.tokenLimit),te(de.tokenResetInterval),ke(de.tokenResetBaseTime?new Date(de.tokenResetBaseTime):void 0),$e(de.tokenLimit),Se(!0),Qt(!0)):($e(void 0),Se(!1),Qt(!1)),de.enableRequestLimit&&de.requestCountLimit?(Ge(de.requestCountLimit),ht(de.requestResetInterval),Nt(de.requestResetBaseTime?new Date(de.requestResetBaseTime):void 0),lt(de.requestCountLimit),De(!0),Xn(!0)):(lt(void 0),De(!1),Xn(!1)))},required:!0,disabled:!K,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择API服务"}),m.map(C=>o.jsx("option",{value:C.id,children:C.name},C.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsxs("select",{value:$,onChange:C=>ee(C.target.value),disabled:!z,children:[o.jsx("option",{value:"",children:"透传模型名"}),(h1=(p1=d.find(C=>C.id===z))==null?void 0:p1.supportedModels)==null?void 0:h1.map(C=>o.jsx("option",{value:C,children:C},C))]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:Ce?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:jn,onChange:C=>Qt(C.target.checked),disabled:Ce,style:{marginRight:"8px",cursor:Ce?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Tokens超量限制"}),Ce&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),Ce&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>Se(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),jn&&!Ce&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Tokens超量(单位:k)"}),o.jsx("input",{type:"number",value:Q||"",onChange:C=>{const J=C.target.value?parseInt(C.target.value):void 0;if(J!==void 0&&Fe!==void 0&&J>Fe){W.warning(`Token超量值不能超过API服务的限制 (${Fe}k)`);return}Z(J),Ce&&J!==Fe&&Se(!1)},min:"0",max:Fe,placeholder:Fe?`最大 ${Fe}k`:"不限制",disabled:Ce}),Fe&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",Fe,"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:he||"",onChange:C=>{te(C.target.value?parseInt(C.target.value):void 0),Ce&&Se(!1)},min:"1",placeholder:"不自动重置",disabled:Ce}),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:Ee?Ij(Ee):"",onChange:C=>{C.target.value?ke(new Date(C.target.value)):ke(void 0),Ce&&Se(!1)},disabled:!he||Ce,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:Re?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:wr,onChange:C=>Xn(C.target.checked),disabled:Re,style:{marginRight:"8px",cursor:Re?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"}),Re&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),Re&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>De(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),wr&&!Re&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量"}),o.jsx("input",{type:"number",value:Ie||"",onChange:C=>{const J=C.target.value?parseInt(C.target.value):void 0;if(J!==void 0&&He!==void 0&&J>He){W.warning(`请求次数超量值不能超过API服务的限制 (${He})`);return}Ge(J),Re&&J!==He&&De(!1)},min:"0",max:He,placeholder:He?`最大 ${He}`:"不限制",disabled:Re}),He&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",He,",当前值不能超过此限制"]}),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:et||"",onChange:C=>{ht(C.target.value?parseInt(C.target.value):void 0),Re&&De(!1)},min:"1",placeholder:"不自动重置",disabled:Re}),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:It?Ij(It):"",onChange:C=>{C.target.value?Nt(new Date(C.target.value)):Nt(void 0),Re&&De(!1)},disabled:!et||Re,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:!!Xe,onChange:C=>{C.target.checked?(L(10),R(0)):(L(void 0),R(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:"启用后,当同一内容类型的请求频率超过限制时,系统会自动切换到其他同类型规则"})]}),Xe&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制次数(并发数)"}),o.jsx("input",{type:"number",value:Xe||"",onChange:C=>L(C.target.value?parseInt(C.target.value):void 0),min:"1",placeholder:"例如: 10"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"在指定时间窗口内允许的最大请求次数"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制时间窗口(秒,0=同一时刻)"}),o.jsx("input",{type:"number",value:ae===0?0:ae||"",onChange:C=>{const J=C.target.value?parseInt(C.target.value):void 0;R(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:_e||"",onChange:C=>ze(C.target.value?parseInt(C.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:me,onChange:C=>X(parseInt(C.target.value)||0),min:"0",max:"1000"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>M(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),o.jsx(GT,{show:jr,onClose:()=>hn(!1),onComplete:()=>{rl(),cm(),um(),$u(),i1()}}),o.jsx(d8,{show:ut,onClose:()=>Ii(!1),onComplete:()=>{cm(),um()}}),nl&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:o1,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal",style:{width:"500px",maxWidth:"90vw"},children:[o.jsx("div",{className:"modal-header",children:o.jsxs("h2",{children:["绑定会话 - ",((m1=r.find(C=>C.id===nl))==null?void 0:m1.name)||nl]})}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[iR?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"加载中..."}):Ue.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:["以下 ",Ue.length," 个会话绑定了此路由:"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[Ue.slice(0,50).map(C=>{var J;return o.jsxs("div",{style:{padding:"10px 14px",backgroundColor:"var(--bg-secondary)",borderRadius:"6px"},children:[o.jsx("div",{style:{fontWeight:500,fontSize:"14px",marginBottom:"4px"},children:((J=C.title)==null?void 0:J.replace(/<\/?session>/g,"").trim())||C.id.slice(0,8)}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{className:`badge ${C.targetType==="claude-code"?"badge-claude-code":"badge-codex"}`,style:{fontSize:"11px"},children:C.targetType==="claude-code"?"Claude Code":"Codex"}),o.jsxs("span",{children:[C.requestCount," 次请求"]}),o.jsxs("span",{children:[C.totalTokens.toLocaleString()," tokens"]})]})]},C.id)}),Ue.length>50&&o.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:"var(--text-tertiary)",padding:"8px"},children:["等共 ",Ue.length," 个会话"]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:o1,children:"关闭"})]})]})]})]})}var JT={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(q){var A=["th","st","nd","rd"],U=q%100;return"["+q+(A[(U-20)%10]||A[U]||A[0])+"]"}},w=function(q,A,U){var K=String(q);return!K||K.length>=A?q:""+Array(A+1-K.length).join(U)+q},j={s:w,z:function(q){var A=-q.utcOffset(),U=Math.abs(A),K=Math.floor(U/60),T=U%60;return(A<=0?"+":"-")+w(K,2,"0")+":"+w(T,2,"0")},m:function q(A,U){if(A.date()<U.date())return-q(U,A);var K=12*(U.year()-A.year())+(U.month()-A.month()),T=A.clone().add(K,d),z=U-T<0,P=A.clone().add(K+(z?-1:1),d);return+(-(K+(U-T)/(z?T-P:P-T))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:d,y:m,w:f,d:u,D:g,h:c,m:s,s:l,ms:a,Q:p}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},k="en",S={};S[k]=b;var E="$isDayjsObject",I=function(q){return q instanceof M||!(!q||!q[E])},D=function q(A,U,K){var T;if(!A)return k;if(typeof A=="string"){var z=A.toLowerCase();S[z]&&(T=z),U&&(S[z]=U,T=z);var P=A.split("-");if(!T&&P.length>1)return q(P[0])}else{var $=A.name;S[$]=A,T=$}return!K&&T&&(k=T),T||!K&&k},O=function(q,A){if(I(q))return q.clone();var U=typeof A=="object"?A:{};return U.date=q,U.args=arguments,new M(U)},_=j;_.l=D,_.i=I,_.w=function(q,A){return O(q,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var M=function(){function q(U){this.$L=D(U.locale,null,!0),this.parse(U),this.$x=this.$x||U.x||{},this[E]=!0}var A=q.prototype;return A.parse=function(U){this.$d=function(K){var T=K.date,z=K.utc;if(T===null)return new Date(NaN);if(_.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var P=T.match(x);if(P){var $=P[2]-1||0,ee=(P[7]||"0").substring(0,3);return z?new Date(Date.UTC(P[1],$,P[3]||1,P[4]||0,P[5]||0,P[6]||0,ee)):new Date(P[1],$,P[3]||1,P[4]||0,P[5]||0,P[6]||0,ee)}}return new Date(T)}(U),this.init()},A.init=function(){var U=this.$d;this.$y=U.getFullYear(),this.$M=U.getMonth(),this.$D=U.getDate(),this.$W=U.getDay(),this.$H=U.getHours(),this.$m=U.getMinutes(),this.$s=U.getSeconds(),this.$ms=U.getMilliseconds()},A.$utils=function(){return _},A.isValid=function(){return this.$d.toString()!==y},A.isSame=function(U,K){var T=O(U);return this.startOf(K)<=T&&T<=this.endOf(K)},A.isAfter=function(U,K){return O(U)<this.startOf(K)},A.isBefore=function(U,K){return this.endOf(K)<O(U)},A.$g=function(U,K,T){return _.u(U)?this[K]:this.set(T,U)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(U,K){var T=this,z=!!_.u(K)||K,P=_.p(U),$=function(Q,Z){var he=_.w(T.$u?Date.UTC(T.$y,Z,Q):new Date(T.$y,Z,Q),T);return z?he:he.endOf(u)},ee=function(Q,Z){return _.w(T.toDate()[Q].apply(T.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(Z)),T)},N=this.$W,le=this.$M,me=this.$D,X="set"+(this.$u?"UTC":"");switch(P){case m:return z?$(1,0):$(31,11);case d:return z?$(1,le):$(0,le+1);case f:var ne=this.$locale().weekStart||0,ue=(N<ne?N+7:N)-ne;return $(z?me-ue:me+(6-ue),le);case u:case g:return ee(X+"Hours",0);case c:return ee(X+"Minutes",1);case s:return ee(X+"Seconds",2);case l:return ee(X+"Milliseconds",3);default:return this.clone()}},A.endOf=function(U){return this.startOf(U,!1)},A.$set=function(U,K){var T,z=_.p(U),P="set"+(this.$u?"UTC":""),$=(T={},T[u]=P+"Date",T[g]=P+"Date",T[d]=P+"Month",T[m]=P+"FullYear",T[c]=P+"Hours",T[s]=P+"Minutes",T[l]=P+"Seconds",T[a]=P+"Milliseconds",T)[z],ee=z===u?this.$D+(K-this.$W):K;if(z===d||z===m){var N=this.clone().set(g,1);N.$d[$](ee),N.init(),this.$d=N.set(g,Math.min(this.$D,N.daysInMonth())).$d}else $&&this.$d[$](ee);return this.init(),this},A.set=function(U,K){return this.clone().$set(U,K)},A.get=function(U){return this[_.p(U)]()},A.add=function(U,K){var T,z=this;U=Number(U);var P=_.p(K),$=function(le){var me=O(z);return _.w(me.date(me.date()+Math.round(le*U)),z)};if(P===d)return this.set(d,this.$M+U);if(P===m)return this.set(m,this.$y+U);if(P===u)return $(1);if(P===f)return $(7);var ee=(T={},T[s]=r,T[c]=i,T[l]=n,T)[P]||1,N=this.$d.getTime()+U*ee;return _.w(N,this)},A.subtract=function(U,K){return this.add(-1*U,K)},A.format=function(U){var K=this,T=this.$locale();if(!this.isValid())return T.invalidDate||y;var z=U||"YYYY-MM-DDTHH:mm:ssZ",P=_.z(this),$=this.$H,ee=this.$m,N=this.$M,le=T.weekdays,me=T.months,X=T.meridiem,ne=function(Z,he,te,Ee){return Z&&(Z[he]||Z(K,z))||te[he].slice(0,Ee)},ue=function(Z){return _.s($%12||12,Z,"0")},Q=X||function(Z,he,te){var Ee=Z<12?"AM":"PM";return te?Ee.toLowerCase():Ee};return z.replace(v,function(Z,he){return he||function(te){switch(te){case"YY":return String(K.$y).slice(-2);case"YYYY":return _.s(K.$y,4,"0");case"M":return N+1;case"MM":return _.s(N+1,2,"0");case"MMM":return ne(T.monthsShort,N,me,3);case"MMMM":return ne(me,N);case"D":return K.$D;case"DD":return _.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return ne(T.weekdaysMin,K.$W,le,2);case"ddd":return ne(T.weekdaysShort,K.$W,le,3);case"dddd":return le[K.$W];case"H":return String($);case"HH":return _.s($,2,"0");case"h":return ue(1);case"hh":return ue(2);case"a":return Q($,ee,!0);case"A":return Q($,ee,!1);case"m":return String(ee);case"mm":return _.s(ee,2,"0");case"s":return String(K.$s);case"ss":return _.s(K.$s,2,"0");case"SSS":return _.s(K.$ms,3,"0");case"Z":return P}return null}(Z)||P.replace(":","")})},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(U,K,T){var z,P=this,$=_.p(K),ee=O(U),N=(ee.utcOffset()-this.utcOffset())*r,le=this-ee,me=function(){return _.m(P,ee)};switch($){case m:z=me()/12;break;case d:z=me();break;case p:z=me()/3;break;case f:z=(le-N)/6048e5;break;case u:z=(le-N)/864e5;break;case c:z=le/i;break;case s:z=le/r;break;case l:z=le/n;break;default:z=le}return T?z:_.a(z)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return S[this.$L]},A.locale=function(U,K){if(!U)return this.$L;var T=this.clone(),z=D(U,K,!0);return z&&(T.$L=z),T},A.clone=function(){return _.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},q}(),G=M.prototype;return O.prototype=G,[["$ms",a],["$s",l],["$m",s],["$H",c],["$W",u],["$M",d],["$y",m],["$D",g]].forEach(function(q){G[q[1]]=function(A){return this.$g(A,q[0],q[1])}}),O.extend=function(q,A){return q.$i||(q(A,M,O),q.$i=!0),O},O.locale=D,O.isDayjs=I,O.unix=function(q){return O(1e3*q)},O.en=S[k],O.Ls=S,O.p={},O})})(JT);var C8=JT.exports;const st=zr(C8);var ZT={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 k=b[j];k.d&&(g=p?i(u).diff(d,k.d,!0):d.diff(u,k.d,!0));var S=(n.rounding||Math.round)(Math.abs(g));if(x=g>0,S<=k.r||!k.r){S<=1&&j>0&&(k=b[j-1]);var E=v[k.l];m&&(S=m(""+S)),y=typeof E=="string"?E.replace("%d",S):E(S,f,k.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)}}})})(ZT);var P8=ZT.exports;const Hx=zr(P8),zc=({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))}),"条"]})})]})},E8=["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"],T8=e=>{const t=e.toLowerCase();return!!(E8.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,""))))},O8=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))T8(n)?t[n]=typeof r=="string"?O8(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 uu(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 du(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 A8(e,t){if(!e||e.length===0)return{text:"",thinking:""};const n=uu(e);return du(n)}function eO(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}=A8(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 I8(e){const t=[];t.push(`# 请求日志详情
|
|
120
|
-
`),t.push("## 基本信息"),t.push(`- **日志ID**: ${e.id}`),t.push(`- **时间**: ${st(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=eO(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=uu(e.downstreamResponseBody),{text:i,thinking:a}=du(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 N8(e){const t=[];return t.push(`# 错误日志详情
|
|
122
|
-
`),t.push("## 基本信息"),t.push(`- **ID**: ${e.id}`),t.push(`- **时间**: ${st(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 _8=1e6;function M8(e){return"errorMessage"in e}function R8({events:e}){const{text:t,thinking:n}=du(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 D8({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:st(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=eO(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=uu(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(R8,{events:s})})]})})()]})}function L8({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:st(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??_8,i=M8(e),a=()=>{const l=i?N8(e):I8(e);navigator.clipboard.writeText(l).then(()=>{W.success("复制成功")}).catch(()=>{W.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(L8,{log:e}):o.jsx(D8,{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:"关闭"})]})]})]})}st.extend(Hx);function z8(){const{confirm:e}=cu(),[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),[k,S]=h.useState(0),[E,I]=h.useState(!1),[D,O]=h.useState(!1),[_,M]=h.useState(10),[G,q]=h.useState([]),[A,U]=h.useState([]),[K,T]=h.useState(""),[z,P]=h.useState(""),[$,ee]=h.useState(""),[N,le]=h.useState(""),[me,X]=h.useState(""),[ne,ue]=h.useState("");h.useEffect(()=>{Q()},[t,d,m,v,w,me,ne]),h.useEffect(()=>{Z(),he()},[]),h.useEffect(()=>{let L=null,ae=null;return D&&(ae=setInterval(()=>{M(R=>R<=1?10:R-1)},1e3),L=setInterval(()=>{Q(),he()},1e4)),()=>{L&&clearInterval(L),ae&&clearInterval(ae)}},[D,t,d,m,v,w]);const Q=async()=>{I(!0);try{if(t==="request"){const L=(d-1)*m,[ae,R]=await Promise.all([me.trim()?V.searchLogs(me.trim(),m,L):V.getLogs(m,L),me.trim()?V.searchLogsCount(me.trim()):V.getLogsCount()]);i(ae),x(R.count)}else if(t==="error"){const L=(v-1)*w,[ae,R]=await Promise.all([ne.trim()?V.searchErrorLogs(ne.trim(),w,L):V.getErrorLogs(w,L),ne.trim()?V.searchErrorLogsCount(ne.trim()):V.getErrorLogsCount()]);l(ae),S(R.count)}}catch(L){console.error("Failed to load logs:",L)}finally{I(!1)}},Z=async()=>{try{const[L,ae]=await Promise.all([V.getVendors(),V.getAPIServices()]);q(L),U(ae)}catch(L){console.error("Failed to load vendors and services:",L)}},he=async()=>{try{const[L,ae]=await Promise.all([V.getLogsCount(),V.getErrorLogsCount()]);x(L.count),S(ae.count)}catch(L){console.error("Failed to load counts:",L)}},te=async()=>{if(await e({message:`确定要清空所有日志吗?
|
|
127
|
-
|
|
128
|
-
⚠️ 警告:
|
|
129
|
-
1. 此操作将永久删除所有请求日志和错误日志
|
|
130
|
-
2. 相关的统计数据也会被清空
|
|
131
|
-
3. 此操作不可撤销
|
|
132
|
-
|
|
133
|
-
是否继续?`,title:"确认清空全部日志",type:"danger",confirmText:"确认清空",cancelText:"取消"}))try{await Promise.all([V.clearLogs(),V.clearErrorLogs()]),i([]),c(null),p(1),x(0),l([]),f(null),b(1),S(0),W.success("所有日志已清空")}catch(R){console.error("清空日志失败:",R),W.error("清空日志失败,请重试")}},Ee=L=>L?L>=200&&L<300?"badge-success":L>=400&&L<500?"badge-warning":"badge-danger":"badge-danger",ke=L=>{P(L),ee(""),le("")},_e=L=>{ee(L),le("")},ze=()=>z?A.filter(L=>L.vendorId===z):[],ge=()=>{if(!$)return[];const L=A.find(ae=>ae.id===$);return(L==null?void 0:L.supportedModels)||[]},Ie=(L=>L.filter(ae=>!(K&&ae.targetType!==K||z&&ae.vendorId!==z||$&&ae.targetServiceId!==$||N&&ae.targetModel!==N)))(r),Ge=L=>{p(L)},et=L=>{g(L),p(1)},ht=L=>{b(L)},It=L=>{j(L),b(1)},Nt=()=>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(L=>o.jsxs("tr",{children:[o.jsx("td",{children:st(L.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:Yl[L.targetType]?o.jsx("span",{className:`badge ${L.targetType==="claude-code"?"badge-claude-code":L.targetType==="codex"?"badge-codex":"badge-info"}`,children:Yl[L.targetType]}):"-"}),o.jsx("td",{children:L.path}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ee(L.statusCode)}`,children:L.statusCode||"Error"})}),o.jsx("td",{children:L.responseTime?`${L.responseTime}ms`:"-"}),o.jsx("td",{children:L.usage?o.jsxs("span",{children:[L.usage.totalTokens?L.usage.totalTokens:L.usage.inputTokens+L.usage.outputTokens," tokens"]}):"-"}),o.jsx("td",{children:o.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[(()=>{const ae=L.downstreamResponseBody;return typeof ae=="string"&&(ae.includes("event:")||ae.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(L),children:"详情"})]})})]},L.id))})]}),Xe=()=>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(L=>o.jsxs("tr",{children:[o.jsx("td",{children:st(L.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:L.method})}),o.jsx("td",{children:L.path}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:L.statusCode||"-"})}),o.jsx("td",{style:{maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#e74c3c"},children:L.errorMessage}),o.jsx("td",{children:o.jsx("button",{className:"btn btn-secondary",onClick:()=>f(L),children:"详情"})})]},L.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请求日志"})]}),o.jsx("button",{className:"btn btn-danger",onClick:te,children:"清空全部日志"})]})}),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:["错误日志 (",k,")"]})]})}),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:me,onChange:L=>{X(L.target.value),p(1)},onKeyDown:L=>{L.key==="Enter"&&Q()},style:{padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",width:"200px",fontSize:"14px"}}),me&&o.jsx("button",{onClick:()=>{X(""),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:ne,onChange:L=>{ue(L.target.value),b(1)},onKeyDown:L=>{L.key==="Enter"&&Q()},style:{padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",width:"200px",fontSize:"14px"}}),ne&&o.jsx("button",{onClick:()=>{ue(""),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:D,onChange:L=>{O(L.target.checked),L.target.checked&&M(10)},style:{cursor:"pointer"}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",D&&`(⏱ ${_}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{Q(),he(),M(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:K,onChange:L=>T(L.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:z,onChange:L=>ke(L.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:"全部供应商"}),G.map(L=>o.jsx("option",{value:L.id,children:L.name},L.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:$,onChange:L=>_e(L.target.value),disabled:!z,style:{padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",minWidth:"150px",background:z?"var(--bg-card)":"var(--bg-secondary)",color:"var(--text-primary)",cursor:z?"pointer":"not-allowed",opacity:z?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),ze().map(L=>o.jsx("option",{value:L.id,children:L.name},L.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:N,onChange:L=>le(L.target.value),disabled:!$,style:{padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",minWidth:"150px",background:$?"var(--bg-card)":"var(--bg-secondary)",color:"var(--text-primary)",cursor:$?"pointer":"not-allowed",opacity:$?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),ge().map(L=>o.jsx("option",{value:L,children:L},L))]})]}),(K||z||$||N)&&o.jsx("button",{onClick:()=>{T(""),P(""),ee(""),le("")},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:"加载中..."})}):Nt(),!E&&o.jsx(zc,{currentPage:d,totalItems:y,pageSize:m,onPageChange:Ge,onPageSizeChange:et})]}),t==="error"&&o.jsxs(o.Fragment,{children:[E?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):Xe(),!E&&o.jsx(zc,{currentPage:v,totalItems:k,pageSize:w,onPageChange:ht,onPageSizeChange:It})]})]}),s&&o.jsx(Tf,{log:s,onClose:()=>c(null)}),u&&o.jsx(Tf,{log:u,onClose:()=>f(null)})]})}function $8({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",k=n==="claude-code"?"Claude Code":"Codex",S=(()=>{const M=e.lastRequestAt-e.firstRequestAt,G=Math.floor(M/6e4);return G<1?`${Math.max(1,Math.floor(M/1e3))}秒`:G<60?`${G}分钟`:`${Math.floor(G/60)}小时${G%60}分钟`})(),E=async()=>{d(!0),m(null),v(null);try{const M={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:l,maxRounds:c},G=await V.migrationPreview(e.id,M);m(G),y(G.generatedPrompt)}catch(M){W.error(M.message||"预览失败")}finally{d(!1)}},I=async()=>{const M=g||(p==null?void 0:p.generatedPrompt)||"";try{await navigator.clipboard.writeText(M),W.success("已复制到剪贴板!请打开 "+k+",粘贴为第一条消息")}catch{const G=document.querySelector(".migration-prompt-textarea");G?(G.select(),document.execCommand("copy"),W.success("已复制到剪贴板!")):W.error("复制失败,请手动选择内容复制")}},D=async()=>{if(x!=null&&x.command)try{await navigator.clipboard.writeText(x.command),W.success("命令已复制!请在终端中执行")}catch{W.error("复制失败")}},O=async()=>{w(!0),v(null);try{const M={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:l,maxRounds:c},G=await V.migrateLaunch(e.id,M);v(G),G.success&&W.success(`已在新的终端窗口中启动 ${k}`)}catch(M){W.error(M.message||"启动失败")}finally{w(!1)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout migration-modal",style:{width:"900px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"会话迁移"}),o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:["将 ",j," 会话迁移到 ",k]})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{className:"migration-source-info",children:[o.jsx("div",{className:"migration-source-title",children:((_=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:M=>s(M.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:M=>a(M.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:M=>u(Number(M.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:M=>y(M.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((M,G)=>o.jsxs("span",{style:{color:"#e67e22",marginLeft:"12px"},children:["⚠ ",M]},G)),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:["✅ 已在新终端窗口中启动 ",k]}),o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:["请在新终端窗口中继续与 ",k," 交互"]})]}):o.jsxs("div",{children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:600,color:"#e67e22",marginBottom:"8px"},children:["⚠️ ",x.reason||"无法自动启动"]}),x.command&&o.jsxs("div",{style:{marginTop:"8px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"请在终端中执行以下命令:"}),o.jsx("pre",{style:{marginTop:"6px",padding:"10px",backgroundColor:"var(--bg-secondary)",borderRadius:"6px",fontSize:"12px",fontFamily:"monospace",overflow:"auto"},children:x.command}),o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:D,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((M,G)=>o.jsxs("div",{children:["• ",M]},G))})]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:O,disabled:b||!p,title:p?"":"请先预览迁移内容",children:b?"启动中...":`🚀 启动 ${k}`}),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 B8({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 V.getRoutes();i(w);const j={};for(const k of w)try{const S=await V.getRules(k.id);j[k.id]=S.length}catch{j[k.id]=0}l(j)}catch{W.error("加载路由列表失败")}finally{p(!1)}})()},[]);const g=async()=>{if(s){f(!0);try{const b=await V.bindSessionRoute(e.id,s);b.success?(W.success("路由绑定成功"),n(),t()):W.error(b.error||"绑定失败")}catch(b){W.error(b.message||"绑定失败")}finally{f(!1)}}},y=async()=>{f(!0);try{const b=await V.unbindSessionRoute(e.id);b.success?(W.success("已解除路由绑定"),n(),t()):W.error(b.error||"解绑失败")}catch(b){W.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?"处理中...":"确认绑定"})]})]})]})}st.extend(Hx);function F8(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(`
|
|
134
|
-
`),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(`
|
|
135
|
-
`):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 U8(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=uu(r),{text:f,thinking:d}=du(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=F8(f,l.timestamp,l.requestModel,r);t.push(...d)}const u=U8(l);t.push(...u)}return W8(t)}function W8(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 vo(e){return(e||"").replace("<session>","").replace("</session>","").trim()||"(无标题)"}function K8({content:e,header:t,forceCollapsible:n,hideContentWhenCollapsed:r}){const i=e.split(`
|
|
136
|
-
`),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(`
|
|
137
|
-
`)}),!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(K8,{content:m.content,header:m.header,forceCollapsible:!!m.type,hideContentWhenCollapsed:m.type==="tool_use"})]}),!m.type&&o.jsxs("div",{className:"chat-meta",children:[st(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 tO({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=`${vo(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(k=>({role:k.role,type:k.type,header:k.header,content:k.content,thinking:k.thinking,timestamp:k.timestamp,model:k.model,tokens:k.tokens}))},b=new Blob([JSON.stringify(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:vo(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:"首次请求"})," ",st(e.firstRequestAt).format("YYYY-MM-DD HH:mm:ss")]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"最后请求"})," ",st(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:st(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)})]})}st.extend(Hx);function H8(){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,k]=h.useState(10),[S,E]=h.useState(null),[I,D]=h.useState(null);h.useEffect(()=>{_()},[i,l]),h.useEffect(()=>{let T=null,z=null;return b&&(z=setInterval(()=>{k(P=>P<=1?10:P-1)},1e3),T=setInterval(()=>{_()},1e4)),()=>{T&&clearInterval(T),z&&clearInterval(z)}},[b,i,l]);const O=e.filter(T=>{if(x&&T.targetType!==x)return!1;if(g.trim()){const z=g.trim().toLowerCase(),P=(T.title||"").toLowerCase(),$=T.id.toLowerCase();if(!P.includes(z)&&!$.includes(z))return!1}return!0}),_=async()=>{try{const T=(i-1)*l,[z,P]=await Promise.all([V.getSessions(l,T),V.getSessionsCount()]);t(z),r(P.count)}catch(T){console.error("Failed to load sessions:",T)}},M=async T=>{u(T),m(!0);try{const z=await V.getSessionLogs(T.id,1e4);d(z)}catch(z){console.error("Failed to load session logs:",z)}finally{m(!1)}},G=(T,z)=>{const P=z-T;return P<6e4?`${Math.floor(P/1e3)}秒`:P<36e5?`${Math.floor(P/6e4)}分钟`:`${Math.floor(P/36e5)}小时`},q=T=>T==="claude-code"?o.jsx("span",{className:"badge badge-claude-code",children:"Claude Code"}):T==="codex"?o.jsx("span",{className:"badge badge-codex",children:"Codex"}):o.jsx("span",{className:"badge",children:T}),A=(T,z,P)=>{const $=T;if(P==="chat"){const Z=Vx(z).map((ge,Te)=>({index:Te+1,role:ge.role,type:ge.type||null,header:ge.header||null,content:ge.content,thinking:ge.thinking||null,timestamp:st(ge.timestamp).format("YYYY-MM-DD HH:mm:ss"),model:ge.model||null,tokens:ge.tokens||null})),he={session:{id:$.id,title:vo($.title),targetType:$.targetType,requestCount:$.requestCount,totalTokens:$.totalTokens,firstRequestAt:st($.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:st($.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:G($.firstRequestAt,$.lastRequestAt)},messages:Z,exportedAt:st().format("YYYY-MM-DD HH:mm:ss")},te=JSON.stringify(he,null,2),Ee=new Blob([te],{type:"application/json;charset=utf-8"}),ke=URL.createObjectURL(Ee),_e=document.createElement("a");_e.href=ke;const ze=vo($.title).replace(/[\\/:*?"<>|]/g,"_");_e.download=`${ze}_对话.json`,document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(ke),W.success("对话数据已导出");return}const ee=z.map((Q,Z)=>{var ke,_e,ze,ge;const he=((ke=Q.body)==null?void 0:ke.messages)||[];let te="";const Ee=Q.downstreamResponseBody;if(typeof Ee=="string"&&(Ee.includes("event:")||Ee.includes("data:"))){const Te=uu(Ee),{text:Ie,thinking:Ge}=du(Te),et=[];Ge&&et.push(`<details><summary>思考过程</summary>
|
|
138
|
-
|
|
139
|
-
${Ge}
|
|
140
|
-
|
|
141
|
-
</details>`),Ie&&et.push(Ie),te=et.join(`
|
|
142
|
-
|
|
143
|
-
`)}if(!te&&Q.responseBody)try{const Te=typeof Q.responseBody=="string"?JSON.parse(Q.responseBody):Q.responseBody;if(Te.content){if(Array.isArray(Te.content)){const Ie=[];for(const Ge of Te.content)Ge.type==="text"&&Ge.text?Ie.push(Ge.text):Ge.type==="thinking"&&Ge.thinking&&Ie.push(`<details><summary>思考过程</summary>
|
|
144
|
-
|
|
145
|
-
${Ge.thinking}
|
|
146
|
-
|
|
147
|
-
</details>`);te=Ie.join(`
|
|
148
|
-
|
|
149
|
-
`)}typeof Te.content=="string"&&(te=Te.content)}!te&&((ge=(ze=(_e=Te.choices)==null?void 0:_e[0])==null?void 0:ze.message)!=null&&ge.content)&&(te=Te.choices[0].message.content)}catch{}return{index:Z+1,timestamp:st(Q.timestamp).format("YYYY-MM-DD HH:mm:ss"),statusCode:Q.statusCode||null,responseTime:Q.responseTime||null,requestModel:Q.requestModel||null,targetModel:Q.targetModel||null,vendorName:Q.vendorName||null,serviceName:Q.targetServiceName||null,contentType:Q.contentType||null,tags:Q.tags||[],usage:Q.usage||null,messages:he,response:te||null}}),N={session:{id:$.id,title:$.title||null,targetType:$.targetType,requestCount:$.requestCount,totalTokens:$.totalTokens,model:$.model||null,vendorName:$.vendorName||null,serviceName:$.serviceName||null,firstRequestAt:st($.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:st($.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:G($.firstRequestAt,$.lastRequestAt)},logs:ee,exportedAt:st().format("YYYY-MM-DD HH:mm:ss")},le=JSON.stringify(N,null,2),me=new Blob([le],{type:"application/json;charset=utf-8"}),X=URL.createObjectURL(me),ne=document.createElement("a");ne.href=X;const ue=vo($.title).replace(/[\\/:*?"<>|]/g,"_");ne.download=`${ue}.json`,document.body.appendChild(ne),ne.click(),document.body.removeChild(ne),URL.revokeObjectURL(X),W.success("导出成功")},U=T=>a(T),K=T=>{s(T),a(1)};return o.jsxs("div",{className:"sessions-page",children:[o.jsx("div",{className:"page-header",children:o.jsx("div",{className:"page-header-content",children:o.jsxs("div",{className:"page-header-text",children:[o.jsx("h1",{children:"会话"}),o.jsx("p",{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:T=>{y(T.target.value),a(1)},onKeyDown:T=>{T.key==="Enter"&&_()},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:T=>{v(T.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:T=>{w(T.target.checked),k(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:()=>{_(),k(10)},children:"刷新"})]})]}),e.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无会话记录"})}):O.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:O.map(T=>o.jsxs("tr",{onClick:()=>M(T),style:{cursor:"pointer",backgroundColor:(c==null?void 0:c.id)===T.id?"var(--bg-selected)":void 0},children:[o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:vo(T.title)}),o.jsx("td",{children:q(T.targetType)}),o.jsx("td",{children:T.requestCount}),o.jsx("td",{children:T.totalTokens.toLocaleString()}),o.jsx("td",{children:st(T.firstRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:st(T.lastRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:G(T.firstRequestAt,T.lastRequestAt)}),o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",gap:"6px"},children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:z=>{z.stopPropagation(),M(T)},children:"查看"}),o.jsx("button",{className:"btn btn-sm btn-primary",onClick:z=>{z.stopPropagation(),u(T),m(!0),V.getSessionLogs(T.id,1e4).then(P=>d(P)).catch(console.error).finally(()=>m(!1))},children:"对话"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:"#8e44ad",color:"white",border:"none"},onClick:z=>{z.stopPropagation(),E(T)},title:"迁移到另一个工具",children:"迁移"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:T.routeId?"#27ae60":"#2980b9",color:"white",border:"none",minWidth:(T.routeId,void 0)},onClick:z=>{z.stopPropagation(),D(T)},title:T.routeId?`已绑定: ${T.routeName||T.routeId}`:"绑定路由",children:T.routeName?T.routeName.length>8?T.routeName.slice(0,8)+"…":T.routeName:"路由"})]})})]},T.id))})]}),o.jsx(zc,{currentPage:i,pageSize:l,totalItems:n,onPageChange:U,onPageSizeChange:K})]})]}),c&&o.jsx(tO,{session:c,logs:f,logsLoading:p,onRefreshLogs:async()=>{if(c){m(!0);try{const T=await V.getSessionLogs(c.id,1e4);d(T)}catch(T){console.error("Failed to refresh session logs:",T)}finally{m(!1)}}},onFetchNewLogs:async()=>{if(!c)return[];const T=await V.getSessionLogs(c.id,1e4);return d(T),T},onClose:()=>{u(null),d([])},onExport:A}),S&&o.jsx($8,{session:S,onClose:()=>E(null)}),I&&o.jsx(B8,{session:I,onClose:()=>D(null),onBound:()=>{_()}})]})}function $c({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 _j({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($c,{checked:n,onChange:l=>r(e,t,l),disabled:i,label:a,labelPosition:"right"})})}function V8(){var A,U,K,T,z,P;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,k]=h.useState(!1);h.useEffect(()=>{S()},[]);const S=async()=>{const $=await V.getConfig();t($),r($.enableFailover!==!1),a(typeof $.failoverRecoverySeconds=="number"&&$.failoverRecoverySeconds>0?String(Math.floor($.failoverRecoverySeconds)):"10"),m({proxyEnabled:$.proxyEnabled||!1,proxyUrl:$.proxyUrl||"",proxyUsername:$.proxyUsername||"",proxyPassword:$.proxyPassword||""}),y($.enableLanDiscovery||!1)},E=async $=>{$.preventDefault();const ee=Number(i),N=Number.isFinite(ee)&&ee>0?Math.floor(ee):10,le={...e,enableFailover:n,failoverRecoverySeconds:N};await V.updateConfig(le)?(W.success("配置保存成功"),S()):W.error("配置保存失败")},I=async $=>{$.preventDefault();const ee=new FormData($.currentTarget),N={...e,enableLogging:ee.get("enableLogging")==="true",logRetentionDays:parseInt(ee.get("logRetentionDays")),maxLogSize:parseInt(ee.get("maxLogSize"))};await V.updateConfig(N)?(W.success("日志配置保存成功"),S()):W.error("日志配置保存失败")},D=async $=>{$.preventDefault();const ee=new FormData($.currentTarget),N={...e,proxyEnabled:ee.get("proxyEnabled")==="true",proxyUrl:ee.get("proxyUrl"),proxyUsername:ee.get("proxyUsername"),proxyPassword:ee.get("proxyPassword")};await V.updateConfig(N)?(W.success("代理配置保存成功"),S()):W.error("代理配置保存失败")},O=async $=>{y($);const ee={...e,enableLanDiscovery:$};await V.updateConfig(ee)?(W.success($?"已开启局域网同步":"已关闭局域网同步"),S()):(y(!$),W.error("配置保存失败"))},_=async()=>{if(!l){W.warning("请输入密码");return}try{const $=await V.exportData(l);d($),W.success("导出成功,请复制下方数据")}catch($){W.error("导出失败: "+$.message)}},M=async()=>{if(!l||!c){W.warning("请输入密码和导入数据");return}w(!0);try{const $=await V.previewImportData(c,l);v($),$.success||W.error($.message||"预览失败")}catch($){W.error("预览失败: "+$.message),v({success:!1,message:$.message})}finally{w(!1)}},G=async()=>{if(!l||!c||!(x!=null&&x.success)){W.warning("请先预览数据并确认无误");return}k(!0);try{const $=await V.importData(c,l);$.success?(W.success($.message+($.details?` (${$.details})`:"")),u(""),s(""),v(null)):W.error($.message+($.details?`: ${$.details}`:""))}catch($){W.error("导入失败: "+$.message)}finally{k(!1)}},q=()=>{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:$=>r($.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:$=>a($.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:D,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($c,{checked:p.proxyEnabled,onChange:$=>m(ee=>({...ee,proxyEnabled:$}))}),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:$=>m(ee=>({...ee,proxyUrl:$.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:$=>m(ee=>({...ee,proxyUsername:$.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:$=>m(ee=>({...ee,proxyPassword:$.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($c,{checked:g,onChange:O}),o.jsx("span",{style:{fontSize:"14px",color:"#666"},children:g?"已启用":"未启用"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"数据导出"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"导出所有配置数据,包括供应商、API服务、路由等。数据将使用密码加密。"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"加密密码"}),o.jsx("input",{type:"password",value:l,onChange:$=>s($.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),W.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:((A=x.data)==null?void 0:A.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:((U=x.data)==null?void 0:U.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:((K=x.data)==null?void 0:K.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:((T=x.data)==null?void 0:T.rules)||0})]})]}),o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:[o.jsxs("div",{children:["数据版本: ",(z=x.data)==null?void 0:z.version]}),o.jsxs("div",{children:["导出时间: ",(P=x.data)!=null&&P.exportDate?new Date(x.data.exportDate).toLocaleString("zh-CN"):"-"]})]})]}),o.jsxs("div",{style:{marginTop:"15px",padding:"12px",backgroundColor:"#fff3cd",borderRadius:"4px",border:"1px solid #ffeaa7",color:"#856404"},children:[o.jsx("strong",{children:"确认导入?"})," 此操作将覆盖所有现有的供应商、服务、路由和规则配置,且无法撤销。"]}),o.jsxs("div",{style:{marginTop:"15px",display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-danger",onClick:G,disabled:j,children:j?"导入中...":"确认导入"}),o.jsx("button",{className:"btn btn-secondary",onClick:q,disabled:j,children:"取消"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"解密密码"}),o.jsx("input",{type:"password",value:l,onChange:$=>s($.target.value),placeholder:"用于解密导入数据"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"导入数据"}),o.jsx("textarea",{rows:6,value:c,onChange:$=>u($.target.value),placeholder:"粘贴导出的加密数据",style:{fontFamily:"monospace",fontSize:"12px"}})]}),o.jsx("button",{className:"btn btn-primary",onClick:M,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 Y8(){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,k]=await Promise.all([V.getClaudeConfigStatus(),V.getCodexConfigStatus()]);a({claude:j,codex:k})}catch(j){console.error("Failed to check config status:",j)}},u=async j=>{t(k=>({...k,[j]:!0})),s("");try{(j==="claude"?await V.writeClaudeConfig():await V.writeCodexConfig())?(s(`${j==="claude"?"Claude Code":"Codex"}配置文件写入成功!原始文件已备份为 .aicodeswitch_backup 文件。`),await c()):s("写入失败: 操作未成功")}catch(k){s(`写入失败: ${k.message}`)}finally{t(k=>({...k,[j]:!1}))}},f=async j=>{r(k=>({...k,[j]:!0})),s("");try{(j==="claude"?await V.restoreClaudeConfig():await V.restoreCodexConfig())?(s(`${j==="claude"?"Claude Code":"Codex"}配置文件已从备份恢复!`),await c()):s("恢复失败: 操作未成功")}catch(k){s(`恢复失败: ${k.message}`)}finally{r(k=>({...k,[j]:!1}))}},d=j=>{const k=i[j];if(!k)return null;const S=j==="claude"?"Claude Code":"Codex";return k.isOverwritten&&k.isModified?o.jsxs("p",{style:{color:"#f39c12",fontSize:"12px",marginTop:"10px"},children:["⚠️ 检测到",S,"配置已被修改,但备份文件仍然存在。建议先恢复原始配置,再重新写入以确保配置正确。"]}):k.isOverwritten&&!k.isModified?o.jsxs("p",{style:{color:"#27ae60",fontSize:"12px",marginTop:"10px"},children:["✓ ",S,"配置已正确设置为代理模式,且未被修改。"]}):!k.isOverwritten&&k.hasBackup?o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 检测到配置状态不一致。备份文件存在但当前配置不是代理配置,请先恢复或手动删除备份文件。"}):null};return o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"写入配置"}),o.jsx("p",{children:"将Claude Code和Codex的配置文件写入到用户目录"})]}),o.jsxs("div",{className:"card",style:{marginBottom:"20px"},children:[o.jsx("h3",{children:"Claude Code配置"}),o.jsx("p",{style:{color:"#7f8c8d",marginBottom:"15px"},children:"为Claude Code工具写入配置文件。原始文件将被备份为.aicodeswitch_backup文件。"}),o.jsxs("div",{style:{marginBottom:"15px"},children:[o.jsx("h4",{children:"配置文件:"}),o.jsxs("ul",{style:{color:"#7f8c8d",lineHeight:"1.6"},children:[o.jsxs("li",{children:[o.jsx("code",{children:"~/.claude/settings.json"})," - Claude Code设置"]}),o.jsxs("li",{children:[o.jsx("code",{children:"~/.claude.json"})," - Claude Code初始化设置"]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>u("claude"),disabled:e.claude||(((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 G8=`# AI Code Switch
|
|
150
|
-
|
|
151
|
-
## 简介
|
|
152
|
-
|
|
153
|
-
AI Code Switch 是帮助你在本地管理 AI 编程工具接入大模型的工具。
|
|
154
|
-
它可以让你的 Claude Code、Codex 等工具不再局限于官方模型。
|
|
155
|
-
为所有编程工具提供本地API驱动,自动智能的切换不同场景下的模型。
|
|
156
|
-
|
|
157
|
-
**而且它尽可能简单的帮你解决这件事。**
|
|
158
|
-
|
|
159
|
-
- 视频演示:[https://www.bilibili.com/video/BV1uEznBuEJd/](https://www.bilibili.com/video/BV1uEznBuEJd/?from=github)
|
|
160
|
-
- 1分钟让Claude Code接入GLM国产模型:[https://www.bilibili.com/video/BV1a865B8ErA/](https://www.bilibili.com/video/BV1a865B8ErA/)
|
|
161
|
-
- 1分钟让Codex接入免费模型Agnes:[https://www.bilibili.com/video/BV1tQ7Q63Eva/](https://www.bilibili.com/video/BV1tQ7Q63Eva/) Codex接入Deepseek可参考该方法实现
|
|
162
|
-
|
|
163
|
-
## 功能要点
|
|
164
|
-
|
|
165
|
-
* 可登记任意的大模型API接口服务,让你可以在一个面板管理你的大模型厂商
|
|
166
|
-
* 一键切换模型:可以注册多个供应商的多个API接口,当想要切换模型时,只需要点击一个按钮就可以立即切换
|
|
167
|
-
* 自动配置:无需你手动去修改claude code或codex的系统配置文件,aicodeswitch自动帮你修改,你只要启动它,无需配置claude code或codex就可以让它们正常工作
|
|
168
|
-
* 一键配置供应商,省去复杂的供应商配置流程
|
|
169
|
-
* 启动所有已知大模型接口标准,可接入任意客户端,包括但不限于openclaw、hermes、trae等,根据不同需要自主配置接口对应的大模型服务
|
|
170
|
-
* API转流:将兼容openai接口标准的模型,轻松接入到claude code中,支持将符合openai、anthropic、gemini的数据格式转发给claude code或codex
|
|
171
|
-
* 按需中转请求:根据请求类型,让不同的模型来处理不同的任务,节省成本,基于该特性,可以让glm等原生非多模态模型支持图像识别
|
|
172
|
-
* 智能故障切换:当API服务发生故障时,智能切换到其他API服务进行尝试,无需手动切换,特别适用于中转服务商
|
|
173
|
-
* 代理:针对无法直接访问的模型服务,例如地区被ban,支持设置代理来解决
|
|
174
|
-
* tokens超量限制:避免其中一个服务商的用量超过限制,浪费了钱,适合有免费额度的服务商
|
|
175
|
-
* 次数超量限制:次数到达一定量后,切换其他服务商,适合coding plan的服务商
|
|
176
|
-
* 日志:超精细的日志记录和会话记录,帮助你发现编程工具本身的问题,以及专研工具的agent逻辑
|
|
177
|
-
* 统计:丰富且详细的统计数据,用量信息快速掌握,发掘自己的编程习惯
|
|
178
|
-
* Skills管理:一键搜索和安装Skills,一键启用skill到claude code或codex
|
|
179
|
-
* MCP管理:一键安装预设MCP,一键启用MCP
|
|
180
|
-
* 导入和导出:一键备份数据,在多太电脑间共享aicodeswitch配置
|
|
181
|
-
* 服务端部署,自定义API Key,支持B/S架构,让aicodeswitch成为在线服务,提供给团队使用
|
|
182
|
-
* 数据完全本地,自主可控
|
|
183
|
-
* 特殊语法:在发送的提示词最前面添加\`[!]\`来直接切换为高智商模型服务(\`[x]\`关闭),简单快捷
|
|
184
|
-
|
|
185
|
-
## 桌面客户端
|
|
186
|
-
|
|
187
|
-
[进入下载](https://github.com/tangshuang/aicodeswitch/releases)
|
|
188
|
-
|
|
189
|
-
## 命令行工具
|
|
190
|
-
|
|
191
|
-
### 安装
|
|
192
|
-
|
|
193
|
-
\`\`\`
|
|
194
|
-
npm install -g aicodeswitch
|
|
195
|
-
\`\`\`
|
|
196
|
-
|
|
197
|
-
### 使用方法
|
|
198
|
-
|
|
199
|
-
**启动服务**
|
|
200
|
-
|
|
201
|
-
\`\`\`
|
|
202
|
-
aicos start
|
|
203
|
-
\`\`\`
|
|
204
|
-
|
|
205
|
-
或者直接运行
|
|
206
|
-
|
|
207
|
-
\`\`\`
|
|
208
|
-
aicos ui
|
|
209
|
-
\`\`\`
|
|
210
|
-
|
|
211
|
-
**停止服务**
|
|
212
|
-
|
|
213
|
-
\`\`\`
|
|
214
|
-
aicos stop
|
|
215
|
-
\`\`\`
|
|
216
|
-
|
|
217
|
-
**进入管理界面**
|
|
218
|
-
|
|
219
|
-
\`\`\`
|
|
220
|
-
# 自动启动服务和打开界面
|
|
221
|
-
aicos ui
|
|
222
|
-
\`\`\`
|
|
223
|
-
|
|
224
|
-
\`\`\`
|
|
225
|
-
# 手动在浏览器打开管理界面
|
|
226
|
-
http://127.0.0.1:4567
|
|
227
|
-
\`\`\`
|
|
228
|
-
|
|
229
|
-
## 管理界面
|
|
230
|
-
|
|
231
|
-
**配置供应商**
|
|
232
|
-
|
|
233
|
-
* 什么是供应商?
|
|
234
|
-
* 供应商配置有什么用?
|
|
235
|
-
|
|
236
|
-
具体请看下方文档。
|
|
237
|
-
|
|
238
|
-
**路由配置**
|
|
239
|
-
|
|
240
|
-
* 什么是路由?
|
|
241
|
-
* 什么是路由规则?
|
|
242
|
-
|
|
243
|
-
具体请看下方文档。
|
|
244
|
-
|
|
245
|
-
**覆盖配置文件**
|
|
246
|
-
|
|
247
|
-
在aicodeswitch中,点击“写入Claude Code配置”按钮,它会修改Claude Code的配置文件,让Claude Code开始使用aicocdeswitch提供的模型API,而非直接连到官网的模型API。
|
|
248
|
-
|
|
249
|
-
你不用太担心,你可以在写入后,点击“恢复Claude Code配置”按钮,将Claude Code的配置文件恢复到原始状态。
|
|
250
|
-
|
|
251
|
-
Codex的配置覆盖逻辑一模一样。
|
|
252
|
-
|
|
253
|
-
**设置**
|
|
254
|
-
|
|
255
|
-
你可以在设置页面,对aicodedeswitch进行配置。
|
|
256
|
-
|
|
257
|
-
也可以导出配置数据,转移到其他电脑上导入。
|
|
258
|
-
|
|
259
|
-
## 配置供应商
|
|
260
|
-
|
|
261
|
-
### 什么是供应商?
|
|
262
|
-
|
|
263
|
-
所谓供应商,就是提供AI服务的上游服务商。可以是OpenAI、Claude、DeepSeek、GLM 官方服务,也可以是其他中转服务商。
|
|
264
|
-
|
|
265
|
-
### 供应商配置有什么用?
|
|
266
|
-
|
|
267
|
-
通过将你所有的AI服务商统一起来管理,可以帮你:
|
|
268
|
-
|
|
269
|
-
1. 避免频繁修改配置文件,通过aicodeswitch,可以一键切换到不同的供应商的AI服务API
|
|
270
|
-
2. 通过aicodeswitch,将不同供应商的接口数据,转换为工具可以正确使用的接口数据格式,也就是说,你可以将Claude Code接入遵循openai的接口数据协议的其他接口
|
|
271
|
-
3. 避免你忘记曾经注册过那些供应商
|
|
272
|
-
4. 充分榨干不怎么用的供应商的服务,避免充值后不怎么用浪费了
|
|
273
|
-
|
|
274
|
-
### 什么是API服务的“源类型”
|
|
275
|
-
|
|
276
|
-
供应商接口返回的数据格式标准类型,目前支持以下几种:
|
|
277
|
-
|
|
278
|
-
* OpenAI(Responses API标准)
|
|
279
|
-
* OpenAI Chat (Chat Completions API标准)
|
|
280
|
-
* DeepSeek Chat(reasoning_content标准)
|
|
281
|
-
* Claude
|
|
282
|
-
* Claude Chat
|
|
283
|
-
* Gemini
|
|
284
|
-
* Gemini Chat
|
|
285
|
-
|
|
286
|
-
**有什么用?**
|
|
287
|
-
|
|
288
|
-
aicodeswitch内部,会根据“源类型”来转换数据。例如,你的供应商API服务接口是OpenAI Chat的数据格式,而你在路由中配置的“客户端工具“是Claude Code,那么就意味着,这个供应商API的数据,需要经过转换之后才能被Claude Code正确使用。
|
|
289
|
-
|
|
290
|
-
## 路由管理
|
|
291
|
-
|
|
292
|
-
### 什么是路由?
|
|
293
|
-
|
|
294
|
-
路由是aicodeswitch的核心功能,它负责将不同的对象工具(目前指Claude Code和Codex)的请求,路由到不同的供应商API服务上。
|
|
295
|
-
|
|
296
|
-
### 什么是“客户端工具”?
|
|
297
|
-
|
|
298
|
-
目前指Claude Code或Codex。
|
|
299
|
-
|
|
300
|
-
### 什么是“路由规则”?
|
|
301
|
-
|
|
302
|
-
以Claude Code为例,它的请求实际上并非铁板一块,可以被分为多种。比如它的深度思考、长文对话、图片理解等等,都是可以独立对待的。
|
|
303
|
-
|
|
304
|
-
路由规则的目的,就是让你的工具发出的请求,可以根据这个区分,发送给不同的服务商来处理。例如,你默认使用glm-4.7作为写代码的模型,但是,你可以把图片识别的请求发给doubao-code来进行,因为doubao-code的图片识别平均价格可以更低。同样的道理,不同目标的请求可以通过不同的规则来处理,以提升编程的质量和效果。
|
|
305
|
-
|
|
306
|
-
目前,我仅提供了几个比较容易区分的规则,以后,还会添加更多的规则。
|
|
307
|
-
|
|
308
|
-
### 激活路由
|
|
309
|
-
|
|
310
|
-
我们可以为Claude Code添加多个路由,但是,我们必须激活一个路由,才能开始使用。
|
|
311
|
-
而且,所有以Claude Code为对象的路由,在同一时间,只有一个可以被激活。
|
|
312
|
-
|
|
313
|
-
### 切换路由
|
|
314
|
-
|
|
315
|
-
你可以根据你的实际情况来实时切换路由,比如,你可以在发现自己的某个服务商处的余额较少时,立即切换到另外一个服务商。
|
|
316
|
-
|
|
317
|
-
**智能故障切换机制**
|
|
318
|
-
|
|
319
|
-
当同一请求类型配置多个规则时,系统会按排序优先使用第一个,如果某个服务报错(4xx/5xx)或请求超时,将自动切换到下一个可用规则,确保你可以正常使用coding工具。
|
|
320
|
-
|
|
321
|
-
### 数据转流
|
|
322
|
-
|
|
323
|
-
支持将openai的流式响应数据转换成Claude Code的流式数据,并支持实时转换,从而可以让你使用支持openAI的API服务来在Claude Code中使用。
|
|
324
|
-
|
|
325
|
-
*不过,需要注意,如果你的API服务商不支持tools,或者所支持的max_tokens太小,是无法在Claude Code中使用的。*
|
|
326
|
-
|
|
327
|
-
## Skills管理
|
|
328
|
-
|
|
329
|
-
你可以在 aicodeswitch 中集中统一管理 skills,把skills分发给claude code和codex,随时启用和停用skills。
|
|
330
|
-
另外,你可以基于自然语言搜索skills,找到skill之后,支持一键安装。
|
|
331
|
-
|
|
332
|
-
## MCP管理
|
|
333
|
-
|
|
334
|
-
你可以在 aicodeswitch 中集中统一管理 MCP,把MCP分发给claude code和codex,随时启用和停用MCP。
|
|
335
|
-
并且,你还可以通过MCP来实现图像理解。
|
|
336
|
-
|
|
337
|
-
## 日志
|
|
338
|
-
|
|
339
|
-
在**日志**页面,您可以查看:
|
|
340
|
-
|
|
341
|
-
**请求日志**:所有 API 请求的详细记录
|
|
342
|
-
|
|
343
|
-
* 请求来源和目标
|
|
344
|
-
* 请求内容和响应
|
|
345
|
-
* 耗时和状态码
|
|
346
|
-
* 错误信息(如有)
|
|
347
|
-
|
|
348
|
-
**错误日志**:错误和异常记录
|
|
349
|
-
|
|
350
|
-
* 错误类型
|
|
351
|
-
* 错误详情
|
|
352
|
-
* 发生时间
|
|
353
|
-
|
|
354
|
-
**会话日志**:按照会话session来汇集日志
|
|
355
|
-
|
|
356
|
-
**日志筛选**
|
|
357
|
-
|
|
358
|
-
根据提供的选项进行筛选。
|
|
359
|
-
|
|
360
|
-
## 配置文件
|
|
361
|
-
|
|
362
|
-
作为 CLI 工具,你可以在 ~/.aicodeswitch/ 目录下找到工具的相关文件。里面有一个 aicodeswitch.conf 文件,可以进行配置。
|
|
363
|
-
目前仅支持以下配置:
|
|
364
|
-
|
|
365
|
-
\`\`\`
|
|
366
|
-
# aicodeswitch的服务IP
|
|
367
|
-
HOST=127.0.0.1
|
|
368
|
-
# aicodeswitch的服务端口
|
|
369
|
-
PORT=4567
|
|
370
|
-
|
|
371
|
-
# 如果提供AUTH,你无法直接登录用户界面,必须输入AUTH的值才能进入,相当于是一个登陆鉴权
|
|
372
|
-
# 如果你在自己的服务器上使用,通过远程接入接口时,就必须提供这个值
|
|
373
|
-
# AUTH=
|
|
374
|
-
\`\`\`
|
|
375
|
-
|
|
376
|
-
## 常见问题
|
|
377
|
-
|
|
378
|
-
### 1\\. 如何切换供应商?
|
|
379
|
-
|
|
380
|
-
在路由管理页面修改规则的目标供应商,或调整优先级即可。
|
|
381
|
-
|
|
382
|
-
### 2\\. 如何查看失败的请求?
|
|
383
|
-
|
|
384
|
-
在请求日志页面,筛选状态码不为 200 的记录。
|
|
385
|
-
|
|
386
|
-
### 3\\. 如何备份配置?
|
|
387
|
-
|
|
388
|
-
在系统设置页面使用**导出配置**功能,然后将提供的数据保存到本地文件中。
|
|
389
|
-
|
|
390
|
-
### 4\\. 如何设置日志保留时间?
|
|
391
|
-
|
|
392
|
-
在系统设置页面修改**日志保留天数**配置。
|
|
393
|
-
|
|
394
|
-
## 我的开源
|
|
395
|
-
|
|
396
|
-
* [PCM](https://github.com/tangshuang/pcm): 用户意图识别、精准上下文、多线对话的Agent系统
|
|
397
|
-
* [Lan Transfer](https://github.com/tangshuang/lan-transfer): 免费高效的局域网文件互传工具
|
|
398
|
-
* [MCP Bone](https://github.com/tangshuang/mcp-bone): 远程托管的MCP服管理工具
|
|
399
|
-
* [Anys](https://github.com/tangshuang/anys): 免费前端监控kit
|
|
400
|
-
* [WebCut](https://github.com/tangshuang/webcut): 免费开源的网页端视频剪辑UI框架
|
|
401
|
-
* [indb](https://github.com/tangshuang/indb): 网页端轻量kv数据库操作库
|
|
402
|
-
* [Formast](https://github.com/tangshuang/formast): 复杂业务场景下的企业级JSON驱动表单框架
|
|
403
|
-
|
|
404
|
-
## 关联资源
|
|
405
|
-
|
|
406
|
-
* [Claude Code 深度教程](https://claudecode.tangshuang.net): 100%免费的Claude Code入门到精通教程
|
|
407
|
-
|
|
408
|
-
## 支持我
|
|
409
|
-
|
|
410
|
-

|
|
411
|
-
|
|
412
|
-
你的支持是我前进的动力!
|
|
413
|
-
|
|
414
|
-
## 许可
|
|
415
|
-
|
|
416
|
-
此项目采用双许可证模式:
|
|
417
|
-
|
|
418
|
-
* **开源使用**:项目默认采用 GPL 3.0 许可证,允许个人免费使用、修改和分发,但所有衍生品必须开源。
|
|
419
|
-
* **商业使用**:如果您希望商业化使用而不遵守 GPL 条款(例如闭源销售),请联系我们购买单独的商业许可证。
|
|
420
|
-
|
|
421
|
-
## 技术支持
|
|
422
|
-
|
|
423
|
-
如有问题或建议,请访问项目 [GitHub 仓库](https://github.com/tangshuang/aicodeswitch/issues)提交 Issue。
|
|
424
|
-
`,X8=()=>o.jsx("div",{className:"markdown-content",children:o.jsx(mc,{children:G8})});function nO(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=nO(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ze(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=nO(e))&&(r&&(r+=" "),r+=t);return r}var Q8=["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=Q8;return t.includes(e)}var J8=["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"],Z8=new Set(J8);function rO(e){return typeof e!="string"?!1:Z8.has(e)}function iO(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)&&(rO(n)||iO(n))&&(t[n]=e[n]);return t}function Ro(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)&&(rO(n)||iO(n)||Yx(n))&&(t[n]=e[n]);return t}function e5(e){return e==null?null:h.isValidElement(e)?Ln(e.props):typeof e=="object"&&!Array.isArray(e)?Ln(e):null}var t5=["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 n5(e,t){if(e==null)return{};var n,r,i=r5(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 r5(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=n5(e,t5),d=a||{width:r,height:i,x:0,y:0},p=Ze("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)}),i5=["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 a5(e,t){if(e==null)return{};var n,r,i=o5(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 o5(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=a5(e,i5),a=Ze("recharts-layer",r);return h.createElement("g",Rv({className:a},Ln(i),{ref:t}),n)}),aO=h.createContext(null),l5=()=>h.useContext(aO);function xt(e){return function(){return e}}const oO=Math.cos,Of=Math.sin,ei=Math.sqrt,Af=Math.PI,Zp=2*Af,Dv=Math.PI,Lv=2*Dv,co=1e-6,s5=Lv-co;function lO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function c5(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return lO;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 u5{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?lO:c5(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>co)if(!(Math.abs(d*c-u*f)>co)||!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,k=w/v;Math.abs(j-1)>co&&this._append`L${t+j*f},${n+j*d}`,this._append`A${a},${a},0,0,${+(d*m>f*g)},${this._x1=t+k*c},${this._y1=n+k*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)>co||Math.abs(this._y1-f)>co)&&this._append`L${u},${f}`,r&&(p<0&&(p=p%Lv+Lv),p>s5?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>co&&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 u5(t)}function Qx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sO(e){this._context=e}sO.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 sO(e)}function cO(e){return e[0]}function uO(e){return e[1]}function dO(e,t){var n=xt(!0),r=null,i=eh,a=null,l=Xx(s);e=typeof e=="function"?e:e===void 0?cO:xt(e),t=typeof t=="function"?t:t===void 0?uO:xt(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:xt(+c),s):e},s.y=function(c){return arguments.length?(t=typeof c=="function"?c:xt(+c),s):t},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:xt(!!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=xt(!0),a=null,l=eh,s=null,c=Xx(u);e=typeof e=="function"?e:e===void 0?cO:xt(+e),t=typeof t=="function"?t:xt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?uO:xt(+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 dO().defined(i).curve(l).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:xt(+d),r=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:xt(+d),u):e},u.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:xt(+d),u):r},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:xt(+d),n=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:xt(+d),u):t},u.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:xt(+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:xt(!!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 fO{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 d5(e){return new fO(e,!0)}function f5(e){return new fO(e,!1)}const Jx={draw(e,t){const n=ei(t/Af);e.moveTo(n,0),e.arc(0,0,n,0,Zp)}},p5={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()}},pO=ei(1/3),h5=pO*2,m5={draw(e,t){const n=ei(t/h5),r=n*pO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},g5={draw(e,t){const n=ei(t),r=-n/2;e.rect(r,r,n,n)}},v5=.8908130915292852,hO=Of(Af/10)/Of(7*Af/10),y5=Of(Zp/10)*hO,x5=-oO(Zp/10)*hO,b5={draw(e,t){const n=ei(t*v5),r=y5*n,i=x5*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=Zp*a/5,s=oO(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),w5={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),j5=(zv/2+1)*3,S5={draw(e,t){const n=ei(t/j5),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 k5(e,t){let n=null,r=Xx(i);e=typeof e=="function"?e:xt(e||Jx),t=typeof t=="function"?t:xt(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:xt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:xt(+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 mO(e){this._context=e}mO.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 C5(e){return new mO(e)}function gO(e){this._context=e}gO.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 P5(e){return new gO(e)}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(){(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 E5(e){return new vO(e)}function yO(e){this._context=e}yO.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 T5(e){return new yO(e)}function Mj(e){return e<0?-1:1}function Rj(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(Mj(a)+Mj(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(s))||0}function Dj(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,Dj(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,Dj(this,n=Rj(this,e,t)),n);break;default:Qm(this,this._t0,n=Rj(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function xO(e){this._context=new bO(e)}(xO.prototype=Object.create(_f.prototype)).point=function(e,t){_f.prototype.point.call(this,t,e)};function bO(e){this._context=e}bO.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 O5(e){return new _f(e)}function A5(e){return new xO(e)}function wO(e){this._context=e}wO.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=Lj(e),i=Lj(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 Lj(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 I5(e){return new wO(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 N5(e){return new th(e,.5)}function _5(e){return new th(e,0)}function M5(e){return new th(e,1)}function Do(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 R5(e,t){return e[t]}function D5(e){const t=[];return t.key=e,t}function L5(){var e=xt([]),t=$v,n=Do,r=R5;function i(a){var l=Array.from(e.apply(this,arguments),D5),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:xt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:xt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?$v:typeof a=="function"?a:xt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Do,i):n},i}function z5(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}Do(e,t)}}function $5(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}Do(e,t)}}function B5(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,Do(e,t)}}var nh={},jO={};function F5(e){return e==="__proto__"}jO.isUnsafeProperty=F5;var Zx={};function U5(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}Zx.isDeepKey=U5;var rh={};function W5(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=W5;var ih={},SO={};function kO(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(kO).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}SO.toString=kO;const K5=rh,q5=SO;function H5(e){if(Array.isArray(e))return e.map(K5.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=H5;const Bv=jO,V5=Zx,Y5=rh,G5=ih;function CO(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?V5.isDeepKey(t)?CO(e,G5.toPath(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=Y5.toKey(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return X5(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 X5(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=CO;var Q5=nh.get;const Lo=zr(Q5);var J5=4;function ja(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:J5,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Ut(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,zo=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",Z5=0,Bc=e=>{var t=++Z5;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(zo(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},PO=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 ot(e,t,n){return ve(e)&&ve(t)?ja(e+n*(t-e)):t}function EO(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Lo(r,t))===n)}var Et=e=>e===null||typeof e>"u",fu=e=>Et(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function tr(e){return e!=null}function qa(){}var eF=["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 zj(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 $j(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zj(Object(n),!0).forEach(function(r){tF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tF(e,t,n){return(t=nF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nF(e){var t=rF(e,"string");return typeof t=="symbol"?t:t+""}function rF(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 iF(e,t){if(e==null)return{};var n,r,i=aF(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 aF(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 TO={symbolCircle:Jx,symbolCross:p5,symbolDiamond:m5,symbolSquare:g5,symbolStar:b5,symbolTriangle:w5,symbolWye:S5},oF=Math.PI/180,lF=e=>{var t="symbol".concat(fu(e));return TO[t]||Jx},sF=(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*oF;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}},cF=(e,t)=>{TO["symbol".concat(fu(e))]=t},e0=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=iF(e,eF),a=$j($j({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var s=()=>{var p=lF(l),m=k5().type(p).size(sF(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:Ze("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(f,")"),d:s()})):null};e0.registerSymbol=cF;var OO=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},uF=(e,t,n)=>r=>(e(t,n,r),null),pu=(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]=uF(a,t,n))}),r};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 dF(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){fF(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 fF(e,t,n){return(t=pF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pF(e){var t=hF(e,"string");return typeof t=="symbol"?t:t+""}function hF(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=dF({},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 Fj(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 AO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fj(Object(n),!0).forEach(function(r){mF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mF(e,t,n){return(t=gF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gF(e){var t=vF(e,"string");return typeof t=="symbol"?t:t+""}function vF(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,yF={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function xF(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function bF(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:xF(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,`
|
|
425
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
|
|
426
|
-
H`).concat(Pr,"M").concat(2*l,",").concat(i,`
|
|
427
|
-
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=AO({},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 wF(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=Ze({"recharts-legend-item":!0,["legend-item-".concat(p)]:!0,inactive:d.inactive});if(d.type==="none")return null;var y=typeof s=="object"?AO({},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)},pu(e,d,p)),h.createElement(Gx,{width:n,height:n,viewBox:c,style:f,"aria-label":"".concat(d.value," legend icon")},h.createElement(bF,{data:d,iconType:l,inactiveColor:a})),h.createElement("span",{className:"recharts-legend-item-text",style:y},x))})}var jF=e=>{var t=Xt(e,yF),{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(wF,Mf({},t,{payload:n})))},IO={},NO={};function SF(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())}NO.uniqBy=SF;var _O={};function kF(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}_O.ary=kF;var n0={};function CF(e){return e}n0.identity=CF;var MO={},RO={};const PF=nh;function EF(e){return function(t){return PF.get(t,e)}}RO.property=EF;var DO={},LO={},hu={},r0={};function TF(e){return e==null||typeof e!="object"&&typeof e!="function"}r0.isPrimitive=TF;var zO={};function OF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}zO.isTypedArray=OF;var $O={};function AF(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}$O.getSymbols=AF;var ah={};function IF(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}ah.getTag=IF;var ft={};const NF="[object RegExp]",_F="[object String]",MF="[object Number]",RF="[object Boolean]",DF="[object Arguments]",LF="[object Symbol]",zF="[object Date]",$F="[object Map]",BF="[object Set]",FF="[object Array]",UF="[object Function]",WF="[object ArrayBuffer]",KF="[object Object]",qF="[object Error]",HF="[object DataView]",VF="[object Uint8Array]",YF="[object Uint8ClampedArray]",GF="[object Uint16Array]",XF="[object Uint32Array]",QF="[object BigUint64Array]",JF="[object Int8Array]",ZF="[object Int16Array]",eU="[object Int32Array]",tU="[object BigInt64Array]",nU="[object Float32Array]",rU="[object Float64Array]";ft.argumentsTag=DF;ft.arrayBufferTag=WF;ft.arrayTag=FF;ft.bigInt64ArrayTag=tU;ft.bigUint64ArrayTag=QF;ft.booleanTag=RF;ft.dataViewTag=HF;ft.dateTag=zF;ft.errorTag=qF;ft.float32ArrayTag=nU;ft.float64ArrayTag=rU;ft.functionTag=UF;ft.int16ArrayTag=ZF;ft.int32ArrayTag=eU;ft.int8ArrayTag=JF;ft.mapTag=$F;ft.numberTag=MF;ft.objectTag=KF;ft.regexpTag=NF;ft.setTag=BF;ft.stringTag=_F;ft.symbolTag=LF;ft.uint16ArrayTag=GF;ft.uint32ArrayTag=XF;ft.uint8ArrayTag=VF;ft.uint8ClampedArrayTag=YF;var BO={},FO={};const iU=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof Ma=="object"&&Ma||function(){return this}()||Function("return this")();FO.globalThis_=iU;const Uj=FO;function aU(e){return typeof Uj.globalThis_.Buffer<"u"&&Uj.globalThis_.Buffer.isBuffer(e)}BO.isBuffer=aU;const oU=r0,lU=zO,sU=$O,cU=ah,Bt=ft,uU=BO;function dU(e,t){return yo(e,void 0,e,new Map,t)}function yo(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(oU.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]=yo(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,yo(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(yo(s,void 0,n,r,i));return l}if(uU.isBuffer(e))return e.subarray();if(lU.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]=yo(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"&&fU(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),...sU.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]=yo(t[s],s,n,r,i))}}function fU(e){switch(cU.getTag(e)){case Bt.argumentsTag:case Bt.arrayTag:case Bt.arrayBufferTag:case Bt.dataViewTag:case Bt.booleanTag:case Bt.dateTag:case Bt.float32ArrayTag:case Bt.float64ArrayTag:case Bt.int8ArrayTag:case Bt.int16ArrayTag:case Bt.int32ArrayTag:case Bt.mapTag:case Bt.numberTag:case Bt.objectTag:case Bt.regexpTag:case Bt.setTag:case Bt.stringTag:case Bt.symbolTag:case Bt.uint8ArrayTag:case Bt.uint8ClampedArrayTag:case Bt.uint16ArrayTag:case Bt.uint32ArrayTag:return!0;default:return!1}}hu.cloneDeepWith=dU;hu.cloneDeepWithImpl=yo;hu.copyProperties=Ni;const pU=hu;function hU(e){return pU.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}LO.cloneDeep=hU;var i0={},UO={},a0={};function mU(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}a0.isEqualsSameValueZero=mU;var o0={};function gU(e){return e!==null&&(typeof e=="object"||typeof e=="function")}o0.isObject=gU;const Wj=r0,Kj=a0,vU=o0;function WO(e,t,n){return typeof n!="function"?WO(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 yU(e,t,n,r);case"function":return Object.keys(t).length>0?Uv(e,{...t},n,r):Kj.isEqualsSameValueZero(e,t);default:return vU.isObject(e)?typeof t=="string"?t==="":!0:Kj.isEqualsSameValueZero(e,t)}}function yU(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return KO(e,t,n,r);if(t instanceof Map)return xU(e,t,n,r);if(t instanceof Set)return bU(e,t,n,r);const i=Object.keys(t);if(e==null||Wj.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(!Wj.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 xU(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 KO(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 bU(e,t,n,r){return t.size===0?!0:e instanceof Set?KO([...e],[...t],n,r):!1}UO.isMatchWith=WO;const wU=UO;function jU(e,t){return wU.isMatchWith(e,t,()=>{})}i0.isMatch=jU;const SU=LO,kU=i0;function CU(e){return e=SU.cloneDeep(e),t=>kU.isMatch(t,e)}DO.matches=CU;var qO={},HO={},VO={};const PU=ah,hd=ft,md=hu;function EU(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(PU.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}}})}VO.cloneDeepWith=EU;const TU=VO;function OU(e){return TU.cloneDeepWith(e)}HO.cloneDeep=OU;var YO={},l0={};const AU=/^(?:0|[1-9]\d*)$/;function IU(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 AU.test(e)}}l0.isIndex=IU;var GO={};const NU=ah;function _U(e){return e!==null&&typeof e=="object"&&NU.getTag(e)==="[object Arguments]"}GO.isArguments=_U;const MU=Zx,RU=ih,DU=l0,LU=GO;function zU(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&MU.isDeepKey(t)&&(e==null?void 0:e[t])==null?n=RU.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)||LU.isArguments(r))&&DU.isIndex(a)&&a<r.length))return!1;r=r[a]}return!0}YO.has=zU;const $U=rh,BU=nh,FU=i0,UU=HO,WU=YO;function KU(e,t){switch(typeof e){case"object":Object.is(e==null?void 0:e.valueOf(),-0)&&(e="-0");break;case"number":e=$U.toKey(e);break}return t=UU.cloneDeep(t),function(n){const r=BU.get(n,e);return r===void 0?WU.has(n,e):t===void 0?r===void 0:FU.isMatch(r,t)}}qO.matchesProperty=KU;const qU=n0,HU=RO,VU=DO,YU=qO;function GU(e){if(e==null)return qU.identity;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?YU.matchesProperty(e[0],e[1]):VU.matches(e);case"string":case"symbol":case"number":return HU.property(e)}}MO.iteratee=GU;var XO={},s0={},QO={};function XU(e){return Number.isSafeInteger(e)&&e>=0}QO.isLength=XU;const QU=QO;function JU(e){return e!=null&&typeof e!="function"&&QU.isLength(e.length)}s0.isArrayLike=JU;var JO={};function ZU(e){return typeof e=="object"&&e!==null}JO.isObjectLike=ZU;const eW=s0,tW=JO;function nW(e){return tW.isObjectLike(e)&&eW.isArrayLike(e)}XO.isArrayLikeObject=nW;const rW=NO,iW=_O,aW=n0,oW=MO,lW=XO;function sW(e,t=aW.identity){return lW.isArrayLikeObject(e)?rW.uniqBy(Array.from(e),iW.ary(oW.iteratee(t),1)):[]}IO.uniqBy=sW;var cW=IO.uniqBy;const qj=zr(cW);function ZO(e,t,n){return t===!0?qj(e,n):typeof t=="function"?qj(e,t):e}var eA={exports:{}},tA={},nA={exports:{}},rA={};/**
|
|
428
|
-
* @license React
|
|
429
|
-
* use-sync-external-store-shim.production.js
|
|
430
|
-
*
|
|
431
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the MIT license found in the
|
|
434
|
-
* LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/var Gl=h;function uW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dW=typeof Object.is=="function"?Object.is:uW,fW=Gl.useState,pW=Gl.useEffect,hW=Gl.useLayoutEffect,mW=Gl.useDebugValue;function gW(e,t){var n=t(),r=fW({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return hW(function(){i.value=n,i.getSnapshot=t,Jm(i)&&a({inst:i})},[e,n,t]),pW(function(){return Jm(i)&&a({inst:i}),e(function(){Jm(i)&&a({inst:i})})},[e]),mW(n),n}function Jm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dW(e,n)}catch{return!0}}function vW(e,t){return t()}var yW=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?vW:gW;rA.useSyncExternalStore=Gl.useSyncExternalStore!==void 0?Gl.useSyncExternalStore:yW;nA.exports=rA;var xW=nA.exports;/**
|
|
436
|
-
* @license React
|
|
437
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
438
|
-
*
|
|
439
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
440
|
-
*
|
|
441
|
-
* This source code is licensed under the MIT license found in the
|
|
442
|
-
* LICENSE file in the root directory of this source tree.
|
|
443
|
-
*/var oh=h,bW=xW;function wW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jW=typeof Object.is=="function"?Object.is:wW,SW=bW.useSyncExternalStore,kW=oh.useRef,CW=oh.useEffect,PW=oh.useMemo,EW=oh.useDebugValue;tA.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=kW(null);if(a.current===null){var l={hasValue:!1,value:null};a.current=l}else l=a.current;a=PW(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,jW(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=SW(e,a[0],a[1]);return CW(function(){l.hasValue=!0,l.value=s},[s]),EW(s),s};eA.exports=tA;var TW=eA.exports,c0=h.createContext(null),OW=e=>e,pt=()=>{var e=h.useContext(c0);return e?e.store.dispatch:OW},Hd=()=>{},AW=()=>Hd,IW=(e,t)=>e===t;function we(e){var t=h.useContext(c0),n=h.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Hd,[t,e]);return TW.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:AW,t?t.store.getState:Hd,t?t.store.getState:Hd,n,IW)}function NW(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 MW(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 Hj=e=>Array.isArray(e)?e:[e];function RW(e){const t=Array.isArray(e[0])?e[0]:e;return MW(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function DW(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var LW=class{constructor(e){this.value=e}deref(){return this.value}},zW=typeof WeakRef<"u"?WeakRef:LW,$W=0,Vj=1;function gd(){return{s:$W,v:void 0,o:null,p:null}}function iA(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===Vj)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 zW(f):f}return u.s=Vj,u.v=f,f}return l.clearCache=()=>{n=gd(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function BW(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()),NW(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const f={...n,...c},{memoize:d,memoizeOptions:p=[],argsMemoize:m=iA,argsMemoizeOptions:g=[]}=f,y=Hj(p),x=Hj(g),v=RW(i),b=d(function(){return a++,u.apply(null,arguments)},...y),w=m(function(){l++;const k=DW(v,arguments);return s=b.apply(null,k),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 H=BW(iA),FW=Object.assign((e,t=H)=>{_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:()=>FW}),aA={},oA={};function UW(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}oA.flatten=UW;var u0={};const WW=a0,KW=s0,qW=o0,HW=l0;function VW(e,t,n){return qW.isObject(n)&&(typeof t=="number"&&KW.isArrayLike(n)&&HW.isIndex(t)&&t<n.length||typeof t=="string"&&t in n)?WW.isEqualsSameValueZero(n[t],e):!1}u0.isIterateeCall=VW;var lA={},sA={};function Yj(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const YW=(e,t,n)=>{if(e!==t){const r=Yj(e),i=Yj(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};sA.compareValues=YW;var cA={},d0={};function GW(e){return typeof e=="symbol"||e instanceof Symbol}d0.isSymbol=GW;const XW=d0,QW=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,JW=/^\w*$/;function ZW(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||XW.isSymbol(e)?!0:typeof e=="string"&&(JW.test(e)||!QW.test(e))||t!=null&&Object.hasOwn(t,e)}cA.isKey=ZW;const eK=ih,tK=sA,nK=cA;function rK(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)||nK.isKey(s)?s:{key:s,path:eK.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=tK.compareValues(s.criteria[u],c.criteria[u],n[u]);if(f!==0)return f}return 0}).map(s=>s.original)}lA.orderBy=rK;const iK=oA,Gj=u0,aK=lA;function oK(e,...t){const n=t.length;return n>1&&Gj.isIterateeCall(e,t[0],t[1])?t=[]:n>2&&Gj.isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),aK.orderBy(e,iK.flatten(t),["asc"])}aA.sortBy=oK;var lK=aA.sortBy;const lh=zr(lK);var uA=e=>e.legend.settings,sK=e=>e.legend.size,cK=e=>e.legend.payload,uK=H([cK,uA],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?lh(r,n):r});function dK(){return we(uK)}var vd=1;function dA(){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 fK=typeof Symbol=="function"&&Symbol.observable||"@@observable",Xj=fK,Zm=()=>Math.random().toString(36).substring(7).split("").join("."),pK={INIT:`@@redux/INIT${Zm()}`,REPLACE:`@@redux/REPLACE${Zm()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Zm()}`},Rf=pK;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 fA(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(fA)(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)}},[Xj](){return this}}}return p({type:Rf.INIT}),{dispatch:p,subscribe:d,getState:f,replaceReducer:m,[Xj]:g}}function hK(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 pA(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{hK(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 mK(...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 hA(e){return f0(e)&&"type"in e&&typeof e.type=="string"}var mA=Symbol.for("immer-nothing"),Qj=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",Fc="value",Yi=e=>!!e&&!!e[Hn];function Zr(e){var t;return e?gA(e)||uh(e)||!!e[Qj]||!!((t=e[Lf])!=null&&t[Qj])||dh(e)||fh(e):!1}var gK=pr[sh][Lf].toString(),Jj=new WeakMap;function gA(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=Jj.get(n);return r===void 0&&(r=Function.toString.call(n),Jj.set(n,r)),r===gK}function ch(e,t,n=!0){mu(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 mu(e){const t=e[Hn];return t?t.type_:uh(e)?1:dh(e)?2:fh(e)?3:0}var Zj=(e,t,n=mu(e))=>n===2?e.has(t):pr[sh].hasOwnProperty.call(e,t),Kv=(e,t,n=mu(e))=>n===2?e.get(t):e[t],$f=(e,t,n,r=mu(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function vK(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 yK(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=gA(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],[Fc]: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)||(mu(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 xK(){Hr(2)}var yd={[Fc]:xK};function ph(e){return e===null||!p0(e)?!0:pr.isFrozen(e)}var Bf="MapSet",Hv="Patches",eS="ArrayMethods",vA={};function $o(e){const t=vA[e];return t||Hr(0,e),t}var tS=e=>!!vA[e],Uc,yA=()=>Uc,bK=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:tS(Bf)?$o(Bf):void 0,arrayMethodsPlugin_:tS(eS)?$o(eS):void 0});function nS(e,t){t&&(e.patchPlugin_=$o(Hv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Vv(e){Yv(e),e.drafts_.forEach(wK),e.drafts_=null}function Yv(e){e===Uc&&(Uc=e.parent_)}var rS=e=>Uc=bK(Uc,e);function wK(e){const t=e[Hn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function iS(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=aS(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Hn].base_,e,t)}else e=aS(t,n);return jK(t,e,!0),Vv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==mA?e:void 0}function aS(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);wA(n,e)}return n.copy_}function jK(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&m0(t,n)}function xA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var hh=(e,t)=>e.scope_===t,SK=[];function bA(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)??SK;for(const s of l)$f(i,s,n,a)}function kK(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);bA(e,a.draft_??a,l,n),wA(a,i)})}function wA(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)}xA(e)}}function CK(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);bA(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_),xA(a)}}else Zr(i)&&Ff(i,t,n)})),e}function PK(e,t){const n=uh(e),r={type_:n?1:0,scope_:t?t.scope_:yA(),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=Wc);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(!Zj(i,t,e.type_))return EK(e,i,t);const a=i[t];if(e.finalized_||!Zr(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&yK(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=jA(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(vK(n,i)&&(n!==void 0||Zj(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),CK(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],[Fc]:n[t]}},defineProperty(){Hr(11)},getPrototypeOf(e){return Xl(e.base_)},setPrototypeOf(){Hr(12)}},Wc={};for(let e in Uf){let t=Uf[e];Wc[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Wc.deleteProperty=function(e,t){return Wc.set.call(this,e,t,void 0)};Wc.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 EK(e,t,n){var i;const r=jA(t,n);return r?Fc in r?r[Fc]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function jA(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 TK=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=rS(this),s=Xv(l,n,void 0);let c=!0;try{a=r(s),c=!1}finally{c?Vv(l):Yv(l)}return nS(l,i),iS(a,l)}else if(!n||!p0(n)){if(a=r(n),a===void 0&&(a=n),a===mA&&(a=void 0),this.autoFreeze_&&m0(a,!0),i){const l=[],s=[];$o(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=rS(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 nS(i,n),iS(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=$o(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)?$o(Bf).proxyMap_(t,n):fh(t)?$o(Bf).proxySet_(t,n):PK(t,n);return((n==null?void 0:n.scope_)??yA()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?kK(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),SA(e)}function SA(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,SA(a))},r),t&&(t.finalized_=!1),n}var OK=new TK,kA=OK.produce;function CA(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var AK=CA(),IK=CA,NK=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=>hA(r)&&r.type===e,n}var PA=class Xs extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Xs.prototype)}static get[Symbol.species](){return Xs}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Xs(...t[0].concat(this)):new Xs(...t.concat(this))}};function oS(e){return Zr(e)?kA(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 MK=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new PA;return n&&(_K(n)?l.push(AK):l.push(IK(n.extraArgument))),l},EA="RTK_autoBatch",kt=()=>e=>({payload:e,meta:{[EA]:!0}}),lS=e=>t=>{setTimeout(t,e)},RK=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(l),n())},a=e(i),l=setTimeout(i,t)},TA=(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?RK(window.requestAnimationFrame,100):lS(10):e.type==="callback"?e.queueNotification:lS(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[EA]),a=!i,a&&(l||(l=!0,c(u))),r.dispatch(f)}finally{i=!0}}})},DK=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new PA(e);return r&&i.push(TA(typeof r=="object"?r:void 0)),i};function LK(e){const t=MK(),{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=pA(n);else throw new Error(mr(1));let c;typeof r=="function"?c=r(t):c=t();let u=Df;i&&(u=NK({trace:!1,...typeof i=="object"&&i}));const f=mK(...c),d=DK(f);let p=typeof l=="function"?l(d):d();const m=u(...p);return fA(s,a,m)}function OA(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 zK(e){return typeof e=="function"}function $K(e,t){let[n,r,i]=OA(t),a;if(zK(e))a=()=>oS(e());else{const s=oS(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 kA(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 BK="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",FK=(e=21)=>{let t="",n=e;for(;n--;)t+=BK[Math.random()*64|0];return t},UK=Symbol.for("rtk-slice-createasyncthunk");function WK(e,t){return`${e}/${t}`}function KK({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[UK];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(HK()):i.reducers)||{},c=Object.keys(s),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(j,k){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]=k,f},addMatcher(j,k){return u.sliceMatchers.push({matcher:j,reducer:k}),f},exposeAction(j,k){return u.actionCreators[j]=k,f},exposeCaseReducer(j,k){return u.sliceCaseReducersByName[j]=k,f}};c.forEach(j=>{const k=s[j],S={reducerName:j,type:WK(a,j),createNotation:typeof i.reducers=="function"};YK(k)?XK(S,k,f,t):VK(S,k,f)});function d(){const[j={},k=[],S=void 0]=typeof i.extraReducers=="function"?OA(i.extraReducers):[i.extraReducers],E={...j,...u.sliceCaseReducersByType};return $K(i.initialState,I=>{for(let D in E)I.addCase(D,E[D]);for(let D of u.sliceMatchers)I.addMatcher(D.matcher,D.reducer);for(let D of k)I.addMatcher(D.matcher,D.reducer);S&&I.addDefaultCase(S)})}const p=j=>j,m=new Map,g=new WeakMap;let y;function x(j,k){return y||(y=d()),y(j,k)}function v(){return y||(y=d()),y.getInitialState()}function b(j,k=!1){function S(I){let D=I[j];return typeof D>"u"&&k&&(D=xd(g,S,v)),D}function E(I=p){const D=xd(m,k,()=>new WeakMap);return xd(D,I,()=>{const O={};for(const[_,M]of Object.entries(i.selectors??{}))O[_]=qK(M,I,()=>xd(g,I,v),k);return O})}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:k,...S}={}){const E=k??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=KK();function HK(){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 VK({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!GK(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 YK(e){return e._reducerDefinitionType==="asyncThunk"}function GK(e){return e._reducerDefinitionType==="reducerWithPrepare"}function XK({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 QK="task",AA="listener",IA="completed",g0="cancelled",JK=`task-${g0}`,ZK=`task-${IA}`,Qv=`${AA}-${g0}`,eq=`${AA}-${IA}`,mh=class{constructor(e){Uu(this,"code");Uu(this,"name","TaskAbortError");Uu(this,"message");this.code=e,this.message=`${QK} ${g0} (reason: ${e})`}},v0=(e,t)=>{if(typeof e!="function")throw new TypeError(mr(32))},Wf=()=>{},NA=(e,t=Wf)=>(e.catch(t),e),_A=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Po=e=>{if(e.aborted)throw new mh(e.reason)};function MA(e,t){let n=Wf;return new Promise((r,i)=>{const a=()=>i(new mh(e.reason));if(e.aborted){a();return}n=_A(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Wf})}var tq=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=>NA(MA(e,t).then(n=>(Po(e),n))),RA=e=>{const t=Kf(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Dl}=Object,sS={},gh="listenerMiddleware",nq=(e,t)=>{const n=r=>_A(e,()=>r.abort(e.reason));return(r,i)=>{v0(r);const a=new AbortController;n(a);const l=tq(async()=>{Po(e),Po(a.signal);const s=await r({pause:Kf(a.signal),delay:RA(a.signal),signal:a.signal});return Po(a.signal),s},()=>a.abort(ZK));return i!=null&&i.autoJoin&&t.push(l.catch(Wf)),{result:Kf(e)(l),cancel(){a.abort(JK)}}}},rq=(e,t)=>{const n=async(r,i)=>{Po(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 MA(t,Promise.race(s));return Po(t),c}finally{a()}};return(r,i)=>NA(n(r,i))},DA=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}},LA=Dl(e=>{const{type:t,predicate:n,effect:r}=DA(e);return{id:FK(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(mr(22))}}},{withTypes:()=>LA}),cS=(e,t)=>{const{type:n,effect:r,predicate:i}=DA(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)})},iq=(e,t)=>()=>{for(const n of t.keys())Jv(n);e.clear()},uS=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},zA=Dl(vr(`${gh}/add`),{withTypes:()=>zA}),aq=vr(`${gh}/removeAll`),$A=Dl(vr(`${gh}/remove`),{withTypes:()=>$A}),oq=(...e)=>{console.error(`${gh}/error`,...e)},gu=(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=oq}=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=cS(t,m)??LA(m);return s(g)};Dl(c,{withTypes:()=>c});const u=m=>{const g=cS(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=rq(c,v.signal),w=[];try{m.pending.add(v),r(m),await Promise.resolve(m.effect(g,Dl({},y,{getOriginalState:x,condition:(j,k)=>b(j,k).then(Boolean),take:b,delay:RA(v.signal),pause:Kf(v.signal),extra:a,signal:v.signal,fork:nq(v.signal,w),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((j,k,S)=>{j!==v&&(j.abort(Qv),S.delete(j))})},cancel:()=>{v.abort(Qv),m.pending.delete(v)},throwIfCancelled:()=>{Po(v.signal)}})))}catch(j){j instanceof mh||uS(l,j,{raisedBy:"effect"})}finally{await Promise.all(w),v.abort(eq),i(m),m.pending.delete(v)}},d=iq(t,n);return{middleware:m=>g=>y=>{if(!hA(y))return g(y);if(zA.match(y))return c(y.payload);if(aq.match(y)){d();return}if($A.match(y))return u(y.payload);let x=m.getState();const v=()=>{if(x===sS)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 k of j){let S=!1;try{S=k.predicate(y,w,x)}catch(E){S=!1,uS(l,E,{raisedBy:"predicate"})}S&&f(k,y,m,v)}}}finally{x=sS}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 lq={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},BA=$n({name:"chartLayout",initialState:lq,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:sq,setLayout:cq,setChartSize:uq,setScale:dq}=BA.actions,fq=BA.reducer;function FA(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Be(e){return Number.isFinite(e)}function ki(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function dS(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?dS(Object(n),!0).forEach(function(r){pq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pq(e,t,n){return(t=hq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hq(e){var t=mq(e,"string");return typeof t=="symbol"?t:t+""}function mq(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 nt(e,t,n){return Et(e)||Et(t)?n:Si(t)?Lo(e,t,n):typeof t=="function"?t(e):n}var gq=(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",UA=(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},WA=(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 Be(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 Be(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 Be(w)?{coordinate:w+y,value:v,index:b,offset:y}:null}).filter(tr):l.domain().map((v,b)=>{var w=l.map(v);return Be(w)?{coordinate:w+y,value:r?r[v]:v,index:b,offset:y}:null}).filter(tr)},vq=(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},yq=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)}}}},xq=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)}}}},bq={sign:yq,expand:z5,none:Do,silhouette:$5,wiggle:B5,positive:xq},wq=(e,t,n)=>{var r,i=(r=bq[n])!==null&&r!==void 0?r:Do,a=L5().keys(t).value((s,c)=>Number(nt(s,c,0))).order($v).offset(i),l=a(e);return l.forEach((s,c)=>{s.forEach((u,f)=>{var d=nt(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 KA(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&&!Et(i[t.dataKey])){var s=EO(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=nt(i,Et(l)?t.dataKey:l),u=t.scale.map(c);return ve(u)?u:null}var fS=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=nt(a,t.dataKey,t.scale.domain()[l]);if(Et(s))return null;var c=t.scale.map(s);return ve(c)?c-i/2+r:null},jq=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]},Sq=e=>{var t=e.flat(2).filter(ve);return[Math.min(...t),Math.max(...t)]},kq=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Cq=(e,t,n)=>{if(e!=null)return kq(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=FA(u,t,n),d=Sq(f);return!Be(d[0])||!Be(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]))},pS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,hS=/^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 mS(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 Pq=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Eq=(e,t)=>t==="centric"?e.angle:e.radius,ta=e=>e.layout.width,na=e=>e.layout.height,Tq=e=>e.layout.scale,qA=e=>e.layout.margin,vh=H(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),yh=H(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),HA="data-recharts-item-index",VA="data-recharts-item-id",vu=60;function gS(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?gS(Object(n),!0).forEach(function(r){Oq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oq(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=Iq(e,"string");return typeof t=="symbol"?t:t+""}function Iq(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 Nq=e=>e.brush.height;function _q(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:vu;return n+i}return n},0)}function Mq(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:vu;return n+i}return n},0)}function Rq(e){var t=vh(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Dq(e){var t=vh(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var cn=H([ta,na,qA,Nq,_q,Mq,Rq,Dq,uA,sK],(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=gq(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)})}),Lq=H(cn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),y0=H(ta,na,(e,t)=>({x:0,y:0,width:e,height:t})),zq=h.createContext(null),xn=()=>h.useContext(zq)!=null,xh=e=>e.brush,bh=H([xh,cn,qA],(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})),YA={},GA={},XA={};function $q(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}XA.debounce=$q;const Bq=XA;function Fq(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=Bq.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}GA.debounce=Fq;const Uq=GA;function Wq(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return Uq.debounce(e,t,{leading:r,maxWait:t,trailing:i})}YA.throttle=Wq;var Kq=YA.throttle;const qq=zr(Kq);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}},QA=(e,t,n)=>{var{width:r=gi.width,height:i=gi.height,aspect:a,maxHeight:l}=n,s=zo(r)?e:Number(r),c=zo(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}},Hq={width:0,height:0,overflow:"visible"},Vq={width:0,overflowX:"visible"},Yq={height:0,overflowY:"visible"},Gq={},Xq=e=>{var{width:t,height:n}=e,r=zo(t),i=zo(n);return r&&i?Hq:r?Vq:i?Yq:Gq};function Qq(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 vS(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 yS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vS(Object(n),!0).forEach(function(r){Jq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jq(e,t,n){return(t=Zq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zq(e){var t=e9(e,"string");return typeof t=="symbol"?t:t+""}function e9(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 JA=h.createContext(gi.initialDimension);function t9(e){return ki(e.width)&&ki(e.height)}function ZA(e){var{children:t,width:n,height:r}=e,i=h.useMemo(()=>({width:n,height:r}),[n,r]);return t9(i)?h.createElement(JA.Provider,{value:i},t):null}var x0=()=>h.useContext(JA),n9=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,D)=>{b(O=>{var _=Math.round(I),M=Math.round(D);return O.containerWidth===_&&O.containerHeight===M?O:{containerWidth:_,containerHeight:M}})},[]);h.useEffect(()=>{if(y.current==null||typeof ResizeObserver>"u")return qa;var I=M=>{var G,q=M[0];if(q!=null){var{width:A,height:U}=q.contentRect;w(A,U),(G=x.current)===null||G===void 0||G.call(x,A,U)}};f>0&&(I=qq(I,f,{trailing:!0,leading:!1}));var D=new ResizeObserver(I),{width:O,height:_}=y.current.getBoundingClientRect();return w(O,_),D.observe(y.current),()=>{D.disconnect()}},[w,f]);var{containerWidth:j,containerHeight:k}=v;Hf(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:S,calculatedHeight:E}=QA(j,k,{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,
|
|
444
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
445
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
446
|
-
height and width.`,S,E,i,a,l,s,n),h.createElement("div",{id:d?"".concat(d):void 0,className:Ze("recharts-responsive-container",p),style:yS(yS({},g),{},{width:i,height:a,minWidth:l,minHeight:s,maxHeight:c}),ref:y},h.createElement("div",{style:Xq({width:i,height:a})},h.createElement(ZA,{width:S,height:E},u)))}),_s=h.forwardRef((e,t)=>{var n=x0();if(ki(n.width)&&ki(n.height))return e.children;var{width:r,height:i}=Qq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=QA(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ve(a)&&ve(l)?h.createElement(ZA,{width:a,height:l},e.children):h.createElement(n9,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=we(Lq),r=we(bh),i=(e=we(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}},r9={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},eI=()=>{var e;return(e=we(cn))!==null&&e!==void 0?e:r9},w0=()=>we(ta),j0=()=>we(na),i9=()=>we(e=>e.layout.margin),Ye=e=>e.layout.layoutType,Va=()=>we(Ye),S0=()=>{var e=Va();if(e==="horizontal"||e==="vertical")return e},tI=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},a9=()=>{var e=Va();return e!==void 0},yu=e=>{var t=pt(),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(uq({width:l,height:s}))},[t,n,l,s]),null},nI=Symbol.for("immer-nothing"),xS=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 Kc=Object.getPrototypeOf;function Ql(e){return!!e&&!!e[yr]}function Bo(e){var t;return e?rI(e)||Array.isArray(e)||!!e[xS]||!!((t=e.constructor)!=null&&t[xS])||xu(e)||Sh(e):!1}var o9=Object.prototype.constructor.toString(),bS=new WeakMap;function rI(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=bS.get(n);return r===void 0&&(r=Function.toString.call(n),bS.set(n,r)),r===o9}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:xu(e)?2:Sh(e)?3:0}function ey(e,t){return jh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function iI(e,t,n){const r=jh(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function l9(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xu(e){return e instanceof Map}function Sh(e){return e instanceof Set}function uo(e){return e.copy_||e.base_}function ty(e,t){if(xu(e))return new Map(e);if(Sh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=rI(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(Kc(e),r)}else{const r=Kc(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)||!Bo(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 s9(){Vr(2)}var jd={value:s9};function kh(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var c9={};function Fo(e){const t=c9[e];return t||Vr(0,e),t}var qc;function aI(){return qc}function u9(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wS(e,t){t&&(Fo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ny(e){ry(e),e.drafts_.forEach(d9),e.drafts_=null}function ry(e){e===qc&&(qc=e.parent_)}function jS(e){return qc=u9(qc,e)}function d9(e){const t=e[yr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function SS(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)),Bo(e)&&(e=Yf(t,e),t.parent_||Gf(t,e)),t.patches_&&Fo("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!==nI?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)=>kS(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)=>kS(e,i,a,c,u,n,s),r),Gf(e,a,!1),n&&e.patches_&&Fo("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function kS(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(iI(n,r,u),Ql(u))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(Bo(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"&&(xu(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 f9(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:aI(),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=Hc);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=uo(e);if(!ey(n,t))return p9(e,n,t);const r=n[t];return e.finalized_||!Bo(r)?r:r===ng(e.base_,t)?(rg(e),e.copy_[t]=ay(r,e)):r},has(e,t){return t in uo(e)},ownKeys(e){return Reflect.ownKeys(uo(e))},set(e,t,n){const r=oI(uo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ng(uo(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(l9(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=uo(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 Kc(e.base_)},setPrototypeOf(){Vr(12)}},Hc={};Vf(C0,(e,t)=>{Hc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Hc.deleteProperty=function(e,t){return Hc.set.call(this,e,t,void 0)};Hc.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?uo(n):e)[t]}function p9(e,t,n){var i;const r=oI(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function oI(e,t){if(!(t in e))return;let n=Kc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Kc(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 h9=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(Bo(t)){const a=jS(this),l=ay(t,void 0);let s=!0;try{i=n(l),s=!1}finally{s?ny(a):ry(a)}return wS(a,r),SS(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===nI&&(i=void 0),this.autoFreeze_&&k0(i,!0),r){const a=[],l=[];Fo("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){Bo(e)||Vr(8),Ql(e)&&(e=m9(e));const t=jS(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 wS(r,t),SS(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=Fo("Patches").applyPatches_;return Ql(e)?r(e,t):this.produce(e,i=>r(i,t))}};function ay(e,t){const n=xu(e)?Fo("MapSet").proxyMap_(e,t):Sh(e)?Fo("MapSet").proxySet_(e,t):f9(e,t);return(t?t.scope_:aI()).drafts_.push(n),n}function m9(e){return Ql(e)||Vr(10,e),lI(e)}function lI(e){if(!Bo(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)=>{iI(n,i,lI(a))},r),t&&(t.finalized_=!1),n}var g9=new h9;g9.produce;var v9={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},sI=$n({name:"legend",initialState:v9,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:kt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Nr(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:kt()},removeLegendPayload:{reducer(e,t){var n=Nr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:kt()}}}),{setLegendSize:CS,setLegendSettings:y9,addLegendPayload:cI,replaceLegendPayload:uI,removeLegendPayload:dI}=sI.actions,x9=sI.reducer,b9={};/**
|
|
447
|
-
* @license React
|
|
448
|
-
* use-sync-external-store-with-selector.production.js
|
|
449
|
-
*
|
|
450
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
451
|
-
*
|
|
452
|
-
* This source code is licensed under the MIT license found in the
|
|
453
|
-
* LICENSE file in the root directory of this source tree.
|
|
454
|
-
*/var bu=h;function w9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var j9=typeof Object.is=="function"?Object.is:w9,S9=bu.useSyncExternalStore,k9=bu.useRef,C9=bu.useEffect,P9=bu.useMemo,E9=bu.useDebugValue;b9.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=k9(null);if(a.current===null){var l={hasValue:!1,value:null};a.current=l}else l=a.current;a=P9(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,j9(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=S9(e,a[0],a[1]);return C9(function(){l.hasValue=!0,l.value=s},[s]),E9(s),s};function T9(e){e()}function O9(){let e=null,t=null;return{clear(){e=null,t=null},notify(){T9(()=>{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 PS={notify(){},get:()=>[]};function A9(e,t){let n,r=PS,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=O9())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=PS)}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 I9=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",N9=I9(),_9=()=>typeof navigator<"u"&&navigator.product==="ReactNative",M9=_9(),R9=()=>N9||M9?h.useLayoutEffect:h.useEffect,D9=R9();function ES(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function L9(e,t){if(ES(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])||!ES(e[n[i]],t[n[i]]))return!1;return!0}var ig=Symbol.for("react-redux-context"),ag=typeof globalThis<"u"?globalThis:{};function z9(){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 $9=z9();function B9(e){const{children:t,context:n,serverState:r,store:i}=e,a=h.useMemo(()=>{const c=A9(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),l=h.useMemo(()=>i.getState(),[i]);D9(()=>{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||$9;return h.createElement(s.Provider,{value:a},t)}var F9=B9,U9=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function W9(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Go(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(U9.has(r)){if(e[r]==null&&t[r]==null)continue;if(!L9(e[r],t[r]))return!1}else if(!W9(e[r],t[r]))return!1;return!0}var K9=["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 TS(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?TS(Object(n),!0).forEach(function(r){q9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q9(e,t,n){return(t=H9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H9(e){var t=V9(e,"string");return typeof t=="symbol"?t:t+""}function V9(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 Y9(e,t){if(e==null)return{};var n,r,i=G9(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 G9(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 X9(e){return e.value}function Q9(e){var{contextPayload:t}=e,n=Y9(e,K9),r=ZO(t,e.payloadUniqBy,X9),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(jF,i)}function J9(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 Z9(e){var t=pt();return h.useEffect(()=>{t(y9(e))},[t,e]),null}function eH(e){var t=pt();return h.useEffect(()=>(t(CS(e)),()=>{t(CS({width:0,height:0}))}),[t,e]),null}function tH(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var nH={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function rH(e){var t=Xt(e,nH),n=dK(),r=l5(),i=i9(),{width:a,height:l,wrapperStyle:s,portal:c}=t,[u,f]=dA([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=tH(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"},J9(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(Z9,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&h.createElement(eH,{width:u.width,height:u.height}),h.createElement(Q9,oy({},t,g,{margin:i,chartWidth:d,chartHeight:p,contextPayload:n})));return Wp.createPortal(v,x)}var Qs=h.memo(rH,Go);Qs.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 OS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ms(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OS(Object(n),!0).forEach(function(r){iH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iH(e,t,n){return(t=aH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aH(e){var t=oH(e,"string");return typeof t=="symbol"?t:t+""}function oH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lH(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 sH(e,t){return t==null?e:lh(e,t)}var cH=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 k={padding:0,margin:0},S=sH(a,s),E=S.map((I,D)=>{if(!I||I.type==="none")return null;var O=I.formatter||l||lH,{value:_,name:M}=I,G=_,q=M;if(O){var A=O(_,M,I,D,a);if(Array.isArray(A))[G,q]=A;else if(A!=null)G=A;else return null}var U=Ms(Ms({},ol.itemStyle),{},{color:I.color||ol.itemStyle.color},r);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:U},Si(q)?h.createElement("span",{className:"recharts-tooltip-item-name"},q):null,Si(q)?h.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,h.createElement("span",{className:"recharts-tooltip-item-value"},G),h.createElement("span",{className:"recharts-tooltip-item-unit"},I.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:k},E)}return null},g=Ms(Ms({},ol.contentStyle),n),y=Ms({margin:0},i),x=!Et(f),v=x?f:"",b=Ze("recharts-default-tooltip",c),w=Ze("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())},Rs="recharts-tooltip-wrapper",uH={visibility:"hidden"};function dH(e){var{coordinate:t,translateX:n,translateY:r}=e;return Ze(Rs,{["".concat(Rs,"-right")]:ve(n)&&t&&ve(t.x)&&n>=t.x,["".concat(Rs,"-left")]:ve(n)&&t&&ve(t.x)&&n<t.x,["".concat(Rs,"-bottom")]:ve(r)&&t&&ve(t.y)&&r>=t.y,["".concat(Rs,"-top")]:ve(r)&&t&&ve(t.y)&&r<t.y})}function AS(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 fH(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 pH(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=AS({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:s.width,viewBox:u,viewBoxDimension:u.width}),p=AS({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:s.height,viewBox:u,viewBoxDimension:u.height}),f=fH({translateX:d,translateY:p,useTranslate3d:c})):f=uH,{cssProperties:f,cssClasses:dH({translateX:d,translateY:p,coordinate:n})}}var hH=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),wu={isSsr:hH()};function fI(){var[e,t]=h.useState(()=>wu.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 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 ll(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){mH(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 mH(e,t,n){return(t=gH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gH(e){var t=vH(e,"string");return typeof t=="symbol"?t:t+""}function vH(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 yH(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function xH(e){var t,n,r,i,a,l,s=fI(),[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}=pH({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:yH({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 bH=h.memo(xH),pI=()=>{var e;return(e=we(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 NS(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 _S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NS(Object(n),!0).forEach(function(r){wH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NS(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)}var MS={curveBasisClosed:P5,curveBasisOpen:E5,curveBasis:C5,curveBumpX:d5,curveBumpY:f5,curveLinearClosed:T5,curveLinear:eh,curveMonotoneX:O5,curveMonotoneY:A5,curveNatural:I5,curveStep:N5,curveStepAfter:M5,curveStepBefore:_5},Xf=e=>Be(e.x)&&Be(e.y),RS=e=>e.base!=null&&Xf(e.base)&&Xf(e),Ds=e=>e.x,Ls=e=>e.y,kH=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(fu(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=MS["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return MS[n]||eh},DS={connectNulls:!1,type:"linear"},CH=e=>{var{type:t=DS.type,points:n=[],baseLine:r,layout:i,connectNulls:a=DS.connectNulls}=e,l=kH(t,i),s=a?n.filter(Xf):n;if(Array.isArray(r)){var c,u=n.map((g,y)=>_S(_S({},g),{},{base:r[y]}));i==="vertical"?c=pd().y(Ls).x1(Ds).x0(g=>g.base.x):c=pd().x(Ds).y1(Ls).y0(g=>g.base.y);var f=c.defined(RS).curve(l),d=a?u.filter(RS):u;return f(d)}var p;i==="vertical"&&ve(r)?p=pd().y(Ls).x1(Ds).x0(r):ve(r)?p=pd().x(Ds).y1(Ls).y0(r):p=dO().x(Ds).y(Ls);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?CH(l):r;return h.createElement("path",sy({},qn(e),t0(e),{className:Ze("recharts-curve",t),d:s===null?void 0:s,ref:i}))},PH=["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 LS(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 EH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LS(Object(n),!0).forEach(function(r){TH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TH(e,t,n){return(t=OH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OH(e){var t=AH(e,"string");return typeof t=="symbol"?t:t+""}function AH(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 IH(e,t){if(e==null)return{};var n,r,i=NH(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 NH(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),MH=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:s}=e,c=IH(e,PH),u=EH({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:Ze("recharts-cross",s),d:_H(t,n,a,l,r,i)}))};function RH(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 zS(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 $S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zS(Object(n),!0).forEach(function(r){DH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DH(e,t,n){return(t=LH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LH(e){var t=zH(e,"string");return typeof t=="symbol"?t:t+""}function zH(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 $H=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),hI=(e,t,n)=>e.map(r=>"".concat($H(r)," ").concat(t,"ms ").concat(n)).join(","),BH=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Vc=(e,t)=>Object.keys(t).reduce((n,r)=>$S($S({},n),{},{[r]:e(r,t[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 ln(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){FH(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 FH(e,t,n){return(t=UH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UH(e){var t=WH(e,"string");return typeof t=="symbol"?t:t+""}function WH(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},mI=(e,t,n)=>{var r=Vc((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?Vc((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):mI(e,r,n-1)};function KH(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=()=>Vc((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=mI(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=Vc((y,x)=>Qf(...x,n(p)),c);if(a(ln(ln(ln({},e),t),m)),p<1)s=l.setTimeout(f);else{var g=Vc((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 HH=(e,t,n,r,i,a)=>{var l=BH(e,t);return n==null?()=>(i(ln(ln({},e),t)),()=>{}):n.isStepper===!0?KH(e,t,n,l,i,a):qH(e,t,n,r,l,i,a)};var Jf=1e-4,gI=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],vI=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),FS=(e,t)=>n=>{var r=gI(e,t);return vI(r,n)},VH=(e,t)=>n=>{var r=gI(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return vI(i,n)},YH=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]]},GH=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=YH(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},XH=(e,t,n,r)=>{var i=FS(e,n),a=FS(t,r),l=VH(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},US=function(){return XH(...GH(...arguments))},QH=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},JH=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return US(e);case"spring":return QH();default:if(e.split("(")[0]==="cubic-bezier")return US(e)}return typeof e=="function"?e:null};function ZH(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 e7{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 t7(){return ZH(new e7)}var n7=h.createContext(t7);function r7(e,t){var n=h.useContext(n7);return h.useMemo(()=>t??n(e),[e,t,n])}var i7={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},WS={t:0},og={t:1};function ds(e){var t=Xt(e,i7),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:s,onAnimationStart:c,children:u}=t,f=fI(),d=n==="auto"?!wu.isSsr&&!f:n,p=r7(t.animationId,t.animationManager),[m,g]=h.useState(d?WS:og),y=h.useRef(null);return h.useEffect(()=>{d||g(og)},[d]),h.useEffect(()=>{if(!d||!r)return qa;var x=HH(WS,og,JH(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(Bc(t)),r=h.useRef(e);return r.current!==e&&(n.current=Bc(t),r.current=e),n.current}var a7=["radius"],o7=["radius"],KS,qS,HS,VS,YS,GS,XS,QS,JS,ZS;function ek(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 tk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ek(Object(n),!0).forEach(function(r){l7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ek(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l7(e,t,n){return(t=s7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s7(e){var t=c7(e,"string");return typeof t=="symbol"?t:t+""}function c7(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 nk(e,t){if(e==null)return{};var n,r,i=u7(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 u7(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 rk=(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=Ut(KS||(KS=li(["M",",",""])),e,t+c*p[0]),p[0]>0&&(d+=Ut(qS||(qS=li(["A ",",",",0,0,",",",",",""])),p[0],p[0],f,e+u*p[0],t)),d+=Ut(HS||(HS=li(["L ",",",""])),e+n-u*p[1],t),p[1]>0&&(d+=Ut(VS||(VS=li(["A ",",",",0,0,",`,
|
|
455
|
-
`,",",""])),p[1],p[1],f,e+n,t+c*p[1])),d+=Ut(YS||(YS=li(["L ",",",""])),e+n,t+r-c*p[2]),p[2]>0&&(d+=Ut(GS||(GS=li(["A ",",",",0,0,",`,
|
|
456
|
-
`,",",""])),p[2],p[2],f,e+n-u*p[2],t+r)),d+=Ut(XS||(XS=li(["L ",",",""])),e+u*p[3],t+r),p[3]>0&&(d+=Ut(QS||(QS=li(["A ",",",",0,0,",`,
|
|
457
|
-
`,",",""])),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=Ut(JS||(JS=li(["M ",",",`
|
|
458
|
-
A `,",",",0,0,",",",",",`
|
|
459
|
-
L `,",",`
|
|
460
|
-
A `,",",",0,0,",",",",",`
|
|
461
|
-
L `,",",`
|
|
462
|
-
A `,",",",0,0,",",",",",`
|
|
463
|
-
L `,",",`
|
|
464
|
-
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=Ut(ZS||(ZS=li(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},ik={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yI=e=>{var t=Xt(e,ik),n=h.useRef(null),[r,i]=h.useState(-1);h.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var K=n.current.getTotalLength();K&&i(K)}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]),k=fs(j,"rectangle-");if(a!==+a||l!==+l||s!==+s||c!==+c||s===0||c===0)return null;var S=Ze("recharts-rectangle",f);if(!y){var E=Ln(t),{radius:I}=E,D=nk(E,a7);return h.createElement("path",Zf({},D,{x:ja(a),y:ja(l),width:ja(s),height:ja(c),radius:typeof u=="number"?u:void 0,className:S,d:rk(a,l,s,c,u)}))}var O=x.current,_=v.current,M=b.current,G=w.current,q="0px ".concat(r===-1?1:r,"px"),A="".concat(r,"px ").concat(r,"px"),U=hI(["strokeDasharray"],p,typeof d=="string"?d:ik.animationEasing);return h.createElement(ds,{animationId:k,key:k,canBegin:r>0,duration:p,easing:d,isActive:y,begin:m},K=>{var T=ot(O,s,K),z=ot(_,c,K),P=ot(M,a,K),$=ot(G,l,K);n.current&&(x.current=T,v.current=z,b.current=P,w.current=$);var ee;g?K>0?ee={transition:U,strokeDasharray:A}:ee={strokeDasharray:q}:ee={strokeDasharray:A};var N=Ln(t),{radius:le}=N,me=nk(N,o7);return h.createElement("path",Zf({},me,{radius:typeof u=="number"?u:void 0,className:S,d:rk(P,$,T,z,u),ref:n,style:tk(tk({},ee),t.style)}))})};function ak(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 ok(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ak(Object(n),!0).forEach(function(r){d7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ak(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d7(e,t,n){return(t=f7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f7(e){var t=p7(e,"string");return typeof t=="symbol"?t:t+""}function p7(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,h7=e=>e*180/Math.PI,tn=(e,t,n,r)=>({x:e+Math.cos(-ep*r)*n,y:t+Math.sin(-ep*r)*n}),xI=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},m7=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},g7=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=m7({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:h7(c),angleInRadian:c}},v7=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}},y7=(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},x7=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=g7({x:n,y:r},t),{innerRadius:l,outerRadius:s}=t;if(i<l||i>s||i===0)return null;var{startAngle:c,endAngle:u}=v7(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?ok(ok({},t),{},{radius:i,angle:y7(f,t)}):null};function bI(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 lk,sk,ck,uk,dk,fk,pk;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 xo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var b7=(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}},wI=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,s=b7(a,l),c=a+s,u=tn(t,n,i,a),f=tn(t,n,i,c),d=Ut(lk||(lk=xo(["M ",",",`
|
|
465
|
-
A `,",",`,0,
|
|
466
|
-
`,",",`,
|
|
467
|
-
`,",",`
|
|
468
|
-
`])),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+=Ut(sk||(sk=xo(["L ",",",`
|
|
469
|
-
A `,",",`,0,
|
|
470
|
-
`,",",`,
|
|
471
|
-
`,","," Z"])),m.x,m.y,r,r,+(Math.abs(s)>180),+(a<=c),p.x,p.y)}else d+=Ut(ck||(ck=xo(["L ",","," Z"])),t,n);return d},w7=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?Ut(uk||(uk=xo(["M ",",",`
|
|
472
|
-
a`,",",",0,0,1,",`,0
|
|
473
|
-
a`,",",",0,0,1,",`,0
|
|
474
|
-
`])),p.x,p.y,a,a,a*2,a,a,-a*2):wI({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var b=Ut(dk||(dk=xo(["M ",",",`
|
|
475
|
-
A`,",",",0,0,",",",",",`
|
|
476
|
-
A`,",",",0,",",",",",",",`
|
|
477
|
-
A`,",",",0,0,",",",",",`
|
|
478
|
-
`])),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:k}=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}),D=s?Math.abs(c-u):Math.abs(c-u)-k-I;if(D<0&&a===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=Ut(fk||(fk=xo(["L",",",`
|
|
479
|
-
A`,",",",0,0,",",",",",`
|
|
480
|
-
A`,",",",0,",",",",",",",`
|
|
481
|
-
A`,",",",0,0,",",",",","Z"])),E.x,E.y,a,a,+(f<0),S.x,S.y,r,r,+(D>180),+(f>0),w.x,w.y,a,a,+(f<0),j.x,j.y)}else b+=Ut(pk||(pk=xo(["L",",","Z"])),t,n);return b},j7={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},jI=e=>{var t=Xt(e,j7),{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=Ze("recharts-sector",d),m=a-i,g=Rn(l,m,0,!0),y;return g>0&&Math.abs(u-f)<360?y=w7({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,m/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:f}):y=wI({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f}),h.createElement("path",dy({},Ln(t),{className:p,d:y}))};function S7(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(OO(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 bI(t)}}var SI={},kI={},CI={};const k7=d0;function C7(e){return k7.isSymbol(e)?NaN:Number(e)}CI.toNumber=C7;const P7=CI;function E7(e){return e?(e=P7.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}kI.toFinite=E7;const lg=kI,T7=u0;function O7(e,t,n){n&&typeof n!="number"&&T7.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}SI.range=O7;var A7=SI.range;const PI=zr(A7);var ni=e=>e.chartData,ju=H([ni],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Su=(e,t,n,r)=>r?ju(e):ni(e),EI=(e,t,n)=>n?ju(e):ni(e),I7=H([Su],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),N7=H([ju],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),_7=H([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(Be(t)&&Be(n))return!0}return!1}function hk(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function TI(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Be(n))i=n;else if(typeof n=="function")return;if(Be(r))a=r;else if(typeof r=="function")return;var l=[i,a];if(bi(l))return l}}function M7(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(bi(r))return hk(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"&&pS.test(i)){var c=pS.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"&&hS.test(a)){var f=hS.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:hk(p,t,n)}}}var ps=1e9,R7={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},E0,At=!0,Lr="[DecimalError] ",Eo=Lr+"Invalid argument: ",P0=Lr+"Exponent out of range: ",hs=Math.floor,fo=Math.pow,D7=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ur,mn=1e7,Ct=7,OI=9007199254740991,tp=hs(OI/Ct),je={};je.absoluteValue=je.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};je.comparedTo=je.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};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Ct;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};je.dividedBy=je.div=function(e){return Ui(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,n=t.constructor;return gt(Ui(t,new n(e),0,1),n.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return nn(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.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):(At=!1,t=Ui(Yc(n,a),Yc(e,a),a),At=!0,gt(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?NI(t,e):AI(t,(e.s=-e.s,e))};je.modulo=je.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?(At=!1,t=Ui(n,e,0,1).times(e),At=!0,n.minus(t)):gt(new r(n),i)};je.naturalExponential=je.exp=function(){return II(this)};je.naturalLogarithm=je.ln=function(){return Yc(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?AI(t,e):NI(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Eo+e);if(t=nn(i)+1,r=i.d.length-1,n=r*Ct+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};je.squareRoot=je.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),At=!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(gt(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if(t!="9999")break;l+=4}return At=!0,gt(r,n)};je.times=je.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,At?gt(e,d.precision):e};je.toDecimalPlaces=je.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),gt(n,e+nn(n)+1,t))};je.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Uo(r,!0):(Ci(e,0,ps),t===void 0?t=i.rounding:Ci(t,0,8),r=gt(new i(r),e+1,t),n=Uo(r,!0,e+1)),n};je.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Uo(i):(Ci(e,0,ps),t===void 0?t=a.rounding:Ci(t,0,8),r=gt(new a(i),e+nn(i)+1,t),n=Uo(r.abs(),!1,e+nn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return gt(new t(e),nn(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.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 gt(s,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=s.s,l){if((n=f<0?-f:f)<=OI){for(i=new c(ur),t=Math.ceil(r/Ct+4),At=!1;n%2&&(i=i.times(s),gk(i.d,t)),n=hs(n/2),n!==0;)s=s.times(s),gk(s.d,t);return At=!0,e.s<0?new c(ur).div(i):gt(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,At=!1,i=e.times(Yc(s,r+u)),At=!0,i=II(i),i.s=a,i};je.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=nn(i),r=Uo(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ci(e,1,ps),t===void 0?t=a.rounding:Ci(t,0,8),i=gt(new a(i),e,t),n=nn(i),r=Uo(i,e<=n||n<=a.toExpNeg,e)),r};je.toSignificantDigits=je.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)),gt(new r(n),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=nn(e),n=e.constructor;return Uo(e,t<=n.toExpNeg||t>=n.toExpPos)};function AI(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)),At?gt(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/Ct),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,At?gt(t,d):t}function Ci(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Eo+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=Ct-r.length,n&&(a+=ha(n)),a+=r;l=e[t],r=l+"",n=Ct-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,k,S,E,I,D=r.constructor,O=r.s==i.s?1:-1,_=r.d,M=i.d;if(!r.s)return new D(r);if(!i.s)throw Error(Lr+"Division by zero");for(c=r.e-i.e,E=M.length,k=_.length,m=new D(O),g=m.d=[],u=0;M[u]==(_[u]||0);)++u;if(M[u]>(_[u]||0)&&--c,a==null?b=a=D.precision:l?b=a+(nn(r)-nn(i))+1:b=a,b<0)return new D(0);if(b=b/Ct+2|0,u=0,E==1)for(f=0,M=M[0],b++;(u<k||f)&&b--;u++)w=f*mn+(_[u]||0),g[u]=w/M|0,f=w%M|0;else{for(f=mn/(M[0]+1)|0,f>1&&(M=e(M,f),_=e(_,f),E=M.length,k=_.length),j=E,y=_.slice(0,E),x=y.length;x<E;)y[x++]=0;I=M.slice(),I.unshift(0),S=M[0],M[1]>=mn/2&&++S;do f=0,s=t(M,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(M,f),p=d.length,x=y.length,s=t(d,y,p,x),s==1&&(f--,n(d,E<p?I:M,p))):(f==0&&(s=f=1),d=M.slice()),p=d.length,p<x&&d.unshift(0),n(y,d,x),s==-1&&(x=y.length,s=t(M,y,E,x),s<1&&(f++,n(y,E<x?I:M,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++<k||y[0]!==void 0)&&b--)}return g[0]||g.shift(),m.e=c,gt(m,l?a+nn(m)+1:a)}}();function II(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(At=!1,s=d,l=new f(.03125);e.abs().gte(.1);)e=e.times(l),u+=5;for(r=Math.log(fo(2,u))/Math.LN10*2+5|0,s+=r,n=i=a=new f(ur),f.precision=s;;){if(i=gt(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=gt(a.times(a),s);return f.precision=d,t==null?(At=!0,gt(a,d)):a}a=l}}function nn(e){for(var t=e.e*Ct,n=e.d[0];n>=10;n/=10)t++;return t}function sg(e,t,n){if(t>e.LN10.sd())throw At=!0,n&&(e.precision=n),Error(Lr+"LN10 precision limit exceeded");return gt(new e(e.LN10),t)}function ha(e){for(var t="";e--;)t+="0";return t}function Yc(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?(At=!1,u=x):u=t,m.eq(10))return t==null&&(At=!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=Yc(new y(r+"."+n.slice(1)),u-p).plus(c),y.precision=x,t==null?(At=!0,gt(m,x)):m;for(s=l=m=Ui(m.minus(ur),m.plus(ur),u),f=gt(m.times(m),u),i=3;;){if(l=gt(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?(At=!0,gt(s,x)):s;s=c,i+=2}}function mk(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/Ct),e.d=[],r=(n+1)%Ct,n<0&&(r+=Ct),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Ct;r<i;)e.d.push(+t.slice(r,r+=Ct));t=t.slice(r),r=Ct-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),At&&(e.e>tp||e.e<-tp))throw Error(P0+n)}else e.s=0,e.e=0,e.d=[0];return e}function gt(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+=Ct,i=t,u=d[f=0];else{if(f=Math.ceil((r+1)/Ct),a=d.length,f>=a)return e;for(u=a=d[f],l=1;a>=10;a/=10)l++;r%=Ct,i=r-Ct+l}if(n!==void 0&&(a=fo(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/fo(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]=fo(10,(Ct-t%Ct)%Ct),e.e=hs(-t/Ct)||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=fo(10,Ct-r),d[f]=i>0?(u/fo(10,l-i)%fo(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(At&&(e.e>tp||e.e<-tp))throw Error(P0+nn(e));return e}function NI(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),At?gt(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/Ct),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,At?gt(t,m):t):new p(0)}function Uo(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 gk(e,t){if(e.length>t)return e.length=t,!0}function _I(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(Eo+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 mk(l,a.toString())}else if(typeof a!="string")throw Error(Eo+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,D7.test(a))mk(l,a);else throw Error(Eo+a)}if(i.prototype=je,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=_I,i.config=i.set=L7,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 L7(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(Eo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Eo+n+": "+r);return this}var E0=_I(R7);ur=new E0(1);const Ve=E0;function MI(e){var t;return e===0?t=1:t=Math.floor(new Ve(e).abs().log(10).toNumber())+1,t}function RI(e,t,n){for(var r=new Ve(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var DI=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 Ve(0);var r=MI(e.toNumber()),i=new Ve(10).pow(r),a=e.div(i),l=r!==1?.05:.1,s=new Ve(Math.ceil(a.div(l).toNumber())).add(n).mul(l),c=s.mul(i);return t?new Ve(c.toNumber()):new Ve(Math.ceil(c.toNumber()))},LI=(e,t,n)=>{var r;if(e.lte(0))return new Ve(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new Ve(a).abs().log(10).toNumber()),s=new Ve(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 Ve(10).pow(f))}var d=(r=i[u])!==null&&r!==void 0?r:1,p=new Ve(d).mul(s);return t?p:new Ve(Math.ceil(p.toNumber()))},z7=(e,t,n)=>{var r=new Ve(1),i=new Ve(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Ve(10).pow(MI(e)-1),i=new Ve(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Ve(Math.floor(e)))}else e===0?i=new Ve(Math.floor((t-1)/2)):n||(i=new Ve(Math.floor(e)));for(var l=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new Ve(c-l).mul(r)).toNumber());return s},zI=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 Ve(0),tickMin:new Ve(0),tickMax:new Ve(0)};var s=l(new Ve(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new Ve(0):(c=new Ve(t).add(n).div(2),c=c.sub(new Ve(c).mod(s)));var u=Math.ceil(c.sub(t).div(s).toNumber()),f=Math.ceil(new Ve(n).sub(c).div(s).toNumber()),d=u+f+1;return d>r?zI(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 Ve(u).mul(s)),tickMax:c.add(new Ve(f).mul(s))})},vk=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]=DI([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 z7(c,i,a);var d=l==="snap125"?LI:T0,{step:p,tickMin:m,tickMax:g}=zI(c,u,s,a,0,d),y=RI(m,g.add(new Ve(.1).mul(p)),p);return n>r?y.reverse():y},yk=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]=DI([r,i]);if(s===-1/0||c===1/0)return[r,i];if(s===c)return[s];var u=l==="snap125"?LI:T0,f=Math.max(n,2),d=u(new Ve(c).sub(s).div(f-1),a,0),p=[...RI(new Ve(s),new Ve(c),d),c];return a===!1&&(p=p.map(m=>Math.round(m))),r>i?p.reverse():p},$I=e=>e.rootProps.maxBarSize,$7=e=>e.rootProps.barGap,BI=e=>e.rootProps.barCategoryGap,B7=e=>e.rootProps.barSize,ku=e=>e.rootProps.stackOffset,FI=e=>e.rootProps.reverseStackOrder,O0=e=>e.options.chartName,A0=e=>e.rootProps.syncId,UI=e=>e.rootProps.syncMethod,I0=e=>e.options.eventEmitter,F7=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},ro={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 xk(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?xk(Object(n),!0).forEach(function(r){U7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function U7(e,t,n){return(t=W7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W7(e){var t=K7(e,"string");return typeof t=="symbol"?t:t+""}function K7(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 bk={allowDataOverflow:ro.allowDataOverflow,allowDecimals:ro.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:ro.angleAxisId,includeHidden:!1,name:void 0,reversed:ro.reversed,scale:ro.scale,tick:ro.tick,tickCount:void 0,ticks:void 0,type:ro.type,unit:void 0,niceTicks:"auto"},wk={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=H([q7,tI],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ph(t,"angleAxis",bk.type))!==null&&n!==void 0?n:"category";return np(np({},bk),{},{type:r})}),H7=(e,t)=>e.polarAxis.radiusAxis[t],_0=H([H7,tI],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ph(t,"radiusAxis",wk.type))!==null&&n!==void 0?n:"category";return np(np({},wk),{},{type:r})}),Eh=e=>e.polarOptions,M0=H([ta,na,cn],xI),WI=H([Eh,M0],(e,t)=>{if(e!=null)return Rn(e.innerRadius,t,0)}),KI=H([Eh,M0],(e,t)=>{if(e!=null)return Rn(e.outerRadius,t,t*.8)}),V7=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},qI=H([Eh],V7);H([N0,qI],Ch);var HI=H([M0,WI,KI],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});H([_0,HI],Ch);var VI=H([Ye,Eh,WI,KI,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,Cu=(e,t,n)=>n;function Th(e){return e==null?void 0:e.id}function YI(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(nt(d,a,null)),g=nt(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 Y7(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=Ye(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 GI=(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];Be(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 G7(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===G7?e:X7,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 X7(){return 0}function XI(e){return e===null?NaN:+e}function*Q7(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const J7=D0(Na),Pu=J7.right;D0(XI).center;class jk extends Map{constructor(t,n=tV){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(Sk(this,t))}has(t){return super.has(Sk(this,t))}set(t,n){return super.set(Z7(this,t),n)}delete(t){return super.delete(eV(this,t))}}function Sk({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Z7({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function eV({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function tV(e){return e!==null&&typeof e=="object"?e.valueOf():e}function nV(e=Na){if(e===Na)return QI;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 QI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const rV=Math.sqrt(50),iV=Math.sqrt(10),aV=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>=rV?10:a>=iV?5:a>=aV?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 kk(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Ck(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function JI(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?QI:nV(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));JI(e,t,m,g,i)}const a=e[t];let l=n,s=r;for(zs(e,n,t),i(e[r],a)>0&&zs(e,n,r);l<s;){for(zs(e,l,s),++l,--s;i(e[l],a)<0;)++l;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?zs(e,n,s):(++s,zs(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function zs(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function oV(e,t,n){if(e=Float64Array.from(Q7(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Ck(e);if(t>=1)return kk(e);var r,i=(r-1)*t,a=Math.floor(i),l=kk(JI(e,a).subarray(0,a+1)),s=Ck(e.subarray(a+1));return l+(s-l)*(i-a)}}function lV(e,t,n=XI){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 sV(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 jk,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 jk;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=sV(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 ZI(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return ZI(t())},e}function cV(){return ZI(z0.apply(null,arguments).paddingInner(1))}function $0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function eN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Eu(){}var Gc=.7,ip=1/Gc,zl="\\s*([+-]?\\d+)\\s*",Xc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uV=/^#([0-9a-f]{3,8})$/,dV=new RegExp(`^rgb\\(${zl},${zl},${zl}\\)$`),fV=new RegExp(`^rgb\\(${wi},${wi},${wi}\\)$`),pV=new RegExp(`^rgba\\(${zl},${zl},${zl},${Xc}\\)$`),hV=new RegExp(`^rgba\\(${wi},${wi},${wi},${Xc}\\)$`),mV=new RegExp(`^hsl\\(${Xc},${wi},${wi}\\)$`),gV=new RegExp(`^hsla\\(${Xc},${wi},${wi},${Xc}\\)$`),Pk={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(Eu,Qc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ek,formatHex:Ek,formatHex8:vV,formatHsl:yV,formatRgb:Tk,toString:Tk});function Ek(){return this.rgb().formatHex()}function vV(){return this.rgb().formatHex8()}function yV(){return tN(this).formatHsl()}function Tk(){return this.rgb().formatRgb()}function Qc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=uV.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ok(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=dV.exec(e))?new nr(t[1],t[2],t[3],1):(t=fV.exec(e))?new nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pV.exec(e))?kd(t[1],t[2],t[3],t[4]):(t=hV.exec(e))?kd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mV.exec(e))?Nk(t[1],t[2]/100,t[3]/100,1):(t=gV.exec(e))?Nk(t[1],t[2]/100,t[3]/100,t[4]):Pk.hasOwnProperty(e)?Ok(Pk[e]):e==="transparent"?new nr(NaN,NaN,NaN,0):null}function Ok(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 xV(e){return e instanceof Eu||(e=Qc(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?xV(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,eN(Eu,{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?Gc:Math.pow(Gc,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nr(To(this.r),To(this.g),To(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:Ak,formatHex:Ak,formatHex8:bV,formatRgb:Ik,toString:Ik}));function Ak(){return`#${bo(this.r)}${bo(this.g)}${bo(this.b)}`}function bV(){return`#${bo(this.r)}${bo(this.g)}${bo(this.b)}${bo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ik(){const e=ap(this.opacity);return`${e===1?"rgb(":"rgba("}${To(this.r)}, ${To(this.g)}, ${To(this.b)}${e===1?")":`, ${e})`}`}function ap(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function To(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bo(e){return e=To(e),(e<16?"0":"")+e.toString(16)}function Nk(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 tN(e){if(e instanceof Yr)return new Yr(e.h,e.s,e.l,e.opacity);if(e instanceof Eu||(e=Qc(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 wV(e,t,n,r){return arguments.length===1?tN(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,wV,eN(Eu,{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?Gc:Math.pow(Gc,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(_k(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("}${_k(this.h)}, ${Cd(this.s)*100}%, ${Cd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _k(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 jV(e,t){return function(n){return e+n*t}}function SV(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 kV(e){return(e=+e)==1?nN:function(t,n){return n-t?SV(t,n,e):B0(isNaN(t)?n:t)}}function nN(e,t){var n=t-e;return n?jV(e,n):B0(isNaN(e)?t:e)}const Mk=function e(t){var n=kV(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=nN(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 CV(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 PV(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function EV(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 TV(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 OV(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 AV(e){return function(){return e}}function IV(e){return function(t){return e(t)+""}}function NV(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]?IV(c[0].x):AV(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=Qc(t))?(t=r,Mk):NV:t instanceof Qc?Mk:t instanceof Date?TV:PV(t)?CV:Array.isArray(t)?EV:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?OV: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 MV(e){return function(){return e}}function lp(e){return+e}var Rk=[0,1];function Wn(e){return e}function yy(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:MV(isNaN(t)?NaN:.5)}function RV(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function DV(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 LV(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=Pu(e,s,1,r)-1;return a[c](i[c](s))}}function Tu(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Nh(){var e=Rk,t=Rk,n=gs,r,i,a,l=Wn,s,c,u;function f(){var p=Math.min(e.length,t.length);return l!==Wn&&(l=RV(e[0],e[p-1])),s=p>2?LV:DV,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 zV(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 $V(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 BV(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var FV=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jc(e){if(!(t=FV.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]})}Jc.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 UV(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 WV(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 Dk(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 Lk={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:zV,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)=>Dk(e*100,t),r:Dk,s:WV,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function zk(e){return e}var $k=Array.prototype.map,Bk=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function KV(e){var t=e.grouping===void 0||e.thousands===void 0?zk:$V($k.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?zk:BV($k.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=Jc(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,k=d.trim,S=d.type;S==="n"?(w=!0,S="g"):Lk[S]||(j===void 0&&(j=12),k=!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:""),D=Lk[S],O=/[defgprs%]/.test(S);j=j===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function _(M){var G=E,q=I,A,U,K;if(S==="c")q=D(M)+q,M="";else{M=+M;var T=M<0||1/M<0;if(M=isNaN(M)?c:D(Math.abs(M),j),k&&(M=UV(M)),T&&+M==0&&y!=="+"&&(T=!1),G=(T?y==="("?y:s:y==="-"||y==="("?"":y)+G,q=(S==="s"&&!isNaN(M)&&cp!==void 0?Bk[8+cp/3]:"")+q+(T&&y==="("?")":""),O){for(A=-1,U=M.length;++A<U;)if(K=M.charCodeAt(A),48>K||K>57){q=(K===46?i+M.slice(A+1):M.slice(A))+q,M=M.slice(0,A);break}}}w&&!v&&(M=t(M,1/0));var z=G.length+M.length+q.length,P=z<b?new Array(b-z+1).join(m):"";switch(w&&v&&(M=t(P+M,P.length?b-q.length:1/0),P=""),g){case"<":M=G+M+q+P;break;case"=":M=G+P+M+q;break;case"^":M=P.slice(0,z=P.length>>1)+G+M+q+P.slice(z);break;default:M=P+G+M+q;break}return a(M)}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=Jc(d),d.type="f",d),{suffix:Bk[8+m/3]});return function(x){return y(g*x)}}return{format:u,formatPrefix:f}}var Pd,K0,rN;qV({thousands:",",grouping:[3],currency:["$",""]});function qV(e){return Pd=KV(e),K0=Pd.format,rN=Pd.formatPrefix,Pd}function HV(e){return Math.max(0,-Zl(Math.abs(e)))}function VV(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zl(t)/3)))*3-Zl(Math.abs(e)))}function YV(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Zl(t)-Zl(e))+1}function iN(e,t,n,r){var i=hy(e,t,n),a;switch(r=Jc(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=VV(i,l))&&(r.precision=a),rN(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=YV(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=HV(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 iN(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 aN(){var e=U0();return e.copy=function(){return Tu(e,aN())},$r.apply(e,arguments),Ya(e)}function oN(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 oN(e).unknown(t)},e=arguments.length?Array.from(e,lp):[0,1],Ya(n)}function lN(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 Fk(e){return Math.log(e)}function Uk(e){return Math.exp(e)}function GV(e){return-Math.log(-e)}function XV(e){return-Math.exp(-e)}function QV(e){return isFinite(e)?+("1e"+e):e<0?0:e}function JV(e){return e===10?QV:e===Math.E?Math.exp:t=>Math.pow(e,t)}function ZV(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 Wk(e){return(t,n)=>-e(-t,n)}function q0(e){const t=e(Fk,Uk),n=t.domain;let r=10,i,a;function l(){return i=ZV(r),a=JV(r),n()[0]<0?(i=Wk(i),a=Wk(a),e(GV,XV)):e(Fk,Uk),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=Jc(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(lN(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function sN(){const e=q0(Nh()).domain([1,10]);return e.copy=()=>Tu(e,sN()).base(e.base()),$r.apply(e,arguments),e}function Kk(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qk(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function H0(e){var t=1,n=e(Kk(t),qk(t));return n.constant=function(r){return arguments.length?e(Kk(t=+r),qk(t)):t},Ya(n)}function cN(){var e=H0(Nh());return e.copy=function(){return Tu(e,cN()).constant(e.constant())},$r.apply(e,arguments)}function Hk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function eY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function tY(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(eY,tY):e(Hk(n),Hk(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 Tu(e,Y0()).exponent(e.exponent())},$r.apply(e,arguments),e}function nY(){return Y0.apply(null,arguments).exponent(.5)}function Vk(e){return Math.sign(e)*e*e}function rY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function uN(){var e=U0(),t=[0,1],n=!1,r;function i(a){var l=rY(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(Vk(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(Vk)),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 uN(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},$r.apply(i,arguments),Ya(i)}function dN(){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]=lV(e,l/s);return a}function a(l){return l==null||isNaN(l=+l)?r:t[Pu(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 dN().domain(e).range(t).unknown(r)},$r.apply(a,arguments)}function fN(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(c){return c!=null&&c<=c?i[Pu(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 fN().domain([e,t]).range(i).unknown(a)},$r.apply(Ya(l),arguments)}function pN(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Pu(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 pN().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,Yk=Gi*30,pg=Gi*365,wo=un(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*$i)},(e,t)=>(t-e)/$i,e=>e.getUTCSeconds());wo.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 Ou=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);Ou.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 hN=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));hN.range;function Xo(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=Xo(0),dp=Xo(1),iY=Xo(2),aY=Xo(3),es=Xo(4),oY=Xo(5),lY=Xo(6);Mh.range;dp.range;iY.range;aY.range;es.range;oY.range;lY.range;function Qo(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=Qo(0),fp=Qo(1),sY=Qo(2),cY=Qo(3),ts=Qo(4),uY=Qo(5),dY=Qo(6);Rh.range;fp.range;sY.range;cY.range;ts.range;uY.range;dY.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 mN(e,t,n,r,i,a){const l=[[wo,1,$i],[wo,5,5*$i],[wo,15,15*$i],[wo,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,Yk],[t,3,3*Yk],[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[fY,pY]=mN(Qi,tb,Rh,hN,Z0,Q0),[hY,mY]=mN(Xi,eb,Mh,Ou,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 $s(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function gY(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=Bs(i),f=Fs(i),d=Bs(a),p=Fs(a),m=Bs(l),g=Fs(l),y=Bs(s),x=Fs(s),v=Bs(c),b=Fs(c),w={a:K,A:T,b:z,B:P,c:null,d:eC,e:eC,f:$Y,g:GY,G:QY,H:DY,I:LY,j:zY,L:gN,m:BY,M:FY,p:$,q:ee,Q:rC,s:iC,S:UY,u:WY,U:KY,V:qY,w:HY,W:VY,x:null,X:null,y:YY,Y:XY,Z:JY,"%":nC},j={a:N,A:le,b:me,B:X,c:null,d:tC,e:tC,f:nG,g:fG,G:hG,H:ZY,I:eG,j:tG,L:yN,m:rG,M:iG,p:ne,q:ue,Q:rC,s:iC,S:aG,u:oG,U:lG,V:sG,w:cG,W:uG,x:null,X:null,y:dG,Y:pG,Z:mG,"%":nC},k={a:O,A:_,b:M,B:G,c:q,d:Jk,e:Jk,f:NY,g:Qk,G:Xk,H:Zk,I:Zk,j:TY,L:IY,m:EY,M:OY,p:D,q:PY,Q:MY,s:RY,S:AY,u:wY,U:jY,V:SY,w:bY,W:kY,x:A,X:U,y:Qk,Y:Xk,Z:CY,"%":_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(Q,Z){return function(he){var te=[],Ee=-1,ke=0,_e=Q.length,ze,ge,Te;for(he instanceof Date||(he=new Date(+he));++Ee<_e;)Q.charCodeAt(Ee)===37&&(te.push(Q.slice(ke,Ee)),(ge=Gk[ze=Q.charAt(++Ee)])!=null?ze=Q.charAt(++Ee):ge=ze==="e"?" ":"0",(Te=Z[ze])&&(ze=Te(he,ge)),te.push(ze),ke=Ee+1);return te.push(Q.slice(ke,Ee)),te.join("")}}function E(Q,Z){return function(he){var te=$s(1900,void 0,1),Ee=I(te,Q,he+="",0),ke,_e;if(Ee!=he.length)return null;if("Q"in te)return new Date(te.Q);if("s"in te)return new Date(te.s*1e3+("L"in te?te.L:0));if(Z&&!("Z"in te)&&(te.Z=0),"p"in te&&(te.H=te.H%12+te.p*12),te.m===void 0&&(te.m="q"in te?te.q:0),"V"in te){if(te.V<1||te.V>53)return null;"w"in te||(te.w=1),"Z"in te?(ke=mg($s(te.y,0,1)),_e=ke.getUTCDay(),ke=_e>4||_e===0?fp.ceil(ke):fp(ke),ke=_h.offset(ke,(te.V-1)*7),te.y=ke.getUTCFullYear(),te.m=ke.getUTCMonth(),te.d=ke.getUTCDate()+(te.w+6)%7):(ke=hg($s(te.y,0,1)),_e=ke.getDay(),ke=_e>4||_e===0?dp.ceil(ke):dp(ke),ke=Ou.offset(ke,(te.V-1)*7),te.y=ke.getFullYear(),te.m=ke.getMonth(),te.d=ke.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),_e="Z"in te?mg($s(te.y,0,1)).getUTCDay():hg($s(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(_e+5)%7:te.w+te.U*7-(_e+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,mg(te)):hg(te)}}function I(Q,Z,he,te){for(var Ee=0,ke=Z.length,_e=he.length,ze,ge;Ee<ke;){if(te>=_e)return-1;if(ze=Z.charCodeAt(Ee++),ze===37){if(ze=Z.charAt(Ee++),ge=k[ze in Gk?Z.charAt(Ee++):ze],!ge||(te=ge(Q,he,te))<0)return-1}else if(ze!=he.charCodeAt(te++))return-1}return te}function D(Q,Z,he){var te=u.exec(Z.slice(he));return te?(Q.p=f.get(te[0].toLowerCase()),he+te[0].length):-1}function O(Q,Z,he){var te=m.exec(Z.slice(he));return te?(Q.w=g.get(te[0].toLowerCase()),he+te[0].length):-1}function _(Q,Z,he){var te=d.exec(Z.slice(he));return te?(Q.w=p.get(te[0].toLowerCase()),he+te[0].length):-1}function M(Q,Z,he){var te=v.exec(Z.slice(he));return te?(Q.m=b.get(te[0].toLowerCase()),he+te[0].length):-1}function G(Q,Z,he){var te=y.exec(Z.slice(he));return te?(Q.m=x.get(te[0].toLowerCase()),he+te[0].length):-1}function q(Q,Z,he){return I(Q,t,Z,he)}function A(Q,Z,he){return I(Q,n,Z,he)}function U(Q,Z,he){return I(Q,r,Z,he)}function K(Q){return l[Q.getDay()]}function T(Q){return a[Q.getDay()]}function z(Q){return c[Q.getMonth()]}function P(Q){return s[Q.getMonth()]}function $(Q){return i[+(Q.getHours()>=12)]}function ee(Q){return 1+~~(Q.getMonth()/3)}function N(Q){return l[Q.getUTCDay()]}function le(Q){return a[Q.getUTCDay()]}function me(Q){return c[Q.getUTCMonth()]}function X(Q){return s[Q.getUTCMonth()]}function ne(Q){return i[+(Q.getUTCHours()>=12)]}function ue(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var Z=S(Q+="",w);return Z.toString=function(){return Q},Z},parse:function(Q){var Z=E(Q+="",!1);return Z.toString=function(){return Q},Z},utcFormat:function(Q){var Z=S(Q+="",j);return Z.toString=function(){return Q},Z},utcParse:function(Q){var Z=E(Q+="",!0);return Z.toString=function(){return Q},Z}}}var Gk={"-":"",_:" ",0:"0"},wn=/^\s*\d+/,vY=/^%/,yY=/[\\^$*+?|[\]().{}]/g;function rt(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 xY(e){return e.replace(yY,"\\$&")}function Bs(e){return new RegExp("^(?:"+e.map(xY).join("|")+")","i")}function Fs(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function bY(e,t,n){var r=wn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function wY(e,t,n){var r=wn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function jY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function SY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Xk(e,t,n){var r=wn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Qk(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 CY(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 PY(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 EY(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 Jk(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function TY(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 Zk(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function OY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function AY(e,t,n){var r=wn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function IY(e,t,n){var r=wn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function NY(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=vY.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function MY(e,t,n){var r=wn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function RY(e,t,n){var r=wn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function eC(e,t){return rt(e.getDate(),t,2)}function DY(e,t){return rt(e.getHours(),t,2)}function LY(e,t){return rt(e.getHours()%12||12,t,2)}function zY(e,t){return rt(1+Ou.count(Xi(e),e),t,3)}function gN(e,t){return rt(e.getMilliseconds(),t,3)}function $Y(e,t){return gN(e,t)+"000"}function BY(e,t){return rt(e.getMonth()+1,t,2)}function FY(e,t){return rt(e.getMinutes(),t,2)}function UY(e,t){return rt(e.getSeconds(),t,2)}function WY(e){var t=e.getDay();return t===0?7:t}function KY(e,t){return rt(Mh.count(Xi(e)-1,e),t,2)}function vN(e){var t=e.getDay();return t>=4||t===0?es(e):es.ceil(e)}function qY(e,t){return e=vN(e),rt(es.count(Xi(e),e)+(Xi(e).getDay()===4),t,2)}function HY(e){return e.getDay()}function VY(e,t){return rt(dp.count(Xi(e)-1,e),t,2)}function YY(e,t){return rt(e.getFullYear()%100,t,2)}function GY(e,t){return e=vN(e),rt(e.getFullYear()%100,t,2)}function XY(e,t){return rt(e.getFullYear()%1e4,t,4)}function QY(e,t){var n=e.getDay();return e=n>=4||n===0?es(e):es.ceil(e),rt(e.getFullYear()%1e4,t,4)}function JY(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+rt(t/60|0,"0",2)+rt(t%60,"0",2)}function tC(e,t){return rt(e.getUTCDate(),t,2)}function ZY(e,t){return rt(e.getUTCHours(),t,2)}function eG(e,t){return rt(e.getUTCHours()%12||12,t,2)}function tG(e,t){return rt(1+_h.count(Qi(e),e),t,3)}function yN(e,t){return rt(e.getUTCMilliseconds(),t,3)}function nG(e,t){return yN(e,t)+"000"}function rG(e,t){return rt(e.getUTCMonth()+1,t,2)}function iG(e,t){return rt(e.getUTCMinutes(),t,2)}function aG(e,t){return rt(e.getUTCSeconds(),t,2)}function oG(e){var t=e.getUTCDay();return t===0?7:t}function lG(e,t){return rt(Rh.count(Qi(e)-1,e),t,2)}function xN(e){var t=e.getUTCDay();return t>=4||t===0?ts(e):ts.ceil(e)}function sG(e,t){return e=xN(e),rt(ts.count(Qi(e),e)+(Qi(e).getUTCDay()===4),t,2)}function cG(e){return e.getUTCDay()}function uG(e,t){return rt(fp.count(Qi(e)-1,e),t,2)}function dG(e,t){return rt(e.getUTCFullYear()%100,t,2)}function fG(e,t){return e=xN(e),rt(e.getUTCFullYear()%100,t,2)}function pG(e,t){return rt(e.getUTCFullYear()%1e4,t,4)}function hG(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ts(e):ts.ceil(e),rt(e.getUTCFullYear()%1e4,t,4)}function mG(){return"+0000"}function nC(){return"%"}function rC(e){return+e}function iC(e){return Math.floor(+e/1e3)}var sl,bN,wN;gG({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 gG(e){return sl=gY(e),bN=sl.format,sl.parse,wN=sl.utcFormat,sl.utcParse,sl}function vG(e){return new Date(e)}function yG(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 k(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,yG)):p().map(vG)},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?k: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(lN(E,S)):f},f.copy=function(){return Tu(f,nb(e,t,n,r,i,a,l,s,c,u))},f}function xG(){return $r.apply(nb(hY,mY,Xi,eb,Mh,Ou,J0,X0,wo,bN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function bG(){return $r.apply(nb(fY,pY,Qi,tb,Rh,_h,Z0,Q0,wo,wN).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 jN(){var e=Ya(Dh()(Wn));return e.copy=function(){return Ga(e,jN())},ra.apply(e,arguments)}function SN(){var e=q0(Dh()).domain([1,10]);return e.copy=function(){return Ga(e,SN()).base(e.base())},ra.apply(e,arguments)}function kN(){var e=H0(Dh());return e.copy=function(){return Ga(e,kN()).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 wG(){return rb.apply(null,arguments).exponent(.5)}function CN(){var e=[],t=Wn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Pu(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)=>oV(e,a/r))},n.copy=function(){return CN(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 PN(){var e=Ya(Lh()(Wn));return e.copy=function(){return Ga(e,PN())},ra.apply(e,arguments)}function EN(){var e=q0(Lh()).domain([.1,1,10]);return e.copy=function(){return Ga(e,EN()).base(e.base())},ra.apply(e,arguments)}function TN(){var e=H0(Lh());return e.copy=function(){return Ga(e,TN()).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 jG(){return ib.apply(null,arguments).exponent(.5)}const ON=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:z0,scaleDiverging:PN,scaleDivergingLog:EN,scaleDivergingPow:ib,scaleDivergingSqrt:jG,scaleDivergingSymlog:TN,scaleIdentity:oN,scaleImplicit:my,scaleLinear:aN,scaleLog:sN,scaleOrdinal:L0,scalePoint:cV,scalePow:Y0,scaleQuantile:dN,scaleQuantize:fN,scaleRadial:uN,scaleSequential:jN,scaleSequentialLog:SN,scaleSequentialPow:rb,scaleSequentialQuantile:CN,scaleSequentialSqrt:wG,scaleSequentialSymlog:kN,scaleSqrt:nY,scaleSymlog:cN,scaleThreshold:pN,scaleTime:xG,scaleUtc:bG,tickFormat:iN},Symbol.toStringTag,{value:"Module"}));function SG(e){var t=ON;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(fu(e));if(n in t&&typeof t[n]=="function")return t[n]()}function aC(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=SG(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"?aC(e.scale,n,r):aC(t,n,r)}function kG(e){return"scale".concat(fu(e))}function CG(e){return kG(e)in ON}var AN=(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 CG(r)?r:"point"}};function PG(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 IN(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=PG(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 EG(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):IN(e,void 0)}function oC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oC(Object(n),!0).forEach(function(r){TG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TG(e,t,n){return(t=OG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OG(e){var t=AG(e,"string");return typeof t=="symbol"?t:t+""}function AG(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"},NN=(e,t)=>e.cartesianAxis.xAxis[t],ia=(e,t)=>{var n=NN(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:vu},_N=(e,t)=>e.cartesianAxis.yAxis[t],aa=(e,t)=>{var n=_N(e,t);return n??an},IG={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??IG},Kt=(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))}},NG=(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))}},MN=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 Au=e=>e.graphicalItems.cartesianItems,_G=H([zt,Cu],lb),sb=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),ys=H([Au,Kt,_G],sb,{memoizeOptions:{resultEqualityCheck:Ih}}),RN=H([ys],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Oh)),DN=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),MG=H([ys],DN),cb=e=>e.map(t=>t.data).filter(Boolean).flat(1),RG=H([ys],e=>e.some(t=>!t.data)),LN=H([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=H([LN,Su],ub),zN=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:nt(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:nt(i,r)}))):e.map(r=>({value:r})),$N=(e,t,n,r,i,a)=>{var{chartData:l=[],dataStartIndex:s,dataEndIndex:c}=r,u=zN(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:nt(p,t.dataKey)})).filter(p=>p.value!=null);return[...d,...u]}return u},Iu=H([db,Kt,ys,Su,RG,LN],$N);function $l(e){if(Si(e)||e instanceof Date){var t=Number(e);if(Be(t))return t}}function lC(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 DG(e,t){var n=$l(e),r=$l(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var LG=H([Iu],e=>e==null?void 0:e.map(t=>t.value).sort(DG));function BN(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function zG(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=nt(e,a.dataKey),s,c;if(Array.isArray(l)?[s,c]=l:s=c=l,!(!Be(s)||!Be(c)))return[r-s,r+c]}))}var dn=e=>{var t=bn(e),n=ms(e);return vs(e,t,n)},ns=H([dn],e=>e==null?void 0:e.dataKey),$G=H([RN,Su,dn],YI),FN=(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:wq(e,f,n),graphicalItems:u}]}))},hp=H([$G,RN,ku,FI],FN),UN=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=Cq(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},BG=H([Kt],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=H([Kt],fb),hb=H([pb,BG],TI),FG=H([hp,ni,zt,hb],UN,{memoizeOptions:{resultEqualityCheck:Ah}}),zh=e=>e.errorBars,UG=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>BN(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=>BN(a,m));d.forEach(m=>{var g,y=nt(m,(g=n.dataKey)!==null&&g!==void 0?g:u.dataKey),x=zG(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=lC(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=lC(nt(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]))}),Be(s)&&Be(c))return[s,c]},WG=H([db,Kt,MG,zh,zt,I7],mb,{memoizeOptions:{resultEqualityCheck:Ah}});function KG(e){var{value:t}=e;if(Si(t)||t instanceof Date)return t}var qG=(e,t,n)=>{var r=e.map(KG).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&PO(r))?PI(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},WN=e=>e.referenceElements.dots,xs=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),HG=H([WN,zt,Cu],xs),KN=e=>e.referenceElements.areas,VG=H([KN,zt,Cu],xs),qN=e=>e.referenceElements.lines,YG=H([qN,zt,Cu],xs),HN=(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)]}},GG=H(HG,zt,HN),VN=(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)]}},XG=H([VG,zt],VN);function QG(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 JG(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 YN=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?QG(r):JG(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},ZG=H([YG,zt],YN),eX=H(GG,ZG,XG,(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 M7(t,u,e.allowDataOverflow)},tX=H([Kt,pb,hb,FG,WG,eX,Ye,zt],gb,{memoizeOptions:{resultEqualityCheck:Ah}}),nX=[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 PI(0,(f=n==null?void 0:n.length)!==null&&f!==void 0?f:0)}return c==="category"?qG(r,e,u):i==="expand"&&!u?nX:l}},yb=H([Kt,Ye,db,Iu,ku,zt,tX],vb),Xa=H([Kt,MN,O0],AN),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 vk(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return yk(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&bi(e))return vk(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&bi(e))return yk(e,t.tickCount,t.allowDecimals,"adaptive")}}},bb=H([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},rX=H([Kt,yb,bb,zt],wb),iX=H(Iu,Kt,(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}}),GN=H(iX,Ye,BI,cn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Be(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}),aX=(e,t,n)=>{var r=ia(e,t);return r==null||typeof r.padding!="string"?0:GN(e,"xAxis",t,n,r.padding)},oX=(e,t,n)=>{var r=aa(e,t);return r==null||typeof r.padding!="string"?0:GN(e,"yAxis",t,n,r.padding)},lX=H(ia,aX,(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}}),sX=H(aa,oX,(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}}),cX=H([cn,lX,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]}),uX=H([cn,Ye,sX,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]}),Nu=(e,t,n,r)=>{var i;switch(t){case"xAxis":return cX(e,n,r);case"yAxis":return uX(e,n,r);case"zAxis":return(i=ob(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return qI(e);case"radiusAxis":return HI(e,n);default:return}},XN=H([Kt,Nu],Ch),dX=H([Xa,rX],GI),jb=H([Kt,Xa,dX,XN],ab),QN=(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=H([Ye,Iu,vs,zt],QN),$h=H([jb],R0);H([jb],EG);H([jb,LG],IN);H([ys,zh,zt],UG);function JN(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Bh=(e,t)=>t,Fh=(e,t,n)=>n,fX=H(vh,Bh,Fh,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(JN)),pX=H(yh,Bh,Fh,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(JN)),ZN=(e,t)=>({width:e.width,height:t.height}),hX=(e,t)=>{var n=typeof t.width=="number"?t.width:vu;return{width:n,height:e.height}},e_=H(cn,ia,ZN),mX=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},gX=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},vX=H(na,cn,fX,Bh,Fh,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=ZN(t,s);l==null&&(l=mX(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}),yX=H(ta,cn,pX,Bh,Fh,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=hX(t,s);l==null&&(l=gX(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}),xX=(e,t)=>{var n=ia(e,t);if(n!=null)return vX(e,n.orientation,n.mirror)},bX=H([cn,ia,xX,(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}}}),wX=(e,t)=>{var n=aa(e,t);if(n!=null)return yX(e,n.orientation,n.mirror)},jX=H([cn,aa,wX,(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}}}),t_=H(cn,aa,(e,t)=>{var n=typeof t.width=="number"?t.width:vu;return{width:n,height:e.height}}),sC=(e,t,n)=>{switch(t){case"xAxis":return e_(e,n).width;case"yAxis":return t_(e,n).height;default:return}},n_=(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&&PO(u))return c}},kb=H([Ye,Iu,Kt,zt],n_),cC=H([Ye,NG,Xa,$h,kb,Sb,Nu,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}}}),SX=(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 Be(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 Be(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 Be(b)?{coordinate:b+g,value:x,index:v,offset:g}:null}).filter(tr):r.domain().map((x,v)=>{var b=r.map(x);return Be(b)?{coordinate:b+g,value:l?l[x]:x,index:v,offset:g}:null}).filter(tr)}},r_=H([Ye,vs,Xa,$h,bb,Nu,kb,Sb,zt],SX),kX=(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 Be(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 Be(p)?{coordinate:p+u,value:f,index:d,offset:u}:null}).filter(tr):n.domain().map((f,d)=>{var p=n.map(f);return Be(p)?{coordinate:p+u,value:i?i[f]:f,index:d,offset:u}:null}).filter(tr)}},Ei=H([Ye,vs,$h,Nu,kb,Sb,zt],kX),Ti=H(Kt,$h,(e,t)=>{if(!(e==null||t==null))return pp(pp({},e),{},{scale:t})}),CX=H([Kt,Xa,yb,XN],ab),PX=H([CX],R0);H((e,t,n)=>ob(e,n),PX,(e,t)=>{if(!(e==null||t==null))return pp(pp({},e),{},{scale:t})});var EX=H([Ye,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}}),TX=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};H([TX],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 i_=e=>e.options.defaultTooltipEventType,a_=e=>e.options.validateTooltipEventTypes;function o_(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function _u(e,t){var n=i_(e),r=a_(e);return o_(t,n,r)}function OX(e){return we(t=>_u(t,e))}var l_=(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},AX=e=>e.tooltip.settings,ya={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},IX={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}},s_=$n({name:"tooltip",initialState:IX,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:kt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Nr(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:kt()},removeTooltipEntrySettings:{reducer(e,t){var n=Nr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:kt()},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:NX,replaceTooltipEntrySettings:_X,removeTooltipEntrySettings:MX,setTooltipSettingsState:RX,setActiveMouseOverItemIndex:c_,mouseLeaveItem:DX,mouseLeaveChart:u_,setActiveClickItemIndex:LX,setMouseOverAxisIndex:d_,setMouseClickAxisIndex:zX,setSyncInteraction:Js,setKeyboardInteraction:gp}=s_.actions,$X=s_.reducer;function uC(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?uC(Object(n),!0).forEach(function(r){BX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BX(e,t,n){return(t=FX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FX(e){var t=UX(e,"string");return typeof t=="symbol"?t:t+""}function UX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WX(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function KX(e){return e.index!=null}var f_=(e,t,n,r)=>{if(t==null)return ya;var i=WX(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(KX(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 HX(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 VX(e,t,n){if(n==null||t==null)return!0;var r=nt(e,t);return r==null||!bi(n)?!0:HX(r,n)}var gc=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Be(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||VX(u,n,r)?String(c):null},p_=(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}}}},h_=(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})},m_=e=>e.options.tooltipPayloadSearcher,bs=e=>e.tooltip;function dC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dC(Object(n),!0).forEach(function(r){YX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YX(e,t,n){return(t=GX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GX(e){var t=XX(e,"string");return typeof t=="symbol"?t:t+""}function XX(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 QX(e){if(typeof e=="string"||typeof e=="number")return e}function JX(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function ZX(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function pC(e){if(typeof e=="string")return e}function eQ(e){if(!(e==null||typeof e!="object")){var t="name"in e?QX(e.name):void 0,n="unit"in e?JX(e.unit):void 0,r="dataKey"in e?ZX(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?pC(e.color):void 0,l="fill"in e?pC(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function tQ(e,t){return e??t}var g_=(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=tQ(y,s),b=Array.isArray(v)?FA(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,k;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&l==="axis"?k=EO(b,r,i):k=a(b,t,c,j),Array.isArray(k))k.forEach(E=>{var I,D,O=eQ(E),_=O==null?void 0:O.name,M=O==null?void 0:O.dataKey,G=O==null?void 0:O.payload,q=fC(fC({},x),{},{name:_,unit:O==null?void 0:O.unit,color:(I=O==null?void 0:O.color)!==null&&I!==void 0?I:x==null?void 0:x.color,fill:(D=O==null?void 0:O.fill)!==null&&D!==void 0?D:x==null?void 0:x.fill});p.push(mS({tooltipEntrySettings:q,dataKey:M,payload:G,value:nt(G,M),name:_==null?void 0:String(_)}))});else{var S;p.push(mS({tooltipEntrySettings:x,dataKey:w,payload:k,value:nt(k,w),name:(S=nt(k,j))!==null&&S!==void 0?S:x==null?void 0:x.name}))}return p},d)}},Cb=H([dn,MN,O0],AN),nQ=H([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),rQ=H([bn,ms],lb),Jo=H([nQ,dn,rQ],sb,{memoizeOptions:{resultEqualityCheck:Ih}}),iQ=H([Jo],e=>e.filter(Oh)),v_=H([Jo],cb,{memoizeOptions:{resultEqualityCheck:Ih}}),aQ=H([Jo],e=>e.some(t=>!t.data)),Wo=H([v_,ni],ub),oQ=H([iQ,ni,dn],YI),Pb=H([Wo,dn,Jo,ni,aQ,v_],$N),y_=H([dn],fb),lQ=H([dn],e=>e.allowDataOverflow),x_=H([y_,lQ],TI),sQ=H([Jo],e=>e.filter(Oh)),cQ=H([oQ,sQ,ku,FI],FN),uQ=H([cQ,ni,bn,x_],UN),dQ=H([Jo],DN),fQ=H([Wo,dn,dQ,zh,bn,_7],mb,{memoizeOptions:{resultEqualityCheck:Ah}}),pQ=H([WN,bn,ms],xs),hQ=H([pQ,bn],HN),mQ=H([KN,bn,ms],xs),gQ=H([mQ,bn],VN),vQ=H([qN,bn,ms],xs),yQ=H([vQ,bn],YN),xQ=H([hQ,yQ,gQ],mp),bQ=H([dn,y_,x_,uQ,fQ,xQ,Ye,bn],gb),rs=H([dn,Ye,Wo,Pb,ku,bn,bQ],vb),wQ=H([rs,dn,Cb],xb),jQ=H([dn,rs,wQ,bn],wb),b_=e=>{var t=bn(e),n=ms(e),r=!1;return Nu(e,t,n,r)},w_=H([dn,b_],Ch),SQ=H([dn,Cb,jQ,w_],ab),j_=H([SQ],R0),kQ=H([Ye,Pb,dn,bn],n_),CQ=H([Ye,Pb,dn,bn],QN),PQ=(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 Be(g)?{coordinate:g+d,value:p,index:m,offset:d}:null}).filter(tr):r.domain().map((p,m)=>{var g=r.map(p);return Be(g)?{coordinate:g+d,value:a?a[p]:p,index:m,offset:d}:null}).filter(tr)}}},oa=H([Ye,dn,Cb,j_,b_,kQ,CQ,bn],PQ),Eb=H([i_,a_,AX],(e,t,n)=>o_(n.shared,e,t)),S_=e=>e.tooltip.settings.trigger,Tb=e=>e.tooltip.settings.defaultIndex,Mu=H([bs,Eb,S_,Tb],f_),za=H([Mu,Wo,ns,rs],gc),k_=H([oa,za],l_),Ob=H([Mu],e=>{if(e)return e.dataKey}),C_=H([Mu],e=>{if(e)return e.graphicalItemId}),P_=H([bs,Eb,S_,Tb],h_),EQ=H([ta,na,Ye,cn,oa,Tb,P_],p_),TQ=H([Mu,EQ],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),OQ=H([Mu],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),AQ=H([P_,za,ni,ns,k_,m_,Eb],g_),IQ=H([AQ],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function hC(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 mC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hC(Object(n),!0).forEach(function(r){NQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NQ(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=MQ(e,"string");return typeof t=="symbol"?t:t+""}function MQ(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 RQ=()=>we(dn),DQ=()=>{var e=RQ(),t=we(oa),n=we(j_);return La(!e||!n?void 0:mC(mC({},e),{},{scale:n}),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 cl(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){LQ(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 LQ(e,t,n){return(t=zQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zQ(e){var t=$Q(e,"string");return typeof t=="symbol"?t:t+""}function $Q(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 BQ=(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}},FQ=(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 UQ(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 E_=(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 k;return(k=n[s])===null||k===void 0?void 0:k.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 D=0;D<l;D++){var O=t[D];if(O!=null){var _=t[D+1],M=t[D-1];if(D===0&&_!=null&&e<=(O.coordinate+_.coordinate)/2||D===l-1&&M!=null&&e>(O.coordinate+M.coordinate)/2||D>0&&D<l-1&&M!=null&&_!=null&&e>(O.coordinate+M.coordinate)/2&&e<=(O.coordinate+_.coordinate)/2)return O.index}}return-1},T_=()=>we(O0),Ab=(e,t)=>t,O_=(e,t,n)=>n,Ib=(e,t,n,r)=>r,WQ=H(oa,e=>lh(e,t=>t.coordinate)),Nb=H([bs,Ab,O_,Ib],f_),_b=H([Nb,Wo,ns,rs],gc),KQ=(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}},A_=H([bs,Ab,O_,Ib],h_),vp=H([ta,na,Ye,cn,oa,Ib,A_],p_),qQ=H([Nb,vp],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),I_=H([oa,_b],l_),HQ=H([A_,_b,ni,ns,I_,m_,Ab],g_),VQ=H([Nb,_b],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),YQ=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&UQ(e,l)){var s=Pq(e,t),c=E_(s,a,i,n,r),u=BQ(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},GQ=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var s=x7(e,n);if(s){var c=Eq(s,t),u=E_(c,l,a,r,i),f=FQ(t,a,u,s);return{activeIndex:String(u),activeCoordinate:f}}}},XQ=(e,t,n,r,i,a,l,s)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?YQ(e,t,r,i,a,l,s):GQ(e,t,n,r,i,a,l)},QQ=H(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}}),JQ=H(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:Y7}});function vC(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 yC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vC(Object(n),!0).forEach(function(r){ZQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZQ(e,t,n){return(t=eJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eJ(e){var t=tJ(e,"string");return typeof t=="symbol"?t:t+""}function tJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nJ={},rJ={zIndexMap:Object.values(Gt).reduce((e,t)=>yC(yC({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),nJ)},iJ=new Set(Object.values(Gt));function aJ(e){return iJ.has(e)}var N_=$n({name:"zIndex",initialState:rJ,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:kt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!aJ(n)&&delete e.zIndexMap[n])},prepare:kt()},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:kt()},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:kt()}}}),{registerZIndexPortal:oJ,unregisterZIndexPortal:gg,registerZIndexPortalElement:lJ,unregisterZIndexPortalElement:sJ}=N_.actions,cJ=N_.reducer;function Gn(e){var{zIndex:t,children:n}=e,r=a9(),i=r&&t!==void 0&&t!==0,a=xn(),l=h.useRef(void 0),s=h.useRef(new Set),c=pt(),u=we(d=>QQ(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(oJ({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 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 Td(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){uJ(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 uJ(e,t,n){return(t=dJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dJ(e){var t=fJ(e,"string");return typeof t=="symbol"?t:t+""}function fJ(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 pJ(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return h.isValidElement(t)?h.cloneElement(t,r):h.createElement(n,r)}function hJ(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=MH,x=Gt.cursorLine;else if(f==="BarChart")g=RH(s,d,a,l),y=yI,x=Gt.cursorRectangle;else if(s==="radial"&&OO(d)){var{cx:v,cy:b,radius:w,startAngle:j,endAngle:k}=bI(d);g={cx:v,cy:b,startAngle:j,endAngle:k,innerRadius:w,outerRadius:w},y=jI,x=Gt.cursorLine}else g={points:S7(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),Ro(c)),{},{payload:p,payloadIndex:m,className:Ze("recharts-tooltip-cursor",S)});return h.createElement(Gn,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:x},h.createElement(pJ,{cursor:c,cursorComp:y,cursorProps:E}))}function mJ(e){var t=DQ(),n=eI(),r=Va(),i=T_();return t==null||n==null||r==null||i==null?null:h.createElement(hJ,by({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var __=h.createContext(null),gJ=()=>h.useContext(__),M_={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,k;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(k=1,b=new Array(v-1);k<v;k++)b[k-1]=arguments[k];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})(M_);var vJ=M_.exports;const yJ=zr(vJ);var Zc=new yJ,wy="recharts.syncEvent.tooltip",bC="recharts.syncEvent.brush",Uh=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Jr(n))return e[n]}},xJ={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},R_=$n({name:"options",initialState:xJ,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),bJ=R_.reducer,{createEventEmitter:wJ}=R_.actions;function jJ(e){return e.tooltip.syncInteraction}var SJ={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},D_=$n({name:"chartData",initialState:SJ,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:wC,setDataStartEndIndexes:kJ,setComputedData:Goe}=D_.actions,CJ=D_.reducer,PJ=["x","y"];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 ul(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){EJ(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 EJ(e,t,n){return(t=TJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TJ(e){var t=OJ(e,"string");return typeof t=="symbol"?t:t+""}function OJ(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 AJ(e,t){if(e==null)return{};var n,r,i=IJ(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 IJ(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 NJ(){var e=we(A0),t=we(I0),n=pt(),r=we(UI),i=we(oa),a=Va(),l=wh(),s=we(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(Js({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=AJ(m,PJ),{x:v,y:b,width:w,height:j}=f.payload.sourceViewBox,k=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:k})}))}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(U=>String(U.value)===f.payload.label));var{coordinate:D}=f.payload;if(D==null||l==null){n(Js({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(S==null){n(Js({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:f.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:O,y:_}=D,M=Math.min(O,l.x+l.width),G=Math.min(_,l.y+l.height),q={x:a==="horizontal"?S.coordinate:M,y:a==="horizontal"?G:S.coordinate},A=Js({active:f.payload.active,coordinate:q,dataKey:f.payload.dataKey,index:String(S.index),label:f.payload.label,sourceViewBox:f.payload.sourceViewBox,graphicalItemId:f.payload.graphicalItemId});n(A)}}};return Zc.on(wy,c),()=>{Zc.off(wy,c)}},[s,n,t,e,r,i,a,l])}function _J(){var e=we(A0),t=we(I0),n=pt();h.useEffect(()=>{if(e==null)return qa;var r=(i,a,l)=>{t!==l&&e===i&&n(kJ(a))};return Zc.on(bC,r),()=>{Zc.off(bC,r)}},[n,t,e])}function MJ(){var e=pt();h.useEffect(()=>{e(wJ())},[e]),NJ(),_J()}function RJ(e,t,n,r,i,a){var l=we(g=>KQ(g,e,t)),s=we(C_),c=we(I0),u=we(A0),f=we(UI),d=we(jJ),p=(d==null?void 0:d.sourceViewBox)!=null,m=wh();h.useEffect(()=>{if(!p&&u!=null&&c!=null){var g=Js({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:m,graphicalItemId:s});Zc.emit(wy,u,g,c)}},[p,n,l,s,i,r,c,u,f,a,m])}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 kC(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){DJ(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 DJ(e,t,n){return(t=LJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LJ(e){var t=zJ(e,"string");return typeof t=="symbol"?t:t+""}function zJ(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 $J(e){return e.dataKey}function BJ(e,t){return h.isValidElement(e)?h.cloneElement(e,t):typeof e=="function"?h.createElement(e,t):h.createElement(cH,t)}var CC=[],FJ={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 Us(e){var t,n,r=Xt(e,FJ),{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:k,axisId:S}=r,E=pt(),I=typeof j=="number"?String(j):j;h.useEffect(()=>{E(RX({shared:b,trigger:w,axisId:S,active:i,defaultIndex:I}))},[E,b,w,S,i,I]);var D=wh(),O=pI(),_=OX(b),{activeIndex:M,isActive:G}=(t=we(ue=>VQ(ue,_,w,I)))!==null&&t!==void 0?t:{},q=we(ue=>HQ(ue,_,w,I)),A=we(ue=>I_(ue,_,w,I)),U=we(ue=>qQ(ue,_,w,I)),K=q,T=gJ(),z=(n=i??G)!==null&&n!==void 0?n:!1,[P,$]=dA([K,z]),ee=_==="axis"?A:void 0;RJ(_,w,U,ee,M,z);var N=k??T;if(N==null||D==null||_==null)return null;var le=K??CC;z||(le=CC),u&&le.length&&(le=ZO(le.filter(ue=>ue.value!=null&&(ue.hide!==!0||r.includeHidden)),p,$J));var me=le.length>0,X=kC(kC({},r),{},{payload:le,label:ee,active:z,activeIndex:M,coordinate:U,accessibilityLayer:O}),ne=h.createElement(bH,{allowEscapeViewBox:a,animationDuration:l,animationEasing:s,isAnimationActive:f,active:z,coordinate:U,hasPayload:me,offset:d,position:m,reverseDirection:g,useTranslate3d:y,viewBox:D,wrapperStyle:x,lastBoundingBox:P,innerRef:$,hasPortalFromProps:!!k},BJ(c,X));return h.createElement(h.Fragment,null,Wp.createPortal(ne,N),z&&h.createElement(mJ,{cursor:v,tooltipEventType:_,coordinate:U,payload:le,index:M}))}var Ru=e=>null;Ru.displayName="Cell";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)}class qJ{constructor(t){UJ(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 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 HJ(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){VJ(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 VJ(e,t,n){return(t=YJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YJ(e){var t=GJ(e,"string");return typeof t=="symbol"?t:t+""}function GJ(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 XJ={cacheSize:2e3,enableCache:!0},L_=HJ({},XJ),EC=new qJ(L_.cacheSize),QJ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},TC="recharts_measurement_span";function JJ(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 OC=(e,t)=>{try{var n=document.getElementById(TC);n||(n=document.createElement("span"),n.setAttribute("id",TC),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,QJ,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},vc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||wu.isSsr)return{width:0,height:0};if(!L_.enableCache)return OC(t,n);var r=JJ(t,n),i=EC.get(r);if(i)return i;var a=OC(t,n);return EC.set(r,a),a},z_;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 AC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,IC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,nZ=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,rZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,iZ={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},aZ=["cm","mm","pt","pc","in","Q","px"];function oZ(e){return aZ.includes(e)}var El="NaN";function lZ(e,t){return e*iZ[t]}class Cn{static parse(t){var n,[,r,i]=(n=rZ.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!==""&&!nZ.test(n)&&(this.num=NaN,this.unit=""),oZ(n)&&(this.num=lZ(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)}}z_=Cn;ZJ(Cn,"NaN",new z_(NaN,""));function $_(e){if(e==null||e.includes(El))return El;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=AC.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(AC,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,f,d,p]=(u=IC.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(IC,y.toString())}return t}var NC=/\(([^()]*)\)/;function sZ(e){for(var t=e,n;(n=NC.exec(t))!=null;){var[,r]=n;t=t.replace(NC,$_(r))}return t}function cZ(e){var t=e.replace(/\s+/g,"");return t=sZ(t),t=$_(t),t}function uZ(e){try{return cZ(e)}catch{return El}}function vg(e){var t=uZ(e.slice(5,-1));return t===El?"":t}var dZ=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],fZ=["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 _C(e,t){if(e==null)return{};var n,r,i=pZ(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 pZ(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 B_=/[ \f\n\r\t\v\u2028\u2029]+/,F_=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Et(t)||(n?i=t.toString().split(""):i=t.toString().split(B_));var a=i.map(s=>({word:s,width:vc(s,r).width})),l=n?0:vc(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function U_(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function hZ(e){return Et(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var W_=(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},[]),K_=e=>e.reduce((t,n)=>t.width>n.width?t:n),mZ="…",MC=(e,t,n,r,i,a,l,s)=>{var c=e.slice(0,t),u=F_({breakAll:n,style:r,children:c+mZ});if(!u)return[!1,[]];var f=W_(u.wordsWithComputedWidth,a,l,s),d=f.length>i||K_(f).width>Number(a);return[d,f]},gZ=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:s,breakAll:c}=e,u=ve(a),f=String(l),d=W_(t,r,n,i);if(!u||i)return d;var p=d.length>a||K_(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]=MC(f,b,c,s,a,r,n,i),[k]=MC(f,v,c,s,a,r,n,i);if(!w&&!k&&(m=v+1),w&&k&&(g=v-1),!w&&k){x=j;break}y++}return x||d},RC=e=>{var t=Et(e)?[]:e.toString().split(B_);return[{words:t,width:void 0}]},vZ=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!wu.isSsr){var s,c,u=F_({breakAll:a,children:r,style:i});if(u){var{wordsWithComputedWidth:f,spaceWidth:d}=u;s=f,c=d}else return RC(r);return gZ({breakAll:a,children:r,maxLines:l,style:i},s,c,t,!!n)}return RC(r)},q_="#808080",yZ={angle:0,breakAll:!1,capHeight:"0.71em",fill:q_,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Wh=h.forwardRef((e,t)=>{var n=Xt(e,yZ),{x:r,y:i,lineHeight:a,capHeight:l,fill:s,scaleToFit:c,textAnchor:u,verticalAnchor:f}=n,d=_C(n,dZ),p=h.useMemo(()=>vZ({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=_C(d,fZ);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(!Be(w)||!Be(j))return null;var k;switch(f){case"start":k=vg("calc(".concat(l,")"));break;case"middle":k=vg("calc(".concat((p.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:k=vg("calc(".concat(p.length-1," * -").concat(a,")"));break}var S=[],E=p[0];if(c&&E!=null){var I=E.width,{width:D}=d;S.push("scale(".concat(ve(D)&&ve(I)?D/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:Ze("recharts-text",x),textAnchor:u,fill:s.includes("url")?q_:s}),p.map((O,_)=>{var M=O.words.join(v?"":" ");return h.createElement("tspan",{x:w,dy:_===0?k:a,key:"".concat(M,"-").concat(_)},M)}))});Wh.displayName="Text";function DC(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?DC(Object(n),!0).forEach(function(r){xZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xZ(e,t,n){return(t=bZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bZ(e){var t=wZ(e,"string");return typeof t=="symbol"?t:t+""}function wZ(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 jZ=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,k=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 D={x:d+u/2,y:l+s+x,horizontalAnchor:"middle",verticalAnchor:b};return E&&(D.height=Math.max(E.y+E.height-(l+s),0),D.width=u),D}if(n==="left"){var O={x:p-j,y:l+s/2,horizontalAnchor:k,verticalAnchor:"middle"};return E&&(O.width=Math.max(O.x-E.x,0),O.height=s),O}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 M=E?{width:m,height:s}:{};return n==="insideLeft"?ci({x:p+j,y:l+s/2,horizontalAnchor:S,verticalAnchor:"middle"},M):n==="insideRight"?ci({x:p+m-j,y:l+s/2,horizontalAnchor:k,verticalAnchor:"middle"},M):n==="insideTop"?ci({x:f+c/2,y:l+x,horizontalAnchor:"middle",verticalAnchor:b},M):n==="insideBottom"?ci({x:d+u/2,y:l+s-x,horizontalAnchor:"middle",verticalAnchor:v},M):n==="insideTopLeft"?ci({x:f+j,y:l+x,horizontalAnchor:S,verticalAnchor:b},M):n==="insideTopRight"?ci({x:f+c-j,y:l+x,horizontalAnchor:k,verticalAnchor:b},M):n==="insideBottomLeft"?ci({x:d+j,y:l+s-x,horizontalAnchor:S,verticalAnchor:v},M):n==="insideBottomRight"?ci({x:d+u-j,y:l+s-x,horizontalAnchor:k,verticalAnchor:v},M):n&&typeof n=="object"&&(ve(n.x)||zo(n.x))&&(ve(n.y)||zo(n.y))?ci({x:a+Rn(n.x,m),y:l+Rn(n.y,s),horizontalAnchor:"end",verticalAnchor:"end"},M):ci({x:g,y:l+s/2,horizontalAnchor:"middle",verticalAnchor:"middle"},M)},SZ=["labelRef"],kZ=["content"];function LC(e,t){if(e==null)return{};var n,r,i=CZ(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 CZ(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 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 Zs(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){PZ(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 PZ(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)}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 H_=h.createContext(null),OZ=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(H_.Provider,{value:c},s)},V_=()=>{var e=h.useContext(H_),t=wh();return e||(t?b0(t):void 0)},AZ=h.createContext(null),IZ=()=>{var e=h.useContext(AZ),t=we(VI);return e||t},NZ=e=>{var{value:t,formatter:n}=e,r=Et(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},MZ=(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),k="M".concat(w.x,",").concat(w.y,`
|
|
482
|
-
A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
|
|
483
|
-
`).concat(j.x,",").concat(j.y),S=Et(e.id)?Bc("recharts-radial-line-"):e.id;return h.createElement("text",Di({},r,{dominantBaseline:"central",className:Ze("recharts-radial-bar-label",l)}),h.createElement("defs",null,h.createElement("path",{id:S,d:k})),h.createElement("textPath",{xlinkHref:"#".concat(S)},n))},RZ=(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),DZ={angle:0,offset:5,zIndex:Gt.label,position:"middle",textBreakAll:!1};function LZ(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,DZ),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:s,className:c="",textBreakAll:u,labelRef:f}=t,d=IZ(),p=V_(),m=i==="center"?p:d??p,g,y,x;n==null?g=m:Gd(n)?g=n:g=b0(n);var v=LZ(g);if(!g||Et(a)&&Et(l)&&!h.isValidElement(s)&&typeof s!="function")return null;var b=Zs(Zs({},t),{},{viewBox:g});if(h.isValidElement(s)){var{labelRef:w}=b,j=LC(b,SZ);return h.cloneElement(s,j)}if(typeof s=="function"){var{content:k}=b,S=LC(b,kZ);if(y=h.createElement(s,S),h.isValidElement(y))return y}else y=NZ(t);var E=Ln(t);if(Gd(g)){if(i==="insideStart"||i==="insideEnd"||i==="end")return MZ(t,i,y,E,g);x=RZ(g,t.offset,t.position)}else{if(!v)return null;var I=jZ({viewBox:v,position:i,offset:t.offset,parentViewBox:Gd(r)?void 0:r});x=Zs(Zs({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:Ze("recharts-label",c)},E,x,{textAnchor:U_(E.textAnchor)?E.textAnchor:x.textAnchor,breakAll:u}),y))}ma.displayName="Label";var zZ=(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,Zs({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 $Z(e){var{label:t,labelRef:n}=e,r=V_();return zZ(t,r,n)||null}var BZ=["valueAccessor"],FZ=["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 $C(e,t){if(e==null)return{};var n,r,i=UZ(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 UZ(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 WZ=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(hZ(t))return t},Y_=h.createContext(void 0),Rb=Y_.Provider,G_=h.createContext(void 0),KZ=G_.Provider;function qZ(){return h.useContext(Y_)}function HZ(){return h.useContext(G_)}function Xd(e){var{valueAccessor:t=WZ}=e,n=$C(e,BZ),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:s}=n,c=$C(n,FZ),u=qZ(),f=HZ(),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=Et(r)?t(p,m):nt(p.payload,r),x=Et(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 X_=e=>{var{cx:t,cy:n,r,className:i}=e,a=Ze("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},Q_=e=>e.graphicalItems.polarItems,VZ=H([zt,Cu],lb),qh=H([Q_,Kt,VZ],sb),YZ=H([qh],cb),Hh=H([YZ,ju],ub),GZ=H([Hh,Kt,qh],zN);H([Hh,Kt,qh],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,l=nt(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:nt(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var BC=()=>{},XZ=H([Hh,Kt,qh,zh,zt,N7],mb),QZ=H([Kt,pb,hb,BC,XZ,BC,Ye,zt],gb),J_=H([Kt,Ye,Hh,GZ,ku,zt,QZ],vb),JZ=H([J_,vs,Xa],xb),ZZ=H([Kt,J_,JZ,zt],wb);H([Xa,ZZ],GI);var eee={radiusAxis:{},angleAxis:{}},Z_=$n({name:"polarAxis",initialState:eee,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:Xoe,removeRadiusAxis:Qoe,addAngleAxis:Joe,removeAngleAxis:Zoe}=Z_.actions,tee=Z_.reducer;function eM(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}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 UC(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){nee(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 nee(e,t,n){return(t=ree(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ree(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)}var aee=(e,t)=>t,Db=H([Q_,aee],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),oee=[],Lb=(e,t,n)=>(n==null?void 0:n.length)===0?oee:n,tM=H([ju,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=>UC(UC({},t.presentationProps),a.props))),i!=null)return i}}),lee=H([tM,Db,Lb],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,l=nt(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}})}),see=H([tM,Db,Lb,cn],(e,t,n,r)=>{if(!(t==null||e==null))return dte({offset:r,pieSettings:t,displayedData:e,cells:n})}),nM={exports:{}},vt={};/**
|
|
484
|
-
* @license React
|
|
485
|
-
* react-is.production.js
|
|
486
|
-
*
|
|
487
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
488
|
-
*
|
|
489
|
-
* This source code is licensed under the MIT license found in the
|
|
490
|
-
* LICENSE file in the root directory of this source tree.
|
|
491
|
-
*/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"),cee=Symbol.for("react.view_transition"),uee=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 cee: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}}}vt.ContextConsumer=Xh;vt.ContextProvider=Qh;vt.Element=zb;vt.ForwardRef=Jh;vt.Fragment=Vh;vt.Lazy=nm;vt.Memo=tm;vt.Portal=$b;vt.Profiler=Gh;vt.StrictMode=Yh;vt.Suspense=Zh;vt.SuspenseList=em;vt.isContextConsumer=function(e){return Br(e)===Xh};vt.isContextProvider=function(e){return Br(e)===Qh};vt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===zb};vt.isForwardRef=function(e){return Br(e)===Jh};vt.isFragment=function(e){return Br(e)===Vh};vt.isLazy=function(e){return Br(e)===nm};vt.isMemo=function(e){return Br(e)===tm};vt.isPortal=function(e){return Br(e)===$b};vt.isProfiler=function(e){return Br(e)===Gh};vt.isStrictMode=function(e){return Br(e)===Yh};vt.isSuspense=function(e){return Br(e)===Zh};vt.isSuspenseList=function(e){return Br(e)===em};vt.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===uee||e.getModuleId!==void 0)};vt.typeOf=Br;nM.exports=vt;var dee=nM.exports,WC=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",KC=null,yg=null,rM=e=>{if(e===KC&&Array.isArray(yg))return yg;var t=[];return h.Children.forEach(e,n=>{Et(n)||(dee.isFragment(n)?t=t.concat(rM(n.props.children)):t.push(n))}),yg=t,KC=e,t};function Bb(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>WC(i)):r=[WC(t)],rM(e).forEach(i=>{var a=Lo(i,"type.displayName")||Lo(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,iM={};function fee(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}iM.isPlainObject=fee;var pee=iM.isPlainObject;const hee=zr(pee);var qC,HC,VC,YC,GC;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 QC(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){mee(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 mee(e,t,n){return(t=gee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gee(e){var t=vee(e,"string");return typeof t=="symbol"?t:t+""}function vee(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 Ws(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var JC=(e,t,n,r,i)=>{var a=n-r,l;return l=Ut(qC||(qC=Ws(["M ",",",""])),e,t),l+=Ut(HC||(HC=Ws(["L ",",",""])),e+n,t),l+=Ut(VC||(VC=Ws(["L ",",",""])),e+n-a/2,t+i),l+=Ut(YC||(YC=Ws(["L ",",",""])),e+n-a/2-r,t+i),l+=Ut(GC||(GC=Ws(["L ",","," Z"])),e,t),l},yee={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},xee=e=>{var t=Xt(e,yee),{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 q=p.current.getTotalLength();q&&g(q)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||l!==+l||i===0&&a===0||l===0)return null;var k=Ze("recharts-trapezoid",s);if(!d)return h.createElement("g",null,h.createElement("path",xp({},Ln(t),{className:k,d:JC(n,r,i,a,l)})));var S=y.current,E=x.current,I=v.current,D=b.current,O=w.current,_="0px ".concat(m===-1?1:m,"px"),M="".concat(m,"px ").concat(m,"px"),G=hI(["strokeDasharray"],u,c);return h.createElement(ds,{animationId:j,key:j,canBegin:m>0,duration:u,easing:c,isActive:d,begin:f},q=>{var A=ot(S,i,q),U=ot(E,a,q),K=ot(I,l,q),T=ot(D,n,q),z=ot(O,r,q);p.current&&(y.current=A,x.current=U,v.current=K,b.current=T,w.current=z);var P=q>0?{transition:G,strokeDasharray:M}:{strokeDasharray:_};return h.createElement("path",xp({},Ln(t),{className:k,d:JC(T,z,A,U,K),ref:p,style:QC(QC({},P),t.style)}))})},bee=["option","shapeType","activeClassName","inActiveClassName"];function wee(e,t){if(e==null)return{};var n,r,i=jee(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 jee(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 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 bp(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){See(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 See(e,t,n){return(t=kee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kee(e){var t=Cee(e,"string");return typeof t=="symbol"?t:t+""}function Cee(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 Pee(e,t){return bp(bp({},t),e)}function Eee(e,t){return e==="symbols"}function eP(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return h.createElement(yI,n);case"trapezoid":return h.createElement(xee,n);case"sector":return h.createElement(jI,n);case"symbols":if(Eee(t))return h.createElement(e0,n);break;case"curve":return h.createElement(Ll,n);default:return null}}function Tee(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=wee(e,bee),l;if(h.isValidElement(t))l=h.cloneElement(t,bp(bp({},a),Tee(t)));else if(typeof t=="function")l=t(a,a.index);else if(hee(t)&&typeof t!="boolean"){var s=Pee(t,a);l=h.createElement(eP,{shapeType:n,elementProps:s})}else{var c=a;l=h.createElement(eP,{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=pt();return(i,a)=>l=>{e==null||e(i,a,l),r(c_({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Kb=e=>{var t=pt();return(n,r)=>i=>{e==null||e(n,r,i),t(DX())}},qb=(e,t,n)=>{var r=pt();return(i,a)=>l=>{e==null||e(i,a,l),r(LX({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function rm(e){var{tooltipEntrySettings:t}=e,n=pt(),r=xn(),i=h.useRef(null);return h.useLayoutEffect(()=>{r||(i.current===null?n(NX(t)):i.current!==t&&n(_X({prev:i.current,next:t})),i.current=t)},[t,n,r]),h.useLayoutEffect(()=>()=>{i.current&&(n(MX(i.current)),i.current=null)},[n]),null}function Hb(e){var{legendPayload:t}=e,n=pt(),r=xn(),i=h.useRef(null);return h.useLayoutEffect(()=>{r||(i.current===null?n(cI(t)):i.current!==t&&n(uI({prev:i.current,next:t})),i.current=t)},[n,r,t]),h.useLayoutEffect(()=>()=>{i.current&&(n(dI(i.current)),i.current=null)},[n]),null}function Oee(e){var{legendPayload:t}=e,n=pt(),r=we(Ye),i=h.useRef(null);return h.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(cI(t)):i.current!==t&&n(uI({prev:i.current,next:t})),i.current=t)},[n,r,t]),h.useLayoutEffect(()=>()=>{i.current&&(n(dI(i.current)),i.current=null)},[n]),null}var xg,Aee=()=>{var[e]=h.useState(()=>Bc("uid-"));return e},Iee=(xg=VP.useId)!==null&&xg!==void 0?xg:Aee;function Nee(e,t){var n=Iee();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=Nee("recharts-".concat(n),t);return h.createElement(_ee.Provider,{value:i},r(i))},Mee={cartesianItems:[],polarItems:[]},aM=$n({name:"graphicalItems",initialState:Mee,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:kt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Nr(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:kt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Nr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:kt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:kt()},removePolarGraphicalItem:{reducer(e,t){var n=Nr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:kt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Nr(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:kt()}}}),{addCartesianGraphicalItem:Ree,replaceCartesianGraphicalItem:Dee,removeCartesianGraphicalItem:Lee,addPolarGraphicalItem:zee,removePolarGraphicalItem:$ee,replacePolarGraphicalItem:Bee}=aM.actions,Fee=aM.reducer,Uee=e=>{var t=pt(),n=h.useRef(null);return h.useLayoutEffect(()=>{n.current===null?t(Ree(e)):n.current!==e&&t(Dee({prev:n.current,next:e})),n.current=e},[t,e]),h.useLayoutEffect(()=>()=>{n.current&&(t(Lee(n.current)),n.current=null)},[t]),null},Vb=h.memo(Uee),Wee=e=>{var t=pt(),n=h.useRef(null);return h.useLayoutEffect(()=>{n.current===null?t(zee(e)):n.current!==e&&t(Bee({prev:n.current,next:e})),n.current=e},[t,e]),h.useLayoutEffect(()=>()=>{n.current&&(t($ee(n.current)),n.current=null)},[t]),null},Kee=h.memo(Wee),qee=["key"],Hee=["onMouseEnter","onClick","onMouseLeave"],Vee=["id"],Yee=["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=Gee(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 Gee(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 Tt(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){Xee(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 Xee(e,t,n){return(t=Qee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qee(e){var t=Jee(e,"string");return typeof t=="symbol"?t:t+""}function Jee(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 Zee(e){var t=h.useMemo(()=>Bb(e.children,Ru),[e.children]),n=we(r=>lee(r,e.id,t));return n==null?null:h.createElement(Oee,{legendPayload:n})}function ete(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 tte=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=ete(d),m=r.map(y=>{var x=y.tooltipPayload;return p==null||x==null?x:x.map(v=>Tt(Tt({},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})}),nte=(e,t)=>e>t?"start":e<t?"end":"middle",rte=(e,t,n)=>Rn(typeof t=="function"?t(e):t,n,n*.8),ite=(e,t,n)=>{var{top:r,left:i,width:a,height:l}=t,s=xI(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=rte(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}},ate=(e,t)=>{var n=vn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},ote=(e,t)=>{if(h.isValidElement(e))return h.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Ze("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}))},lte=(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=Ze("recharts-pie-label-text",eM(e));return h.createElement(Wh,$a({},t,{alignmentBaseline:"middle",className:i}),r)};function ste(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=Ro(i),u=Ro(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=Tt(Tt(Tt(Tt({},s),p),{},{stroke:"none"},c),{},{index:m,textAnchor:nte(y.x,p.cx)},y),v=Tt(Tt(Tt(Tt({},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&&ote(a,v),lte(i,x,nt(p,l))))});return h.createElement(Lt,{className:"recharts-pie-labels"},d)}function cte(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(ste,{sectors:t,props:n,showLabels:r})}function ute(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:l}=e,s=we(za),c=we(Ob),u=we(C_),{onMouseEnter:f,onClick:d,onMouseLeave:p}=i,m=am(i,Hee),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,k=s?r:null,S=n&&j?n:k,E=Tt(Tt({},v),{},{stroke:v.stroke,tabIndex:-1,[HA]:b,[VA]: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"},pu(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 dte(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=ate(s,c),g=Math.abs(m),y=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,x=r.filter(I=>nt(I,u,0)!==0).length,v=(g>=360?x:x-1)*y,b=r.reduce((I,D)=>{var O=nt(D,u,0);return I+(ve(O)?O:0)},0),w=p>0&&b>0&&r.some(I=>{var D=nt(I,u,0),O=(ve(D)?D:0)/b;return D!==0&&O*g<p}),j=w?p:0,k=g-x*j-v,S;if(b>0){var E;S=r.map((I,D)=>{var O=nt(I,u,0),_=nt(I,f,D),M=ite(n,a,I),G=(ve(O)?O:0)/b,q,A=Tt(Tt({},I),i&&i[D]&&i[D].props),U=A!=null&&"fill"in A&&typeof A.fill=="string"?A.fill:n.fill;D?q=E.endAngle+vn(m)*y*(O!==0?1:0):q=s;var K=q+vn(m)*((O!==0?j:0)+G*k),T=(q+K)/2,z=(M.innerRadius+M.outerRadius)/2,P=[{name:_,value:O,payload:A,dataKey:u,type:d,color:U,fill:U,graphicalItemId:n.id}],$=tn(M.cx,M.cy,z,T);return E=Tt(Tt(Tt(Tt({},n.presentationProps),{},{percent:G,cornerRadius:typeof l=="string"?parseFloat(l):l,name:_,tooltipPayload:P,midAngle:T,middleRadius:z,tooltipPosition:$},A),M),{},{value:O,dataKey:u,startAngle:q,endAngle:K,payload:A,paddingAngle:O!==0?vn(m)*y:0}),E})}return S}function fte(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(KZ,{value:t?i:void 0},r)}function pte(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(fte,{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,k=[],S=i&&i[0],E=(j=S==null?void 0:S.startAngle)!==null&&j!==void 0?j:0;return i==null||i.forEach((I,D)=>{var O=g&&g[D],_=D>0?Lo(I,"paddingAngle",0):0;if(O){var M=ot(O.endAngle-O.startAngle,I.endAngle-I.startAngle,w),G=Tt(Tt({},I),{},{startAngle:E+_,endAngle:E+M+_});k.push(G),E=G.endAngle}else{var{endAngle:q,startAngle:A}=I,U=ot(0,q-A,w),K=Tt(Tt({},I),{},{startAngle:E+_,endAngle:E+U+_});k.push(K),E=K.endAngle}}),n.current=k,h.createElement(Lt,null,h.createElement(ute,{sectors:k,activeShape:u,inactiveShape:f,allOtherPieProps:t,shape:t.shape,id:r}))}),h.createElement(cte,{showLabels:!y,sectors:i,props:t}),t.children)}var hte={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 mte(e){var{id:t}=e,n=am(e,Vee),{hide:r,className:i,rootTabIndex:a}=e,l=h.useMemo(()=>Bb(e.children,Ru),[e.children]),s=we(f=>see(f,t,l)),c=h.useRef(null),u=Ze("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(tte,{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(pte,{props:Tt(Tt({},n),{},{sectors:s}),previousSectorsRef:c,id:t})))}function gte(e){var t=Xt(e,hte),{id:n}=t,r=am(t,Yee),i=qn(r);return h.createElement(im,{id:n,type:"pie"},a=>h.createElement(h.Fragment,null,h.createElement(Kee,{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(Zee,$a({},r,{id:a})),h.createElement(mte,$a({},r,{id:a}))))}var oM=gte;oM.displayName="Pie";var vte=["points"];function nP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nP(Object(n),!0).forEach(function(r){yte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yte(e,t,n){return(t=xte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xte(e){var t=bte(e,"string");return typeof t=="symbol"?t:t+""}function bte(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 wte(e,t){if(e==null)return{};var n,r,i=jte(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 jte(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 Ste(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=Ze(r,typeof t!="boolean"?t.className:""),a=n??{},{points:l}=a,s=wte(a,vte);return h.createElement(X_,wp({},s,{className:i}))}function kte(e,t){return e==null?!1:t?!0:e.length===1}function lM(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:l,needClip:s,clipPathId:c,zIndex:u=Gt.scatter}=e;if(!kte(t,n))return null;var f=Fb(n),d=e5(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(Ste,{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 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 iP(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){Cte(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 Cte(e,t,n){return(t=Pte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pte(e){var t=Ete(e,"string");return typeof t=="symbol"?t:t+""}function Ete(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 sM=0,Tte={xAxis:{},yAxis:{},zAxis:{}},cM=$n({name:"cartesianAxis",initialState:Tte,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:kt()},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:kt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:kt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:kt()},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:kt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:kt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:kt()},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:kt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:kt()},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]=iP(iP({},i),{},{width:r,widthHistory:s})}}}}),{addXAxis:Ote,replaceXAxis:Ate,removeXAxis:Ite,addYAxis:Nte,replaceYAxis:_te,removeYAxis:Mte,addZAxis:ele,replaceZAxis:tle,removeZAxis:nle,updateYAxisWidth:Rte}=cM.actions,Dte=cM.reducer,Lte=H([cn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),zte=H([Lte,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=()=>we(zte),$te=()=>we(IQ);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 wg(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){Bte(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 Bte(e,t,n){return(t=Fte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fte(e){var t=Ute(e,"string");return typeof t=="symbol"?t:t+""}function Ute(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 Wte=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),Ro(i)),t0(i)),u;return h.isValidElement(i)?u=h.cloneElement(i,c):typeof i=="function"?u=i(c):u=h.createElement(X_,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=we(za),c=$te();if(t==null||c==null)return null;var u=t.find(f=>c.includes(f.payload));return Et(u)?null:h.createElement(Gn,{zIndex:l},h.createElement(Wte,{point:u,childIndex:Number(s),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var oP=(e,t,n)=>{var r=n??e;if(!Et(r))return Rn(r,t,0)},Kte=(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=oP(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=oP(t,n,u.barSize);return{stackId:void 0,dataKeys:f,barSize:d}});return[...s,...c]};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 Od(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){qte(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 qte(e,t,n){return(t=Hte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hte(e){var t=Vte(e,"string");return typeof t=="symbol"?t:t+""}function Vte(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 Yte(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var s=Rn(e,n,0,!0),c,u=[];if(Be((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,k={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,k];return g=k.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=Be(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 Gte=(e,t,n,r,i,a,l)=>{var s=Et(l)?t:l,c=Yte(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},Xte=(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)}}}},Qte=(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 Jte(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Be(e.zIndex)?e.zIndex:t}var uM=e=>{var{chartData:t}=e,n=pt(),r=xn();return h.useEffect(()=>r?()=>{}:(n(wC(t)),()=>{n(wC(void 0))}),[t,n,r]),null},sP={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},dM=$n({name:"brush",initialState:sP,reducers:{setBrushSettings(e,t){return t.payload==null?sP:t.payload}}}),{setBrushSettings:rle}=dM.actions,Zte=dM.reducer;function ene(e){return(e%180+180)%180}var tne=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=ene(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)},nne={dots:[],areas:[],lines:[]},fM=$n({name:"referenceElements",initialState:nne,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:ile,removeDot:ale,addArea:ole,removeArea:lle,addLine:sle,removeLine:cle}=fM.actions,rne=fM.reducer,ine=h.createContext(void 0),ane=e=>{var{children:t}=e,[n]=h.useState("".concat(Bc("recharts"),"-clip")),r=om();if(r==null)return null;var{x:i,y:a,width:l,height:s}=r;return h.createElement(ine.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 pM(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 one(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return tne(r,n)}function lne(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 eu(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 sne(e,t){return pM(e,t+1)}function cne(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:pM(r,u)};var y=c,x,v=()=>(x===void 0&&(x=n(g,y)),x),b=g.coordinate,w=c===0||eu(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 une(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 k=y,S,E=()=>(S===void 0&&(S=n(j,k)),S),I=j.coordinate,D=y===f||eu(e,I,E,d,c);if(!D)return p=!1,1;D&&(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 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 Nn(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){dne(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 dne(e,t,n){return(t=fne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fne(e){var t=pne(e,"string");return typeof t=="symbol"?t:t+""}function pne(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 hne(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=eu(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 mne(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=eu(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,k,S=()=>(k===void 0&&(k=n(w,b)),k);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=eu(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)||wu.isSsr){var p;return(p=sne(i,ve(c)?c:0))!==null&&p!==void 0?p:[]}var m=[],g=s==="top"||s==="bottom"?"width":"height",y=f&&g==="width"?vc(f,{fontSize:t,letterSpacing:n}):{width:0,height:0},x=(k,S)=>{var E=typeof u=="function"?u(k.value,S):k.value;return g==="width"?one(vc(E,{fontSize:t,letterSpacing:n}),y,d):vc(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=lne(a,w,g);return c==="equidistantPreserveStart"?cne(w,j,x,i,l):c==="equidistantPreserveEnd"?une(w,j,x,i,l):(c==="preserveStart"||c==="preserveStartEnd"?m=mne(w,j,x,i,l,c==="preserveStartEnd"):m=hne(w,j,x,i,l),m.filter(k=>k.isShow))}var gne=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},vne={xAxis:{},yAxis:{}},hM=$n({name:"renderedTicks",initialState:vne,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:yne,removeRenderedTicks:xne}=hM.actions,bne=hM.reducer,wne=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function jne(e,t){if(e==null)return{};var n,r,i=Sne(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 Sne(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 Ko(){return Ko=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},Ko.apply(null,arguments)}function uP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uP(Object(n),!0).forEach(function(r){kne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kne(e,t,n){return(t=Cne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cne(e){var t=Pne(e,"string");return typeof t=="symbol"?t:t+""}function Pne(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 Ene(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=Ft(Ft(Ft({},c),qn(s)),{},{fill:"none"});if(a==="top"||a==="bottom"){var f=+(a==="top"&&!l||a==="bottom"&&l);u=Ft(Ft({},u),{},{x1:t,y1:n+f*i,x2:t+r,y2:n+f*i})}else{var d=+(a==="left"&&!l||a==="right"&&l);u=Ft(Ft({},u),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return h.createElement("line",Ko({},u,{className:Ze("recharts-cartesian-axis-line",Lo(s,"className"))}))}function Tne(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 One(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Ane(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Ine(e){var{option:t,tickProps:n,value:r}=e,i,a=Ze(n.className,"recharts-cartesian-axis-tick-value");if(h.isValidElement(t))i=h.cloneElement(t,Ft(Ft({},n),{},{className:a}));else if(typeof t=="function")i=t(Ft(Ft({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=Ze(l,eM(t))),i=h.createElement(Wh,Ko({},n,{className:l}),r)}return i}function Nne(e){var{ticks:t,axisType:n,axisId:r}=e,i=pt();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(yne({ticks:a,axisId:r,axisType:n})),()=>{i(xne({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:k,axisType:S,axisId:E}=e,I=Yb(Ft(Ft({},j),{},{ticks:n}),b,w),D=qn(j),O=Ro(r),_=U_(D.textAnchor)?D.textAnchor:One(f,d),M=Ane(f,d),G={};typeof i=="object"&&(G=i);var q=Ft(Ft({},D),{},{fill:"none"},G),A=I.map(T=>Ft({entry:T},Tne(T,p,m,g,y,f,x,d,v))),U=A.map(T=>{var{entry:z,line:P}=T;return h.createElement(Lt,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(z.value,"-").concat(z.coordinate,"-").concat(z.tickCoord)},i&&h.createElement("line",Ko({},q,P,{className:Ze("recharts-cartesian-axis-tick-line",Lo(i,"className"))})))}),K=A.map((T,z)=>{var P,$,{entry:ee,tick:N}=T,le=Ft(Ft(Ft(Ft({verticalAnchor:M},D),{},{textAnchor:_,stroke:"none",fill:a},N),{},{index:z,payload:ee,visibleTicksCount:I.length,tickFormatter:l,padding:c},u),{},{angle:(P=($=u==null?void 0:u.angle)!==null&&$!==void 0?$:D.angle)!==null&&P!==void 0?P:0}),me=Ft(Ft({},le),O);return h.createElement(Lt,Ko({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ee.value,"-").concat(ee.coordinate,"-").concat(ee.tickCoord)},pu(k,ee,z)),r&&h.createElement(Ine,{option:r,tickProps:me,value:"".concat(typeof l=="function"?l(ee.value,z):ee.value).concat(s||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(S,"-ticks")},h.createElement(Nne,{ticks:I,axisId:E,axisType:S}),K.length>0&&h.createElement(Gn,{zIndex:Gt.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(S,"-tick-labels"),ref:t},K)),U.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(S,"-tick-lines")},U))}),Mne=h.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:s,axisType:c,axisId:u}=e,f=jne(e,wne),[d,p]=h.useState(""),[m,g]=h.useState(""),y=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return gne({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),k=j.fontSize,S=j.letterSpacing;(k!==d||S!==m)&&(p(k),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:Ze("recharts-cartesian-axis",a)},h.createElement(Ene,{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(OZ,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement($Z,{label:e.label,labelRef:e.labelRef}),e.children)))}),Gb=h.forwardRef((e,t)=>{var n=Xt(e,Wi);return h.createElement(Mne,Ko({},n,{ref:t}))});Gb.displayName="CartesianAxis";var Rne=["x1","y1","x2","y2","key"],Dne=["offset"],Lne=["xAxisId","yAxisId"],zne=["xAxisId","yAxisId"];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 Mn(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){$ne(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 $ne(e,t,n){return(t=Bne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bne(e){var t=Fne(e,"string");return typeof t=="symbol"?t:t+""}function Fne(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 jo(){return jo=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},jo.apply(null,arguments)}function jp(e,t){if(e==null)return{};var n,r,i=Une(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 Une(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 Wne=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 mM(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,Rne),d=(i=qn(f))!==null&&i!==void 0?i:{},{offset:p}=d,m=jp(d,Dne);r=h.createElement("line",jo({},m,{x1:a,y1:l,x2:s,y2:c,fill:"none",key:u}))}return r}function Kne(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,Lne),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(mM,{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,zne),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(mM,{option:r,lineItemProps:d,key:"line-".concat(f)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function Hne(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 Vne(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 Yne=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return UA(Yb(Mn(Mn(Mn({},Wi),n),{},{ticks:WA(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Gne=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return UA(Yb(Mn(Mn(Mn({},Wi),n),{},{ticks:WA(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Xne={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Gt.grid};function ec(e){var t=w0(),n=j0(),r=eI(),i=Mn(Mn({},Xt(e,Xne)),{},{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=we(D=>cC(D,"xAxis",a,g)),x=we(D=>cC(D,"yAxis",l,g));if(!ki(u)||!ki(f)||!ve(s)||!ve(c))return null;var v=i.verticalCoordinatesGenerator||Yne,b=i.horizontalCoordinatesGenerator||Gne,{horizontalPoints:w,verticalPoints:j}=i;if((!w||!w.length)&&typeof b=="function"){var k=p&&p.length,S=b({yAxis:x?Mn(Mn({},x),{},{ticks:k?p:x.ticks}):void 0,width:t??u,height:n??f,offset:r},k?!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(Wne,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),h.createElement(Hne,jo({},i,{horizontalPoints:w})),h.createElement(Vne,jo({},i,{verticalPoints:j})),h.createElement(Kne,jo({},i,{offset:r,horizontalPoints:w,xAxis:y,yAxis:x})),h.createElement(qne,jo({},i,{offset:r,verticalPoints:j,xAxis:y,yAxis:x}))))}ec.displayName="CartesianGrid";var Qne={},gM=$n({name:"errorBars",initialState:Qne,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:ule,replaceErrorBar:dle,removeErrorBar:fle}=gM.actions,Jne=gM.reducer,Zne=["children"];function ere(e,t){if(e==null)return{};var n,r,i=tre(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 tre(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 nre={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},rre=h.createContext(nre);function vM(e){var{children:t}=e,n=ere(e,Zne);return h.createElement(rre.Provider,{value:n},t)}function lm(e,t){var n,r,i=we(u=>ia(u,e)),a=we(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 yM=(e,t,n,r)=>Ti(e,"xAxis",t,r),xM=(e,t,n,r)=>Ei(e,"xAxis",t,r),bM=(e,t,n,r)=>Ti(e,"yAxis",n,r),wM=(e,t,n,r)=>Ei(e,"yAxis",n,r),ire=H([Ye,yM,bM,xM,wM],(e,t,n,r,i)=>ti(e,"xAxis")?La(t,r,!1):La(n,i,!1)),are=(e,t,n,r,i)=>i;function ore(e){return e.type==="line"}var lre=H([Au,are],(e,t)=>e.filter(ore).find(n=>n.id===t)),sre=H([Ye,yM,bM,xM,wM,lre,ire,Su],(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 Tre({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:l,displayedData:m})}});function jM(e){var t=Ro(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 cre=["id"],ure=["type","layout","connectNulls","needClip","shape"],dre=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function tu(){return tu=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},tu.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 pi(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){fre(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 fre(e,t,n){return(t=pre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pre(e){var t=hre(e,"string");return typeof t=="symbol"?t:t+""}function hre(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=mre(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 mre(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 gre=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}]},vre=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})}),SM=(e,t)=>"".concat(t,"px ").concat(e,"px");function yre(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var xre=(e,t,n)=>{var r=n.reduce((p,m)=>p+m,0);if(!r)return SM(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[...yre(n,i),...l,...d].map(p=>"".concat(p,"px")).join(", ")};function bre(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:l}=r,{id:s}=r,c=Qb(r,cre),u=qn(c);return h.createElement(lM,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:l,clipPathId:t})}function wre(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 pP(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,ure),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,tu({shapeType:"curve",option:f},p,{pathRef:n})),h.createElement(bre,{points:r,clipPathId:t,props:a}))}function jre(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Sre(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,k]=h.useState(!1),S=!j,E=h.useCallback(()=>{typeof y=="function"&&y(),k(!1)},[y]),I=h.useCallback(()=>{typeof x=="function"&&x(),k(!0)},[x]),D=jre(r.current),O=h.useRef(0);w.current!==b&&(O.current=a.current,w.current=b);var _=O.current;return h.createElement(wre,{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},M=>{var G=ot(_,D+_,M),q=Math.min(G,D),A;if(c)if(s){var U="".concat(s).split(/[,\s]+/gim).map(z=>parseFloat(z));A=xre(q,D,U)}else A=SM(D,q);else A=s==null?void 0:String(s);if(M>0&&D>0&&(i.current=l,a.current=Math.max(a.current,q)),v){var K=v.length/l.length,T=M===1?l:l.map((z,P)=>{var $=Math.floor(P*K);if(v[$]){var ee=v[$];return pi(pi({},z),{},{x:ot(ee.x,z.x,M),y:ot(ee.y,z.y,M)})}return p?pi(pi({},z),{},{x:ot(m*2,z.x,M),y:ot(g/2,z.y,M)}):pi(pi({},z),{},{x:z.x,y:z.y})});return i.current=T,h.createElement(pP,{props:n,points:T,clipPathId:t,pathRef:r,strokeDasharray:A})}return h.createElement(pP,{props:n,points:l,clipPathId:t,pathRef:r,strokeDasharray:A})}),h.createElement(Kh,{label:n.label}))}function kre(e){var{clipPathId:t,props:n}=e,r=h.useRef(null),i=h.useRef(0),a=h.useRef(null);return h.createElement(Sre,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var Cre=(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:nt(e.payload,t)}};class Pre 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=Ze("recharts-line",i),y=d,{r:x,strokeWidth:v}=jM(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(vM,{xAxisId:a,yAxisId:l,data:r,dataPointFormatter:Cre,errorBarOffset:0},h.createElement(kre,{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 kM={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 Ere(e){var t=Xt(e,kM),{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,dre),{needClip:v}=lm(m,g),b=om(),w=Va(),j=xn(),k=we(O=>sre(O,m,g,j,y));if(w!=="horizontal"&&w!=="vertical"||k==null||b==null)return null;var{height:S,width:E,x:I,y:D}=b;return h.createElement(Pre,tu({},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:k,layout:w,height:S,width:E,left:I,top:D,needClip:v}))}function Tre(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=nt(u,l);if(t==="horizontal"){var p=qf({axis:n,ticks:i,bandSize:s,entry:u,index:f}),m=Et(d)?null:r.scale.map(d);return{x:p,y:m??null,value:d,payload:u}}var g=Et(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 Ore(e){var t=Xt(e,kM),n=xn();return h.createElement(im,{id:t.id,type:"line"},r=>h.createElement(h.Fragment,null,h.createElement(Hb,{legendPayload:gre(t)}),h.createElement(vre,{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(Ere,tu({},t,{id:r}))))}var Qd=h.memo(Ore,Go);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:sM}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:sM}var CM=(e,t,n)=>Ti(e,"xAxis",Oi(e,t),n),PM=(e,t,n)=>Ei(e,"xAxis",Oi(e,t),n),EM=(e,t,n)=>Ti(e,"yAxis",Ai(e,t),n),TM=(e,t,n)=>Ei(e,"yAxis",Ai(e,t),n),Are=H([Ye,CM,EM,PM,TM],(e,t,n,r,i)=>ti(e,"xAxis")?La(t,r,!1):La(n,i,!1)),Ire=(e,t)=>t,OM=H([Au,Ire],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),AM=e=>{var t=Ye(e),n=ti(t,"xAxis");return n?"yAxis":"xAxis"},Nre=(e,t)=>{var n=AM(e);return n==="yAxis"?Ai(e,t):Oi(e,t)},_re=(e,t,n)=>hp(e,AM(e),Nre(e,t),n),Mre=H([OM,_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]])}}}),Rre=H([Ye,CM,EM,PM,TM,Mre,EI,Are,OM,F7],(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 tie({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:g,chartBaseValue:u,bandSize:s})}}),Dre=["id"],Lre=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oo.apply(null,arguments)}function IM(e,t){if(e==null)return{};var n,r,i=zre(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 zre(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 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 Tl(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){$re(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 $re(e,t,n){return(t=Bre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bre(e){var t=Fre(e,"string");return typeof t=="symbol"?t:t+""}function Fre(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 Ure=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}]},Wre=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 Kre(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:l}=r,s=qn(r);return h.createElement(lM,{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 mP(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=IM(a,Dre),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,Oo({},g,{id:d,points:t,connectNulls:u,type:s,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),c!=="none"&&h.createElement(Ll,Oo({},m,{className:"recharts-area-curve",layout:l,type:s,connectNulls:u,fill:"none",points:t})),c!=="none"&&f&&Array.isArray(n)&&h.createElement(Ll,Oo({},m,{className:"recharts-area-curve",layout:l,type:s,connectNulls:u,fill:"none",points:n}))),h.createElement(Kre,{points:t,props:p,clipPathId:i}))}function Hre(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(!Be(s)||!Be(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 Vre(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(!Be(s)||!Be(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 Yre(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?h.createElement(Hre,{alpha:t,points:r,baseLine:i,strokeWidth:a}):h.createElement(Vre,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Gre(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]),k=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:k,key:y},I=>{if(S){var D=S.length/l.length,O=I===1?l:l.map((M,G)=>{var q=Math.floor(G*D);if(S[q]){var A=S[q];return Tl(Tl({},M),{},{x:ot(A.x,M.x,I),y:ot(A.y,M.y,I)})}return M}),_;return ve(s)?_=ot(E,s,I):Et(s)||Jr(s)?_=ot(E,0,I):_=s.map((M,G)=>{var q=Math.floor(G*D);if(Array.isArray(E)&&E[q]){var A=E[q];return Tl(Tl({},M),{},{x:ot(A.x,M.x,I),y:ot(A.y,M.y,I)})}return M}),I>0&&(i.current=O,a.current=_),h.createElement(mP,{points:O,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(Yre,{alpha:I,points:l,baseLine:s,layout:x,strokeWidth:r.strokeWidth}))),h.createElement(Lt,{clipPath:"url(#animationClipPath-".concat(n,")")},h.createElement(mP,{points:l,baseLine:s,needClip:t,clipPathId:n,props:r})))}),h.createElement(Kh,{label:r.label}))}function Xre(e){var{needClip:t,clipPathId:n,props:r}=e,i=h.useRef(null),a=h.useRef();return h.createElement(Gre,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class Qre 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=Ze("recharts-area",i),x=p,{r:v,strokeWidth:b}=jM(n),w=Fb(n),j=v*2+b,k=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(Xre,{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:k}),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:k}))}}var Jre={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 Zre(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=IM(e,Lre),v=Va(),b=T_(),{needClip:w}=lm(g,y),j=xn(),{points:k,isRange:S,baseLine:E}=(t=we(G=>Rre(G,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:D,width:O,x:_,y:M}=I;return!k||!k.length?null:h.createElement(Qre,Oo({},x,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:E,connectNulls:l,dot:s,fill:c,fillOpacity:u,height:D,hide:f,layout:v,isAnimationActive:d,isRange:S,legendType:p,needClip:w,points:k,stroke:m,width:O,left:_,top:M,xAxisId:g,yAxisId:y}))}var eie=(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 tie(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=eie(a,l,n,s,c),x=a==="horizontal",v=!1,b=u.map((j,k)=>{var S,E,I,D;if(g)D=i[f+k];else{var O=nt(j,r);Array.isArray(O)?(D=O,v=!0):D=[y,O]}var _=(S=(E=D)===null||E===void 0?void 0:E[1])!==null&&S!==void 0?S:null,M=_==null||g&&!t&&nt(j,r)==null;if(x){var G;return{x:qf({axis:s,ticks:d,bandSize:m,entry:j,index:k}),y:M?null:(G=c.scale.map(_))!==null&&G!==void 0?G:null,value:D,payload:j}}return{x:M?null:(I=s.scale.map(_))!==null&&I!==void 0?I:null,y:qf({axis:c,ticks:p,bandSize:m,entry:j,index:k}),value:D,payload:j}}),w;return g||v?w=b.map(j=>{var k,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&&(k=s.scale.map(S))!==null&&k!==void 0?k: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 nie(e){var t=Xt(e,Jre),n=xn();return h.createElement(im,{id:t.id,type:"area"},r=>h.createElement(h.Fragment,null,h.createElement(Hb,{legendPayload:Ure(t)}),h.createElement(Wre,{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:KA(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),h.createElement(Zre,Oo({},t,{id:r}))))}var Cy=h.memo(nie,Go);Cy.displayName="Area";var rie="Invariant failed";function iie(e,t){throw new Error(rie)}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 aie=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)||Et(r);return a?t(r,i):(a||iie(),n)}},oie=(e,t,n)=>n,lie=(e,t)=>t,Du=H([Au,lie],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),sie=H([Du],e=>e==null?void 0:e.maxBarSize),cie=(e,t,n,r)=>r,uie=H([Ye,Au,Oi,Ai,oie],(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")),die=(e,t,n)=>{var r=Ye(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)},fie=(e,t)=>{var n=Ye(e),r=Oi(e,t),i=Ai(e,t);if(!(r==null||i==null))return n==="horizontal"?sC(e,"xAxis",r):sC(e,"yAxis",i)},pie=H([uie,B7,fie],Kte),hie=(e,t,n)=>{var r,i,a=Du(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=Ye(e),u=$I(e),{maxBarSize:f}=a,d=Et(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},NM=(e,t,n)=>{var r=Ye(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)}},mie=H([pie,$I,$7,BI,hie,NM,sie],Gte),gie=(e,t,n)=>{var r=Oi(e,t);if(r!=null)return Ti(e,"xAxis",r,n)},vie=(e,t,n)=>{var r=Ai(e,t);if(r!=null)return Ti(e,"yAxis",r,n)},yie=(e,t,n)=>{var r=Oi(e,t);if(r!=null)return Ei(e,"xAxis",r,n)},xie=(e,t,n)=>{var r=Ai(e,t);if(r!=null)return Ei(e,"yAxis",r,n)},bie=H([mie,Du],Qte),wie=H([die,Du],Xte),jie=H([cn,y0,gie,vie,yie,xie,bie,Ye,EI,NM,wie,Du,cie],(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 Xie({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})}}),Sie=["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 kie(e,t){if(e==null)return{};var n,r,i=Cie(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 Cie(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 _M=h.createContext(void 0),Pie=e=>{var t=h.useContext(_M);if(t!=null)return t.stackId;if(e!=null)return KA(e)},Eie=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),Tie=e=>{var t=h.useContext(_M);if(t!=null){var{stackId:n}=t;return"url(#".concat(Eie(n,e),")")}},MM=e=>{var{index:t}=e,n=kie(e,Sie),r=Tie(t);return h.createElement(Lt,Ey({className:"recharts-bar-stack-layer",clipPath:r},n))},Oie=["onMouseEnter","onMouseLeave","onClick"],Aie=["value","background","tooltipPosition"],Iie=["id"],Nie=["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 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 Un(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){_ie(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 _ie(e,t,n){return(t=Mie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mie(e){var t=Rie(e,"string");return typeof t=="symbol"?t:t+""}function Rie(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=Die(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 Die(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 Lie=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}]},zie=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 $ie(e){var t=we(za),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:s,onClick:c}=a,u=kp(a,Oie),f=Wb(l,r,a.id),d=Kb(s),p=qb(c,r,a.id);if(!i||n==null)return null;var m=Ro(i);return h.createElement(Gn,{zIndex:Jte(i,Gt.barBackground)},n.map((g,y)=>{var{value:x,background:v,tooltipPosition:b}=g,w=kp(g,Aie);if(!v)return null;var j=f(g,y),k=d(g,y),S=p(g,y),E=Un(Un(Un(Un(Un({option:i,isActive:String(y)===t},w),{},{fill:"#eee"},v),m),pu(u,g,y)),{},{onMouseEnter:j,onMouseLeave:k,onClick:S,dataKey:r,index:y,className:"recharts-bar-background-rectangle"});return h.createElement(Jb,Ba({key:"background-bar-".concat(y)},E))}))}function Bie(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 Fie(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,s=we(za),c=we(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(MM,{index:i.originalDataIndex},b)):b}function Uie(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 Wie(e){var t,{data:n,props:r}=e,i=(t=qn(r))!==null&&t!==void 0?t:{},{id:a}=i,l=kp(i,Iie),{shape:s,dataKey:c,activeBar:u}=r,{onMouseEnter:f,onClick:d,onMouseLeave:p}=r,m=kp(r,Nie),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(MM,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"},pu(m,v,b),{onMouseEnter:g(v,b),onMouseLeave:y(v,b),onClick:x(v,b)}),u?h.createElement(Fie,{shape:s,activeBar:u,baseProps:l,entry:v,index:b,dataKey:c}):h.createElement(Uie,{shape:s,baseProps:l,entry:v,index:b,dataKey:c})))):null}function Kie(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(Bie,{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,k)=>{var S=d&&d[k];if(S)return Un(Un({},j),{},{x:ot(S.x,j.x,b),y:ot(S.y,j.y,b),width:ot(S.width,j.width,b),height:ot(S.height,j.height,b)});if(i==="horizontal"){var E=ot(0,j.height,b),I=ot(j.stackedBarStart,j.y,b);return Un(Un({},j),{},{y:I,height:E})}var D=ot(0,j.width,b),O=ot(j.stackedBarStart,j.x,b);return Un(Un({},j),{},{width:D,x:O})});return b>0&&(n.current=w??null),w==null?null:h.createElement(Lt,null,h.createElement(Wie,{props:t,data:w}))}),h.createElement(Kh,{label:t.label}),t.children)}function qie(e){var t=h.useRef(null);return h.createElement(Kie,{previousRectanglesRef:t,props:e})}var RM=0,Hie=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:nt(e,t)}};class Vie 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=Ze("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($ie,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),h.createElement(qie,this.props)))}}var Yie={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:RM,xAxisId:0,yAxisId:0,zIndex:Gt.bar};function Gie(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,Ru),y=we(b=>jie(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(vM,{xAxisId:t,yAxisId:n,data:y,dataPointFormatter:Hie,errorBarOffset:x},h.createElement(Vie,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 Xie(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=jq({numericAxis:v}),j=v.scale.map(w);return p.map((k,S)=>{var E,I,D,O,_,M;if(d){var G=d[S+x];if(G==null)return null;E=vq(G,b)}else E=nt(k,n),Array.isArray(E)||(E=[w,E]);var q=aie(r,RM)(E[1],S);if(t==="horizontal"){var A,U=c.scale.map(E[0]),K=c.scale.map(E[1]);if(U==null||K==null)return null;I=fS({axis:s,ticks:u,bandSize:l,offset:a.offset,entry:k,index:S}),D=(A=K??U)!==null&&A!==void 0?A:void 0,O=a.size;var T=U-K;if(_=Jr(T)?0:T,M={x:I,y:m.top,width:O,height:m.height},Math.abs(q)>0&&Math.abs(_)<Math.abs(q)){var z=vn(_||q)*(Math.abs(q)-Math.abs(_));D-=z,_+=z}}else{var P=s.scale.map(E[0]),$=s.scale.map(E[1]);if(P==null||$==null)return null;if(I=P,D=fS({axis:c,ticks:f,bandSize:l,offset:a.offset,entry:k,index:S}),O=$-P,_=a.size,M={x:m.left,y:D,width:m.width,height:_},Math.abs(q)>0&&Math.abs(O)<Math.abs(q)){var ee=vn(O||q)*(Math.abs(q)-Math.abs(O));O+=ee}}if(I==null||D==null||O==null||_==null||!i&&(O===0||_===0))return null;var N=Un(Un({},k),{},{stackedBarStart:j,x:I,y:D,width:O,height:_,value:d?E:E[1],payload:k,background:M,tooltipPosition:{x:I+O/2,y:D+_/2},parentViewBox:y,originalDataIndex:S},g&&g[S]&&g[S].props);return N}).filter(Boolean)}function Qie(e){var t=Xt(e,Yie),n=Pie(t.stackId),r=xn();return h.createElement(im,{id:t.id,type:"bar"},i=>h.createElement(h.Fragment,null,h.createElement(Hb,{legendPayload:Lie(t)}),h.createElement(zie,{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(Gie,Ba({},t,{id:i})))))}var DM=h.memo(Qie,Go);DM.displayName="Bar";var Jie=["domain","range"],Zie=["domain","range"];function vP(e,t){if(e==null)return{};var n,r,i=eae(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 eae(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 yP(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 LM(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=vP(e,Jie),{domain:a,range:l}=t,s=vP(t,Zie);return!yP(n,a)||!yP(r,l)?!1:Go(i,s)}var tae=["type"],nae=["dangerouslySetInnerHTML","ticks","scale"],rae=["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 xP(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?xP(Object(n),!0).forEach(function(r){iae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iae(e,t,n){return(t=aae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aae(e){var t=oae(e,"string");return typeof t=="symbol"?t:t+""}function oae(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=lae(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 lae(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 sae(e){var t=pt(),n=h.useRef(null),r=S0(),{type:i}=e,a=Oy(e,tae),l=Ph(r,"xAxis",i),s=h.useMemo(()=>{if(l!=null)return bP(bP({},a),{},{type:l})},[a,l]);return h.useLayoutEffect(()=>{s!=null&&(n.current===null?t(Ote(s)):n.current!==s&&t(Ate({prev:n.current,next:s})),n.current=s)},[s,t]),h.useLayoutEffect(()=>()=>{n.current&&(t(Ite(n.current)),n.current=null)},[t]),null}var cae=e=>{var{xAxisId:t,className:n}=e,r=we(y0),i=xn(),a="xAxis",l=we(v=>r_(v,a,t,i)),s=we(v=>e_(v,t)),c=we(v=>bX(v,t)),u=we(v=>NN(v,t));if(s==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:f,ticks:d,scale:p}=e,m=Oy(e,nae),{id:g,scale:y}=u,x=Oy(u,rae);return h.createElement(Gb,Ty({},m,x,{x:c.x,y:c.y,width:s.width,height:s.height,className:Ze("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},uae={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},dae=e=>{var t=Xt(e,uae);return h.createElement(h.Fragment,null,h.createElement(sae,{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(cae,t))},tc=h.memo(dae,LM);tc.displayName="XAxis";var fae=["type"],pae=["dangerouslySetInnerHTML","ticks","scale"],hae=["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 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){mae(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 mae(e,t,n){return(t=gae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gae(e){var t=vae(e,"string");return typeof t=="symbol"?t:t+""}function vae(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=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 xae(e){var t=pt(),n=h.useRef(null),r=S0(),{type:i}=e,a=Iy(e,fae),l=Ph(r,"yAxis",i),s=h.useMemo(()=>{if(l!=null)return jP(jP({},a),{},{type:l})},[l,a]);return h.useLayoutEffect(()=>{s!=null&&(n.current===null?t(Nte(s)):n.current!==s&&t(_te({prev:n.current,next:s})),n.current=s)},[s,t]),h.useLayoutEffect(()=>()=>{n.current&&(t(Mte(n.current)),n.current=null)},[t]),null}function bae(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=h.useRef(null),l=h.useRef(null),s=we(y0),c=xn(),u=pt(),f="yAxis",d=we(S=>t_(S,t)),p=we(S=>jX(S,t)),m=we(S=>r_(S,f,t,c)),g=we(S=>_N(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(Rte({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,pae),{id:w,scale:j}=g,k=Iy(g,hae);return h.createElement(Gb,Ay({},b,k,{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:Ze("recharts-".concat(f," ").concat(f),n),viewBox:s,ticks:m,axisType:f,axisId:t}))}var wae={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},jae=e=>{var t=Xt(e,wae);return h.createElement(h.Fragment,null,h.createElement(xae,{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(bae,t))},nc=h.memo(jae,LM);nc.displayName="YAxis";var Sae=(e,t)=>t,Zb=H([Sae,Ye,VI,bn,w_,oa,WQ,cn],XQ);function kae(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function e1(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(kae(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 zM=vr("mouseClick"),$M=gu();$M.startListening({actionCreator:zM,effect:(e,t)=>{var n=e.payload,r=Zb(t.getState(),e1(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(zX({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Ny=vr("mouseMove"),BM=gu(),dl=null,io=null,jg=null;BM.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),io!==null&&(typeof i!="number"||!l)&&(clearTimeout(io),io=null),jg=e1(n);var s=()=>{var c=t.getState(),u=_u(c,c.tooltip.settings.shared);if(!jg){dl=null,io=null;return}if(u==="axis"){var f=Zb(c,jg);(f==null?void 0:f.activeIndex)!=null?t.dispatch(d_({activeIndex:f.activeIndex,activeDataKey:void 0,activeCoordinate:f.activeCoordinate})):t.dispatch(u_())}dl=null,io=null};if(!l){s();return}i==="raf"?dl=requestAnimationFrame(s):typeof i=="number"&&io===null&&(io=setTimeout(s,i))}});function Cae(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 SP={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},FM=$n({name:"rootProps",initialState:SP,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:SP.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}}}),Pae=FM.reducer,{updateOptions:Eae}=FM.actions,Tae=null,Oae={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)},UM=$n({name:"polarOptions",initialState:Tae,reducers:Oae}),{updatePolarOptions:Aae}=UM.actions,Iae=UM.reducer,WM=vr("keyDown"),KM=vr("focus"),qM=vr("blur"),sm=gu(),fl=null,ao=null,Ad=null;sm.startListening({actionCreator:WM,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");ao!==null&&(typeof r!="number"||!a)&&(clearTimeout(ao),ao=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=gc(u,Wo(s),ns(s),rs(s)),p=d==null?-1:Number(d),m=!Number.isFinite(p)||p<0,g=oa(s),y=Wo(s),x=_u(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=EX(s),w=b==="left-to-right"?1:-1,j=f==="ArrowRight"?1:-1,k;if(m){var S=ns(s),E=rs(s),I=j*w,D=q=>({active:!1,index:String(q),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(k=-1,I>0){for(var O=0;O<y.length;O++)if(gc(D(O),y,S,E)!=null){k=O;break}}else for(var _=y.length-1;_>=0;_--)if(gc(D(_),y,S,E)!=null){k=_;break}if(k<0)return}else{k=p+j*w;var M=(g==null?void 0:g.length)||y.length;if(M===0||k>=M||k<0)return}var G=vp(s,x,"hover",String(k));t.dispatch(gp({active:!0,activeIndex:k.toString(),activeCoordinate:G}))}finally{fl=null,ao=null}};if(!a){l();return}r==="raf"?fl=requestAnimationFrame(l):typeof r=="number"&&ao===null&&(l(),Ad=null,ao=setTimeout(()=>{Ad?l():(ao=null,fl=null)},r))}});sm.startListening({actionCreator:KM,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=_u(n,n.tooltip.settings.shared),s=vp(n,l,"hover",String(a));t.dispatch(gp({active:!0,activeIndex:a,activeCoordinate:s}))}}}});sm.startListening({actionCreator:qM,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 HM(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"),VM=gu(),Id=new Map,Ks=new Map,Sg=new Map;VM.startListening({actionCreator:Cr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=HM(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=Ks.get(i);p!==void 0&&(typeof c!="number"||!d)&&(clearTimeout(p),Ks.delete(i));var m=()=>{var x=Sg.get(i);try{if(!x)return;var{handler:v,reactEvent:b}=x,w=t.getState(),j={activeCoordinate:TQ(w),activeDataKey:Ob(w),activeIndex:za(w),activeLabel:k_(w),activeTooltipIndex:za(w),isTooltipActive:OQ(w)};v&&v(j,b)}finally{Id.delete(i),Ks.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(!Ks.has(i)){m();var y=setTimeout(m,c);Ks.set(i,y)}}else m()}}});var Nae=H([bs],e=>e.tooltipItemPayloads),_ae=H([Nae,(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)}}}),YM=vr("touchMove"),GM=gu(),oo=null,da=null,kP=null,qs=null;GM.startListening({actionCreator:YM,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){qs=HM(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a.includes("touchmove");oo!==null&&(cancelAnimationFrame(oo),oo=null),da!==null&&(typeof i!="number"||!l)&&(clearTimeout(da),da=null),kP=Array.from(n.touches).map(c=>e1({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var s=()=>{if(qs!=null){var c=t.getState(),u=_u(c,c.tooltip.settings.shared);if(u==="axis"){var f,d=(f=kP)===null||f===void 0?void 0:f[0];if(d==null){oo=null,da=null;return}var p=Zb(c,d);(p==null?void 0:p.activeIndex)!=null&&t.dispatch(d_({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate}))}else if(u==="item"){var m,g=qs.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(HA),v=(m=y.getAttribute(VA))!==null&&m!==void 0?m:void 0,b=Jo(c).find(k=>k.id===v);if(x==null||b==null||v==null)return;var{dataKey:w}=b,j=_ae(c,x,v);t.dispatch(c_({activeDataKey:w,activeIndex:x,activeCoordinate:j,activeGraphicalItemId:v}))}oo=null,da=null}};if(!l){s();return}i==="raf"?oo=requestAnimationFrame(s):typeof i=="number"&&da===null&&(s(),qs=null,da=setTimeout(()=>{qs?s():(da=null,oo=null)},i))}}});var t1={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},XM=$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:Mae}=XM.actions,Rae=XM.reducer,Dae=pA({brush:Zte,cartesianAxis:Dte,chartData:CJ,errorBars:Jne,eventSettings:Rae,graphicalItems:Fee,layout:fq,legend:x9,options:bJ,polarAxis:tee,polarOptions:Iae,referenceElements:rne,renderedTicks:bne,rootProps:Pae,tooltip:$X,zIndex:cJ}),Lae=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return LK({reducer:Dae,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([$M.middleware,BM.middleware,sm.middleware,VM.middleware,GM.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(TA({type:"raf"}))},devTools:{serialize:{replacer:Cae},name:"recharts-".concat(n)}})};function QM(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=xn(),a=h.useRef(null);if(i)return n;a.current==null&&(a.current=Lae(t,r));var l=c0;return h.createElement(F9,{context:l,store:a.current},n)}function zae(e){var{layout:t,margin:n}=e,r=pt(),i=xn();return h.useEffect(()=>{i||(r(cq(t)),r(sq(n)))},[r,i,t,n]),null}var JM=h.memo(zae,Go);function ZM(e){var t=pt();return h.useEffect(()=>{t(Eae(e))},[t,e]),null}var $ae=e=>{var t=pt();return h.useEffect(()=>{t(Mae(e))},[t,e]),null},eR=h.memo($ae,Go);function CP(e){var{zIndex:t,isPanorama:n}=e,r=h.useRef(null),i=pt();return h.useLayoutEffect(()=>(r.current&&i(lJ({zIndex:t,element:r.current,isPanorama:n})),()=>{i(sJ({zIndex:t,isPanorama:n}))}),[i,t,n]),h.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function PP(e){var{children:t,isPanorama:n}=e,r=we(JQ);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(CP,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>h.createElement(CP,{key:l,zIndex:l,isPanorama:n})))}var Bae=["children"];function Fae(e,t){if(e==null)return{};var n,r,i=Uae(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 Uae(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 Wae={width:"100%",height:"100%",display:"block"},Kae=h.forwardRef((e,t)=>{var n=w0(),r=j0(),i=pI();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:Wae,ref:t}),a)}),qae=e=>{var{children:t}=e,n=we(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)},EP=h.forwardRef((e,t)=>{var{children:n}=e,r=Fae(e,Bae),i=xn();return i?h.createElement(qae,null,h.createElement(PP,{isPanorama:!0},n)):h.createElement(Kae,Cp({ref:t},r),h.createElement(PP,{isPanorama:!1},n))});function Hae(){var e=pt(),[t,n]=h.useState(null),r=we(Tq);return h.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Be(a)&&a!==r&&e(dq(a))}},[t,e,r]),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 Vae(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){Yae(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 Yae(e,t,n){return(t=Gae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gae(e){var t=Xae(e,"string");return typeof t=="symbol"?t:t+""}function Xae(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 Qae=()=>(MJ(),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 Jae=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(yu,{width:a.containerWidth,height:a.containerHeight}),h.createElement("div",_a({ref:c},e)))}),Zae=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(yu,{width:i.containerWidth,height:i.containerHeight}),h.createElement("div",_a({ref:s},e)))}),eoe=h.forwardRef((e,t)=>{var{width:n,height:r}=e;return h.createElement(h.Fragment,null,h.createElement(yu,{width:n,height:r}),h.createElement("div",_a({ref:t},e)))}),toe=h.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?h.createElement(Zae,_a({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?h.createElement(eoe,_a({},e,{width:n,height:r,ref:t})):h.createElement(h.Fragment,null,h.createElement(yu,{width:n,height:r}),h.createElement("div",_a({ref:t},e)))});function noe(e){return e?Jae:toe}var roe=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),k=pt(),[S,E]=h.useState(null),[I,D]=h.useState(null),O=Hae(),_=x0(),M=(_==null?void 0:_.width)>0?_.width:v,G=(_==null?void 0:_.height)>0?_.height:i,q=h.useCallback(Z=>{O(Z),typeof t=="function"&&t(Z),E(Z),D(Z),Z!=null&&(j.current=Z)},[O,t,E,D]),A=h.useCallback(Z=>{k(zM(Z)),k(Cr({handler:a,reactEvent:Z}))},[k,a]),U=h.useCallback(Z=>{k(Ny(Z)),k(Cr({handler:u,reactEvent:Z}))},[k,u]),K=h.useCallback(Z=>{k(u_()),k(Cr({handler:f,reactEvent:Z}))},[k,f]),T=h.useCallback(Z=>{k(Ny(Z)),k(Cr({handler:d,reactEvent:Z}))},[k,d]),z=h.useCallback(()=>{k(KM())},[k]),P=h.useCallback(()=>{k(qM())},[k]),$=h.useCallback(Z=>{k(WM(Z.key))},[k]),ee=h.useCallback(Z=>{k(Cr({handler:l,reactEvent:Z}))},[k,l]),N=h.useCallback(Z=>{k(Cr({handler:s,reactEvent:Z}))},[k,s]),le=h.useCallback(Z=>{k(Cr({handler:c,reactEvent:Z}))},[k,c]),me=h.useCallback(Z=>{k(Cr({handler:p,reactEvent:Z}))},[k,p]),X=h.useCallback(Z=>{k(Cr({handler:y,reactEvent:Z}))},[k,y]),ne=h.useCallback(Z=>{w&&k(YM(Z)),k(Cr({handler:g,reactEvent:Z}))},[k,w,g]),ue=h.useCallback(Z=>{k(Cr({handler:m,reactEvent:Z}))},[k,m]),Q=noe(b);return h.createElement(__.Provider,{value:S},h.createElement(aO.Provider,{value:I},h.createElement(Q,{width:M??(x==null?void 0:x.width),height:G??(x==null?void 0:x.height),className:Ze("recharts-wrapper",r),style:Vae({position:"relative",cursor:"default",width:M,height:G},x),onClick:A,onContextMenu:ee,onDoubleClick:N,onFocus:z,onBlur:P,onKeyDown:$,onMouseDown:le,onMouseEnter:U,onMouseLeave:K,onMouseMove:T,onMouseUp:me,onTouchEnd:ue,onTouchMove:ne,onTouchStart:X,ref:q},h.createElement(Qae,null),n)))}),ioe=["width","height","responsive","children","className","style","compact","title","desc"];function aoe(e,t){if(e==null)return{};var n,r,i=ooe(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 ooe(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 tR=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=aoe(e,ioe),p=qn(d);return c?h.createElement(h.Fragment,null,h.createElement(yu,{width:n,height:r}),h.createElement(EP,{otherAttributes:p,title:u,desc:f},a)):h.createElement(roe,{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(EP,{otherAttributes:p,title:u,desc:f,ref:t},h.createElement(ane,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 OP(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 loe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OP(Object(n),!0).forEach(function(r){soe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function soe(e,t,n){return(t=coe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function coe(e){var t=uoe(e,"string");return typeof t=="symbol"?t:t+""}function uoe(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 doe={top:5,right:5,bottom:5,left:5},foe=loe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:doe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},t1),n1=h.forwardRef(function(t,n){var r,i=Xt(t.categoricalChartProps,foe),{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(QM,{preloadedState:{options:f},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},h.createElement(uM,{chartData:u.data}),h.createElement(JM,{layout:i.layout,margin:i.margin}),h.createElement(eR,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),h.createElement(ZM,{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(tR,_y({},i,{ref:n})))}),poe=["axis"],AP=h.forwardRef((e,t)=>h.createElement(n1,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:poe,tooltipPayloadSearcher:Uh,categoricalChartProps:e,ref:t})),hoe=["axis","item"],moe=h.forwardRef((e,t)=>h.createElement(n1,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:hoe,tooltipPayloadSearcher:Uh,categoricalChartProps:e,ref:t}));function goe(e){var t=pt();return h.useEffect(()=>{t(Aae(e))},[t,e]),null}var voe=["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 yoe(e,t){if(e==null)return{};var n,r,i=xoe(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 xoe(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 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 boe(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){woe(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 woe(e,t,n){return(t=joe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function joe(e){var t=Soe(e,"string");return typeof t=="symbol"?t:t+""}function Soe(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 koe={top:5,right:5,bottom:5,left:5},nR=boe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:koe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},t1),Coe=h.forwardRef(function(t,n){var r,i=Xt(t.categoricalChartProps,nR),{layout:a}=i,l=yoe(i,voe),{chartName:s,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f}=t,d={chartName:s,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return h.createElement(QM,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:s},h.createElement(uM,{chartData:i.data}),h.createElement(JM,{layout:a,margin:i.margin}),h.createElement(eR,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),h.createElement(ZM,{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(goe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),h.createElement(tR,My({},l,{ref:n})))});function NP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _P(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NP(Object(n),!0).forEach(function(r){Poe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Poe(e,t,n){return(t=Eoe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eoe(e){var t=Toe(e,"string");return typeof t=="symbol"?t:t+""}function Toe(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 Ooe=["item"],Aoe=_P(_P({},nR),{},{layout:"centric",startAngle:0,endAngle:360}),Ioe=h.forwardRef((e,t)=>{var n=Xt(e,Aoe);return h.createElement(Coe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Ooe,tooltipPayloadSearcher:Uh,categoricalChartProps:n,ref:t})}),Noe=["axis"],_oe=h.forwardRef((e,t)=>h.createElement(n1,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Noe,tooltipPayloadSearcher:Uh,categoricalChartProps:e,ref:t}));const MP=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#f97316"];function Moe(){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 V.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(_s,{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(ec,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(tc,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>st(d).format("MM/DD")}),o.jsx(nc,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Us,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>st(d).format("YYYY-MM-DD")}),o.jsx(Qs,{}),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(_s,{width:"100%",height:300,children:o.jsxs(AP,{data:e.timeline,children:[o.jsx(ec,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(tc,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>st(d).format("MM/DD")}),o.jsx(nc,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d?s(Number(d)):""}),o.jsx(Us,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>st(d).format("YYYY-MM-DD"),formatter:d=>d?s(Number(d)):""}),o.jsx(Qs,{}),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(_s,{width:"100%",height:300,children:o.jsxs(AP,{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(ec,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(tc,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>st(d).format("MM/DD")}),o.jsx(nc,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d!=null?d>=60?`${Math.round(Number(d)/60)}h`:`${Number(d)}m`:""}),o.jsx(Us,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>st(d).format("YYYY-MM-DD"),formatter:d=>d!=null?c(Number(d)):""}),o.jsx(Qs,{}),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(_s,{width:"100%",height:300,children:o.jsxs(moe,{data:e.byVendor,children:[o.jsx(ec,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(tc,{dataKey:"vendorName",stroke:"var(--text-muted)",fontSize:12,angle:-45,textAnchor:"end",height:80}),o.jsx(nc,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Us,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"}}),o.jsx(Qs,{}),o.jsx(DM,{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(_s,{width:"100%",height:300,children:o.jsxs(Ioe,{children:[o.jsx(oM,{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(Ru,{fill:MP[p%MP.length]},`cell-${p}`))}),o.jsx(Us,{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 RP({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 Roe(){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,k]=h.useState(!1),[S,E]=h.useState([]),[I,D]=h.useState(!1),[O,_]=h.useState({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}),M=async()=>{try{a(!0);const X=await V.getInstalledSkills();r(X)}catch(X){console.error("Failed to load installed skills:",X),W.error("加载已安装 Skills 失败")}finally{a(!1)}};h.useEffect(()=>{M()},[]);const G=async()=>{const X=b.trim();if(!X){W.warning("请输入需求描述后再搜索");return}try{k(!0),D(!0);const ue=(await V.searchSkills(X)).sort((Q,Z)=>{const he=Q.stars??0;return(Z.stars??0)-he});E(ue)}catch(ne){console.error("Failed to search skills:",ne),W.error("搜索失败,请稍后重试")}finally{k(!1)}},q=X=>{_({skill:X,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},A=()=>{O.isInstalling||_({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},U=(X,ne)=>{_(ue=>({...ue,selectedTargets:ne?[...ue.selectedTargets,X]:ue.selectedTargets.filter(Q=>Q!==X)}))},K=async()=>{var X;if(O.skill)try{_(ue=>({...ue,isInstalling:!0,status:"preparing",message:"正在准备安装...",progress:0})),_(ue=>({...ue,status:"downloading",message:"正在从GitHub下载..."}));const ne=await V.installSkill(O.skill,O.selectedTargets[0]);if(ne.success){const ue=O.selectedTargets,Q=(X=ne.installedSkill)==null?void 0:X.id;if(!Q){_(he=>({...he,status:"error",message:"安装返回数据异常"})),W.error("安装返回数据异常");return}let Z=0;for(const he of ue)(await V.enableSkill(Q,he)).success&&Z++;_(he=>({...he,status:"completed",message:ue.length>0?`安装完成!已启用 ${Z}/${ue.length} 个目标`:"安装完成!可在列表中启用目标",progress:100})),ue.length>0?W.success(`已安装到 ${ue.map(he=>he==="claude-code"?"Claude Code":"Codex").join(", ")}`):W.success("安装完成!可在列表中启用目标"),await M()}else _(ue=>({...ue,status:"error",message:ne.message?`${ne.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试"})),W.error(ne.message?`${ne.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试")}catch(ne){console.error("Failed to install skill:",ne),_(ue=>({...ue,status:"error",message:"安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理"})),W.error("安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理")}finally{setTimeout(()=>{_(ne=>({...ne,skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}))},2e3)}},T=async(X,ne,ue)=>{try{ue?(await V.enableSkill(X,ne),W.success(`已启用 ${ne==="claude-code"?"Claude Code":"Codex"}`)):(await V.disableSkill(X,ne),W.success(`已禁用 ${ne==="claude-code"?"Claude Code":"Codex"}`)),await M()}catch(Q){console.error("Failed to toggle skill:",Q),W.error("操作失败,请稍后重试")}},z=X=>{s({skillId:X.id,skillName:X.name,isDeleting:!1})},P=()=>{l.isDeleting||s({skillId:null,skillName:"",isDeleting:!1})},$=async()=>{if(l.skillId)try{s(X=>({...X,isDeleting:!0})),await V.deleteSkill(l.skillId),W.success("已删除 Skill"),await M(),P()}catch(X){console.error("Failed to delete skill:",X),W.error("删除失败,请稍后重试"),s(ne=>({...ne,isDeleting:!1}))}},ee=()=>{try{const X=x.trim();if(!X){W.error("请粘贴 SKILL.md 内容");return}let ne="",ue="",Q=X;if(X.startsWith("---")){const Z=X.indexOf("---",3);if(Z!==-1){const he=X.slice(3,Z),te=X.match(/^#\s+(.+)$/m);ne=te?te[1].trim():"";const Ee=he.split(`
|
|
492
|
-
`);for(const ke of Ee)ke.startsWith("name:")?ne=ke.replace("name:","").trim():ke.startsWith("description:")&&(ue=ke.replace("description:","").trim());Q=X.slice(Z+3).trim(),Q=Q.replace(/^##\s+指令\n*/,"").trim()}}else{const Z=X.match(/^#\s+(.+)$/m);Z&&(ne=Z[1].trim())}if(!ne){W.error("无法解析 Skill 名称");return}d(Z=>({...Z,name:ne,description:ue||Z.description,instruction:Q||Z.instruction})),y(!1),v(""),W.success("解析成功")}catch(X){console.error("Failed to parse skill:",X),W.error("解析失败,请检查格式")}},N=async X=>{var ne;if(X.preventDefault(),!f.name.trim()){W.error("请填写 Skill 名称");return}if(!f.description.trim()){W.error("请填写描述");return}if(!f.instruction.trim()){W.error("请填写指令");return}try{m(!0);const ue=await V.createLocalSkill({name:f.name.trim(),description:f.description.trim(),instruction:f.instruction.trim(),link:f.link.trim()||void 0,targets:f.targets});if(ue.success){W.success("Skill 创建成功"),u(!1),d({name:"",description:"",instruction:"",link:"",targets:[]}),await M();for(const Q of f.targets)(ne=ue.installedSkill)!=null&&ne.id&&await V.enableSkill(ue.installedSkill.id,Q)}else W.error(ue.message||"创建失败")}catch(ue){console.error("Failed to create skill:",ue),W.error("创建失败,请稍后重试")}finally{m(!1)}},le=()=>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(X=>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:X.name}),o.jsxs("div",{style:{display:"flex",gap:"8px",flexShrink:0},children:[X.githubUrl&&o.jsx("a",{href:X.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:()=>z(X),style:{padding:"6px 12px",fontSize:"12px"},children:"删除"})]})]}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{className:"skill-description",children:X.description||"暂无描述"}),o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(X.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(_j,{skillId:X.id,targetType:"claude-code",enabled:X.enabledTargets.includes("claude-code"),onChange:T}),o.jsx(_j,{skillId:X.id,targetType:"codex",enabled:X.enabledTargets.includes("codex"),onChange:T})]})]},X.id))}),me=()=>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:X=>w(X.target.value),placeholder:"请输入你的需求...",className:"skills-search-input"}),o.jsx("div",{className:"skills-search-actions",children:o.jsx("button",{className:"btn btn-primary",onClick:G,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(X=>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:X.name}),X.stars!==void 0&&X.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:X.stars})]})]}),X.tags&&X.tags.length>0&&o.jsx("div",{className:"skill-tags",children:X.tags.map(ne=>o.jsx("span",{className:"badge badge-secondary",children:ne},ne))}),o.jsx("div",{className:"skill-description",children:X.description||"暂无描述"}),o.jsxs("div",{className:"skills-result-actions",children:[X.url?o.jsx("a",{className:"btn btn-secondary",href:X.url,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:"8px"},children:"查看"}):null,o.jsx("button",{className:"btn btn-secondary",onClick:()=>q(X),children:"安装"})]})]},X.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(X=>!X),children:e?"返回":"发现"})]})]}),e?me():le(),O.skill&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:A,disabled:O.isInstalling,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"520px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:O.status==="idle"?"选择安装目标":O.status==="completed"?"安装完成":O.status==="error"?"安装失败":"正在安装"})}),o.jsx("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:O.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{style:{marginBottom:"12px",color:"var(--text-muted)"},children:["即将安装:",o.jsx("strong",{children:O.skill.name})]}),O.skill.description&&o.jsx("p",{style:{marginBottom:"12px",color:"var(--text-muted)",fontSize:"14px"},children:O.skill.description}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)",marginBottom:"12px"},children:"选择安装目标(可多选):"}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:O.selectedTargets.includes("claude-code"),onChange:X=>U("claude-code",X.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"Claude Code"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:O.selectedTargets.includes("codex"),onChange:X=>U("codex",X.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:`${O.progress}%`,height:"100%",backgroundColor:O.status==="error"?"var(--error-color)":"var(--primary-color)",transition:"width 0.3s ease"}})}),o.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",marginBottom:"8px"},children:O.message}),O.status==="error"&&o.jsx("p",{style:{textAlign:"center",color:"var(--error)",fontSize:"14px"},children:O.message})]})}),o.jsx("div",{className:"modal-footer",style:{justifyContent:O.status!=="idle"?"center":"space-between"},children:O.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"btn btn-secondary",onClick:A,disabled:O.isInstalling,children:"取消"}),o.jsx("button",{className:"btn btn-primary",onClick:K,disabled:O.isInstalling,children:"确定安装"})]}):O.status==="completed"||O.status==="error"?o.jsx("button",{className:"btn btn-primary",onClick:A,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:P,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:P,disabled:l.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:$,disabled:l.isDeleting,children:l.isDeleting?"删除中...":"确认删除"})]})]})})]}),c&&o.jsx(RP,{isOpen:c,onClose:()=>u(!1),title:"新增 Skill",closeOnOverlayClick:!1,children:o.jsxs("form",{onSubmit:N,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:X=>d(ne=>({...ne,name:X.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:X=>d(ne=>({...ne,description:X.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:X=>d(ne=>({...ne,instruction:X.target.value})),placeholder:`当这个 Skill 被触发时,你希望模型遵循哪些规则或信息,例如:
|
|
493
|
-
# codemap
|
|
494
|
-
## 命令
|
|
495
|
-
## 使用场景
|
|
496
|
-
## 输出解释
|
|
497
|
-
## 示例`,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:X=>d(ne=>({...ne,link:X.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:X=>{X.target.checked?d(ne=>({...ne,targets:[...ne.targets,"claude-code"]})):d(ne=>({...ne,targets:ne.targets.filter(ue=>ue!=="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:X=>{X.target.checked?d(ne=>({...ne,targets:[...ne.targets,"codex"]})):d(ne=>({...ne,targets:ne.targets.filter(ue=>ue!=="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(RP,{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:X=>v(X.target.value),placeholder:`---
|
|
498
|
-
name: skill-name
|
|
499
|
-
description: Skill 描述
|
|
500
|
-
---
|
|
501
|
-
|
|
502
|
-
# Skill 名称
|
|
503
|
-
|
|
504
|
-
Skill 描述
|
|
505
|
-
|
|
506
|
-
## 指令
|
|
507
|
-
|
|
508
|
-
技能指令内容...`,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:ee,children:"解析并填充"})]})]})]})}const Doe=[{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 Loe(){var G,q;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 A=await V.getMCPs();t(A)}catch(A){console.error("Failed to load MCPs:",A),W.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=A=>{s(A),u({name:A.name,description:A.description||"",type:A.type,command:A.command||"",args:A.args?A.args.join(" "):"",url:A.url||"",headers:A.headers?JSON.stringify(A.headers,null,2):"",env:A.env?JSON.stringify(A.env,null,2):"",targets:A.targets||[]}),a(!0)},w=()=>{f||(a(!1),s(null))},j=async A=>{var U,K;if(A.preventDefault(),!c.name.trim()){W.error("请填写 MCP 名称");return}if(c.type==="stdio"&&!c.command){W.error("请填写命令");return}if((c.type==="http"||c.type==="sse")&&!c.url){W.error("请填写 URL");return}try{d(!0);const T={},z={};if(c.env)try{Object.assign(T,JSON.parse(c.env))}catch{W.error("环境变量格式错误,请使用有效的 JSON 格式");return}if(c.headers)try{Object.assign(z,JSON.parse(c.headers))}catch{W.error("请求头格式错误,请使用有效的 JSON 格式");return}const P={name:c.name.trim(),description:c.description.trim(),type:c.type,command:(U=c.command)==null?void 0:U.trim(),args:c.args?c.args.trim().split(/\s+/):void 0,url:(K=c.url)==null?void 0:K.trim(),headers:Object.keys(z).length>0?z:void 0,env:Object.keys(T).length>0?T:void 0,targets:c.targets};l?(await V.updateMCP(l.id,P),W.success("MCP 工具已更新")):(await V.createMCP(P),W.success("MCP 工具已添加")),a(!1),s(null),await x()}catch(T){console.error("Failed to save MCP:",T),W.error("保存失败,请稍后重试")}finally{d(!1)}},k=A=>{m({mcpId:A.id,mcpName:A.name,isDeleting:!1})},S=()=>{p.isDeleting||m({mcpId:null,mcpName:"",isDeleting:!1})},E=async()=>{if(p.mcpId)try{m(A=>({...A,isDeleting:!0})),await V.deleteMCP(p.mcpId),W.success("已删除 MCP 工具"),await x(),S()}catch(A){console.error("Failed to delete MCP:",A),W.error("删除失败,请稍后重试"),m(U=>({...U,isDeleting:!1}))}},I=()=>{y({isOpen:!0,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},D=()=>{g.installingMCPName||y({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},O=A=>{y(U=>({...U,step:"input-api-key",selectedDefinition:A}))},_=async()=>{var A;if(!g.apiKey.trim()){W.error("请填写 API Key");return}if(g.selectedDefinition)try{const U=g.selectedDefinition;y(le=>({...le,step:"installing",message:"正在安装...",installingMCPName:U.name}));const K=U.apiKeyEnvName||"Z_AI_API_KEY",T=U.apiKeyIn==="env",z=[];U.env&&Object.entries(U.env).forEach(([le,me])=>{me!==void 0&&z.push([le,me])}),T&&z.push([K,g.apiKey.trim()]);const P=z.length>0?Object.fromEntries(z):void 0,ee=U.apiKeyIn==="headers"?{Authorization:`Bearer ${g.apiKey.trim()}`}:void 0,N={name:U.name,description:U.description,type:U.type,command:U.command,args:U.args,url:U.url,env:P,headers:ee,targets:["claude-code","codex"]};await V.createMCP(N),y(le=>({...le,step:"completed",message:`成功安装 ${U.name}`,installingMCPName:null})),W.success(`已安装 ${U.name}`),await x()}catch(U){console.error(`Failed to install ${(A=g.selectedDefinition)==null?void 0:A.id}:`,U),y(K=>({...K,step:"error",message:"安装失败,请稍后重试",installingMCPName:null})),W.error("安装失败,请稍后重试")}},M=A=>{switch(A){case"stdio":return"命令行";case"http":return"HTTP";case"sse":return"SSE";default:return A}};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(A=>{var U,K,T;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:A.name}),o.jsx("div",{className:"badge badge-secondary",children:M(A.type)})]}),o.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>b(A),style:{padding:"6px 14px",fontSize:"13px"},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>k(A),style:{padding:"6px 14px",fontSize:"13px"},children:"删除"})]})]}),A.description&&o.jsx("div",{className:"mcp-description",style:{marginTop:"12px",color:"var(--text-muted)",fontSize:"14px"},children:A.description}),o.jsxs("div",{style:{marginTop:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(A.createdAt).toLocaleDateString("zh-CN")]}),A.type==="stdio"&&A.command&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",fontFamily:"monospace",color:"var(--text-muted)"},children:["命令: ",A.command," ",(U=A.args)==null?void 0:U.join(" ")]}),(A.type==="http"||A.type==="sse")&&A.url&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["URL: ",A.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($c,{checked:((K=A.targets)==null?void 0:K.includes("claude-code"))??!1,onChange:async z=>{const P=A.targets||[],$=z?[...P,"claude-code"]:P.filter(ee=>ee!=="claude-code");await V.updateMCP(A.id,{targets:$}),await x()},label:"Claude Code",labelPosition:"right"}),o.jsx($c,{checked:((T=A.targets)==null?void 0:T.includes("codex"))??!1,onChange:async z=>{const P=A.targets||[],$=z?[...P,"codex"]:P.filter(ee=>ee!=="codex");await V.updateMCP(A.id,{targets:$}),await x()},label:"Codex",labelPosition:"right"})]})})]},A.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:A=>u({...c,name:A.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:A=>u({...c,description:A.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:A=>u({...c,type:A.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:A=>u({...c,command:A.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:A=>u({...c,args:A.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:A=>u({...c,url:A.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:A=>u({...c,headers:A.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:A=>u({...c,env:A.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:A=>u({...c,targets:A.target.checked?[...c.targets,"claude-code"]:c.targets.filter(U=>U!=="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:A=>u({...c,targets:A.target.checked?[...c.targets,"codex"]:c.targets.filter(U=>U!=="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:D,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:Doe.map(A=>{const U=e.some(K=>K.name===A.name);return o.jsxs("div",{className:"card",style:{padding:"16px",cursor:U?"not-allowed":"pointer",transition:"all 0.2s ease",opacity:U?.7:1},onClick:()=>!U&&O(A),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:A.name}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[U&&o.jsx("div",{className:"badge badge-success",style:{fontSize:"12px"},children:"已安装"}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"12px"},children:M(A.type)})]})]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-muted)",marginBottom:"12px"},children:A.description}),o.jsx("button",{className:"btn btn-primary",style:{width:"100%"},disabled:U,children:U?"已安装":"安装"})]},A.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:(G=g.selectedDefinition)==null?void 0:G.name}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)"},children:(q=g.selectedDefinition)==null?void 0:q.description})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"quick-install-api-key",children:["API Key ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"quick-install-api-key",type:"password",value:g.apiKey,onChange:A=>y({...g,apiKey:A.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(A=>({...A,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:D,children:"关闭"})})]})})]})]})}function rR({keyName:e,apiKey:t,guide:n,onClose:r}){const i=a=>{navigator.clipboard.writeText(a).then(()=>W.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:`
|
|
509
|
-
.ak-guide-section {
|
|
510
|
-
border-radius: 10px;
|
|
511
|
-
border: 1px solid var(--border-primary);
|
|
512
|
-
overflow: hidden;
|
|
513
|
-
background: var(--bg-primary-solid);
|
|
514
|
-
}
|
|
515
|
-
.ak-guide-section-header {
|
|
516
|
-
padding: 10px 16px;
|
|
517
|
-
border-bottom: 1px solid var(--border-primary);
|
|
518
|
-
background: var(--bg-secondary);
|
|
519
|
-
fontWeight: 600;
|
|
520
|
-
font-size: 14px;
|
|
521
|
-
}
|
|
522
|
-
.ak-guide-env-name {
|
|
523
|
-
color: var(--color-accent, #8b5cf6);
|
|
524
|
-
fontWeight: 600;
|
|
525
|
-
fontFamily: "SF Mono", "Fira Code", monospace;
|
|
526
|
-
flexShrink: 0;
|
|
527
|
-
}
|
|
528
|
-
.ak-guide-env-value {
|
|
529
|
-
flex: 1;
|
|
530
|
-
padding: 6px 10px;
|
|
531
|
-
border-radius: 5px;
|
|
532
|
-
background: var(--bg-secondary);
|
|
533
|
-
wordBreak: break-all;
|
|
534
|
-
fontSize: 12px;
|
|
535
|
-
fontFamily: "SF Mono", "Fira Code", monospace;
|
|
536
|
-
}
|
|
537
|
-
[data-theme="dark"] .ak-guide-section {
|
|
538
|
-
background: #0C1F12;
|
|
539
|
-
border-color: rgba(167, 243, 208, 0.15);
|
|
540
|
-
}
|
|
541
|
-
[data-theme="dark"] .ak-guide-section-header {
|
|
542
|
-
background: rgba(30, 58, 40, 0.95);
|
|
543
|
-
border-color: rgba(167, 243, 208, 0.15);
|
|
544
|
-
}
|
|
545
|
-
[data-theme="dark"] .ak-guide-env-value {
|
|
546
|
-
background: rgba(30, 58, 40, 0.95);
|
|
547
|
-
}
|
|
548
|
-
`})]})}function zoe(){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(""),[k,S]=h.useState(new Set),[E,I]=h.useState(!1),[D,O]=h.useState(null),[_,M]=h.useState(""),[G,q]=h.useState(""),[A,U]=h.useState(""),[K,T]=h.useState(!1),[z,P]=h.useState(()=>localStorage.getItem("policies-panel-open")==="true"),[$,ee]=h.useState(null),[N,le]=h.useState(!1),[me,X]=h.useState(""),[ne,ue]=h.useState(""),[Q,Z]=h.useState("system"),[he,te]=h.useState(""),[Ee,ke]=h.useState(""),[_e,ze]=h.useState(""),[ge,Te]=h.useState(""),[Ie,Ge]=h.useState(""),[et,ht]=h.useState([]),[It,Nt]=h.useState([]),[Xe,L]=h.useState("none"),[ae,R]=h.useState(""),[oe,fe]=h.useState([]),[Ce,Se]=h.useState(!1),Re=h.useRef(null),{confirm:De}=cu(),Fe=h.useRef(null);h.useEffect(()=>{if(!K)return;const F=B=>{Fe.current&&!Fe.current.contains(B.target)&&T(!1)};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[K]);const $e=async()=>{x(!0);try{const F=await V.getAccessKeys({page:p,pageSize:g,status:v||void 0,search:w||void 0});t(F.data),d(F.total)}catch(F){W.error("加载密钥列表失败: "+F.message)}finally{x(!1)}},He=async()=>{try{const[F,B,ye]=await Promise.all([V.getPolicies().catch(()=>[]),V.getRoutes().catch(()=>[]),V.getPolicyTemplates().catch(()=>[])]);r(F),a(B),s(ye)}catch{}};h.useEffect(()=>{$e()},[p,v,w]),h.useEffect(()=>{He()},[]),h.useEffect(()=>{V.getWriteLocalRecords().then(u).catch(()=>{})},[e]);const lt=async()=>{if(!_.trim()){W.error("请输入密钥名称");return}try{const F=await V.createAccessKey({name:_.trim(),remark:G||void 0,policyId:A||void 0});I(!1),O(F),M(""),q(""),U(""),$e()}catch(F){W.error("创建失败: "+F.message)}},fn=async F=>{try{await V.updateAccessKey(F.id,{status:F.status==="active"?"disabled":"active"}),W.success(F.status==="active"?"已停用":"已启用"),$e()}catch(B){W.error("操作失败: "+B.message)}},Y=async F=>{if(await De({message:`确定删除密钥「${F.name}」吗?`}))try{await V.deleteAccessKey(F.id),W.success("已删除"),$e()}catch(ye){W.error("删除失败: "+ye.message)}},pe=async F=>{if(await De({message:"重新生成后旧密钥将立即失效,确定继续吗?"}))try{const ye=await V.regenerateAccessKey(F.id);O({key:{...F,apiKey:ye.apiKey},apiKey:ye.apiKey}),$e()}catch(ye){W.error("重新生成失败: "+ye.message)}},[xe,Ne]=h.useState(null),tt=async F=>{try{const B=await V.getAccessKeyGuide(F.id);Ne({key:F,guide:B})}catch(B){W.error("获取指引失败: "+B.message)}},Qe=async F=>{if(k.size!==0)try{await V.batchUpdateAccessKeyStatus(Array.from(k),F),W.success(`已批量${F==="active"?"启用":"停用"} ${k.size} 个密钥`),S(new Set),T(!1),$e()}catch(B){W.error("批量操作失败: "+B.message)}},yt=async()=>{if(!(k.size===0||!await De({message:`确定删除选中的 ${k.size} 个密钥吗?`})))try{await V.batchDeleteAccessKeys(Array.from(k)),W.success(`已删除 ${k.size} 个密钥`),S(new Set),T(!1),$e()}catch(B){W.error("批量删除失败: "+B.message)}},jn=async F=>{if(!(k.size===0||!F))try{await V.batchBindAccessKeyPolicy(Array.from(k),F),W.success("已批量绑定策略"),S(new Set),T(!1),$e()}catch(B){W.error("批量绑定失败: "+B.message)}},Qt=F=>{const B=new Set(k);B.has(F)?B.delete(F):B.add(F),S(B)},wr=()=>S(k.size===e.length?new Set:new Set(e.map(F=>F.id))),Xn=F=>navigator.clipboard.writeText(F).then(()=>W.success("已复制")),pn=()=>{X(""),ue(""),Z(""),te(""),ke(""),ze(""),Te(""),Ge(""),ht([]),Nt([]),L("none"),R("")},$t=F=>{var B,ye,We,Oe,dt,Ht,Fr;F?(ee(F),X(F.name),ue(F.description||""),Z(F.routeId||"system"),te(((B=F.dailyTokenLimit)==null?void 0:B.toString())||""),ke(((ye=F.monthlyTokenLimit)==null?void 0:ye.toString())||""),ze(((We=F.dailyRequestLimit)==null?void 0:We.toString())||""),Te(((Oe=F.rpmLimit)==null?void 0:Oe.toString())||""),Ge(((dt=F.concurrentLimit)==null?void 0:dt.toString())||""),ht(F.allowedModels||[]),Nt(F.blockedModels||[]),L((Ht=F.allowedModels)!=null&&Ht.length?"allow":(Fr=F.blockedModels)!=null&&Fr.length?"block":"none")):(ee(null),pn()),le(!0),jr()},jr=async()=>{try{const F=await V.getVendors(),B=new Map;(F||[]).forEach(ye=>{const We=ye.name||"";(ye.services||[]).forEach(Oe=>{(Oe.supportedModels||[]).forEach(dt=>{B.has(dt)||B.set(dt,new Set),B.get(dt).add(We)})})}),fe(Array.from(B.entries()).map(([ye,We])=>({name:ye,vendors:Array.from(We)})).sort((ye,We)=>ye.name.localeCompare(We.name)))}catch{}},hn=Xe==="allow"?et:It,ut=ae.trim()?oe.filter(F=>F.name.toLowerCase().includes(ae.toLowerCase())&&!hn.includes(F.name)):oe.filter(F=>!hn.includes(F.name)),Ii=F=>{var ye,We,Oe,dt,Ht;const B=F.config;X(B.name||""),ue(F.description),te(((ye=B.dailyTokenLimit)==null?void 0:ye.toString())||""),ke(((We=B.monthlyTokenLimit)==null?void 0:We.toString())||""),ze(((Oe=B.dailyRequestLimit)==null?void 0:Oe.toString())||""),Te(((dt=B.rpmLimit)==null?void 0:dt.toString())||""),Ge(((Ht=B.concurrentLimit)==null?void 0:Ht.toString())||""),W.success(`已应用模板: ${F.name}`)},Qa=async()=>{if(!me.trim()){W.error("请输入策略名称");return}const F={name:me.trim(),description:ne||void 0,routeId:Q==="system"?"system":Q||void 0,dailyTokenLimit:he?Number(he):void 0,monthlyTokenLimit:Ee?Number(Ee):void 0,dailyRequestLimit:_e?Number(_e):void 0,rpmLimit:ge?Number(ge):void 0,concurrentLimit:Ie?Number(Ie):void 0,allowedModels:Xe==="allow"?et:void 0,blockedModels:Xe==="block"?It:void 0};try{$?(await V.updatePolicy($.id,F),W.success("策略已更新")):(await V.createPolicy(F),W.success("策略已创建")),le(!1),He(),$e()}catch(B){W.error("保存失败: "+B.message)}},Zo=async F=>{if(F.keyCount&&F.keyCount>0){W.error(`有 ${F.keyCount} 个密钥正在使用此策略,请先解除绑定`);return}if(await De({message:`确定删除策略「${F.name}」吗?`}))try{await V.deletePolicy(F.id),W.success("已删除"),He(),$e()}catch(ye){W.error("删除失败: "+ye.message)}},el=async F=>{try{await V.duplicatePolicy(F.id),W.success("已复制"),He()}catch(B){W.error("复制失败: "+B.message)}},la=(F,B)=>{const ye=ae.trim();ye&&!F.includes(ye)&&(B([...F,ye]),R(""))},tl=F=>{var B;return(B=i.find(ye=>ye.id===F))==null?void 0:B.name},Ja=F=>{const B=[];return F.dailyTokenLimit&&B.push(`日${F.dailyTokenLimit}k`),F.monthlyTokenLimit&&B.push(`月${F.monthlyTokenLimit}k`),F.dailyRequestLimit&&B.push(`日${F.dailyRequestLimit}次`),F.rpmLimit&&B.push(`RPM ${F.rpmLimit}`),F.concurrentLimit&&B.push(`并发${F.concurrentLimit}`),B.length>0?B.join(", "):"无限制"},sa=Math.ceil(f/g),qt={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),He()},style:{height:"45px"},children:"+ 创建密钥"}),o.jsxs("button",{className:`btn ${z?"btn-primary":"btn-secondary"}`,onClick:()=>{const F=!z;P(F),localStorage.setItem("policies-panel-open",String(F)),F&&He()},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:z?"var(--color-success, #22c55e)":"transparent",flexShrink:0,transition:"all 0.25s"},children:z&&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:z?"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:F=>{b(F.target.value),m(1)},style:qt,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:F=>{j(F.target.value),m(1)},style:{...qt,minWidth:"200px"}})]}),k.size>0&&o.jsxs("div",{ref:Fe,style:{position:"relative",flexShrink:0},children:[o.jsxs("button",{className:"ak-action-btn",onClick:()=>T(!K),children:["批量操作 (",k.size,") ▾"]}),K&&o.jsxs("div",{className:"ak-dropdown-menu",children:[o.jsx("button",{className:"dropdown-btn",onClick:()=>Qe("active"),children:"批量启用"}),o.jsx("button",{className:"dropdown-btn",onClick:()=>Qe("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:F=>{F.target.value&&jn(F.target.value)},children:[o.jsx("option",{value:"",children:"批量绑定策略..."}),n.map(F=>o.jsx("option",{value:F.id,children:F.name},F.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:yt,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:k.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(F=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("td",{style:{padding:"10px 12px"},children:o.jsx("input",{type:"checkbox",checked:k.has(F.id),onChange:()=>Qt(F.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/${F.id}`,style:{color:"var(--color-primary)",textDecoration:"none",fontWeight:500},children:F.name}),(()=>{const B=c.find(ye=>ye.accessKeyId===F.id);return B?B.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})()]}),F.remark&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:F.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:F.apiKey})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px"},children:F.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:F.status==="active"?"#22c55e":"var(--text-tertiary)"},title:F.status==="active"?"启用":"停用"})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:new Date(F.createdAt).toLocaleDateString()}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:F.lastActiveAt?new Date(F.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:()=>tt(F),title:"接入指引",children:"📋"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>fn(F),title:F.status==="active"?"停用":"启用",children:F.status==="active"?"⏸":"▶"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>pe(F),title:"重新生成",children:"🔄"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>Y(F),title:"删除",children:"✕"})]})})]},F.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:z?"480px":"0",overflow:"hidden",transition:"width 0.35s ease, opacity 0.35s ease",opacity:z?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(F=>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:["📋 ",F.name]}),F.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"12px"},children:F.description})]}),o.jsxs("div",{style:{display:"flex",gap:"4px"},children:[o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>$t(F),children:"编辑"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>el(F),children:"复制"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>Zo(F),children:"删除"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"16px",fontSize:"12px",color:"var(--text-secondary)"},children:[o.jsxs("span",{children:["🔗 路由: ",F.routeId&&F.routeId!=="system"?tl(F.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: ",F.keyCount||0]}),o.jsxs("span",{children:["📊 配额: ",Ja(F)]})]})]},F.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:F=>F.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:F=>M(F.target.value),placeholder:"例如:张三 - 前端组",autoFocus:!0,style:{...qt,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:G,onChange:F=>q(F.target.value),placeholder:"补充说明信息",style:{...qt,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:A,onChange:F=>U(F.target.value),style:{...qt,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"",children:"稍后配置"}),n.map(F=>o.jsx("option",{value:F.id,children:F.name},F.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:lt,className:"ak-modal-btn-primary",children:"创建密钥"})]})]})}),D&&o.jsx("div",{className:"modal-overlay",onClick:()=>O(null),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:F=>F.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>O(null),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsxs("div",{style:{textAlign:"center",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"40px",marginBottom:"8px"},children:"🔑"}),o.jsx("h3",{style:{margin:"0",fontSize:"20px",color:"#22c55e"},children:"密钥创建成功"})]}),o.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"16px",border:"2px dashed #22c55e",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"1px"},children:"API Key"}),o.jsx("code",{style:{display:"block",fontSize:"16px",wordBreak:"break-all",lineHeight:1.6,fontFamily:'"SF Mono", "Fira Code", monospace',color:"var(--text-primary)"},children:D.apiKey})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[o.jsx("button",{onClick:()=>Xn(D.apiKey),className:"ak-modal-btn-primary",children:"📋 复制 Key"}),o.jsx("button",{onClick:()=>O(null),className:"ak-modal-btn-secondary",children:"完成"})]})]})}),N&&o.jsx("div",{className:"modal-overlay",onClick:()=>le(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:F=>F.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>le(!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:$?"编辑策略":"创建策略"}),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:me,onChange:F=>X(F.target.value),placeholder:"例如:中度限制策略",style:{...qt,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:ne,onChange:F=>ue(F.target.value),placeholder:"适合普通开发者使用",style:{...qt,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:Q,onChange:F=>Z(F.target.value),style:{...qt,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"system",children:"按系统默认"}),i.map(F=>o.jsx("option",{value:F.id,children:F.name},F.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.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:F=>{F.target.value&&(Ii(l[Number(F.target.value)]),F.target.value="")},children:[o.jsx("option",{value:"",children:"📋 使用模板..."}),l.map((F,B)=>o.jsxs("option",{value:String(B),children:[F.name," — ",F.description]},B))]})]}),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:he,onChange:F=>te(F.target.value),placeholder:"不限",style:{...qt,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:Ee,onChange:F=>ke(F.target.value),placeholder:"不限",style:{...qt,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:_e,onChange:F=>ze(F.target.value),placeholder:"不限",style:{...qt,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:ge,onChange:F=>Te(F.target.value),placeholder:"不限",style:{...qt,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:Ie,onChange:F=>Ge(F.target.value),placeholder:"不限",style:{...qt,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:Xe!=="none"?"12px":"0"},children:[{value:"none",label:"不限制",desc:"允许所有模型"},{value:"allow",label:"白名单",desc:"仅允许指定模型"},{value:"block",label:"黑名单",desc:"禁止指定模型"}].map(F=>o.jsxs("label",{className:`policy-model-opt ${Xe===F.value?"policy-model-opt--active":""}`,children:[o.jsx("input",{type:"radio",name:"modelMode",value:F.value,checked:Xe===F.value,onChange:()=>L(F.value),style:{display:"none"}}),o.jsx("div",{style:{fontWeight:600,fontSize:"14px",marginBottom:"2px"},children:F.label}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)"},children:F.desc})]},F.value))}),Xe!=="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:Re,type:"text",value:ae,onChange:F=>{R(F.target.value),Se(!0)},onFocus:()=>Se(!0),onBlur:()=>setTimeout(()=>Se(!1),150),placeholder:oe.length>0?"搜索或输入模型名...":"输入模型名,回车确认...",autoFocus:!0,onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),la(Xe==="allow"?et:It,Xe==="allow"?ht:Nt)),F.key==="Escape"&&Se(!1)},style:{...qt,width:"100%",padding:"8px 12px",borderRadius:"6px",fontSize:"13px"}}),Ce&&ut.length>0&&o.jsx("div",{className:"ak-model-suggest",children:ut.map(F=>o.jsxs("button",{className:"ak-model-suggest-item",onMouseDown:B=>{var Oe;B.preventDefault();const ye=Xe==="allow"?et:It,We=Xe==="allow"?ht:Nt;ye.includes(F.name)||We([...ye,F.name]),R(""),Se(!1),(Oe=Re.current)==null||Oe.focus()},children:[o.jsx("span",{children:F.name}),o.jsx("span",{children:F.vendors.join(", ")})]},F.name))})]}),o.jsx("button",{className:"btn btn-primary btn-sm",style:{padding:"8px 14px",borderRadius:"6px"},onClick:()=>la(Xe==="allow"?et:It,Xe==="allow"?ht:Nt),children:"添加"})]}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",minHeight:"24px"},children:[(Xe==="allow"?et:It).length===0&&o.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)",padding:"4px 0"},children:Xe==="allow"?"尚未添加模型,至少需要添加一个模型才能生效":"尚未添加模型,不添加则不对任何模型进行屏蔽"}),(Xe==="allow"?et:It).map((F,B)=>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:[F,o.jsx("button",{style:{border:"none",background:"none",cursor:"pointer",padding:"0 2px",color:"var(--text-tertiary)",fontSize:"14px",lineHeight:1},onClick:()=>{(Xe==="allow"?ht:Nt)((Xe==="allow"?et:It).filter((Oe,dt)=>dt!==B))},children:"×"})]},B))]})]})]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>le(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Qa,className:"ak-modal-btn-primary",children:$?"保存修改":"创建策略"})]})]})}),xe&&o.jsx(rR,{keyName:xe.key.name,apiKey:xe.key.apiKey,guide:xe.guide,onClose:()=>Ne(null)}),o.jsx("style",{children:`
|
|
549
|
-
.dropdown-btn {
|
|
550
|
-
display: block; width: 100%; padding: 6px 10px; text-align: left;
|
|
551
|
-
border: none; background: none; cursor: pointer; font-size: 13px;
|
|
552
|
-
color: var(--text-primary);
|
|
553
|
-
}
|
|
554
|
-
.dropdown-btn:hover { background: var(--bg-secondary); }
|
|
555
|
-
|
|
556
|
-
/* 操作按钮 - 列表/策略面板中的小按钮 */
|
|
557
|
-
.ak-action-btn {
|
|
558
|
-
padding: 4px 10px; border-radius: 6px;
|
|
559
|
-
border: 1px solid var(--border-primary);
|
|
560
|
-
background: var(--bg-secondary);
|
|
561
|
-
color: var(--text-secondary);
|
|
562
|
-
cursor: pointer; font-size: 13px;
|
|
563
|
-
transition: all 0.15s;
|
|
564
|
-
}
|
|
565
|
-
.ak-action-btn:hover {
|
|
566
|
-
background: var(--bg-route-item-hover);
|
|
567
|
-
border-color: var(--text-secondary);
|
|
568
|
-
}
|
|
569
|
-
.ak-action-btn--danger {
|
|
570
|
-
color: var(--accent-danger);
|
|
571
|
-
}
|
|
572
|
-
.ak-action-btn--danger:hover {
|
|
573
|
-
background: rgba(220, 38, 38, 0.1);
|
|
574
|
-
border-color: var(--accent-danger);
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
/* 模型自动补全下拉 */
|
|
578
|
-
.ak-model-suggest {
|
|
579
|
-
position: absolute; left: 0; right: 0; bottom: 100%; z-index: 50;
|
|
580
|
-
margin-top: 4px; max-height: 240px; overflow-y: auto;
|
|
581
|
-
background: var(--bg-primary-solid); border: 1px solid var(--border-primary);
|
|
582
|
-
border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
|
|
583
|
-
padding: 4px 0;
|
|
584
|
-
}
|
|
585
|
-
.ak-model-suggest-item {
|
|
586
|
-
display: flex; justify-content: space-between; align-items: center; gap: 8px;
|
|
587
|
-
width: 100%; padding: 7px 12px;
|
|
588
|
-
border: none; background: none; cursor: pointer;
|
|
589
|
-
font-size: 13px; color: var(--text-primary); text-align: left;
|
|
590
|
-
}
|
|
591
|
-
.ak-model-suggest-item > span:first-child {
|
|
592
|
-
font-family: "SF Mono", "Fira Code", monospace;
|
|
593
|
-
white-space: nowrap;
|
|
594
|
-
}
|
|
595
|
-
.ak-model-suggest-item > span:last-child {
|
|
596
|
-
color: #999; font-size: 11px; white-space: nowrap; flex-shrink: 0;
|
|
597
|
-
}
|
|
598
|
-
[data-theme="dark"] .ak-model-suggest-item > span:last-child {
|
|
599
|
-
color: #888;
|
|
600
|
-
}
|
|
601
|
-
.ak-model-suggest-item:hover {
|
|
602
|
-
background: var(--bg-secondary);
|
|
603
|
-
}
|
|
604
|
-
[data-theme="dark"] .ak-model-suggest {
|
|
605
|
-
background: #0C1F12;
|
|
606
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
607
|
-
}
|
|
608
|
-
[data-theme="dark"] .ak-model-suggest-item:hover {
|
|
609
|
-
background: rgba(30, 58, 40, 0.95);
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
/* 批量操作按钮 */
|
|
613
|
-
.ak-action-btn[onClick] {
|
|
614
|
-
padding: 6px 12px;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/* 下拉菜单 */
|
|
618
|
-
.ak-dropdown-menu {
|
|
619
|
-
position: absolute; right: 0; top: 100%; z-index: 100;
|
|
620
|
-
background: var(--bg-primary-solid);
|
|
621
|
-
border: 1px solid var(--border-primary);
|
|
622
|
-
border-radius: 6px;
|
|
623
|
-
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
624
|
-
min-width: 140px; padding: 4px 0;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
/* 弹窗按钮 */
|
|
628
|
-
.ak-modal-btn-primary {
|
|
629
|
-
padding: 10px 28px; border-radius: 8px; border: none;
|
|
630
|
-
background: var(--color-primary, #3b82f6); color: #fff;
|
|
631
|
-
cursor: pointer; font-size: 14px; font-weight: 600;
|
|
632
|
-
transition: opacity 0.15s;
|
|
633
|
-
}
|
|
634
|
-
.ak-modal-btn-primary:hover { opacity: 0.9; }
|
|
635
|
-
|
|
636
|
-
.ak-modal-btn-secondary {
|
|
637
|
-
padding: 10px 24px; border-radius: 8px;
|
|
638
|
-
border: 1px solid var(--border-primary);
|
|
639
|
-
background: var(--bg-secondary);
|
|
640
|
-
color: var(--text-primary);
|
|
641
|
-
cursor: pointer; font-size: 14px; font-weight: 500;
|
|
642
|
-
transition: all 0.15s;
|
|
643
|
-
}
|
|
644
|
-
.ak-modal-btn-secondary:hover {
|
|
645
|
-
background: var(--bg-route-item-hover);
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
/* 模型过滤选项 */
|
|
649
|
-
.policy-model-opt {
|
|
650
|
-
cursor: pointer; padding: 10px 14px; border-radius: 8px;
|
|
651
|
-
flex: 1; text-align: center; transition: all 0.2s;
|
|
652
|
-
border: 1px solid var(--border-primary);
|
|
653
|
-
background: transparent;
|
|
654
|
-
}
|
|
655
|
-
.policy-model-opt:hover {
|
|
656
|
-
background: rgba(59,130,246,0.05);
|
|
657
|
-
}
|
|
658
|
-
.policy-model-opt--active {
|
|
659
|
-
border: 2px solid var(--color-primary, #3b82f6);
|
|
660
|
-
background: rgba(59,130,246,0.12);
|
|
661
|
-
}
|
|
662
|
-
.policy-model-opt--active:hover {
|
|
663
|
-
background: rgba(59,130,246,0.18);
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
/* ========== 深色模式 ========== */
|
|
667
|
-
[data-theme="dark"] .ak-action-btn {
|
|
668
|
-
background: rgba(30, 58, 40, 0.95);
|
|
669
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
670
|
-
color: #A7F3D0;
|
|
671
|
-
}
|
|
672
|
-
[data-theme="dark"] .ak-action-btn:hover {
|
|
673
|
-
background: rgba(40, 75, 52, 0.95);
|
|
674
|
-
border-color: rgba(167, 243, 208, 0.4);
|
|
675
|
-
}
|
|
676
|
-
[data-theme="dark"] .ak-action-btn--danger {
|
|
677
|
-
color: #EF4444;
|
|
678
|
-
}
|
|
679
|
-
[data-theme="dark"] .ak-action-btn--danger:hover {
|
|
680
|
-
background: rgba(239, 68, 68, 0.15);
|
|
681
|
-
border-color: rgba(239, 68, 68, 0.5);
|
|
682
|
-
}
|
|
683
|
-
[data-theme="dark"] .ak-dropdown-menu {
|
|
684
|
-
background: #0C1F12;
|
|
685
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
686
|
-
}
|
|
687
|
-
[data-theme="dark"] .ak-modal-btn-secondary {
|
|
688
|
-
background: rgba(30, 58, 40, 0.95);
|
|
689
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
690
|
-
color: #ECFEF5;
|
|
691
|
-
}
|
|
692
|
-
[data-theme="dark"] .ak-modal-btn-secondary:hover {
|
|
693
|
-
background: rgba(40, 75, 52, 0.95);
|
|
694
|
-
border-color: rgba(167, 243, 208, 0.35);
|
|
695
|
-
}
|
|
696
|
-
[data-theme="dark"] .policy-model-opt:hover {
|
|
697
|
-
background: rgba(96,165,250,0.12);
|
|
698
|
-
}
|
|
699
|
-
[data-theme="dark"] .policy-model-opt--active {
|
|
700
|
-
background: rgba(96,165,250,0.28);
|
|
701
|
-
border-color: #60a5fa;
|
|
702
|
-
}
|
|
703
|
-
[data-theme="dark"] .policy-model-opt--active:hover {
|
|
704
|
-
background: rgba(96,165,250,0.38);
|
|
705
|
-
}
|
|
706
|
-
[data-theme="dark"] .page-container select option {
|
|
707
|
-
background: #0C1F12;
|
|
708
|
-
color: #ECFEF5;
|
|
709
|
-
}
|
|
710
|
-
[data-theme="dark"] .page-container textarea,
|
|
711
|
-
[data-theme="dark"] .page-container input[type="text"],
|
|
712
|
-
[data-theme="dark"] .page-container input[type="number"] {
|
|
713
|
-
color-scheme: dark;
|
|
714
|
-
}
|
|
715
|
-
`})]})}function $oe(){var Ja,sa,qt,F;const{id:e}=Lz(),t=Vp(),{confirm:n}=cu(),[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([]),[k,S]=h.useState(0),[E,I]=h.useState(1),[D,O]=h.useState(20),[_,M]=h.useState(""),[G,q]=h.useState(""),[A,U]=h.useState(""),[K,T]=h.useState(""),[z,P]=h.useState(null),[$,ee]=h.useState(!1),[N,le]=h.useState(10),me=h.useRef(null),[X,ne]=h.useState(!1),[ue,Q]=h.useState(""),[Z,he]=h.useState(""),[te,Ee]=h.useState(""),[ke,_e]=h.useState(null),[ze,ge]=h.useState(!1),[Te,Ie]=h.useState({"claude-code":!0,codex:!0}),[Ge,et]=h.useState(!1),[ht,It]=h.useState([]),[Nt,Xe]=h.useState(0),[L,ae]=h.useState(1),[R,oe]=h.useState(20),[fe,Ce]=h.useState(""),[Se,Re]=h.useState(""),[De,Fe]=h.useState(null),[$e,He]=h.useState([]),[lt,fn]=h.useState(!1),[Y,pe]=h.useState(!1),[xe,Ne]=h.useState(10),tt=h.useRef(null),Qe=h.useCallback(async()=>{if(e)try{const[B,ye,We]=await Promise.all([V.getAccessKey(e).catch(()=>null),V.getPolicies().catch(()=>[]),V.getRoutes().catch(()=>[])]);if(!B){W.error("密钥不存在"),t("/access-keys");return}i(B),l(ye),c(We),Q(B.name),he(B.remark||""),Ee(B.policyId||"")}catch(B){W.error("加载数据失败: "+B.message)}finally{f(!1)}},[e,t]),yt=h.useCallback(async()=>{if(e)try{const[B,ye]=await Promise.all([V.getAccessKeyUsage(e).catch(()=>null),V.getAccessKeyUsageTrend(e,v).catch(()=>[])]);g(B),x(ye)}catch{}},[e,v]),jn=h.useCallback(async()=>{if(e)try{const B=await V.getAccessKeyLogs(e,{page:E,pageSize:D,startDate:_||void 0,endDate:G||void 0,contentType:A||void 0,search:K||void 0});j(B.data),S(B.total)}catch{}},[e,E,D,_,G,A,K]),Qt=h.useCallback(async()=>{if(e)try{const B=await V.getAccessKeySessions(e,{page:L,pageSize:R,targetType:Se||void 0,search:fe||void 0});It(B.data),Xe(B.total)}catch{}},[e,L,R,Se,fe]);h.useEffect(()=>{Qe()},[Qe]),h.useEffect(()=>{d==="stats"&&yt(),d==="logs"&&jn(),d==="sessions"&&Qt()},[d,yt,jn,Qt]),h.useEffect(()=>{if($&&d==="logs")return me.current=setInterval(()=>{le(B=>B<=1?(jn(),10):B-1)},1e3),()=>{me.current&&clearInterval(me.current)};me.current&&clearInterval(me.current),le(10)},[$,d,jn]),h.useEffect(()=>{if(Y&&d==="sessions")return tt.current=setInterval(()=>{Ne(B=>B<=1?(Qt(),10):B-1)},1e3),()=>{tt.current&&clearInterval(tt.current)};tt.current&&clearInterval(tt.current),Ne(10)},[Y,d,Qt]);const wr=async()=>{if(!(!e||!ue.trim()))try{await V.updateAccessKey(e,{name:ue.trim(),remark:Z||void 0,policyId:te||void 0}),W.success("已保存"),ne(!1),Qe()}catch(B){W.error("保存失败: "+B.message)}},Xn=async()=>{if(r)try{await V.updateAccessKey(r.id,{status:r.status==="active"?"disabled":"active"}),W.success(r.status==="active"?"已停用":"已启用"),Qe()}catch(B){W.error("操作失败: "+B.message)}},pn=async()=>{if(!(!r||!await n({message:"确定删除此密钥吗?删除后不可恢复。"})))try{await V.deleteAccessKey(r.id),W.success("已删除"),t("/access-keys")}catch(ye){W.error("删除失败: "+ye.message)}},$t=async()=>{if(r)try{const B=await V.getAccessKeyGuide(r.id);_e({key:r,guide:B})}catch(B){W.error("获取指引失败: "+B.message)}},jr=async()=>{var B,ye;if(r)try{const We=await V.getAccessKeyGuide(r.id),Oe=((ye=(B=We==null?void 0:We.claudeCode)==null?void 0:B.envVars)==null?void 0:ye.ANTHROPIC_AUTH_TOKEN)||r.apiKey;await navigator.clipboard.writeText(Oe),W.success("已复制到剪贴板")}catch{try{await navigator.clipboard.writeText(r.apiKey),W.success("已复制到剪贴板")}catch{W.error("复制失败")}}},hn=async()=>{if(!r)return;const B=Object.entries(Te).filter(([,ye])=>ye).map(([ye])=>ye);if(B.length===0){W.error("请选择至少一个目标");return}et(!0);try{await V.writeAccessKeyToLocal(r.id,B),W.success("已写入本地配置文件"),ge(!1)}catch(ye){W.error("写入失败: "+(ye.message||"未知错误"))}finally{et(!1)}},ut=B=>B>=1e6?(B/1e6).toFixed(1)+"M":B>=1e3?(B/1e3).toFixed(1)+"k":String(B),Ii=B=>B?new Date(B).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 Zo=m&&m.lifetime.totalRequests>0?((m.lifetime.totalRequests-m.lifetime.errorCount)/m.lifetime.totalRequests*100).toFixed(1):"-",el=Math.max(...y.map(B=>B.tokens),1),la=Math.max(...y.map(B=>B.requests),1),tl=[{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:()=>ne(!0),children:"编辑"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:()=>ge(!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:tl.map(B=>o.jsx("button",{className:`ak-tab-btn ${d===B.key?"ak-tab-btn--active":""}`,onClick:()=>p(B.key),children:B.label},B.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:ut(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,Lu,nl,ws;const B=a.find(Ue=>Ue.id===r.policyId),ye=B!=null&&B.routeId&&B.routeId!=="system"?(Fr=s.find(Ue=>Ue.id===B.routeId))==null?void 0:Fr.name:void 0,We=Ue=>{const Vt=[];return Ue.dailyTokenLimit&&Vt.push(`日 ${Ue.dailyTokenLimit}k Token`),Ue.weeklyTokenLimit&&Vt.push(`周 ${Ue.weeklyTokenLimit}k Token`),Ue.monthlyTokenLimit&&Vt.push(`月 ${Ue.monthlyTokenLimit}k Token`),Ue.customTokenLimit&&Ue.customTokenResetHours&&Vt.push(`${Ue.customTokenResetHours}h ${Ue.customTokenLimit}k Token`),Ue.dailyRequestLimit&&Vt.push(`日 ${Ue.dailyRequestLimit} 次请求`),Ue.weeklyRequestLimit&&Vt.push(`周 ${Ue.weeklyRequestLimit} 次请求`),Ue.monthlyRequestLimit&&Vt.push(`月 ${Ue.monthlyRequestLimit} 次请求`),Ue.customRequestLimit&&Ue.customRequestResetHours&&Vt.push(`${Ue.customRequestResetHours}h ${Ue.customRequestLimit} 次请求`),Ue.rpmLimit&&Vt.push(`RPM ${Ue.rpmLimit}`),Ue.concurrentLimit&&Vt.push(`并发 ${Ue.concurrentLimit}`),Vt.length>0?Vt:null},Oe=(Za=B==null?void 0:B.allowedModels)!=null&&Za.length?B.allowedModels:(Lu=B==null?void 0:B.blockedModels)!=null&&Lu.length?B.blockedModels:null,dt=(nl=B==null?void 0:B.allowedModels)!=null&&nl.length?"allow":(ws=B==null?void 0:B.blockedModels)!=null&&ws.length?"block":"none";if(!B)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 Ht=We(B);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:["📋 ",B.name]}),B.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px"},children:B.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:"📊 配额限制"}),Ht?o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:Ht.map((Ue,Vt)=>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:Ue},Vt))}):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:"🏷️ 模型过滤"}),dt==="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:dt==="allow"?"✅ 白名单模式 — 仅允许以下模型":"🚫 黑名单模式 — 禁止以下模型"}),o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Oe.map((Ue,Vt)=>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:Ue},Vt))})]})]})]})})(),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:ut(m.lifetime.totalTokens)},{label:"累计请求",value:String(m.lifetime.totalRequests)},{label:"成功率",value:Zo+"%"},{label:"错误数",value:String(m.lifetime.errorCount)},{label:"输入 Token",value:ut(m.lifetime.inputTokens)},{label:"输出 Token",value:ut(m.lifetime.outputTokens)}].map(B=>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:B.label}),o.jsx("div",{style:{fontSize:"20px",fontWeight:600},children:B.value})]},B.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(B=>o.jsxs("button",{className:`ak-action-btn ${v===B?"ak-action-btn--active":""}`,style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>b(B),children:[B,"天"]},B))})]}),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((B,ye)=>o.jsx("div",{style:{flex:1,minWidth:0,height:el>0?`${Math.max(2,B.tokens/el*100)}%`:"2px",background:"var(--color-primary, #3b82f6)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${B.date}: ${ut(B.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((B,ye)=>o.jsx("div",{style:{flex:1,minWidth:0,height:la>0?`${Math.max(2,B.requests/la*100)}%`:"2px",background:"var(--color-success, #22c55e)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${B.date}: ${B.requests} 请求`},ye))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(qt=y[0])==null?void 0:qt.date}),o.jsx("span",{children:(F=y[y.length-1])==null?void 0:F.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((B,ye)=>{const We=Math.max(...y.map(Oe=>Oe.errors),1);return o.jsx("div",{style:{flex:1,minWidth:0,height:We>0?`${Math.max(2,B.errors/We*100)}%`:"2px",background:B.errors>0?"var(--accent-danger, #ef4444)":"var(--border-primary)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${B.date}: ${B.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:K,onChange:B=>{T(B.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:A,onChange:B=>{U(B.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:B=>{M(B.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:G,onChange:B=>{q(B.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:$,onChange:B=>ee(B.target.checked)}),"自动刷新 ",$&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",N,"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(B=>{var Oe,dt,Ht;const ye=((Oe=B.usage)==null?void 0:Oe.totalTokens)||(((dt=B.usage)==null?void 0:dt.inputTokens)||0)+(((Ht=B.usage)==null?void 0:Ht.outputTokens)||0),We=(B.statusCode||200)<400;return o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>P(B),children:[o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(B.timestamp).toLocaleString()}),o.jsx("td",{style:{padding:"8px 6px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B.path||"-"}),o.jsx("td",{style:{padding:"8px 6px"},children:B.requestModel||B.targetModel||"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:ut(ye)}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:B.responseTime?(B.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:We?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",color:We?"var(--color-success, #22c55e)":"var(--accent-danger, #ef4444)"},children:B.statusCode||200})}),o.jsx("td",{style:{padding:"8px 6px"},children:B.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(),P(B)},children:"详情"})})]},B.id)})})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(zc,{currentPage:E,totalItems:k,pageSize:D,onPageChange:I,onPageSizeChange:B=>{O(B),I(1)}})})]})})]}),d==="sessions"&&(()=>{const B=(Oe,dt)=>{const Ht=dt-Oe;return Ht<6e4?`${Math.floor(Ht/1e3)}秒`:Ht<36e5?`${Math.floor(Ht/6e4)}分钟`:`${Math.floor(Ht/36e5)}小时`},ye=async Oe=>{Fe(Oe),fn(!0);try{const dt=await V.getAccessKeySessionLogs(e,Oe.id,1e4);He(dt)}catch{W.error("加载会话日志失败")}finally{fn(!1)}},We=async()=>{if(!(!De||lt)){fn(!0);try{const Oe=await V.getAccessKeySessionLogs(e,De.id,1e4);He(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:fe,onChange:Oe=>{Ce(Oe.target.value),ae(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px",width:"200px"}}),o.jsxs("select",{value:Se,onChange:Oe=>{Re(Oe.target.value),ae(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:Y,onChange:Oe=>pe(Oe.target.checked)}),"自动刷新 ",Y&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",xe,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>Qt(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:ht.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:ht.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:vo(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:ut(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:B(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:dt=>{dt.stopPropagation(),ye(Oe)},children:"详情"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px",marginLeft:"4px"},onClick:dt=>{dt.stopPropagation(),Fe(Oe),fn(!0),V.getAccessKeySessionLogs(e,Oe.id,1e4).then(Ht=>{He(Ht),fn(!1)}).catch(()=>fn(!1))},children:"对话"})]})]},Oe.id))})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(zc,{currentPage:L,totalItems:Nt,pageSize:R,onPageChange:ae,onPageSizeChange:Oe=>{oe(Oe),ae(1)}})})]})}),De&&o.jsx(tO,{session:De,logs:$e,logsLoading:lt,onRefreshLogs:We,onFetchNewLogs:async()=>De?await V.getAccessKeySessionLogs(e,De.id,1e4):[],onClose:()=>{Fe(null),He([])}})]})})(),X&&o.jsx("div",{className:"modal-overlay",onClick:()=>ne(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"480px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>ne(!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:ue,onChange:B=>Q(B.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:Z,onChange:B=>he(B.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:te,onChange:B=>Ee(B.target.value),style:{...Qa,cursor:"pointer"},children:[o.jsx("option",{value:"",children:"未配置"}),a.map(B=>o.jsx("option",{value:B.id,children:B.name},B.id))]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>ne(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:wr,className:"ak-modal-btn-primary",children:"保存"})]})]})}),z&&o.jsx(Tf,{log:z,onClose:()=>P(null)}),ke&&o.jsx(rR,{keyName:ke.key.name,apiKey:ke.key.apiKey,guide:ke.guide,onClose:()=>_e(null)}),ze&&o.jsx("div",{className:"modal-overlay",onClick:()=>ge(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"420px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>ge(!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(B=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px",marginBottom:"8px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:Te[B.key]?"var(--bg-secondary)":"transparent",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:Te[B.key],onChange:ye=>Ie(We=>({...We,[B.key]:ye.target.checked})),style:{marginTop:"2px"}}),o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:B.label}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:B.desc})]})]},B.key))}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>ge(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:hn,className:"ak-modal-btn-primary",disabled:Ge,children:Ge?"写入中...":"确认写入"})]})]})}),o.jsx("style",{children:`
|
|
716
|
-
.ak-tab-btn {
|
|
717
|
-
padding: 10px 24px;
|
|
718
|
-
border: none;
|
|
719
|
-
background: transparent;
|
|
720
|
-
color: var(--text-tertiary);
|
|
721
|
-
font-size: 14px;
|
|
722
|
-
font-weight: 500;
|
|
723
|
-
cursor: pointer;
|
|
724
|
-
border-bottom: 2px solid transparent;
|
|
725
|
-
margin-bottom: -2px;
|
|
726
|
-
transition: all 0.15s;
|
|
727
|
-
}
|
|
728
|
-
.ak-tab-btn:hover {
|
|
729
|
-
color: var(--text-secondary);
|
|
730
|
-
}
|
|
731
|
-
.ak-tab-btn--active {
|
|
732
|
-
color: var(--color-primary, #3b82f6);
|
|
733
|
-
border-bottom-color: var(--color-primary, #3b82f6);
|
|
734
|
-
font-weight: 600;
|
|
735
|
-
}
|
|
736
|
-
.ak-action-btn {
|
|
737
|
-
padding: 4px 10px; border-radius: 6px;
|
|
738
|
-
border: 1px solid var(--border-primary);
|
|
739
|
-
background: var(--bg-secondary);
|
|
740
|
-
color: var(--text-secondary);
|
|
741
|
-
cursor: pointer; font-size: 13px;
|
|
742
|
-
transition: all 0.15s;
|
|
743
|
-
}
|
|
744
|
-
.ak-action-btn:hover {
|
|
745
|
-
background: var(--bg-route-item-hover);
|
|
746
|
-
border-color: var(--text-secondary);
|
|
747
|
-
}
|
|
748
|
-
.ak-action-btn--active {
|
|
749
|
-
background: var(--color-primary, #3b82f6);
|
|
750
|
-
color: #fff;
|
|
751
|
-
border-color: var(--color-primary, #3b82f6);
|
|
752
|
-
}
|
|
753
|
-
.ak-action-btn--danger {
|
|
754
|
-
color: var(--accent-danger);
|
|
755
|
-
}
|
|
756
|
-
.ak-action-btn--danger:hover {
|
|
757
|
-
background: rgba(220, 38, 38, 0.1);
|
|
758
|
-
border-color: var(--accent-danger);
|
|
759
|
-
}
|
|
760
|
-
.ak-modal-btn-primary {
|
|
761
|
-
padding: 10px 28px; border-radius: 8px; border: none;
|
|
762
|
-
background: var(--color-primary, #3b82f6); color: #fff;
|
|
763
|
-
cursor: pointer; font-size: 14px; font-weight: 600;
|
|
764
|
-
transition: opacity 0.15s;
|
|
765
|
-
}
|
|
766
|
-
.ak-modal-btn-primary:hover { opacity: 0.9; }
|
|
767
|
-
.ak-modal-btn-secondary {
|
|
768
|
-
padding: 10px 24px; border-radius: 8px;
|
|
769
|
-
border: 1px solid var(--border-primary);
|
|
770
|
-
background: var(--bg-secondary);
|
|
771
|
-
color: var(--text-primary);
|
|
772
|
-
cursor: pointer; font-size: 14px; font-weight: 500;
|
|
773
|
-
transition: all 0.15s;
|
|
774
|
-
}
|
|
775
|
-
.ak-modal-btn-secondary:hover {
|
|
776
|
-
background: var(--bg-route-item-hover);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
/* 深色模式 */
|
|
780
|
-
[data-theme="dark"] .ak-action-btn {
|
|
781
|
-
background: rgba(30, 58, 40, 0.95);
|
|
782
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
783
|
-
color: #A7F3D0;
|
|
784
|
-
}
|
|
785
|
-
[data-theme="dark"] .ak-action-btn:hover {
|
|
786
|
-
background: rgba(40, 75, 52, 0.95);
|
|
787
|
-
border-color: rgba(167, 243, 208, 0.4);
|
|
788
|
-
}
|
|
789
|
-
[data-theme="dark"] .ak-action-btn--danger {
|
|
790
|
-
color: #EF4444;
|
|
791
|
-
}
|
|
792
|
-
[data-theme="dark"] .ak-action-btn--danger:hover {
|
|
793
|
-
background: rgba(239, 68, 68, 0.15);
|
|
794
|
-
border-color: rgba(239, 68, 68, 0.5);
|
|
795
|
-
}
|
|
796
|
-
[data-theme="dark"] .ak-modal-btn-secondary {
|
|
797
|
-
background: rgba(30, 58, 40, 0.95);
|
|
798
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
799
|
-
color: #ECFEF5;
|
|
800
|
-
}
|
|
801
|
-
[data-theme="dark"] .ak-modal-btn-secondary:hover {
|
|
802
|
-
background: rgba(40, 75, 52, 0.95);
|
|
803
|
-
border-color: rgba(167, 243, 208, 0.35);
|
|
804
|
-
}
|
|
805
|
-
[data-theme="dark"] .page-container select option {
|
|
806
|
-
background: #0C1F12;
|
|
807
|
-
color: #ECFEF5;
|
|
808
|
-
}
|
|
809
|
-
[data-theme="dark"] .page-container textarea,
|
|
810
|
-
[data-theme="dark"] .page-container input[type="text"],
|
|
811
|
-
[data-theme="dark"] .page-container input[type="date"] {
|
|
812
|
-
color-scheme: dark;
|
|
813
|
-
}
|
|
814
|
-
`})]})}function Boe({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+`
|
|
815
|
-
`),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 Foe({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 D=I==="claude-code"?"@anthropic-ai/claude-code":"@openai/codex",O=window.navigator.platform;let _=[];return O.includes("Win")?_=["打开命令提示符(CMD)或 PowerShell","执行以下命令:",`npm install -g ${D}`]:_=["打开终端","执行以下命令(需要输入管理员密码):",`sudo npm install -g ${D}`,"输入您的系统密码"],_},[]),x=h.useCallback(I=>{if(r!=="installing"){console.log(`[Frontend] 开始安装 ${I}`),l(I),i("installing"),f(""),p(!1),c([`正在连接到服务器...
|
|
816
|
-
`,`准备安装 ${I==="claude-code"?"Claude Code":"Codex"}...
|
|
817
|
-
`,`请稍候...
|
|
818
|
-
`]);try{m.current=V.installTool(I,{onStdout:O=>{console.log("[Frontend] stdout:",O),c(_=>[..._,O])},onStderr:O=>{console.log("[Frontend] stderr:",O),c(_=>[..._,O]),(O.includes("password")||O.includes("Password")||O.includes("密码"))&&p(!0)},onClose:(O,_)=>{console.log(`[Frontend] 安装完成,退出码: ${O}, 成功: ${_}`),p(!1),c(M=>[...M,_?`
|
|
819
|
-
✓ 安装成功!`:`
|
|
820
|
-
✗ 安装失败 (退出码: ${O})`]),i(_?"completed":"error"),f(_?"":`安装失败,退出码: ${O}`),_&&setTimeout(()=>{n()},1500)},onError:O=>{console.error("[Frontend] 安装错误:",O),c(_=>[..._,`[ERROR] ${O}`]),p(!1),i("error"),f(O)}});const D=setTimeout(()=>{i(O=>O==="installing"&&s.length<=3?(console.error("[Frontend] 连接超时"),c(_=>[..._,`
|
|
821
|
-
[ERROR] 连接服务器超时!`]),f("连接服务器超时"),"error"):O)},15e3);m.current||(m.current=()=>clearTimeout(D))}catch(D){console.error("[Frontend] 启动安装失败:",D),c(O=>[...O,`[ERROR] 启动安装失败: ${D}`]),i("error"),f(String(D))}}},[r,n]),v=h.useCallback(I=>{var D;console.log("[Frontend] 发送用户输入:",I.slice(0,10)),(D=m.current)!=null&&D.sendInput&&(m.current.sendInput(I),c(O=>[...O,`
|
|
822
|
-
$ ${"•".repeat(I.length)}
|
|
823
|
-
`]),p(!1))},[]),b=!e.claudeCode.installed||!e.codex.installed,w=r==="idle",j=r==="installing",k=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(Boe,{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,D)=>o.jsx("li",{style:{marginBottom:D<E.length-1?"8px":"0"},children:I},D))}),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]})]}),k&&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:"一键安装所需工具"})]}),k&&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:`
|
|
824
|
-
@keyframes spin {
|
|
825
|
-
0% { transform: rotate(0deg); }
|
|
826
|
-
100% { transform: rotate(360deg); }
|
|
827
|
-
}
|
|
828
|
-
`})]})}function Uoe({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 Woe=""+new URL("logo-CRx_w1Ov.png",import.meta.url).href,Koe="升级到 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=i8(),[j,k]=h.useState(!1),[S,E]=h.useState(!1),[I,D]=h.useState(""),[O,_]=h.useState(""),[M,G]=h.useState(!0),[q,A]=h.useState(!1),[U,K]=h.useState(""),[T,z]=h.useState(!1),[P,$]=h.useState(!1),[ee,N]=h.useState(!1),[le,me]=h.useState(null),[X,ne]=h.useState(!1);h.useEffect(()=>{const ge=localStorage.getItem("theme")||"light";n(ge),document.documentElement.setAttribute("data-theme",ge),localStorage.getItem("sidebar-collapsed")==="true"&&f(!0)},[]),h.useEffect(()=>{const ge=async()=>{try{const Ie=await V.checkVersion();p(Ie.hasUpdate),g(Ie.latestVersion),x(Ie.currentVersion)}catch(Ie){console.error("Failed to check version:",Ie)}};ge();const Te=setInterval(ge,6e4);return()=>clearInterval(Te)},[]),h.useEffect(()=>{(async()=>{try{const Te=await V.getAuthStatus();if(k(Te.enabled),!Te.enabled){E(!0),G(!1);return}if(!localStorage.getItem("auth_token")){G(!1);return}try{await V.getVendors(),E(!0)}catch{}}catch(Te){console.error("Failed to check auth status:",Te)}finally{G(!1)}})()},[]),h.useEffect(()=>{(async()=>{if(!T)try{const Te=await V.getUpgrade();Te.shouldShow&&Te.content&&(K(Te.content),A(!0)),z(!0)}catch(Te){console.error("Failed to check upgrade:",Te)}})()},[T]),h.useEffect(()=>{const ge=async()=>{if(X)return;if(localStorage.getItem("tools_install_completed")==="true"){ne(!0);return}try{const Ie=await V.getToolsStatus();me(Ie),!Ie.claudeCode.installed||!Ie.codex.installed?N(!0):localStorage.setItem("tools_install_completed","true"),ne(!0)}catch(Ie){console.error("Failed to check tools status:",Ie),ne(!0)}};(!M&&S||!M&&!j)&&ge()},[X,M,S,j]),h.useEffect(()=>{(async()=>{try{(await V.getVendors()).length===0&&!a&&(i(!0),l(!0))}catch(Te){console.error("Failed to check vendors:",Te)}})()},[a]);const ue=()=>{const ge=t==="light"?"dark":"light";n(ge),document.documentElement.setAttribute("data-theme",ge),localStorage.setItem("theme",ge)},Q=()=>{f(!u),localStorage.setItem("sidebar-collapsed",(!u).toString())},Z=()=>{i(!1),e("/vendors")},he=async()=>{try{await V.acknowledgeUpgrade()}catch(ge){console.error("Failed to acknowledge upgrade:",ge)}A(!1)},te=()=>{N(!1)},Ee=()=>{N(!1),$(!0)},ke=()=>{$(!1)},_e=async()=>{try{const ge=await V.getToolsStatus();me(ge),ge.claudeCode.installed&&ge.codex.installed&&(localStorage.setItem("tools_install_completed","true"),N(!1)),setTimeout(()=>{$(!1),(!ge.claudeCode.installed||!ge.codex.installed)&&N(!0)},500)}catch(ge){console.error("Failed to refresh tools status:",ge)}},ze=async ge=>{if(ge.preventDefault(),_(""),!I.trim()){_("请输入鉴权码");return}try{const Te=await V.login(I);localStorage.setItem("auth_token",Te.token),E(!0),D("")}catch(Te){Te instanceof Error?_(Te.message||"登录失败,请检查鉴权码"):_("登录失败,请检查鉴权码")}};return M?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:ze,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:ge=>D(ge.target.value),placeholder:"请输入鉴权码",style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-color)",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box"},autoFocus:!0})]}),O&&o.jsx("div",{style:{padding:"10px 12px",backgroundColor:"#fee",border:"1px solid #fcc",borderRadius:"6px",color:"#c33",fontSize:"14px",marginBottom:"16px"},children:O})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%"},children:"登录"})})]})]})})]}):o.jsxs("div",{className:"app",children:[o.jsxs("nav",{className:`sidebar ${u?"collapsed":""}`,children:[o.jsxs("div",{className:"logo",children:[o.jsx("img",{src:Woe,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:ue,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:Q,className:"sidebar-toggle-btn",title:u?"展开侧边栏":"收起侧边栏",children:u?"»":"«"})]})]}),o.jsx("main",{className:"main-content",children:o.jsxs(Zz,{children:[o.jsx(Qn,{path:"/",element:o.jsx(Nj,{})}),o.jsx(Qn,{path:"/statistics",element:o.jsx(Moe,{})}),o.jsx(Qn,{path:"/routes",element:o.jsx(Nj,{})}),o.jsx(Qn,{path:"/vendors",element:o.jsx(c8,{})}),o.jsx(Qn,{path:"/skills",element:o.jsx(Roe,{})}),o.jsx(Qn,{path:"/mcp",element:o.jsx(Loe,{})}),o.jsx(Qn,{path:"/access-keys",element:j?o.jsx(zoe,{}):o.jsx(od,{to:"/"})}),o.jsx(Qn,{path:"/access-keys/:id",element:j?o.jsx($oe,{}):o.jsx(od,{to:"/"})}),o.jsx(Qn,{path:"/sessions",element:j?o.jsx(od,{to:"/"}):o.jsx(H8,{})}),o.jsx(Qn,{path:"/logs",element:j?o.jsx(od,{to:"/"}):o.jsx(z8,{})}),o.jsx(Qn,{path:"/write-config",element:o.jsx(Y8,{})}),o.jsx(Qn,{path:"/settings",element:o.jsx(V8,{})}),o.jsx(Qn,{path:"/usage",element:o.jsx(X8,{})})]})}),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:Z,children:"前往供应商管理"})]})]})]})})]}),o.jsx(GT,{show:s,onClose:()=>c(!1),onComplete:()=>l(!0)}),q&&o.jsx("div",{className:"modal-overlay",children:o.jsx("div",{className:"modal",style:{maxWidth:"800px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"📋 升级提示"})}),o.jsx("div",{className:"modal-body",children:o.jsx("div",{className:"markdown-content",children:o.jsx(mc,{children:U})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:he,children:"我知道了"})})]})})}),ee&&le&&o.jsx(Uoe,{toolName:!le.claudeCode.installed&&!le.codex.installed?"both":le.claudeCode.installed?"codex":"claude-code",onInstallClick:Ee,onClose:te}),P&&le&&o.jsx(Foe,{status:le,onClose:ke,onInstallComplete:_e}),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(mc,{children:w})}):null:o.jsxs("div",{className:"markdown-content",children:[o.jsx("h4",{style:{marginBottom:12},children:"当前版本提示:"}),o.jsx(mc,{children:Koe})]})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>b(!1),children:"关闭"})})]})})]})]})}function Hoe(){return o.jsx(l$,{children:o.jsx(a8,{children:o.jsxs(h8,{children:[o.jsx(qoe,{}),o.jsx(l8,{})]})})})}kg.createRoot(document.getElementById("root")).render(o.jsx(HP.StrictMode,{children:o.jsx(Hoe,{})}));
|