diff --git a/cmd/computing-provider/daemon.go b/cmd/computing-provider/daemon.go index f7cbf5ef..a5d658dc 100644 --- a/cmd/computing-provider/daemon.go +++ b/cmd/computing-provider/daemon.go @@ -114,6 +114,20 @@ func runDaemon(cctx *cli.Context) error { providerStats := computing.NewProviderStatsClient( conf.GetConfig().Inference.ServiceURL, conf.GetConfig().Inference.ApiKey) + // Record the platform's lifetime earnings with every metrics snapshot, so + // the earnings series can be differenced from the ledger that governs + // rather than recomputed from token counts at published rates. The client + // caches, so this costs one upstream call every couple of minutes at most. + inferenceService.SetPlatformEarningsProvider(func() (float64, bool) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + stats, err := providerStats.Stats(ctx) + if err != nil || stats == nil { + return 0, false + } + return stats.TotalEarningsUSDC, true + }) + gin.SetMode(gin.ReleaseMode) r := gin.Default() configureEncodedPathParameters(r) diff --git a/docs/configuration.md b/docs/configuration.md index b1289d7f..4ba21859 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -298,6 +298,29 @@ overloaded GPU. Both can also be changed at runtime, globally or per model, through the REST API — see the endpoint table in the [main README](../README.md#rest-api). +### Earnings history + +`GET /inference/earnings/history` prefers **Swan Inference's own earnings +figure**. The platform's lifetime total is recorded with each metrics snapshot, +and consecutive samples are differenced to give what the platform says was +earned in each interval — no local rate arithmetic is involved, so it accounts +for however the platform actually settles. + +Where no platform figure was recorded — intervals stored before this existed, or +samples taken while the API was unreachable — the interval falls back to pricing +this node's own token counts at current published rates. Each point reports +which it is, and the dashboard says so rather than presenting the two as the +same number. + +Two consequences worth knowing: + +- **The split by model stays local.** The platform reports no per-model + breakdown, so the division of a bar is this node's share of served tokens + rescaled onto the authoritative total. The bar's height is the platform's + number; how it is divided is an estimate. +- **A decrease contributes zero.** The lifetime total going down is a + correction or a payout on the platform side, not negative earnings. + ### Request history ```toml diff --git a/internal/computing/earnings_history.go b/internal/computing/earnings_history.go index 7d6f5e32..bc7db87a 100644 --- a/internal/computing/earnings_history.go +++ b/internal/computing/earnings_history.go @@ -18,6 +18,12 @@ type EarningsPoint struct { Models map[string]ModelEarningsPoint `json:"models,omitempty"` // Unattributed is the part of USD this bucket cannot assign to any model. Unattributed float64 `json:"unattributed,omitempty"` + // Authoritative marks a bucket whose total came from differencing the + // platform's own lifetime figure rather than from local token counts + // priced at published rates. The two are not interchangeable: only the + // platform's ledger accounts for how it actually settles, so the UI must + // be able to say which one a bar is. + Authoritative bool `json:"authoritative,omitempty"` } // ModelEarningsPoint is one model's contribution to a bucket. @@ -41,6 +47,9 @@ type EarningsSeries struct { // days of a database that holds 7 should not silently look like a month of // near-zero earnings. Covers string `json:"covers,omitempty"` + // AuthoritativePoints is how many points were priced from the platform's + // own figure. Zero means the whole series is this node's estimate. + AuthoritativePoints int `json:"authoritative_points"` // BucketSeconds is the interval each point spans. Sent so the UI can label // and describe points from what was actually aggregated, rather than // re-deriving the rule from the requested duration and drifting from it. @@ -111,6 +120,7 @@ func CalculateEarningsHistory(ctx context.Context, snapshots []HistoricalDataPoi inRate, outRate := blendedRate(metrics, rates) var prevIn, prevOut int64 + var prevPlatform *float64 prevModels := map[string]ModelTokenCounts{} first := true for _, s := range snapshots { @@ -132,7 +142,28 @@ func CalculateEarningsHistory(ctx context.Context, snapshots []HistoricalDataPoi prevIn, prevOut = s.TotalTokensIn, s.TotalTokensOut // Rates are per million tokens, and the deltas are raw token counts. + // This is the fallback: it cannot know how the platform settles, so it + // is only used where the platform's own figure is unavailable. usd := float64(dIn)/tokensPerPriceUnit*inRate + float64(dOut)/tokensPerPriceUnit*outRate + + // Prefer the ledger. The platform's lifetime total is cumulative and + // never resets, so differencing consecutive samples gives what it says + // was earned in between — no local rate arithmetic involved. + authoritative := false + if s.PlatformEarningsUSD != nil { + if prevPlatform != nil { + delta := *s.PlatformEarningsUSD - *prevPlatform + // A decrease is a correction or a payout on the platform side, + // not negative earnings; it contributes nothing rather than + // subtracting from the window. + if delta < 0 { + delta = 0 + } + usd = delta + authoritative = true + } + prevPlatform = s.PlatformEarningsUSD + } out.TotalUSD += usd // Split the same delta by model where the sample carries one. Each @@ -142,9 +173,25 @@ func CalculateEarningsHistory(ctx context.Context, snapshots []HistoricalDataPoi if s.ModelTokens != nil { prevModels = s.ModelTokens } + // When the bucket's total came from the platform, the per-model figures + // did not: the platform reports no per-model breakdown, so the split is + // this node's own share of served tokens. Rescale it onto the + // authoritative total so the segments sum to the bar they are drawn in. + // + // The consequence is worth being explicit about: the bar's height is + // the platform's number, the division of it is this node's estimate. + if authoritative && attributed > 0 { + scale := usd / attributed + for id, m := range perModel { + m.USD *= scale + perModel[id] = m + } + attributed = usd + } + // Only what the split could not account for is unattributed. Comparing - // against the bucket's own priced total keeps the segments summing to - // the bar rather than to a separately-rounded figure. + // against the bucket's own total keeps the segments summing to the bar + // rather than to a separately-rounded figure. unattributed := usd - attributed if unattributed < 0 { unattributed = 0 @@ -160,17 +207,25 @@ func CalculateEarningsHistory(ctx context.Context, snapshots []HistoricalDataPoi p.TokensOut += dOut p.USD += usd p.Unattributed += unattributed + // A bucket is only authoritative if every sample in it was. + p.Authoritative = p.Authoritative && authoritative mergeModelPoints(p, perModel) continue } point := EarningsPoint{ Timestamp: key, TokensIn: dIn, TokensOut: dOut, USD: usd, - Unattributed: unattributed, + Unattributed: unattributed, Authoritative: authoritative, } mergeModelPoints(&point, perModel) out.Points = append(out.Points, point) } + for _, p := range out.Points { + if p.Authoritative { + out.AuthoritativePoints++ + } + } + if n := len(snapshots); n > 0 { out.Covers = snapshots[n-1].Timestamp.Sub(snapshots[0].Timestamp).Round(time.Hour).String() } diff --git a/internal/computing/earnings_split_test.go b/internal/computing/earnings_split_test.go index 12cef415..3e89ad03 100644 --- a/internal/computing/earnings_split_test.go +++ b/internal/computing/earnings_split_test.go @@ -167,3 +167,120 @@ func TestEarningsHistoryReportsItsBucket(t *testing.T) { t.Errorf("daily gave %d points, want 1 — all three samples are the same day", len(daily.Points)) } } + +func usd(v float64) *float64 { return &v } + +func snapPlatform(t time.Time, in, out int64, models map[string]ModelTokenCounts, platform *float64) HistoricalDataPoint { + p := snap(t, in, out, models) + p.PlatformEarningsUSD = platform + return p +} + +// The platform's lifetime figure is the number that governs. Differencing it +// gives what it says was earned in an interval, with no local rate arithmetic. +func TestEarningsHistoryPrefersThePlatformLedger(t *testing.T) { + t0 := time.Date(2026, 9, 4, 12, 0, 0, 0, time.UTC) + models := map[string]ModelTokenCounts{"a": {In: 1_000_000}} + // A local rate that would give a wildly different answer, to prove it is + // not the one being used. + prices := fixedPrices{"a": {ProviderInputPrice: 999, ProviderOutputPrice: 999}} + + series := CalculateEarningsHistory(context.Background(), + []HistoricalDataPoint{ + snapPlatform(t0, 0, 0, map[string]ModelTokenCounts{"a": {}}, usd(10)), + snapPlatform(t0.Add(time.Minute), 1_000_000, 0, models, usd(12.5)), + }, + metricsFor(models), prices, "24h", 0) + + last := series.Points[len(series.Points)-1] + if !last.Authoritative { + t.Error("bucket should be marked authoritative when it came from the ledger") + } + if last.USD < 2.49 || last.USD > 2.51 { + t.Errorf("bucket = %.4f, want the ledger delta 2.50 — not the local rate", last.USD) + } + if series.AuthoritativePoints != 1 { + t.Errorf("authoritative points = %d, want 1", series.AuthoritativePoints) + } +} + +// Samples with no platform figure keep the local estimate, and say so. +func TestEarningsHistoryFallsBackWhenLedgerAbsent(t *testing.T) { + t0 := time.Date(2026, 9, 4, 12, 0, 0, 0, time.UTC) + models := map[string]ModelTokenCounts{"a": {In: 1_000_000}} + prices := fixedPrices{"a": {ProviderInputPrice: 2, ProviderOutputPrice: 0}} + + series := CalculateEarningsHistory(context.Background(), + []HistoricalDataPoint{ + snap(t0, 0, 0, map[string]ModelTokenCounts{"a": {}}), + snap(t0.Add(time.Minute), 1_000_000, 0, models), + }, + metricsFor(models), prices, "24h", 0) + + last := series.Points[len(series.Points)-1] + if last.Authoritative { + t.Error("a bucket with no platform figure must not claim to be authoritative") + } + if last.USD < 1.99 || last.USD > 2.01 { + t.Errorf("fallback = %.4f, want the locally priced 2.00", last.USD) + } + if series.AuthoritativePoints != 0 { + t.Errorf("authoritative points = %d, want 0", series.AuthoritativePoints) + } +} + +// The platform reports no per-model split, so the local share is rescaled onto +// the authoritative total. The bar's height is the platform's; its division is +// this node's estimate — but the segments must still sum to the bar. +func TestEarningsHistoryRescalesModelSplitOntoLedgerTotal(t *testing.T) { + t0 := time.Date(2026, 9, 4, 12, 0, 0, 0, time.UTC) + models := map[string]ModelTokenCounts{"a": {In: 3_000_000}, "b": {In: 1_000_000}} + prices := fixedPrices{ + "a": {ProviderInputPrice: 1}, + "b": {ProviderInputPrice: 1}, + } + + series := CalculateEarningsHistory(context.Background(), + []HistoricalDataPoint{ + snapPlatform(t0, 0, 0, map[string]ModelTokenCounts{"a": {}, "b": {}}, usd(0)), + snapPlatform(t0.Add(time.Minute), 4_000_000, 0, models, usd(8)), + }, + metricsFor(models), prices, "24h", 0) + + last := series.Points[len(series.Points)-1] + if last.USD < 7.99 || last.USD > 8.01 { + t.Fatalf("bucket = %.4f, want the ledger's 8.00", last.USD) + } + sum := 0.0 + for _, m := range last.Models { + sum += m.USD + } + if sum < 7.99 || sum > 8.01 { + t.Errorf("model segments sum to %.4f, want them to fill the 8.00 bar", sum) + } + // Local rates gave a:b = 3:1, so the rescaled split must keep that ratio. + if got := last.Models["a"].USD; got < 5.99 || got > 6.01 { + t.Errorf("model a = %.4f, want 6.00 (3:1 of the ledger total)", got) + } + if last.Unattributed > 0.01 { + t.Errorf("unattributed = %.4f, want ~0 once the split fills the bar", last.Unattributed) + } +} + +// A lifetime total that goes down is a correction or a payout on the platform +// side, not negative earnings. +func TestEarningsHistoryTreatsLedgerDecreaseAsZero(t *testing.T) { + t0 := time.Date(2026, 9, 4, 12, 0, 0, 0, time.UTC) + models := map[string]ModelTokenCounts{"a": {In: 10}} + series := CalculateEarningsHistory(context.Background(), + []HistoricalDataPoint{ + snapPlatform(t0, 0, 0, nil, usd(50)), + snapPlatform(t0.Add(time.Minute), 10, 0, nil, usd(40)), + }, + metricsFor(models), nil, "24h", 0) + + last := series.Points[len(series.Points)-1] + if last.USD != 0 { + t.Errorf("bucket = %.4f, want 0 — a decrease must not subtract from the window", last.USD) + } +} diff --git a/internal/computing/inference_service.go b/internal/computing/inference_service.go index 967969d8..5b54cc19 100644 --- a/internal/computing/inference_service.go +++ b/internal/computing/inference_service.go @@ -1294,6 +1294,15 @@ func (s *InferenceService) GetRequestHistory(limit int, modelFilter string) []Re return s.client.metrics.GetRequestHistory(limit, modelFilter) } +// SetPlatformEarningsProvider installs the source of the platform's lifetime +// earnings figure, so each stored snapshot carries it and the earnings series +// can be differenced from the ledger rather than priced locally. +func (s *InferenceService) SetPlatformEarningsProvider(fn func() (float64, bool)) { + if s.metricsHistory != nil { + s.metricsHistory.SetPlatformEarningsProvider(fn) + } +} + // QueryRequestHistory returns one page of request history along with the total // matching the filters. // diff --git a/internal/computing/metrics_history.go b/internal/computing/metrics_history.go index b81b46f4..ef5ef48e 100644 --- a/internal/computing/metrics_history.go +++ b/internal/computing/metrics_history.go @@ -36,6 +36,16 @@ type MetricsHistoryEntity struct { // column existed have it empty, and those intervals stay unattributed — // history cannot be split after the fact. ModelTokens string `gorm:"type:text" json:"model_tokens,omitempty"` + // PlatformEarningsUSD is the platform's own lifetime earnings figure at + // this instant. Stored so a bucket's earnings can be read off the ledger + // that governs, by differencing consecutive samples, instead of being + // recomputed locally from token counts and published rates — which cannot + // account for how the platform actually settles. + // + // A pointer because absent and zero are different: rows written before this + // column existed have no figure, and a provider that has genuinely earned + // nothing has zero. + PlatformEarningsUSD *float64 `json:"platform_earnings_usd,omitempty"` } // ModelTokenCounts is one model's cumulative token counters. Like the node-wide @@ -66,6 +76,9 @@ type HistoricalDataPoint struct { // ModelTokens is the same cumulative split, per model. Empty for samples // recorded before the column existed. ModelTokens map[string]ModelTokenCounts `json:"model_tokens,omitempty"` + // PlatformEarningsUSD is the platform's lifetime figure at this sample, or + // nil when none was recorded. + PlatformEarningsUSD *float64 `json:"platform_earnings_usd,omitempty"` } // MetricsHistory manages historical metrics storage and retrieval @@ -75,6 +88,19 @@ type MetricsHistory struct { retentionDays int stopChan chan struct{} running bool + // platformEarnings reports the platform's lifetime earnings, and whether a + // figure was available. Set separately from Start because the stats client + // is built after the service starts; snapshots taken before it is set + // simply carry no platform figure. + platformEarnings func() (float64, bool) +} + +// SetPlatformEarningsProvider installs the source of the platform's lifetime +// earnings figure, recorded with each snapshot. +func (h *MetricsHistory) SetPlatformEarningsProvider(fn func() (float64, bool)) { + h.mu.Lock() + defer h.mu.Unlock() + h.platformEarnings = fn } // NewMetricsHistory creates a new MetricsHistory instance @@ -186,6 +212,15 @@ func (h *MetricsHistory) recordSnapshot(metricsProvider func() *InferenceMetrics ModelTokens: encodeModelTokens(snapshot.ModelMetrics), } + h.mu.RLock() + platform := h.platformEarnings + h.mu.RUnlock() + if platform != nil { + if usd, ok := platform(); ok { + entry.PlatformEarningsUSD = &usd + } + } + if err := database.Create(&entry).Error; err != nil { logs.GetLogger().Warnf("Failed to record metrics history: %v", err) } @@ -300,16 +335,17 @@ func (h *MetricsHistory) aggregateByResolution(entries []MetricsHistoryEntity, r result := make([]HistoricalDataPoint, len(entries)) for i, e := range entries { result[i] = HistoricalDataPoint{ - Timestamp: e.Timestamp, - TotalRequests: e.TotalRequests, - SuccessRate: e.SuccessRate, - AvgLatencyMs: e.AvgLatencyMs, - P99LatencyMs: e.P99LatencyMs, - TokensPerSecond: e.TokensPerSecond, - RequestsPerMinute: e.RequestsPerMinute, - TotalTokensIn: e.TotalTokensIn, - TotalTokensOut: e.TotalTokensOut, - ModelTokens: decodeModelTokens(e.ModelTokens), + Timestamp: e.Timestamp, + TotalRequests: e.TotalRequests, + SuccessRate: e.SuccessRate, + AvgLatencyMs: e.AvgLatencyMs, + P99LatencyMs: e.P99LatencyMs, + TokensPerSecond: e.TokensPerSecond, + RequestsPerMinute: e.RequestsPerMinute, + TotalTokensIn: e.TotalTokensIn, + TotalTokensOut: e.TotalTokensOut, + ModelTokens: decodeModelTokens(e.ModelTokens), + PlatformEarningsUSD: e.PlatformEarningsUSD, } } return result @@ -358,16 +394,17 @@ func (h *MetricsHistory) aggregateByResolution(entries []MetricsHistoryEntity, r // exists, which would make every later difference wrong. last := bucket[len(bucket)-1] result = append(result, HistoricalDataPoint{ - Timestamp: time.Unix(key, 0), - TotalRequests: maxTotalReqs, - SuccessRate: sumSuccessRate / count, - AvgLatencyMs: sumAvgLatency / count, - P99LatencyMs: sumP99Latency / count, - TokensPerSecond: sumTokensPerSec / count, - RequestsPerMinute: sumReqPerMin / count, - TotalTokensIn: last.TotalTokensIn, - TotalTokensOut: last.TotalTokensOut, - ModelTokens: decodeModelTokens(last.ModelTokens), + Timestamp: time.Unix(key, 0), + TotalRequests: maxTotalReqs, + SuccessRate: sumSuccessRate / count, + AvgLatencyMs: sumAvgLatency / count, + P99LatencyMs: sumP99Latency / count, + TokensPerSecond: sumTokensPerSec / count, + RequestsPerMinute: sumReqPerMin / count, + TotalTokensIn: last.TotalTokensIn, + TotalTokensOut: last.TotalTokensOut, + ModelTokens: decodeModelTokens(last.ModelTokens), + PlatformEarningsUSD: last.PlatformEarningsUSD, }) } diff --git a/internal/dashboard/ui/dist/assets/index-BhTw3f0T.js b/internal/dashboard/ui/dist/assets/index-DxUNGQDF.js similarity index 79% rename from internal/dashboard/ui/dist/assets/index-BhTw3f0T.js rename to internal/dashboard/ui/dist/assets/index-DxUNGQDF.js index 08c08af1..dc337c09 100644 --- a/internal/dashboard/ui/dist/assets/index-BhTw3f0T.js +++ b/internal/dashboard/ui/dist/assets/index-DxUNGQDF.js @@ -1,18 +1,18 @@ -function O4(e,t){for(var n=0;na[l]})}}}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 l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lm={exports:{}},Lu={};var CS;function _4(){if(CS)return Lu;CS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:c,ref:l!==void 0?l:null,props:o}}return Lu.Fragment=t,Lu.jsx=n,Lu.jsxs=n,Lu}var DS;function A4(){return DS||(DS=1,Lm.exports=_4()),Lm.exports}var g=A4(),Um={exports:{}},xe={};var kS;function E4(){if(kS)return xe;kS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=b&&P[b]||P["@@iterator"],typeof P=="function"?P:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,_={};function E(P,F,ie){this.props=P,this.context=F,this.refs=_,this.updater=ie||O}E.prototype.isReactComponent={},E.prototype.setState=function(P,F){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,F,"setState")},E.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=E.prototype;function T(P,F,ie){this.props=P,this.context=F,this.refs=_,this.updater=ie||O}var C=T.prototype=new N;C.constructor=T,j(C,E.prototype),C.isPureReactComponent=!0;var k=Array.isArray;function M(){}var L={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function re(P,F,ie){var le=ie.ref;return{$$typeof:e,type:P,key:F,ref:le!==void 0?le:null,props:ie}}function H(P,F){return re(P.type,F,P.props)}function $(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function K(P){var F={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(ie){return F[ie]})}var ce=/\/+/g;function ue(P,F){return typeof P=="object"&&P!==null&&P.key!=null?K(""+P.key):F.toString(36)}function ve(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(M,M):(P.status="pending",P.then(function(F){P.status==="pending"&&(P.status="fulfilled",P.value=F)},function(F){P.status==="pending"&&(P.status="rejected",P.reason=F)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function I(P,F,ie,le,ye){var be=typeof P;(be==="undefined"||be==="boolean")&&(P=null);var he=!1;if(P===null)he=!0;else switch(be){case"bigint":case"string":case"number":he=!0;break;case"object":switch(P.$$typeof){case e:case t:he=!0;break;case v:return he=P._init,I(he(P._payload),F,ie,le,ye)}}if(he)return ye=ye(P),he=le===""?"."+ue(P,0):le,k(ye)?(ie="",he!=null&&(ie=he.replace(ce,"$&/")+"/"),I(ye,F,ie,"",function(Se){return Se})):ye!=null&&($(ye)&&(ye=H(ye,ie+(ye.key==null||P&&P.key===ye.key?"":(""+ye.key).replace(ce,"$&/")+"/")+he)),F.push(ye)),1;he=0;var ut=le===""?".":le+":";if(k(P))for(var Q=0;Q>>1,ne=I[G];if(0>>1;Gl(ie,z))lel(ye,ie)?(I[G]=ye,I[le]=z,G=le):(I[G]=ie,I[F]=z,G=F);else if(lel(ye,z))I[G]=ye,I[le]=z,G=le;else break e}}return ee}function l(I,ee){var z=I.sortIndex-ee.sortIndex;return z!==0?z:I.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var d=[],h=[],v=1,p=null,b=3,x=!1,O=!1,j=!1,_=!1,E=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function C(I){for(var ee=n(h);ee!==null;){if(ee.callback===null)a(h);else if(ee.startTime<=I)a(h),ee.sortIndex=ee.expirationTime,t(d,ee);else break;ee=n(h)}}function k(I){if(j=!1,C(I),!O)if(n(d)!==null)O=!0,M||(M=!0,K());else{var ee=n(h);ee!==null&&ve(k,ee.startTime-I)}}var M=!1,L=-1,W=5,re=-1;function H(){return _?!0:!(e.unstable_now()-reI&&H());){var G=p.callback;if(typeof G=="function"){p.callback=null,b=p.priorityLevel;var ne=G(p.expirationTime<=I);if(I=e.unstable_now(),typeof ne=="function"){p.callback=ne,C(I),ee=!0;break t}p===n(d)&&a(d),C(I)}else a(d);p=n(d)}if(p!==null)ee=!0;else{var P=n(h);P!==null&&ve(k,P.startTime-I),ee=!1}}break e}finally{p=null,b=z,x=!1}ee=void 0}}finally{ee?K():M=!1}}}var K;if(typeof T=="function")K=function(){T($)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,ue=ce.port2;ce.port1.onmessage=$,K=function(){ue.postMessage(null)}}else K=function(){E($,0)};function ve(I,ee){L=E(function(){I(e.unstable_now())},ee)}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(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125G?(I.sortIndex=z,t(h,I),n(d)===null&&I===n(h)&&(j?(N(L),L=-1):j=!0,ve(k,z-G))):(I.sortIndex=ne,t(d,I),O||x||(O=!0,M||(M=!0,K()))),I},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(I){var ee=b;return function(){var z=b;b=ee;try{return I.apply(this,arguments)}finally{b=z}}}})(Bm)),Bm}var RS;function C4(){return RS||(RS=1,qm.exports=M4()),qm.exports}var Im={exports:{}},Xt={};var LS;function D4(){if(LS)return Xt;LS=1;var e=kl();function t(d){var h="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Im.exports=D4(),Im.exports}var $S;function k4(){if($S)return Uu;$S=1;var e=C4(),t=kl(),n=Y_();function a(r){var i="https://react.dev/errors/"+r;if(1ne||(r.current=G[ne],G[ne]=null,ne--)}function ie(r,i){ne++,G[ne]=r.current,r.current=i}var le=P(null),ye=P(null),be=P(null),he=P(null);function ut(r,i){switch(ie(be,i),ie(ye,r),ie(le,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?eS(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=eS(i),r=tS(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}F(le),ie(le,r)}function Q(){F(le),F(ye),F(be)}function Se(r){r.memoizedState!==null&&ie(he,r);var i=le.current,u=tS(i,r.type);i!==u&&(ie(ye,r),ie(le,u))}function _e(r){ye.current===r&&(F(le),F(ye)),he.current===r&&(F(he),ku._currentValue=z)}var ae,Lt;function Ce(r){if(ae===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);ae=i&&i[1]||"",Lt=-1a[l]})}}}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 l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lm={exports:{}},Lu={};var CS;function _4(){if(CS)return Lu;CS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:c,ref:l!==void 0?l:null,props:o}}return Lu.Fragment=t,Lu.jsx=n,Lu.jsxs=n,Lu}var DS;function A4(){return DS||(DS=1,Lm.exports=_4()),Lm.exports}var g=A4(),$m={exports:{}},xe={};var kS;function E4(){if(kS)return xe;kS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function x(k){return k===null||typeof k!="object"?null:(k=b&&k[b]||k["@@iterator"],typeof k=="function"?k:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,_={};function N(k,F,ie){this.props=k,this.context=F,this.refs=_,this.updater=ie||O}N.prototype.isReactComponent={},N.prototype.setState=function(k,F){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,F,"setState")},N.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function E(){}E.prototype=N.prototype;function T(k,F,ie){this.props=k,this.context=F,this.refs=_,this.updater=ie||O}var P=T.prototype=new E;P.constructor=T,j(P,N.prototype),P.isPureReactComponent=!0;var C=Array.isArray;function M(){}var L={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function re(k,F,ie){var le=ie.ref;return{$$typeof:e,type:k,key:F,ref:le!==void 0?le:null,props:ie}}function B(k,F){return re(k.type,F,k.props)}function U(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function K(k){var F={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ie){return F[ie]})}var ce=/\/+/g;function ue(k,F){return typeof k=="object"&&k!==null&&k.key!=null?K(""+k.key):F.toString(36)}function ve(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(M,M):(k.status="pending",k.then(function(F){k.status==="pending"&&(k.status="fulfilled",k.value=F)},function(F){k.status==="pending"&&(k.status="rejected",k.reason=F)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function H(k,F,ie,le,ye){var be=typeof k;(be==="undefined"||be==="boolean")&&(k=null);var he=!1;if(k===null)he=!0;else switch(be){case"bigint":case"string":case"number":he=!0;break;case"object":switch(k.$$typeof){case e:case t:he=!0;break;case v:return he=k._init,H(he(k._payload),F,ie,le,ye)}}if(he)return ye=ye(k),he=le===""?"."+ue(k,0):le,C(ye)?(ie="",he!=null&&(ie=he.replace(ce,"$&/")+"/"),H(ye,F,ie,"",function(Se){return Se})):ye!=null&&(U(ye)&&(ye=B(ye,ie+(ye.key==null||k&&k.key===ye.key?"":(""+ye.key).replace(ce,"$&/")+"/")+he)),F.push(ye)),1;he=0;var ut=le===""?".":le+":";if(C(k))for(var W=0;W>>1,ne=H[G];if(0>>1;Gl(ie,z))lel(ye,ie)?(H[G]=ye,H[le]=z,G=le):(H[G]=ie,H[F]=z,G=F);else if(lel(ye,z))H[G]=ye,H[le]=z,G=le;else break e}}return ee}function l(H,ee){var z=H.sortIndex-ee.sortIndex;return z!==0?z:H.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var d=[],h=[],v=1,p=null,b=3,x=!1,O=!1,j=!1,_=!1,N=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function P(H){for(var ee=n(h);ee!==null;){if(ee.callback===null)a(h);else if(ee.startTime<=H)a(h),ee.sortIndex=ee.expirationTime,t(d,ee);else break;ee=n(h)}}function C(H){if(j=!1,P(H),!O)if(n(d)!==null)O=!0,M||(M=!0,K());else{var ee=n(h);ee!==null&&ve(C,ee.startTime-H)}}var M=!1,L=-1,Z=5,re=-1;function B(){return _?!0:!(e.unstable_now()-reH&&B());){var G=p.callback;if(typeof G=="function"){p.callback=null,b=p.priorityLevel;var ne=G(p.expirationTime<=H);if(H=e.unstable_now(),typeof ne=="function"){p.callback=ne,P(H),ee=!0;break t}p===n(d)&&a(d),P(H)}else a(d);p=n(d)}if(p!==null)ee=!0;else{var k=n(h);k!==null&&ve(C,k.startTime-H),ee=!1}}break e}finally{p=null,b=z,x=!1}ee=void 0}}finally{ee?K():M=!1}}}var K;if(typeof T=="function")K=function(){T(U)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,ue=ce.port2;ce.port1.onmessage=U,K=function(){ue.postMessage(null)}}else K=function(){N(U,0)};function ve(H,ee){L=N(function(){H(e.unstable_now())},ee)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125G?(H.sortIndex=z,t(h,H),n(d)===null&&H===n(h)&&(j?(E(L),L=-1):j=!0,ve(C,z-G))):(H.sortIndex=ne,t(d,H),O||x||(O=!0,M||(M=!0,K()))),H},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(H){var ee=b;return function(){var z=b;b=ee;try{return H.apply(this,arguments)}finally{b=z}}}})(Bm)),Bm}var RS;function C4(){return RS||(RS=1,qm.exports=M4()),qm.exports}var Im={exports:{}},Xt={};var LS;function D4(){if(LS)return Xt;LS=1;var e=kl();function t(d){var h="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Im.exports=D4(),Im.exports}var US;function k4(){if(US)return $u;US=1;var e=C4(),t=kl(),n=Y_();function a(r){var i="https://react.dev/errors/"+r;if(1ne||(r.current=G[ne],G[ne]=null,ne--)}function ie(r,i){ne++,G[ne]=r.current,r.current=i}var le=k(null),ye=k(null),be=k(null),he=k(null);function ut(r,i){switch(ie(be,i),ie(ye,r),ie(le,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?eS(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=eS(i),r=tS(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}F(le),ie(le,r)}function W(){F(le),F(ye),F(be)}function Se(r){r.memoizedState!==null&&ie(he,r);var i=le.current,u=tS(i,r.type);i!==u&&(ie(ye,r),ie(le,u))}function _e(r){ye.current===r&&(F(le),F(ye)),he.current===r&&(F(he),ku._currentValue=z)}var ae,Lt;function Ce(r){if(ae===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);ae=i&&i[1]||"",Lt=-1)":-1m||D[s]!==B[m]){var Z=` -`+D[s].replace(" at new "," at ");return r.displayName&&Z.includes("")&&(Z=Z.replace("",r.displayName)),Z}while(1<=s&&0<=m);break}}}finally{Ut=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?Ce(u):""}function br(r,i){switch(r.tag){case 26:case 27:case 5:return Ce(r.type);case 16:return Ce("Lazy");case 13:return r.child!==i&&i!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return $t(r.type,!1);case 11:return $t(r.type.render,!1);case 1:return $t(r.type,!0);case 31:return Ce("Activity");default:return""}}function Kl(r){try{var i="",u=null;do i+=br(r,u),u=r,r=r.return;while(r);return i}catch(s){return` +`+ae+r+Lt}var $t=!1;function Ut(r,i){if(!r||$t)return"";$t=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(i){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(X){var Y=X}Reflect.construct(r,[],te)}else{try{te.call()}catch(X){Y=X}r.call(te.prototype)}}else{try{throw Error()}catch(X){Y=X}(te=r())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(X){if(X&&Y&&typeof X.stack=="string")return[X.stack,Y.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=s.DetermineComponentFrameRoot(),w=y[0],A=y[1];if(w&&A){var D=w.split(` +`),I=A.split(` +`);for(m=s=0;sm||D[s]!==I[m]){var Q=` +`+D[s].replace(" at new "," at ");return r.displayName&&Q.includes("")&&(Q=Q.replace("",r.displayName)),Q}while(1<=s&&0<=m);break}}}finally{$t=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?Ce(u):""}function br(r,i){switch(r.tag){case 26:case 27:case 5:return Ce(r.type);case 16:return Ce("Lazy");case 13:return r.child!==i&&i!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Ut(r.type,!1);case 11:return Ut(r.type.render,!1);case 1:return Ut(r.type,!0);case 31:return Ce("Activity");default:return""}}function Kl(r){try{var i="",u=null;do i+=br(r,u),u=r,r=r.return;while(r);return i}catch(s){return` Error generating stack: `+s.message+` -`+s.stack}}var wd=Object.prototype.hasOwnProperty,jd=e.unstable_scheduleCallback,Od=e.unstable_cancelCallback,n3=e.unstable_shouldYield,r3=e.unstable_requestPaint,vn=e.unstable_now,a3=e.unstable_getCurrentPriorityLevel,Dg=e.unstable_ImmediatePriority,kg=e.unstable_UserBlockingPriority,Ko=e.unstable_NormalPriority,i3=e.unstable_LowPriority,Pg=e.unstable_IdlePriority,l3=e.log,u3=e.unstable_setDisableYieldValue,Yl=null,pn=null;function aa(r){if(typeof l3=="function"&&u3(r),pn&&typeof pn.setStrictMode=="function")try{pn.setStrictMode(Yl,r)}catch{}}var yn=Math.clz32?Math.clz32:c3,o3=Math.log,s3=Math.LN2;function c3(r){return r>>>=0,r===0?32:31-(o3(r)/s3|0)|0}var Yo=256,Go=262144,Vo=4194304;function Ha(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Xo(r,i,u){var s=r.pendingLanes;if(s===0)return 0;var m=0,y=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var A=s&134217727;return A!==0?(s=A&~y,s!==0?m=Ha(s):(w&=A,w!==0?m=Ha(w):u||(u=A&~r,u!==0&&(m=Ha(u))))):(A=s&~y,A!==0?m=Ha(A):w!==0?m=Ha(w):u||(u=s&~r,u!==0&&(m=Ha(u)))),m===0?0:i!==0&&i!==m&&(i&y)===0&&(y=m&-m,u=i&-i,y>=u||y===32&&(u&4194048)!==0)?i:m}function Gl(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function f3(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zg(){var r=Vo;return Vo<<=1,(Vo&62914560)===0&&(Vo=4194304),r}function _d(r){for(var i=[],u=0;31>u;u++)i.push(r);return i}function Vl(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function d3(r,i,u,s,m,y){var w=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var A=r.entanglements,D=r.expirationTimes,B=r.hiddenUpdates;for(u=w&~u;0"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var g3=/[\n"\\]/g;function Dn(r){return r.replace(g3,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Cd(r,i,u,s,m,y,w,A){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Cn(i)):r.value!==""+Cn(i)&&(r.value=""+Cn(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?Dd(r,w,Cn(i)):u!=null?Dd(r,w,Cn(u)):s!=null&&r.removeAttribute("value"),m==null&&y!=null&&(r.defaultChecked=!!y),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.name=""+Cn(A):r.removeAttribute("name")}function Xg(r,i,u,s,m,y,w,A){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){Md(r);return}u=u!=null?""+Cn(u):"",i=i!=null?""+Cn(i):u,A||i===r.value||(r.value=i),r.defaultValue=i}s=s??m,s=typeof s!="function"&&typeof s!="symbol"&&!!s,r.checked=A?r.checked:!!s,r.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Md(r)}function Dd(r,i,u){i==="number"&&Qo(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function Pi(r,i,u,s){if(r=r.options,i){i={};for(var m=0;m"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ld=!1;if(wr)try{var Ql={};Object.defineProperty(Ql,"passive",{get:function(){Ld=!0}}),window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{Ld=!1}var la=null,Ud=null,Jo=null;function tb(){if(Jo)return Jo;var r,i=Ud,u=i.length,s,m="value"in la?la.value:la.textContent,y=m.length;for(r=0;r=eu),ub=" ",ob=!1;function sb(r,i){switch(r){case"keyup":return G3.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cb(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ui=!1;function X3(r,i){switch(r){case"compositionend":return cb(i);case"keypress":return i.which!==32?null:(ob=!0,ub);case"textInput":return r=i.data,r===ub&&ob?null:r;default:return null}}function F3(r,i){if(Ui)return r==="compositionend"||!Hd&&sb(r,i)?(r=tb(),Jo=Ud=la=null,Ui=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:u,offset:i-r};r=s}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=gb(u)}}function xb(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?xb(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Sb(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Qo(r.document);i instanceof r.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)r=i.contentWindow;else break;i=Qo(r.document)}return i}function Gd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var rC=wr&&"documentMode"in document&&11>=document.documentMode,$i=null,Vd=null,au=null,Xd=!1;function wb(r,i,u){var s=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Xd||$i==null||$i!==Qo(s)||(s=$i,"selectionStart"in s&&Gd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),au&&ru(au,s)||(au=s,s=Gs(Vd,"onSelect"),0>=w,m-=w,lr=1<<32-yn(i)+m|u<Oe?(Te=fe,fe=null):Te=fe.sibling;var ke=Y(U,fe,q[Oe],J);if(ke===null){fe===null&&(fe=Te);break}r&&fe&&ke.alternate===null&&i(U,fe),R=y(ke,R,Oe),De===null?pe=ke:De.sibling=ke,De=ke,fe=Te}if(Oe===q.length)return u(U,fe),Me&&Or(U,Oe),pe;if(fe===null){for(;OeOe?(Te=fe,fe=null):Te=fe.sibling;var Na=Y(U,fe,ke.value,J);if(Na===null){fe===null&&(fe=Te);break}r&&fe&&Na.alternate===null&&i(U,fe),R=y(Na,R,Oe),De===null?pe=Na:De.sibling=Na,De=Na,fe=Te}if(ke.done)return u(U,fe),Me&&Or(U,Oe),pe;if(fe===null){for(;!ke.done;Oe++,ke=q.next())ke=te(U,ke.value,J),ke!==null&&(R=y(ke,R,Oe),De===null?pe=ke:De.sibling=ke,De=ke);return Me&&Or(U,Oe),pe}for(fe=s(fe);!ke.done;Oe++,ke=q.next())ke=X(fe,U,Oe,ke.value,J),ke!==null&&(r&&ke.alternate!==null&&fe.delete(ke.key===null?Oe:ke.key),R=y(ke,R,Oe),De===null?pe=ke:De.sibling=ke,De=ke);return r&&fe.forEach(function(j4){return i(U,j4)}),Me&&Or(U,Oe),pe}function Ke(U,R,q,J){if(typeof q=="object"&&q!==null&&q.type===j&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case x:e:{for(var pe=q.key;R!==null;){if(R.key===pe){if(pe=q.type,pe===j){if(R.tag===7){u(U,R.sibling),J=m(R,q.props.children),J.return=U,U=J;break e}}else if(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===W&&ei(pe)===R.type){u(U,R.sibling),J=m(R,q.props),cu(J,q),J.return=U,U=J;break e}u(U,R);break}else i(U,R);R=R.sibling}q.type===j?(J=Fa(q.props.children,U.mode,J,q.key),J.return=U,U=J):(J=ss(q.type,q.key,q.props,null,U.mode,J),cu(J,q),J.return=U,U=J)}return w(U);case O:e:{for(pe=q.key;R!==null;){if(R.key===pe)if(R.tag===4&&R.stateNode.containerInfo===q.containerInfo&&R.stateNode.implementation===q.implementation){u(U,R.sibling),J=m(R,q.children||[]),J.return=U,U=J;break e}else{u(U,R);break}else i(U,R);R=R.sibling}J=th(q,U.mode,J),J.return=U,U=J}return w(U);case W:return q=ei(q),Ke(U,R,q,J)}if(ve(q))return se(U,R,q,J);if(K(q)){if(pe=K(q),typeof pe!="function")throw Error(a(150));return q=pe.call(q),ge(U,R,q,J)}if(typeof q.then=="function")return Ke(U,R,ps(q),J);if(q.$$typeof===T)return Ke(U,R,ds(U,q),J);ys(U,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,R!==null&&R.tag===6?(u(U,R.sibling),J=m(R,q),J.return=U,U=J):(u(U,R),J=eh(q,U.mode,J),J.return=U,U=J),w(U)):u(U,R)}return function(U,R,q,J){try{su=0;var pe=Ke(U,R,q,J);return Zi=null,pe}catch(fe){if(fe===Fi||fe===ms)throw fe;var De=bn(29,fe,null,U.mode);return De.lanes=J,De.return=U,De}}}var ni=Yb(!0),Gb=Yb(!1),fa=!1;function hh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mh(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function da(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ha(r,i,u){var s=r.updateQueue;if(s===null)return null;if(s=s.shared,(ze&2)!==0){var m=s.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),s.pending=i,i=os(r),Tb(r,null,u),i}return us(r,s,i,u),os(r)}function fu(r,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var s=i.lanes;s&=r.pendingLanes,u|=s,i.lanes=u,Lg(r,u)}}function vh(r,i){var u=r.updateQueue,s=r.alternate;if(s!==null&&(s=s.updateQueue,u===s)){var m=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?m=y=w:y=y.next=w,u=u.next}while(u!==null);y===null?m=y=i:y=y.next=i}else m=y=i;u={baseState:s.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:s.shared,callbacks:s.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=i:r.next=i,u.lastBaseUpdate=i}var ph=!1;function du(){if(ph){var r=Xi;if(r!==null)throw r}}function hu(r,i,u,s){ph=!1;var m=r.updateQueue;fa=!1;var y=m.firstBaseUpdate,w=m.lastBaseUpdate,A=m.shared.pending;if(A!==null){m.shared.pending=null;var D=A,B=D.next;D.next=null,w===null?y=B:w.next=B,w=D;var Z=r.alternate;Z!==null&&(Z=Z.updateQueue,A=Z.lastBaseUpdate,A!==w&&(A===null?Z.firstBaseUpdate=B:A.next=B,Z.lastBaseUpdate=D))}if(y!==null){var te=m.baseState;w=0,Z=B=D=null,A=y;do{var Y=A.lane&-536870913,X=Y!==A.lane;if(X?(Ne&Y)===Y:(s&Y)===Y){Y!==0&&Y===Vi&&(ph=!0),Z!==null&&(Z=Z.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var se=r,ge=A;Y=i;var Ke=u;switch(ge.tag){case 1:if(se=ge.payload,typeof se=="function"){te=se.call(Ke,te,Y);break e}te=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=ge.payload,Y=typeof se=="function"?se.call(Ke,te,Y):se,Y==null)break e;te=p({},te,Y);break e;case 2:fa=!0}}Y=A.callback,Y!==null&&(r.flags|=64,X&&(r.flags|=8192),X=m.callbacks,X===null?m.callbacks=[Y]:X.push(Y))}else X={lane:Y,tag:A.tag,payload:A.payload,callback:A.callback,next:null},Z===null?(B=Z=X,D=te):Z=Z.next=X,w|=Y;if(A=A.next,A===null){if(A=m.shared.pending,A===null)break;X=A,A=X.next,X.next=null,m.lastBaseUpdate=X,m.shared.pending=null}}while(!0);Z===null&&(D=te),m.baseState=D,m.firstBaseUpdate=B,m.lastBaseUpdate=Z,y===null&&(m.shared.lanes=0),ga|=w,r.lanes=w,r.memoizedState=te}}function Vb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Xb(r,i){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;ry?y:8;var w=I.T,A={};I.T=A,zh(r,!1,i,u);try{var D=m(),B=I.S;if(B!==null&&B(A,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Z=dC(D,s);pu(r,i,Z,On(r))}else pu(r,i,s,On(r))}catch(te){pu(r,i,{then:function(){},status:"rejected",reason:te},On())}finally{ee.p=y,w!==null&&A.types!==null&&(w.types=A.types),I.T=w}}function gC(){}function kh(r,i,u,s){if(r.tag!==5)throw Error(a(476));var m=Ax(r).queue;_x(r,m,i,z,u===null?gC:function(){return Ex(r),u(s)})}function Ax(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:z},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:u},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Ex(r){var i=Ax(r);i.next===null&&(i=r.alternate.memoizedState),pu(r,i.next.queue,{},On())}function Ph(){return It(ku)}function Nx(){return ht().memoizedState}function Tx(){return ht().memoizedState}function bC(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var u=On();r=da(u);var s=ha(i,r,u);s!==null&&(cn(s,i,u),fu(s,i,u)),i={cache:sh()},r.payload=i;return}i=i.return}}function xC(r,i,u){var s=On();u={lane:s,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Es(r)?Cx(i,u):(u=Wd(r,i,u,s),u!==null&&(cn(u,r,s),Dx(u,i,s)))}function Mx(r,i,u){var s=On();pu(r,i,u,s)}function pu(r,i,u,s){var m={lane:s,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Es(r))Cx(i,m);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var w=i.lastRenderedState,A=y(w,u);if(m.hasEagerState=!0,m.eagerState=A,gn(A,w))return us(r,i,m,0),Ve===null&&ls(),!1}catch{}if(u=Wd(r,i,m,s),u!==null)return cn(u,r,s),Dx(u,i,s),!0}return!1}function zh(r,i,u,s){if(s={lane:2,revertLane:hm(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Es(r)){if(i)throw Error(a(479))}else i=Wd(r,u,s,2),i!==null&&cn(i,r,2)}function Es(r){var i=r.alternate;return r===we||i!==null&&i===we}function Cx(r,i){Wi=xs=!0;var u=r.pending;u===null?i.next=i:(i.next=u.next,u.next=i),r.pending=i}function Dx(r,i,u){if((u&4194048)!==0){var s=i.lanes;s&=r.pendingLanes,u|=s,i.lanes=u,Lg(r,u)}}var yu={readContext:It,use:js,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};yu.useEffectEvent=ot;var kx={readContext:It,use:js,useCallback:function(r,i){return Jt().memoizedState=[r,i===void 0?null:i],r},useContext:It,useEffect:px,useImperativeHandle:function(r,i,u){u=u!=null?u.concat([r]):null,_s(4194308,4,xx.bind(null,i,r),u)},useLayoutEffect:function(r,i){return _s(4194308,4,r,i)},useInsertionEffect:function(r,i){_s(4,2,r,i)},useMemo:function(r,i){var u=Jt();i=i===void 0?null:i;var s=r();if(ri){aa(!0);try{r()}finally{aa(!1)}}return u.memoizedState=[s,i],s},useReducer:function(r,i,u){var s=Jt();if(u!==void 0){var m=u(i);if(ri){aa(!0);try{u(i)}finally{aa(!1)}}}else m=i;return s.memoizedState=s.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},s.queue=r,r=r.dispatch=xC.bind(null,we,r),[s.memoizedState,r]},useRef:function(r){var i=Jt();return r={current:r},i.memoizedState=r},useState:function(r){r=Nh(r);var i=r.queue,u=Mx.bind(null,we,i);return i.dispatch=u,[r.memoizedState,u]},useDebugValue:Ch,useDeferredValue:function(r,i){var u=Jt();return Dh(u,r,i)},useTransition:function(){var r=Nh(!1);return r=_x.bind(null,we,r.queue,!0,!1),Jt().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,u){var s=we,m=Jt();if(Me){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),Ve===null)throw Error(a(349));(Ne&127)!==0||ex(s,i,u)}m.memoizedState=u;var y={value:u,getSnapshot:i};return m.queue=y,px(nx.bind(null,s,y,r),[r]),s.flags|=2048,el(9,{destroy:void 0},tx.bind(null,s,y,u,i),null),u},useId:function(){var r=Jt(),i=Ve.identifierPrefix;if(Me){var u=ur,s=lr;u=(s&~(1<<32-yn(s)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Ss++,0<\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof s.is=="string"?w.createElement("select",{is:s.is}):w.createElement("select"),s.multiple?y.multiple=!0:s.size&&(y.size=s.size);break;default:y=typeof s.is=="string"?w.createElement(m,{is:s.is}):w.createElement(m)}}y[qt]=i,y[rn]=s;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=y;e:switch(Kt(y,m,s),m){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Mr(i)}}return Je(i),Fh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,u),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==s&&Mr(i);else{if(typeof s!="string"&&i.stateNode===null)throw Error(a(166));if(r=be.current,Yi(i)){if(r=i.stateNode,u=i.memoizedProps,s=null,m=Bt,m!==null)switch(m.tag){case 27:case 5:s=m.memoizedProps}r[qt]=i,r=!!(r.nodeValue===u||s!==null&&s.suppressHydrationWarning===!0||W1(r.nodeValue,u)),r||sa(i,!0)}else r=Vs(r).createTextNode(s),r[qt]=i,i.stateNode=r}return Je(i),null;case 31:if(u=i.memoizedState,r===null||r.memoizedState!==null){if(s=Yi(i),u!==null){if(r===null){if(!s)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[qt]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),r=!1}else u=ih(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return i.flags&256?(Sn(i),i):(Sn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Je(i),null;case 13:if(s=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Yi(i),s!==null&&s.dehydrated!==null){if(r===null){if(!m)throw Error(a(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[qt]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),m=!1}else m=ih(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(Sn(i),i):(Sn(i),null)}return Sn(i),(i.flags&128)!==0?(i.lanes=u,i):(u=s!==null,r=r!==null&&r.memoizedState!==null,u&&(s=i.child,m=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(m=s.alternate.memoizedState.cachePool.pool),y=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==m&&(s.flags|=2048)),u!==r&&u&&(i.child.flags|=8192),Ds(i,i.updateQueue),Je(i),null);case 4:return Q(),r===null&&ym(i.stateNode.containerInfo),Je(i),null;case 10:return Ar(i.type),Je(i),null;case 19:if(F(dt),s=i.memoizedState,s===null)return Je(i),null;if(m=(i.flags&128)!==0,y=s.rendering,y===null)if(m)bu(s,!1);else{if(st!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=bs(r),y!==null){for(i.flags|=128,bu(s,!1),r=y.updateQueue,i.updateQueue=r,Ds(i,r),i.subtreeFlags=0,r=u,u=i.child;u!==null;)Mb(u,r),u=u.sibling;return ie(dt,dt.current&1|2),Me&&Or(i,s.treeForkCount),i.child}r=r.sibling}s.tail!==null&&vn()>Ls&&(i.flags|=128,m=!0,bu(s,!1),i.lanes=4194304)}else{if(!m)if(r=bs(y),r!==null){if(i.flags|=128,m=!0,r=r.updateQueue,i.updateQueue=r,Ds(i,r),bu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!y.alternate&&!Me)return Je(i),null}else 2*vn()-s.renderingStartTime>Ls&&u!==536870912&&(i.flags|=128,m=!0,bu(s,!1),i.lanes=4194304);s.isBackwards?(y.sibling=i.child,i.child=y):(r=s.last,r!==null?r.sibling=y:i.child=y,s.last=y)}return s.tail!==null?(r=s.tail,s.rendering=r,s.tail=r.sibling,s.renderingStartTime=vn(),r.sibling=null,u=dt.current,ie(dt,m?u&1|2:u&1),Me&&Or(i,s.treeForkCount),r):(Je(i),null);case 22:case 23:return Sn(i),gh(),s=i.memoizedState!==null,r!==null?r.memoizedState!==null!==s&&(i.flags|=8192):s&&(i.flags|=8192),s?(u&536870912)!==0&&(i.flags&128)===0&&(Je(i),i.subtreeFlags&6&&(i.flags|=8192)):Je(i),u=i.updateQueue,u!==null&&Ds(i,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==u&&(i.flags|=2048),r!==null&&F(Ja),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ar(vt),Je(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function _C(r,i){switch(rh(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ar(vt),Q(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return _e(i),null;case 31:if(i.memoizedState!==null){if(Sn(i),i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Sn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return F(dt),null;case 4:return Q(),null;case 10:return Ar(i.type),null;case 22:case 23:return Sn(i),gh(),r!==null&&F(Ja),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ar(vt),null;case 25:return null;default:return null}}function r1(r,i){switch(rh(i),i.tag){case 3:Ar(vt),Q();break;case 26:case 27:case 5:_e(i);break;case 4:Q();break;case 31:i.memoizedState!==null&&Sn(i);break;case 13:Sn(i);break;case 19:F(dt);break;case 10:Ar(i.type);break;case 22:case 23:Sn(i),gh(),r!==null&&F(Ja);break;case 24:Ar(vt)}}function xu(r,i){try{var u=i.updateQueue,s=u!==null?u.lastEffect:null;if(s!==null){var m=s.next;u=m;do{if((u.tag&r)===r){s=void 0;var y=u.create,w=u.inst;s=y(),w.destroy=s}u=u.next}while(u!==m)}}catch(A){qe(i,i.return,A)}}function pa(r,i,u){try{var s=i.updateQueue,m=s!==null?s.lastEffect:null;if(m!==null){var y=m.next;s=y;do{if((s.tag&r)===r){var w=s.inst,A=w.destroy;if(A!==void 0){w.destroy=void 0,m=i;var D=u,B=A;try{B()}catch(Z){qe(m,D,Z)}}}s=s.next}while(s!==y)}}catch(Z){qe(i,i.return,Z)}}function a1(r){var i=r.updateQueue;if(i!==null){var u=r.stateNode;try{Xb(i,u)}catch(s){qe(r,r.return,s)}}}function i1(r,i,u){u.props=ai(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(s){qe(r,i,s)}}function Su(r,i){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var s=r.stateNode;break;case 30:s=r.stateNode;break;default:s=r.stateNode}typeof u=="function"?r.refCleanup=u(s):u.current=s}}catch(m){qe(r,i,m)}}function or(r,i){var u=r.ref,s=r.refCleanup;if(u!==null)if(typeof s=="function")try{s()}catch(m){qe(r,i,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(m){qe(r,i,m)}else u.current=null}function l1(r){var i=r.type,u=r.memoizedProps,s=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&s.focus();break e;case"img":u.src?s.src=u.src:u.srcSet&&(s.srcset=u.srcSet)}}catch(m){qe(r,r.return,m)}}function Zh(r,i,u){try{var s=r.stateNode;VC(s,r.type,u,i),s[rn]=i}catch(m){qe(r,r.return,m)}}function u1(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ja(r.type)||r.tag===4}function Qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||u1(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ja(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Wh(r,i,u){var s=r.tag;if(s===5||s===6)r=r.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(r),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Sr));else if(s!==4&&(s===27&&ja(r.type)&&(u=r.stateNode,i=null),r=r.child,r!==null))for(Wh(r,i,u),r=r.sibling;r!==null;)Wh(r,i,u),r=r.sibling}function ks(r,i,u){var s=r.tag;if(s===5||s===6)r=r.stateNode,i?u.insertBefore(r,i):u.appendChild(r);else if(s!==4&&(s===27&&ja(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(ks(r,i,u),r=r.sibling;r!==null;)ks(r,i,u),r=r.sibling}function o1(r){var i=r.stateNode,u=r.memoizedProps;try{for(var s=r.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);Kt(i,s,u),i[qt]=r,i[rn]=u}catch(y){qe(r,r.return,y)}}var Cr=!1,gt=!1,Jh=!1,s1=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function AC(r,i){if(r=r.containerInfo,xm=ec,r=Sb(r),Gd(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var s=u.getSelection&&u.getSelection();if(s&&s.rangeCount!==0){u=s.anchorNode;var m=s.anchorOffset,y=s.focusNode;s=s.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var w=0,A=-1,D=-1,B=0,Z=0,te=r,Y=null;t:for(;;){for(var X;te!==u||m!==0&&te.nodeType!==3||(A=w+m),te!==y||s!==0&&te.nodeType!==3||(D=w+s),te.nodeType===3&&(w+=te.nodeValue.length),(X=te.firstChild)!==null;)Y=te,te=X;for(;;){if(te===r)break t;if(Y===u&&++B===m&&(A=w),Y===y&&++Z===s&&(D=w),(X=te.nextSibling)!==null)break;te=Y,Y=te.parentNode}te=X}u=A===-1||D===-1?null:{start:A,end:D}}else u=null}u=u||{start:0,end:0}}else u=null;for(Sm={focusedElem:r,selectionRange:u},ec=!1,Ct=i;Ct!==null;)if(i=Ct,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Ct=r;else for(;Ct!==null;){switch(i=Ct,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u title"))),Kt(y,s,u),y[qt]=r,Mt(y),s=y;break e;case"link":var w=vS("link","href",m).get(s+(u.href||""));if(w){for(var A=0;AKe&&(w=Ke,Ke=ge,ge=w);var U=bb(A,ge),R=bb(A,Ke);if(U&&R&&(X.rangeCount!==1||X.anchorNode!==U.node||X.anchorOffset!==U.offset||X.focusNode!==R.node||X.focusOffset!==R.offset)){var q=te.createRange();q.setStart(U.node,U.offset),X.removeAllRanges(),ge>Ke?(X.addRange(q),X.extend(R.node,R.offset)):(q.setEnd(R.node,R.offset),X.addRange(q))}}}}for(te=[],X=A;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;Au?32:u,I.T=null,u=lm,lm=null;var y=xa,w=Rr;if(jt=0,il=xa=null,Rr=0,(ze&6)!==0)throw Error(a(331));var A=ze;if(ze|=4,x1(y.current),y1(y,y.current,w,u),ze=A,Eu(0,!1),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(Yl,y)}catch{}return!0}finally{ee.p=m,I.T=s,U1(r,i)}}function q1(r,i,u){i=Pn(u,i),i=$h(r.stateNode,i,2),r=ha(r,i,2),r!==null&&(Vl(r,2),sr(r))}function qe(r,i,u){if(r.tag===3)q1(r,r,u);else for(;i!==null;){if(i.tag===3){q1(i,r,u);break}else if(i.tag===1){var s=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ba===null||!ba.has(s))){r=Pn(u,r),u=Bx(2),s=ha(i,u,2),s!==null&&(Ix(u,s,i,r),Vl(s,2),sr(s));break}}i=i.return}}function cm(r,i,u){var s=r.pingCache;if(s===null){s=r.pingCache=new TC;var m=new Set;s.set(i,m)}else m=s.get(i),m===void 0&&(m=new Set,s.set(i,m));m.has(u)||(nm=!0,m.add(u),r=PC.bind(null,r,i,u),i.then(r,r))}function PC(r,i,u){var s=r.pingCache;s!==null&&s.delete(i),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Ve===r&&(Ne&u)===u&&(st===4||st===3&&(Ne&62914560)===Ne&&300>vn()-Rs?(ze&2)===0&&ll(r,0):rm|=u,al===Ne&&(al=0)),sr(r)}function B1(r,i){i===0&&(i=zg()),r=Xa(r,i),r!==null&&(Vl(r,i),sr(r))}function zC(r){var i=r.memoizedState,u=0;i!==null&&(u=i.retryLane),B1(r,u)}function RC(r,i){var u=0;switch(r.tag){case 31:case 13:var s=r.stateNode,m=r.memoizedState;m!==null&&(u=m.retryLane);break;case 19:s=r.stateNode;break;case 22:s=r.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(i),B1(r,u)}function LC(r,i){return jd(r,i)}var Hs=null,ol=null,fm=!1,Ks=!1,dm=!1,wa=0;function sr(r){r!==ol&&r.next===null&&(ol===null?Hs=ol=r:ol=ol.next=r),Ks=!0,fm||(fm=!0,$C())}function Eu(r,i){if(!dm&&Ks){dm=!0;do for(var u=!1,s=Hs;s!==null;){if(r!==0){var m=s.pendingLanes;if(m===0)var y=0;else{var w=s.suspendedLanes,A=s.pingedLanes;y=(1<<31-yn(42|r)+1)-1,y&=m&~(w&~A),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,Y1(s,y))}else y=Ne,y=Xo(s,s===Ve?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(y&3)===0||Gl(s,y)||(u=!0,Y1(s,y));s=s.next}while(u);dm=!1}}function UC(){I1()}function I1(){Ks=fm=!1;var r=0;wa!==0&&FC()&&(r=wa);for(var i=vn(),u=null,s=Hs;s!==null;){var m=s.next,y=H1(s,i);y===0?(s.next=null,u===null?Hs=m:u.next=m,m===null&&(ol=u)):(u=s,(r!==0||(y&3)!==0)&&(Ks=!0)),s=m}jt!==0&&jt!==5||Eu(r),wa!==0&&(wa=0)}function H1(r,i){for(var u=r.suspendedLanes,s=r.pingedLanes,m=r.expirationTimes,y=r.pendingLanes&-62914561;0A)break;var Z=D.transferSize,te=D.initiatorType;Z&&J1(te)&&(D=D.responseEnd,w+=Z*(D"u"?null:document;function fS(r,i,u){var s=sl;if(s&&typeof i=="string"&&i){var m=Dn(i);m='link[rel="'+r+'"][href="'+m+'"]',typeof u=="string"&&(m+='[crossorigin="'+u+'"]'),cS.has(m)||(cS.add(m),r={rel:r,crossOrigin:u,href:i},s.querySelector(m)===null&&(i=s.createElement("link"),Kt(i,"link",r),Mt(i),s.head.appendChild(i)))}}function a4(r){Lr.D(r),fS("dns-prefetch",r,null)}function i4(r,i){Lr.C(r,i),fS("preconnect",r,i)}function l4(r,i,u){Lr.L(r,i,u);var s=sl;if(s&&r&&i){var m='link[rel="preload"][as="'+Dn(i)+'"]';i==="image"&&u&&u.imageSrcSet?(m+='[imagesrcset="'+Dn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(m+='[imagesizes="'+Dn(u.imageSizes)+'"]')):m+='[href="'+Dn(r)+'"]';var y=m;switch(i){case"style":y=cl(r);break;case"script":y=fl(r)}qn.has(y)||(r=p({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:r,as:i},u),qn.set(y,r),s.querySelector(m)!==null||i==="style"&&s.querySelector(Cu(y))||i==="script"&&s.querySelector(Du(y))||(i=s.createElement("link"),Kt(i,"link",r),Mt(i),s.head.appendChild(i)))}}function u4(r,i){Lr.m(r,i);var u=sl;if(u&&r){var s=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+Dn(s)+'"][href="'+Dn(r)+'"]',y=m;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=fl(r)}if(!qn.has(y)&&(r=p({rel:"modulepreload",href:r},i),qn.set(y,r),u.querySelector(m)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Du(y)))return}s=u.createElement("link"),Kt(s,"link",r),Mt(s),u.head.appendChild(s)}}}function o4(r,i,u){Lr.S(r,i,u);var s=sl;if(s&&r){var m=Di(s).hoistableStyles,y=cl(r);i=i||"default";var w=m.get(y);if(!w){var A={loading:0,preload:null};if(w=s.querySelector(Cu(y)))A.loading=5;else{r=p({rel:"stylesheet",href:r,"data-precedence":i},u),(u=qn.get(y))&&Nm(r,u);var D=w=s.createElement("link");Mt(D),Kt(D,"link",r),D._p=new Promise(function(B,Z){D.onload=B,D.onerror=Z}),D.addEventListener("load",function(){A.loading|=1}),D.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Fs(w,i,s)}w={type:"stylesheet",instance:w,count:1,state:A},m.set(y,w)}}}function s4(r,i){Lr.X(r,i);var u=sl;if(u&&r){var s=Di(u).hoistableScripts,m=fl(r),y=s.get(m);y||(y=u.querySelector(Du(m)),y||(r=p({src:r,async:!0},i),(i=qn.get(m))&&Tm(r,i),y=u.createElement("script"),Mt(y),Kt(y,"link",r),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(m,y))}}function c4(r,i){Lr.M(r,i);var u=sl;if(u&&r){var s=Di(u).hoistableScripts,m=fl(r),y=s.get(m);y||(y=u.querySelector(Du(m)),y||(r=p({src:r,async:!0,type:"module"},i),(i=qn.get(m))&&Tm(r,i),y=u.createElement("script"),Mt(y),Kt(y,"link",r),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(m,y))}}function dS(r,i,u,s){var m=(m=be.current)?Xs(m):null;if(!m)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=cl(u.href),u=Di(m).hoistableStyles,s=u.get(i),s||(s={type:"style",instance:null,count:0,state:null},u.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=cl(u.href);var y=Di(m).hoistableStyles,w=y.get(r);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,w),(y=m.querySelector(Cu(r)))&&!y._p&&(w.instance=y,w.state.loading=5),qn.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},qn.set(r,u),y||f4(m,r,u,w.state))),i&&s===null)throw Error(a(528,""));return w}if(i&&s!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fl(u),u=Di(m).hoistableScripts,s=u.get(i),s||(s={type:"script",instance:null,count:0,state:null},u.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function cl(r){return'href="'+Dn(r)+'"'}function Cu(r){return'link[rel="stylesheet"]['+r+"]"}function hS(r){return p({},r,{"data-precedence":r.precedence,precedence:null})}function f4(r,i,u,s){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?s.loading=1:(i=r.createElement("link"),s.preload=i,i.addEventListener("load",function(){return s.loading|=1}),i.addEventListener("error",function(){return s.loading|=2}),Kt(i,"link",u),Mt(i),r.head.appendChild(i))}function fl(r){return'[src="'+Dn(r)+'"]'}function Du(r){return"script[async]"+r}function mS(r,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var s=r.querySelector('style[data-href~="'+Dn(u.href)+'"]');if(s)return i.instance=s,Mt(s),s;var m=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return s=(r.ownerDocument||r).createElement("style"),Mt(s),Kt(s,"style",m),Fs(s,u.precedence,r),i.instance=s;case"stylesheet":m=cl(u.href);var y=r.querySelector(Cu(m));if(y)return i.state.loading|=4,i.instance=y,Mt(y),y;s=hS(u),(m=qn.get(m))&&Nm(s,m),y=(r.ownerDocument||r).createElement("link"),Mt(y);var w=y;return w._p=new Promise(function(A,D){w.onload=A,w.onerror=D}),Kt(y,"link",s),i.state.loading|=4,Fs(y,u.precedence,r),i.instance=y;case"script":return y=fl(u.src),(m=r.querySelector(Du(y)))?(i.instance=m,Mt(m),m):(s=u,(m=qn.get(y))&&(s=p({},u),Tm(s,m)),r=r.ownerDocument||r,m=r.createElement("script"),Mt(m),Kt(m,"link",s),r.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(s=i.instance,i.state.loading|=4,Fs(s,u.precedence,r));return i.instance}function Fs(r,i,u){for(var s=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=s.length?s[s.length-1]:null,y=m,w=0;w title"):null)}function d4(r,i,u){if(u===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function yS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function h4(r,i,u,s){if(u.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var m=cl(s.href),y=i.querySelector(Cu(m));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Qs.bind(r),i.then(r,r)),u.state.loading|=4,u.instance=y,Mt(y);return}y=i.ownerDocument||i,s=hS(s),(m=qn.get(m))&&Nm(s,m),y=y.createElement("link"),Mt(y);var w=y;w._p=new Promise(function(A,D){w.onload=A,w.onerror=D}),Kt(y,"link",s),u.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=Qs.bind(r),i.addEventListener("load",u),i.addEventListener("error",u))}}var Mm=0;function m4(r,i){return r.stylesheets&&r.count===0&&Js(r,r.stylesheets),0Mm?50:800)+i);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(s),clearTimeout(m)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Js(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Ws=null;function Js(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Ws=new Map,i.forEach(v4,r),Ws=null,Qs.call(r))}function v4(r,i){if(!(i.state.loading&4)){var u=Ws.get(r);if(u)var s=u.get(null);else{u=new Map,Ws.set(r,u);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$m.exports=k4(),$m.exports}var z4=P4();const R4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),L4=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),BS=e=>{const t=L4(e);return t.charAt(0).toUpperCase()+t.slice(1)},G_=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),U4=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var $4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const q4=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},d)=>S.createElement("svg",{ref:d,...$4,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:G_("lucide",l),...!o&&!U4(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,v])=>S.createElement(h,v)),...Array.isArray(o)?o:[o]]));const je=(e,t)=>{const n=S.forwardRef(({className:a,...l},o)=>S.createElement(q4,{ref:o,iconNode:t,className:G_(`lucide-${R4(BS(e))}`,`lucide-${e}`,a),...l}));return n.displayName=BS(e),n};const B4=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],V_=je("activity",B4);const I4=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Hm=je("arrow-down-to-line",I4);const H4=[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]],Km=je("arrow-up-from-line",H4);const K4=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Y4=je("bell",K4);const G4=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],IS=je("calendar",G4);const V4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],X4=je("check",V4);const F4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kc=je("chevron-down",F4);const Z4=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Q4=je("chevron-left",Z4);const W4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],J4=je("chevron-right",W4);const eD=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ep=je("chevron-up",eD);const tD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Tf=je("circle-alert",tD);const nD=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],wl=je("circle-check-big",nD);const rD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],aD=je("circle-check",rD);const iD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],lD=je("circle-dollar-sign",iD);const uD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pa=je("circle-x",uD);const oD=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],T0=je("clock",oD);const sD=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],cD=je("coins",sD);const fD=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],dD=je("cpu",fD);const hD=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],M0=je("gauge",hD);const mD=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],X_=je("key-round",mD);const vD=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],pD=je("layers",vD);const yD=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],gD=je("layout-dashboard",yD);const bD=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],C0=je("lock-keyhole",bD);const xD=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],SD=je("log-out",xD);const wD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jD=je("plus",wD);const OD=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],_D=je("power",OD);const AD=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],ED=je("receipt-text",AD);const ND=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Pl=je("refresh-cw",ND);const TD=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],D0=je("rotate-ccw",TD);const MD=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],CD=je("save",MD);const DD=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],kD=je("server-cog",DD);const PD=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],zD=je("server",PD);const RD=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],LD=je("settings",RD);const UD=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],F_=je("settings-2",UD);const $D=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Z_=je("shield-check",$D);const qD=[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]],BD=je("thermometer",qD);const ID=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],HD=je("trash-2",ID);const KD=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Np=je("triangle-alert",KD);const YD=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],HS=je("wifi-off",YD);const GD=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],VD=je("wifi",GD);const XD=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Q_=je("x",XD);const FD=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ZD=je("zap",FD);function Da(e,t=5e3){const[n,a]=S.useState(null),[l,o]=S.useState(null),[c,f]=S.useState(!0),[d,h]=S.useState(!1),[v,p]=S.useState(null),b=S.useCallback(async()=>{h(!0);try{const x=await e();a(x),o(null),p(new Date)}catch(x){o(x instanceof Error?x:new Error(String(x)))}finally{f(!1),h(!1)}},[e]);return S.useEffect(()=>{if(b(),t<=0)return;const x=setInterval(b,t);return()=>clearInterval(x)},[b,t]),{data:n,error:l,loading:c,refreshing:d,lastUpdated:v,refetch:b}}const k0="/api/v1/computing/inference",_c="computing-provider-control-token";let fi=sessionStorage.getItem(_c)??"";function hl(e){return encodeURIComponent(e)}class P0 extends Error{status;constructor(t,n){super(n),this.name="ApiError",this.status=t}}function z0(){return fi?{Authorization:`Bearer ${fi}`}:{}}async function cr(e){const t=await fetch(`${k0}${e}`,{headers:z0()});if(!t.ok){const n=await t.json().catch(()=>null);throw new P0(t.status,n?.error??`API error: ${t.status} ${t.statusText}`)}return t.json()}async function Ta(e,t){const n=await fetch(`${k0}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...z0()},body:t?JSON.stringify(t):void 0});if(!n.ok){const a=await n.json().catch(()=>null);throw new P0(n.status,a?.error??`API error: ${n.status} ${n.statusText}`)}return n.json()}async function $u(e,t){const n=await fetch(`${k0}${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...z0()},body:JSON.stringify(t)});if(!n.ok){const a=await n.json().catch(()=>null);throw new P0(n.status,a?.error??`API error: ${n.status} ${n.statusText}`)}return n.json()}const Ze={setAccessToken:e=>{fi=e.trim(),fi?sessionStorage.setItem(_c,fi):sessionStorage.removeItem(_c)},hasAccessToken:()=>!!fi,clearAccessToken:()=>{fi="",sessionStorage.removeItem(_c)},getMetrics:()=>cr("/metrics"),getStatus:()=>cr("/status"),getModels:()=>cr("/models"),enableModel:e=>Ta(`/models/${hl(e)}/enable`),disableModel:e=>Ta(`/models/${hl(e)}/disable`),reloadModels:()=>Ta("/models/reload"),forceHealthCheck:e=>Ta(`/models/${hl(e)}/healthcheck`),getRequestManagement:()=>cr("/request-management"),setGlobalRateLimit:e=>Ta("/ratelimit/global",{rate:e}),setModelRateLimit:(e,t)=>Ta(`/ratelimit/model/${hl(e)}`,{rate:t}),setGlobalConcurrency:e=>Ta("/concurrency/global",{max:e}),setModelConcurrency:(e,t)=>Ta(`/concurrency/model/${hl(e)}`,{max:t}),getRequestHistory:(e={})=>{const t=new URLSearchParams;e.limit&&t.set("limit",e.limit.toString()),e.offset&&t.set("offset",e.offset.toString()),e.model&&t.set("model",e.model),e.source&&t.set("source",e.source);const n=t.toString();return cr(`/requests${n?`?${n}`:""}`)},getEarnings:()=>cr("/earnings"),getEarningsHistory:e=>cr(`/earnings/history?duration=${e}`),getMetricsHistory:(e,t)=>{const n=new URLSearchParams;e&&n.set("duration",e),t&&n.set("resolution",t);const a=n.toString();return cr(`/metrics/history${a?`?${a}`:""}`)},getModelMetrics:e=>cr(`/models/${hl(e)}/metrics`),getSettings:()=>cr("/settings"),updateAlerts:e=>$u("/settings/alerts",e),updateSelfCheck:e=>$u("/settings/self-check",e),updateLogging:e=>$u("/settings/logging",e),updateLimits:e=>$u("/settings/limits",e),updateModels:e=>$u("/settings/models",{models:e})},W_=["#3987e5","#c98500","#d55181","#008300"],R0="#94a3b8",J_="Other",Tp="#5b6b82",eA="Unattributed",QD=W_.length;function tA(e){const t=[...e??[]].sort((o,c)=>c.total_usd!==o.total_usd?c.total_usd-o.total_usd:o.model.localeCompare(c.model)),n=new Map,a=[],l=new Set;return t.forEach((o,c)=>{c=86400?a.toLocaleDateString(void 0,{year:n?"numeric":void 0,month:"short",day:"numeric"}):n?a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function oc(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function ui(e){return e===0?"$0":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function KS(e,t){const n=[];let a=0,l=0,o=0;for(const[f,d]of Object.entries(e.models??{}))t.colours.has(f)?n.push({key:f,label:f,colour:Pc(t,f),usd:d.usd,tokensIn:d.tokens_in,tokensOut:d.tokens_out}):(a+=d.usd,l+=d.tokens_in,o+=d.tokens_out);n.sort((f,d)=>d.usd-f.usd),(a>0||l>0||o>0)&&n.push({key:"__other",label:J_,colour:R0,usd:a,tokensIn:l,tokensOut:o});const c=e.unattributed??0;return c>1e-6&&n.push({key:"__unattributed",label:eA,colour:Tp,usd:c,tokensIn:0,tokensOut:0}),n}function JD({models:e}){const[t,n]=S.useState("24h"),[a,l]=S.useState(null),{data:o,loading:c,error:f}=Da(S.useCallback(()=>Ze.getEarningsHistory(t),[t]),6e4),d=S.useMemo(()=>tA(e),[e]),h=S.useMemo(()=>o?.points??[],[o?.points]),v=o?.bucket_seconds,p=h.reduce((_,E)=>Math.max(_,E.usd),0),b=a??(h.length>0?h.length-1:null),x=b!==null?h[b]:null,O=x?KS(x,d):[],j=S.useMemo(()=>{const _=new Set;let E=!1,N=!1;for(const C of h){for(const k of Object.keys(C.models??{}))d.colours.has(k)?_.add(k):E=!0;(C.unattributed??0)>1e-6&&(N=!0)}const T=d.ordered.filter(C=>_.has(C)).map(C=>({key:C,label:C,colour:Pc(d,C)}));return E&&T.push({key:"__other",label:J_,colour:R0}),N&&T.push({key:"__unattributed",label:eA,colour:Tp}),T},[h,d]);return g.jsxs("div",{className:"min-w-0 overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 px-4 py-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Earnings over time"}),g.jsx("p",{className:"text-xs text-slate-400",children:c&&!o?"Loading…":f&&o?`${ui(o.total_usd)} · showing stale data`:`${ui(o?.total_usd??0)} in this window`})]}),g.jsx("div",{className:"flex gap-1",role:"group","aria-label":"Time window",children:WD.map(_=>g.jsx("button",{type:"button",onClick:()=>n(_.id),"aria-pressed":t===_.id,className:`rounded-lg px-3 py-1.5 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${t===_.id?"bg-slate-700 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:_.label},_.id))})]}),f&&!o?g.jsxs("p",{className:"px-4 py-6 text-sm text-amber-300",children:["Could not load earnings history: ",f.message]}):h.length===0?g.jsx("p",{className:"px-4 py-6 text-sm text-slate-400",children:"No history for this window yet."}):g.jsxs("div",{className:"px-4 py-4",children:[g.jsx("div",{className:"mb-2 h-36","aria-live":"polite",children:x?g.jsxs("div",{className:"text-xs",children:[g.jsxs("div",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-mono text-sm text-white",children:ui(x.usd)}),g.jsx("span",{className:"text-slate-400",children:uc(x.timestamp,v,!0)}),a===null&&g.jsx("span",{className:"ml-auto text-slate-400",children:"Latest interval"})]}),O.length>0?g.jsx("ul",{className:"mt-1 space-y-0.5",children:O.map(_=>g.jsxs("li",{className:"flex items-center gap-2",children:[g.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:_.colour}}),g.jsx("span",{className:"min-w-0 flex-1 truncate text-slate-300",children:_.label}),g.jsx("span",{className:"font-mono text-slate-400",children:ui(_.usd)}),_.key!=="__unattributed"&&g.jsxs("span",{className:"w-28 shrink-0 text-right font-mono text-slate-400",children:[oc(_.tokensIn)," in / ",oc(_.tokensOut)," out"]})]},_.key))}):g.jsxs("div",{className:"mt-1 text-slate-400",children:[oc(x.tokens_in)," in / ",oc(x.tokens_out)," out",g.jsx("span",{className:"ml-2 text-slate-400",children:"— recorded before the per-model split"})]})]}):g.jsxs("div",{className:"text-xs text-slate-400",children:["Hover a bar for its models and usage. ",h.length," intervals shown."]})}),g.jsx("div",{className:"flex h-32 items-end gap-px",onMouseLeave:()=>l(null),role:"group","aria-label":`Earnings per interval over ${t}, split by model, totalling ${ui(o?.total_usd??0)}`,children:h.map((_,E)=>{const N=p>0?Math.max(2,_.usd/p*100):2,T=b===E,C=KS(_,d),k=C.length?C.map(M=>`${M.label} ${ui(M.usd)}`).join(", "):`${_.tokens_in.toLocaleString()} in, ${_.tokens_out.toLocaleString()} out`;return g.jsx("button",{type:"button",onMouseEnter:()=>l(E),onFocus:()=>l(E),onBlur:()=>l(null),"aria-label":`${uc(_.timestamp,v,!0)}: ${ui(_.usd)} — ${k}`,className:`flex h-full flex-1 flex-col justify-end rounded-t focus:outline-none focus:ring-1 focus:ring-blue-400 ${T?"ring-1 ring-white/40":""}`,style:{height:`${N}%`},children:C.length===0?g.jsx("span",{className:"block h-full w-full rounded-t",style:{backgroundColor:Tp}}):C.map((M,L)=>{const W=_.usd>0?M.usd/_.usd*100:0;return g.jsx("span",{className:L===0?"block w-full rounded-t":"block w-full",style:{height:`${W}%`,backgroundColor:M.colour,marginTop:L===0?0:2,opacity:T?1:.85}},M.key)})},_.timestamp)})}),g.jsxs("div",{className:"mt-2 flex justify-between text-xs text-slate-400",children:[g.jsx("span",{children:h[0]&&uc(h[0].timestamp,v,!0)}),g.jsx("span",{children:h[h.length-1]&&uc(h[h.length-1].timestamp,v,!0)})]}),j.length>0&&g.jsx("ul",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs","aria-label":"Models in this chart",children:j.map(_=>g.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[g.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:_.colour}}),g.jsx("span",{className:"break-all text-slate-400",children:_.label})]},_.key))})]}),g.jsxs("p",{className:"flex items-start gap-2 border-t border-slate-800 px-4 py-3 text-xs text-slate-400",children:[g.jsx(Tf,{"aria-hidden":"true",size:14,className:"mt-px shrink-0"}),g.jsxs("span",{children:["This node’s own estimate, priced from its stored history at current rates — not the platform’s ledger.",(o?.restarts??0)>0&&` The counters reset ${o?.restarts} time(s) in this window, so the total is a floor.`,o?.covers&&` History reaches back ${o.covers}.`]})]})]})}function nA(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t{var{children:n,width:a,height:l,viewBox:o,className:c,style:f,title:d,desc:h}=e,v=ik(e,ak),p=o||{width:a,height:l,x:0,y:0},b=Re("recharts-surface",c);return S.createElement("svg",Mp({},tn(v),{className:b,width:a,height:l,style:f,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),S.createElement("title",null,d),S.createElement("desc",null,h),n)}),uk=["children","className"];function Cp(){return Cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:a}=e,l=ok(e,uk),o=Re("recharts-layer",a);return S.createElement("g",Cp({className:o},tn(l),{ref:t}),n)}),$0=Y_(),iA=S.createContext(null),ck=()=>S.useContext(iA);function Fe(e){return function(){return e}}const lA=Math.cos,zc=Math.sin,ar=Math.sqrt,Rc=Math.PI,Mf=2*Rc,Dp=Math.PI,kp=2*Dp,oi=1e-6,fk=kp-oi;function uA(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return uA;const n=10**t;return function(a){this._+=a[0];for(let l=1,o=a.length;loi)if(!(Math.abs(p*d-h*v)>oi)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=a-c,O=l-f,j=d*d+h*h,_=x*x+O*O,E=Math.sqrt(j),N=Math.sqrt(b),T=o*Math.tan((Dp-Math.acos((j+b-_)/(2*E*N)))/2),C=T/N,k=T/E;Math.abs(C-1)>oi&&this._append`L${t+C*v},${n+C*p}`,this._append`A${o},${o},0,0,${+(p*x>v*O)},${this._x1=t+k*d},${this._y1=n+k*h}`}}arc(t,n,a,l,o,c){if(t=+t,n=+n,a=+a,c=!!c,a<0)throw new Error(`negative radius: ${a}`);let f=a*Math.cos(l),d=a*Math.sin(l),h=t+f,v=n+d,p=1^c,b=c?l-o:o-l;this._x1===null?this._append`M${h},${v}`:(Math.abs(this._x1-h)>oi||Math.abs(this._y1-v)>oi)&&this._append`L${h},${v}`,a&&(b<0&&(b=b%kp+kp),b>fk?this._append`A${a},${a},0,1,${p},${t-f},${n-d}A${a},${a},0,1,${p},${this._x1=h},${this._y1=v}`:b>oi&&this._append`A${a},${a},0,${+(b>=Dp)},${p},${this._x1=t+a*Math.cos(o)},${this._y1=n+a*Math.sin(o)}`)}rect(t,n,a,l){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${a=+a}v${+l}h${-a}Z`}toString(){return this._}}function q0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const a=Math.floor(n);if(!(a>=0))throw new RangeError(`invalid digits: ${n}`);t=a}return e},()=>new hk(t)}function B0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oA(e){this._context=e}oA.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 Cf(e){return new oA(e)}function sA(e){return e[0]}function cA(e){return e[1]}function fA(e,t){var n=Fe(!0),a=null,l=Cf,o=null,c=q0(f);e=typeof e=="function"?e:e===void 0?sA:Fe(e),t=typeof t=="function"?t:t===void 0?cA:Fe(t);function f(d){var h,v=(d=B0(d)).length,p,b=!1,x;for(a==null&&(o=l(x=c())),h=0;h<=v;++h)!(h=x;--O)f.point(T[O],C[O]);f.lineEnd(),f.areaEnd()}E&&(T[b]=+e(_,b,p),C[b]=+t(_,b,p),f.point(a?+a(_,b,p):T[b],n?+n(_,b,p):C[b]))}if(N)return f=null,N+""||null}function v(){return fA().defined(l).curve(c).context(o)}return h.x=function(p){return arguments.length?(e=typeof p=="function"?p:Fe(+p),a=null,h):e},h.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Fe(+p),h):e},h.x1=function(p){return arguments.length?(a=p==null?null:typeof p=="function"?p:Fe(+p),h):a},h.y=function(p){return arguments.length?(t=typeof p=="function"?p:Fe(+p),n=null,h):t},h.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Fe(+p),h):t},h.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Fe(+p),h):n},h.lineX0=h.lineY0=function(){return v().x(e).y(t)},h.lineY1=function(){return v().x(e).y(n)},h.lineX1=function(){return v().x(a).y(t)},h.defined=function(p){return arguments.length?(l=typeof p=="function"?p:Fe(!!p),h):l},h.curve=function(p){return arguments.length?(c=p,o!=null&&(f=c(o)),h):c},h.context=function(p){return arguments.length?(p==null?o=f=null:f=c(o=p),h):o},h}class dA{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 mk(e){return new dA(e,!0)}function vk(e){return new dA(e,!1)}const I0={draw(e,t){const n=ar(t/Rc);e.moveTo(n,0),e.arc(0,0,n,0,Mf)}},pk={draw(e,t){const n=ar(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()}},hA=ar(1/3),yk=hA*2,gk={draw(e,t){const n=ar(t/yk),a=n*hA;e.moveTo(0,-n),e.lineTo(a,0),e.lineTo(0,n),e.lineTo(-a,0),e.closePath()}},bk={draw(e,t){const n=ar(t),a=-n/2;e.rect(a,a,n,n)}},xk=.8908130915292852,mA=zc(Rc/10)/zc(7*Rc/10),Sk=zc(Mf/10)*mA,wk=-lA(Mf/10)*mA,jk={draw(e,t){const n=ar(t*xk),a=Sk*n,l=wk*n;e.moveTo(0,-n),e.lineTo(a,l);for(let o=1;o<5;++o){const c=Mf*o/5,f=lA(c),d=zc(c);e.lineTo(d*n,-f*n),e.lineTo(f*a-d*l,d*a+f*l)}e.closePath()}},Ym=ar(3),Ok={draw(e,t){const n=-ar(t/(Ym*3));e.moveTo(0,n*2),e.lineTo(-Ym*n,-n),e.lineTo(Ym*n,-n),e.closePath()}},Bn=-.5,In=ar(3)/2,Pp=1/ar(12),_k=(Pp/2+1)*3,Ak={draw(e,t){const n=ar(t/_k),a=n/2,l=n*Pp,o=a,c=n*Pp+n,f=-o,d=c;e.moveTo(a,l),e.lineTo(o,c),e.lineTo(f,d),e.lineTo(Bn*a-In*l,In*a+Bn*l),e.lineTo(Bn*o-In*c,In*o+Bn*c),e.lineTo(Bn*f-In*d,In*f+Bn*d),e.lineTo(Bn*a+In*l,Bn*l-In*a),e.lineTo(Bn*o+In*c,Bn*c-In*o),e.lineTo(Bn*f+In*d,Bn*d-In*f),e.closePath()}};function Ek(e,t){let n=null,a=q0(l);e=typeof e=="function"?e:Fe(e||I0),t=typeof t=="function"?t:Fe(t===void 0?64:+t);function l(){let o;if(n||(n=o=a()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return l.type=function(o){return arguments.length?(e=typeof o=="function"?o:Fe(o),l):e},l.size=function(o){return arguments.length?(t=typeof o=="function"?o:Fe(+o),l):t},l.context=function(o){return arguments.length?(n=o??null,l):n},l}function Lc(){}function Uc(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 vA(e){this._context=e}vA.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:Uc(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:Uc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nk(e){return new vA(e)}function pA(e){this._context=e}pA.prototype={areaStart:Lc,areaEnd:Lc,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:Uc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tk(e){return new pA(e)}function yA(e){this._context=e}yA.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,a=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,a):this._context.moveTo(n,a);break;case 3:this._point=4;default:Uc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Mk(e){return new yA(e)}function gA(e){this._context=e}gA.prototype={areaStart:Lc,areaEnd:Lc,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 Ck(e){return new gA(e)}function YS(e){return e<0?-1:1}function GS(e,t,n){var a=e._x1-e._x0,l=t-e._x1,o=(e._y1-e._y0)/(a||l<0&&-0),c=(n-e._y1)/(l||a<0&&-0),f=(o*l+c*a)/(a+l);return(YS(o)+YS(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(f))||0}function VS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gm(e,t,n){var a=e._x0,l=e._y0,o=e._x1,c=e._y1,f=(o-a)/3;e._context.bezierCurveTo(a+f,l+f*t,o-f,c-f*n,o,c)}function $c(e){this._context=e}$c.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:Gm(this,this._t0,VS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Gm(this,VS(this,n=GS(this,e,t)),n);break;default:Gm(this,this._t0,n=GS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function bA(e){this._context=new xA(e)}(bA.prototype=Object.create($c.prototype)).point=function(e,t){$c.prototype.point.call(this,t,e)};function xA(e){this._context=e}xA.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,a,l,o){this._context.bezierCurveTo(t,e,a,n,o,l)}};function Dk(e){return new $c(e)}function kk(e){return new bA(e)}function SA(e){this._context=e}SA.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 a=XS(e),l=XS(t),o=0,c=1;c=0;--t)l[t]=(c[t]-l[t+1])/o[t];for(o[n-1]=(e[n]+l[n-1])/2,t=0;t=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 zk(e){return new Df(e,.5)}function Rk(e){return new Df(e,0)}function Lk(e){return new Df(e,1)}function bi(e,t){if((c=e.length)>1)for(var n=1,a,l,o=e[t[0]],c,f=o.length;n=0;)n[t]=t;return n}function Uk(e,t){return e[t]}function $k(e){const t=[];return t.key=e,t}function qk(){var e=Fe([]),t=zp,n=bi,a=Uk;function l(o){var c=Array.from(e.apply(this,arguments),$k),f,d=c.length,h=-1,v;for(const p of o)for(f=0,++h;f0){for(var n,a,l=0,o=e[0].length,c;l0){for(var n=0,a=e[t[0]],l,o=a.length;n0)||!((o=(l=e[t[0]]).length)>0))){for(var n=0,a=1,l,o,c;a1&&arguments[1]!==void 0?arguments[1]:Xk,n=10**t,a=Math.round(e*n)/n;return Object.is(a,-0)?0:a}function ct(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a{var f=n[c-1];return typeof f=="string"?l+f+o:f!==void 0?l+za(f)+o:l+o},"")}var Wt=e=>e===0?0:e>0?1:-1,vr=e=>typeof e=="number"&&e!=+e,Yr=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,me=e=>(typeof e=="number"||e instanceof Number)&&!vr(e),pr=e=>me(e)||typeof e=="string",Fk=0,uo=e=>{var t=++Fk;return"".concat(e||"").concat(t)},Nn=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!me(t)&&typeof t!="string")return a;var o;if(Yr(t)){if(n==null)return a;var c=t.indexOf("%");o=n*parseFloat(t.slice(0,c))/100}else o=+t;return vr(o)&&(o=a),l&&n!=null&&o>n&&(o=n),o},jA=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},a=0;aa&&(typeof t=="function"?t(a):xi(a,t))===n)}var _t=e=>e===null||typeof e>"u",Oo=e=>_t(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Zk(e){return e!=null}function _o(){}var Qk=["type","size","sizeType"];function Rp(){return Rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(Oo(e));return _A[t]||I0},iP=(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 a=18*rP;return 1.25*e*e*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**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}},lP=(e,t)=>{_A["symbol".concat(Oo(e))]=t},G0=e=>{var{type:t="circle",size:n=64,sizeType:a="area"}=e,l=tP(e,Qk),o=rw(rw({},l),{},{type:t,size:n,sizeType:a}),c="circle";typeof t=="string"&&(c=t);var f=()=>{var b=aP(c),x=Ek().type(b).size(iP(n,a,c)),O=x();if(O!==null)return O},{className:d,cx:h,cy:v}=o,p=tn(o);return me(h)&&me(v)&&me(n)?S.createElement("path",Rp({},p,{className:Re("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(v,")"),d:f()})):null};G0.registerSymbol=lP;var AA=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,V0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(S.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var a={};return Object.keys(n).forEach(l=>{L0(l)&&(a[l]=(o=>n[l](n,o)))}),a},uP=(e,t,n)=>a=>(e(t,n,a),null),X0=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var a=null;return Object.keys(e).forEach(l=>{var o=e[l];L0(l)&&typeof o=="function"&&(a||(a={}),a[l]=uP(o,t,n))}),a};function aw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function oP(e){for(var t=1;t(c[f]===void 0&&a[f]!==void 0&&(c[f]=a[f]),c),n);return o}function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t>>=0,r===0?32:31-(o3(r)/s3|0)|0}var Yo=256,Go=262144,Vo=4194304;function Ha(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Xo(r,i,u){var s=r.pendingLanes;if(s===0)return 0;var m=0,y=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var A=s&134217727;return A!==0?(s=A&~y,s!==0?m=Ha(s):(w&=A,w!==0?m=Ha(w):u||(u=A&~r,u!==0&&(m=Ha(u))))):(A=s&~y,A!==0?m=Ha(A):w!==0?m=Ha(w):u||(u=s&~r,u!==0&&(m=Ha(u)))),m===0?0:i!==0&&i!==m&&(i&y)===0&&(y=m&-m,u=i&-i,y>=u||y===32&&(u&4194048)!==0)?i:m}function Gl(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function f3(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zg(){var r=Vo;return Vo<<=1,(Vo&62914560)===0&&(Vo=4194304),r}function _d(r){for(var i=[],u=0;31>u;u++)i.push(r);return i}function Vl(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function d3(r,i,u,s,m,y){var w=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var A=r.entanglements,D=r.expirationTimes,I=r.hiddenUpdates;for(u=w&~u;0"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var g3=/[\n"\\]/g;function Dn(r){return r.replace(g3,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Cd(r,i,u,s,m,y,w,A){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Cn(i)):r.value!==""+Cn(i)&&(r.value=""+Cn(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?Dd(r,w,Cn(i)):u!=null?Dd(r,w,Cn(u)):s!=null&&r.removeAttribute("value"),m==null&&y!=null&&(r.defaultChecked=!!y),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.name=""+Cn(A):r.removeAttribute("name")}function Xg(r,i,u,s,m,y,w,A){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){Md(r);return}u=u!=null?""+Cn(u):"",i=i!=null?""+Cn(i):u,A||i===r.value||(r.value=i),r.defaultValue=i}s=s??m,s=typeof s!="function"&&typeof s!="symbol"&&!!s,r.checked=A?r.checked:!!s,r.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Md(r)}function Dd(r,i,u){i==="number"&&Qo(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function Pi(r,i,u,s){if(r=r.options,i){i={};for(var m=0;m"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ld=!1;if(wr)try{var Ql={};Object.defineProperty(Ql,"passive",{get:function(){Ld=!0}}),window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{Ld=!1}var la=null,$d=null,Jo=null;function tb(){if(Jo)return Jo;var r,i=$d,u=i.length,s,m="value"in la?la.value:la.textContent,y=m.length;for(r=0;r=eu),ub=" ",ob=!1;function sb(r,i){switch(r){case"keyup":return G3.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cb(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var $i=!1;function X3(r,i){switch(r){case"compositionend":return cb(i);case"keypress":return i.which!==32?null:(ob=!0,ub);case"textInput":return r=i.data,r===ub&&ob?null:r;default:return null}}function F3(r,i){if($i)return r==="compositionend"||!Hd&&sb(r,i)?(r=tb(),Jo=$d=la=null,$i=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:u,offset:i-r};r=s}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=gb(u)}}function xb(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?xb(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Sb(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Qo(r.document);i instanceof r.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)r=i.contentWindow;else break;i=Qo(r.document)}return i}function Gd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var rC=wr&&"documentMode"in document&&11>=document.documentMode,Ui=null,Vd=null,au=null,Xd=!1;function wb(r,i,u){var s=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Xd||Ui==null||Ui!==Qo(s)||(s=Ui,"selectionStart"in s&&Gd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),au&&ru(au,s)||(au=s,s=Gs(Vd,"onSelect"),0>=w,m-=w,lr=1<<32-yn(i)+m|u<Oe?(Te=fe,fe=null):Te=fe.sibling;var ke=Y($,fe,q[Oe],J);if(ke===null){fe===null&&(fe=Te);break}r&&fe&&ke.alternate===null&&i($,fe),R=y(ke,R,Oe),De===null?pe=ke:De.sibling=ke,De=ke,fe=Te}if(Oe===q.length)return u($,fe),Me&&Or($,Oe),pe;if(fe===null){for(;OeOe?(Te=fe,fe=null):Te=fe.sibling;var Na=Y($,fe,ke.value,J);if(Na===null){fe===null&&(fe=Te);break}r&&fe&&Na.alternate===null&&i($,fe),R=y(Na,R,Oe),De===null?pe=Na:De.sibling=Na,De=Na,fe=Te}if(ke.done)return u($,fe),Me&&Or($,Oe),pe;if(fe===null){for(;!ke.done;Oe++,ke=q.next())ke=te($,ke.value,J),ke!==null&&(R=y(ke,R,Oe),De===null?pe=ke:De.sibling=ke,De=ke);return Me&&Or($,Oe),pe}for(fe=s(fe);!ke.done;Oe++,ke=q.next())ke=X(fe,$,Oe,ke.value,J),ke!==null&&(r&&ke.alternate!==null&&fe.delete(ke.key===null?Oe:ke.key),R=y(ke,R,Oe),De===null?pe=ke:De.sibling=ke,De=ke);return r&&fe.forEach(function(j4){return i($,j4)}),Me&&Or($,Oe),pe}function Ke($,R,q,J){if(typeof q=="object"&&q!==null&&q.type===j&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case x:e:{for(var pe=q.key;R!==null;){if(R.key===pe){if(pe=q.type,pe===j){if(R.tag===7){u($,R.sibling),J=m(R,q.props.children),J.return=$,$=J;break e}}else if(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===Z&&ei(pe)===R.type){u($,R.sibling),J=m(R,q.props),cu(J,q),J.return=$,$=J;break e}u($,R);break}else i($,R);R=R.sibling}q.type===j?(J=Fa(q.props.children,$.mode,J,q.key),J.return=$,$=J):(J=ss(q.type,q.key,q.props,null,$.mode,J),cu(J,q),J.return=$,$=J)}return w($);case O:e:{for(pe=q.key;R!==null;){if(R.key===pe)if(R.tag===4&&R.stateNode.containerInfo===q.containerInfo&&R.stateNode.implementation===q.implementation){u($,R.sibling),J=m(R,q.children||[]),J.return=$,$=J;break e}else{u($,R);break}else i($,R);R=R.sibling}J=th(q,$.mode,J),J.return=$,$=J}return w($);case Z:return q=ei(q),Ke($,R,q,J)}if(ve(q))return se($,R,q,J);if(K(q)){if(pe=K(q),typeof pe!="function")throw Error(a(150));return q=pe.call(q),ge($,R,q,J)}if(typeof q.then=="function")return Ke($,R,ps(q),J);if(q.$$typeof===T)return Ke($,R,ds($,q),J);ys($,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,R!==null&&R.tag===6?(u($,R.sibling),J=m(R,q),J.return=$,$=J):(u($,R),J=eh(q,$.mode,J),J.return=$,$=J),w($)):u($,R)}return function($,R,q,J){try{su=0;var pe=Ke($,R,q,J);return Zi=null,pe}catch(fe){if(fe===Fi||fe===ms)throw fe;var De=bn(29,fe,null,$.mode);return De.lanes=J,De.return=$,De}}}var ni=Yb(!0),Gb=Yb(!1),fa=!1;function hh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mh(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function da(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ha(r,i,u){var s=r.updateQueue;if(s===null)return null;if(s=s.shared,(ze&2)!==0){var m=s.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),s.pending=i,i=os(r),Tb(r,null,u),i}return us(r,s,i,u),os(r)}function fu(r,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var s=i.lanes;s&=r.pendingLanes,u|=s,i.lanes=u,Lg(r,u)}}function vh(r,i){var u=r.updateQueue,s=r.alternate;if(s!==null&&(s=s.updateQueue,u===s)){var m=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?m=y=w:y=y.next=w,u=u.next}while(u!==null);y===null?m=y=i:y=y.next=i}else m=y=i;u={baseState:s.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:s.shared,callbacks:s.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=i:r.next=i,u.lastBaseUpdate=i}var ph=!1;function du(){if(ph){var r=Xi;if(r!==null)throw r}}function hu(r,i,u,s){ph=!1;var m=r.updateQueue;fa=!1;var y=m.firstBaseUpdate,w=m.lastBaseUpdate,A=m.shared.pending;if(A!==null){m.shared.pending=null;var D=A,I=D.next;D.next=null,w===null?y=I:w.next=I,w=D;var Q=r.alternate;Q!==null&&(Q=Q.updateQueue,A=Q.lastBaseUpdate,A!==w&&(A===null?Q.firstBaseUpdate=I:A.next=I,Q.lastBaseUpdate=D))}if(y!==null){var te=m.baseState;w=0,Q=I=D=null,A=y;do{var Y=A.lane&-536870913,X=Y!==A.lane;if(X?(Ne&Y)===Y:(s&Y)===Y){Y!==0&&Y===Vi&&(ph=!0),Q!==null&&(Q=Q.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var se=r,ge=A;Y=i;var Ke=u;switch(ge.tag){case 1:if(se=ge.payload,typeof se=="function"){te=se.call(Ke,te,Y);break e}te=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=ge.payload,Y=typeof se=="function"?se.call(Ke,te,Y):se,Y==null)break e;te=p({},te,Y);break e;case 2:fa=!0}}Y=A.callback,Y!==null&&(r.flags|=64,X&&(r.flags|=8192),X=m.callbacks,X===null?m.callbacks=[Y]:X.push(Y))}else X={lane:Y,tag:A.tag,payload:A.payload,callback:A.callback,next:null},Q===null?(I=Q=X,D=te):Q=Q.next=X,w|=Y;if(A=A.next,A===null){if(A=m.shared.pending,A===null)break;X=A,A=X.next,X.next=null,m.lastBaseUpdate=X,m.shared.pending=null}}while(!0);Q===null&&(D=te),m.baseState=D,m.firstBaseUpdate=I,m.lastBaseUpdate=Q,y===null&&(m.shared.lanes=0),ga|=w,r.lanes=w,r.memoizedState=te}}function Vb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Xb(r,i){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;ry?y:8;var w=H.T,A={};H.T=A,zh(r,!1,i,u);try{var D=m(),I=H.S;if(I!==null&&I(A,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Q=dC(D,s);pu(r,i,Q,On(r))}else pu(r,i,s,On(r))}catch(te){pu(r,i,{then:function(){},status:"rejected",reason:te},On())}finally{ee.p=y,w!==null&&A.types!==null&&(w.types=A.types),H.T=w}}function gC(){}function kh(r,i,u,s){if(r.tag!==5)throw Error(a(476));var m=Ax(r).queue;_x(r,m,i,z,u===null?gC:function(){return Ex(r),u(s)})}function Ax(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:z},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:u},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Ex(r){var i=Ax(r);i.next===null&&(i=r.alternate.memoizedState),pu(r,i.next.queue,{},On())}function Ph(){return It(ku)}function Nx(){return ht().memoizedState}function Tx(){return ht().memoizedState}function bC(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var u=On();r=da(u);var s=ha(i,r,u);s!==null&&(cn(s,i,u),fu(s,i,u)),i={cache:sh()},r.payload=i;return}i=i.return}}function xC(r,i,u){var s=On();u={lane:s,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Es(r)?Cx(i,u):(u=Wd(r,i,u,s),u!==null&&(cn(u,r,s),Dx(u,i,s)))}function Mx(r,i,u){var s=On();pu(r,i,u,s)}function pu(r,i,u,s){var m={lane:s,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Es(r))Cx(i,m);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var w=i.lastRenderedState,A=y(w,u);if(m.hasEagerState=!0,m.eagerState=A,gn(A,w))return us(r,i,m,0),Ve===null&&ls(),!1}catch{}if(u=Wd(r,i,m,s),u!==null)return cn(u,r,s),Dx(u,i,s),!0}return!1}function zh(r,i,u,s){if(s={lane:2,revertLane:hm(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Es(r)){if(i)throw Error(a(479))}else i=Wd(r,u,s,2),i!==null&&cn(i,r,2)}function Es(r){var i=r.alternate;return r===we||i!==null&&i===we}function Cx(r,i){Wi=xs=!0;var u=r.pending;u===null?i.next=i:(i.next=u.next,u.next=i),r.pending=i}function Dx(r,i,u){if((u&4194048)!==0){var s=i.lanes;s&=r.pendingLanes,u|=s,i.lanes=u,Lg(r,u)}}var yu={readContext:It,use:js,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};yu.useEffectEvent=ot;var kx={readContext:It,use:js,useCallback:function(r,i){return Jt().memoizedState=[r,i===void 0?null:i],r},useContext:It,useEffect:px,useImperativeHandle:function(r,i,u){u=u!=null?u.concat([r]):null,_s(4194308,4,xx.bind(null,i,r),u)},useLayoutEffect:function(r,i){return _s(4194308,4,r,i)},useInsertionEffect:function(r,i){_s(4,2,r,i)},useMemo:function(r,i){var u=Jt();i=i===void 0?null:i;var s=r();if(ri){aa(!0);try{r()}finally{aa(!1)}}return u.memoizedState=[s,i],s},useReducer:function(r,i,u){var s=Jt();if(u!==void 0){var m=u(i);if(ri){aa(!0);try{u(i)}finally{aa(!1)}}}else m=i;return s.memoizedState=s.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},s.queue=r,r=r.dispatch=xC.bind(null,we,r),[s.memoizedState,r]},useRef:function(r){var i=Jt();return r={current:r},i.memoizedState=r},useState:function(r){r=Nh(r);var i=r.queue,u=Mx.bind(null,we,i);return i.dispatch=u,[r.memoizedState,u]},useDebugValue:Ch,useDeferredValue:function(r,i){var u=Jt();return Dh(u,r,i)},useTransition:function(){var r=Nh(!1);return r=_x.bind(null,we,r.queue,!0,!1),Jt().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,u){var s=we,m=Jt();if(Me){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),Ve===null)throw Error(a(349));(Ne&127)!==0||ex(s,i,u)}m.memoizedState=u;var y={value:u,getSnapshot:i};return m.queue=y,px(nx.bind(null,s,y,r),[r]),s.flags|=2048,el(9,{destroy:void 0},tx.bind(null,s,y,u,i),null),u},useId:function(){var r=Jt(),i=Ve.identifierPrefix;if(Me){var u=ur,s=lr;u=(s&~(1<<32-yn(s)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Ss++,0<\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof s.is=="string"?w.createElement("select",{is:s.is}):w.createElement("select"),s.multiple?y.multiple=!0:s.size&&(y.size=s.size);break;default:y=typeof s.is=="string"?w.createElement(m,{is:s.is}):w.createElement(m)}}y[qt]=i,y[rn]=s;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=y;e:switch(Kt(y,m,s),m){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Mr(i)}}return Je(i),Fh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,u),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==s&&Mr(i);else{if(typeof s!="string"&&i.stateNode===null)throw Error(a(166));if(r=be.current,Yi(i)){if(r=i.stateNode,u=i.memoizedProps,s=null,m=Bt,m!==null)switch(m.tag){case 27:case 5:s=m.memoizedProps}r[qt]=i,r=!!(r.nodeValue===u||s!==null&&s.suppressHydrationWarning===!0||W1(r.nodeValue,u)),r||sa(i,!0)}else r=Vs(r).createTextNode(s),r[qt]=i,i.stateNode=r}return Je(i),null;case 31:if(u=i.memoizedState,r===null||r.memoizedState!==null){if(s=Yi(i),u!==null){if(r===null){if(!s)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[qt]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),r=!1}else u=ih(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return i.flags&256?(Sn(i),i):(Sn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Je(i),null;case 13:if(s=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Yi(i),s!==null&&s.dehydrated!==null){if(r===null){if(!m)throw Error(a(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[qt]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),m=!1}else m=ih(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(Sn(i),i):(Sn(i),null)}return Sn(i),(i.flags&128)!==0?(i.lanes=u,i):(u=s!==null,r=r!==null&&r.memoizedState!==null,u&&(s=i.child,m=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(m=s.alternate.memoizedState.cachePool.pool),y=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==m&&(s.flags|=2048)),u!==r&&u&&(i.child.flags|=8192),Ds(i,i.updateQueue),Je(i),null);case 4:return W(),r===null&&ym(i.stateNode.containerInfo),Je(i),null;case 10:return Ar(i.type),Je(i),null;case 19:if(F(dt),s=i.memoizedState,s===null)return Je(i),null;if(m=(i.flags&128)!==0,y=s.rendering,y===null)if(m)bu(s,!1);else{if(st!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=bs(r),y!==null){for(i.flags|=128,bu(s,!1),r=y.updateQueue,i.updateQueue=r,Ds(i,r),i.subtreeFlags=0,r=u,u=i.child;u!==null;)Mb(u,r),u=u.sibling;return ie(dt,dt.current&1|2),Me&&Or(i,s.treeForkCount),i.child}r=r.sibling}s.tail!==null&&vn()>Ls&&(i.flags|=128,m=!0,bu(s,!1),i.lanes=4194304)}else{if(!m)if(r=bs(y),r!==null){if(i.flags|=128,m=!0,r=r.updateQueue,i.updateQueue=r,Ds(i,r),bu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!y.alternate&&!Me)return Je(i),null}else 2*vn()-s.renderingStartTime>Ls&&u!==536870912&&(i.flags|=128,m=!0,bu(s,!1),i.lanes=4194304);s.isBackwards?(y.sibling=i.child,i.child=y):(r=s.last,r!==null?r.sibling=y:i.child=y,s.last=y)}return s.tail!==null?(r=s.tail,s.rendering=r,s.tail=r.sibling,s.renderingStartTime=vn(),r.sibling=null,u=dt.current,ie(dt,m?u&1|2:u&1),Me&&Or(i,s.treeForkCount),r):(Je(i),null);case 22:case 23:return Sn(i),gh(),s=i.memoizedState!==null,r!==null?r.memoizedState!==null!==s&&(i.flags|=8192):s&&(i.flags|=8192),s?(u&536870912)!==0&&(i.flags&128)===0&&(Je(i),i.subtreeFlags&6&&(i.flags|=8192)):Je(i),u=i.updateQueue,u!==null&&Ds(i,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==u&&(i.flags|=2048),r!==null&&F(Ja),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ar(vt),Je(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function _C(r,i){switch(rh(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ar(vt),W(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return _e(i),null;case 31:if(i.memoizedState!==null){if(Sn(i),i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Sn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return F(dt),null;case 4:return W(),null;case 10:return Ar(i.type),null;case 22:case 23:return Sn(i),gh(),r!==null&&F(Ja),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ar(vt),null;case 25:return null;default:return null}}function r1(r,i){switch(rh(i),i.tag){case 3:Ar(vt),W();break;case 26:case 27:case 5:_e(i);break;case 4:W();break;case 31:i.memoizedState!==null&&Sn(i);break;case 13:Sn(i);break;case 19:F(dt);break;case 10:Ar(i.type);break;case 22:case 23:Sn(i),gh(),r!==null&&F(Ja);break;case 24:Ar(vt)}}function xu(r,i){try{var u=i.updateQueue,s=u!==null?u.lastEffect:null;if(s!==null){var m=s.next;u=m;do{if((u.tag&r)===r){s=void 0;var y=u.create,w=u.inst;s=y(),w.destroy=s}u=u.next}while(u!==m)}}catch(A){qe(i,i.return,A)}}function pa(r,i,u){try{var s=i.updateQueue,m=s!==null?s.lastEffect:null;if(m!==null){var y=m.next;s=y;do{if((s.tag&r)===r){var w=s.inst,A=w.destroy;if(A!==void 0){w.destroy=void 0,m=i;var D=u,I=A;try{I()}catch(Q){qe(m,D,Q)}}}s=s.next}while(s!==y)}}catch(Q){qe(i,i.return,Q)}}function a1(r){var i=r.updateQueue;if(i!==null){var u=r.stateNode;try{Xb(i,u)}catch(s){qe(r,r.return,s)}}}function i1(r,i,u){u.props=ai(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(s){qe(r,i,s)}}function Su(r,i){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var s=r.stateNode;break;case 30:s=r.stateNode;break;default:s=r.stateNode}typeof u=="function"?r.refCleanup=u(s):u.current=s}}catch(m){qe(r,i,m)}}function or(r,i){var u=r.ref,s=r.refCleanup;if(u!==null)if(typeof s=="function")try{s()}catch(m){qe(r,i,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(m){qe(r,i,m)}else u.current=null}function l1(r){var i=r.type,u=r.memoizedProps,s=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&s.focus();break e;case"img":u.src?s.src=u.src:u.srcSet&&(s.srcset=u.srcSet)}}catch(m){qe(r,r.return,m)}}function Zh(r,i,u){try{var s=r.stateNode;VC(s,r.type,u,i),s[rn]=i}catch(m){qe(r,r.return,m)}}function u1(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ja(r.type)||r.tag===4}function Qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||u1(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ja(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Wh(r,i,u){var s=r.tag;if(s===5||s===6)r=r.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(r),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Sr));else if(s!==4&&(s===27&&ja(r.type)&&(u=r.stateNode,i=null),r=r.child,r!==null))for(Wh(r,i,u),r=r.sibling;r!==null;)Wh(r,i,u),r=r.sibling}function ks(r,i,u){var s=r.tag;if(s===5||s===6)r=r.stateNode,i?u.insertBefore(r,i):u.appendChild(r);else if(s!==4&&(s===27&&ja(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(ks(r,i,u),r=r.sibling;r!==null;)ks(r,i,u),r=r.sibling}function o1(r){var i=r.stateNode,u=r.memoizedProps;try{for(var s=r.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);Kt(i,s,u),i[qt]=r,i[rn]=u}catch(y){qe(r,r.return,y)}}var Cr=!1,gt=!1,Jh=!1,s1=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function AC(r,i){if(r=r.containerInfo,xm=ec,r=Sb(r),Gd(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var s=u.getSelection&&u.getSelection();if(s&&s.rangeCount!==0){u=s.anchorNode;var m=s.anchorOffset,y=s.focusNode;s=s.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var w=0,A=-1,D=-1,I=0,Q=0,te=r,Y=null;t:for(;;){for(var X;te!==u||m!==0&&te.nodeType!==3||(A=w+m),te!==y||s!==0&&te.nodeType!==3||(D=w+s),te.nodeType===3&&(w+=te.nodeValue.length),(X=te.firstChild)!==null;)Y=te,te=X;for(;;){if(te===r)break t;if(Y===u&&++I===m&&(A=w),Y===y&&++Q===s&&(D=w),(X=te.nextSibling)!==null)break;te=Y,Y=te.parentNode}te=X}u=A===-1||D===-1?null:{start:A,end:D}}else u=null}u=u||{start:0,end:0}}else u=null;for(Sm={focusedElem:r,selectionRange:u},ec=!1,Ct=i;Ct!==null;)if(i=Ct,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Ct=r;else for(;Ct!==null;){switch(i=Ct,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u title"))),Kt(y,s,u),y[qt]=r,Mt(y),s=y;break e;case"link":var w=vS("link","href",m).get(s+(u.href||""));if(w){for(var A=0;AKe&&(w=Ke,Ke=ge,ge=w);var $=bb(A,ge),R=bb(A,Ke);if($&&R&&(X.rangeCount!==1||X.anchorNode!==$.node||X.anchorOffset!==$.offset||X.focusNode!==R.node||X.focusOffset!==R.offset)){var q=te.createRange();q.setStart($.node,$.offset),X.removeAllRanges(),ge>Ke?(X.addRange(q),X.extend(R.node,R.offset)):(q.setEnd(R.node,R.offset),X.addRange(q))}}}}for(te=[],X=A;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;Au?32:u,H.T=null,u=lm,lm=null;var y=xa,w=Rr;if(jt=0,il=xa=null,Rr=0,(ze&6)!==0)throw Error(a(331));var A=ze;if(ze|=4,x1(y.current),y1(y,y.current,w,u),ze=A,Eu(0,!1),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(Yl,y)}catch{}return!0}finally{ee.p=m,H.T=s,$1(r,i)}}function q1(r,i,u){i=Pn(u,i),i=Uh(r.stateNode,i,2),r=ha(r,i,2),r!==null&&(Vl(r,2),sr(r))}function qe(r,i,u){if(r.tag===3)q1(r,r,u);else for(;i!==null;){if(i.tag===3){q1(i,r,u);break}else if(i.tag===1){var s=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ba===null||!ba.has(s))){r=Pn(u,r),u=Bx(2),s=ha(i,u,2),s!==null&&(Ix(u,s,i,r),Vl(s,2),sr(s));break}}i=i.return}}function cm(r,i,u){var s=r.pingCache;if(s===null){s=r.pingCache=new TC;var m=new Set;s.set(i,m)}else m=s.get(i),m===void 0&&(m=new Set,s.set(i,m));m.has(u)||(nm=!0,m.add(u),r=PC.bind(null,r,i,u),i.then(r,r))}function PC(r,i,u){var s=r.pingCache;s!==null&&s.delete(i),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Ve===r&&(Ne&u)===u&&(st===4||st===3&&(Ne&62914560)===Ne&&300>vn()-Rs?(ze&2)===0&&ll(r,0):rm|=u,al===Ne&&(al=0)),sr(r)}function B1(r,i){i===0&&(i=zg()),r=Xa(r,i),r!==null&&(Vl(r,i),sr(r))}function zC(r){var i=r.memoizedState,u=0;i!==null&&(u=i.retryLane),B1(r,u)}function RC(r,i){var u=0;switch(r.tag){case 31:case 13:var s=r.stateNode,m=r.memoizedState;m!==null&&(u=m.retryLane);break;case 19:s=r.stateNode;break;case 22:s=r.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(i),B1(r,u)}function LC(r,i){return jd(r,i)}var Hs=null,ol=null,fm=!1,Ks=!1,dm=!1,wa=0;function sr(r){r!==ol&&r.next===null&&(ol===null?Hs=ol=r:ol=ol.next=r),Ks=!0,fm||(fm=!0,UC())}function Eu(r,i){if(!dm&&Ks){dm=!0;do for(var u=!1,s=Hs;s!==null;){if(r!==0){var m=s.pendingLanes;if(m===0)var y=0;else{var w=s.suspendedLanes,A=s.pingedLanes;y=(1<<31-yn(42|r)+1)-1,y&=m&~(w&~A),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,Y1(s,y))}else y=Ne,y=Xo(s,s===Ve?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(y&3)===0||Gl(s,y)||(u=!0,Y1(s,y));s=s.next}while(u);dm=!1}}function $C(){I1()}function I1(){Ks=fm=!1;var r=0;wa!==0&&FC()&&(r=wa);for(var i=vn(),u=null,s=Hs;s!==null;){var m=s.next,y=H1(s,i);y===0?(s.next=null,u===null?Hs=m:u.next=m,m===null&&(ol=u)):(u=s,(r!==0||(y&3)!==0)&&(Ks=!0)),s=m}jt!==0&&jt!==5||Eu(r),wa!==0&&(wa=0)}function H1(r,i){for(var u=r.suspendedLanes,s=r.pingedLanes,m=r.expirationTimes,y=r.pendingLanes&-62914561;0A)break;var Q=D.transferSize,te=D.initiatorType;Q&&J1(te)&&(D=D.responseEnd,w+=Q*(D"u"?null:document;function fS(r,i,u){var s=sl;if(s&&typeof i=="string"&&i){var m=Dn(i);m='link[rel="'+r+'"][href="'+m+'"]',typeof u=="string"&&(m+='[crossorigin="'+u+'"]'),cS.has(m)||(cS.add(m),r={rel:r,crossOrigin:u,href:i},s.querySelector(m)===null&&(i=s.createElement("link"),Kt(i,"link",r),Mt(i),s.head.appendChild(i)))}}function a4(r){Lr.D(r),fS("dns-prefetch",r,null)}function i4(r,i){Lr.C(r,i),fS("preconnect",r,i)}function l4(r,i,u){Lr.L(r,i,u);var s=sl;if(s&&r&&i){var m='link[rel="preload"][as="'+Dn(i)+'"]';i==="image"&&u&&u.imageSrcSet?(m+='[imagesrcset="'+Dn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(m+='[imagesizes="'+Dn(u.imageSizes)+'"]')):m+='[href="'+Dn(r)+'"]';var y=m;switch(i){case"style":y=cl(r);break;case"script":y=fl(r)}qn.has(y)||(r=p({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:r,as:i},u),qn.set(y,r),s.querySelector(m)!==null||i==="style"&&s.querySelector(Cu(y))||i==="script"&&s.querySelector(Du(y))||(i=s.createElement("link"),Kt(i,"link",r),Mt(i),s.head.appendChild(i)))}}function u4(r,i){Lr.m(r,i);var u=sl;if(u&&r){var s=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+Dn(s)+'"][href="'+Dn(r)+'"]',y=m;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=fl(r)}if(!qn.has(y)&&(r=p({rel:"modulepreload",href:r},i),qn.set(y,r),u.querySelector(m)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Du(y)))return}s=u.createElement("link"),Kt(s,"link",r),Mt(s),u.head.appendChild(s)}}}function o4(r,i,u){Lr.S(r,i,u);var s=sl;if(s&&r){var m=Di(s).hoistableStyles,y=cl(r);i=i||"default";var w=m.get(y);if(!w){var A={loading:0,preload:null};if(w=s.querySelector(Cu(y)))A.loading=5;else{r=p({rel:"stylesheet",href:r,"data-precedence":i},u),(u=qn.get(y))&&Nm(r,u);var D=w=s.createElement("link");Mt(D),Kt(D,"link",r),D._p=new Promise(function(I,Q){D.onload=I,D.onerror=Q}),D.addEventListener("load",function(){A.loading|=1}),D.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Fs(w,i,s)}w={type:"stylesheet",instance:w,count:1,state:A},m.set(y,w)}}}function s4(r,i){Lr.X(r,i);var u=sl;if(u&&r){var s=Di(u).hoistableScripts,m=fl(r),y=s.get(m);y||(y=u.querySelector(Du(m)),y||(r=p({src:r,async:!0},i),(i=qn.get(m))&&Tm(r,i),y=u.createElement("script"),Mt(y),Kt(y,"link",r),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(m,y))}}function c4(r,i){Lr.M(r,i);var u=sl;if(u&&r){var s=Di(u).hoistableScripts,m=fl(r),y=s.get(m);y||(y=u.querySelector(Du(m)),y||(r=p({src:r,async:!0,type:"module"},i),(i=qn.get(m))&&Tm(r,i),y=u.createElement("script"),Mt(y),Kt(y,"link",r),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},s.set(m,y))}}function dS(r,i,u,s){var m=(m=be.current)?Xs(m):null;if(!m)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=cl(u.href),u=Di(m).hoistableStyles,s=u.get(i),s||(s={type:"style",instance:null,count:0,state:null},u.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=cl(u.href);var y=Di(m).hoistableStyles,w=y.get(r);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,w),(y=m.querySelector(Cu(r)))&&!y._p&&(w.instance=y,w.state.loading=5),qn.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},qn.set(r,u),y||f4(m,r,u,w.state))),i&&s===null)throw Error(a(528,""));return w}if(i&&s!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fl(u),u=Di(m).hoistableScripts,s=u.get(i),s||(s={type:"script",instance:null,count:0,state:null},u.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function cl(r){return'href="'+Dn(r)+'"'}function Cu(r){return'link[rel="stylesheet"]['+r+"]"}function hS(r){return p({},r,{"data-precedence":r.precedence,precedence:null})}function f4(r,i,u,s){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?s.loading=1:(i=r.createElement("link"),s.preload=i,i.addEventListener("load",function(){return s.loading|=1}),i.addEventListener("error",function(){return s.loading|=2}),Kt(i,"link",u),Mt(i),r.head.appendChild(i))}function fl(r){return'[src="'+Dn(r)+'"]'}function Du(r){return"script[async]"+r}function mS(r,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var s=r.querySelector('style[data-href~="'+Dn(u.href)+'"]');if(s)return i.instance=s,Mt(s),s;var m=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return s=(r.ownerDocument||r).createElement("style"),Mt(s),Kt(s,"style",m),Fs(s,u.precedence,r),i.instance=s;case"stylesheet":m=cl(u.href);var y=r.querySelector(Cu(m));if(y)return i.state.loading|=4,i.instance=y,Mt(y),y;s=hS(u),(m=qn.get(m))&&Nm(s,m),y=(r.ownerDocument||r).createElement("link"),Mt(y);var w=y;return w._p=new Promise(function(A,D){w.onload=A,w.onerror=D}),Kt(y,"link",s),i.state.loading|=4,Fs(y,u.precedence,r),i.instance=y;case"script":return y=fl(u.src),(m=r.querySelector(Du(y)))?(i.instance=m,Mt(m),m):(s=u,(m=qn.get(y))&&(s=p({},u),Tm(s,m)),r=r.ownerDocument||r,m=r.createElement("script"),Mt(m),Kt(m,"link",s),r.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(s=i.instance,i.state.loading|=4,Fs(s,u.precedence,r));return i.instance}function Fs(r,i,u){for(var s=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=s.length?s[s.length-1]:null,y=m,w=0;w title"):null)}function d4(r,i,u){if(u===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function yS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function h4(r,i,u,s){if(u.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var m=cl(s.href),y=i.querySelector(Cu(m));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Qs.bind(r),i.then(r,r)),u.state.loading|=4,u.instance=y,Mt(y);return}y=i.ownerDocument||i,s=hS(s),(m=qn.get(m))&&Nm(s,m),y=y.createElement("link"),Mt(y);var w=y;w._p=new Promise(function(A,D){w.onload=A,w.onerror=D}),Kt(y,"link",s),u.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=Qs.bind(r),i.addEventListener("load",u),i.addEventListener("error",u))}}var Mm=0;function m4(r,i){return r.stylesheets&&r.count===0&&Js(r,r.stylesheets),0Mm?50:800)+i);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(s),clearTimeout(m)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Js(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Ws=null;function Js(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Ws=new Map,i.forEach(v4,r),Ws=null,Qs.call(r))}function v4(r,i){if(!(i.state.loading&4)){var u=Ws.get(r);if(u)var s=u.get(null);else{u=new Map,Ws.set(r,u);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Um.exports=k4(),Um.exports}var z4=P4();const R4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),L4=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),BS=e=>{const t=L4(e);return t.charAt(0).toUpperCase()+t.slice(1)},G_=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),$4=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var U4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const q4=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},d)=>S.createElement("svg",{ref:d,...U4,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:G_("lucide",l),...!o&&!$4(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,v])=>S.createElement(h,v)),...Array.isArray(o)?o:[o]]));const je=(e,t)=>{const n=S.forwardRef(({className:a,...l},o)=>S.createElement(q4,{ref:o,iconNode:t,className:G_(`lucide-${R4(BS(e))}`,`lucide-${e}`,a),...l}));return n.displayName=BS(e),n};const B4=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],V_=je("activity",B4);const I4=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Hm=je("arrow-down-to-line",I4);const H4=[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]],Km=je("arrow-up-from-line",H4);const K4=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Y4=je("bell",K4);const G4=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],IS=je("calendar",G4);const V4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],X4=je("check",V4);const F4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kc=je("chevron-down",F4);const Z4=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Q4=je("chevron-left",Z4);const W4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],J4=je("chevron-right",W4);const eD=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ep=je("chevron-up",eD);const tD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Tf=je("circle-alert",tD);const nD=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],wl=je("circle-check-big",nD);const rD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],aD=je("circle-check",rD);const iD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],lD=je("circle-dollar-sign",iD);const uD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pa=je("circle-x",uD);const oD=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],T0=je("clock",oD);const sD=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],cD=je("coins",sD);const fD=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],dD=je("cpu",fD);const hD=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],M0=je("gauge",hD);const mD=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],X_=je("key-round",mD);const vD=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],pD=je("layers",vD);const yD=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],gD=je("layout-dashboard",yD);const bD=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],C0=je("lock-keyhole",bD);const xD=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],SD=je("log-out",xD);const wD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jD=je("plus",wD);const OD=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],_D=je("power",OD);const AD=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],ED=je("receipt-text",AD);const ND=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Pl=je("refresh-cw",ND);const TD=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],D0=je("rotate-ccw",TD);const MD=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],CD=je("save",MD);const DD=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],kD=je("server-cog",DD);const PD=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],zD=je("server",PD);const RD=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],LD=je("settings",RD);const $D=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],F_=je("settings-2",$D);const UD=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Z_=je("shield-check",UD);const qD=[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]],BD=je("thermometer",qD);const ID=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],HD=je("trash-2",ID);const KD=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Np=je("triangle-alert",KD);const YD=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],HS=je("wifi-off",YD);const GD=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],VD=je("wifi",GD);const XD=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Q_=je("x",XD);const FD=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ZD=je("zap",FD);function Da(e,t=5e3){const[n,a]=S.useState(null),[l,o]=S.useState(null),[c,f]=S.useState(!0),[d,h]=S.useState(!1),[v,p]=S.useState(null),b=S.useCallback(async()=>{h(!0);try{const x=await e();a(x),o(null),p(new Date)}catch(x){o(x instanceof Error?x:new Error(String(x)))}finally{f(!1),h(!1)}},[e]);return S.useEffect(()=>{if(b(),t<=0)return;const x=setInterval(b,t);return()=>clearInterval(x)},[b,t]),{data:n,error:l,loading:c,refreshing:d,lastUpdated:v,refetch:b}}const k0="/api/v1/computing/inference",_c="computing-provider-control-token";let fi=sessionStorage.getItem(_c)??"";function hl(e){return encodeURIComponent(e)}class P0 extends Error{status;constructor(t,n){super(n),this.name="ApiError",this.status=t}}function z0(){return fi?{Authorization:`Bearer ${fi}`}:{}}async function cr(e){const t=await fetch(`${k0}${e}`,{headers:z0()});if(!t.ok){const n=await t.json().catch(()=>null);throw new P0(t.status,n?.error??`API error: ${t.status} ${t.statusText}`)}return t.json()}async function Ta(e,t){const n=await fetch(`${k0}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...z0()},body:t?JSON.stringify(t):void 0});if(!n.ok){const a=await n.json().catch(()=>null);throw new P0(n.status,a?.error??`API error: ${n.status} ${n.statusText}`)}return n.json()}async function Uu(e,t){const n=await fetch(`${k0}${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...z0()},body:JSON.stringify(t)});if(!n.ok){const a=await n.json().catch(()=>null);throw new P0(n.status,a?.error??`API error: ${n.status} ${n.statusText}`)}return n.json()}const Ze={setAccessToken:e=>{fi=e.trim(),fi?sessionStorage.setItem(_c,fi):sessionStorage.removeItem(_c)},hasAccessToken:()=>!!fi,clearAccessToken:()=>{fi="",sessionStorage.removeItem(_c)},getMetrics:()=>cr("/metrics"),getStatus:()=>cr("/status"),getModels:()=>cr("/models"),enableModel:e=>Ta(`/models/${hl(e)}/enable`),disableModel:e=>Ta(`/models/${hl(e)}/disable`),reloadModels:()=>Ta("/models/reload"),forceHealthCheck:e=>Ta(`/models/${hl(e)}/healthcheck`),getRequestManagement:()=>cr("/request-management"),setGlobalRateLimit:e=>Ta("/ratelimit/global",{rate:e}),setModelRateLimit:(e,t)=>Ta(`/ratelimit/model/${hl(e)}`,{rate:t}),setGlobalConcurrency:e=>Ta("/concurrency/global",{max:e}),setModelConcurrency:(e,t)=>Ta(`/concurrency/model/${hl(e)}`,{max:t}),getRequestHistory:(e={})=>{const t=new URLSearchParams;e.limit&&t.set("limit",e.limit.toString()),e.offset&&t.set("offset",e.offset.toString()),e.model&&t.set("model",e.model),e.source&&t.set("source",e.source);const n=t.toString();return cr(`/requests${n?`?${n}`:""}`)},getEarnings:()=>cr("/earnings"),getEarningsHistory:e=>cr(`/earnings/history?duration=${e}`),getMetricsHistory:(e,t)=>{const n=new URLSearchParams;e&&n.set("duration",e),t&&n.set("resolution",t);const a=n.toString();return cr(`/metrics/history${a?`?${a}`:""}`)},getModelMetrics:e=>cr(`/models/${hl(e)}/metrics`),getSettings:()=>cr("/settings"),updateAlerts:e=>Uu("/settings/alerts",e),updateSelfCheck:e=>Uu("/settings/self-check",e),updateLogging:e=>Uu("/settings/logging",e),updateLimits:e=>Uu("/settings/limits",e),updateModels:e=>Uu("/settings/models",{models:e})},W_=["#3987e5","#c98500","#d55181","#008300"],R0="#94a3b8",J_="Other",Tp="#5b6b82",eA="Unattributed",QD=W_.length;function tA(e){const t=[...e??[]].sort((o,c)=>c.total_usd!==o.total_usd?c.total_usd-o.total_usd:o.model.localeCompare(c.model)),n=new Map,a=[],l=new Set;return t.forEach((o,c)=>{c=86400?a.toLocaleDateString(void 0,{year:n?"numeric":void 0,month:"short",day:"numeric"}):n?a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function oc(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function ui(e){return e===0?"$0":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function KS(e,t){const n=[];let a=0,l=0,o=0;for(const[f,d]of Object.entries(e.models??{}))t.colours.has(f)?n.push({key:f,label:f,colour:Pc(t,f),usd:d.usd,tokensIn:d.tokens_in,tokensOut:d.tokens_out}):(a+=d.usd,l+=d.tokens_in,o+=d.tokens_out);n.sort((f,d)=>d.usd-f.usd),(a>0||l>0||o>0)&&n.push({key:"__other",label:J_,colour:R0,usd:a,tokensIn:l,tokensOut:o});const c=e.unattributed??0;return c>1e-6&&n.push({key:"__unattributed",label:eA,colour:Tp,usd:c,tokensIn:0,tokensOut:0}),n}function JD({models:e}){const[t,n]=S.useState("24h"),[a,l]=S.useState(null),{data:o,loading:c,error:f}=Da(S.useCallback(()=>Ze.getEarningsHistory(t),[t]),6e4),d=S.useMemo(()=>tA(e),[e]),h=S.useMemo(()=>o?.points??[],[o?.points]),v=o?.bucket_seconds,p=o?.authoritative_points??0,b=h.length>0&&p===h.length,x=h.reduce((E,T)=>Math.max(E,T.usd),0),O=a??(h.length>0?h.length-1:null),j=O!==null?h[O]:null,_=j?KS(j,d):[],N=S.useMemo(()=>{const E=new Set;let T=!1,P=!1;for(const M of h){for(const L of Object.keys(M.models??{}))d.colours.has(L)?E.add(L):T=!0;(M.unattributed??0)>1e-6&&(P=!0)}const C=d.ordered.filter(M=>E.has(M)).map(M=>({key:M,label:M,colour:Pc(d,M)}));return T&&C.push({key:"__other",label:J_,colour:R0}),P&&C.push({key:"__unattributed",label:eA,colour:Tp}),C},[h,d]);return g.jsxs("div",{className:"min-w-0 overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 px-4 py-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Earnings over time"}),g.jsx("p",{className:"text-xs text-slate-400",children:c&&!o?"Loading…":f&&o?`${ui(o.total_usd)} · showing stale data`:`${ui(o?.total_usd??0)} in this window`})]}),g.jsx("div",{className:"flex gap-1",role:"group","aria-label":"Time window",children:WD.map(E=>g.jsx("button",{type:"button",onClick:()=>n(E.id),"aria-pressed":t===E.id,className:`rounded-lg px-3 py-1.5 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${t===E.id?"bg-slate-700 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:E.label},E.id))})]}),f&&!o?g.jsxs("p",{className:"px-4 py-6 text-sm text-amber-300",children:["Could not load earnings history: ",f.message]}):h.length===0?g.jsx("p",{className:"px-4 py-6 text-sm text-slate-400",children:"No history for this window yet."}):g.jsxs("div",{className:"px-4 py-4",children:[g.jsx("div",{className:"mb-2 h-36","aria-live":"polite",children:j?g.jsxs("div",{className:"text-xs",children:[g.jsxs("div",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-mono text-sm text-white",children:ui(j.usd)}),g.jsx("span",{className:"text-slate-400",children:uc(j.timestamp,v,!0)}),a===null&&g.jsx("span",{className:"ml-auto text-slate-400",children:"Latest interval"})]}),_.length>0?g.jsx("ul",{className:"mt-1 space-y-0.5",children:_.map(E=>g.jsxs("li",{className:"flex items-center gap-2",children:[g.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:E.colour}}),g.jsx("span",{className:"min-w-0 flex-1 truncate text-slate-300",children:E.label}),g.jsx("span",{className:"font-mono text-slate-400",children:ui(E.usd)}),E.key!=="__unattributed"&&g.jsxs("span",{className:"w-28 shrink-0 text-right font-mono text-slate-400",children:[oc(E.tokensIn)," in / ",oc(E.tokensOut)," out"]})]},E.key))}):g.jsxs("div",{className:"mt-1 text-slate-400",children:[oc(j.tokens_in)," in / ",oc(j.tokens_out)," out",g.jsx("span",{className:"ml-2 text-slate-400",children:"— recorded before the per-model split"})]})]}):g.jsxs("div",{className:"text-xs text-slate-400",children:["Hover a bar for its models and usage. ",h.length," intervals shown."]})}),g.jsx("div",{className:"flex h-32 items-end gap-px",onMouseLeave:()=>l(null),role:"group","aria-label":`Earnings per interval over ${t}, split by model, totalling ${ui(o?.total_usd??0)}`,children:h.map((E,T)=>{const P=x>0?Math.max(2,E.usd/x*100):2,C=O===T,M=KS(E,d),L=M.length?M.map(Z=>`${Z.label} ${ui(Z.usd)}`).join(", "):`${E.tokens_in.toLocaleString()} in, ${E.tokens_out.toLocaleString()} out`;return g.jsx("button",{type:"button",onMouseEnter:()=>l(T),onFocus:()=>l(T),onBlur:()=>l(null),"aria-label":`${uc(E.timestamp,v,!0)}: ${ui(E.usd)} — ${L}`,className:`flex h-full flex-1 flex-col justify-end rounded-t focus:outline-none focus:ring-1 focus:ring-blue-400 ${C?"ring-1 ring-white/40":""}`,style:{height:`${P}%`},children:M.length===0?g.jsx("span",{className:"block h-full w-full rounded-t",style:{backgroundColor:Tp}}):M.map((Z,re)=>{const B=E.usd>0?Z.usd/E.usd*100:0;return g.jsx("span",{className:re===0?"block w-full rounded-t":"block w-full",style:{height:`${B}%`,backgroundColor:Z.colour,marginTop:re===0?0:2,opacity:C?1:.85}},Z.key)})},E.timestamp)})}),g.jsxs("div",{className:"mt-2 flex justify-between text-xs text-slate-400",children:[g.jsx("span",{children:h[0]&&uc(h[0].timestamp,v,!0)}),g.jsx("span",{children:h[h.length-1]&&uc(h[h.length-1].timestamp,v,!0)})]}),N.length>0&&g.jsx("ul",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs","aria-label":"Models in this chart",children:N.map(E=>g.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[g.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:E.colour}}),g.jsx("span",{className:"break-all text-slate-400",children:E.label})]},E.key))})]}),g.jsxs("p",{className:"flex items-start gap-2 border-t border-slate-800 px-4 py-3 text-xs text-slate-400",children:[g.jsx(Tf,{"aria-hidden":"true",size:14,className:"mt-px shrink-0"}),g.jsxs("span",{children:[b?"From Swan Inference’s own earnings figure, sampled and differenced per interval.":p>0?`${p} of ${h.length} intervals come from Swan Inference’s own figure; the rest are this node’s estimate, priced from stored history at current rates.`:"This node’s own estimate, priced from its stored history at current rates — not the platform’s ledger.",p>0&&" The split by model is still this node’s share of served tokens: the platform reports no per-model breakdown.",(o?.restarts??0)>0&&p{var{children:n,width:a,height:l,viewBox:o,className:c,style:f,title:d,desc:h}=e,v=ik(e,ak),p=o||{width:a,height:l,x:0,y:0},b=Re("recharts-surface",c);return S.createElement("svg",Mp({},tn(v),{className:b,width:a,height:l,style:f,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),S.createElement("title",null,d),S.createElement("desc",null,h),n)}),uk=["children","className"];function Cp(){return Cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:a}=e,l=ok(e,uk),o=Re("recharts-layer",a);return S.createElement("g",Cp({className:o},tn(l),{ref:t}),n)}),U0=Y_(),iA=S.createContext(null),ck=()=>S.useContext(iA);function Fe(e){return function(){return e}}const lA=Math.cos,zc=Math.sin,ar=Math.sqrt,Rc=Math.PI,Mf=2*Rc,Dp=Math.PI,kp=2*Dp,oi=1e-6,fk=kp-oi;function uA(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return uA;const n=10**t;return function(a){this._+=a[0];for(let l=1,o=a.length;loi)if(!(Math.abs(p*d-h*v)>oi)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=a-c,O=l-f,j=d*d+h*h,_=x*x+O*O,N=Math.sqrt(j),E=Math.sqrt(b),T=o*Math.tan((Dp-Math.acos((j+b-_)/(2*N*E)))/2),P=T/E,C=T/N;Math.abs(P-1)>oi&&this._append`L${t+P*v},${n+P*p}`,this._append`A${o},${o},0,0,${+(p*x>v*O)},${this._x1=t+C*d},${this._y1=n+C*h}`}}arc(t,n,a,l,o,c){if(t=+t,n=+n,a=+a,c=!!c,a<0)throw new Error(`negative radius: ${a}`);let f=a*Math.cos(l),d=a*Math.sin(l),h=t+f,v=n+d,p=1^c,b=c?l-o:o-l;this._x1===null?this._append`M${h},${v}`:(Math.abs(this._x1-h)>oi||Math.abs(this._y1-v)>oi)&&this._append`L${h},${v}`,a&&(b<0&&(b=b%kp+kp),b>fk?this._append`A${a},${a},0,1,${p},${t-f},${n-d}A${a},${a},0,1,${p},${this._x1=h},${this._y1=v}`:b>oi&&this._append`A${a},${a},0,${+(b>=Dp)},${p},${this._x1=t+a*Math.cos(o)},${this._y1=n+a*Math.sin(o)}`)}rect(t,n,a,l){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${a=+a}v${+l}h${-a}Z`}toString(){return this._}}function q0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const a=Math.floor(n);if(!(a>=0))throw new RangeError(`invalid digits: ${n}`);t=a}return e},()=>new hk(t)}function B0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oA(e){this._context=e}oA.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 Cf(e){return new oA(e)}function sA(e){return e[0]}function cA(e){return e[1]}function fA(e,t){var n=Fe(!0),a=null,l=Cf,o=null,c=q0(f);e=typeof e=="function"?e:e===void 0?sA:Fe(e),t=typeof t=="function"?t:t===void 0?cA:Fe(t);function f(d){var h,v=(d=B0(d)).length,p,b=!1,x;for(a==null&&(o=l(x=c())),h=0;h<=v;++h)!(h=x;--O)f.point(T[O],P[O]);f.lineEnd(),f.areaEnd()}N&&(T[b]=+e(_,b,p),P[b]=+t(_,b,p),f.point(a?+a(_,b,p):T[b],n?+n(_,b,p):P[b]))}if(E)return f=null,E+""||null}function v(){return fA().defined(l).curve(c).context(o)}return h.x=function(p){return arguments.length?(e=typeof p=="function"?p:Fe(+p),a=null,h):e},h.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Fe(+p),h):e},h.x1=function(p){return arguments.length?(a=p==null?null:typeof p=="function"?p:Fe(+p),h):a},h.y=function(p){return arguments.length?(t=typeof p=="function"?p:Fe(+p),n=null,h):t},h.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Fe(+p),h):t},h.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Fe(+p),h):n},h.lineX0=h.lineY0=function(){return v().x(e).y(t)},h.lineY1=function(){return v().x(e).y(n)},h.lineX1=function(){return v().x(a).y(t)},h.defined=function(p){return arguments.length?(l=typeof p=="function"?p:Fe(!!p),h):l},h.curve=function(p){return arguments.length?(c=p,o!=null&&(f=c(o)),h):c},h.context=function(p){return arguments.length?(p==null?o=f=null:f=c(o=p),h):o},h}class dA{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 mk(e){return new dA(e,!0)}function vk(e){return new dA(e,!1)}const I0={draw(e,t){const n=ar(t/Rc);e.moveTo(n,0),e.arc(0,0,n,0,Mf)}},pk={draw(e,t){const n=ar(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()}},hA=ar(1/3),yk=hA*2,gk={draw(e,t){const n=ar(t/yk),a=n*hA;e.moveTo(0,-n),e.lineTo(a,0),e.lineTo(0,n),e.lineTo(-a,0),e.closePath()}},bk={draw(e,t){const n=ar(t),a=-n/2;e.rect(a,a,n,n)}},xk=.8908130915292852,mA=zc(Rc/10)/zc(7*Rc/10),Sk=zc(Mf/10)*mA,wk=-lA(Mf/10)*mA,jk={draw(e,t){const n=ar(t*xk),a=Sk*n,l=wk*n;e.moveTo(0,-n),e.lineTo(a,l);for(let o=1;o<5;++o){const c=Mf*o/5,f=lA(c),d=zc(c);e.lineTo(d*n,-f*n),e.lineTo(f*a-d*l,d*a+f*l)}e.closePath()}},Ym=ar(3),Ok={draw(e,t){const n=-ar(t/(Ym*3));e.moveTo(0,n*2),e.lineTo(-Ym*n,-n),e.lineTo(Ym*n,-n),e.closePath()}},Bn=-.5,In=ar(3)/2,Pp=1/ar(12),_k=(Pp/2+1)*3,Ak={draw(e,t){const n=ar(t/_k),a=n/2,l=n*Pp,o=a,c=n*Pp+n,f=-o,d=c;e.moveTo(a,l),e.lineTo(o,c),e.lineTo(f,d),e.lineTo(Bn*a-In*l,In*a+Bn*l),e.lineTo(Bn*o-In*c,In*o+Bn*c),e.lineTo(Bn*f-In*d,In*f+Bn*d),e.lineTo(Bn*a+In*l,Bn*l-In*a),e.lineTo(Bn*o+In*c,Bn*c-In*o),e.lineTo(Bn*f+In*d,Bn*d-In*f),e.closePath()}};function Ek(e,t){let n=null,a=q0(l);e=typeof e=="function"?e:Fe(e||I0),t=typeof t=="function"?t:Fe(t===void 0?64:+t);function l(){let o;if(n||(n=o=a()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return l.type=function(o){return arguments.length?(e=typeof o=="function"?o:Fe(o),l):e},l.size=function(o){return arguments.length?(t=typeof o=="function"?o:Fe(+o),l):t},l.context=function(o){return arguments.length?(n=o??null,l):n},l}function Lc(){}function $c(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 vA(e){this._context=e}vA.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:$c(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:$c(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nk(e){return new vA(e)}function pA(e){this._context=e}pA.prototype={areaStart:Lc,areaEnd:Lc,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:$c(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tk(e){return new pA(e)}function yA(e){this._context=e}yA.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,a=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,a):this._context.moveTo(n,a);break;case 3:this._point=4;default:$c(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Mk(e){return new yA(e)}function gA(e){this._context=e}gA.prototype={areaStart:Lc,areaEnd:Lc,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 Ck(e){return new gA(e)}function YS(e){return e<0?-1:1}function GS(e,t,n){var a=e._x1-e._x0,l=t-e._x1,o=(e._y1-e._y0)/(a||l<0&&-0),c=(n-e._y1)/(l||a<0&&-0),f=(o*l+c*a)/(a+l);return(YS(o)+YS(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(f))||0}function VS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gm(e,t,n){var a=e._x0,l=e._y0,o=e._x1,c=e._y1,f=(o-a)/3;e._context.bezierCurveTo(a+f,l+f*t,o-f,c-f*n,o,c)}function Uc(e){this._context=e}Uc.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:Gm(this,this._t0,VS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Gm(this,VS(this,n=GS(this,e,t)),n);break;default:Gm(this,this._t0,n=GS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function bA(e){this._context=new xA(e)}(bA.prototype=Object.create(Uc.prototype)).point=function(e,t){Uc.prototype.point.call(this,t,e)};function xA(e){this._context=e}xA.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,a,l,o){this._context.bezierCurveTo(t,e,a,n,o,l)}};function Dk(e){return new Uc(e)}function kk(e){return new bA(e)}function SA(e){this._context=e}SA.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 a=XS(e),l=XS(t),o=0,c=1;c=0;--t)l[t]=(c[t]-l[t+1])/o[t];for(o[n-1]=(e[n]+l[n-1])/2,t=0;t=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 zk(e){return new Df(e,.5)}function Rk(e){return new Df(e,0)}function Lk(e){return new Df(e,1)}function bi(e,t){if((c=e.length)>1)for(var n=1,a,l,o=e[t[0]],c,f=o.length;n=0;)n[t]=t;return n}function $k(e,t){return e[t]}function Uk(e){const t=[];return t.key=e,t}function qk(){var e=Fe([]),t=zp,n=bi,a=$k;function l(o){var c=Array.from(e.apply(this,arguments),Uk),f,d=c.length,h=-1,v;for(const p of o)for(f=0,++h;f0){for(var n,a,l=0,o=e[0].length,c;l0){for(var n=0,a=e[t[0]],l,o=a.length;n0)||!((o=(l=e[t[0]]).length)>0))){for(var n=0,a=1,l,o,c;a1&&arguments[1]!==void 0?arguments[1]:Xk,n=10**t,a=Math.round(e*n)/n;return Object.is(a,-0)?0:a}function ct(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a{var f=n[c-1];return typeof f=="string"?l+f+o:f!==void 0?l+za(f)+o:l+o},"")}var Wt=e=>e===0?0:e>0?1:-1,vr=e=>typeof e=="number"&&e!=+e,Yr=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,me=e=>(typeof e=="number"||e instanceof Number)&&!vr(e),pr=e=>me(e)||typeof e=="string",Fk=0,uo=e=>{var t=++Fk;return"".concat(e||"").concat(t)},Nn=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!me(t)&&typeof t!="string")return a;var o;if(Yr(t)){if(n==null)return a;var c=t.indexOf("%");o=n*parseFloat(t.slice(0,c))/100}else o=+t;return vr(o)&&(o=a),l&&n!=null&&o>n&&(o=n),o},jA=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},a=0;aa&&(typeof t=="function"?t(a):xi(a,t))===n)}var _t=e=>e===null||typeof e>"u",Oo=e=>_t(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Zk(e){return e!=null}function _o(){}var Qk=["type","size","sizeType"];function Rp(){return Rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(Oo(e));return _A[t]||I0},iP=(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 a=18*rP;return 1.25*e*e*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**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}},lP=(e,t)=>{_A["symbol".concat(Oo(e))]=t},G0=e=>{var{type:t="circle",size:n=64,sizeType:a="area"}=e,l=tP(e,Qk),o=rw(rw({},l),{},{type:t,size:n,sizeType:a}),c="circle";typeof t=="string"&&(c=t);var f=()=>{var b=aP(c),x=Ek().type(b).size(iP(n,a,c)),O=x();if(O!==null)return O},{className:d,cx:h,cy:v}=o,p=tn(o);return me(h)&&me(v)&&me(n)?S.createElement("path",Rp({},p,{className:Re("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(v,")"),d:f()})):null};G0.registerSymbol=lP;var AA=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,V0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(S.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var a={};return Object.keys(n).forEach(l=>{L0(l)&&(a[l]=(o=>n[l](n,o)))}),a},uP=(e,t,n)=>a=>(e(t,n,a),null),X0=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var a=null;return Object.keys(e).forEach(l=>{var o=e[l];L0(l)&&typeof o=="function"&&(a||(a={}),a[l]=uP(o,t,n))}),a};function aw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function oP(e){for(var t=1;t(c[f]===void 0&&a[f]!==void 0&&(c[f]=a[f]),c),n);return o}function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var b=v.formatter||l,x=Re({"recharts-legend-item":!0,["legend-item-".concat(p)]:!0,inactive:v.inactive});if(v.type==="none")return null;var O=v.inactive?o:v.color,j=b?b(v.value,v,p):v.value;return S.createElement("li",qc({className:x,style:d,key:"legend-item-".concat(p)},X0(e,v,p)),S.createElement(U0,{width:n,height:n,viewBox:f,style:h,"aria-label":"".concat(j," legend icon")},S.createElement(yP,{data:v,iconType:c,inactiveColor:o})),S.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},j))})}var bP=e=>{var t=At(e,pP),{payload:n,layout:a,align:l}=t;if(!n||!n.length)return null;var o={padding:0,margin:0,textAlign:a==="horizontal"?l:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:o},S.createElement(gP,qc({},t,{payload:n})))},ev={},tv={},lw;function xP(){return lw||(lw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a){const l=new Map;for(let o=0;o=0}e.isLength=t})(lv)),lv}var cw;function F0(){return cw||(cw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wP();function n(a){return a!=null&&typeof a!="function"&&t.isLength(a.length)}e.isArrayLike=n})(iv)),iv}var uv={},fw;function jP(){return fw||(fw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(uv)),uv}var dw;function OP(){return dw||(dw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F0(),n=jP();function a(l){return n.isObjectLike(l)&&t.isArrayLike(l)}e.isArrayLikeObject=a})(av)),av}var ov={},sv={},hw;function _P(){return hw||(hw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Y0();function n(a){return function(l){return t.get(l,a)}}e.property=n})(sv)),sv}var cv={},fv={},dv={},hv={},mw;function NA(){return mw||(mw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(hv)),hv}var mv={},vw;function TA(){return vw||(vw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(mv)),mv}var vv={},pw;function MA(){return pw||(pw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a){return n===a||Number.isNaN(n)&&Number.isNaN(a)}e.isEqualsSameValueZero=t})(vv)),vv}var yw;function AP(){return yw||(yw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NA(),n=TA(),a=MA();function l(v,p,b){return typeof b!="function"?l(v,p,()=>{}):o(v,p,function x(O,j,_,E,N,T){const C=b(O,j,_,E,N,T);return C!==void 0?!!C:o(O,j,x,T)},new Map)}function o(v,p,b,x){if(p===v)return!0;switch(typeof p){case"object":return c(v,p,b,x);case"function":return Object.keys(p).length>0?o(v,{...p},b,x):a.isEqualsSameValueZero(v,p);default:return t.isObject(v)?typeof p=="string"?p==="":!0:a.isEqualsSameValueZero(v,p)}}function c(v,p,b,x){if(p==null)return!0;if(Array.isArray(p))return d(v,p,b,x);if(p instanceof Map)return f(v,p,b,x);if(p instanceof Set)return h(v,p,b,x);const O=Object.keys(p);if(v==null||n.isPrimitive(v))return O.length===0;if(O.length===0)return!0;if(x?.has(p))return x.get(p)===v;x?.set(p,v);try{for(let j=0;j{})}e.isMatch=n})(fv)),fv}var pv={},yv={},gv={},bw;function EP(){return bw||(bw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(a=>Object.prototype.propertyIsEnumerable.call(n,a))}e.getSymbols=t})(gv)),gv}var bv={},xw;function Z0(){return xw||(xw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(bv)),bv}var xv={},Sw;function DA(){return Sw||(Sw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",a="[object Number]",l="[object Boolean]",o="[object Arguments]",c="[object Symbol]",f="[object Date]",d="[object Map]",h="[object Set]",v="[object Array]",p="[object Function]",b="[object ArrayBuffer]",x="[object Object]",O="[object Error]",j="[object DataView]",_="[object Uint8Array]",E="[object Uint8ClampedArray]",N="[object Uint16Array]",T="[object Uint32Array]",C="[object BigUint64Array]",k="[object Int8Array]",M="[object Int16Array]",L="[object Int32Array]",W="[object BigInt64Array]",re="[object Float32Array]",H="[object Float64Array]";e.argumentsTag=o,e.arrayBufferTag=b,e.arrayTag=v,e.bigInt64ArrayTag=W,e.bigUint64ArrayTag=C,e.booleanTag=l,e.dataViewTag=j,e.dateTag=f,e.errorTag=O,e.float32ArrayTag=re,e.float64ArrayTag=H,e.functionTag=p,e.int16ArrayTag=M,e.int32ArrayTag=L,e.int8ArrayTag=k,e.mapTag=d,e.numberTag=a,e.objectTag=x,e.regexpTag=t,e.setTag=h,e.stringTag=n,e.symbolTag=c,e.uint16ArrayTag=N,e.uint32ArrayTag=T,e.uint8ArrayTag=_,e.uint8ClampedArrayTag=E})(xv)),xv}var Sv={},ww;function NP(){return ww||(ww=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Sv)),Sv}var jw;function kA(){return jw||(jw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=EP(),n=Z0(),a=DA(),l=TA(),o=NP();function c(v,p){return f(v,void 0,v,new Map,p)}function f(v,p,b,x=new Map,O=void 0){const j=O?.(v,p,b,x);if(j!==void 0)return j;if(l.isPrimitive(v))return v;if(x.has(v))return x.get(v);if(Array.isArray(v)){const _=new Array(v.length);x.set(v,_);for(let E=0;Et.isMatch(o,l)}e.matches=a})(cv)),cv}var wv={},jv={},Ov={},Aw;function CP(){return Aw||(Aw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kA(),n=Z0(),a=DA();function l(o,c){return t.cloneDeepWith(o,(f,d,h,v)=>{const p=c?.(f,d,h,v);if(p!==void 0)return p;if(typeof o=="object"){if(n.getTag(o)===a.objectTag&&typeof o.constructor!="function"){const b={};return v.set(o,b),t.copyProperties(b,o,h,v),b}switch(Object.prototype.toString.call(o)){case a.numberTag:case a.stringTag:case a.booleanTag:{const b=new o.constructor(o?.valueOf());return t.copyProperties(b,o),b}case a.argumentsTag:{const b={};return t.copyProperties(b,o),b.length=o.length,b[Symbol.iterator]=o[Symbol.iterator],b}default:return}}})}e.cloneDeepWith=l})(Ov)),Ov}var Ew;function DP(){return Ew||(Ew=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CP();function n(a){return t.cloneDeepWith(a)}e.cloneDeep=n})(jv)),jv}var _v={},Av={},Nw;function PA(){return Nw||(Nw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(a,l=Number.MAX_SAFE_INTEGER){switch(typeof a){case"number":return Number.isInteger(a)&&a>=0&&a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return Dv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dv}var Lw;function BP(){return Lw||(Lw=1,Cv.exports=qP()),Cv.exports}var Uw;function IP(){if(Uw)return Mv;Uw=1;var e=kl(),t=BP();function n(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var a=typeof Object.is=="function"?Object.is:n,l=t.useSyncExternalStore,o=e.useRef,c=e.useEffect,f=e.useMemo,d=e.useDebugValue;return Mv.useSyncExternalStoreWithSelector=function(h,v,p,b,x){var O=o(null);if(O.current===null){var j={hasValue:!1,value:null};O.current=j}else j=O.current;O=f(function(){function E(M){if(!N){if(N=!0,T=M,M=b(M),x!==void 0&&j.hasValue){var L=j.value;if(x(L,M))return C=L}return C=M}if(L=C,a(T,M))return L;var W=b(M);return x!==void 0&&x(L,W)?(T=M,L):(T=M,C=W)}var N=!1,T,C,k=p===void 0?null:p;return[function(){return E(v())},k===null?void 0:function(){return E(k())}]},[v,p,b,x]);var _=l(h,O[0],O[1]);return c(function(){j.hasValue=!0,j.value=_},[_]),d(_),_},Mv}var $w;function HP(){return $w||($w=1,Tv.exports=IP()),Tv.exports}var KP=HP(),Q0=S.createContext(null),YP=e=>e,Qe=()=>{var e=S.useContext(Q0);return e?e.store.dispatch:YP},Ac=()=>{},GP=()=>Ac,VP=(e,t)=>e===t;function de(e){var t=S.useContext(Q0);return KP.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:GP,t?t.store.getState:Ac,t?t.store.getState:Ac,t?e:Ac,VP)}function XP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function FP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ZP(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${t}[${n}]`)}}var qw=e=>Array.isArray(e)?e:[e];function QP(e){const t=Array.isArray(e[0])?e[0]:e;return ZP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function WP(e,t){const n=[],{length:a}=e;for(let l=0;l{n=cc(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}function nz(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,a=(...l)=>{let o=0,c=0,f,d={},h=l.pop();typeof h=="object"&&(d=h,h=l.pop()),XP(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const v={...n,...d},{memoize:p,memoizeOptions:b=[],argsMemoize:x=RA,argsMemoizeOptions:O=[]}=v,j=qw(b),_=qw(O),E=QP(l),N=p(function(){return o++,h.apply(null,arguments)},...j),T=x(function(){c++;const k=WP(E,arguments);return f=N.apply(null,k),f},..._);return Object.assign(T,{resultFunc:h,memoizedResultFunc:N,dependencies:E,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>f,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:p,argsMemoize:x})};return Object.assign(a,{withTypes:()=>a}),a}var V=nz(RA),rz=Object.assign((e,t=V)=>{FP(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),a=n.map(o=>e[o]);return t(a,(...o)=>o.reduce((c,f,d)=>(c[n[d]]=f,c),{}))},{withTypes:()=>rz}),kv={},Pv={},zv={},Iw;function az(){return Iw||(Iw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(a){return typeof a=="symbol"?1:a===null?2:a===void 0?3:a!==a?4:0}const n=(a,l,o)=>{if(a!==l){const c=t(a),f=t(l);if(c===f&&c===0){if(al)return o==="desc"?-1:1}return o==="desc"?f-c:c-f}return 0};e.compareValues=n})(zv)),zv}var Rv={},Lv={},Hw;function LA(){return Hw||(Hw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Lv)),Lv}var Kw;function iz(){return Kw||(Kw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LA(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function l(o,c){return Array.isArray(o)?!1:typeof o=="number"||typeof o=="boolean"||o==null||t.isSymbol(o)?!0:typeof o=="string"&&(a.test(o)||!n.test(o))||c!=null&&Object.hasOwn(c,o)}e.isKey=l})(Rv)),Rv}var Yw;function lz(){return Yw||(Yw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=az(),n=iz(),a=K0();function l(o,c,f,d){if(o==null)return[];f=d?void 0:f,Array.isArray(o)||(o=Object.values(o)),Array.isArray(c)||(c=c==null?[null]:[c]),c.length===0&&(c=[null]),Array.isArray(f)||(f=f==null?[]:[f]),f=f.map(x=>String(x));const h=(x,O)=>{let j=x;for(let _=0;_O==null||x==null?O:typeof x=="object"&&"key"in x?Object.hasOwn(O,x.key)?O[x.key]:h(O,x.path):typeof x=="function"?x(O):Array.isArray(x)?h(O,x):typeof O=="object"?O[x]:O,p=c.map(x=>(Array.isArray(x)&&x.length===1&&(x=x[0]),x==null||typeof x=="function"||Array.isArray(x)||n.isKey(x)?x:{key:x,path:a.toPath(x)}));return o.map(x=>({original:x,criteria:p.map(O=>v(O,x))})).slice().sort((x,O)=>{for(let j=0;jx.original)}e.orderBy=l})(Pv)),Pv}var Uv={},Gw;function uz(){return Gw||(Gw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a=1){const l=[],o=Math.floor(a),c=(f,d)=>{for(let h=0;h1&&a.isIterateeCall(o,c[0],c[1])?c=[]:f>2&&a.isIterateeCall(c[0],c[1],c[2])&&(c=[c[0]]),t.orderBy(o,n.flatten(c),["asc"])}e.sortBy=l})(kv)),kv}var qv,Fw;function sz(){return Fw||(Fw=1,qv=oz().sortBy),qv}var cz=sz();const kf=Qr(cz);var $A=e=>e.legend.settings,fz=e=>e.legend.size,dz=e=>e.legend.payload,hz=V([dz,$A],(e,t)=>{var{itemSorter:n}=t,a=e.flat(1);return n?kf(a,n):a});function mz(){return de(hz)}var fc=1;function qA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=S.useState({height:0,left:0,top:0,width:0}),a=S.useCallback(l=>{if(l!=null){var o=l.getBoundingClientRect(),c={height:o.height,left:o.left,top:o.top,width:o.width};(Math.abs(c.height-t.height)>fc||Math.abs(c.left-t.left)>fc||Math.abs(c.top-t.top)>fc||Math.abs(c.width-t.width)>fc)&&n({height:c.height,left:c.left,top:c.top,width:c.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,a]}function Yt(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 vz=typeof Symbol=="function"&&Symbol.observable||"@@observable",Zw=vz,Bv=()=>Math.random().toString(36).substring(7).split("").join("."),pz={INIT:`@@redux/INIT${Bv()}`,REPLACE:`@@redux/REPLACE${Bv()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bv()}`},Bc=pz;function W0(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 BA(e,t,n){if(typeof e!="function")throw new Error(Yt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Yt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Yt(1));return n(BA)(e,t)}let a=e,l=t,o=new Map,c=o,f=0,d=!1;function h(){c===o&&(c=new Map,o.forEach((_,E)=>{c.set(E,_)}))}function v(){if(d)throw new Error(Yt(3));return l}function p(_){if(typeof _!="function")throw new Error(Yt(4));if(d)throw new Error(Yt(5));let E=!0;h();const N=f++;return c.set(N,_),function(){if(E){if(d)throw new Error(Yt(6));E=!1,h(),c.delete(N),o=null}}}function b(_){if(!W0(_))throw new Error(Yt(7));if(typeof _.type>"u")throw new Error(Yt(8));if(typeof _.type!="string")throw new Error(Yt(17));if(d)throw new Error(Yt(9));try{d=!0,l=a(l,_)}finally{d=!1}return(o=c).forEach(N=>{N()}),_}function x(_){if(typeof _!="function")throw new Error(Yt(10));a=_,b({type:Bc.REPLACE})}function O(){const _=p;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Yt(11));function N(){const C=E;C.next&&C.next(v())}return N(),{unsubscribe:_(N)}},[Zw](){return this}}}return b({type:Bc.INIT}),{dispatch:b,subscribe:p,getState:v,replaceReducer:x,[Zw]:O}}function yz(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Bc.INIT})>"u")throw new Error(Yt(12));if(typeof n(void 0,{type:Bc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yt(13))})}function IA(e){const t=Object.keys(e),n={};for(let o=0;o"u")throw f&&f.type,new Error(Yt(14));h[p]=O,d=d||O!==x}return d=d||a.length!==Object.keys(c).length,d?h:c}}function Ic(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...a)=>t(n(...a)))}function gz(...e){return t=>(n,a)=>{const l=t(n,a);let o=()=>{throw new Error(Yt(15))};const c={getState:l.getState,dispatch:(d,...h)=>o(d,...h)},f=e.map(d=>d(c));return o=Ic(...f)(l.dispatch),{...l,dispatch:o}}}function HA(e){return W0(e)&&"type"in e&&typeof e.type=="string"}var KA=Symbol.for("immer-nothing"),Qw=Symbol.for("immer-draftable"),nn=Symbol.for("immer-state");function Jn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var En=Object,Al=En.getPrototypeOf,Hc="constructor",Pf="prototype",Lp="configurable",Kc="enumerable",Ec="writable",oo="value",Gr=e=>!!e&&!!e[nn];function rr(e){return e?YA(e)||Rf(e)||!!e[Qw]||!!e[Hc]?.[Qw]||Lf(e)||Uf(e):!1}var bz=En[Pf][Hc].toString(),Ww=new WeakMap;function YA(e){if(!e||!J0(e))return!1;const t=Al(e);if(t===null||t===En[Pf])return!0;const n=En.hasOwnProperty.call(t,Hc)&&t[Hc];if(n===Object)return!0;if(!gl(n))return!1;let a=Ww.get(n);return a===void 0&&(a=Function.toString.call(n),Ww.set(n,a)),a===bz}function zf(e,t,n=!0){Ao(e)===0?(n?Reflect.ownKeys(e):En.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((a,l)=>t(l,a,e))}function Ao(e){const t=e[nn];return t?t.type_:Rf(e)?1:Lf(e)?2:Uf(e)?3:0}var Jw=(e,t,n=Ao(e))=>n===2?e.has(t):En[Pf].hasOwnProperty.call(e,t),Up=(e,t,n=Ao(e))=>n===2?e.get(t):e[t],Yc=(e,t,n,a=Ao(e))=>{a===2?e.set(t,n):a===3?e.add(n):e[t]=n};function xz(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Rf=Array.isArray,Lf=e=>e instanceof Map,Uf=e=>e instanceof Set,J0=e=>typeof e=="object",gl=e=>typeof e=="function",Iv=e=>typeof e=="boolean";function Sz(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ur=e=>e.copy_||e.base_,ey=e=>e.modified_?e.copy_:e.base_;function $p(e,t){if(Lf(e))return new Map(e);if(Uf(e))return new Set(e);if(Rf(e))return Array[Pf].slice.call(e);const n=YA(e);if(t===!0||t==="class_only"&&!n){const a=En.getOwnPropertyDescriptors(e);delete a[nn];let l=Reflect.ownKeys(a);for(let o=0;o1&&En.defineProperties(e,{set:dc,add:dc,clear:dc,delete:dc}),En.freeze(e),t&&zf(e,(n,a)=>{ty(a,!0)},!1)),e}function wz(){Jn(2)}var dc={[oo]:wz};function $f(e){return e===null||!J0(e)?!0:En.isFrozen(e)}var Gc="MapSet",qp="Patches",ej="ArrayMethods",GA={};function Si(e){const t=GA[e];return t||Jn(0,e),t}var tj=e=>!!GA[e],so,VA=()=>so,jz=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:tj(Gc)?Si(Gc):void 0,arrayMethodsPlugin_:tj(ej)?Si(ej):void 0});function nj(e,t){t&&(e.patchPlugin_=Si(qp),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bp(e){Ip(e),e.drafts_.forEach(Oz),e.drafts_=null}function Ip(e){e===so&&(so=e.parent_)}var rj=e=>so=jz(so,e);function Oz(e){const t=e[nn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function aj(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[nn].modified_&&(Bp(t),Jn(4)),rr(e)&&(e=ij(t,e));const{patchPlugin_:l}=t;l&&l.generateReplacementPatches_(n[nn].base_,e,t)}else e=ij(t,n);return _z(t,e,!0),Bp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==KA?e:void 0}function ij(e,t){if($f(t))return t;const n=t[nn];if(!n)return Vc(t,e.handledSet_,e);if(!qf(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:a}=n;if(a)for(;a.length>0;)a.pop()(e);ZA(n,e)}return n.copy_}function _z(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ty(t,n)}function XA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var qf=(e,t)=>e.scope_===t,Az=[];function FA(e,t,n,a){const l=Ur(e),o=e.type_;if(a!==void 0&&Up(l,a,o)===t){Yc(l,a,n,o);return}if(!e.draftLocations_){const f=e.draftLocations_=new Map;zf(l,(d,h)=>{if(Gr(h)){const v=f.get(h)||[];v.push(d),f.set(h,v)}})}const c=e.draftLocations_.get(t)??Az;for(const f of c)Yc(l,f,n,o)}function Ez(e,t,n){e.callbacks_.push(function(l){const o=t;if(!o||!qf(o,l))return;l.mapSetPlugin_?.fixSetContents(o);const c=ey(o);FA(e,o.draft_??o,c,n),ZA(o,l)})}function ZA(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:a}=t;if(a){const l=a.getPath(e);l&&a.generatePatches_(e,l,t)}XA(e)}}function Nz(e,t,n){const{scope_:a}=e;if(Gr(n)){const l=n[nn];qf(l,a)&&l.callbacks_.push(function(){Nc(e);const c=ey(l);FA(e,n,c,t)})}else rr(n)&&e.callbacks_.push(function(){const o=Ur(e);e.type_===3?o.has(n)&&Vc(n,a.handledSet_,a):Up(o,t,e.type_)===n&&a.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Vc(Up(e.copy_,t,e.type_),a.handledSet_,a)})}function Vc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Gr(e)||t.has(e)||!rr(e)||$f(e)||(t.add(e),zf(e,(a,l)=>{if(Gr(l)){const o=l[nn];if(qf(o,n)){const c=ey(o);Yc(e,a,c,e.type_),XA(o)}}else rr(l)&&Vc(l,t,n)})),e}function Tz(e,t){const n=Rf(e),a={type_:n?1:0,scope_:t?t.scope_:VA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let l=a,o=Xc;n&&(l=[a],o=co);const{revoke:c,proxy:f}=Proxy.revocable(l,o);return a.draft_=f,a.revoke_=c,[f,a]}var Xc={get(e,t){if(t===nn)return e;let n=e.scope_.arrayMethodsPlugin_;const a=e.type_===1&&typeof t=="string";if(a&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const l=Ur(e);if(!Jw(l,t,e.type_))return Mz(e,l,t);const o=l[t];if(e.finalized_||!rr(o)||a&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Sz(t))return o;if(o===Hv(e.base_,t)){Nc(e);const c=e.type_===1?+t:t,f=Kp(e.scope_,o,e,c);return e.copy_[c]=f}return o},has(e,t){return t in Ur(e)},ownKeys(e){return Reflect.ownKeys(Ur(e))},set(e,t,n){const a=QA(Ur(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){const l=Hv(Ur(e),t),o=l?.[nn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(xz(n,l)&&(n!==void 0||Jw(e.base_,t,e.type_)))return!0;Nc(e),Hp(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),Nz(e,t,n)),!0},deleteProperty(e,t){return Nc(e),Hv(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Hp(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ur(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{[Ec]:!0,[Lp]:e.type_!==1||t!=="length",[Kc]:a[Kc],[oo]:n[t]}},defineProperty(){Jn(11)},getPrototypeOf(e){return Al(e.base_)},setPrototypeOf(){Jn(12)}},co={};for(let e in Xc){let t=Xc[e];co[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}co.deleteProperty=function(e,t){return co.set.call(this,e,t,void 0)};co.set=function(e,t,n){return Xc.set.call(this,e[0],t,n,e[0])};function Hv(e,t){const n=e[nn];return(n?Ur(n):e)[t]}function Mz(e,t,n){const a=QA(t,n);return a?oo in a?a[oo]:a.get?.call(e.draft_):void 0}function QA(e,t){if(!(t in e))return;let n=Al(e);for(;n;){const a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=Al(n)}}function Hp(e){e.modified_||(e.modified_=!0,e.parent_&&Hp(e.parent_))}function Nc(e){e.copy_||(e.assigned_=new Map,e.copy_=$p(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Cz=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,a,l)=>{if(gl(n)&&!gl(a)){const c=a;a=n;const f=this;return function(h=c,...v){return f.produce(h,p=>a.call(this,p,...v))}}gl(a)||Jn(6),l!==void 0&&!gl(l)&&Jn(7);let o;if(rr(n)){const c=rj(this),f=Kp(c,n,void 0);let d=!0;try{o=a(f),d=!1}finally{d?Bp(c):Ip(c)}return nj(c,l),aj(o,c)}else if(!n||!J0(n)){if(o=a(n),o===void 0&&(o=n),o===KA&&(o=void 0),this.autoFreeze_&&ty(o,!0),l){const c=[],f=[];Si(qp).generateReplacementPatches_(n,o,{patches_:c,inversePatches_:f}),l(c,f)}return o}else Jn(1,n)},this.produceWithPatches=(n,a)=>{if(gl(n))return(f,...d)=>this.produceWithPatches(f,h=>n(h,...d));let l,o;return[this.produce(n,a,(f,d)=>{l=f,o=d}),l,o]},Iv(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Iv(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Iv(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){rr(t)||Jn(8),Gr(t)&&(t=nr(t));const n=rj(this),a=Kp(n,t,void 0);return a[nn].isManual_=!0,Ip(n),a}finishDraft(t,n){const a=t&&t[nn];(!a||!a.isManual_)&&Jn(9);const{scope_:l}=a;return nj(l,n),aj(void 0,l)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let a;for(a=n.length-1;a>=0;a--){const o=n[a];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}a>-1&&(n=n.slice(a+1));const l=Si(qp).applyPatches_;return Gr(t)?l(t,n):this.produce(t,o=>l(o,n))}};function Kp(e,t,n,a){const[l,o]=Lf(t)?Si(Gc).proxyMap_(t,n):Uf(t)?Si(Gc).proxySet_(t,n):Tz(t,n);return(n?.scope_??VA()).drafts_.push(l),o.callbacks_=n?.callbacks_??[],o.key_=a,n&&a!==void 0?Ez(n,o,a):o.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:h}=d;o.modified_&&h&&h.generatePatches_(o,[],d)}),l}function nr(e){return Gr(e)||Jn(10,e),WA(e)}function WA(e){if(!rr(e)||$f(e))return e;const t=e[nn];let n,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=$p(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else n=$p(e,!0);return zf(n,(l,o)=>{Yc(n,l,WA(o))},a),t&&(t.finalized_=!1),n}var Dz=new Cz,JA=Dz.produce;function eE(e){return({dispatch:n,getState:a})=>l=>o=>typeof o=="function"?o(n,a,e):l(o)}var kz=eE(),Pz=eE,zz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ic:Ic.apply(null,arguments)};function Vn(e,t){function n(...a){if(t){let l=t(...a);if(!l)throw new Error(Tn(0));return{type:e,payload:l.payload,..."meta"in l&&{meta:l.meta},..."error"in l&&{error:l.error}}}return{type:e,payload:a[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=a=>HA(a)&&a.type===e,n}var tE=class Ju extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ju.prototype)}static get[Symbol.species](){return Ju}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ju(...t[0].concat(this)):new Ju(...t.concat(this))}};function lj(e){return rr(e)?JA(e,()=>{}):e}function hc(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Rz(e){return typeof e=="boolean"}var Lz=()=>function(t){const{thunk:n=!0,immutableCheck:a=!0,serializableCheck:l=!0,actionCreatorCheck:o=!0}=t??{};let c=new tE;return n&&(Rz(n)?c.push(kz):c.push(Pz(n.extraArgument))),c},nE="RTK_autoBatch",rt=()=>e=>({payload:e,meta:{[nE]:!0}}),uj=e=>t=>{setTimeout(t,e)},rE=(e={type:"raf"})=>t=>(...n)=>{const a=t(...n);let l=!0,o=!1,c=!1;const f=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:uj(10):e.type==="callback"?e.queueNotification:uj(e.timeout),h=()=>{c=!1,o&&(o=!1,f.forEach(v=>v()))};return Object.assign({},a,{subscribe(v){const p=()=>l&&v(),b=a.subscribe(p);return f.add(v),()=>{b(),f.delete(v)}},dispatch(v){try{return l=!v?.meta?.[nE],o=!l,o&&(c||(c=!0,d(h))),a.dispatch(v)}finally{l=!0}}})},Uz=e=>function(n){const{autoBatch:a=!0}=n??{};let l=new tE(e);return a&&l.push(rE(typeof a=="object"?a:void 0)),l};function $z(e){const t=Lz(),{reducer:n=void 0,middleware:a,devTools:l=!0,preloadedState:o=void 0,enhancers:c=void 0}=e||{};let f;if(typeof n=="function")f=n;else if(W0(n))f=IA(n);else throw new Error(Tn(1));let d;typeof a=="function"?d=a(t):d=t();let h=Ic;l&&(h=zz({trace:!1,...typeof l=="object"&&l}));const v=gz(...d),p=Uz(v);let b=typeof c=="function"?c(p):p();const x=h(...b);return BA(f,o,x)}function aE(e){const t={},n=[];let a;const l={addCase(o,c){const f=typeof o=="string"?o:o.type;if(!f)throw new Error(Tn(28));if(f in t)throw new Error(Tn(29));return t[f]=c,l},addAsyncThunk(o,c){return c.pending&&(t[o.pending.type]=c.pending),c.rejected&&(t[o.rejected.type]=c.rejected),c.fulfilled&&(t[o.fulfilled.type]=c.fulfilled),c.settled&&n.push({matcher:o.settled,reducer:c.settled}),l},addMatcher(o,c){return n.push({matcher:o,reducer:c}),l},addDefaultCase(o){return a=o,l}};return e(l),[t,n,a]}function qz(e){return typeof e=="function"}function Bz(e,t){let[n,a,l]=aE(t),o;if(qz(e))o=()=>lj(e());else{const f=lj(e);o=()=>f}function c(f=o(),d){let h=[n[d.type],...a.filter(({matcher:v})=>v(d)).map(({reducer:v})=>v)];return h.filter(v=>!!v).length===0&&(h=[l]),h.reduce((v,p)=>{if(p)if(Gr(v)){const x=p(v,d);return x===void 0?v:x}else{if(rr(v))return JA(v,b=>p(b,d));{const b=p(v,d);if(b===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}}return v},f)}return c.getInitialState=o,c}var Iz="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Hz=(e=21)=>{let t="",n=e;for(;n--;)t+=Iz[Math.random()*64|0];return t},Kz=Symbol.for("rtk-slice-createasyncthunk");function Yz(e,t){return`${e}/${t}`}function Gz({creators:e}={}){const t=e?.asyncThunk?.[Kz];return function(a){const{name:l,reducerPath:o=l}=a;if(!l)throw new Error(Tn(11));const c=(typeof a.reducers=="function"?a.reducers(Xz()):a.reducers)||{},f=Object.keys(c),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(T,C){const k=typeof T=="string"?T:T.type;if(!k)throw new Error(Tn(12));if(k in d.sliceCaseReducersByType)throw new Error(Tn(13));return d.sliceCaseReducersByType[k]=C,h},addMatcher(T,C){return d.sliceMatchers.push({matcher:T,reducer:C}),h},exposeAction(T,C){return d.actionCreators[T]=C,h},exposeCaseReducer(T,C){return d.sliceCaseReducersByName[T]=C,h}};f.forEach(T=>{const C=c[T],k={reducerName:T,type:Yz(l,T),createNotation:typeof a.reducers=="function"};Zz(C)?Wz(k,C,h,t):Fz(k,C,h)});function v(){const[T={},C=[],k=void 0]=typeof a.extraReducers=="function"?aE(a.extraReducers):[a.extraReducers],M={...T,...d.sliceCaseReducersByType};return Bz(a.initialState,L=>{for(let W in M)L.addCase(W,M[W]);for(let W of d.sliceMatchers)L.addMatcher(W.matcher,W.reducer);for(let W of C)L.addMatcher(W.matcher,W.reducer);k&&L.addDefaultCase(k)})}const p=T=>T,b=new Map,x=new WeakMap;let O;function j(T,C){return O||(O=v()),O(T,C)}function _(){return O||(O=v()),O.getInitialState()}function E(T,C=!1){function k(L){let W=L[T];return typeof W>"u"&&C&&(W=hc(x,k,_)),W}function M(L=p){const W=hc(b,C,()=>new WeakMap);return hc(W,L,()=>{const re={};for(const[H,$]of Object.entries(a.selectors??{}))re[H]=Vz($,L,()=>hc(x,L,_),C);return re})}return{reducerPath:T,getSelectors:M,get selectors(){return M(k)},selectSlice:k}}const N={name:l,reducer:j,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:_,...E(o),injectInto(T,{reducerPath:C,...k}={}){const M=C??o;return T.inject({reducerPath:M,reducer:j},k),{...N,...E(M,!0)}}};return N}}function Vz(e,t,n,a){function l(o,...c){let f=t(o);return typeof f>"u"&&a&&(f=n()),e(f,...c)}return l.unwrapped=e,l}var hn=Gz();function Xz(){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 Fz({type:e,reducerName:t,createNotation:n},a,l){let o,c;if("reducer"in a){if(n&&!Qz(a))throw new Error(Tn(17));o=a.reducer,c=a.prepare}else o=a;l.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,c?Vn(e,c):Vn(e))}function Zz(e){return e._reducerDefinitionType==="asyncThunk"}function Qz(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Wz({type:e,reducerName:t},n,a,l){if(!l)throw new Error(Tn(18));const{payloadCreator:o,fulfilled:c,pending:f,rejected:d,settled:h,options:v}=n,p=l(e,o,v);a.exposeAction(t,p),c&&a.addCase(p.fulfilled,c),f&&a.addCase(p.pending,f),d&&a.addCase(p.rejected,d),h&&a.addMatcher(p.settled,h),a.exposeCaseReducer(t,{fulfilled:c||mc,pending:f||mc,rejected:d||mc,settled:h||mc})}function mc(){}var Jz="task",iE="listener",lE="completed",ny="cancelled",e5=`task-${ny}`,t5=`task-${lE}`,Yp=`${iE}-${ny}`,n5=`${iE}-${lE}`,Bf=class{constructor(e){this.code=e,this.message=`${Jz} ${ny} (reason: ${e})`}name="TaskAbortError";message},ry=(e,t)=>{if(typeof e!="function")throw new TypeError(Tn(32))},Fc=()=>{},uE=(e,t=Fc)=>(e.catch(t),e),oE=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),pi=e=>{if(e.aborted)throw new Bf(e.reason)};function sE(e,t){let n=Fc;return new Promise((a,l)=>{const o=()=>l(new Bf(e.reason));if(e.aborted){o();return}n=oE(e,o),t.finally(()=>n()).then(a,l)}).finally(()=>{n=Fc})}var r5=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Bf?"cancelled":"rejected",error:n}}finally{t?.()}},Zc=e=>t=>uE(sE(e,t).then(n=>(pi(e),n))),cE=e=>{const t=Zc(e);return n=>t(new Promise(a=>setTimeout(a,n)))},{assign:jl}=Object,oj={},If="listenerMiddleware",a5=(e,t)=>{const n=a=>oE(e,()=>a.abort(e.reason));return(a,l)=>{ry(a);const o=new AbortController;n(o);const c=r5(async()=>{pi(e),pi(o.signal);const f=await a({pause:Zc(o.signal),delay:cE(o.signal),signal:o.signal});return pi(o.signal),f},()=>o.abort(t5));return l?.autoJoin&&t.push(c.catch(Fc)),{result:Zc(e)(c),cancel(){o.abort(e5)}}}},i5=(e,t)=>{const n=async(a,l)=>{pi(t);let o=()=>{};const f=[new Promise((d,h)=>{let v=e({predicate:a,effect:(p,b)=>{b.unsubscribe(),d([p,b.getState(),b.getOriginalState()])}});o=()=>{v(),h()}})];l!=null&&f.push(new Promise(d=>setTimeout(d,l,null)));try{const d=await sE(t,Promise.race(f));return pi(t),d}finally{o()}};return(a,l)=>uE(n(a,l))},fE=e=>{let{type:t,actionCreator:n,matcher:a,predicate:l,effect:o}=e;if(t)l=Vn(t).match;else if(n)t=n.type,l=n.match;else if(a)l=a;else if(!l)throw new Error(Tn(21));return ry(o),{predicate:l,type:t,effect:o}},dE=jl(e=>{const{type:t,predicate:n,effect:a}=fE(e);return{id:Hz(),effect:a,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Tn(22))}}},{withTypes:()=>dE}),sj=(e,t)=>{const{type:n,effect:a,predicate:l}=fE(t);return Array.from(e.values()).find(o=>(typeof n=="string"?o.type===n:o.predicate===l)&&o.effect===a)},Gp=e=>{e.pending.forEach(t=>{t.abort(Yp)})},l5=(e,t)=>()=>{for(const n of t.keys())Gp(n);e.clear()},cj=(e,t,n)=>{try{e(t,n)}catch(a){setTimeout(()=>{throw a},0)}},hE=jl(Vn(`${If}/add`),{withTypes:()=>hE}),u5=Vn(`${If}/removeAll`),mE=jl(Vn(`${If}/remove`),{withTypes:()=>mE}),o5=(...e)=>{console.error(`${If}/error`,...e)},Eo=(e={})=>{const t=new Map,n=new Map,a=x=>{const O=n.get(x)??0;n.set(x,O+1)},l=x=>{const O=n.get(x)??1;O===1?n.delete(x):n.set(x,O-1)},{extra:o,onError:c=o5}=e;ry(c);const f=x=>(x.unsubscribe=()=>t.delete(x.id),t.set(x.id,x),O=>{x.unsubscribe(),O?.cancelActive&&Gp(x)}),d=x=>{const O=sj(t,x)??dE(x);return f(O)};jl(d,{withTypes:()=>d});const h=x=>{const O=sj(t,x);return O&&(O.unsubscribe(),x.cancelActive&&Gp(O)),!!O};jl(h,{withTypes:()=>h});const v=async(x,O,j,_)=>{const E=new AbortController,N=i5(d,E.signal),T=[];try{x.pending.add(E),a(x),await Promise.resolve(x.effect(O,jl({},j,{getOriginalState:_,condition:(C,k)=>N(C,k).then(Boolean),take:N,delay:cE(E.signal),pause:Zc(E.signal),extra:o,signal:E.signal,fork:a5(E.signal,T),unsubscribe:x.unsubscribe,subscribe:()=>{t.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((C,k,M)=>{C!==E&&(C.abort(Yp),M.delete(C))})},cancel:()=>{E.abort(Yp),x.pending.delete(E)},throwIfCancelled:()=>{pi(E.signal)}})))}catch(C){C instanceof Bf||cj(c,C,{raisedBy:"effect"})}finally{await Promise.all(T),E.abort(n5),l(x),x.pending.delete(E)}},p=l5(t,n);return{middleware:x=>O=>j=>{if(!HA(j))return O(j);if(hE.match(j))return d(j.payload);if(u5.match(j)){p();return}if(mE.match(j))return h(j.payload);let _=x.getState();const E=()=>{if(_===oj)throw new Error(Tn(23));return _};let N;try{if(N=O(j),t.size>0){const T=x.getState(),C=Array.from(t.values());for(const k of C){let M=!1;try{M=k.predicate(j,T,_)}catch(L){M=!1,cj(c,L,{raisedBy:"predicate"})}M&&v(k,j,x,E)}}}finally{_=oj}return N},startListening:d,stopListening:h,clearListeners:p}};function Tn(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 s5={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},vE=hn({name:"chartLayout",initialState:s5,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,a,l,o;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(a=t.payload.right)!==null&&a!==void 0?a:0,e.margin.bottom=(l=t.payload.bottom)!==null&&l!==void 0?l:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:c5,setLayout:f5,setChartSize:d5,setScale:h5}=vE.actions,m5=vE.reducer;function pE(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function wt(e){return Number.isFinite(e)}function yr(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function fj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function bl(e){for(var t=1;t{if(t&&n){var{width:a,height:l}=n,{align:o,verticalAlign:c,layout:f}=t;if((f==="vertical"||f==="horizontal"&&c==="middle")&&o!=="center"&&me(e[o]))return bl(bl({},e),{},{[o]:e[o]+(a||0)});if((f==="horizontal"||f==="vertical"&&o==="center")&&c!=="middle"&&me(e[c]))return bl(bl({},e),{},{[c]:e[c]+(l||0)})}return e},$a=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",yE=(e,t,n,a)=>{if(a)return e.map(f=>f.coordinate);var l,o,c=e.map(f=>(f.coordinate===t&&(l=!0),f.coordinate===n&&(o=!0),f.coordinate));return l||c.push(t),o||c.push(n),c},gE=(e,t,n)=>{if(!e)return null;var{duplicateDomain:a,type:l,range:o,scale:c,realScaleType:f,isCategorical:d,categoricalDomain:h,tickCount:v,ticks:p,niceTicks:b,axisType:x}=e;if(!c)return null;var O=f==="scaleBand"&&c.bandwidth?c.bandwidth()/2:2,j=l==="category"&&c.bandwidth?c.bandwidth()/O:0;if(j=x==="angleAxis"&&o&&o.length>=2?Wt(o[0]-o[1])*2*j:j,p||b){var _=(p||b||[]).map((E,N)=>{var T=a?a.indexOf(E):E;return{coordinate:c(T)+j,value:E,offset:j,index:N}});return _.filter(E=>!vr(E.coordinate))}return d&&h?h.map((E,N)=>({coordinate:c(E)+j,value:E,index:N,offset:j})):c.ticks&&v!=null?c.ticks(v).map((E,N)=>({coordinate:c(E)+j,value:E,offset:j,index:N})):c.domain().map((E,N)=>({coordinate:c(E)+j,value:a?a[E]:E,index:N,offset:j}))},dj=1e-4,b5=e=>{var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,a=e.range(),l=Math.min(a[0],a[1])-dj,o=Math.max(a[0],a[1])+dj,c=e(t[0]),f=e(t[n-1]);(co||fo)&&e.domain([t[0],t[n-1]])}},x5=e=>{var t,n=e.length;if(!(n<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var l=0;l=0?(h[0]=o,h[1]=o+b,o=v):(h[0]=c,h[1]=c+b,c=v)}}}},S5=e=>{var t,n=e.length;if(!(n<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var l=0;l=0?(d[0]=o,d[1]=o+h,o=d[1]):(d[0]=0,d[1]=0)}}}},w5={sign:x5,expand:Bk,none:bi,silhouette:Ik,wiggle:Hk,positive:S5},j5=(e,t,n)=>{var a,l=(a=w5[n])!==null&&a!==void 0?a:bi,o=qk().keys(t).value((f,d)=>Number(tt(f,d,0))).order(zp).offset(l),c=o(e);return c.forEach((f,d)=>{f.forEach((h,v)=>{var p=tt(e[v],t[d],0);Array.isArray(p)&&p.length===2&&me(p[0])&&me(p[1])&&(h[0]=p[0],h[1]=p[1])})}),c};function hj(e){var{axis:t,ticks:n,bandSize:a,entry:l,index:o,dataKey:c}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!_t(l[t.dataKey])){var f=OA(n,"value",l[t.dataKey]);if(f)return f.coordinate+a/2}return n[o]?n[o].coordinate+a/2:null}var d=tt(l,_t(c)?t.dataKey:c);return _t(d)?null:t.scale(d)}var O5=e=>{var t=e.flat(2).filter(me);return[Math.min(...t),Math.max(...t)]},_5=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],A5=(e,t,n)=>{if(e!=null)return _5(Object.keys(e).reduce((a,l)=>{var o=e[l];if(!o)return a;var{stackedData:c}=o,f=c.reduce((d,h)=>{var v=pE(h,t,n),p=O5(v);return!wt(p[0])||!wt(p[1])?d:[Math.min(d[0],p[0]),Math.max(d[1],p[1])]},[1/0,-1/0]);return[Math.min(f[0],a[0]),Math.max(f[1],a[1])]},[1/0,-1/0]))},mj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Qc=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var a=e.scale.bandwidth();if(!n||a>0)return a}if(e&&t&&t.length>=2){for(var l=kf(t,v=>v.coordinate),o=1/0,c=1,f=l.length;c{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},N5=(e,t)=>t==="centric"?e.angle:e.radius,Wr=e=>e.layout.width,Jr=e=>e.layout.height,T5=e=>e.layout.scale,bE=e=>e.layout.margin,Kf=V(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Yf=V(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),xE="data-recharts-item-index",SE="data-recharts-item-id",No=60;function yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vc(e){for(var t=1;te.brush.height;function P5(e){var t=Yf(e);return t.reduce((n,a)=>{if(a.orientation==="left"&&!a.mirror&&!a.hide){var l=typeof a.width=="number"?a.width:No;return n+l}return n},0)}function z5(e){var t=Yf(e);return t.reduce((n,a)=>{if(a.orientation==="right"&&!a.mirror&&!a.hide){var l=typeof a.width=="number"?a.width:No;return n+l}return n},0)}function R5(e){var t=Kf(e);return t.reduce((n,a)=>a.orientation==="top"&&!a.mirror&&!a.hide?n+a.height:n,0)}function L5(e){var t=Kf(e);return t.reduce((n,a)=>a.orientation==="bottom"&&!a.mirror&&!a.hide?n+a.height:n,0)}var zt=V([Wr,Jr,bE,k5,P5,z5,R5,L5,$A,fz],(e,t,n,a,l,o,c,f,d,h)=>{var v={left:(n.left||0)+l,right:(n.right||0)+o},p={top:(n.top||0)+c,bottom:(n.bottom||0)+f},b=vc(vc({},p),v),x=b.bottom;b.bottom+=a,b=g5(b,d,h);var O=e-b.left-b.right,j=t-b.top-b.bottom;return vc(vc({brushBottom:x},b),{},{width:Math.max(O,0),height:Math.max(j,0)})}),U5=V(zt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),wE=V(Wr,Jr,(e,t)=>({x:0,y:0,width:e,height:t})),$5=S.createContext(null),mn=()=>S.useContext($5)!=null,Gf=e=>e.brush,Vf=V([Gf,zt,bE],(e,t,n)=>({height:e.height,x:me(e.x)?e.x:t.left,y:me(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:me(e.width)?e.width:t.width})),Kv={},Yv={},Gv={},gj;function q5(){return gj||(gj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a,{signal:l,edges:o}={}){let c,f=null;const d=o!=null&&o.includes("leading"),h=o==null||o.includes("trailing"),v=()=>{f!==null&&(n.apply(c,f),c=void 0,f=null)},p=()=>{h&&v(),j()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,p()},a)},O=()=>{b!==null&&(clearTimeout(b),b=null)},j=()=>{O(),c=void 0,f=null},_=()=>{v()},E=function(...N){if(l?.aborted)return;c=this,f=N;const T=b==null;x(),d&&T&&v()};return E.schedule=x,E.cancel=j,E.flush=_,l?.addEventListener("abort",j,{once:!0}),E}e.debounce=t})(Gv)),Gv}var bj;function B5(){return bj||(bj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q5();function n(a,l=0,o={}){typeof o!="object"&&(o={});const{leading:c=!1,trailing:f=!0,maxWait:d}=o,h=Array(2);c&&(h[0]="leading"),f&&(h[1]="trailing");let v,p=null;const b=t.debounce(function(...j){v=a.apply(this,j),p=null},l,{edges:h}),x=function(...j){return d!=null&&(p===null&&(p=Date.now()),Date.now()-p>=d)?(v=a.apply(this,j),p=Date.now(),b.cancel(),b.schedule(),v):(b.apply(this,j),v)},O=()=>(b.flush(),v);return x.cancel=b.cancel,x.flush=O,x}e.debounce=n})(Yv)),Yv}var xj;function I5(){return xj||(xj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=B5();function n(a,l=0,o={}){const{leading:c=!0,trailing:f=!0}=o;return t.debounce(a,l,{leading:c,maxWait:l,trailing:f})}e.throttle=n})(Kv)),Kv}var Vv,Sj;function H5(){return Sj||(Sj=1,Vv=I5().throttle),Vv}var K5=H5();const Y5=Qr(K5);var Wc=function(t,n){for(var a=arguments.length,l=new Array(a>2?a-2:0),o=2;ol[c++]))}},jE=(e,t,n)=>{var{width:a="100%",height:l="100%",aspect:o,maxHeight:c}=n,f=Yr(a)?e:Number(a),d=Yr(l)?t:Number(l);return o&&o>0&&(f?d=f/o:d&&(f=d*o),c&&d!=null&&d>c&&(d=c)),{calculatedWidth:f,calculatedHeight:d}},G5={width:0,height:0,overflow:"visible"},V5={width:0,overflowX:"visible"},X5={height:0,overflowY:"visible"},F5={},Z5=e=>{var{width:t,height:n}=e,a=Yr(t),l=Yr(n);return a&&l?G5:a?V5:l?X5:F5};function Q5(e){var{width:t,height:n,aspect:a}=e,l=t,o=n;return l===void 0&&o===void 0?(l="100%",o="100%"):l===void 0?l=a&&a>0?void 0:"100%":o===void 0&&(o=a&&a>0?void 0:"100%"),{width:l,height:o}}function Vp(){return Vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:a}),[n,a]);return tR(l)?S.createElement(OE.Provider,{value:l},t):null}var ay=()=>S.useContext(OE),nR=S.forwardRef((e,t)=>{var{aspect:n,initialDimension:a={width:-1,height:-1},width:l,height:o,minWidth:c=0,minHeight:f,maxHeight:d,children:h,debounce:v=0,id:p,className:b,onResize:x,style:O={}}=e,j=S.useRef(null),_=S.useRef();_.current=x,S.useImperativeHandle(t,()=>j.current);var[E,N]=S.useState({containerWidth:a.width,containerHeight:a.height}),T=S.useCallback((W,re)=>{N(H=>{var $=Math.round(W),K=Math.round(re);return H.containerWidth===$&&H.containerHeight===K?H:{containerWidth:$,containerHeight:K}})},[]);S.useEffect(()=>{if(j.current==null||typeof ResizeObserver>"u")return _o;var W=K=>{var ce,{width:ue,height:ve}=K[0].contentRect;T(ue,ve),(ce=_.current)===null||ce===void 0||ce.call(_,ue,ve)};v>0&&(W=Y5(W,v,{trailing:!0,leading:!1}));var re=new ResizeObserver(W),{width:H,height:$}=j.current.getBoundingClientRect();return T(H,$),re.observe(j.current),()=>{re.disconnect()}},[T,v]);var{containerWidth:C,containerHeight:k}=E;Wc(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:M,calculatedHeight:L}=jE(C,k,{width:l,height:o,aspect:n,maxHeight:d});return Wc(M!=null&&M>0||L!=null&&L>0,`The width(%s) and height(%s) of chart should be greater than 0, + A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(l),className:"recharts-legend-icon"});if(d==="rect")return S.createElement("path",{stroke:"none",fill:f,d:"M0,".concat(Kn/8,"h").concat(Kn,"v").concat(Kn*3/4,"h").concat(-Kn,"z"),className:"recharts-legend-icon"});if(S.isValidElement(t.legendIcon)){var v=dP({},t);return delete v.legendIcon,S.cloneElement(t.legendIcon,v)}return S.createElement(G0,{fill:f,cx:l,cy:l,size:Kn,sizeType:"diameter",type:d})}function gP(e){var{payload:t,iconSize:n,layout:a,formatter:l,inactiveColor:o,iconType:c}=e,f={x:0,y:0,width:Kn,height:Kn},d={display:a==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((v,p)=>{var b=v.formatter||l,x=Re({"recharts-legend-item":!0,["legend-item-".concat(p)]:!0,inactive:v.inactive});if(v.type==="none")return null;var O=v.inactive?o:v.color,j=b?b(v.value,v,p):v.value;return S.createElement("li",qc({className:x,style:d,key:"legend-item-".concat(p)},X0(e,v,p)),S.createElement($0,{width:n,height:n,viewBox:f,style:h,"aria-label":"".concat(j," legend icon")},S.createElement(yP,{data:v,iconType:c,inactiveColor:o})),S.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},j))})}var bP=e=>{var t=At(e,pP),{payload:n,layout:a,align:l}=t;if(!n||!n.length)return null;var o={padding:0,margin:0,textAlign:a==="horizontal"?l:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:o},S.createElement(gP,qc({},t,{payload:n})))},ev={},tv={},lw;function xP(){return lw||(lw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a){const l=new Map;for(let o=0;o=0}e.isLength=t})(lv)),lv}var cw;function F0(){return cw||(cw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wP();function n(a){return a!=null&&typeof a!="function"&&t.isLength(a.length)}e.isArrayLike=n})(iv)),iv}var uv={},fw;function jP(){return fw||(fw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(uv)),uv}var dw;function OP(){return dw||(dw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F0(),n=jP();function a(l){return n.isObjectLike(l)&&t.isArrayLike(l)}e.isArrayLikeObject=a})(av)),av}var ov={},sv={},hw;function _P(){return hw||(hw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Y0();function n(a){return function(l){return t.get(l,a)}}e.property=n})(sv)),sv}var cv={},fv={},dv={},hv={},mw;function NA(){return mw||(mw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(hv)),hv}var mv={},vw;function TA(){return vw||(vw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(mv)),mv}var vv={},pw;function MA(){return pw||(pw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a){return n===a||Number.isNaN(n)&&Number.isNaN(a)}e.isEqualsSameValueZero=t})(vv)),vv}var yw;function AP(){return yw||(yw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NA(),n=TA(),a=MA();function l(v,p,b){return typeof b!="function"?l(v,p,()=>{}):o(v,p,function x(O,j,_,N,E,T){const P=b(O,j,_,N,E,T);return P!==void 0?!!P:o(O,j,x,T)},new Map)}function o(v,p,b,x){if(p===v)return!0;switch(typeof p){case"object":return c(v,p,b,x);case"function":return Object.keys(p).length>0?o(v,{...p},b,x):a.isEqualsSameValueZero(v,p);default:return t.isObject(v)?typeof p=="string"?p==="":!0:a.isEqualsSameValueZero(v,p)}}function c(v,p,b,x){if(p==null)return!0;if(Array.isArray(p))return d(v,p,b,x);if(p instanceof Map)return f(v,p,b,x);if(p instanceof Set)return h(v,p,b,x);const O=Object.keys(p);if(v==null||n.isPrimitive(v))return O.length===0;if(O.length===0)return!0;if(x?.has(p))return x.get(p)===v;x?.set(p,v);try{for(let j=0;j{})}e.isMatch=n})(fv)),fv}var pv={},yv={},gv={},bw;function EP(){return bw||(bw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(a=>Object.prototype.propertyIsEnumerable.call(n,a))}e.getSymbols=t})(gv)),gv}var bv={},xw;function Z0(){return xw||(xw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(bv)),bv}var xv={},Sw;function DA(){return Sw||(Sw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",a="[object Number]",l="[object Boolean]",o="[object Arguments]",c="[object Symbol]",f="[object Date]",d="[object Map]",h="[object Set]",v="[object Array]",p="[object Function]",b="[object ArrayBuffer]",x="[object Object]",O="[object Error]",j="[object DataView]",_="[object Uint8Array]",N="[object Uint8ClampedArray]",E="[object Uint16Array]",T="[object Uint32Array]",P="[object BigUint64Array]",C="[object Int8Array]",M="[object Int16Array]",L="[object Int32Array]",Z="[object BigInt64Array]",re="[object Float32Array]",B="[object Float64Array]";e.argumentsTag=o,e.arrayBufferTag=b,e.arrayTag=v,e.bigInt64ArrayTag=Z,e.bigUint64ArrayTag=P,e.booleanTag=l,e.dataViewTag=j,e.dateTag=f,e.errorTag=O,e.float32ArrayTag=re,e.float64ArrayTag=B,e.functionTag=p,e.int16ArrayTag=M,e.int32ArrayTag=L,e.int8ArrayTag=C,e.mapTag=d,e.numberTag=a,e.objectTag=x,e.regexpTag=t,e.setTag=h,e.stringTag=n,e.symbolTag=c,e.uint16ArrayTag=E,e.uint32ArrayTag=T,e.uint8ArrayTag=_,e.uint8ClampedArrayTag=N})(xv)),xv}var Sv={},ww;function NP(){return ww||(ww=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Sv)),Sv}var jw;function kA(){return jw||(jw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=EP(),n=Z0(),a=DA(),l=TA(),o=NP();function c(v,p){return f(v,void 0,v,new Map,p)}function f(v,p,b,x=new Map,O=void 0){const j=O?.(v,p,b,x);if(j!==void 0)return j;if(l.isPrimitive(v))return v;if(x.has(v))return x.get(v);if(Array.isArray(v)){const _=new Array(v.length);x.set(v,_);for(let N=0;Nt.isMatch(o,l)}e.matches=a})(cv)),cv}var wv={},jv={},Ov={},Aw;function CP(){return Aw||(Aw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kA(),n=Z0(),a=DA();function l(o,c){return t.cloneDeepWith(o,(f,d,h,v)=>{const p=c?.(f,d,h,v);if(p!==void 0)return p;if(typeof o=="object"){if(n.getTag(o)===a.objectTag&&typeof o.constructor!="function"){const b={};return v.set(o,b),t.copyProperties(b,o,h,v),b}switch(Object.prototype.toString.call(o)){case a.numberTag:case a.stringTag:case a.booleanTag:{const b=new o.constructor(o?.valueOf());return t.copyProperties(b,o),b}case a.argumentsTag:{const b={};return t.copyProperties(b,o),b.length=o.length,b[Symbol.iterator]=o[Symbol.iterator],b}default:return}}})}e.cloneDeepWith=l})(Ov)),Ov}var Ew;function DP(){return Ew||(Ew=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CP();function n(a){return t.cloneDeepWith(a)}e.cloneDeep=n})(jv)),jv}var _v={},Av={},Nw;function PA(){return Nw||(Nw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(a,l=Number.MAX_SAFE_INTEGER){switch(typeof a){case"number":return Number.isInteger(a)&&a>=0&&a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return Dv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dv}var Lw;function BP(){return Lw||(Lw=1,Cv.exports=qP()),Cv.exports}var $w;function IP(){if($w)return Mv;$w=1;var e=kl(),t=BP();function n(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var a=typeof Object.is=="function"?Object.is:n,l=t.useSyncExternalStore,o=e.useRef,c=e.useEffect,f=e.useMemo,d=e.useDebugValue;return Mv.useSyncExternalStoreWithSelector=function(h,v,p,b,x){var O=o(null);if(O.current===null){var j={hasValue:!1,value:null};O.current=j}else j=O.current;O=f(function(){function N(M){if(!E){if(E=!0,T=M,M=b(M),x!==void 0&&j.hasValue){var L=j.value;if(x(L,M))return P=L}return P=M}if(L=P,a(T,M))return L;var Z=b(M);return x!==void 0&&x(L,Z)?(T=M,L):(T=M,P=Z)}var E=!1,T,P,C=p===void 0?null:p;return[function(){return N(v())},C===null?void 0:function(){return N(C())}]},[v,p,b,x]);var _=l(h,O[0],O[1]);return c(function(){j.hasValue=!0,j.value=_},[_]),d(_),_},Mv}var Uw;function HP(){return Uw||(Uw=1,Tv.exports=IP()),Tv.exports}var KP=HP(),Q0=S.createContext(null),YP=e=>e,Qe=()=>{var e=S.useContext(Q0);return e?e.store.dispatch:YP},Ac=()=>{},GP=()=>Ac,VP=(e,t)=>e===t;function de(e){var t=S.useContext(Q0);return KP.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:GP,t?t.store.getState:Ac,t?t.store.getState:Ac,t?e:Ac,VP)}function XP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function FP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ZP(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${t}[${n}]`)}}var qw=e=>Array.isArray(e)?e:[e];function QP(e){const t=Array.isArray(e[0])?e[0]:e;return ZP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function WP(e,t){const n=[],{length:a}=e;for(let l=0;l{n=cc(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}function nz(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,a=(...l)=>{let o=0,c=0,f,d={},h=l.pop();typeof h=="object"&&(d=h,h=l.pop()),XP(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const v={...n,...d},{memoize:p,memoizeOptions:b=[],argsMemoize:x=RA,argsMemoizeOptions:O=[]}=v,j=qw(b),_=qw(O),N=QP(l),E=p(function(){return o++,h.apply(null,arguments)},...j),T=x(function(){c++;const C=WP(N,arguments);return f=E.apply(null,C),f},..._);return Object.assign(T,{resultFunc:h,memoizedResultFunc:E,dependencies:N,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>f,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:p,argsMemoize:x})};return Object.assign(a,{withTypes:()=>a}),a}var V=nz(RA),rz=Object.assign((e,t=V)=>{FP(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),a=n.map(o=>e[o]);return t(a,(...o)=>o.reduce((c,f,d)=>(c[n[d]]=f,c),{}))},{withTypes:()=>rz}),kv={},Pv={},zv={},Iw;function az(){return Iw||(Iw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(a){return typeof a=="symbol"?1:a===null?2:a===void 0?3:a!==a?4:0}const n=(a,l,o)=>{if(a!==l){const c=t(a),f=t(l);if(c===f&&c===0){if(al)return o==="desc"?-1:1}return o==="desc"?f-c:c-f}return 0};e.compareValues=n})(zv)),zv}var Rv={},Lv={},Hw;function LA(){return Hw||(Hw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Lv)),Lv}var Kw;function iz(){return Kw||(Kw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LA(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function l(o,c){return Array.isArray(o)?!1:typeof o=="number"||typeof o=="boolean"||o==null||t.isSymbol(o)?!0:typeof o=="string"&&(a.test(o)||!n.test(o))||c!=null&&Object.hasOwn(c,o)}e.isKey=l})(Rv)),Rv}var Yw;function lz(){return Yw||(Yw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=az(),n=iz(),a=K0();function l(o,c,f,d){if(o==null)return[];f=d?void 0:f,Array.isArray(o)||(o=Object.values(o)),Array.isArray(c)||(c=c==null?[null]:[c]),c.length===0&&(c=[null]),Array.isArray(f)||(f=f==null?[]:[f]),f=f.map(x=>String(x));const h=(x,O)=>{let j=x;for(let _=0;_O==null||x==null?O:typeof x=="object"&&"key"in x?Object.hasOwn(O,x.key)?O[x.key]:h(O,x.path):typeof x=="function"?x(O):Array.isArray(x)?h(O,x):typeof O=="object"?O[x]:O,p=c.map(x=>(Array.isArray(x)&&x.length===1&&(x=x[0]),x==null||typeof x=="function"||Array.isArray(x)||n.isKey(x)?x:{key:x,path:a.toPath(x)}));return o.map(x=>({original:x,criteria:p.map(O=>v(O,x))})).slice().sort((x,O)=>{for(let j=0;jx.original)}e.orderBy=l})(Pv)),Pv}var $v={},Gw;function uz(){return Gw||(Gw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a=1){const l=[],o=Math.floor(a),c=(f,d)=>{for(let h=0;h1&&a.isIterateeCall(o,c[0],c[1])?c=[]:f>2&&a.isIterateeCall(c[0],c[1],c[2])&&(c=[c[0]]),t.orderBy(o,n.flatten(c),["asc"])}e.sortBy=l})(kv)),kv}var qv,Fw;function sz(){return Fw||(Fw=1,qv=oz().sortBy),qv}var cz=sz();const kf=Qr(cz);var UA=e=>e.legend.settings,fz=e=>e.legend.size,dz=e=>e.legend.payload,hz=V([dz,UA],(e,t)=>{var{itemSorter:n}=t,a=e.flat(1);return n?kf(a,n):a});function mz(){return de(hz)}var fc=1;function qA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=S.useState({height:0,left:0,top:0,width:0}),a=S.useCallback(l=>{if(l!=null){var o=l.getBoundingClientRect(),c={height:o.height,left:o.left,top:o.top,width:o.width};(Math.abs(c.height-t.height)>fc||Math.abs(c.left-t.left)>fc||Math.abs(c.top-t.top)>fc||Math.abs(c.width-t.width)>fc)&&n({height:c.height,left:c.left,top:c.top,width:c.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,a]}function Yt(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 vz=typeof Symbol=="function"&&Symbol.observable||"@@observable",Zw=vz,Bv=()=>Math.random().toString(36).substring(7).split("").join("."),pz={INIT:`@@redux/INIT${Bv()}`,REPLACE:`@@redux/REPLACE${Bv()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bv()}`},Bc=pz;function W0(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 BA(e,t,n){if(typeof e!="function")throw new Error(Yt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Yt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Yt(1));return n(BA)(e,t)}let a=e,l=t,o=new Map,c=o,f=0,d=!1;function h(){c===o&&(c=new Map,o.forEach((_,N)=>{c.set(N,_)}))}function v(){if(d)throw new Error(Yt(3));return l}function p(_){if(typeof _!="function")throw new Error(Yt(4));if(d)throw new Error(Yt(5));let N=!0;h();const E=f++;return c.set(E,_),function(){if(N){if(d)throw new Error(Yt(6));N=!1,h(),c.delete(E),o=null}}}function b(_){if(!W0(_))throw new Error(Yt(7));if(typeof _.type>"u")throw new Error(Yt(8));if(typeof _.type!="string")throw new Error(Yt(17));if(d)throw new Error(Yt(9));try{d=!0,l=a(l,_)}finally{d=!1}return(o=c).forEach(E=>{E()}),_}function x(_){if(typeof _!="function")throw new Error(Yt(10));a=_,b({type:Bc.REPLACE})}function O(){const _=p;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(Yt(11));function E(){const P=N;P.next&&P.next(v())}return E(),{unsubscribe:_(E)}},[Zw](){return this}}}return b({type:Bc.INIT}),{dispatch:b,subscribe:p,getState:v,replaceReducer:x,[Zw]:O}}function yz(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Bc.INIT})>"u")throw new Error(Yt(12));if(typeof n(void 0,{type:Bc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yt(13))})}function IA(e){const t=Object.keys(e),n={};for(let o=0;o"u")throw f&&f.type,new Error(Yt(14));h[p]=O,d=d||O!==x}return d=d||a.length!==Object.keys(c).length,d?h:c}}function Ic(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...a)=>t(n(...a)))}function gz(...e){return t=>(n,a)=>{const l=t(n,a);let o=()=>{throw new Error(Yt(15))};const c={getState:l.getState,dispatch:(d,...h)=>o(d,...h)},f=e.map(d=>d(c));return o=Ic(...f)(l.dispatch),{...l,dispatch:o}}}function HA(e){return W0(e)&&"type"in e&&typeof e.type=="string"}var KA=Symbol.for("immer-nothing"),Qw=Symbol.for("immer-draftable"),nn=Symbol.for("immer-state");function Jn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var En=Object,Al=En.getPrototypeOf,Hc="constructor",Pf="prototype",Lp="configurable",Kc="enumerable",Ec="writable",oo="value",Gr=e=>!!e&&!!e[nn];function rr(e){return e?YA(e)||Rf(e)||!!e[Qw]||!!e[Hc]?.[Qw]||Lf(e)||$f(e):!1}var bz=En[Pf][Hc].toString(),Ww=new WeakMap;function YA(e){if(!e||!J0(e))return!1;const t=Al(e);if(t===null||t===En[Pf])return!0;const n=En.hasOwnProperty.call(t,Hc)&&t[Hc];if(n===Object)return!0;if(!gl(n))return!1;let a=Ww.get(n);return a===void 0&&(a=Function.toString.call(n),Ww.set(n,a)),a===bz}function zf(e,t,n=!0){Ao(e)===0?(n?Reflect.ownKeys(e):En.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((a,l)=>t(l,a,e))}function Ao(e){const t=e[nn];return t?t.type_:Rf(e)?1:Lf(e)?2:$f(e)?3:0}var Jw=(e,t,n=Ao(e))=>n===2?e.has(t):En[Pf].hasOwnProperty.call(e,t),$p=(e,t,n=Ao(e))=>n===2?e.get(t):e[t],Yc=(e,t,n,a=Ao(e))=>{a===2?e.set(t,n):a===3?e.add(n):e[t]=n};function xz(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Rf=Array.isArray,Lf=e=>e instanceof Map,$f=e=>e instanceof Set,J0=e=>typeof e=="object",gl=e=>typeof e=="function",Iv=e=>typeof e=="boolean";function Sz(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var $r=e=>e.copy_||e.base_,ey=e=>e.modified_?e.copy_:e.base_;function Up(e,t){if(Lf(e))return new Map(e);if($f(e))return new Set(e);if(Rf(e))return Array[Pf].slice.call(e);const n=YA(e);if(t===!0||t==="class_only"&&!n){const a=En.getOwnPropertyDescriptors(e);delete a[nn];let l=Reflect.ownKeys(a);for(let o=0;o1&&En.defineProperties(e,{set:dc,add:dc,clear:dc,delete:dc}),En.freeze(e),t&&zf(e,(n,a)=>{ty(a,!0)},!1)),e}function wz(){Jn(2)}var dc={[oo]:wz};function Uf(e){return e===null||!J0(e)?!0:En.isFrozen(e)}var Gc="MapSet",qp="Patches",ej="ArrayMethods",GA={};function Si(e){const t=GA[e];return t||Jn(0,e),t}var tj=e=>!!GA[e],so,VA=()=>so,jz=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:tj(Gc)?Si(Gc):void 0,arrayMethodsPlugin_:tj(ej)?Si(ej):void 0});function nj(e,t){t&&(e.patchPlugin_=Si(qp),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bp(e){Ip(e),e.drafts_.forEach(Oz),e.drafts_=null}function Ip(e){e===so&&(so=e.parent_)}var rj=e=>so=jz(so,e);function Oz(e){const t=e[nn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function aj(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[nn].modified_&&(Bp(t),Jn(4)),rr(e)&&(e=ij(t,e));const{patchPlugin_:l}=t;l&&l.generateReplacementPatches_(n[nn].base_,e,t)}else e=ij(t,n);return _z(t,e,!0),Bp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==KA?e:void 0}function ij(e,t){if(Uf(t))return t;const n=t[nn];if(!n)return Vc(t,e.handledSet_,e);if(!qf(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:a}=n;if(a)for(;a.length>0;)a.pop()(e);ZA(n,e)}return n.copy_}function _z(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ty(t,n)}function XA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var qf=(e,t)=>e.scope_===t,Az=[];function FA(e,t,n,a){const l=$r(e),o=e.type_;if(a!==void 0&&$p(l,a,o)===t){Yc(l,a,n,o);return}if(!e.draftLocations_){const f=e.draftLocations_=new Map;zf(l,(d,h)=>{if(Gr(h)){const v=f.get(h)||[];v.push(d),f.set(h,v)}})}const c=e.draftLocations_.get(t)??Az;for(const f of c)Yc(l,f,n,o)}function Ez(e,t,n){e.callbacks_.push(function(l){const o=t;if(!o||!qf(o,l))return;l.mapSetPlugin_?.fixSetContents(o);const c=ey(o);FA(e,o.draft_??o,c,n),ZA(o,l)})}function ZA(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:a}=t;if(a){const l=a.getPath(e);l&&a.generatePatches_(e,l,t)}XA(e)}}function Nz(e,t,n){const{scope_:a}=e;if(Gr(n)){const l=n[nn];qf(l,a)&&l.callbacks_.push(function(){Nc(e);const c=ey(l);FA(e,n,c,t)})}else rr(n)&&e.callbacks_.push(function(){const o=$r(e);e.type_===3?o.has(n)&&Vc(n,a.handledSet_,a):$p(o,t,e.type_)===n&&a.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Vc($p(e.copy_,t,e.type_),a.handledSet_,a)})}function Vc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Gr(e)||t.has(e)||!rr(e)||Uf(e)||(t.add(e),zf(e,(a,l)=>{if(Gr(l)){const o=l[nn];if(qf(o,n)){const c=ey(o);Yc(e,a,c,e.type_),XA(o)}}else rr(l)&&Vc(l,t,n)})),e}function Tz(e,t){const n=Rf(e),a={type_:n?1:0,scope_:t?t.scope_:VA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let l=a,o=Xc;n&&(l=[a],o=co);const{revoke:c,proxy:f}=Proxy.revocable(l,o);return a.draft_=f,a.revoke_=c,[f,a]}var Xc={get(e,t){if(t===nn)return e;let n=e.scope_.arrayMethodsPlugin_;const a=e.type_===1&&typeof t=="string";if(a&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const l=$r(e);if(!Jw(l,t,e.type_))return Mz(e,l,t);const o=l[t];if(e.finalized_||!rr(o)||a&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Sz(t))return o;if(o===Hv(e.base_,t)){Nc(e);const c=e.type_===1?+t:t,f=Kp(e.scope_,o,e,c);return e.copy_[c]=f}return o},has(e,t){return t in $r(e)},ownKeys(e){return Reflect.ownKeys($r(e))},set(e,t,n){const a=QA($r(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){const l=Hv($r(e),t),o=l?.[nn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(xz(n,l)&&(n!==void 0||Jw(e.base_,t,e.type_)))return!0;Nc(e),Hp(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),Nz(e,t,n)),!0},deleteProperty(e,t){return Nc(e),Hv(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Hp(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=$r(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{[Ec]:!0,[Lp]:e.type_!==1||t!=="length",[Kc]:a[Kc],[oo]:n[t]}},defineProperty(){Jn(11)},getPrototypeOf(e){return Al(e.base_)},setPrototypeOf(){Jn(12)}},co={};for(let e in Xc){let t=Xc[e];co[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}co.deleteProperty=function(e,t){return co.set.call(this,e,t,void 0)};co.set=function(e,t,n){return Xc.set.call(this,e[0],t,n,e[0])};function Hv(e,t){const n=e[nn];return(n?$r(n):e)[t]}function Mz(e,t,n){const a=QA(t,n);return a?oo in a?a[oo]:a.get?.call(e.draft_):void 0}function QA(e,t){if(!(t in e))return;let n=Al(e);for(;n;){const a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=Al(n)}}function Hp(e){e.modified_||(e.modified_=!0,e.parent_&&Hp(e.parent_))}function Nc(e){e.copy_||(e.assigned_=new Map,e.copy_=Up(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Cz=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,a,l)=>{if(gl(n)&&!gl(a)){const c=a;a=n;const f=this;return function(h=c,...v){return f.produce(h,p=>a.call(this,p,...v))}}gl(a)||Jn(6),l!==void 0&&!gl(l)&&Jn(7);let o;if(rr(n)){const c=rj(this),f=Kp(c,n,void 0);let d=!0;try{o=a(f),d=!1}finally{d?Bp(c):Ip(c)}return nj(c,l),aj(o,c)}else if(!n||!J0(n)){if(o=a(n),o===void 0&&(o=n),o===KA&&(o=void 0),this.autoFreeze_&&ty(o,!0),l){const c=[],f=[];Si(qp).generateReplacementPatches_(n,o,{patches_:c,inversePatches_:f}),l(c,f)}return o}else Jn(1,n)},this.produceWithPatches=(n,a)=>{if(gl(n))return(f,...d)=>this.produceWithPatches(f,h=>n(h,...d));let l,o;return[this.produce(n,a,(f,d)=>{l=f,o=d}),l,o]},Iv(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Iv(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Iv(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){rr(t)||Jn(8),Gr(t)&&(t=nr(t));const n=rj(this),a=Kp(n,t,void 0);return a[nn].isManual_=!0,Ip(n),a}finishDraft(t,n){const a=t&&t[nn];(!a||!a.isManual_)&&Jn(9);const{scope_:l}=a;return nj(l,n),aj(void 0,l)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let a;for(a=n.length-1;a>=0;a--){const o=n[a];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}a>-1&&(n=n.slice(a+1));const l=Si(qp).applyPatches_;return Gr(t)?l(t,n):this.produce(t,o=>l(o,n))}};function Kp(e,t,n,a){const[l,o]=Lf(t)?Si(Gc).proxyMap_(t,n):$f(t)?Si(Gc).proxySet_(t,n):Tz(t,n);return(n?.scope_??VA()).drafts_.push(l),o.callbacks_=n?.callbacks_??[],o.key_=a,n&&a!==void 0?Ez(n,o,a):o.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:h}=d;o.modified_&&h&&h.generatePatches_(o,[],d)}),l}function nr(e){return Gr(e)||Jn(10,e),WA(e)}function WA(e){if(!rr(e)||Uf(e))return e;const t=e[nn];let n,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Up(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else n=Up(e,!0);return zf(n,(l,o)=>{Yc(n,l,WA(o))},a),t&&(t.finalized_=!1),n}var Dz=new Cz,JA=Dz.produce;function eE(e){return({dispatch:n,getState:a})=>l=>o=>typeof o=="function"?o(n,a,e):l(o)}var kz=eE(),Pz=eE,zz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ic:Ic.apply(null,arguments)};function Vn(e,t){function n(...a){if(t){let l=t(...a);if(!l)throw new Error(Tn(0));return{type:e,payload:l.payload,..."meta"in l&&{meta:l.meta},..."error"in l&&{error:l.error}}}return{type:e,payload:a[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=a=>HA(a)&&a.type===e,n}var tE=class Ju extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ju.prototype)}static get[Symbol.species](){return Ju}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ju(...t[0].concat(this)):new Ju(...t.concat(this))}};function lj(e){return rr(e)?JA(e,()=>{}):e}function hc(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Rz(e){return typeof e=="boolean"}var Lz=()=>function(t){const{thunk:n=!0,immutableCheck:a=!0,serializableCheck:l=!0,actionCreatorCheck:o=!0}=t??{};let c=new tE;return n&&(Rz(n)?c.push(kz):c.push(Pz(n.extraArgument))),c},nE="RTK_autoBatch",rt=()=>e=>({payload:e,meta:{[nE]:!0}}),uj=e=>t=>{setTimeout(t,e)},rE=(e={type:"raf"})=>t=>(...n)=>{const a=t(...n);let l=!0,o=!1,c=!1;const f=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:uj(10):e.type==="callback"?e.queueNotification:uj(e.timeout),h=()=>{c=!1,o&&(o=!1,f.forEach(v=>v()))};return Object.assign({},a,{subscribe(v){const p=()=>l&&v(),b=a.subscribe(p);return f.add(v),()=>{b(),f.delete(v)}},dispatch(v){try{return l=!v?.meta?.[nE],o=!l,o&&(c||(c=!0,d(h))),a.dispatch(v)}finally{l=!0}}})},$z=e=>function(n){const{autoBatch:a=!0}=n??{};let l=new tE(e);return a&&l.push(rE(typeof a=="object"?a:void 0)),l};function Uz(e){const t=Lz(),{reducer:n=void 0,middleware:a,devTools:l=!0,preloadedState:o=void 0,enhancers:c=void 0}=e||{};let f;if(typeof n=="function")f=n;else if(W0(n))f=IA(n);else throw new Error(Tn(1));let d;typeof a=="function"?d=a(t):d=t();let h=Ic;l&&(h=zz({trace:!1,...typeof l=="object"&&l}));const v=gz(...d),p=$z(v);let b=typeof c=="function"?c(p):p();const x=h(...b);return BA(f,o,x)}function aE(e){const t={},n=[];let a;const l={addCase(o,c){const f=typeof o=="string"?o:o.type;if(!f)throw new Error(Tn(28));if(f in t)throw new Error(Tn(29));return t[f]=c,l},addAsyncThunk(o,c){return c.pending&&(t[o.pending.type]=c.pending),c.rejected&&(t[o.rejected.type]=c.rejected),c.fulfilled&&(t[o.fulfilled.type]=c.fulfilled),c.settled&&n.push({matcher:o.settled,reducer:c.settled}),l},addMatcher(o,c){return n.push({matcher:o,reducer:c}),l},addDefaultCase(o){return a=o,l}};return e(l),[t,n,a]}function qz(e){return typeof e=="function"}function Bz(e,t){let[n,a,l]=aE(t),o;if(qz(e))o=()=>lj(e());else{const f=lj(e);o=()=>f}function c(f=o(),d){let h=[n[d.type],...a.filter(({matcher:v})=>v(d)).map(({reducer:v})=>v)];return h.filter(v=>!!v).length===0&&(h=[l]),h.reduce((v,p)=>{if(p)if(Gr(v)){const x=p(v,d);return x===void 0?v:x}else{if(rr(v))return JA(v,b=>p(b,d));{const b=p(v,d);if(b===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}}return v},f)}return c.getInitialState=o,c}var Iz="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Hz=(e=21)=>{let t="",n=e;for(;n--;)t+=Iz[Math.random()*64|0];return t},Kz=Symbol.for("rtk-slice-createasyncthunk");function Yz(e,t){return`${e}/${t}`}function Gz({creators:e}={}){const t=e?.asyncThunk?.[Kz];return function(a){const{name:l,reducerPath:o=l}=a;if(!l)throw new Error(Tn(11));const c=(typeof a.reducers=="function"?a.reducers(Xz()):a.reducers)||{},f=Object.keys(c),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(T,P){const C=typeof T=="string"?T:T.type;if(!C)throw new Error(Tn(12));if(C in d.sliceCaseReducersByType)throw new Error(Tn(13));return d.sliceCaseReducersByType[C]=P,h},addMatcher(T,P){return d.sliceMatchers.push({matcher:T,reducer:P}),h},exposeAction(T,P){return d.actionCreators[T]=P,h},exposeCaseReducer(T,P){return d.sliceCaseReducersByName[T]=P,h}};f.forEach(T=>{const P=c[T],C={reducerName:T,type:Yz(l,T),createNotation:typeof a.reducers=="function"};Zz(P)?Wz(C,P,h,t):Fz(C,P,h)});function v(){const[T={},P=[],C=void 0]=typeof a.extraReducers=="function"?aE(a.extraReducers):[a.extraReducers],M={...T,...d.sliceCaseReducersByType};return Bz(a.initialState,L=>{for(let Z in M)L.addCase(Z,M[Z]);for(let Z of d.sliceMatchers)L.addMatcher(Z.matcher,Z.reducer);for(let Z of P)L.addMatcher(Z.matcher,Z.reducer);C&&L.addDefaultCase(C)})}const p=T=>T,b=new Map,x=new WeakMap;let O;function j(T,P){return O||(O=v()),O(T,P)}function _(){return O||(O=v()),O.getInitialState()}function N(T,P=!1){function C(L){let Z=L[T];return typeof Z>"u"&&P&&(Z=hc(x,C,_)),Z}function M(L=p){const Z=hc(b,P,()=>new WeakMap);return hc(Z,L,()=>{const re={};for(const[B,U]of Object.entries(a.selectors??{}))re[B]=Vz(U,L,()=>hc(x,L,_),P);return re})}return{reducerPath:T,getSelectors:M,get selectors(){return M(C)},selectSlice:C}}const E={name:l,reducer:j,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:_,...N(o),injectInto(T,{reducerPath:P,...C}={}){const M=P??o;return T.inject({reducerPath:M,reducer:j},C),{...E,...N(M,!0)}}};return E}}function Vz(e,t,n,a){function l(o,...c){let f=t(o);return typeof f>"u"&&a&&(f=n()),e(f,...c)}return l.unwrapped=e,l}var hn=Gz();function Xz(){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 Fz({type:e,reducerName:t,createNotation:n},a,l){let o,c;if("reducer"in a){if(n&&!Qz(a))throw new Error(Tn(17));o=a.reducer,c=a.prepare}else o=a;l.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,c?Vn(e,c):Vn(e))}function Zz(e){return e._reducerDefinitionType==="asyncThunk"}function Qz(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Wz({type:e,reducerName:t},n,a,l){if(!l)throw new Error(Tn(18));const{payloadCreator:o,fulfilled:c,pending:f,rejected:d,settled:h,options:v}=n,p=l(e,o,v);a.exposeAction(t,p),c&&a.addCase(p.fulfilled,c),f&&a.addCase(p.pending,f),d&&a.addCase(p.rejected,d),h&&a.addMatcher(p.settled,h),a.exposeCaseReducer(t,{fulfilled:c||mc,pending:f||mc,rejected:d||mc,settled:h||mc})}function mc(){}var Jz="task",iE="listener",lE="completed",ny="cancelled",e5=`task-${ny}`,t5=`task-${lE}`,Yp=`${iE}-${ny}`,n5=`${iE}-${lE}`,Bf=class{constructor(e){this.code=e,this.message=`${Jz} ${ny} (reason: ${e})`}name="TaskAbortError";message},ry=(e,t)=>{if(typeof e!="function")throw new TypeError(Tn(32))},Fc=()=>{},uE=(e,t=Fc)=>(e.catch(t),e),oE=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),pi=e=>{if(e.aborted)throw new Bf(e.reason)};function sE(e,t){let n=Fc;return new Promise((a,l)=>{const o=()=>l(new Bf(e.reason));if(e.aborted){o();return}n=oE(e,o),t.finally(()=>n()).then(a,l)}).finally(()=>{n=Fc})}var r5=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Bf?"cancelled":"rejected",error:n}}finally{t?.()}},Zc=e=>t=>uE(sE(e,t).then(n=>(pi(e),n))),cE=e=>{const t=Zc(e);return n=>t(new Promise(a=>setTimeout(a,n)))},{assign:jl}=Object,oj={},If="listenerMiddleware",a5=(e,t)=>{const n=a=>oE(e,()=>a.abort(e.reason));return(a,l)=>{ry(a);const o=new AbortController;n(o);const c=r5(async()=>{pi(e),pi(o.signal);const f=await a({pause:Zc(o.signal),delay:cE(o.signal),signal:o.signal});return pi(o.signal),f},()=>o.abort(t5));return l?.autoJoin&&t.push(c.catch(Fc)),{result:Zc(e)(c),cancel(){o.abort(e5)}}}},i5=(e,t)=>{const n=async(a,l)=>{pi(t);let o=()=>{};const f=[new Promise((d,h)=>{let v=e({predicate:a,effect:(p,b)=>{b.unsubscribe(),d([p,b.getState(),b.getOriginalState()])}});o=()=>{v(),h()}})];l!=null&&f.push(new Promise(d=>setTimeout(d,l,null)));try{const d=await sE(t,Promise.race(f));return pi(t),d}finally{o()}};return(a,l)=>uE(n(a,l))},fE=e=>{let{type:t,actionCreator:n,matcher:a,predicate:l,effect:o}=e;if(t)l=Vn(t).match;else if(n)t=n.type,l=n.match;else if(a)l=a;else if(!l)throw new Error(Tn(21));return ry(o),{predicate:l,type:t,effect:o}},dE=jl(e=>{const{type:t,predicate:n,effect:a}=fE(e);return{id:Hz(),effect:a,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Tn(22))}}},{withTypes:()=>dE}),sj=(e,t)=>{const{type:n,effect:a,predicate:l}=fE(t);return Array.from(e.values()).find(o=>(typeof n=="string"?o.type===n:o.predicate===l)&&o.effect===a)},Gp=e=>{e.pending.forEach(t=>{t.abort(Yp)})},l5=(e,t)=>()=>{for(const n of t.keys())Gp(n);e.clear()},cj=(e,t,n)=>{try{e(t,n)}catch(a){setTimeout(()=>{throw a},0)}},hE=jl(Vn(`${If}/add`),{withTypes:()=>hE}),u5=Vn(`${If}/removeAll`),mE=jl(Vn(`${If}/remove`),{withTypes:()=>mE}),o5=(...e)=>{console.error(`${If}/error`,...e)},Eo=(e={})=>{const t=new Map,n=new Map,a=x=>{const O=n.get(x)??0;n.set(x,O+1)},l=x=>{const O=n.get(x)??1;O===1?n.delete(x):n.set(x,O-1)},{extra:o,onError:c=o5}=e;ry(c);const f=x=>(x.unsubscribe=()=>t.delete(x.id),t.set(x.id,x),O=>{x.unsubscribe(),O?.cancelActive&&Gp(x)}),d=x=>{const O=sj(t,x)??dE(x);return f(O)};jl(d,{withTypes:()=>d});const h=x=>{const O=sj(t,x);return O&&(O.unsubscribe(),x.cancelActive&&Gp(O)),!!O};jl(h,{withTypes:()=>h});const v=async(x,O,j,_)=>{const N=new AbortController,E=i5(d,N.signal),T=[];try{x.pending.add(N),a(x),await Promise.resolve(x.effect(O,jl({},j,{getOriginalState:_,condition:(P,C)=>E(P,C).then(Boolean),take:E,delay:cE(N.signal),pause:Zc(N.signal),extra:o,signal:N.signal,fork:a5(N.signal,T),unsubscribe:x.unsubscribe,subscribe:()=>{t.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((P,C,M)=>{P!==N&&(P.abort(Yp),M.delete(P))})},cancel:()=>{N.abort(Yp),x.pending.delete(N)},throwIfCancelled:()=>{pi(N.signal)}})))}catch(P){P instanceof Bf||cj(c,P,{raisedBy:"effect"})}finally{await Promise.all(T),N.abort(n5),l(x),x.pending.delete(N)}},p=l5(t,n);return{middleware:x=>O=>j=>{if(!HA(j))return O(j);if(hE.match(j))return d(j.payload);if(u5.match(j)){p();return}if(mE.match(j))return h(j.payload);let _=x.getState();const N=()=>{if(_===oj)throw new Error(Tn(23));return _};let E;try{if(E=O(j),t.size>0){const T=x.getState(),P=Array.from(t.values());for(const C of P){let M=!1;try{M=C.predicate(j,T,_)}catch(L){M=!1,cj(c,L,{raisedBy:"predicate"})}M&&v(C,j,x,N)}}}finally{_=oj}return E},startListening:d,stopListening:h,clearListeners:p}};function Tn(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 s5={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},vE=hn({name:"chartLayout",initialState:s5,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,a,l,o;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(a=t.payload.right)!==null&&a!==void 0?a:0,e.margin.bottom=(l=t.payload.bottom)!==null&&l!==void 0?l:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:c5,setLayout:f5,setChartSize:d5,setScale:h5}=vE.actions,m5=vE.reducer;function pE(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function wt(e){return Number.isFinite(e)}function yr(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function fj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function bl(e){for(var t=1;t{if(t&&n){var{width:a,height:l}=n,{align:o,verticalAlign:c,layout:f}=t;if((f==="vertical"||f==="horizontal"&&c==="middle")&&o!=="center"&&me(e[o]))return bl(bl({},e),{},{[o]:e[o]+(a||0)});if((f==="horizontal"||f==="vertical"&&o==="center")&&c!=="middle"&&me(e[c]))return bl(bl({},e),{},{[c]:e[c]+(l||0)})}return e},Ua=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",yE=(e,t,n,a)=>{if(a)return e.map(f=>f.coordinate);var l,o,c=e.map(f=>(f.coordinate===t&&(l=!0),f.coordinate===n&&(o=!0),f.coordinate));return l||c.push(t),o||c.push(n),c},gE=(e,t,n)=>{if(!e)return null;var{duplicateDomain:a,type:l,range:o,scale:c,realScaleType:f,isCategorical:d,categoricalDomain:h,tickCount:v,ticks:p,niceTicks:b,axisType:x}=e;if(!c)return null;var O=f==="scaleBand"&&c.bandwidth?c.bandwidth()/2:2,j=l==="category"&&c.bandwidth?c.bandwidth()/O:0;if(j=x==="angleAxis"&&o&&o.length>=2?Wt(o[0]-o[1])*2*j:j,p||b){var _=(p||b||[]).map((N,E)=>{var T=a?a.indexOf(N):N;return{coordinate:c(T)+j,value:N,offset:j,index:E}});return _.filter(N=>!vr(N.coordinate))}return d&&h?h.map((N,E)=>({coordinate:c(N)+j,value:N,index:E,offset:j})):c.ticks&&v!=null?c.ticks(v).map((N,E)=>({coordinate:c(N)+j,value:N,offset:j,index:E})):c.domain().map((N,E)=>({coordinate:c(N)+j,value:a?a[N]:N,index:E,offset:j}))},dj=1e-4,b5=e=>{var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,a=e.range(),l=Math.min(a[0],a[1])-dj,o=Math.max(a[0],a[1])+dj,c=e(t[0]),f=e(t[n-1]);(co||fo)&&e.domain([t[0],t[n-1]])}},x5=e=>{var t,n=e.length;if(!(n<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var l=0;l=0?(h[0]=o,h[1]=o+b,o=v):(h[0]=c,h[1]=c+b,c=v)}}}},S5=e=>{var t,n=e.length;if(!(n<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var l=0;l=0?(d[0]=o,d[1]=o+h,o=d[1]):(d[0]=0,d[1]=0)}}}},w5={sign:x5,expand:Bk,none:bi,silhouette:Ik,wiggle:Hk,positive:S5},j5=(e,t,n)=>{var a,l=(a=w5[n])!==null&&a!==void 0?a:bi,o=qk().keys(t).value((f,d)=>Number(tt(f,d,0))).order(zp).offset(l),c=o(e);return c.forEach((f,d)=>{f.forEach((h,v)=>{var p=tt(e[v],t[d],0);Array.isArray(p)&&p.length===2&&me(p[0])&&me(p[1])&&(h[0]=p[0],h[1]=p[1])})}),c};function hj(e){var{axis:t,ticks:n,bandSize:a,entry:l,index:o,dataKey:c}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!_t(l[t.dataKey])){var f=OA(n,"value",l[t.dataKey]);if(f)return f.coordinate+a/2}return n[o]?n[o].coordinate+a/2:null}var d=tt(l,_t(c)?t.dataKey:c);return _t(d)?null:t.scale(d)}var O5=e=>{var t=e.flat(2).filter(me);return[Math.min(...t),Math.max(...t)]},_5=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],A5=(e,t,n)=>{if(e!=null)return _5(Object.keys(e).reduce((a,l)=>{var o=e[l];if(!o)return a;var{stackedData:c}=o,f=c.reduce((d,h)=>{var v=pE(h,t,n),p=O5(v);return!wt(p[0])||!wt(p[1])?d:[Math.min(d[0],p[0]),Math.max(d[1],p[1])]},[1/0,-1/0]);return[Math.min(f[0],a[0]),Math.max(f[1],a[1])]},[1/0,-1/0]))},mj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Qc=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var a=e.scale.bandwidth();if(!n||a>0)return a}if(e&&t&&t.length>=2){for(var l=kf(t,v=>v.coordinate),o=1/0,c=1,f=l.length;c{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},N5=(e,t)=>t==="centric"?e.angle:e.radius,Wr=e=>e.layout.width,Jr=e=>e.layout.height,T5=e=>e.layout.scale,bE=e=>e.layout.margin,Kf=V(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Yf=V(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),xE="data-recharts-item-index",SE="data-recharts-item-id",No=60;function yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vc(e){for(var t=1;te.brush.height;function P5(e){var t=Yf(e);return t.reduce((n,a)=>{if(a.orientation==="left"&&!a.mirror&&!a.hide){var l=typeof a.width=="number"?a.width:No;return n+l}return n},0)}function z5(e){var t=Yf(e);return t.reduce((n,a)=>{if(a.orientation==="right"&&!a.mirror&&!a.hide){var l=typeof a.width=="number"?a.width:No;return n+l}return n},0)}function R5(e){var t=Kf(e);return t.reduce((n,a)=>a.orientation==="top"&&!a.mirror&&!a.hide?n+a.height:n,0)}function L5(e){var t=Kf(e);return t.reduce((n,a)=>a.orientation==="bottom"&&!a.mirror&&!a.hide?n+a.height:n,0)}var zt=V([Wr,Jr,bE,k5,P5,z5,R5,L5,UA,fz],(e,t,n,a,l,o,c,f,d,h)=>{var v={left:(n.left||0)+l,right:(n.right||0)+o},p={top:(n.top||0)+c,bottom:(n.bottom||0)+f},b=vc(vc({},p),v),x=b.bottom;b.bottom+=a,b=g5(b,d,h);var O=e-b.left-b.right,j=t-b.top-b.bottom;return vc(vc({brushBottom:x},b),{},{width:Math.max(O,0),height:Math.max(j,0)})}),$5=V(zt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),wE=V(Wr,Jr,(e,t)=>({x:0,y:0,width:e,height:t})),U5=S.createContext(null),mn=()=>S.useContext(U5)!=null,Gf=e=>e.brush,Vf=V([Gf,zt,bE],(e,t,n)=>({height:e.height,x:me(e.x)?e.x:t.left,y:me(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:me(e.width)?e.width:t.width})),Kv={},Yv={},Gv={},gj;function q5(){return gj||(gj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,a,{signal:l,edges:o}={}){let c,f=null;const d=o!=null&&o.includes("leading"),h=o==null||o.includes("trailing"),v=()=>{f!==null&&(n.apply(c,f),c=void 0,f=null)},p=()=>{h&&v(),j()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,p()},a)},O=()=>{b!==null&&(clearTimeout(b),b=null)},j=()=>{O(),c=void 0,f=null},_=()=>{v()},N=function(...E){if(l?.aborted)return;c=this,f=E;const T=b==null;x(),d&&T&&v()};return N.schedule=x,N.cancel=j,N.flush=_,l?.addEventListener("abort",j,{once:!0}),N}e.debounce=t})(Gv)),Gv}var bj;function B5(){return bj||(bj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q5();function n(a,l=0,o={}){typeof o!="object"&&(o={});const{leading:c=!1,trailing:f=!0,maxWait:d}=o,h=Array(2);c&&(h[0]="leading"),f&&(h[1]="trailing");let v,p=null;const b=t.debounce(function(...j){v=a.apply(this,j),p=null},l,{edges:h}),x=function(...j){return d!=null&&(p===null&&(p=Date.now()),Date.now()-p>=d)?(v=a.apply(this,j),p=Date.now(),b.cancel(),b.schedule(),v):(b.apply(this,j),v)},O=()=>(b.flush(),v);return x.cancel=b.cancel,x.flush=O,x}e.debounce=n})(Yv)),Yv}var xj;function I5(){return xj||(xj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=B5();function n(a,l=0,o={}){const{leading:c=!0,trailing:f=!0}=o;return t.debounce(a,l,{leading:c,maxWait:l,trailing:f})}e.throttle=n})(Kv)),Kv}var Vv,Sj;function H5(){return Sj||(Sj=1,Vv=I5().throttle),Vv}var K5=H5();const Y5=Qr(K5);var Wc=function(t,n){for(var a=arguments.length,l=new Array(a>2?a-2:0),o=2;ol[c++]))}},jE=(e,t,n)=>{var{width:a="100%",height:l="100%",aspect:o,maxHeight:c}=n,f=Yr(a)?e:Number(a),d=Yr(l)?t:Number(l);return o&&o>0&&(f?d=f/o:d&&(f=d*o),c&&d!=null&&d>c&&(d=c)),{calculatedWidth:f,calculatedHeight:d}},G5={width:0,height:0,overflow:"visible"},V5={width:0,overflowX:"visible"},X5={height:0,overflowY:"visible"},F5={},Z5=e=>{var{width:t,height:n}=e,a=Yr(t),l=Yr(n);return a&&l?G5:a?V5:l?X5:F5};function Q5(e){var{width:t,height:n,aspect:a}=e,l=t,o=n;return l===void 0&&o===void 0?(l="100%",o="100%"):l===void 0?l=a&&a>0?void 0:"100%":o===void 0&&(o=a&&a>0?void 0:"100%"),{width:l,height:o}}function Vp(){return Vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:a}),[n,a]);return tR(l)?S.createElement(OE.Provider,{value:l},t):null}var ay=()=>S.useContext(OE),nR=S.forwardRef((e,t)=>{var{aspect:n,initialDimension:a={width:-1,height:-1},width:l,height:o,minWidth:c=0,minHeight:f,maxHeight:d,children:h,debounce:v=0,id:p,className:b,onResize:x,style:O={}}=e,j=S.useRef(null),_=S.useRef();_.current=x,S.useImperativeHandle(t,()=>j.current);var[N,E]=S.useState({containerWidth:a.width,containerHeight:a.height}),T=S.useCallback((Z,re)=>{E(B=>{var U=Math.round(Z),K=Math.round(re);return B.containerWidth===U&&B.containerHeight===K?B:{containerWidth:U,containerHeight:K}})},[]);S.useEffect(()=>{if(j.current==null||typeof ResizeObserver>"u")return _o;var Z=K=>{var ce,{width:ue,height:ve}=K[0].contentRect;T(ue,ve),(ce=_.current)===null||ce===void 0||ce.call(_,ue,ve)};v>0&&(Z=Y5(Z,v,{trailing:!0,leading:!1}));var re=new ResizeObserver(Z),{width:B,height:U}=j.current.getBoundingClientRect();return T(B,U),re.observe(j.current),()=>{re.disconnect()}},[T,v]);var{containerWidth:P,containerHeight:C}=N;Wc(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:M,calculatedHeight:L}=jE(P,C,{width:l,height:o,aspect:n,maxHeight:d});return Wc(M!=null&&M>0||L!=null&&L>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,M,L,l,o,c,f,n),S.createElement("div",{id:p?"".concat(p):void 0,className:Re("recharts-responsive-container",b),style:jj(jj({},O),{},{width:l,height:o,minWidth:c,minHeight:f,maxHeight:d}),ref:j},S.createElement("div",{style:Z5({width:l,height:o})},S.createElement(_E,{width:M,height:L},h)))}),to=S.forwardRef((e,t)=>{var n=ay();if(yr(n.width)&&yr(n.height))return e.children;var{width:a,height:l}=Q5({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:o,calculatedHeight:c}=jE(void 0,void 0,{width:a,height:l,aspect:e.aspect,maxHeight:e.maxHeight});return me(o)&&me(c)?S.createElement(_E,{width:o,height:c},e.children):S.createElement(nR,Vp({},e,{width:a,height:l,ref:t}))});function AE(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 Xf=()=>{var e,t=mn(),n=de(U5),a=de(Vf),l=(e=de(Gf))===null||e===void 0?void 0:e.padding;return!t||!a||!l?n:{width:a.width-l.left-l.right,height:a.height-l.top-l.bottom,x:l.left,y:l.top}},rR={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},EE=()=>{var e;return(e=de(zt))!==null&&e!==void 0?e:rR},iy=()=>de(Wr),ly=()=>de(Jr),aR=()=>de(e=>e.layout.margin),Ge=e=>e.layout.layoutType,To=()=>de(Ge),iR=()=>{var e=To();return e!==void 0},Ff=e=>{var t=Qe(),n=mn(),{width:a,height:l}=e,o=ay(),c=a,f=l;return o&&(c=o.width>0?o.width:a,f=o.height>0?o.height:l),S.useEffect(()=>{!n&&yr(c)&&yr(f)&&t(d5({width:c,height:f}))},[t,n,c,f]),null},NE=Symbol.for("immer-nothing"),Oj=Symbol.for("immer-draftable"),Mn=Symbol.for("immer-state");function er(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fo=Object.getPrototypeOf;function El(e){return!!e&&!!e[Mn]}function wi(e){return e?TE(e)||Array.isArray(e)||!!e[Oj]||!!e.constructor?.[Oj]||Mo(e)||Qf(e):!1}var lR=Object.prototype.constructor.toString(),_j=new WeakMap;function TE(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 a=_j.get(n);return a===void 0&&(a=Function.toString.call(n),_j.set(n,a)),a===lR}function Jc(e,t,n=!0){Zf(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((a,l)=>t(l,a,e))}function Zf(e){const t=e[Mn];return t?t.type_:Array.isArray(e)?1:Mo(e)?2:Qf(e)?3:0}function Xp(e,t){return Zf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ME(e,t,n){const a=Zf(e);a===2?e.set(t,n):a===3?e.add(n):e[t]=n}function uR(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Mo(e){return e instanceof Map}function Qf(e){return e instanceof Set}function si(e){return e.copy_||e.base_}function Fp(e,t){if(Mo(e))return new Map(e);if(Qf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=TE(e);if(t===!0||t==="class_only"&&!n){const a=Object.getOwnPropertyDescriptors(e);delete a[Mn];let l=Reflect.ownKeys(a);for(let o=0;o1&&Object.defineProperties(e,{set:pc,add:pc,clear:pc,delete:pc}),Object.freeze(e),t&&Object.values(e).forEach(n=>uy(n,!0))),e}function oR(){er(2)}var pc={value:oR};function Wf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var sR={};function ji(e){const t=sR[e];return t||er(0,e),t}var ho;function CE(){return ho}function cR(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Aj(e,t){t&&(ji("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zp(e){Qp(e),e.drafts_.forEach(fR),e.drafts_=null}function Qp(e){e===ho&&(ho=e.parent_)}function Ej(e){return ho=cR(ho,e)}function fR(e){const t=e[Mn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Nj(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Mn].modified_&&(Zp(t),er(4)),wi(e)&&(e=ef(t,e),t.parent_||tf(t,e)),t.patches_&&ji("Patches").generateReplacementPatches_(n[Mn].base_,e,t.patches_,t.inversePatches_)):e=ef(t,n,[]),Zp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==NE?e:void 0}function ef(e,t,n){if(Wf(t))return t;const a=e.immer_.shouldUseStrictIteration(),l=t[Mn];if(!l)return Jc(t,(o,c)=>Tj(e,l,t,o,c,n),a),t;if(l.scope_!==e)return t;if(!l.modified_)return tf(e,l.base_,!0),l.base_;if(!l.finalized_){l.finalized_=!0,l.scope_.unfinalizedDrafts_--;const o=l.copy_;let c=o,f=!1;l.type_===3&&(c=new Set(o),o.clear(),f=!0),Jc(c,(d,h)=>Tj(e,l,o,d,h,n,f),a),tf(e,o,!1),n&&e.patches_&&ji("Patches").generatePatches_(l,n,e.patches_,e.inversePatches_)}return l.copy_}function Tj(e,t,n,a,l,o,c){if(l==null||typeof l!="object"&&!c)return;const f=Wf(l);if(!(f&&!c)){if(El(l)){const d=o&&t&&t.type_!==3&&!Xp(t.assigned_,a)?o.concat(a):void 0,h=ef(e,l,d);if(ME(n,a,h),El(h))e.canAutoFreeze_=!1;else return}else c&&n.add(l);if(wi(l)&&!f){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[a]===l&&f)return;ef(e,l),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&(Mo(n)?n.has(a):Object.prototype.propertyIsEnumerable.call(n,a))&&tf(e,l)}}}function tf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uy(t,n)}function dR(e,t){const n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:CE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let l=a,o=oy;n&&(l=[a],o=mo);const{revoke:c,proxy:f}=Proxy.revocable(l,o);return a.draft_=f,a.revoke_=c,f}var oy={get(e,t){if(t===Mn)return e;const n=si(e);if(!Xp(n,t))return hR(e,n,t);const a=n[t];return e.finalized_||!wi(a)?a:a===Xv(e.base_,t)?(Fv(e),e.copy_[t]=Jp(a,e)):a},has(e,t){return t in si(e)},ownKeys(e){return Reflect.ownKeys(si(e))},set(e,t,n){const a=DE(si(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){const l=Xv(si(e),t),o=l?.[Mn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(uR(n,l)&&(n!==void 0||Xp(e.base_,t)))return!0;Fv(e),Wp(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 Xv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Fv(e),Wp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=si(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:n[t]}},defineProperty(){er(11)},getPrototypeOf(e){return fo(e.base_)},setPrototypeOf(){er(12)}},mo={};Jc(oy,(e,t)=>{mo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});mo.deleteProperty=function(e,t){return mo.set.call(this,e,t,void 0)};mo.set=function(e,t,n){return oy.set.call(this,e[0],t,n,e[0])};function Xv(e,t){const n=e[Mn];return(n?si(n):e)[t]}function hR(e,t,n){const a=DE(t,n);return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}function DE(e,t){if(!(t in e))return;let n=fo(e);for(;n;){const a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=fo(n)}}function Wp(e){e.modified_||(e.modified_=!0,e.parent_&&Wp(e.parent_))}function Fv(e){e.copy_||(e.copy_=Fp(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var mR=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,a)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const c=this;return function(d=o,...h){return c.produce(d,v=>n.call(this,v,...h))}}typeof n!="function"&&er(6),a!==void 0&&typeof a!="function"&&er(7);let l;if(wi(t)){const o=Ej(this),c=Jp(t,void 0);let f=!0;try{l=n(c),f=!1}finally{f?Zp(o):Qp(o)}return Aj(o,a),Nj(l,o)}else if(!t||typeof t!="object"){if(l=n(t),l===void 0&&(l=t),l===NE&&(l=void 0),this.autoFreeze_&&uy(l,!0),a){const o=[],c=[];ji("Patches").generateReplacementPatches_(t,l,o,c),a(o,c)}return l}else er(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(c,...f)=>this.produceWithPatches(c,d=>t(d,...f));let a,l;return[this.produce(t,n,(c,f)=>{a=c,l=f}),a,l]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){wi(e)||er(8),El(e)&&(e=vR(e));const t=Ej(this),n=Jp(e,void 0);return n[Mn].isManual_=!0,Qp(t),n}finishDraft(e,t){const n=e&&e[Mn];(!n||!n.isManual_)&&er(9);const{scope_:a}=n;return Aj(a,t),Nj(void 0,a)}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 l=t[n];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}n>-1&&(t=t.slice(n+1));const a=ji("Patches").applyPatches_;return El(e)?a(e,t):this.produce(e,l=>a(l,t))}};function Jp(e,t){const n=Mo(e)?ji("MapSet").proxyMap_(e,t):Qf(e)?ji("MapSet").proxySet_(e,t):dR(e,t);return(t?t.scope_:CE()).drafts_.push(n),n}function vR(e){return El(e)||er(10,e),kE(e)}function kE(e){if(!wi(e)||Wf(e))return e;const t=e[Mn];let n,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Fp(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else n=Fp(e,!0);return Jc(n,(l,o)=>{ME(n,l,kE(o))},a),t&&(t.finalized_=!1),n}var pR=new mR;pR.produce;var yR={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},PE=hn({name:"legend",initialState:yR,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:rt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).payload.indexOf(n);l>-1&&(e.payload[l]=a)},prepare:rt()},removeLegendPayload:{reducer(e,t){var n=nr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:rt()}}}),{setLegendSize:Mj,setLegendSettings:gR,addLegendPayload:zE,replaceLegendPayload:RE,removeLegendPayload:LE}=PE.actions,bR=PE.reducer,xR=["contextPayload"];function e0(){return e0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(gR(e))},[t,e]),null}function MR(e){var t=Qe();return S.useEffect(()=>(t(Mj(e)),()=>{t(Mj({width:0,height:0}))}),[t,e]),null}function CR(e,t,n,a){return e==="vertical"&&me(t)?{height:t}:e==="horizontal"?{width:n||a}:null}var DR={align:"center",iconSize:14,itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function UE(e){var t=At(e,DR),n=mz(),a=ck(),l=aR(),{width:o,height:c,wrapperStyle:f,portal:d}=t,[h,v]=qA([n]),p=iy(),b=ly();if(p==null||b==null)return null;var x=p-(l?.left||0)-(l?.right||0),O=CR(t.layout,c,o,x),j=d?f:Nl(Nl({position:"absolute",width:O?.width||o||"auto",height:O?.height||c||"auto"},NR(f,t,l,p,b,h)),f),_=d??a;if(_==null||n==null)return null;var E=S.createElement("div",{className:"recharts-legend-wrapper",style:j,ref:v},S.createElement(TR,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&S.createElement(MR,{width:h.width,height:h.height}),S.createElement(ER,e0({},t,O,{margin:l,chartWidth:p,chartHeight:b,contextPayload:n})));return $0.createPortal(E,_)}UE.displayName="Legend";function t0(){return t0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=" : ",contentStyle:n={},itemStyle:a={},labelStyle:l={},payload:o,formatter:c,itemSorter:f,wrapperClassName:d,labelClassName:h,label:v,labelFormatter:p,accessibilityLayer:b=!1}=e,x=()=>{if(o&&o.length){var k={padding:0,margin:0},M=(f?kf(o,f):o).map((L,W)=>{if(L.type==="none")return null;var re=L.formatter||c||RR,{value:H,name:$}=L,K=H,ce=$;if(re){var ue=re(H,$,L,W,o);if(Array.isArray(ue))[K,ce]=ue;else if(ue!=null)K=ue;else return null}var ve=Zv({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},a);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(W),style:ve},pr(ce)?S.createElement("span",{className:"recharts-tooltip-item-name"},ce):null,pr(ce)?S.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,S.createElement("span",{className:"recharts-tooltip-item-value"},K),S.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:k},M)}return null},O=Zv({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},n),j=Zv({margin:0},l),_=!_t(v),E=_?v:"",N=Re("recharts-default-tooltip",d),T=Re("recharts-tooltip-label",h);_&&p&&o!==void 0&&o!==null&&(E=p(v,o));var C=b?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",t0({className:N,style:O},C),S.createElement("p",{className:T,style:j},S.isValidElement(E)?E:"".concat(E)),x())},qu="recharts-tooltip-wrapper",UR={visibility:"hidden"};function $R(e){var{coordinate:t,translateX:n,translateY:a}=e;return Re(qu,{["".concat(qu,"-right")]:me(n)&&t&&me(t.x)&&n>=t.x,["".concat(qu,"-left")]:me(n)&&t&&me(t.x)&&n=t.y,["".concat(qu,"-top")]:me(a)&&t&&me(t.y)&&a0?l:0),p=n[a]+l;if(t[a])return c[a]?v:p;var b=d[a];if(b==null)return 0;if(c[a]){var x=v,O=b;return x_?Math.max(v,b):Math.max(p,b)}function qR(e){var{translateX:t,translateY:n,useTranslate3d:a}=e;return{transform:a?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function BR(e){var{allowEscapeViewBox:t,coordinate:n,offsetTopLeft:a,position:l,reverseDirection:o,tooltipBox:c,useTranslate3d:f,viewBox:d}=e,h,v,p;return c.height>0&&c.width>0&&n?(v=kj({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:a,position:l,reverseDirection:o,tooltipDimension:c.width,viewBox:d,viewBoxDimension:d.width}),p=kj({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:a,position:l,reverseDirection:o,tooltipDimension:c.height,viewBox:d,viewBoxDimension:d.height}),h=qR({translateX:v,translateY:p,useTranslate3d:f})):h=UR,{cssProperties:h,cssClasses:$R({translateX:v,translateY:p,coordinate:n})}}function Pj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function yc(e){for(var t=1;t{if(t.key==="Escape"){var n,a,l,o;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(a=this.props.coordinate)===null||a===void 0?void 0:a.x)!==null&&n!==void 0?n:0,y:(l=(o=this.props.coordinate)===null||o===void 0?void 0:o.y)!==null&&l!==void 0?l:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:a,animationEasing:l,children:o,coordinate:c,hasPayload:f,isAnimationActive:d,offset:h,position:v,reverseDirection:p,useTranslate3d:b,viewBox:x,wrapperStyle:O,lastBoundingBox:j,innerRef:_,hasPortalFromProps:E}=this.props,{cssClasses:N,cssProperties:T}=BR({allowEscapeViewBox:n,coordinate:c,offsetTopLeft:h,position:v,reverseDirection:p,tooltipBox:{height:j.height,width:j.width},useTranslate3d:b,viewBox:x}),C=E?{}:yc(yc({transition:d&&t?"transform ".concat(a,"ms ").concat(l):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&f?"visible":"hidden",position:"absolute",top:0,left:0}),k=yc(yc({},C),{},{visibility:!this.state.dismissed&&t&&f?"visible":"hidden"},O);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:N,style:k,ref:_},o)}}var $E=()=>{var e;return(e=de(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function r0(){return r0=Object.assign?Object.assign.bind():function(e){for(var t=1;twt(e.x)&&wt(e.y),Uj=e=>e.base!=null&&nf(e.base)&&nf(e),Bu=e=>e.x,Iu=e=>e.y,XR=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Oo(e));return(n==="curveMonotone"||n==="curveBump")&&t?Lj["".concat(n).concat(t==="vertical"?"Y":"X")]:Lj[n]||Cf},FR=e=>{var{type:t="linear",points:n=[],baseLine:a,layout:l,connectNulls:o=!1}=e,c=XR(t,l),f=o?n.filter(nf):n,d;if(Array.isArray(a)){var h=n.map((x,O)=>Rj(Rj({},x),{},{base:a[O]}));l==="vertical"?d=sc().y(Iu).x1(Bu).x0(x=>x.base.x):d=sc().x(Bu).y1(Iu).y0(x=>x.base.y);var v=d.defined(Uj).curve(c),p=o?h.filter(Uj):h;return v(p)}l==="vertical"&&me(a)?d=sc().y(Iu).x1(Bu).x0(a):me(a)?d=sc().x(Bu).y1(Iu).y0(a):d=fA().x(Bu).y(Iu);var b=d.defined(nf).curve(c);return b(f)},sy=e=>{var{className:t,points:n,path:a,pathRef:l}=e,o=To();if((!n||!n.length)&&!a)return null;var c={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},f=n&&n.length?FR(c):a;return S.createElement("path",r0({},Gn(e),V0(e),{className:Re("recharts-curve",t),d:f===null?void 0:f,ref:l}))},ZR=["x","y","top","left","width","height","className"];function a0(){return a0=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(l,"v").concat(a,"M").concat(o,",").concat(t,"h").concat(n),a6=e=>{var{x:t=0,y:n=0,top:a=0,left:l=0,width:o=0,height:c=0,className:f}=e,d=t6(e,ZR),h=QR({x:t,y:n,top:a,left:l,width:o,height:c},d);return!me(t)||!me(n)||!me(o)||!me(c)||!me(a)||!me(l)?null:S.createElement("path",a0({},tn(h),{className:Re("recharts-cross",f),d:r6(t,n,o,c,a,l)}))};function i6(e,t,n,a){var l=a/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-l:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-l,width:e==="horizontal"?a:n.width-1,height:e==="horizontal"?n.height-1:a}}function qj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Bj(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),qE=(e,t,n)=>e.map(a=>"".concat(s6(a)," ").concat(t,"ms ").concat(n)).join(","),c6=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,a)=>n.filter(l=>a.includes(l))),vo=(e,t)=>Object.keys(t).reduce((n,a)=>Bj(Bj({},n),{},{[a]:e(a,t[a])}),{});function Ij(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Ot(e){for(var t=1;te+(t-e)*n,i0=e=>{var{from:t,to:n}=e;return t!==n},BE=(e,t,n)=>{var a=vo((l,o)=>{if(i0(o)){var[c,f]=e(o.from,o.to,o.velocity);return Ot(Ot({},o),{},{from:c,velocity:f})}return o},t);return n<1?vo((l,o)=>i0(o)&&a[l]!=null?Ot(Ot({},o),{},{velocity:rf(o.velocity,a[l].velocity,n),from:rf(o.from,a[l].from,n)}):o,t):BE(e,a,n-1)};function m6(e,t,n,a,l,o){var c,f=a.reduce((b,x)=>Ot(Ot({},b),{},{[x]:{from:e[x],velocity:0,to:t[x]}}),{}),d=()=>vo((b,x)=>x.from,f),h=()=>!Object.values(f).filter(i0).length,v=null,p=b=>{c||(c=b);var x=b-c,O=x/n.dt;f=BE(n,f,O),l(Ot(Ot(Ot({},e),t),d())),c=b,h()||(v=o.setTimeout(p))};return()=>(v=o.setTimeout(p),()=>{var b;(b=v)===null||b===void 0||b()})}function v6(e,t,n,a,l,o,c){var f=null,d=l.reduce((p,b)=>{var x=e[b],O=t[b];return x==null||O==null?p:Ot(Ot({},p),{},{[b]:[x,O]})},{}),h,v=p=>{h||(h=p);var b=(p-h)/a,x=vo((j,_)=>rf(..._,n(b)),d);if(o(Ot(Ot(Ot({},e),t),x)),b<1)f=c.setTimeout(v);else{var O=vo((j,_)=>rf(..._,n(1)),d);o(Ot(Ot(Ot({},e),t),O))}};return()=>(f=c.setTimeout(v),()=>{var p;(p=f)===null||p===void 0||p()})}const p6=(e,t,n,a,l,o)=>{var c=c6(e,t);return n==null?()=>(l(Ot(Ot({},e),t)),()=>{}):n.isStepper===!0?m6(e,t,n,c,l,o):v6(e,t,n,a,c,l,o)};var af=1e-4,IE=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],HE=(e,t)=>e.map((n,a)=>n*t**a).reduce((n,a)=>n+a),Hj=(e,t)=>n=>{var a=IE(e,t);return HE(a,n)},y6=(e,t)=>n=>{var a=IE(e,t),l=[...a.map((o,c)=>o*c).slice(1),0];return HE(l,n)},g6=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var a=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(a==null||a.length!==4)return null;var l=a.map(o=>parseFloat(o));return[l[0],l[1],l[2],l[3]]},b6=function(){for(var t=arguments.length,n=new Array(t),a=0;a{var l=Hj(e,n),o=Hj(t,a),c=y6(e,n),f=h=>h>1?1:h<0?0:h,d=h=>{for(var v=h>1?1:h,p=v,b=0;b<8;++b){var x=l(p)-v,O=c(p);if(Math.abs(x-v)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:a=8,dt:l=17}=t,o=(c,f,d)=>{var h=-(c-f)*n,v=d*a,p=d+(h-v)*l/1e3,b=d*l/1e3+c;return Math.abs(b-f){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Kj(e);case"spring":return S6();default:if(e.split("(")[0]==="cubic-bezier")return Kj(e)}return typeof e=="function"?e:null};function j6(e){var t,n=()=>null,a=!1,l=null,o=c=>{if(!a){if(Array.isArray(c)){if(!c.length)return;var f=c,[d,...h]=f;if(typeof d=="number"){l=e.setTimeout(o.bind(null,h),d);return}o(d),l=e.setTimeout(o.bind(null,h));return}typeof c=="string"&&(t=c,n(t)),typeof c=="object"&&(t=c,n(t)),typeof c=="function"&&c()}};return{stop:()=>{a=!0},start:c=>{a=!1,l&&(l(),l=null),o(c)},subscribe:c=>(n=c,()=>{n=()=>null}),getTimeoutController:()=>e}}class O6{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=performance.now(),l=null,o=c=>{c-a>=n?t(c):typeof requestAnimationFrame=="function"&&(l=requestAnimationFrame(o))};return l=requestAnimationFrame(o),()=>{l!=null&&cancelAnimationFrame(l)}}}function _6(){return j6(new O6)}var A6=S.createContext(_6);function E6(e,t){var n=S.useContext(A6);return S.useMemo(()=>t??n(e),[e,t,n])}var N6=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Jf={isSsr:N6()},T6={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Yj={t:0},Qv={t:1};function ed(e){var t=At(e,T6),{isActive:n,canBegin:a,duration:l,easing:o,begin:c,onAnimationEnd:f,onAnimationStart:d,children:h}=t,v=n==="auto"?!Jf.isSsr:n,p=E6(t.animationId,t.animationManager),[b,x]=S.useState(v?Yj:Qv),O=S.useRef(null);return S.useEffect(()=>{v||x(Qv)},[v]),S.useEffect(()=>{if(!v||!a)return _o;var j=p6(Yj,Qv,w6(o),l,x,p.getTimeoutController()),_=()=>{O.current=j()};return p.start([d,c,_,l,f]),()=>{p.stop(),O.current&&O.current(),f()}},[v,a,l,o,c,d,f,p]),h(b.t)}function td(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=S.useRef(uo(t)),a=S.useRef(e);return a.current!==e&&(n.current=uo(t),a.current=e),n.current}var M6=["radius"],C6=["radius"],Gj,Vj,Xj,Fj,Zj,Qj,Wj,Jj,e2,t2;function n2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function r2(e){for(var t=1;t{var o=za(n),c=za(a),f=Math.min(Math.abs(o)/2,Math.abs(c)/2),d=c>=0?1:-1,h=o>=0?1:-1,v=c>=0&&o>=0||c<0&&o<0?1:0,p;if(f>0&&l instanceof Array){for(var b=[0,0,0,0],x=0,O=4;xf?f:l[x];p=ct(Gj||(Gj=fr(["M",",",""])),e,t+d*b[0]),b[0]>0&&(p+=ct(Vj||(Vj=fr(["A ",",",",0,0,",",",",",""])),b[0],b[0],v,e+h*b[0],t)),p+=ct(Xj||(Xj=fr(["L ",",",""])),e+n-h*b[1],t),b[1]>0&&(p+=ct(Fj||(Fj=fr(["A ",",",",0,0,",`, + height and width.`,M,L,l,o,c,f,n),S.createElement("div",{id:p?"".concat(p):void 0,className:Re("recharts-responsive-container",b),style:jj(jj({},O),{},{width:l,height:o,minWidth:c,minHeight:f,maxHeight:d}),ref:j},S.createElement("div",{style:Z5({width:l,height:o})},S.createElement(_E,{width:M,height:L},h)))}),to=S.forwardRef((e,t)=>{var n=ay();if(yr(n.width)&&yr(n.height))return e.children;var{width:a,height:l}=Q5({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:o,calculatedHeight:c}=jE(void 0,void 0,{width:a,height:l,aspect:e.aspect,maxHeight:e.maxHeight});return me(o)&&me(c)?S.createElement(_E,{width:o,height:c},e.children):S.createElement(nR,Vp({},e,{width:a,height:l,ref:t}))});function AE(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 Xf=()=>{var e,t=mn(),n=de($5),a=de(Vf),l=(e=de(Gf))===null||e===void 0?void 0:e.padding;return!t||!a||!l?n:{width:a.width-l.left-l.right,height:a.height-l.top-l.bottom,x:l.left,y:l.top}},rR={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},EE=()=>{var e;return(e=de(zt))!==null&&e!==void 0?e:rR},iy=()=>de(Wr),ly=()=>de(Jr),aR=()=>de(e=>e.layout.margin),Ge=e=>e.layout.layoutType,To=()=>de(Ge),iR=()=>{var e=To();return e!==void 0},Ff=e=>{var t=Qe(),n=mn(),{width:a,height:l}=e,o=ay(),c=a,f=l;return o&&(c=o.width>0?o.width:a,f=o.height>0?o.height:l),S.useEffect(()=>{!n&&yr(c)&&yr(f)&&t(d5({width:c,height:f}))},[t,n,c,f]),null},NE=Symbol.for("immer-nothing"),Oj=Symbol.for("immer-draftable"),Mn=Symbol.for("immer-state");function er(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fo=Object.getPrototypeOf;function El(e){return!!e&&!!e[Mn]}function wi(e){return e?TE(e)||Array.isArray(e)||!!e[Oj]||!!e.constructor?.[Oj]||Mo(e)||Qf(e):!1}var lR=Object.prototype.constructor.toString(),_j=new WeakMap;function TE(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 a=_j.get(n);return a===void 0&&(a=Function.toString.call(n),_j.set(n,a)),a===lR}function Jc(e,t,n=!0){Zf(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((a,l)=>t(l,a,e))}function Zf(e){const t=e[Mn];return t?t.type_:Array.isArray(e)?1:Mo(e)?2:Qf(e)?3:0}function Xp(e,t){return Zf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ME(e,t,n){const a=Zf(e);a===2?e.set(t,n):a===3?e.add(n):e[t]=n}function uR(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Mo(e){return e instanceof Map}function Qf(e){return e instanceof Set}function si(e){return e.copy_||e.base_}function Fp(e,t){if(Mo(e))return new Map(e);if(Qf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=TE(e);if(t===!0||t==="class_only"&&!n){const a=Object.getOwnPropertyDescriptors(e);delete a[Mn];let l=Reflect.ownKeys(a);for(let o=0;o1&&Object.defineProperties(e,{set:pc,add:pc,clear:pc,delete:pc}),Object.freeze(e),t&&Object.values(e).forEach(n=>uy(n,!0))),e}function oR(){er(2)}var pc={value:oR};function Wf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var sR={};function ji(e){const t=sR[e];return t||er(0,e),t}var ho;function CE(){return ho}function cR(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Aj(e,t){t&&(ji("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zp(e){Qp(e),e.drafts_.forEach(fR),e.drafts_=null}function Qp(e){e===ho&&(ho=e.parent_)}function Ej(e){return ho=cR(ho,e)}function fR(e){const t=e[Mn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Nj(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Mn].modified_&&(Zp(t),er(4)),wi(e)&&(e=ef(t,e),t.parent_||tf(t,e)),t.patches_&&ji("Patches").generateReplacementPatches_(n[Mn].base_,e,t.patches_,t.inversePatches_)):e=ef(t,n,[]),Zp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==NE?e:void 0}function ef(e,t,n){if(Wf(t))return t;const a=e.immer_.shouldUseStrictIteration(),l=t[Mn];if(!l)return Jc(t,(o,c)=>Tj(e,l,t,o,c,n),a),t;if(l.scope_!==e)return t;if(!l.modified_)return tf(e,l.base_,!0),l.base_;if(!l.finalized_){l.finalized_=!0,l.scope_.unfinalizedDrafts_--;const o=l.copy_;let c=o,f=!1;l.type_===3&&(c=new Set(o),o.clear(),f=!0),Jc(c,(d,h)=>Tj(e,l,o,d,h,n,f),a),tf(e,o,!1),n&&e.patches_&&ji("Patches").generatePatches_(l,n,e.patches_,e.inversePatches_)}return l.copy_}function Tj(e,t,n,a,l,o,c){if(l==null||typeof l!="object"&&!c)return;const f=Wf(l);if(!(f&&!c)){if(El(l)){const d=o&&t&&t.type_!==3&&!Xp(t.assigned_,a)?o.concat(a):void 0,h=ef(e,l,d);if(ME(n,a,h),El(h))e.canAutoFreeze_=!1;else return}else c&&n.add(l);if(wi(l)&&!f){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[a]===l&&f)return;ef(e,l),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&(Mo(n)?n.has(a):Object.prototype.propertyIsEnumerable.call(n,a))&&tf(e,l)}}}function tf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uy(t,n)}function dR(e,t){const n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:CE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let l=a,o=oy;n&&(l=[a],o=mo);const{revoke:c,proxy:f}=Proxy.revocable(l,o);return a.draft_=f,a.revoke_=c,f}var oy={get(e,t){if(t===Mn)return e;const n=si(e);if(!Xp(n,t))return hR(e,n,t);const a=n[t];return e.finalized_||!wi(a)?a:a===Xv(e.base_,t)?(Fv(e),e.copy_[t]=Jp(a,e)):a},has(e,t){return t in si(e)},ownKeys(e){return Reflect.ownKeys(si(e))},set(e,t,n){const a=DE(si(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){const l=Xv(si(e),t),o=l?.[Mn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(uR(n,l)&&(n!==void 0||Xp(e.base_,t)))return!0;Fv(e),Wp(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 Xv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Fv(e),Wp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=si(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:n[t]}},defineProperty(){er(11)},getPrototypeOf(e){return fo(e.base_)},setPrototypeOf(){er(12)}},mo={};Jc(oy,(e,t)=>{mo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});mo.deleteProperty=function(e,t){return mo.set.call(this,e,t,void 0)};mo.set=function(e,t,n){return oy.set.call(this,e[0],t,n,e[0])};function Xv(e,t){const n=e[Mn];return(n?si(n):e)[t]}function hR(e,t,n){const a=DE(t,n);return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}function DE(e,t){if(!(t in e))return;let n=fo(e);for(;n;){const a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=fo(n)}}function Wp(e){e.modified_||(e.modified_=!0,e.parent_&&Wp(e.parent_))}function Fv(e){e.copy_||(e.copy_=Fp(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var mR=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,a)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const c=this;return function(d=o,...h){return c.produce(d,v=>n.call(this,v,...h))}}typeof n!="function"&&er(6),a!==void 0&&typeof a!="function"&&er(7);let l;if(wi(t)){const o=Ej(this),c=Jp(t,void 0);let f=!0;try{l=n(c),f=!1}finally{f?Zp(o):Qp(o)}return Aj(o,a),Nj(l,o)}else if(!t||typeof t!="object"){if(l=n(t),l===void 0&&(l=t),l===NE&&(l=void 0),this.autoFreeze_&&uy(l,!0),a){const o=[],c=[];ji("Patches").generateReplacementPatches_(t,l,o,c),a(o,c)}return l}else er(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(c,...f)=>this.produceWithPatches(c,d=>t(d,...f));let a,l;return[this.produce(t,n,(c,f)=>{a=c,l=f}),a,l]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){wi(e)||er(8),El(e)&&(e=vR(e));const t=Ej(this),n=Jp(e,void 0);return n[Mn].isManual_=!0,Qp(t),n}finishDraft(e,t){const n=e&&e[Mn];(!n||!n.isManual_)&&er(9);const{scope_:a}=n;return Aj(a,t),Nj(void 0,a)}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 l=t[n];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}n>-1&&(t=t.slice(n+1));const a=ji("Patches").applyPatches_;return El(e)?a(e,t):this.produce(e,l=>a(l,t))}};function Jp(e,t){const n=Mo(e)?ji("MapSet").proxyMap_(e,t):Qf(e)?ji("MapSet").proxySet_(e,t):dR(e,t);return(t?t.scope_:CE()).drafts_.push(n),n}function vR(e){return El(e)||er(10,e),kE(e)}function kE(e){if(!wi(e)||Wf(e))return e;const t=e[Mn];let n,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Fp(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else n=Fp(e,!0);return Jc(n,(l,o)=>{ME(n,l,kE(o))},a),t&&(t.finalized_=!1),n}var pR=new mR;pR.produce;var yR={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},PE=hn({name:"legend",initialState:yR,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:rt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).payload.indexOf(n);l>-1&&(e.payload[l]=a)},prepare:rt()},removeLegendPayload:{reducer(e,t){var n=nr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:rt()}}}),{setLegendSize:Mj,setLegendSettings:gR,addLegendPayload:zE,replaceLegendPayload:RE,removeLegendPayload:LE}=PE.actions,bR=PE.reducer,xR=["contextPayload"];function e0(){return e0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(gR(e))},[t,e]),null}function MR(e){var t=Qe();return S.useEffect(()=>(t(Mj(e)),()=>{t(Mj({width:0,height:0}))}),[t,e]),null}function CR(e,t,n,a){return e==="vertical"&&me(t)?{height:t}:e==="horizontal"?{width:n||a}:null}var DR={align:"center",iconSize:14,itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function $E(e){var t=At(e,DR),n=mz(),a=ck(),l=aR(),{width:o,height:c,wrapperStyle:f,portal:d}=t,[h,v]=qA([n]),p=iy(),b=ly();if(p==null||b==null)return null;var x=p-(l?.left||0)-(l?.right||0),O=CR(t.layout,c,o,x),j=d?f:Nl(Nl({position:"absolute",width:O?.width||o||"auto",height:O?.height||c||"auto"},NR(f,t,l,p,b,h)),f),_=d??a;if(_==null||n==null)return null;var N=S.createElement("div",{className:"recharts-legend-wrapper",style:j,ref:v},S.createElement(TR,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&S.createElement(MR,{width:h.width,height:h.height}),S.createElement(ER,e0({},t,O,{margin:l,chartWidth:p,chartHeight:b,contextPayload:n})));return U0.createPortal(N,_)}$E.displayName="Legend";function t0(){return t0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=" : ",contentStyle:n={},itemStyle:a={},labelStyle:l={},payload:o,formatter:c,itemSorter:f,wrapperClassName:d,labelClassName:h,label:v,labelFormatter:p,accessibilityLayer:b=!1}=e,x=()=>{if(o&&o.length){var C={padding:0,margin:0},M=(f?kf(o,f):o).map((L,Z)=>{if(L.type==="none")return null;var re=L.formatter||c||RR,{value:B,name:U}=L,K=B,ce=U;if(re){var ue=re(B,U,L,Z,o);if(Array.isArray(ue))[K,ce]=ue;else if(ue!=null)K=ue;else return null}var ve=Zv({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},a);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Z),style:ve},pr(ce)?S.createElement("span",{className:"recharts-tooltip-item-name"},ce):null,pr(ce)?S.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,S.createElement("span",{className:"recharts-tooltip-item-value"},K),S.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:C},M)}return null},O=Zv({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},n),j=Zv({margin:0},l),_=!_t(v),N=_?v:"",E=Re("recharts-default-tooltip",d),T=Re("recharts-tooltip-label",h);_&&p&&o!==void 0&&o!==null&&(N=p(v,o));var P=b?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",t0({className:E,style:O},P),S.createElement("p",{className:T,style:j},S.isValidElement(N)?N:"".concat(N)),x())},qu="recharts-tooltip-wrapper",$R={visibility:"hidden"};function UR(e){var{coordinate:t,translateX:n,translateY:a}=e;return Re(qu,{["".concat(qu,"-right")]:me(n)&&t&&me(t.x)&&n>=t.x,["".concat(qu,"-left")]:me(n)&&t&&me(t.x)&&n=t.y,["".concat(qu,"-top")]:me(a)&&t&&me(t.y)&&a0?l:0),p=n[a]+l;if(t[a])return c[a]?v:p;var b=d[a];if(b==null)return 0;if(c[a]){var x=v,O=b;return x_?Math.max(v,b):Math.max(p,b)}function qR(e){var{translateX:t,translateY:n,useTranslate3d:a}=e;return{transform:a?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function BR(e){var{allowEscapeViewBox:t,coordinate:n,offsetTopLeft:a,position:l,reverseDirection:o,tooltipBox:c,useTranslate3d:f,viewBox:d}=e,h,v,p;return c.height>0&&c.width>0&&n?(v=kj({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:a,position:l,reverseDirection:o,tooltipDimension:c.width,viewBox:d,viewBoxDimension:d.width}),p=kj({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:a,position:l,reverseDirection:o,tooltipDimension:c.height,viewBox:d,viewBoxDimension:d.height}),h=qR({translateX:v,translateY:p,useTranslate3d:f})):h=$R,{cssProperties:h,cssClasses:UR({translateX:v,translateY:p,coordinate:n})}}function Pj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function yc(e){for(var t=1;t{if(t.key==="Escape"){var n,a,l,o;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(a=this.props.coordinate)===null||a===void 0?void 0:a.x)!==null&&n!==void 0?n:0,y:(l=(o=this.props.coordinate)===null||o===void 0?void 0:o.y)!==null&&l!==void 0?l:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:a,animationEasing:l,children:o,coordinate:c,hasPayload:f,isAnimationActive:d,offset:h,position:v,reverseDirection:p,useTranslate3d:b,viewBox:x,wrapperStyle:O,lastBoundingBox:j,innerRef:_,hasPortalFromProps:N}=this.props,{cssClasses:E,cssProperties:T}=BR({allowEscapeViewBox:n,coordinate:c,offsetTopLeft:h,position:v,reverseDirection:p,tooltipBox:{height:j.height,width:j.width},useTranslate3d:b,viewBox:x}),P=N?{}:yc(yc({transition:d&&t?"transform ".concat(a,"ms ").concat(l):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&f?"visible":"hidden",position:"absolute",top:0,left:0}),C=yc(yc({},P),{},{visibility:!this.state.dismissed&&t&&f?"visible":"hidden"},O);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:E,style:C,ref:_},o)}}var UE=()=>{var e;return(e=de(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function r0(){return r0=Object.assign?Object.assign.bind():function(e){for(var t=1;twt(e.x)&&wt(e.y),$j=e=>e.base!=null&&nf(e.base)&&nf(e),Bu=e=>e.x,Iu=e=>e.y,XR=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Oo(e));return(n==="curveMonotone"||n==="curveBump")&&t?Lj["".concat(n).concat(t==="vertical"?"Y":"X")]:Lj[n]||Cf},FR=e=>{var{type:t="linear",points:n=[],baseLine:a,layout:l,connectNulls:o=!1}=e,c=XR(t,l),f=o?n.filter(nf):n,d;if(Array.isArray(a)){var h=n.map((x,O)=>Rj(Rj({},x),{},{base:a[O]}));l==="vertical"?d=sc().y(Iu).x1(Bu).x0(x=>x.base.x):d=sc().x(Bu).y1(Iu).y0(x=>x.base.y);var v=d.defined($j).curve(c),p=o?h.filter($j):h;return v(p)}l==="vertical"&&me(a)?d=sc().y(Iu).x1(Bu).x0(a):me(a)?d=sc().x(Bu).y1(Iu).y0(a):d=fA().x(Bu).y(Iu);var b=d.defined(nf).curve(c);return b(f)},sy=e=>{var{className:t,points:n,path:a,pathRef:l}=e,o=To();if((!n||!n.length)&&!a)return null;var c={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},f=n&&n.length?FR(c):a;return S.createElement("path",r0({},Gn(e),V0(e),{className:Re("recharts-curve",t),d:f===null?void 0:f,ref:l}))},ZR=["x","y","top","left","width","height","className"];function a0(){return a0=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(l,"v").concat(a,"M").concat(o,",").concat(t,"h").concat(n),a6=e=>{var{x:t=0,y:n=0,top:a=0,left:l=0,width:o=0,height:c=0,className:f}=e,d=t6(e,ZR),h=QR({x:t,y:n,top:a,left:l,width:o,height:c},d);return!me(t)||!me(n)||!me(o)||!me(c)||!me(a)||!me(l)?null:S.createElement("path",a0({},tn(h),{className:Re("recharts-cross",f),d:r6(t,n,o,c,a,l)}))};function i6(e,t,n,a){var l=a/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-l:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-l,width:e==="horizontal"?a:n.width-1,height:e==="horizontal"?n.height-1:a}}function qj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Bj(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),qE=(e,t,n)=>e.map(a=>"".concat(s6(a)," ").concat(t,"ms ").concat(n)).join(","),c6=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,a)=>n.filter(l=>a.includes(l))),vo=(e,t)=>Object.keys(t).reduce((n,a)=>Bj(Bj({},n),{},{[a]:e(a,t[a])}),{});function Ij(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Ot(e){for(var t=1;te+(t-e)*n,i0=e=>{var{from:t,to:n}=e;return t!==n},BE=(e,t,n)=>{var a=vo((l,o)=>{if(i0(o)){var[c,f]=e(o.from,o.to,o.velocity);return Ot(Ot({},o),{},{from:c,velocity:f})}return o},t);return n<1?vo((l,o)=>i0(o)&&a[l]!=null?Ot(Ot({},o),{},{velocity:rf(o.velocity,a[l].velocity,n),from:rf(o.from,a[l].from,n)}):o,t):BE(e,a,n-1)};function m6(e,t,n,a,l,o){var c,f=a.reduce((b,x)=>Ot(Ot({},b),{},{[x]:{from:e[x],velocity:0,to:t[x]}}),{}),d=()=>vo((b,x)=>x.from,f),h=()=>!Object.values(f).filter(i0).length,v=null,p=b=>{c||(c=b);var x=b-c,O=x/n.dt;f=BE(n,f,O),l(Ot(Ot(Ot({},e),t),d())),c=b,h()||(v=o.setTimeout(p))};return()=>(v=o.setTimeout(p),()=>{var b;(b=v)===null||b===void 0||b()})}function v6(e,t,n,a,l,o,c){var f=null,d=l.reduce((p,b)=>{var x=e[b],O=t[b];return x==null||O==null?p:Ot(Ot({},p),{},{[b]:[x,O]})},{}),h,v=p=>{h||(h=p);var b=(p-h)/a,x=vo((j,_)=>rf(..._,n(b)),d);if(o(Ot(Ot(Ot({},e),t),x)),b<1)f=c.setTimeout(v);else{var O=vo((j,_)=>rf(..._,n(1)),d);o(Ot(Ot(Ot({},e),t),O))}};return()=>(f=c.setTimeout(v),()=>{var p;(p=f)===null||p===void 0||p()})}const p6=(e,t,n,a,l,o)=>{var c=c6(e,t);return n==null?()=>(l(Ot(Ot({},e),t)),()=>{}):n.isStepper===!0?m6(e,t,n,c,l,o):v6(e,t,n,a,c,l,o)};var af=1e-4,IE=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],HE=(e,t)=>e.map((n,a)=>n*t**a).reduce((n,a)=>n+a),Hj=(e,t)=>n=>{var a=IE(e,t);return HE(a,n)},y6=(e,t)=>n=>{var a=IE(e,t),l=[...a.map((o,c)=>o*c).slice(1),0];return HE(l,n)},g6=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var a=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(a==null||a.length!==4)return null;var l=a.map(o=>parseFloat(o));return[l[0],l[1],l[2],l[3]]},b6=function(){for(var t=arguments.length,n=new Array(t),a=0;a{var l=Hj(e,n),o=Hj(t,a),c=y6(e,n),f=h=>h>1?1:h<0?0:h,d=h=>{for(var v=h>1?1:h,p=v,b=0;b<8;++b){var x=l(p)-v,O=c(p);if(Math.abs(x-v)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:a=8,dt:l=17}=t,o=(c,f,d)=>{var h=-(c-f)*n,v=d*a,p=d+(h-v)*l/1e3,b=d*l/1e3+c;return Math.abs(b-f){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Kj(e);case"spring":return S6();default:if(e.split("(")[0]==="cubic-bezier")return Kj(e)}return typeof e=="function"?e:null};function j6(e){var t,n=()=>null,a=!1,l=null,o=c=>{if(!a){if(Array.isArray(c)){if(!c.length)return;var f=c,[d,...h]=f;if(typeof d=="number"){l=e.setTimeout(o.bind(null,h),d);return}o(d),l=e.setTimeout(o.bind(null,h));return}typeof c=="string"&&(t=c,n(t)),typeof c=="object"&&(t=c,n(t)),typeof c=="function"&&c()}};return{stop:()=>{a=!0},start:c=>{a=!1,l&&(l(),l=null),o(c)},subscribe:c=>(n=c,()=>{n=()=>null}),getTimeoutController:()=>e}}class O6{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=performance.now(),l=null,o=c=>{c-a>=n?t(c):typeof requestAnimationFrame=="function"&&(l=requestAnimationFrame(o))};return l=requestAnimationFrame(o),()=>{l!=null&&cancelAnimationFrame(l)}}}function _6(){return j6(new O6)}var A6=S.createContext(_6);function E6(e,t){var n=S.useContext(A6);return S.useMemo(()=>t??n(e),[e,t,n])}var N6=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Jf={isSsr:N6()},T6={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Yj={t:0},Qv={t:1};function ed(e){var t=At(e,T6),{isActive:n,canBegin:a,duration:l,easing:o,begin:c,onAnimationEnd:f,onAnimationStart:d,children:h}=t,v=n==="auto"?!Jf.isSsr:n,p=E6(t.animationId,t.animationManager),[b,x]=S.useState(v?Yj:Qv),O=S.useRef(null);return S.useEffect(()=>{v||x(Qv)},[v]),S.useEffect(()=>{if(!v||!a)return _o;var j=p6(Yj,Qv,w6(o),l,x,p.getTimeoutController()),_=()=>{O.current=j()};return p.start([d,c,_,l,f]),()=>{p.stop(),O.current&&O.current(),f()}},[v,a,l,o,c,d,f,p]),h(b.t)}function td(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=S.useRef(uo(t)),a=S.useRef(e);return a.current!==e&&(n.current=uo(t),a.current=e),n.current}var M6=["radius"],C6=["radius"],Gj,Vj,Xj,Fj,Zj,Qj,Wj,Jj,e2,t2;function n2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function r2(e){for(var t=1;t{var o=za(n),c=za(a),f=Math.min(Math.abs(o)/2,Math.abs(c)/2),d=c>=0?1:-1,h=o>=0?1:-1,v=c>=0&&o>=0||c<0&&o<0?1:0,p;if(f>0&&l instanceof Array){for(var b=[0,0,0,0],x=0,O=4;xf?f:l[x];p=ct(Gj||(Gj=fr(["M",",",""])),e,t+d*b[0]),b[0]>0&&(p+=ct(Vj||(Vj=fr(["A ",",",",0,0,",",",",",""])),b[0],b[0],v,e+h*b[0],t)),p+=ct(Xj||(Xj=fr(["L ",",",""])),e+n-h*b[1],t),b[1]>0&&(p+=ct(Fj||(Fj=fr(["A ",",",",0,0,",`, `,",",""])),b[1],b[1],v,e+n,t+d*b[1])),p+=ct(Zj||(Zj=fr(["L ",",",""])),e+n,t+a-d*b[2]),b[2]>0&&(p+=ct(Qj||(Qj=fr(["A ",",",",0,0,",`, `,",",""])),b[2],b[2],v,e+n-h*b[2],t+a)),p+=ct(Wj||(Wj=fr(["L ",",",""])),e+h*b[3],t+a),b[3]>0&&(p+=ct(Jj||(Jj=fr(["A ",",",",0,0,",`, `,",",""])),b[3],b[3],v,e,t+a-d*b[3])),p+="Z"}else if(f>0&&l===+l&&l>0){var j=Math.min(f,l);p=ct(e2||(e2=fr(["M ",",",` @@ -22,25 +22,25 @@ Error generating stack: `+s.message+` L `,",",` A `,",",",0,0,",",",",",` L `,",",` - A `,",",",0,0,",",",","," Z"])),e,t+d*j,j,j,v,e+h*j,t,e+n-h*j,t,j,j,v,e+n,t+d*j,e+n,t+a-d*j,j,j,v,e+n-h*j,t+a,e+h*j,t+a,j,j,v,e,t+a-d*j)}else p=ct(t2||(t2=fr(["M ",","," h "," v "," h "," Z"])),e,t,n,a,-n);return p},l2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},KE=e=>{var t=At(e,l2),n=S.useRef(null),[a,l]=S.useState(-1);S.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ee=n.current.getTotalLength();ee&&l(ee)}catch{}},[]);var{x:o,y:c,width:f,height:d,radius:h,className:v}=t,{animationEasing:p,animationDuration:b,animationBegin:x,isAnimationActive:O,isUpdateAnimationActive:j}=t,_=S.useRef(f),E=S.useRef(d),N=S.useRef(o),T=S.useRef(c),C=S.useMemo(()=>({x:o,y:c,width:f,height:d,radius:h}),[o,c,f,d,h]),k=td(C,"rectangle-");if(o!==+o||c!==+c||f!==+f||d!==+d||f===0||d===0)return null;var M=Re("recharts-rectangle",v);if(!j){var L=tn(t),{radius:W}=L,re=a2(L,M6);return S.createElement("path",lf({},re,{x:za(o),y:za(c),width:za(f),height:za(d),radius:typeof h=="number"?h:void 0,className:M,d:i2(o,c,f,d,h)}))}var H=_.current,$=E.current,K=N.current,ce=T.current,ue="0px ".concat(a===-1?1:a,"px"),ve="".concat(a,"px 0px"),I=qE(["strokeDasharray"],b,typeof p=="string"?p:l2.animationEasing);return S.createElement(ed,{animationId:k,key:k,canBegin:a>0,duration:b,easing:p,isActive:j,begin:x},ee=>{var z=Qt(H,f,ee),G=Qt($,d,ee),ne=Qt(K,o,ee),P=Qt(ce,c,ee);n.current&&(_.current=z,E.current=G,N.current=ne,T.current=P);var F;O?ee>0?F={transition:I,strokeDasharray:ve}:F={strokeDasharray:ue}:F={strokeDasharray:ve};var ie=tn(t),{radius:le}=ie,ye=a2(ie,C6);return S.createElement("path",lf({},ye,{radius:typeof h=="number"?h:void 0,className:M,d:i2(ne,P,z,G,h),ref:n,style:r2(r2({},F),t.style)}))})};function u2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function o2(e){for(var t=1;te*180/Math.PI,xt=(e,t,n,a)=>({x:e+Math.cos(-uf*a)*n,y:t+Math.sin(-uf*a)*n}),YE=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(a.left||0)-(a.right||0)),Math.abs(n-(a.top||0)-(a.bottom||0)))/2},q6=(e,t)=>{var{x:n,y:a}=e,{x:l,y:o}=t;return Math.sqrt((n-l)**2+(a-o)**2)},B6=(e,t)=>{var{x:n,y:a}=e,{cx:l,cy:o}=t,c=q6({x:n,y:a},{x:l,y:o});if(c<=0)return{radius:c,angle:0};var f=(n-l)/c,d=Math.acos(f);return a>o&&(d=2*Math.PI-d),{radius:c,angle:$6(d),angleInRadian:d}},I6=e=>{var{startAngle:t,endAngle:n}=e,a=Math.floor(t/360),l=Math.floor(n/360),o=Math.min(a,l);return{startAngle:t-o*360,endAngle:n-o*360}},H6=(e,t)=>{var{startAngle:n,endAngle:a}=t,l=Math.floor(n/360),o=Math.floor(a/360),c=Math.min(l,o);return e+c*360},K6=(e,t)=>{var{chartX:n,chartY:a}=e,{radius:l,angle:o}=B6({x:n,y:a},t),{innerRadius:c,outerRadius:f}=t;if(lf||l===0)return null;var{startAngle:d,endAngle:h}=I6(t),v=o,p;if(d<=h){for(;v>h;)v-=360;for(;v=d&&v<=h}else{for(;v>d;)v-=360;for(;v=h&&v<=d}return p?o2(o2({},t),{},{radius:l,angle:H6(v,t)}):null};function GE(e){var{cx:t,cy:n,radius:a,startAngle:l,endAngle:o}=e,c=xt(t,n,a,l),f=xt(t,n,a,o);return{points:[c,f],cx:t,cy:n,radius:a,startAngle:l,endAngle:o}}var s2,c2,f2,d2,h2,m2,v2;function l0(){return l0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Wt(t-e),a=Math.min(Math.abs(t-e),359.999);return n*a},gc=e=>{var{cx:t,cy:n,radius:a,angle:l,sign:o,isExternal:c,cornerRadius:f,cornerIsExternal:d}=e,h=f*(c?1:-1)+a,v=Math.asin(f/h)/uf,p=d?l:l+o*v,b=xt(t,n,h,p),x=xt(t,n,a,p),O=d?l-o*v:l,j=xt(t,n,h*Math.cos(v*uf),O);return{center:b,circleTangency:x,lineTangency:j,theta:v}},VE=e=>{var{cx:t,cy:n,innerRadius:a,outerRadius:l,startAngle:o,endAngle:c}=e,f=Y6(o,c),d=o+f,h=xt(t,n,l,o),v=xt(t,n,l,d),p=ct(s2||(s2=di(["M ",",",` + A `,",",",0,0,",",",","," Z"])),e,t+d*j,j,j,v,e+h*j,t,e+n-h*j,t,j,j,v,e+n,t+d*j,e+n,t+a-d*j,j,j,v,e+n-h*j,t+a,e+h*j,t+a,j,j,v,e,t+a-d*j)}else p=ct(t2||(t2=fr(["M ",","," h "," v "," h "," Z"])),e,t,n,a,-n);return p},l2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},KE=e=>{var t=At(e,l2),n=S.useRef(null),[a,l]=S.useState(-1);S.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ee=n.current.getTotalLength();ee&&l(ee)}catch{}},[]);var{x:o,y:c,width:f,height:d,radius:h,className:v}=t,{animationEasing:p,animationDuration:b,animationBegin:x,isAnimationActive:O,isUpdateAnimationActive:j}=t,_=S.useRef(f),N=S.useRef(d),E=S.useRef(o),T=S.useRef(c),P=S.useMemo(()=>({x:o,y:c,width:f,height:d,radius:h}),[o,c,f,d,h]),C=td(P,"rectangle-");if(o!==+o||c!==+c||f!==+f||d!==+d||f===0||d===0)return null;var M=Re("recharts-rectangle",v);if(!j){var L=tn(t),{radius:Z}=L,re=a2(L,M6);return S.createElement("path",lf({},re,{x:za(o),y:za(c),width:za(f),height:za(d),radius:typeof h=="number"?h:void 0,className:M,d:i2(o,c,f,d,h)}))}var B=_.current,U=N.current,K=E.current,ce=T.current,ue="0px ".concat(a===-1?1:a,"px"),ve="".concat(a,"px 0px"),H=qE(["strokeDasharray"],b,typeof p=="string"?p:l2.animationEasing);return S.createElement(ed,{animationId:C,key:C,canBegin:a>0,duration:b,easing:p,isActive:j,begin:x},ee=>{var z=Qt(B,f,ee),G=Qt(U,d,ee),ne=Qt(K,o,ee),k=Qt(ce,c,ee);n.current&&(_.current=z,N.current=G,E.current=ne,T.current=k);var F;O?ee>0?F={transition:H,strokeDasharray:ve}:F={strokeDasharray:ue}:F={strokeDasharray:ve};var ie=tn(t),{radius:le}=ie,ye=a2(ie,C6);return S.createElement("path",lf({},ye,{radius:typeof h=="number"?h:void 0,className:M,d:i2(ne,k,z,G,h),ref:n,style:r2(r2({},F),t.style)}))})};function u2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function o2(e){for(var t=1;te*180/Math.PI,xt=(e,t,n,a)=>({x:e+Math.cos(-uf*a)*n,y:t+Math.sin(-uf*a)*n}),YE=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(a.left||0)-(a.right||0)),Math.abs(n-(a.top||0)-(a.bottom||0)))/2},q6=(e,t)=>{var{x:n,y:a}=e,{x:l,y:o}=t;return Math.sqrt((n-l)**2+(a-o)**2)},B6=(e,t)=>{var{x:n,y:a}=e,{cx:l,cy:o}=t,c=q6({x:n,y:a},{x:l,y:o});if(c<=0)return{radius:c,angle:0};var f=(n-l)/c,d=Math.acos(f);return a>o&&(d=2*Math.PI-d),{radius:c,angle:U6(d),angleInRadian:d}},I6=e=>{var{startAngle:t,endAngle:n}=e,a=Math.floor(t/360),l=Math.floor(n/360),o=Math.min(a,l);return{startAngle:t-o*360,endAngle:n-o*360}},H6=(e,t)=>{var{startAngle:n,endAngle:a}=t,l=Math.floor(n/360),o=Math.floor(a/360),c=Math.min(l,o);return e+c*360},K6=(e,t)=>{var{chartX:n,chartY:a}=e,{radius:l,angle:o}=B6({x:n,y:a},t),{innerRadius:c,outerRadius:f}=t;if(lf||l===0)return null;var{startAngle:d,endAngle:h}=I6(t),v=o,p;if(d<=h){for(;v>h;)v-=360;for(;v=d&&v<=h}else{for(;v>d;)v-=360;for(;v=h&&v<=d}return p?o2(o2({},t),{},{radius:l,angle:H6(v,t)}):null};function GE(e){var{cx:t,cy:n,radius:a,startAngle:l,endAngle:o}=e,c=xt(t,n,a,l),f=xt(t,n,a,o);return{points:[c,f],cx:t,cy:n,radius:a,startAngle:l,endAngle:o}}var s2,c2,f2,d2,h2,m2,v2;function l0(){return l0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Wt(t-e),a=Math.min(Math.abs(t-e),359.999);return n*a},gc=e=>{var{cx:t,cy:n,radius:a,angle:l,sign:o,isExternal:c,cornerRadius:f,cornerIsExternal:d}=e,h=f*(c?1:-1)+a,v=Math.asin(f/h)/uf,p=d?l:l+o*v,b=xt(t,n,h,p),x=xt(t,n,a,p),O=d?l-o*v:l,j=xt(t,n,h*Math.cos(v*uf),O);return{center:b,circleTangency:x,lineTangency:j,theta:v}},VE=e=>{var{cx:t,cy:n,innerRadius:a,outerRadius:l,startAngle:o,endAngle:c}=e,f=Y6(o,c),d=o+f,h=xt(t,n,l,o),v=xt(t,n,l,d),p=ct(s2||(s2=di(["M ",",",` A `,",",`,0, `,",",`, `,",",` `])),h.x,h.y,l,l,+(Math.abs(f)>180),+(o>d),v.x,v.y);if(a>0){var b=xt(t,n,a,o),x=xt(t,n,a,d);p+=ct(c2||(c2=di(["L ",",",` A `,",",`,0, `,",",`, - `,","," Z"])),x.x,x.y,a,a,+(Math.abs(f)>180),+(o<=d),b.x,b.y)}else p+=ct(f2||(f2=di(["L ",","," Z"])),t,n);return p},G6=e=>{var{cx:t,cy:n,innerRadius:a,outerRadius:l,cornerRadius:o,forceCornerRadius:c,cornerIsExternal:f,startAngle:d,endAngle:h}=e,v=Wt(h-d),{circleTangency:p,lineTangency:b,theta:x}=gc({cx:t,cy:n,radius:l,angle:d,sign:v,cornerRadius:o,cornerIsExternal:f}),{circleTangency:O,lineTangency:j,theta:_}=gc({cx:t,cy:n,radius:l,angle:h,sign:-v,cornerRadius:o,cornerIsExternal:f}),E=f?Math.abs(d-h):Math.abs(d-h)-x-_;if(E<0)return c?ct(d2||(d2=di(["M ",",",` + `,","," Z"])),x.x,x.y,a,a,+(Math.abs(f)>180),+(o<=d),b.x,b.y)}else p+=ct(f2||(f2=di(["L ",","," Z"])),t,n);return p},G6=e=>{var{cx:t,cy:n,innerRadius:a,outerRadius:l,cornerRadius:o,forceCornerRadius:c,cornerIsExternal:f,startAngle:d,endAngle:h}=e,v=Wt(h-d),{circleTangency:p,lineTangency:b,theta:x}=gc({cx:t,cy:n,radius:l,angle:d,sign:v,cornerRadius:o,cornerIsExternal:f}),{circleTangency:O,lineTangency:j,theta:_}=gc({cx:t,cy:n,radius:l,angle:h,sign:-v,cornerRadius:o,cornerIsExternal:f}),N=f?Math.abs(d-h):Math.abs(d-h)-x-_;if(N<0)return c?ct(d2||(d2=di(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 - `])),b.x,b.y,o,o,o*2,o,o,-o*2):VE({cx:t,cy:n,innerRadius:a,outerRadius:l,startAngle:d,endAngle:h});var N=ct(h2||(h2=di(["M ",",",` + `])),b.x,b.y,o,o,o*2,o,o,-o*2):VE({cx:t,cy:n,innerRadius:a,outerRadius:l,startAngle:d,endAngle:h});var E=ct(h2||(h2=di(["M ",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` - `])),b.x,b.y,o,o,+(v<0),p.x,p.y,l,l,+(E>180),+(v<0),O.x,O.y,o,o,+(v<0),j.x,j.y);if(a>0){var{circleTangency:T,lineTangency:C,theta:k}=gc({cx:t,cy:n,radius:a,angle:d,sign:v,isExternal:!0,cornerRadius:o,cornerIsExternal:f}),{circleTangency:M,lineTangency:L,theta:W}=gc({cx:t,cy:n,radius:a,angle:h,sign:-v,isExternal:!0,cornerRadius:o,cornerIsExternal:f}),re=f?Math.abs(d-h):Math.abs(d-h)-k-W;if(re<0&&o===0)return"".concat(N,"L").concat(t,",").concat(n,"Z");N+=ct(m2||(m2=di(["L",",",` + `])),b.x,b.y,o,o,+(v<0),p.x,p.y,l,l,+(N>180),+(v<0),O.x,O.y,o,o,+(v<0),j.x,j.y);if(a>0){var{circleTangency:T,lineTangency:P,theta:C}=gc({cx:t,cy:n,radius:a,angle:d,sign:v,isExternal:!0,cornerRadius:o,cornerIsExternal:f}),{circleTangency:M,lineTangency:L,theta:Z}=gc({cx:t,cy:n,radius:a,angle:h,sign:-v,isExternal:!0,cornerRadius:o,cornerIsExternal:f}),re=f?Math.abs(d-h):Math.abs(d-h)-C-Z;if(re<0&&o===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=ct(m2||(m2=di(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",","Z"])),L.x,L.y,o,o,+(v<0),M.x,M.y,a,a,+(re>180),+(v>0),T.x,T.y,o,o,+(v<0),C.x,C.y)}else N+=ct(v2||(v2=di(["L",",","Z"])),t,n);return N},V6={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},XE=e=>{var t=At(e,V6),{cx:n,cy:a,innerRadius:l,outerRadius:o,cornerRadius:c,forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v,className:p}=t;if(o0&&Math.abs(h-v)<360?j=G6({cx:n,cy:a,innerRadius:l,outerRadius:o,cornerRadius:Math.min(O,x/2),forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v}):j=VE({cx:n,cy:a,innerRadius:l,outerRadius:o,startAngle:h,endAngle:v}),S.createElement("path",l0({},tn(t),{className:b,d:j}))};function X6(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(AA(t)){if(e==="centric"){var{cx:a,cy:l,innerRadius:o,outerRadius:c,angle:f}=t,d=xt(a,l,o,f),h=xt(a,l,c,f);return[{x:d.x,y:d.y},{x:h.x,y:h.y}]}return GE(t)}}var Wv={},Jv={},ep={},p2;function F6(){return p2||(p2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LA();function n(a){return t.isSymbol(a)?NaN:Number(a)}e.toNumber=n})(ep)),ep}var y2;function Z6(){return y2||(y2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F6();function n(a){return a?(a=t.toNumber(a),a===1/0||a===-1/0?(a<0?-1:1)*Number.MAX_VALUE:a===a?a:0):a===0?a:0}e.toFinite=n})(Jv)),Jv}var g2;function Q6(){return g2||(g2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UA(),n=Z6();function a(l,o,c){c&&typeof c!="number"&&t.isIterateeCall(l,o,c)&&(o=c=void 0),l=n.toFinite(l),o===void 0?(o=l,l=0):o=n.toFinite(o),c=c===void 0?lt?1:e>=t?0:NaN}function e8(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function cy(e){let t,n,a;e.length!==2?(t=Ra,n=(f,d)=>Ra(e(f),d),a=(f,d)=>e(f)-d):(t=e===Ra||e===e8?e:t8,n=e,a=e);function l(f,d,h=0,v=f.length){if(h>>1;n(f[p],d)<0?h=p+1:v=p}while(h>>1;n(f[p],d)<=0?h=p+1:v=p}while(hh&&a(f[p-1],d)>-a(f[p],d)?p-1:p}return{left:l,center:c,right:o}}function t8(){return 0}function ZE(e){return e===null?NaN:+e}function*n8(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const r8=cy(Ra),Co=r8.right;cy(ZE).center;class x2 extends Map{constructor(t,n=l8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[a,l]of t)this.set(a,l)}get(t){return super.get(S2(this,t))}has(t){return super.has(S2(this,t))}set(t,n){return super.set(a8(this,t),n)}delete(t){return super.delete(i8(this,t))}}function S2({_intern:e,_key:t},n){const a=t(n);return e.has(a)?e.get(a):n}function a8({_intern:e,_key:t},n){const a=t(n);return e.has(a)?e.get(a):(e.set(a,n),n)}function i8({_intern:e,_key:t},n){const a=t(n);return e.has(a)&&(n=e.get(a),e.delete(a)),n}function l8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function u8(e=Ra){if(e===Ra)return QE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const a=e(t,n);return a||a===0?a:(e(n,n)===0)-(e(t,t)===0)}}function QE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const o8=Math.sqrt(50),s8=Math.sqrt(10),c8=Math.sqrt(2);function of(e,t,n){const a=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(a)),o=a/Math.pow(10,l),c=o>=o8?10:o>=s8?5:o>=c8?2:1;let f,d,h;return l<0?(h=Math.pow(10,-l)/c,f=Math.round(e*h),d=Math.round(t*h),f/ht&&--d,h=-h):(h=Math.pow(10,l)*c,f=Math.round(e/h),d=Math.round(t/h),f*ht&&--d),d0))return[];if(e===t)return[e];const a=t=l))return[];const f=o-l+1,d=new Array(f);if(a)if(c<0)for(let h=0;h=a)&&(n=a);return n}function j2(e,t){let n;for(const a of e)a!=null&&(n>a||n===void 0&&a>=a)&&(n=a);return n}function WE(e,t,n=0,a=1/0,l){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),a=Math.floor(Math.min(e.length-1,a)),!(n<=t&&t<=a))return e;for(l=l===void 0?QE:u8(l);a>n;){if(a-n>600){const d=a-n+1,h=t-n+1,v=Math.log(d),p=.5*Math.exp(2*v/3),b=.5*Math.sqrt(v*p*(d-p)/d)*(h-d/2<0?-1:1),x=Math.max(n,Math.floor(t-h*p/d+b)),O=Math.min(a,Math.floor(t+(d-h)*p/d+b));WE(e,t,x,O,l)}const o=e[t];let c=n,f=a;for(Hu(e,n,t),l(e[a],o)>0&&Hu(e,n,a);c0;)--f}l(e[n],o)===0?Hu(e,n,f):(++f,Hu(e,f,a)),f<=t&&(n=f+1),t<=f&&(a=f-1)}return e}function Hu(e,t,n){const a=e[t];e[t]=e[n],e[n]=a}function f8(e,t,n){if(e=Float64Array.from(n8(e)),!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return j2(e);if(t>=1)return w2(e);var a,l=(a-1)*t,o=Math.floor(l),c=w2(WE(e,o).subarray(0,o+1)),f=j2(e.subarray(o+1));return c+(f-c)*(l-o)}}function d8(e,t,n=ZE){if(!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return+n(e[0],0,e);if(t>=1)return+n(e[a-1],a-1,e);var a,l=(a-1)*t,o=Math.floor(l),c=+n(e[o],o,e),f=+n(e[o+1],o+1,e);return c+(f-c)*(l-o)}}function h8(e,t,n){e=+e,t=+t,n=(l=arguments.length)<2?(t=e,e=0,1):l<3?1:+n;for(var a=-1,l=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(l);++a>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bc(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=p8.exec(e))?new fn(t[1],t[2],t[3],1):(t=y8.exec(e))?new fn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=g8.exec(e))?bc(t[1],t[2],t[3],t[4]):(t=b8.exec(e))?bc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=x8.exec(e))?M2(t[1],t[2]/100,t[3]/100,1):(t=S8.exec(e))?M2(t[1],t[2]/100,t[3]/100,t[4]):O2.hasOwnProperty(e)?E2(O2[e]):e==="transparent"?new fn(NaN,NaN,NaN,0):null}function E2(e){return new fn(e>>16&255,e>>8&255,e&255,1)}function bc(e,t,n,a){return a<=0&&(e=t=n=NaN),new fn(e,t,n,a)}function O8(e){return e instanceof Do||(e=go(e)),e?(e=e.rgb(),new fn(e.r,e.g,e.b,e.opacity)):new fn}function f0(e,t,n,a){return arguments.length===1?O8(e):new fn(e,t,n,a??1)}function fn(e,t,n,a){this.r=+e,this.g=+t,this.b=+n,this.opacity=+a}hy(fn,f0,eN(Do,{brighter(e){return e=e==null?sf:Math.pow(sf,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?po:Math.pow(po,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fn(yi(this.r),yi(this.g),yi(this.b),cf(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:N2,formatHex:N2,formatHex8:_8,formatRgb:T2,toString:T2}));function N2(){return`#${hi(this.r)}${hi(this.g)}${hi(this.b)}`}function _8(){return`#${hi(this.r)}${hi(this.g)}${hi(this.b)}${hi((isNaN(this.opacity)?1:this.opacity)*255)}`}function T2(){const e=cf(this.opacity);return`${e===1?"rgb(":"rgba("}${yi(this.r)}, ${yi(this.g)}, ${yi(this.b)}${e===1?")":`, ${e})`}`}function cf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function hi(e){return e=yi(e),(e<16?"0":"")+e.toString(16)}function M2(e,t,n,a){return a<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tr(e,t,n,a)}function tN(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof Do||(e=go(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,a=e.b/255,l=Math.min(t,n,a),o=Math.max(t,n,a),c=NaN,f=o-l,d=(o+l)/2;return f?(t===o?c=(n-a)/f+(n0&&d<1?0:c,new tr(c,f,d,e.opacity)}function A8(e,t,n,a){return arguments.length===1?tN(e):new tr(e,t,n,a??1)}function tr(e,t,n,a){this.h=+e,this.s=+t,this.l=+n,this.opacity=+a}hy(tr,A8,eN(Do,{brighter(e){return e=e==null?sf:Math.pow(sf,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?po:Math.pow(po,e),new tr(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,a=n+(n<.5?n:1-n)*t,l=2*n-a;return new fn(np(e>=240?e-240:e+120,l,a),np(e,l,a),np(e<120?e+240:e-120,l,a),this.opacity)},clamp(){return new tr(C2(this.h),xc(this.s),xc(this.l),cf(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=cf(this.opacity);return`${e===1?"hsl(":"hsla("}${C2(this.h)}, ${xc(this.s)*100}%, ${xc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function C2(e){return e=(e||0)%360,e<0?e+360:e}function xc(e){return Math.max(0,Math.min(1,e||0))}function np(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 my=e=>()=>e;function E8(e,t){return function(n){return e+n*t}}function N8(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(a){return Math.pow(e+a*t,n)}}function T8(e){return(e=+e)==1?nN:function(t,n){return n-t?N8(t,n,e):my(isNaN(t)?n:t)}}function nN(e,t){var n=t-e;return n?E8(e,n):my(isNaN(e)?t:e)}const D2=(function e(t){var n=T8(t);function a(l,o){var c=n((l=f0(l)).r,(o=f0(o)).r),f=n(l.g,o.g),d=n(l.b,o.b),h=nN(l.opacity,o.opacity);return function(v){return l.r=c(v),l.g=f(v),l.b=d(v),l.opacity=h(v),l+""}}return a.gamma=e,a})(1);function M8(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,a=t.slice(),l;return function(o){for(l=0;ln&&(o=t.slice(n,o),f[c]?f[c]+=o:f[++c]=o),(a=a[0])===(l=l[0])?f[c]?f[c]+=l:f[++c]=l:(f[++c]=null,d.push({i:c,x:ff(a,l)})),n=rp.lastIndex;return nt&&(n=e,e=t,t=n),function(a){return Math.max(e,Math.min(t,a))}}function B8(e,t,n){var a=e[0],l=e[1],o=t[0],c=t[1];return l2?I8:B8,d=h=null,p}function p(b){return b==null||isNaN(b=+b)?o:(d||(d=f(e.map(a),t,n)))(a(c(b)))}return p.invert=function(b){return c(l((h||(h=f(t,e.map(a),ff)))(b)))},p.domain=function(b){return arguments.length?(e=Array.from(b,df),v()):e.slice()},p.range=function(b){return arguments.length?(t=Array.from(b),v()):t.slice()},p.rangeRound=function(b){return t=Array.from(b),n=vy,v()},p.clamp=function(b){return arguments.length?(c=b?!0:en,v()):c!==en},p.interpolate=function(b){return arguments.length?(n=b,v()):n},p.unknown=function(b){return arguments.length?(o=b,p):o},function(b,x){return a=b,l=x,v()}}function py(){return nd()(en,en)}function H8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function hf(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),a=e.slice(0,n);return[a.length>1?a[0]+a.slice(2):a,+e.slice(n+1)]}function Tl(e){return e=hf(Math.abs(e)),e?e[1]:NaN}function K8(e,t){return function(n,a){for(var l=n.length,o=[],c=0,f=e[0],d=0;l>0&&f>0&&(d+f+1>a&&(f=Math.max(1,a-d)),o.push(n.substring(l-=f,l+f)),!((d+=f+1)>a));)f=e[c=(c+1)%e.length];return o.reverse().join(t)}}function Y8(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var G8=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bo(e){if(!(t=G8.exec(e)))throw new Error("invalid format: "+e);var t;return new yy({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]})}bo.prototype=yy.prototype;function yy(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+""}yy.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 V8(e){e:for(var t=e.length,n=1,a=-1,l;n0&&(a=0);break}return a>0?e.slice(0,a)+e.slice(l+1):e}var mf;function X8(e,t){var n=hf(e,t);if(!n)return mf=void 0,e.toPrecision(t);var a=n[0],l=n[1],o=l-(mf=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,c=a.length;return o===c?a:o>c?a+new Array(o-c+1).join("0"):o>0?a.slice(0,o)+"."+a.slice(o):"0."+new Array(1-o).join("0")+hf(e,Math.max(0,t+o-1))[0]}function P2(e,t){var n=hf(e,t);if(!n)return e+"";var a=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+a:a.length>l+1?a.slice(0,l+1)+"."+a.slice(l+1):a+new Array(l-a.length+2).join("0")}const z2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:H8,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)=>P2(e*100,t),r:P2,s:X8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function R2(e){return e}var L2=Array.prototype.map,U2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function F8(e){var t=e.grouping===void 0||e.thousands===void 0?R2:K8(L2.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",a=e.currency===void 0?"":e.currency[1]+"",l=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?R2:Y8(L2.call(e.numerals,String)),c=e.percent===void 0?"%":e.percent+"",f=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function h(p,b){p=bo(p);var x=p.fill,O=p.align,j=p.sign,_=p.symbol,E=p.zero,N=p.width,T=p.comma,C=p.precision,k=p.trim,M=p.type;M==="n"?(T=!0,M="g"):z2[M]||(C===void 0&&(C=12),k=!0,M="g"),(E||x==="0"&&O==="=")&&(E=!0,x="0",O="=");var L=(b&&b.prefix!==void 0?b.prefix:"")+(_==="$"?n:_==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():""),W=(_==="$"?a:/[%p]/.test(M)?c:"")+(b&&b.suffix!==void 0?b.suffix:""),re=z2[M],H=/[defgprs%]/.test(M);C=C===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function $(K){var ce=L,ue=W,ve,I,ee;if(M==="c")ue=re(K)+ue,K="";else{K=+K;var z=K<0||1/K<0;if(K=isNaN(K)?d:re(Math.abs(K),C),k&&(K=V8(K)),z&&+K==0&&j!=="+"&&(z=!1),ce=(z?j==="("?j:f:j==="-"||j==="("?"":j)+ce,ue=(M==="s"&&!isNaN(K)&&mf!==void 0?U2[8+mf/3]:"")+ue+(z&&j==="("?")":""),H){for(ve=-1,I=K.length;++veee||ee>57){ue=(ee===46?l+K.slice(ve+1):K.slice(ve))+ue,K=K.slice(0,ve);break}}}T&&!E&&(K=t(K,1/0));var G=ce.length+K.length+ue.length,ne=G>1)+ce+K+ue+ne.slice(G);break;default:K=ne+ce+K+ue;break}return o(K)}return $.toString=function(){return p+""},$}function v(p,b){var x=Math.max(-8,Math.min(8,Math.floor(Tl(b)/3)))*3,O=Math.pow(10,-x),j=h((p=bo(p),p.type="f",p),{suffix:U2[8+x/3]});return function(_){return j(O*_)}}return{format:h,formatPrefix:v}}var Sc,gy,rN;Z8({thousands:",",grouping:[3],currency:["$",""]});function Z8(e){return Sc=F8(e),gy=Sc.format,rN=Sc.formatPrefix,Sc}function Q8(e){return Math.max(0,-Tl(Math.abs(e)))}function W8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Tl(t)/3)))*3-Tl(Math.abs(e)))}function J8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Tl(t)-Tl(e))+1}function aN(e,t,n,a){var l=s0(e,t,n),o;switch(a=bo(a??",f"),a.type){case"s":{var c=Math.max(Math.abs(e),Math.abs(t));return a.precision==null&&!isNaN(o=W8(l,c))&&(a.precision=o),rN(a,c)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(o=J8(l,Math.max(Math.abs(e),Math.abs(t))))&&(a.precision=o-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(o=Q8(l))&&(a.precision=o-(a.type==="%")*2);break}}return gy(a)}function qa(e){var t=e.domain;return e.ticks=function(n){var a=t();return u0(a[0],a[a.length-1],n??10)},e.tickFormat=function(n,a){var l=t();return aN(l[0],l[l.length-1],n??10,a)},e.nice=function(n){n==null&&(n=10);var a=t(),l=0,o=a.length-1,c=a[l],f=a[o],d,h,v=10;for(f0;){if(h=o0(c,f,n),h===d)return a[l]=c,a[o]=f,t(a);if(h>0)c=Math.floor(c/h)*h,f=Math.ceil(f/h)*h;else if(h<0)c=Math.ceil(c*h)/h,f=Math.floor(f*h)/h;else break;d=h}return e},e}function iN(){var e=py();return e.copy=function(){return ko(e,iN())},Fn.apply(e,arguments),qa(e)}function lN(e){var t;function n(a){return a==null||isNaN(a=+a)?t:a}return n.invert=n,n.domain=n.range=function(a){return arguments.length?(e=Array.from(a,df),n):e.slice()},n.unknown=function(a){return arguments.length?(t=a,n):t},n.copy=function(){return lN(e).unknown(t)},e=arguments.length?Array.from(e,df):[0,1],qa(n)}function uN(e,t){e=e.slice();var n=0,a=e.length-1,l=e[n],o=e[a],c;return oMath.pow(e,t)}function aL(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 B2(e){return(t,n)=>-e(-t,n)}function by(e){const t=e($2,q2),n=t.domain;let a=10,l,o;function c(){return l=aL(a),o=rL(a),n()[0]<0?(l=B2(l),o=B2(o),e(eL,tL)):e($2,q2),t}return t.base=function(f){return arguments.length?(a=+f,c()):a},t.domain=function(f){return arguments.length?(n(f),c()):n()},t.ticks=f=>{const d=n();let h=d[0],v=d[d.length-1];const p=v0){for(;b<=x;++b)for(O=1;Ov)break;E.push(j)}}else for(;b<=x;++b)for(O=a-1;O>=1;--O)if(j=b>0?O/o(-b):O*o(b),!(jv)break;E.push(j)}E.length*2<_&&(E=u0(h,v,_))}else E=u0(b,x,Math.min(x-b,_)).map(o);return p?E.reverse():E},t.tickFormat=(f,d)=>{if(f==null&&(f=10),d==null&&(d=a===10?"s":","),typeof d!="function"&&(!(a%1)&&(d=bo(d)).precision==null&&(d.trim=!0),d=gy(d)),f===1/0)return d;const h=Math.max(1,a*f/t.ticks().length);return v=>{let p=v/o(Math.round(l(v)));return p*an(uN(n(),{floor:f=>o(Math.floor(l(f))),ceil:f=>o(Math.ceil(l(f)))})),t}function oN(){const e=by(nd()).domain([1,10]);return e.copy=()=>ko(e,oN()).base(e.base()),Fn.apply(e,arguments),e}function I2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function H2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xy(e){var t=1,n=e(I2(t),H2(t));return n.constant=function(a){return arguments.length?e(I2(t=+a),H2(t)):t},qa(n)}function sN(){var e=xy(nd());return e.copy=function(){return ko(e,sN()).constant(e.constant())},Fn.apply(e,arguments)}function K2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iL(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function lL(e){return e<0?-e*e:e*e}function Sy(e){var t=e(en,en),n=1;function a(){return n===1?e(en,en):n===.5?e(iL,lL):e(K2(n),K2(1/n))}return t.exponent=function(l){return arguments.length?(n=+l,a()):n},qa(t)}function wy(){var e=Sy(nd());return e.copy=function(){return ko(e,wy()).exponent(e.exponent())},Fn.apply(e,arguments),e}function uL(){return wy.apply(null,arguments).exponent(.5)}function Y2(e){return Math.sign(e)*e*e}function oL(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function cN(){var e=py(),t=[0,1],n=!1,a;function l(o){var c=oL(e(o));return isNaN(c)?a:n?Math.round(c):c}return l.invert=function(o){return e.invert(Y2(o))},l.domain=function(o){return arguments.length?(e.domain(o),l):e.domain()},l.range=function(o){return arguments.length?(e.range((t=Array.from(o,df)).map(Y2)),l):t.slice()},l.rangeRound=function(o){return l.range(o).round(!0)},l.round=function(o){return arguments.length?(n=!!o,l):n},l.clamp=function(o){return arguments.length?(e.clamp(o),l):e.clamp()},l.unknown=function(o){return arguments.length?(a=o,l):a},l.copy=function(){return cN(e.domain(),t).round(n).clamp(e.clamp()).unknown(a)},Fn.apply(l,arguments),qa(l)}function fN(){var e=[],t=[],n=[],a;function l(){var c=0,f=Math.max(1,t.length);for(n=new Array(f-1);++c0?n[f-1]:e[0],f=n?[a[n-1],t]:[a[h-1],a[h]]},c.unknown=function(d){return arguments.length&&(o=d),c},c.thresholds=function(){return a.slice()},c.copy=function(){return dN().domain([e,t]).range(l).unknown(o)},Fn.apply(qa(c),arguments)}function hN(){var e=[.5],t=[0,1],n,a=1;function l(o){return o!=null&&o<=o?t[Co(e,o,0,a)]:n}return l.domain=function(o){return arguments.length?(e=Array.from(o),a=Math.min(e.length,t.length-1),l):e.slice()},l.range=function(o){return arguments.length?(t=Array.from(o),a=Math.min(e.length,t.length-1),l):t.slice()},l.invertExtent=function(o){var c=t.indexOf(o);return[e[c-1],e[c]]},l.unknown=function(o){return arguments.length?(n=o,l):n},l.copy=function(){return hN().domain(e).range(t).unknown(n)},Fn.apply(l,arguments)}const ap=new Date,ip=new Date;function Et(e,t,n,a){function l(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return l.floor=o=>(e(o=new Date(+o)),o),l.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),l.round=o=>{const c=l(o),f=l.ceil(o);return o-c(t(o=new Date(+o),c==null?1:Math.floor(c)),o),l.range=(o,c,f)=>{const d=[];if(o=l.ceil(o),f=f==null?1:Math.floor(f),!(o0))return d;let h;do d.push(h=new Date(+o)),t(o,f),e(o);while(hEt(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,f)=>{if(c>=c)if(f<0)for(;++f<=0;)for(;t(c,-1),!o(c););else for(;--f>=0;)for(;t(c,1),!o(c););}),n&&(l.count=(o,c)=>(ap.setTime(+o),ip.setTime(+c),e(ap),e(ip),Math.floor(n(ap,ip))),l.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?l.filter(a?c=>a(c)%o===0:c=>l.count(0,c)%o===0):l)),l}const vf=Et(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);vf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Et(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):vf);vf.range;const Br=1e3,Yn=Br*60,Ir=Yn*60,Vr=Ir*24,jy=Vr*7,G2=Vr*30,lp=Vr*365,mi=Et(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getUTCSeconds());mi.range;const Oy=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Br)},(e,t)=>{e.setTime(+e+t*Yn)},(e,t)=>(t-e)/Yn,e=>e.getMinutes());Oy.range;const _y=Et(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Yn)},(e,t)=>(t-e)/Yn,e=>e.getUTCMinutes());_y.range;const Ay=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Br-e.getMinutes()*Yn)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getHours());Ay.range;const Ey=Et(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getUTCHours());Ey.range;const Po=Et(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Yn)/Vr,e=>e.getDate()-1);Po.range;const rd=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>e.getUTCDate()-1);rd.range;const mN=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>Math.floor(e/Vr));mN.range;function Ei(e){return Et(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())*Yn)/jy)}const ad=Ei(0),pf=Ei(1),sL=Ei(2),cL=Ei(3),Ml=Ei(4),fL=Ei(5),dL=Ei(6);ad.range;pf.range;sL.range;cL.range;Ml.range;fL.range;dL.range;function Ni(e){return Et(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)/jy)}const id=Ni(0),yf=Ni(1),hL=Ni(2),mL=Ni(3),Cl=Ni(4),vL=Ni(5),pL=Ni(6);id.range;yf.range;hL.range;mL.range;Cl.range;vL.range;pL.range;const Ny=Et(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());Ny.range;const Ty=Et(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());Ty.range;const Xr=Et(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());Xr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(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)});Xr.range;const Fr=Et(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());Fr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(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)});Fr.range;function vN(e,t,n,a,l,o){const c=[[mi,1,Br],[mi,5,5*Br],[mi,15,15*Br],[mi,30,30*Br],[o,1,Yn],[o,5,5*Yn],[o,15,15*Yn],[o,30,30*Yn],[l,1,Ir],[l,3,3*Ir],[l,6,6*Ir],[l,12,12*Ir],[a,1,Vr],[a,2,2*Vr],[n,1,jy],[t,1,G2],[t,3,3*G2],[e,1,lp]];function f(h,v,p){const b=v_).right(c,b);if(x===c.length)return e.every(s0(h/lp,v/lp,p));if(x===0)return vf.every(Math.max(s0(h,v,p),1));const[O,j]=c[b/c[x-1][2]53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Ce=op(Ku(ae.y,0,1)),Ut=Ce.getUTCDay(),Ce=Ut>4||Ut===0?yf.ceil(Ce):yf(Ce),Ce=rd.offset(Ce,(ae.V-1)*7),ae.y=Ce.getUTCFullYear(),ae.m=Ce.getUTCMonth(),ae.d=Ce.getUTCDate()+(ae.w+6)%7):(Ce=up(Ku(ae.y,0,1)),Ut=Ce.getDay(),Ce=Ut>4||Ut===0?pf.ceil(Ce):pf(Ce),Ce=Po.offset(Ce,(ae.V-1)*7),ae.y=Ce.getFullYear(),ae.m=Ce.getMonth(),ae.d=Ce.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),Ut="Z"in ae?op(Ku(ae.y,0,1)).getUTCDay():up(Ku(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(Ut+5)%7:ae.w+ae.U*7-(Ut+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,op(ae)):up(ae)}}function W(Q,Se,_e,ae){for(var Lt=0,Ce=Se.length,Ut=_e.length,$t,br;Lt=Ut)return-1;if($t=Se.charCodeAt(Lt++),$t===37){if($t=Se.charAt(Lt++),br=k[$t in V2?Se.charAt(Lt++):$t],!br||(ae=br(Q,_e,ae))<0)return-1}else if($t!=_e.charCodeAt(ae++))return-1}return ae}function re(Q,Se,_e){var ae=h.exec(Se.slice(_e));return ae?(Q.p=v.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function H(Q,Se,_e){var ae=x.exec(Se.slice(_e));return ae?(Q.w=O.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function $(Q,Se,_e){var ae=p.exec(Se.slice(_e));return ae?(Q.w=b.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function K(Q,Se,_e){var ae=E.exec(Se.slice(_e));return ae?(Q.m=N.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function ce(Q,Se,_e){var ae=j.exec(Se.slice(_e));return ae?(Q.m=_.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function ue(Q,Se,_e){return W(Q,t,Se,_e)}function ve(Q,Se,_e){return W(Q,n,Se,_e)}function I(Q,Se,_e){return W(Q,a,Se,_e)}function ee(Q){return c[Q.getDay()]}function z(Q){return o[Q.getDay()]}function G(Q){return d[Q.getMonth()]}function ne(Q){return f[Q.getMonth()]}function P(Q){return l[+(Q.getHours()>=12)]}function F(Q){return 1+~~(Q.getMonth()/3)}function ie(Q){return c[Q.getUTCDay()]}function le(Q){return o[Q.getUTCDay()]}function ye(Q){return d[Q.getUTCMonth()]}function be(Q){return f[Q.getUTCMonth()]}function he(Q){return l[+(Q.getUTCHours()>=12)]}function ut(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var Se=M(Q+="",T);return Se.toString=function(){return Q},Se},parse:function(Q){var Se=L(Q+="",!1);return Se.toString=function(){return Q},Se},utcFormat:function(Q){var Se=M(Q+="",C);return Se.toString=function(){return Q},Se},utcParse:function(Q){var Se=L(Q+="",!0);return Se.toString=function(){return Q},Se}}}var V2={"-":"",_:" ",0:"0"},Rt=/^\s*\d+/,wL=/^%/,jL=/[\\^$*+?|[\]().{}]/g;function Pe(e,t,n){var a=e<0?"-":"",l=(a?-e:e)+"",o=l.length;return a+(o[t.toLowerCase(),n]))}function _L(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.w=+a[0],n+a[0].length):-1}function AL(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.u=+a[0],n+a[0].length):-1}function EL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.U=+a[0],n+a[0].length):-1}function NL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.V=+a[0],n+a[0].length):-1}function TL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.W=+a[0],n+a[0].length):-1}function X2(e,t,n){var a=Rt.exec(t.slice(n,n+4));return a?(e.y=+a[0],n+a[0].length):-1}function F2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.y=+a[0]+(+a[0]>68?1900:2e3),n+a[0].length):-1}function ML(e,t,n){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return a?(e.Z=a[1]?0:-(a[2]+(a[3]||"00")),n+a[0].length):-1}function CL(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.q=a[0]*3-3,n+a[0].length):-1}function DL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.m=a[0]-1,n+a[0].length):-1}function Z2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.d=+a[0],n+a[0].length):-1}function kL(e,t,n){var a=Rt.exec(t.slice(n,n+3));return a?(e.m=0,e.d=+a[0],n+a[0].length):-1}function Q2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.H=+a[0],n+a[0].length):-1}function PL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.M=+a[0],n+a[0].length):-1}function zL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.S=+a[0],n+a[0].length):-1}function RL(e,t,n){var a=Rt.exec(t.slice(n,n+3));return a?(e.L=+a[0],n+a[0].length):-1}function LL(e,t,n){var a=Rt.exec(t.slice(n,n+6));return a?(e.L=Math.floor(a[0]/1e3),n+a[0].length):-1}function UL(e,t,n){var a=wL.exec(t.slice(n,n+1));return a?n+a[0].length:-1}function $L(e,t,n){var a=Rt.exec(t.slice(n));return a?(e.Q=+a[0],n+a[0].length):-1}function qL(e,t,n){var a=Rt.exec(t.slice(n));return a?(e.s=+a[0],n+a[0].length):-1}function W2(e,t){return Pe(e.getDate(),t,2)}function BL(e,t){return Pe(e.getHours(),t,2)}function IL(e,t){return Pe(e.getHours()%12||12,t,2)}function HL(e,t){return Pe(1+Po.count(Xr(e),e),t,3)}function pN(e,t){return Pe(e.getMilliseconds(),t,3)}function KL(e,t){return pN(e,t)+"000"}function YL(e,t){return Pe(e.getMonth()+1,t,2)}function GL(e,t){return Pe(e.getMinutes(),t,2)}function VL(e,t){return Pe(e.getSeconds(),t,2)}function XL(e){var t=e.getDay();return t===0?7:t}function FL(e,t){return Pe(ad.count(Xr(e)-1,e),t,2)}function yN(e){var t=e.getDay();return t>=4||t===0?Ml(e):Ml.ceil(e)}function ZL(e,t){return e=yN(e),Pe(Ml.count(Xr(e),e)+(Xr(e).getDay()===4),t,2)}function QL(e){return e.getDay()}function WL(e,t){return Pe(pf.count(Xr(e)-1,e),t,2)}function JL(e,t){return Pe(e.getFullYear()%100,t,2)}function e9(e,t){return e=yN(e),Pe(e.getFullYear()%100,t,2)}function t9(e,t){return Pe(e.getFullYear()%1e4,t,4)}function n9(e,t){var n=e.getDay();return e=n>=4||n===0?Ml(e):Ml.ceil(e),Pe(e.getFullYear()%1e4,t,4)}function r9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Pe(t/60|0,"0",2)+Pe(t%60,"0",2)}function J2(e,t){return Pe(e.getUTCDate(),t,2)}function a9(e,t){return Pe(e.getUTCHours(),t,2)}function i9(e,t){return Pe(e.getUTCHours()%12||12,t,2)}function l9(e,t){return Pe(1+rd.count(Fr(e),e),t,3)}function gN(e,t){return Pe(e.getUTCMilliseconds(),t,3)}function u9(e,t){return gN(e,t)+"000"}function o9(e,t){return Pe(e.getUTCMonth()+1,t,2)}function s9(e,t){return Pe(e.getUTCMinutes(),t,2)}function c9(e,t){return Pe(e.getUTCSeconds(),t,2)}function f9(e){var t=e.getUTCDay();return t===0?7:t}function d9(e,t){return Pe(id.count(Fr(e)-1,e),t,2)}function bN(e){var t=e.getUTCDay();return t>=4||t===0?Cl(e):Cl.ceil(e)}function h9(e,t){return e=bN(e),Pe(Cl.count(Fr(e),e)+(Fr(e).getUTCDay()===4),t,2)}function m9(e){return e.getUTCDay()}function v9(e,t){return Pe(yf.count(Fr(e)-1,e),t,2)}function p9(e,t){return Pe(e.getUTCFullYear()%100,t,2)}function y9(e,t){return e=bN(e),Pe(e.getUTCFullYear()%100,t,2)}function g9(e,t){return Pe(e.getUTCFullYear()%1e4,t,4)}function b9(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Cl(e):Cl.ceil(e),Pe(e.getUTCFullYear()%1e4,t,4)}function x9(){return"+0000"}function eO(){return"%"}function tO(e){return+e}function nO(e){return Math.floor(+e/1e3)}var ml,xN,SN;S9({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 S9(e){return ml=SL(e),xN=ml.format,ml.parse,SN=ml.utcFormat,ml.utcParse,ml}function w9(e){return new Date(e)}function j9(e){return e instanceof Date?+e:+new Date(+e)}function My(e,t,n,a,l,o,c,f,d,h){var v=py(),p=v.invert,b=v.domain,x=h(".%L"),O=h(":%S"),j=h("%I:%M"),_=h("%I %p"),E=h("%a %d"),N=h("%b %d"),T=h("%B"),C=h("%Y");function k(M){return(d(M)t(l/(e.length-1)))},n.quantiles=function(a){return Array.from({length:a+1},(l,o)=>f8(e,o/a))},n.copy=function(){return _N(t).domain(e)},ea.apply(n,arguments)}function ud(){var e=0,t=.5,n=1,a=1,l,o,c,f,d,h=en,v,p=!1,b;function x(j){return isNaN(j=+j)?b:(j=.5+((j=+v(j))-o)*(a*je.chartData,ky=V([Ia],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Py=(e,t,n,a)=>a?ky(e):Ia(e);function La(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(wt(t)&&wt(n))return!0}return!1}function rO(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function TN(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,a]=e,l,o;if(wt(n))l=n;else if(typeof n=="function")return;if(wt(a))o=a;else if(typeof a=="function")return;var c=[l,o];if(La(c))return c}}function N9(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var a=e(t,n);if(La(a))return rO(a,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[l,o]=e,c,f;if(l==="auto")t!=null&&(c=Math.min(...t));else if(me(l))c=l;else if(typeof l=="function")try{t!=null&&(c=l(t?.[0]))}catch{}else if(typeof l=="string"&&mj.test(l)){var d=mj.exec(l);if(d==null||d[1]==null||t==null)c=void 0;else{var h=+d[1];c=t[0]-h}}else c=t?.[0];if(o==="auto")t!=null&&(f=Math.max(...t));else if(me(o))f=o;else if(typeof o=="function")try{t!=null&&(f=o(t?.[1]))}catch{}else if(typeof o=="string"&&vj.test(o)){var v=vj.exec(o);if(v==null||v[1]==null||t==null)f=void 0;else{var p=+v[1];f=t[1]+p}}else f=t?.[1];var b=[c,f];if(La(b))return t==null?b:rO(b,t,n)}}}var Rl=1e9,T9={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Ry,at=!0,Xn="[DecimalError] ",gi=Xn+"Invalid argument: ",zy=Xn+"Exponent out of range: ",Ll=Math.floor,ci=Math.pow,M9=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,An,Pt=1e7,et=7,MN=9007199254740991,gf=Ll(MN/et),oe={};oe.absoluteValue=oe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};oe.comparedTo=oe.cmp=function(e){var t,n,a,l,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(a=o.d.length,l=e.d.length,t=0,n=ae.d[t]^o.s<0?1:-1;return a===l?0:a>l^o.s<0?1:-1};oe.decimalPlaces=oe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*et;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};oe.dividedBy=oe.div=function(e){return Hr(this,new this.constructor(e))};oe.dividedToIntegerBy=oe.idiv=function(e){var t=this,n=t.constructor;return Xe(Hr(t,new n(e),0,1),n.precision)};oe.equals=oe.eq=function(e){return!this.cmp(e)};oe.exponent=function(){return St(this)};oe.greaterThan=oe.gt=function(e){return this.cmp(e)>0};oe.greaterThanOrEqualTo=oe.gte=function(e){return this.cmp(e)>=0};oe.isInteger=oe.isint=function(){return this.e>this.d.length-2};oe.isNegative=oe.isneg=function(){return this.s<0};oe.isPositive=oe.ispos=function(){return this.s>0};oe.isZero=function(){return this.s===0};oe.lessThan=oe.lt=function(e){return this.cmp(e)<0};oe.lessThanOrEqualTo=oe.lte=function(e){return this.cmp(e)<1};oe.logarithm=oe.log=function(e){var t,n=this,a=n.constructor,l=a.precision,o=l+5;if(e===void 0)e=new a(10);else if(e=new a(e),e.s<1||e.eq(An))throw Error(Xn+"NaN");if(n.s<1)throw Error(Xn+(n.s?"NaN":"-Infinity"));return n.eq(An)?new a(0):(at=!1,t=Hr(xo(n,o),xo(e,o),o),at=!0,Xe(t,l))};oe.minus=oe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kN(t,e):CN(t,(e.s=-e.s,e))};oe.modulo=oe.mod=function(e){var t,n=this,a=n.constructor,l=a.precision;if(e=new a(e),!e.s)throw Error(Xn+"NaN");return n.s?(at=!1,t=Hr(n,e,0,1).times(e),at=!0,n.minus(t)):Xe(new a(n),l)};oe.naturalExponential=oe.exp=function(){return DN(this)};oe.naturalLogarithm=oe.ln=function(){return xo(this)};oe.negated=oe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};oe.plus=oe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?CN(t,e):kN(t,(e.s=-e.s,e))};oe.precision=oe.sd=function(e){var t,n,a,l=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(gi+e);if(t=St(l)+1,a=l.d.length-1,n=a*et+1,a=l.d[a],a){for(;a%10==0;a/=10)n--;for(a=l.d[0];a>=10;a/=10)n++}return e&&t>n?t:n};oe.squareRoot=oe.sqrt=function(){var e,t,n,a,l,o,c,f=this,d=f.constructor;if(f.s<1){if(!f.s)return new d(0);throw Error(Xn+"NaN")}for(e=St(f),at=!1,l=Math.sqrt(+f),l==0||l==1/0?(t=hr(f.d),(t.length+e)%2==0&&(t+="0"),l=Math.sqrt(t),e=Ll((e+1)/2)-(e<0||e%2),l==1/0?t="5e"+e:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),a=new d(t)):a=new d(l.toString()),n=d.precision,l=c=n+3;;)if(o=a,a=o.plus(Hr(f,o,c+2)).times(.5),hr(o.d).slice(0,c)===(t=hr(a.d)).slice(0,c)){if(t=t.slice(c-3,c+1),l==c&&t=="4999"){if(Xe(o,n+1,0),o.times(o).eq(f)){a=o;break}}else if(t!="9999")break;c+=4}return at=!0,Xe(a,n)};oe.times=oe.mul=function(e){var t,n,a,l,o,c,f,d,h,v=this,p=v.constructor,b=v.d,x=(e=new p(e)).d;if(!v.s||!e.s)return new p(0);for(e.s*=v.s,n=v.e+e.e,d=b.length,h=x.length,d=0;){for(t=0,l=d+a;l>a;)f=o[l]+x[a]*b[l-a-1]+t,o[l--]=f%Pt|0,t=f/Pt|0;o[l]=(o[l]+t)%Pt|0}for(;!o[--c];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,at?Xe(e,p.precision):e};oe.toDecimalPlaces=oe.todp=function(e,t){var n=this,a=n.constructor;return n=new a(n),e===void 0?n:(gr(e,0,Rl),t===void 0?t=a.rounding:gr(t,0,8),Xe(n,e+St(n)+1,t))};oe.toExponential=function(e,t){var n,a=this,l=a.constructor;return e===void 0?n=Oi(a,!0):(gr(e,0,Rl),t===void 0?t=l.rounding:gr(t,0,8),a=Xe(new l(a),e+1,t),n=Oi(a,!0,e+1)),n};oe.toFixed=function(e,t){var n,a,l=this,o=l.constructor;return e===void 0?Oi(l):(gr(e,0,Rl),t===void 0?t=o.rounding:gr(t,0,8),a=Xe(new o(l),e+St(l)+1,t),n=Oi(a.abs(),!1,e+St(a)+1),l.isneg()&&!l.isZero()?"-"+n:n)};oe.toInteger=oe.toint=function(){var e=this,t=e.constructor;return Xe(new t(e),St(e)+1,t.rounding)};oe.toNumber=function(){return+this};oe.toPower=oe.pow=function(e){var t,n,a,l,o,c,f=this,d=f.constructor,h=12,v=+(e=new d(e));if(!e.s)return new d(An);if(f=new d(f),!f.s){if(e.s<1)throw Error(Xn+"Infinity");return f}if(f.eq(An))return f;if(a=d.precision,e.eq(An))return Xe(f,a);if(t=e.e,n=e.d.length-1,c=t>=n,o=f.s,c){if((n=v<0?-v:v)<=MN){for(l=new d(An),t=Math.ceil(a/et+4),at=!1;n%2&&(l=l.times(f),iO(l.d,t)),n=Ll(n/2),n!==0;)f=f.times(f),iO(f.d,t);return at=!0,e.s<0?new d(An).div(l):Xe(l,a)}}else if(o<0)throw Error(Xn+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,f.s=1,at=!1,l=e.times(xo(f,a+h)),at=!0,l=DN(l),l.s=o,l};oe.toPrecision=function(e,t){var n,a,l=this,o=l.constructor;return e===void 0?(n=St(l),a=Oi(l,n<=o.toExpNeg||n>=o.toExpPos)):(gr(e,1,Rl),t===void 0?t=o.rounding:gr(t,0,8),l=Xe(new o(l),e,t),n=St(l),a=Oi(l,e<=n||n<=o.toExpNeg,e)),a};oe.toSignificantDigits=oe.tosd=function(e,t){var n=this,a=n.constructor;return e===void 0?(e=a.precision,t=a.rounding):(gr(e,1,Rl),t===void 0?t=a.rounding:gr(t,0,8)),Xe(new a(n),e,t)};oe.toString=oe.valueOf=oe.val=oe.toJSON=oe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=St(e),n=e.constructor;return Oi(e,t<=n.toExpNeg||t>=n.toExpPos)};function CN(e,t){var n,a,l,o,c,f,d,h,v=e.constructor,p=v.precision;if(!e.s||!t.s)return t.s||(t=new v(e)),at?Xe(t,p):t;if(d=e.d,h=t.d,c=e.e,l=t.e,d=d.slice(),o=c-l,o){for(o<0?(a=d,o=-o,f=h.length):(a=h,l=c,f=d.length),c=Math.ceil(p/et),f=c>f?c+1:f+1,o>f&&(o=f,a.length=1),a.reverse();o--;)a.push(0);a.reverse()}for(f=d.length,o=h.length,f-o<0&&(o=f,a=h,h=d,d=a),n=0;o;)n=(d[--o]=d[o]+h[o]+n)/Pt|0,d[o]%=Pt;for(n&&(d.unshift(n),++l),f=d.length;d[--f]==0;)d.pop();return t.d=d,t.e=l,at?Xe(t,p):t}function gr(e,t,n){if(e!==~~e||en)throw Error(gi+e)}function hr(e){var t,n,a,l=e.length-1,o="",c=e[0];if(l>0){for(o+=c,t=1;tc?1:-1;else for(f=d=0;fl[f]?1:-1;break}return d}function n(a,l,o){for(var c=0;o--;)a[o]-=c,c=a[o]1;)a.shift()}return function(a,l,o,c){var f,d,h,v,p,b,x,O,j,_,E,N,T,C,k,M,L,W,re=a.constructor,H=a.s==l.s?1:-1,$=a.d,K=l.d;if(!a.s)return new re(a);if(!l.s)throw Error(Xn+"Division by zero");for(d=a.e-l.e,L=K.length,k=$.length,x=new re(H),O=x.d=[],h=0;K[h]==($[h]||0);)++h;if(K[h]>($[h]||0)&&--d,o==null?N=o=re.precision:c?N=o+(St(a)-St(l))+1:N=o,N<0)return new re(0);if(N=N/et+2|0,h=0,L==1)for(v=0,K=K[0],N++;(h1&&(K=e(K,v),$=e($,v),L=K.length,k=$.length),C=L,j=$.slice(0,L),_=j.length;_=Pt/2&&++M;do v=0,f=t(K,j,L,_),f<0?(E=j[0],L!=_&&(E=E*Pt+(j[1]||0)),v=E/M|0,v>1?(v>=Pt&&(v=Pt-1),p=e(K,v),b=p.length,_=j.length,f=t(p,j,b,_),f==1&&(v--,n(p,L16)throw Error(zy+St(e));if(!e.s)return new v(An);for(at=!1,f=p,c=new v(.03125);e.abs().gte(.1);)e=e.times(c),h+=5;for(a=Math.log(ci(2,h))/Math.LN10*2+5|0,f+=a,n=l=o=new v(An),v.precision=f;;){if(l=Xe(l.times(e),f),n=n.times(++d),c=o.plus(Hr(l,n,f)),hr(c.d).slice(0,f)===hr(o.d).slice(0,f)){for(;h--;)o=Xe(o.times(o),f);return v.precision=p,t==null?(at=!0,Xe(o,p)):o}o=c}}function St(e){for(var t=e.e*et,n=e.d[0];n>=10;n/=10)t++;return t}function sp(e,t,n){if(t>e.LN10.sd())throw at=!0,n&&(e.precision=n),Error(Xn+"LN10 precision limit exceeded");return Xe(new e(e.LN10),t)}function Ma(e){for(var t="";e--;)t+="0";return t}function xo(e,t){var n,a,l,o,c,f,d,h,v,p=1,b=10,x=e,O=x.d,j=x.constructor,_=j.precision;if(x.s<1)throw Error(Xn+(x.s?"NaN":"-Infinity"));if(x.eq(An))return new j(0);if(t==null?(at=!1,h=_):h=t,x.eq(10))return t==null&&(at=!0),sp(j,h);if(h+=b,j.precision=h,n=hr(O),a=n.charAt(0),o=St(x),Math.abs(o)<15e14){for(;a<7&&a!=1||a==1&&n.charAt(1)>3;)x=x.times(e),n=hr(x.d),a=n.charAt(0),p++;o=St(x),a>1?(x=new j("0."+n),o++):x=new j(a+"."+n.slice(1))}else return d=sp(j,h+2,_).times(o+""),x=xo(new j(a+"."+n.slice(1)),h-b).plus(d),j.precision=_,t==null?(at=!0,Xe(x,_)):x;for(f=c=x=Hr(x.minus(An),x.plus(An),h),v=Xe(x.times(x),h),l=3;;){if(c=Xe(c.times(v),h),d=f.plus(Hr(c,new j(l),h)),hr(d.d).slice(0,h)===hr(f.d).slice(0,h))return f=f.times(2),o!==0&&(f=f.plus(sp(j,h+2,_).times(o+""))),f=Hr(f,new j(p),h),j.precision=_,t==null?(at=!0,Xe(f,_)):f;f=d,l+=2}}function aO(e,t){var n,a,l;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(n<0&&(n=a),n+=+t.slice(a+1),t=t.substring(0,a)):n<0&&(n=t.length),a=0;t.charCodeAt(a)===48;)++a;for(l=t.length;t.charCodeAt(l-1)===48;)--l;if(t=t.slice(a,l),t){if(l-=a,n=n-a-1,e.e=Ll(n/et),e.d=[],a=(n+1)%et,n<0&&(a+=et),agf||e.e<-gf))throw Error(zy+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xe(e,t,n){var a,l,o,c,f,d,h,v,p=e.d;for(c=1,o=p[0];o>=10;o/=10)c++;if(a=t-c,a<0)a+=et,l=t,h=p[v=0];else{if(v=Math.ceil((a+1)/et),o=p.length,v>=o)return e;for(h=o=p[v],c=1;o>=10;o/=10)c++;a%=et,l=a-et+c}if(n!==void 0&&(o=ci(10,c-l-1),f=h/o%10|0,d=t<0||p[v+1]!==void 0||h%o,d=n<4?(f||d)&&(n==0||n==(e.s<0?3:2)):f>5||f==5&&(n==4||d||n==6&&(a>0?l>0?h/ci(10,c-l):0:p[v-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(o=St(e),p.length=1,t=t-o-1,p[0]=ci(10,(et-t%et)%et),e.e=Ll(-t/et)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(a==0?(p.length=v,o=1,v--):(p.length=v+1,o=ci(10,et-a),p[v]=l>0?(h/ci(10,c-l)%ci(10,l)|0)*o:0),d)for(;;)if(v==0){(p[0]+=o)==Pt&&(p[0]=1,++e.e);break}else{if(p[v]+=o,p[v]!=Pt)break;p[v--]=0,o=1}for(a=p.length;p[--a]===0;)p.pop();if(at&&(e.e>gf||e.e<-gf))throw Error(zy+St(e));return e}function kN(e,t){var n,a,l,o,c,f,d,h,v,p,b=e.constructor,x=b.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new b(e),at?Xe(t,x):t;if(d=e.d,p=t.d,a=t.e,h=e.e,d=d.slice(),c=h-a,c){for(v=c<0,v?(n=d,c=-c,f=p.length):(n=p,a=h,f=d.length),l=Math.max(Math.ceil(x/et),f)+2,c>l&&(c=l,n.length=1),n.reverse(),l=c;l--;)n.push(0);n.reverse()}else{for(l=d.length,f=p.length,v=l0;--l)d[f++]=0;for(l=p.length;l>c;){if(d[--l]0?o=o.charAt(0)+"."+o.slice(1)+Ma(a):c>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(l<0?"e":"e+")+l):l<0?(o="0."+Ma(-l-1)+o,n&&(a=n-c)>0&&(o+=Ma(a))):l>=c?(o+=Ma(l+1-c),n&&(a=n-l-1)>0&&(o=o+"."+Ma(a))):((a=l+1)0&&(l+1===c&&(o+="."),o+=Ma(a))),e.s<0?"-"+o:o}function iO(e,t){if(e.length>t)return e.length=t,!0}function PN(e){var t,n,a;function l(o){var c=this;if(!(c instanceof l))return new l(o);if(c.constructor=l,o instanceof l){c.s=o.s,c.e=o.e,c.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(gi+o);if(o>0)c.s=1;else if(o<0)o=-o,c.s=-1;else{c.s=0,c.e=0,c.d=[0];return}if(o===~~o&&o<1e7){c.e=0,c.d=[o];return}return aO(c,o.toString())}else if(typeof o!="string")throw Error(gi+o);if(o.charCodeAt(0)===45?(o=o.slice(1),c.s=-1):c.s=1,M9.test(o))aO(c,o);else throw Error(gi+o)}if(l.prototype=oe,l.ROUND_UP=0,l.ROUND_DOWN=1,l.ROUND_CEIL=2,l.ROUND_FLOOR=3,l.ROUND_HALF_UP=4,l.ROUND_HALF_DOWN=5,l.ROUND_HALF_EVEN=6,l.ROUND_HALF_CEIL=7,l.ROUND_HALF_FLOOR=8,l.clone=PN,l.config=l.set=C9,e===void 0&&(e={}),e)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=l[t+1]&&a<=l[t+2])this[n]=a;else throw Error(gi+n+": "+a);if((a=e[n="LN10"])!==void 0)if(a==Math.LN10)this[n]=new this(a);else throw Error(gi+n+": "+a);return this}var Ry=PN(T9);An=new Ry(1);const Be=Ry;var D9=e=>e,zN={},RN=e=>e===zN,lO=e=>function t(){return arguments.length===0||arguments.length===1&&RN(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},LN=(e,t)=>e===1?t:lO(function(){for(var n=arguments.length,a=new Array(n),l=0;lc!==zN).length;return o>=e?t(...a):LN(e-o,lO(function(){for(var c=arguments.length,f=new Array(c),d=0;dRN(v)?f.shift():v);return t(...h,...f)}))}),k9=e=>LN(e.length,e),m0=(e,t)=>{for(var n=[],a=e;aArray.isArray(t)?t.map(e):Object.keys(t).map(n=>t[n]).map(e)),z9=function(){for(var t=arguments.length,n=new Array(t),a=0;ad(f),o(...arguments))}};function UN(e){var t;return e===0?t=1:t=Math.floor(new Be(e).abs().log(10).toNumber())+1,t}function $N(e,t,n){for(var a=new Be(e),l=0,o=[];a.lt(t)&&l<1e5;)o.push(a.toNumber()),a=a.add(n),l++;return o}var qN=e=>{var[t,n]=e,[a,l]=[t,n];return t>n&&([a,l]=[n,t]),[a,l]},BN=(e,t,n)=>{if(e.lte(0))return new Be(0);var a=UN(e.toNumber()),l=new Be(10).pow(a),o=e.div(l),c=a!==1?.05:.1,f=new Be(Math.ceil(o.div(c).toNumber())).add(n).mul(c),d=f.mul(l);return t?new Be(d.toNumber()):new Be(Math.ceil(d.toNumber()))},R9=(e,t,n)=>{var a=new Be(1),l=new Be(e);if(!l.isint()&&n){var o=Math.abs(e);o<1?(a=new Be(10).pow(UN(e)-1),l=new Be(Math.floor(l.div(a).toNumber())).mul(a)):o>1&&(l=new Be(Math.floor(e)))}else e===0?l=new Be(Math.floor((t-1)/2)):n||(l=new Be(Math.floor(e)));var c=Math.floor((t-1)/2),f=z9(P9(d=>l.add(new Be(d-c).mul(a)).toNumber()),m0);return f(0,t)},IN=function(t,n,a,l){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(a-1)))return{step:new Be(0),tickMin:new Be(0),tickMax:new Be(0)};var c=BN(new Be(n).sub(t).div(a-1),l,o),f;t<=0&&n>=0?f=new Be(0):(f=new Be(t).add(n).div(2),f=f.sub(new Be(f).mod(c)));var d=Math.ceil(f.sub(t).div(c).toNumber()),h=Math.ceil(new Be(n).sub(f).div(c).toNumber()),v=d+h+1;return v>a?IN(t,n,a,l,o+1):(v0?h+(a-v):h,d=n>0?d:d+(a-v)),{step:c,tickMin:f.sub(new Be(d).mul(c)),tickMax:f.add(new Be(h).mul(c))})},L9=function(t){var[n,a]=t,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,c=Math.max(l,2),[f,d]=qN([n,a]);if(f===-1/0||d===1/0){var h=d===1/0?[f,...m0(0,l-1).map(()=>1/0)]:[...m0(0,l-1).map(()=>-1/0),d];return n>a?h.reverse():h}if(f===d)return R9(f,l,o);var{step:v,tickMin:p,tickMax:b}=IN(f,d,c,o,0),x=$N(p,b.add(new Be(.1).mul(v)),v);return n>a?x.reverse():x},U9=function(t,n){var[a,l]=t,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[c,f]=qN([a,l]);if(c===-1/0||f===1/0)return[a,l];if(c===f)return[c];var d=Math.max(n,2),h=BN(new Be(f).sub(c).div(d-1),o,0),v=[...$N(new Be(c),new Be(f),h),f];return o===!1&&(v=v.map(p=>Math.round(p))),a>l?v.reverse():v},$9=e=>e.rootProps.barCategoryGap,zo=e=>e.rootProps.stackOffset,HN=e=>e.rootProps.reverseStackOrder,Ly=e=>e.options.chartName,Uy=e=>e.rootProps.syncId,KN=e=>e.rootProps.syncMethod,$y=e=>e.options.eventEmitter,Vt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},$r={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},_n={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},od=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},q9={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:$r.angleAxisId,includeHidden:!1,name:void 0,reversed:$r.reversed,scale:$r.scale,tick:$r.tick,tickCount:void 0,ticks:void 0,type:$r.type,unit:void 0},B9={allowDataOverflow:_n.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:_n.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_n.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:_n.scale,tick:_n.tick,tickCount:_n.tickCount,ticks:void 0,type:_n.type,unit:void 0},I9={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:$r.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:$r.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:$r.scale,tick:$r.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},H9={allowDataOverflow:_n.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:_n.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_n.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:_n.scale,tick:_n.tick,tickCount:_n.tickCount,ticks:void 0,type:"category",unit:void 0},qy=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?I9:q9,By=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?H9:B9,sd=e=>e.polarOptions,Iy=V([Wr,Jr,zt],YE),YN=V([sd,Iy],(e,t)=>{if(e!=null)return Nn(e.innerRadius,t,0)}),GN=V([sd,Iy],(e,t)=>{if(e!=null)return Nn(e.outerRadius,t,t*.8)}),K9=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},VN=V([sd],K9);V([qy,VN],od);var XN=V([Iy,YN,GN],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});V([By,XN],od);var FN=V([Ge,sd,YN,GN,Wr,Jr],(e,t,n,a,l,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||a==null)){var{cx:c,cy:f,startAngle:d,endAngle:h}=t;return{cx:Nn(c,l,l/2),cy:Nn(f,o,o/2),innerRadius:n,outerRadius:a,startAngle:d,endAngle:h,clockWise:!1}}}),it=(e,t)=>t,Ro=(e,t,n)=>n;function ZN(e){return e?.id}function QN(e,t,n){var{chartData:a=[]}=t,{allowDuplicatedCategory:l,dataKey:o}=n,c=new Map;return e.forEach(f=>{var d,h=(d=f.data)!==null&&d!==void 0?d:a;if(!(h==null||h.length===0)){var v=ZN(f);h.forEach((p,b)=>{var x=o==null||l?b:String(tt(p,o,null)),O=tt(p,f.dataKey,0),j;c.has(x)?j=c.get(x):j={},Object.assign(j,{[v]:O}),c.set(x,j)})}}),Array.from(c.values())}function Hy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var cd=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function fd(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Y9(e,t){if(e.length===t.length){for(var n=0;n{var t=Ge(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Ul=e=>e.tooltip.settings.axisId;function uO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function bf(e){for(var t=1;te.cartesianAxis.xAxis[t],ta=(e,t)=>{var n=WN(e,t);return n??Dt},kt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:v0,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,width:No},JN=(e,t)=>e.cartesianAxis.yAxis[t],na=(e,t)=>{var n=JN(e,t);return n??kt},F9={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:""},Ky=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??F9},lt=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"zAxis":return Ky(e,n);case"angleAxis":return qy(e,n);case"radiusAxis":return By(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Z9=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Lo=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"angleAxis":return qy(e,n);case"radiusAxis":return By(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},eT=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Yy(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 tT=e=>e.graphicalItems.cartesianItems,Q9=V([it,Ro],Yy),Gy=(e,t,n)=>e.filter(n).filter(a=>t?.includeHidden===!0?!0:!a.hide),Uo=V([tT,lt,Q9],Gy,{memoizeOptions:{resultEqualityCheck:fd}}),nT=V([Uo],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Hy)),rT=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),W9=V([Uo],rT),Vy=e=>e.map(t=>t.data).filter(Boolean).flat(1),J9=V([Uo],Vy,{memoizeOptions:{resultEqualityCheck:fd}}),Xy=(e,t)=>{var{chartData:n=[],dataStartIndex:a,dataEndIndex:l}=t;return e.length>0?e:n.slice(a,l+1)},Fy=V([J9,Py],Xy),Zy=(e,t,n)=>t?.dataKey!=null?e.map(a=>({value:tt(a,t.dataKey)})):n.length>0?n.map(a=>a.dataKey).flatMap(a=>e.map(l=>({value:tt(l,a)}))):e.map(a=>({value:a})),dd=V([Fy,lt,Uo],Zy);function aT(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Tc(e){if(pr(e)||e instanceof Date){var t=Number(e);if(wt(t))return t}}function oO(e){if(Array.isArray(e)){var t=[Tc(e[0]),Tc(e[1])];return La(t)?t:void 0}var n=Tc(e);if(n!=null)return[n,n]}function Zr(e){return e.map(Tc).filter(Zk)}function eU(e,t,n){return!n||typeof t!="number"||vr(t)?[]:n.length?Zr(n.flatMap(a=>{var l=tt(e,a.dataKey),o,c;if(Array.isArray(l)?[o,c]=l:o=c=l,!(!wt(o)||!wt(c)))return[t-o,t+c]})):[]}var Tt=e=>{var t=Nt(e),n=Ul(e);return Lo(e,t,n)},$o=V([Tt],e=>e?.dataKey),tU=V([nT,Py,Tt],QN),iT=(e,t,n,a)=>{var l={},o=t.reduce((c,f)=>{if(f.stackId==null)return c;var d=c[f.stackId];return d==null&&(d=[]),d.push(f),c[f.stackId]=d,c},l);return Object.fromEntries(Object.entries(o).map(c=>{var[f,d]=c,h=a?[...d].reverse():d,v=h.map(ZN);return[f,{stackedData:j5(e,v,n),graphicalItems:h}]}))},nU=V([tU,nT,zo,HN],iT),lT=(e,t,n,a)=>{var{dataStartIndex:l,dataEndIndex:o}=t;if(a==null&&n!=="zAxis"){var c=A5(e,l,o);if(!(c!=null&&c[0]===0&&c[1]===0))return c}},rU=V([lt],e=>e.allowDataOverflow),Qy=e=>{var t;if(e==null||!("domain"in e))return v0;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Zr(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:v0},Wy=V([lt],Qy),Jy=V([Wy,rU],TN),aU=V([nU,Ia,it,Jy],lT,{memoizeOptions:{resultEqualityCheck:cd}}),hd=e=>e.errorBars,iU=(e,t,n)=>e.flatMap(a=>t[a.id]).filter(Boolean).filter(a=>aT(n,a)),xf=function(){for(var t=arguments.length,n=new Array(t),a=0;a{var o,c;if(n.length>0&&e.forEach(f=>{n.forEach(d=>{var h,v,p=(h=a[d.id])===null||h===void 0?void 0:h.filter(E=>aT(l,E)),b=tt(f,(v=t.dataKey)!==null&&v!==void 0?v:d.dataKey),x=eU(f,b,p);if(x.length>=2){var O=Math.min(...x),j=Math.max(...x);(o==null||Oc)&&(c=j)}var _=oO(b);_!=null&&(o=o==null?_[0]:Math.min(o,_[0]),c=c==null?_[1]:Math.max(c,_[1]))})}),t?.dataKey!=null&&e.forEach(f=>{var d=oO(tt(f,t.dataKey));d!=null&&(o=o==null?d[0]:Math.min(o,d[0]),c=c==null?d[1]:Math.max(c,d[1]))}),wt(o)&&wt(c))return[o,c]},lU=V([Fy,lt,W9,hd,it],eg,{memoizeOptions:{resultEqualityCheck:cd}});function uU(e){var{value:t}=e;if(pr(t)||t instanceof Date)return t}var oU=(e,t,n)=>{var a=e.map(uU).filter(l=>l!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&jA(a))?FE(0,e.length):t.allowDuplicatedCategory?a:Array.from(new Set(a))},uT=e=>e.referenceElements.dots,$l=(e,t,n)=>e.filter(a=>a.ifOverflow==="extendDomain").filter(a=>t==="xAxis"?a.xAxisId===n:a.yAxisId===n),sU=V([uT,it,Ro],$l),oT=e=>e.referenceElements.areas,cU=V([oT,it,Ro],$l),sT=e=>e.referenceElements.lines,fU=V([sT,it,Ro],$l),cT=(e,t)=>{if(e!=null){var n=Zr(e.map(a=>t==="xAxis"?a.x:a.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},dU=V(sU,it,cT),fT=(e,t)=>{if(e!=null){var n=Zr(e.flatMap(a=>[t==="xAxis"?a.x1:a.y1,t==="xAxis"?a.x2:a.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},hU=V([cU,it],fT);function mU(e){var t;if(e.x!=null)return Zr([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.x);return n==null||n.length===0?[]:Zr(n)}function vU(e){var t;if(e.y!=null)return Zr([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.y);return n==null||n.length===0?[]:Zr(n)}var dT=(e,t)=>{if(e!=null){var n=e.flatMap(a=>t==="xAxis"?mU(a):vU(a));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},pU=V([fU,it],dT),yU=V(dU,pU,hU,(e,t,n)=>xf(e,n,t)),tg=(e,t,n,a,l,o,c,f)=>{if(n!=null)return n;var d=c==="vertical"&&f==="xAxis"||c==="horizontal"&&f==="yAxis",h=d?xf(a,o,l):xf(o,l);return N9(t,h,e.allowDataOverflow)},gU=V([lt,Wy,Jy,aU,lU,yU,Ge,it],tg,{memoizeOptions:{resultEqualityCheck:cd}}),bU=[0,1],ng=(e,t,n,a,l,o,c)=>{if(!((e==null||n==null||n.length===0)&&c===void 0)){var{dataKey:f,type:d}=e,h=$a(t,o);if(h&&f==null){var v;return FE(0,(v=n?.length)!==null&&v!==void 0?v:0)}return d==="category"?oU(a,e,h):l==="expand"?bU:c}},rg=V([lt,Ge,Fy,dd,zo,it,gU],ng),hT=(e,t,n,a,l)=>{if(e!=null){var{scale:o,type:c}=e;if(o==="auto")return t==="radial"&&l==="radiusAxis"?"band":t==="radial"&&l==="angleAxis"?"linear":c==="category"&&a&&(a.indexOf("LineChart")>=0||a.indexOf("AreaChart")>=0||a.indexOf("ComposedChart")>=0&&!n)?"point":c==="category"?"band":"linear";if(typeof o=="string"){var f="scale".concat(Oo(o));return f in eo?f:"point"}}},ql=V([lt,Ge,eT,Ly,it],hT);function xU(e){if(e!=null){if(e in eo)return eo[e]();var t="scale".concat(Oo(e));if(t in eo)return eo[t]()}}function ag(e,t,n,a){if(!(n==null||a==null)){if(typeof e.scale=="function")return e.scale.copy().domain(n).range(a);var l=xU(t);if(l!=null){var o=l.domain(n).range(a);return b5(o),o}}}var ig=(e,t,n)=>{var a=Qy(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto")&&La(e))return L9(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&La(e))return U9(e,t.tickCount,t.allowDecimals)}},lg=V([rg,Lo,ql],ig),ug=(e,t,n,a)=>{if(a!=="angleAxis"&&e?.type==="number"&&La(t)&&Array.isArray(n)&&n.length>0){var l=t[0],o=n[0],c=t[1],f=n[n.length-1];return[Math.min(l,o),Math.max(c,f)]}return t},SU=V([lt,rg,lg,it],ug),wU=V(dd,lt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,a=Array.from(Zr(e.map(p=>p.value))).sort((p,b)=>p-b),l=a[0],o=a[a.length-1];if(l==null||o==null)return 1/0;var c=o-l;if(c===0)return 1/0;for(var f=0;fl,(e,t,n,a,l)=>{if(!wt(e))return 0;var o=t==="vertical"?a.height:a.width;if(l==="gap")return e*o/2;if(l==="no-gap"){var c=Nn(n,e*o),f=e*o/2;return f-c-(f-c)/o*c}return 0}),jU=(e,t,n)=>{var a=ta(e,t);return a==null||typeof a.padding!="string"?0:mT(e,"xAxis",t,n,a.padding)},OU=(e,t,n)=>{var a=na(e,t);return a==null||typeof a.padding!="string"?0:mT(e,"yAxis",t,n,a.padding)},_U=V(ta,jU,(e,t)=>{var n,a;if(e==null)return{left:0,right:0};var{padding:l}=e;return typeof l=="string"?{left:t,right:t}:{left:((n=l.left)!==null&&n!==void 0?n:0)+t,right:((a=l.right)!==null&&a!==void 0?a:0)+t}}),AU=V(na,OU,(e,t)=>{var n,a;if(e==null)return{top:0,bottom:0};var{padding:l}=e;return typeof l=="string"?{top:t,bottom:t}:{top:((n=l.top)!==null&&n!==void 0?n:0)+t,bottom:((a=l.bottom)!==null&&a!==void 0?a:0)+t}}),EU=V([zt,_U,Vf,Gf,(e,t,n)=>n],(e,t,n,a,l)=>{var{padding:o}=a;return l?[o.left,n.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),NU=V([zt,Ge,AU,Vf,Gf,(e,t,n)=>n],(e,t,n,a,l,o)=>{var{padding:c}=l;return o?[a.height-c.bottom,c.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),qo=(e,t,n,a)=>{var l;switch(t){case"xAxis":return EU(e,n,a);case"yAxis":return NU(e,n,a);case"zAxis":return(l=Ky(e,n))===null||l===void 0?void 0:l.range;case"angleAxis":return VN(e);case"radiusAxis":return XN(e,n);default:return}},vT=V([lt,qo],od),md=V([lt,ql,SU,vT],ag);V([Uo,hd,it],iU);function pT(e,t){return e.idt.id?1:0}var vd=(e,t)=>t,pd=(e,t,n)=>n,TU=V(Kf,vd,pd,(e,t,n)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===n).sort(pT)),MU=V(Yf,vd,pd,(e,t,n)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===n).sort(pT)),yT=(e,t)=>({width:e.width,height:t.height}),CU=(e,t)=>{var n=typeof t.width=="number"?t.width:No;return{width:n,height:e.height}},DU=V(zt,ta,yT),kU=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},PU=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},zU=V(Jr,zt,TU,vd,pd,(e,t,n,a,l)=>{var o={},c;return n.forEach(f=>{var d=yT(t,f);c==null&&(c=kU(t,a,e));var h=a==="top"&&!l||a==="bottom"&&l;o[f.id]=c-Number(h)*d.height,c+=(h?-1:1)*d.height}),o}),RU=V(Wr,zt,MU,vd,pd,(e,t,n,a,l)=>{var o={},c;return n.forEach(f=>{var d=CU(t,f);c==null&&(c=PU(t,a,e));var h=a==="left"&&!l||a==="right"&&l;o[f.id]=c-Number(h)*d.width,c+=(h?-1:1)*d.width}),o}),LU=(e,t)=>{var n=ta(e,t);if(n!=null)return zU(e,n.orientation,n.mirror)},UU=V([zt,ta,LU,(e,t)=>t],(e,t,n,a)=>{if(t!=null){var l=n?.[a];return l==null?{x:e.left,y:0}:{x:e.left,y:l}}}),$U=(e,t)=>{var n=na(e,t);if(n!=null)return RU(e,n.orientation,n.mirror)},qU=V([zt,na,$U,(e,t)=>t],(e,t,n,a)=>{if(t!=null){var l=n?.[a];return l==null?{x:0,y:e.top}:{x:l,y:e.top}}}),BU=V(zt,na,(e,t)=>{var n=typeof t.width=="number"?t.width:No;return{width:n,height:e.height}}),gT=(e,t,n,a)=>{if(n!=null){var{allowDuplicatedCategory:l,type:o,dataKey:c}=n,f=$a(e,a),d=t.map(h=>h.value);if(c&&f&&o==="category"&&l&&jA(d))return d}},og=V([Ge,dd,lt,it],gT),bT=(e,t,n,a)=>{if(!(n==null||n.dataKey==null)){var{type:l,scale:o}=n,c=$a(e,a);if(c&&(l==="number"||o!=="auto"))return t.map(f=>f.value)}},sg=V([Ge,dd,Lo,it],bT),sO=V([Ge,Z9,ql,md,og,sg,qo,lg,it],(e,t,n,a,l,o,c,f,d)=>{if(t!=null){var h=$a(e,d);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:d,categoricalDomain:o,duplicateDomain:l,isCategorical:h,niceTicks:f,range:c,realScaleType:n,scale:a}}}),IU=(e,t,n,a,l,o,c,f,d)=>{if(!(t==null||a==null)){var h=$a(e,d),{type:v,ticks:p,tickCount:b}=t,x=n==="scaleBand"&&typeof a.bandwidth=="function"?a.bandwidth()/2:2,O=v==="category"&&a.bandwidth?a.bandwidth()/x:0;O=d==="angleAxis"&&o!=null&&o.length>=2?Wt(o[0]-o[1])*2*O:O;var j=p||l;if(j){var _=j.map((E,N)=>{var T=c?c.indexOf(E):E;return{index:N,coordinate:a(T)+O,value:E,offset:O}});return _.filter(E=>wt(E.coordinate))}return h&&f?f.map((E,N)=>({coordinate:a(E)+O,value:E,index:N,offset:O})).filter(E=>wt(E.coordinate)):a.ticks?a.ticks(b).map(E=>({coordinate:a(E)+O,value:E,offset:O})):a.domain().map((E,N)=>({coordinate:a(E)+O,value:c?c[E]:E,index:N,offset:O}))}},xT=V([Ge,Lo,ql,md,lg,qo,og,sg,it],IU),HU=(e,t,n,a,l,o,c)=>{if(!(t==null||n==null||a==null||a[0]===a[1])){var f=$a(e,c),{tickCount:d}=t,h=0;return h=c==="angleAxis"&&a?.length>=2?Wt(a[0]-a[1])*2*h:h,f&&o?o.map((v,p)=>({coordinate:n(v)+h,value:v,index:p,offset:h})):n.ticks?n.ticks(d).map(v=>({coordinate:n(v)+h,value:v,offset:h})):n.domain().map((v,p)=>({coordinate:n(v)+h,value:l?l[v]:v,index:p,offset:h}))}},ST=V([Ge,Lo,md,qo,og,sg,it],HU),wT=V(lt,md,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})}),KU=V([lt,ql,rg,vT],ag);V((e,t,n)=>Ky(e,n),KU,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})});var YU=V([Ge,Kf,Yf],(e,t,n)=>{switch(e){case"horizontal":return t.some(a=>a.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(a=>a.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),jT=e=>e.options.defaultTooltipEventType,OT=e=>e.options.validateTooltipEventTypes;function _T(e,t,n){if(e==null)return t;var a=e?"axis":"item";return n==null?t:n.includes(a)?a:t}function cg(e,t){var n=jT(e),a=OT(e);return _T(t,n,a)}function GU(e){return de(t=>cg(t,e))}var AT=(e,t)=>{var n,a=Number(t);if(!(vr(a)||t==null))return a>=0?e==null||(n=e[a])===null||n===void 0?void 0:n.value:void 0},VU=e=>e.tooltip.settings,ka={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},XU={itemInteraction:{click:ka,hover:ka},axisInteraction:{click:ka,hover:ka},keyboardInteraction:ka,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}},ET=hn({name:"tooltip",initialState:XU,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:rt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).tooltipItemPayloads.indexOf(n);l>-1&&(e.tooltipItemPayloads[l]=a)},prepare:rt()},removeTooltipEntrySettings:{reducer(e,t){var n=nr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:rt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,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.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.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.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:FU,replaceTooltipEntrySettings:ZU,removeTooltipEntrySettings:QU,setTooltipSettingsState:WU,setActiveMouseOverItemIndex:NT,mouseLeaveItem:JU,mouseLeaveChart:TT,setActiveClickItemIndex:e7,setMouseOverAxisIndex:MT,setMouseClickAxisIndex:t7,setSyncInteraction:p0,setKeyboardInteraction:y0}=ET.actions,n7=ET.reducer;function cO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function wc(e){for(var t=1;t{if(t==null)return ka;var l=l7(e,t,n);if(l==null)return ka;if(l.active)return l;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(u7(l)){if(o)return wc(wc({},l),{},{active:!0})}else if(a!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:a,graphicalItemId:void 0};return wc(wc({},ka),{},{coordinate:l.coordinate})};function o7(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 s7(e,t){var n=o7(e),a=t[0],l=t[1];if(n===void 0)return!1;var o=Math.min(a,l),c=Math.max(a,l);return n>=o&&n<=c}function c7(e,t,n){if(n==null||t==null)return!0;var a=tt(e,t);return a==null||!La(n)?!0:s7(a,n)}var fg=(e,t,n,a)=>{var l=e?.index;if(l==null)return null;var o=Number(l);if(!wt(o))return l;var c=0,f=1/0;t.length>0&&(f=t.length-1);var d=Math.max(c,Math.min(o,f)),h=t[d];return h==null||c7(h,n,a)?String(d):null},DT=(e,t,n,a,l,o,c,f)=>{if(!(o==null||f==null)){var d=c[0],h=d==null?void 0:f(d.positions,o);if(h!=null)return h;var v=l?.[Number(o)];if(v)return n==="horizontal"?{x:v.coordinate,y:(a.top+t)/2}:{x:(a.left+e)/2,y:v.coordinate}}},kT=(e,t,n,a)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var l;if(n==="hover"?l=e.itemInteraction.hover.graphicalItemId:l=e.itemInteraction.click.graphicalItemId,l==null&&a!=null){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(c=>{var f;return((f=c.settings)===null||f===void 0?void 0:f.graphicalItemId)===l})},Bo=e=>e.options.tooltipPayloadSearcher,Bl=e=>e.tooltip;function fO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function dO(e){for(var t=1;t{if(!(t==null||o==null)){var{chartData:f,computedData:d,dataStartIndex:h,dataEndIndex:v}=n,p=[];return e.reduce((b,x)=>{var O,{dataDefinedOnItem:j,settings:_}=x,E=m7(j,f),N=Array.isArray(E)?pE(E,h,v):E,T=(O=_?.dataKey)!==null&&O!==void 0?O:a,C=_?.nameKey,k;if(a&&Array.isArray(N)&&!Array.isArray(N[0])&&c==="axis"?k=OA(N,a,l):k=o(N,t,d,C),Array.isArray(k))k.forEach(L=>{var W=dO(dO({},_),{},{name:L.name,unit:L.unit,color:void 0,fill:void 0});b.push(pj({tooltipEntrySettings:W,dataKey:L.dataKey,payload:L.payload,value:tt(L.payload,L.dataKey),name:L.name}))});else{var M;b.push(pj({tooltipEntrySettings:_,dataKey:T,payload:k,value:tt(k,T),name:(M=tt(k,C))!==null&&M!==void 0?M:_?.name}))}return b},p)}},dg=V([Tt,Ge,eT,Ly,Nt],hT),v7=V([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),p7=V([Nt,Ul],Yy),Il=V([v7,Tt,p7],Gy,{memoizeOptions:{resultEqualityCheck:fd}}),y7=V([Il],e=>e.filter(Hy)),g7=V([Il],Vy,{memoizeOptions:{resultEqualityCheck:fd}}),Hl=V([g7,Ia],Xy),b7=V([y7,Ia,Tt],QN),hg=V([Hl,Tt,Il],Zy),zT=V([Tt],Qy),x7=V([Tt],e=>e.allowDataOverflow),RT=V([zT,x7],TN),S7=V([Il],e=>e.filter(Hy)),w7=V([b7,S7,zo,HN],iT),j7=V([w7,Ia,Nt,RT],lT),O7=V([Il],rT),_7=V([Hl,Tt,O7,hd,Nt],eg,{memoizeOptions:{resultEqualityCheck:cd}}),A7=V([uT,Nt,Ul],$l),E7=V([A7,Nt],cT),N7=V([oT,Nt,Ul],$l),T7=V([N7,Nt],fT),M7=V([sT,Nt,Ul],$l),C7=V([M7,Nt],dT),D7=V([E7,C7,T7],xf),k7=V([Tt,zT,RT,j7,_7,D7,Ge,Nt],tg),Io=V([Tt,Ge,Hl,hg,zo,Nt,k7],ng),P7=V([Io,Tt,dg],ig),z7=V([Tt,Io,P7,Nt],ug),LT=e=>{var t=Nt(e),n=Ul(e),a=!1;return qo(e,t,n,a)},UT=V([Tt,LT],od),$T=V([Tt,dg,z7,UT],ag),R7=V([Ge,hg,Tt,Nt],gT),L7=V([Ge,hg,Tt,Nt],bT),U7=(e,t,n,a,l,o,c,f)=>{if(t){var{type:d}=t,h=$a(e,f);if(a){var v=n==="scaleBand"&&a.bandwidth?a.bandwidth()/2:2,p=d==="category"&&a.bandwidth?a.bandwidth()/v:0;return p=f==="angleAxis"&&l!=null&&l?.length>=2?Wt(l[0]-l[1])*2*p:p,h&&c?c.map((b,x)=>({coordinate:a(b)+p,value:b,index:x,offset:p})):a.domain().map((b,x)=>({coordinate:a(b)+p,value:o?o[b]:b,index:x,offset:p}))}}},ra=V([Ge,Tt,dg,$T,LT,R7,L7,Nt],U7),mg=V([jT,OT,VU],(e,t,n)=>_T(n.shared,e,t)),qT=e=>e.tooltip.settings.trigger,vg=e=>e.tooltip.settings.defaultIndex,Ho=V([Bl,mg,qT,vg],CT),Dl=V([Ho,Hl,$o,Io],fg),BT=V([ra,Dl],AT),IT=V([Ho],e=>{if(e)return e.dataKey}),$7=V([Ho],e=>{if(e)return e.graphicalItemId}),HT=V([Bl,mg,qT,vg],kT),q7=V([Wr,Jr,Ge,zt,ra,vg,HT,Bo],DT),B7=V([Ho,q7],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),I7=V([Ho],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),H7=V([HT,Dl,Ia,$o,BT,Bo,mg],PT),K7=V([H7],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function hO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function mO(e){for(var t=1;tde(Tt),F7=()=>{var e=X7(),t=de(ra),n=de($T);return Qc(!e||!n?void 0:mO(mO({},e),{},{scale:n}),t)};function vO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vl(e){for(var t=1;t{var l=t.find(o=>o&&o.index===n);if(l){if(e==="horizontal")return{x:l.coordinate,y:a.chartY};if(e==="vertical")return{x:a.chartX,y:l.coordinate}}return{x:0,y:0}},e$=(e,t,n,a)=>{var l=t.find(h=>h&&h.index===n);if(l){if(e==="centric"){var o=l.coordinate,{radius:c}=a;return vl(vl(vl({},a),xt(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var f=l.coordinate,{angle:d}=a;return vl(vl(vl({},a),xt(a.cx,a.cy,f,d)),{},{angle:d,radius:f})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function t$(e,t){var{chartX:n,chartY:a}=e;return n>=t.left&&n<=t.left+t.width&&a>=t.top&&a<=t.top+t.height}var KT=(e,t,n,a,l)=>{var o,c=(o=t?.length)!==null&&o!==void 0?o:0;if(c<=1||e==null)return 0;if(a==="angleAxis"&&l!=null&&Math.abs(Math.abs(l[1]-l[0])-360)<=1e-6)for(var f=0;f0?(d=n[f-1])===null||d===void 0?void 0:d.coordinate:(h=n[c-1])===null||h===void 0?void 0:h.coordinate,O=(v=n[f])===null||v===void 0?void 0:v.coordinate,j=f>=c-1?(p=n[0])===null||p===void 0?void 0:p.coordinate:(b=n[f+1])===null||b===void 0?void 0:b.coordinate,_=void 0;if(!(x==null||O==null||j==null))if(Wt(O-x)!==Wt(j-O)){var E=[];if(Wt(j-O)===Wt(l[1]-l[0])){_=j;var N=O+l[1]-l[0];E[0]=Math.min(N,(N+x)/2),E[1]=Math.max(N,(N+x)/2)}else{_=x;var T=j+l[1]-l[0];E[0]=Math.min(O,(T+O)/2),E[1]=Math.max(O,(T+O)/2)}var C=[Math.min(O,(_+O)/2),Math.max(O,(_+O)/2)];if(e>C[0]&&e<=C[1]||e>=E[0]&&e<=E[1]){var k;return(k=n[f])===null||k===void 0?void 0:k.index}}else{var M=Math.min(x,j),L=Math.max(x,j);if(e>(M+O)/2&&e<=(L+O)/2){var W;return(W=n[f])===null||W===void 0?void 0:W.index}}}else if(t)for(var re=0;re(H.coordinate+K.coordinate)/2||re>0&&re(H.coordinate+K.coordinate)/2&&e<=(H.coordinate+$.coordinate)/2)return H.index}}return-1},n$=()=>de(Ly),pg=(e,t)=>t,YT=(e,t,n)=>n,yg=(e,t,n,a)=>a,r$=V(ra,e=>kf(e,t=>t.coordinate)),gg=V([Bl,pg,YT,yg],CT),bg=V([gg,Hl,$o,Io],fg),a$=(e,t,n)=>{if(t!=null){var a=Bl(e);return t==="axis"?n==="hover"?a.axisInteraction.hover.dataKey:a.axisInteraction.click.dataKey:n==="hover"?a.itemInteraction.hover.dataKey:a.itemInteraction.click.dataKey}},GT=V([Bl,pg,YT,yg],kT),Sf=V([Wr,Jr,Ge,zt,ra,yg,GT,Bo],DT),i$=V([gg,Sf],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),VT=V([ra,bg],AT),l$=V([GT,bg,Ia,$o,VT,Bo,pg],PT),u$=V([gg,bg],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),o$=(e,t,n,a,l,o,c)=>{if(!(!e||!n||!a||!l)&&t$(e,c)){var f=E5(e,t),d=KT(f,o,l,n,a),h=J7(t,l,d,e);return{activeIndex:String(d),activeCoordinate:h}}},s$=(e,t,n,a,l,o,c)=>{if(!(!e||!a||!l||!o||!n)){var f=K6(e,n);if(f){var d=N5(f,t),h=KT(d,c,o,a,l),v=e$(t,o,h,f);return{activeIndex:String(h),activeCoordinate:v}}}},c$=(e,t,n,a,l,o,c,f)=>{if(!(!e||!t||!a||!l||!o))return t==="horizontal"||t==="vertical"?o$(e,t,a,l,o,c,f):s$(e,t,n,a,l,o,c)},f$=V(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var a=e[t];if(a!=null)return n?a.panoramaElement:a.element}}),d$=V(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(a=>parseInt(a,10)).concat(Object.values(Vt)),n=Array.from(new Set(t));return n.sort((a,l)=>a-l)},{memoizeOptions:{resultEqualityCheck:Y9}});function pO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function yO(e){for(var t=1;tyO(yO({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),p$)},g$=new Set(Object.values(Vt));function b$(e){return g$.has(e)}var XT=hn({name:"zIndex",initialState:y$,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:rt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!b$(n)&&delete e.zIndexMap[n])},prepare:rt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:a,isPanorama:l}=t.payload;e.zIndexMap[n]?l?e.zIndexMap[n].panoramaElement=a:e.zIndexMap[n].element=a:e.zIndexMap[n]={consumers:0,element:l?void 0:a,panoramaElement:l?a:void 0}},prepare:rt()},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:rt()}}}),{registerZIndexPortal:x$,unregisterZIndexPortal:S$,registerZIndexPortalElement:w$,unregisterZIndexPortalElement:j$}=XT.actions,O$=XT.reducer;function ir(e){var{zIndex:t,children:n}=e,a=iR(),l=a&&t!==void 0&&t!==0,o=mn(),c=Qe();S.useLayoutEffect(()=>l?(c(x$({zIndex:t})),()=>{c(S$({zIndex:t}))}):_o,[c,t,l]);var f=de(d=>f$(d,t,o));return l?f?$0.createPortal(n,f):null:n}function g0(){return g0=Object.assign?Object.assign.bind():function(e){for(var t=1;tS.useContext(FT),cp={exports:{}},bO;function D$(){return bO||(bO=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function l(d,h,v){this.fn=d,this.context=h,this.once=v||!1}function o(d,h,v,p,b){if(typeof v!="function")throw new TypeError("The listener must be a function");var x=new l(v,p||d,b),O=n?n+h:h;return d._events[O]?d._events[O].fn?d._events[O]=[d._events[O],x]:d._events[O].push(x):(d._events[O]=x,d._eventsCount++),d}function c(d,h){--d._eventsCount===0?d._events=new a:delete d._events[h]}function f(){this._events=new a,this._eventsCount=0}f.prototype.eventNames=function(){var h=[],v,p;if(this._eventsCount===0)return h;for(p in v=this._events)t.call(v,p)&&h.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(v)):h},f.prototype.listeners=function(h){var v=n?n+h:h,p=this._events[v];if(!p)return[];if(p.fn)return[p.fn];for(var b=0,x=p.length,O=new Array(x);b{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),R$=QT.reducer,{createEventEmitter:L$}=QT.actions;function U$(e){return e.tooltip.syncInteraction}var $$={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},WT=hn({name:"chartData",initialState:$$,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:a}=t.payload;n!=null&&(e.dataStartIndex=n),a!=null&&(e.dataEndIndex=a)}}}),{setChartData:SO,setDataStartEndIndexes:q$,setComputedData:KG}=WT.actions,B$=WT.reducer,I$=["x","y"];function wO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function pl(e){for(var t=1;td.rootProps.className);S.useEffect(()=>{if(e==null)return _o;var d=(h,v,p)=>{if(t!==p&&e===h){if(a==="index"){var b;if(c&&v!==null&&v!==void 0&&(b=v.payload)!==null&&b!==void 0&&b.coordinate&&v.payload.sourceViewBox){var x=v.payload.coordinate,{x:O,y:j}=x,_=G$(x,I$),{x:E,y:N,width:T,height:C}=v.payload.sourceViewBox,k=pl(pl({},_),{},{x:c.x+(T?(O-E)/T:0)*c.width,y:c.y+(C?(j-N)/C:0)*c.height});n(pl(pl({},v),{},{payload:pl(pl({},v.payload),{},{coordinate:k})}))}else n(v);return}if(l!=null){var M;if(typeof a=="function"){var L={activeTooltipIndex:v.payload.index==null?void 0:Number(v.payload.index),isTooltipActive:v.payload.active,activeIndex:v.payload.index==null?void 0:Number(v.payload.index),activeLabel:v.payload.label,activeDataKey:v.payload.dataKey,activeCoordinate:v.payload.coordinate},W=a(l,L);M=l[W]}else a==="value"&&(M=l.find(I=>String(I.value)===v.payload.label));var{coordinate:re}=v.payload;if(M==null||v.payload.active===!1||re==null||c==null){n(p0({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:H,y:$}=re,K=Math.min(H,c.x+c.width),ce=Math.min($,c.y+c.height),ue={x:o==="horizontal"?M.coordinate:K,y:o==="horizontal"?ce:M.coordinate},ve=p0({active:v.payload.active,coordinate:ue,dataKey:v.payload.dataKey,index:String(M.index),label:v.payload.label,sourceViewBox:v.payload.sourceViewBox,graphicalItemId:v.payload.graphicalItemId});n(ve)}}};return So.on(b0,d),()=>{So.off(b0,d)}},[f,n,t,e,a,l,o,c])}function F$(){var e=de(Uy),t=de($y),n=Qe();S.useEffect(()=>{if(e==null)return _o;var a=(l,o,c)=>{t!==c&&e===l&&n(q$(o))};return So.on(xO,a),()=>{So.off(xO,a)}},[n,t,e])}function Z$(){var e=Qe();S.useEffect(()=>{e(L$())},[e]),X$(),F$()}function Q$(e,t,n,a,l,o){var c=de(x=>a$(x,e,t)),f=de($y),d=de(Uy),h=de(KN),v=de(U$),p=v?.active,b=Xf();S.useEffect(()=>{if(!p&&d!=null&&f!=null){var x=p0({active:o,coordinate:n,dataKey:c,index:l,label:typeof a=="number"?String(a):a,sourceViewBox:b,graphicalItemId:void 0});So.emit(b0,d,x,f)}},[p,n,c,l,a,f,d,h,o,b])}function jO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function OO(e){for(var t=1;t{L(WU({shared:N,trigger:T,axisId:M,active:l,defaultIndex:W}))},[L,N,T,M,l,W]);var re=Xf(),H=$E(),$=GU(N),{activeIndex:K,isActive:ce}=(t=de(he=>u$(he,$,T,W)))!==null&&t!==void 0?t:{},ue=de(he=>l$(he,$,T,W)),ve=de(he=>VT(he,$,T,W)),I=de(he=>i$(he,$,T,W)),ee=ue,z=C$(),G=(n=l??ce)!==null&&n!==void 0?n:!1,[ne,P]=qA([ee,G]),F=$==="axis"?ve:void 0;Q$($,T,I,F,K,G);var ie=k??z;if(ie==null||re==null||$==null)return null;var le=ee??_O;G||(le=_O),h&&le.length&&(le=zA(le.filter(he=>he.value!=null&&(he.hide!==!0||a.includeHidden)),b,tq));var ye=le.length>0,be=S.createElement(KR,{allowEscapeViewBox:o,animationDuration:c,animationEasing:f,isAnimationActive:v,active:G,coordinate:I,hasPayload:ye,offset:p,position:x,reverseDirection:O,useTranslate3d:j,viewBox:re,wrapperStyle:_,lastBoundingBox:ne,innerRef:P,hasPortalFromProps:!!k},nq(d,OO(OO({},a),{},{payload:le,label:F,active:G,activeIndex:K,coordinate:I,accessibilityLayer:H})));return S.createElement(S.Fragment,null,$0.createPortal(be,ie),G&&S.createElement(M$,{cursor:E,tooltipEventType:$,coordinate:I,payload:le,index:K}))}var yd=e=>null;yd.displayName="Cell";function aq(e,t,n){return(t=iq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iq(e){var t=lq(e,"string");return typeof t=="symbol"?t:t+""}function lq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class uq{constructor(t){aq(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 a=this.cache.keys().next().value;a!=null&&this.cache.delete(a)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function AO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function oq(e){for(var t=1;t{try{var n=document.getElementById(NO);n||(n=document.createElement("span"),n.setAttribute("id",NO),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,hq,t),n.textContent="".concat(e);var a=n.getBoundingClientRect();return{width:a.width,height:a.height}}catch{return{width:0,height:0}}},no=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Jf.isSsr)return{width:0,height:0};if(!JT.enableCache)return TO(t,n);var a=mq(t,n),l=EO.get(a);if(l)return l;var o=TO(t,n);return EO.set(a,o),o},eM;function vq(e,t,n){return(t=pq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pq(e){var t=yq(e,"string");return typeof t=="symbol"?t:t+""}function yq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,CO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,gq=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,bq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,xq={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Sq=["cm","mm","pt","pc","in","Q","px"];function wq(e){return Sq.includes(e)}var xl="NaN";function jq(e,t){return e*xq[t]}class Gt{static parse(t){var n,[,a,l]=(n=bq.exec(t))!==null&&n!==void 0?n:[];return a==null?Gt.NaN:new Gt(parseFloat(a),l??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,vr(t)&&(this.unit=""),n!==""&&!gq.test(n)&&(this.num=NaN,this.unit=""),wq(n)&&(this.num=jq(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return vr(this.num)}}eM=Gt;vq(Gt,"NaN",new eM(NaN,""));function tM(e){if(e==null||e.includes(xl))return xl;for(var t=e;t.includes("*")||t.includes("/");){var n,[,a,l,o]=(n=MO.exec(t))!==null&&n!==void 0?n:[],c=Gt.parse(a??""),f=Gt.parse(o??""),d=l==="*"?c.multiply(f):c.divide(f);if(d.isNaN())return xl;t=t.replace(MO,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,v,p,b]=(h=CO.exec(t))!==null&&h!==void 0?h:[],x=Gt.parse(v??""),O=Gt.parse(b??""),j=p==="+"?x.add(O):x.subtract(O);if(j.isNaN())return xl;t=t.replace(CO,j.toString())}return t}var DO=/\(([^()]*)\)/;function Oq(e){for(var t=e,n;(n=DO.exec(t))!=null;){var[,a]=n;t=t.replace(DO,tM(a))}return t}function _q(e){var t=e.replace(/\s+/g,"");return t=Oq(t),t=tM(t),t}function Aq(e){try{return _q(e)}catch{return xl}}function fp(e){var t=Aq(e.slice(5,-1));return t===xl?"":t}var Eq=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Nq=["dx","dy","angle","className","breakAll"];function x0(){return x0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:a}=e;try{var l=[];_t(t)||(n?l=t.toString().split(""):l=t.toString().split(nM));var o=l.map(f=>({word:f,width:no(f,a).width})),c=n?0:no(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}};function Mq(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var aM=(e,t,n,a)=>e.reduce((l,o)=>{var{word:c,width:f}=o,d=l[l.length-1];if(d&&f!=null&&(t==null||a||d.width+f+ne.reduce((t,n)=>t.width>n.width?t:n),Cq="…",PO=(e,t,n,a,l,o,c,f)=>{var d=e.slice(0,t),h=rM({breakAll:n,style:a,children:d+Cq});if(!h)return[!1,[]];var v=aM(h.wordsWithComputedWidth,o,c,f),p=v.length>l||iM(v).width>Number(o);return[p,v]},Dq=(e,t,n,a,l)=>{var{maxLines:o,children:c,style:f,breakAll:d}=e,h=me(o),v=String(c),p=aM(t,a,n,l);if(!h||l)return p;var b=p.length>o||iM(p).width>Number(a);if(!b)return p;for(var x=0,O=v.length-1,j=0,_;x<=O&&j<=v.length-1;){var E=Math.floor((x+O)/2),N=E-1,[T,C]=PO(v,N,d,f,o,a,n,l),[k]=PO(v,E,d,f,o,a,n,l);if(!T&&!k&&(x=E+1),T&&k&&(O=E-1),!T&&k){_=C;break}j++}return _||p},zO=e=>{var t=_t(e)?[]:e.toString().split(nM);return[{words:t,width:void 0}]},kq=e=>{var{width:t,scaleToFit:n,children:a,style:l,breakAll:o,maxLines:c}=e;if((t||n)&&!Jf.isSsr){var f,d,h=rM({breakAll:o,children:a,style:l});if(h){var{wordsWithComputedWidth:v,spaceWidth:p}=h;f=v,d=p}else return zO(a);return Dq({breakAll:o,children:a,maxLines:c,style:l},f,d,t,!!n)}return zO(a)},lM="#808080",Pq={angle:0,breakAll:!1,capHeight:"0.71em",fill:lM,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},gd=S.forwardRef((e,t)=>{var n=At(e,Pq),{x:a,y:l,lineHeight:o,capHeight:c,fill:f,scaleToFit:d,textAnchor:h,verticalAnchor:v}=n,p=kO(n,Eq),b=S.useMemo(()=>kq({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:d,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,d,p.style,p.width]),{dx:x,dy:O,angle:j,className:_,breakAll:E}=p,N=kO(p,Nq);if(!pr(a)||!pr(l)||b.length===0)return null;var T=Number(a)+(me(x)?x:0),C=Number(l)+(me(O)?O:0);if(!wt(T)||!wt(C))return null;var k;switch(v){case"start":k=fp("calc(".concat(c,")"));break;case"middle":k=fp("calc(".concat((b.length-1)/2," * -").concat(o," + (").concat(c," / 2))"));break;default:k=fp("calc(".concat(b.length-1," * -").concat(o,")"));break}var M=[];if(d){var L=b[0].width,{width:W}=p;M.push("scale(".concat(me(W)&&me(L)?W/L:1,")"))}return j&&M.push("rotate(".concat(j,", ").concat(T,", ").concat(C,")")),M.length&&(N.transform=M.join(" ")),S.createElement("text",x0({},tn(N),{ref:t,x:T,y:C,className:Re("recharts-text",_),textAnchor:h,fill:f.includes("url")?lM:f}),b.map((re,H)=>{var $=re.words.join(E?"":" ");return S.createElement("tspan",{x:T,dy:H===0?k:o,key:"".concat($,"-").concat(H)},$)}))});gd.displayName="Text";var zq=["labelRef"],Rq=["content"];function RO(e,t){if(e==null)return{};var n,a,l=Lq(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{x:t,y:n,upperWidth:a,lowerWidth:l,width:o,height:c,children:f}=e,d=S.useMemo(()=>({x:t,y:n,upperWidth:a,lowerWidth:l,width:o,height:c}),[t,n,a,l,o,c]);return S.createElement(uM.Provider,{value:d},f)},oM=()=>{var e=S.useContext(uM),t=Xf();return e||AE(t)},Iq=S.createContext(null),Hq=()=>{var e=S.useContext(Iq),t=de(FN);return e||t},Kq=e=>{var{value:t,formatter:n}=e,a=_t(e.children)?t:e.children;return typeof n=="function"?n(a):a},xg=e=>e!=null&&typeof e=="function",Yq=(e,t)=>{var n=Wt(t-e),a=Math.min(Math.abs(t-e),360);return n*a},Gq=(e,t,n,a,l)=>{var{offset:o,className:c}=e,{cx:f,cy:d,innerRadius:h,outerRadius:v,startAngle:p,endAngle:b,clockWise:x}=l,O=(h+v)/2,j=Yq(p,b),_=j>=0?1:-1,E,N;switch(t){case"insideStart":E=p+_*o,N=x;break;case"insideEnd":E=b-_*o,N=!x;break;case"end":E=b+_*o,N=x;break;default:throw new Error("Unsupported position ".concat(t))}N=j<=0?N:!N;var T=xt(f,d,O,E),C=xt(f,d,O,E+(N?1:-1)*359),k="M".concat(T.x,",").concat(T.y,` - A`).concat(O,",").concat(O,",0,1,").concat(N?0:1,`, - `).concat(C.x,",").concat(C.y),M=_t(e.id)?uo("recharts-radial-line-"):e.id;return S.createElement("text",qr({},a,{dominantBaseline:"central",className:Re("recharts-radial-bar-label",c)}),S.createElement("defs",null,S.createElement("path",{id:M,d:k})),S.createElement("textPath",{xlinkHref:"#".concat(M)},n))},Vq=(e,t,n)=>{var{cx:a,cy:l,innerRadius:o,outerRadius:c,startAngle:f,endAngle:d}=e,h=(f+d)/2;if(n==="outside"){var{x:v,y:p}=xt(a,l,c+t,h);return{x:v,y:p,textAnchor:v>=a?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"end"};var b=(o+c)/2,{x,y:O}=xt(a,l,b,h);return{x,y:O,textAnchor:"middle",verticalAnchor:"middle"}},S0=e=>"cx"in e&&me(e.cx),Xq=(e,t)=>{var{parentViewBox:n,offset:a,position:l}=e,o;n!=null&&!S0(n)&&(o=n);var{x:c,y:f,upperWidth:d,lowerWidth:h,height:v}=t,p=c,b=c+(d-h)/2,x=(p+b)/2,O=(d+h)/2,j=p+d/2,_=v>=0?1:-1,E=_*a,N=_>0?"end":"start",T=_>0?"start":"end",C=d>=0?1:-1,k=C*a,M=C>0?"end":"start",L=C>0?"start":"end";if(l==="top"){var W={x:p+d/2,y:f-E,textAnchor:"middle",verticalAnchor:N};return mt(mt({},W),o?{height:Math.max(f-o.y,0),width:d}:{})}if(l==="bottom"){var re={x:b+h/2,y:f+v+E,textAnchor:"middle",verticalAnchor:T};return mt(mt({},re),o?{height:Math.max(o.y+o.height-(f+v),0),width:h}:{})}if(l==="left"){var H={x:x-k,y:f+v/2,textAnchor:M,verticalAnchor:"middle"};return mt(mt({},H),o?{width:Math.max(H.x-o.x,0),height:v}:{})}if(l==="right"){var $={x:x+O+k,y:f+v/2,textAnchor:L,verticalAnchor:"middle"};return mt(mt({},$),o?{width:Math.max(o.x+o.width-$.x,0),height:v}:{})}var K=o?{width:O,height:v}:{};return l==="insideLeft"?mt({x:x+k,y:f+v/2,textAnchor:L,verticalAnchor:"middle"},K):l==="insideRight"?mt({x:x+O-k,y:f+v/2,textAnchor:M,verticalAnchor:"middle"},K):l==="insideTop"?mt({x:p+d/2,y:f+E,textAnchor:"middle",verticalAnchor:T},K):l==="insideBottom"?mt({x:b+h/2,y:f+v-E,textAnchor:"middle",verticalAnchor:N},K):l==="insideTopLeft"?mt({x:p+k,y:f+E,textAnchor:L,verticalAnchor:T},K):l==="insideTopRight"?mt({x:p+d-k,y:f+E,textAnchor:M,verticalAnchor:T},K):l==="insideBottomLeft"?mt({x:b+k,y:f+v-E,textAnchor:L,verticalAnchor:N},K):l==="insideBottomRight"?mt({x:b+h-k,y:f+v-E,textAnchor:M,verticalAnchor:N},K):l&&typeof l=="object"&&(me(l.x)||Yr(l.x))&&(me(l.y)||Yr(l.y))?mt({x:c+Nn(l.x,O),y:f+Nn(l.y,v),textAnchor:"end",verticalAnchor:"end"},K):mt({x:j,y:f+v/2,textAnchor:"middle",verticalAnchor:"middle"},K)},Fq={angle:0,offset:5,zIndex:Vt.label,position:"middle",textBreakAll:!1};function Ca(e){var t=At(e,Fq),{viewBox:n,position:a,value:l,children:o,content:c,className:f="",textBreakAll:d,labelRef:h}=t,v=Hq(),p=oM(),b=a==="center"?p:v??p,x,O,j;if(n==null?x=b:S0(n)?x=n:x=AE(n),!x||_t(l)&&_t(o)&&!S.isValidElement(c)&&typeof c!="function")return null;var _=mt(mt({},t),{},{viewBox:x});if(S.isValidElement(c)){var{labelRef:E}=_,N=RO(_,zq);return S.cloneElement(c,N)}if(typeof c=="function"){var{content:T}=_,C=RO(_,Rq);if(O=S.createElement(c,C),S.isValidElement(O))return O}else O=Kq(t);var k=tn(t);if(S0(x)){if(a==="insideStart"||a==="insideEnd"||a==="end")return Gq(t,a,O,k,x);j=Vq(x,t.offset,t.position)}else j=Xq(t,x);return S.createElement(ir,{zIndex:t.zIndex},S.createElement(gd,qr({ref:h,className:Re("recharts-label",f)},k,j,{textAnchor:Mq(k.textAnchor)?k.textAnchor:j.textAnchor,breakAll:d}),O))}Ca.displayName="Label";var Zq=(e,t,n)=>{if(!e)return null;var a={viewBox:t,labelRef:n};return e===!0?S.createElement(Ca,qr({key:"label-implicit"},a)):pr(e)?S.createElement(Ca,qr({key:"label-implicit",value:e},a)):S.isValidElement(e)?e.type===Ca?S.cloneElement(e,mt({key:"label-implicit"},a)):S.createElement(Ca,qr({key:"label-implicit",content:e},a)):xg(e)?S.createElement(Ca,qr({key:"label-implicit",content:e},a)):e&&typeof e=="object"?S.createElement(Ca,qr({},e,{key:"label-implicit"},a)):null};function Qq(e){var{label:t,labelRef:n}=e,a=oM();return Zq(t,a,n)||null}var dp={},hp={},UO;function Wq(){return UO||(UO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(hp)),hp}var mp={},$O;function Jq(){return $O||($O=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(mp)),mp}var qO;function eB(){return qO||(qO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wq(),n=Jq(),a=F0();function l(o){if(a.isArrayLike(o))return t.last(n.toArray(o))}e.last=l})(dp)),dp}var vp,BO;function tB(){return BO||(BO=1,vp=eB().last),vp}var nB=tB();const rB=Qr(nB);var aB=["valueAccessor"],iB=["dataKey","clockWise","id","textBreakAll","zIndex"];function wf(){return wf=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?rB(e.value):e.value,sM=S.createContext(void 0),oB=sM.Provider,cM=S.createContext(void 0),sB=cM.Provider;function cB(){return S.useContext(sM)}function fB(){return S.useContext(cM)}function Cc(e){var{valueAccessor:t=uB}=e,n=IO(e,aB),{dataKey:a,clockWise:l,id:o,textBreakAll:c,zIndex:f}=n,d=IO(n,iB),h=cB(),v=fB(),p=h||v;return!p||!p.length?null:S.createElement(ir,{zIndex:f??Vt.label},S.createElement(dn,{className:"recharts-label-list"},p.map((b,x)=>{var O,j=_t(a)?t(b,x):tt(b&&b.payload,a),_=_t(o)?{}:{id:"".concat(o,"-").concat(x)};return S.createElement(Ca,wf({key:"label-".concat(x)},tn(b),d,_,{fill:(O=n.fill)!==null&&O!==void 0?O:b.fill,parentViewBox:b.parentViewBox,value:j,textBreakAll:c,viewBox:b.viewBox,index:x,zIndex:0}))})))}Cc.displayName="LabelList";function fM(e){var{label:t}=e;return t?t===!0?S.createElement(Cc,{key:"labelList-implicit"}):S.isValidElement(t)||xg(t)?S.createElement(Cc,{key:"labelList-implicit",content:t}):typeof t=="object"?S.createElement(Cc,wf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function w0(){return w0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r:a,className:l}=e,o=Re("recharts-dot",l);return me(t)&&me(n)&&me(a)?S.createElement("circle",w0({},Gn(e),V0(e),{className:o,cx:t,cy:n,r:a})):null},hM=e=>e.graphicalItems.polarItems,dB=V([it,Ro],Yy),bd=V([hM,lt,dB],Gy),hB=V([bd],Vy),xd=V([hB,ky],Xy),mB=V([xd,lt,bd],Zy);V([xd,lt,bd],(e,t,n)=>n.length>0?e.flatMap(a=>n.flatMap(l=>{var o,c=tt(a,(o=t.dataKey)!==null&&o!==void 0?o:l.dataKey);return{value:c,errorDomain:[]}})).filter(Boolean):t?.dataKey!=null?e.map(a=>({value:tt(a,t.dataKey),errorDomain:[]})):e.map(a=>({value:a,errorDomain:[]})));var HO=()=>{},vB=V([xd,lt,bd,hd,it],eg),pB=V([lt,Wy,Jy,HO,vB,HO,Ge,it],tg),mM=V([lt,Ge,xd,mB,zo,it,pB],ng),yB=V([mM,lt,ql],ig);V([lt,mM,yB,it],ug);var gB={radiusAxis:{},angleAxis:{}},vM=hn({name:"polarAxis",initialState:gB,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:YG,removeRadiusAxis:GG,addAngleAxis:VG,removeAngleAxis:XG}=vM.actions,bB=vM.reducer;function KO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function YO(e){for(var t=1;tt,Sg=V([hM,jB],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),OB=[],wg=(e,t,n)=>n?.length===0?OB:n,pM=V([ky,Sg,wg],(e,t,n)=>{var{chartData:a}=e;if(t!=null){var l;if(t?.data!=null&&t.data.length>0?l=t.data:l=a,(!l||!l.length)&&n!=null&&(l=n.map(o=>YO(YO({},t.presentationProps),o.props))),l!=null)return l}}),_B=V([pM,Sg,wg],(e,t,n)=>{if(!(e==null||t==null))return e.map((a,l)=>{var o,c=tt(a,t.nameKey,t.name),f;return n!=null&&(o=n[l])!==null&&o!==void 0&&(o=o.props)!==null&&o!==void 0&&o.fill?f=n[l].props.fill:typeof a=="object"&&a!=null&&"fill"in a?f=a.fill:f=t.fill,{value:Hf(c,t.dataKey),color:f,payload:a,type:t.legendType}})}),AB=V([pM,Sg,wg,zt],(e,t,n,a)=>{if(!(t==null||e==null))return kI({offset:a,pieSettings:t,displayedData:e,cells:n})}),pp={exports:{}},Ye={};var GO;function EB(){if(GO)return Ye;GO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function O(j){if(typeof j=="object"&&j!==null){var _=j.$$typeof;switch(_){case e:switch(j=j.type,j){case n:case l:case a:case d:case h:case b:return j;default:switch(j=j&&j.$$typeof,j){case c:case f:case p:case v:return j;case o:return j;default:return _}}case t:return _}}}return Ye.ContextConsumer=o,Ye.ContextProvider=c,Ye.Element=e,Ye.ForwardRef=f,Ye.Fragment=n,Ye.Lazy=p,Ye.Memo=v,Ye.Portal=t,Ye.Profiler=l,Ye.StrictMode=a,Ye.Suspense=d,Ye.SuspenseList=h,Ye.isContextConsumer=function(j){return O(j)===o},Ye.isContextProvider=function(j){return O(j)===c},Ye.isElement=function(j){return typeof j=="object"&&j!==null&&j.$$typeof===e},Ye.isForwardRef=function(j){return O(j)===f},Ye.isFragment=function(j){return O(j)===n},Ye.isLazy=function(j){return O(j)===p},Ye.isMemo=function(j){return O(j)===v},Ye.isPortal=function(j){return O(j)===t},Ye.isProfiler=function(j){return O(j)===l},Ye.isStrictMode=function(j){return O(j)===a},Ye.isSuspense=function(j){return O(j)===d},Ye.isSuspenseList=function(j){return O(j)===h},Ye.isValidElementType=function(j){return typeof j=="string"||typeof j=="function"||j===n||j===l||j===a||j===d||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===p||j.$$typeof===v||j.$$typeof===c||j.$$typeof===o||j.$$typeof===f||j.$$typeof===x||j.getModuleId!==void 0)},Ye.typeOf=O,Ye}var VO;function NB(){return VO||(VO=1,pp.exports=EB()),pp.exports}var TB=NB(),XO=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",FO=null,yp=null,yM=e=>{if(e===FO&&Array.isArray(yp))return yp;var t=[];return S.Children.forEach(e,n=>{_t(n)||(TB.isFragment(n)?t=t.concat(yM(n.props.children)):t.push(n))}),yp=t,FO=e,t};function gM(e,t){var n=[],a=[];return Array.isArray(t)?a=t.map(l=>XO(l)):a=[XO(t)],yM(e).forEach(l=>{var o=xi(l,"type.displayName")||xi(l,"type.name");o&&a.indexOf(o)!==-1&&n.push(l)}),n}var bM=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,gp={},ZO;function MB(){return ZO||(ZO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const l=n[Symbol.toStringTag];return l==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${l}]`}let a=n;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(n)===a}e.isPlainObject=t})(gp)),gp}var bp,QO;function CB(){return QO||(QO=1,bp=MB().isPlainObject),bp}var DB=CB();const kB=Qr(DB);var WO,JO,e_,t_,n_;function r_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function a_(e){for(var t=1;t{var o=n-a,c;return c=ct(WO||(WO=Vu(["M ",",",""])),e,t),c+=ct(JO||(JO=Vu(["L ",",",""])),e+n,t),c+=ct(e_||(e_=Vu(["L ",",",""])),e+n-o/2,t+l),c+=ct(t_||(t_=Vu(["L ",",",""])),e+n-o/2-a,t+l),c+=ct(n_||(n_=Vu(["L ",","," Z"])),e,t),c},LB={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},UB=e=>{var t=At(e,LB),{x:n,y:a,upperWidth:l,lowerWidth:o,height:c,className:f}=t,{animationEasing:d,animationDuration:h,animationBegin:v,isUpdateAnimationActive:p}=t,b=S.useRef(null),[x,O]=S.useState(-1),j=S.useRef(l),_=S.useRef(o),E=S.useRef(c),N=S.useRef(n),T=S.useRef(a),C=td(e,"trapezoid-");if(S.useEffect(()=>{if(b.current&&b.current.getTotalLength)try{var ue=b.current.getTotalLength();ue&&O(ue)}catch{}},[]),n!==+n||a!==+a||l!==+l||o!==+o||c!==+c||l===0&&o===0||c===0)return null;var k=Re("recharts-trapezoid",f);if(!p)return S.createElement("g",null,S.createElement("path",jf({},tn(t),{className:k,d:i_(n,a,l,o,c)})));var M=j.current,L=_.current,W=E.current,re=N.current,H=T.current,$="0px ".concat(x===-1?1:x,"px"),K="".concat(x,"px 0px"),ce=qE(["strokeDasharray"],h,d);return S.createElement(ed,{animationId:C,key:C,canBegin:x>0,duration:h,easing:d,isActive:p,begin:v},ue=>{var ve=Qt(M,l,ue),I=Qt(L,o,ue),ee=Qt(W,c,ue),z=Qt(re,n,ue),G=Qt(H,a,ue);b.current&&(j.current=ve,_.current=I,E.current=ee,N.current=z,T.current=G);var ne=ue>0?{transition:ce,strokeDasharray:K}:{strokeDasharray:$};return S.createElement("path",jf({},tn(t),{className:k,d:i_(z,G,ve,I,ee),ref:b,style:a_(a_({},ne),t.style)}))})},$B=["option","shapeType","activeClassName"];function qB(e,t){if(e==null)return{};var n,a,l=BB(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(NT({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}},FB=e=>{var t=Qe();return(n,a)=>l=>{e?.(n,a,l),t(JU())}},ZB=(e,t,n)=>{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(e7({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}};function SM(e){var{tooltipEntrySettings:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(FU(t)):l.current!==t&&n(ZU({prev:l.current,next:t})),l.current=t)},[t,n,a]),S.useLayoutEffect(()=>()=>{l.current&&(n(QU(l.current)),l.current=null)},[n]),null}function QB(e){var{legendPayload:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(zE(t)):l.current!==t&&n(RE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n(LE(l.current)),l.current=null)},[n]),null}function WB(e){var{legendPayload:t}=e,n=Qe(),a=de(Ge),l=S.useRef(null);return S.useLayoutEffect(()=>{a!=="centric"&&a!=="radial"||(l.current===null?n(zE(t)):l.current!==t&&n(RE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n(LE(l.current)),l.current=null)},[n]),null}var xp,JB=()=>{var[e]=S.useState(()=>uo("uid-"));return e},eI=(xp=T4.useId)!==null&&xp!==void 0?xp:JB;function tI(e,t){var n=eI();return t||(e?"".concat(e,"-").concat(n):n)}var nI=S.createContext(void 0),wM=e=>{var{id:t,type:n,children:a}=e,l=tI("recharts-".concat(n),t);return S.createElement(nI.Provider,{value:l},a(l))},rI={cartesianItems:[],polarItems:[]},jM=hn({name:"graphicalItems",initialState:rI,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:rt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).cartesianItems.indexOf(n);l>-1&&(e.cartesianItems[l]=a)},prepare:rt()},removeCartesianGraphicalItem:{reducer(e,t){var n=nr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:rt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:rt()},removePolarGraphicalItem:{reducer(e,t){var n=nr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:rt()}}}),{addCartesianGraphicalItem:aI,replaceCartesianGraphicalItem:iI,removeCartesianGraphicalItem:lI,addPolarGraphicalItem:uI,removePolarGraphicalItem:oI}=jM.actions,sI=jM.reducer,cI=e=>{var t=Qe(),n=S.useRef(null);return S.useLayoutEffect(()=>{n.current===null?t(aI(e)):n.current!==e&&t(iI({prev:n.current,next:e})),n.current=e},[t,e]),S.useLayoutEffect(()=>()=>{n.current&&(t(lI(n.current)),n.current=null)},[t]),null},fI=S.memo(cI);function dI(e){var t=Qe();return S.useLayoutEffect(()=>(t(uI(e)),()=>{t(oI(e))}),[t,e]),null}var hI=["key"],mI=["onMouseEnter","onClick","onMouseLeave"],vI=["id"],pI=["id"];function o_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function ft(e){for(var t=1;tgM(e.children,yd),[e.children]),n=de(a=>_B(a,e.id,t));return n==null?null:S.createElement(WB,{legendPayload:n})}var wI=S.memo(e=>{var{dataKey:t,nameKey:n,sectors:a,stroke:l,strokeWidth:o,fill:c,name:f,hide:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:a.map(b=>b.tooltipPayload),positions:a.map(b=>b.tooltipPosition),settings:{stroke:l,strokeWidth:o,fill:c,dataKey:t,nameKey:n,name:Hf(f,t),hide:d,type:h,color:c,unit:"",graphicalItemId:v}};return S.createElement(SM,{tooltipEntrySettings:p})}),jI=(e,t)=>e>t?"start":eNn(typeof t=="function"?t(e):t,n,n*.8),_I=(e,t,n)=>{var{top:a,left:l,width:o,height:c}=t,f=YE(o,c),d=l+Nn(e.cx,o,o/2),h=a+Nn(e.cy,c,c/2),v=Nn(e.innerRadius,f,0),p=OI(n,e.outerRadius,f),b=e.maxRadius||Math.sqrt(o*o+c*c)/2;return{cx:d,cy:h,innerRadius:v,outerRadius:p,maxRadius:b}},AI=(e,t)=>{var n=Wt(t-e),a=Math.min(Math.abs(t-e),360);return n*a};function EI(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var NI=(e,t)=>{if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Re("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:a}=t,l=Sd(t,hI);return S.createElement(sy,Ua({},l,{type:"linear",className:n}))},TI=(e,t,n)=>{if(S.isValidElement(e))return S.cloneElement(e,t);var a=n;if(typeof e=="function"&&(a=e(t),S.isValidElement(a)))return a;var l=Re("recharts-pie-label-text",EI(e));return S.createElement(gd,Ua({},t,{alignmentBaseline:"middle",className:l}),a)};function MI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l,labelLine:o,dataKey:c}=n;if(!a||!l||!t)return null;var f=Gn(n),d=_l(l),h=_l(o),v=typeof l=="object"&&"offsetRadius"in l&&typeof l.offsetRadius=="number"&&l.offsetRadius||20,p=t.map((b,x)=>{var O=(b.startAngle+b.endAngle)/2,j=xt(b.cx,b.cy,b.outerRadius+v,O),_=ft(ft(ft(ft({},f),b),{},{stroke:"none"},d),{},{index:x,textAnchor:jI(j.x,b.cx)},j),E=ft(ft(ft(ft({},f),b),{},{fill:"none",stroke:b.fill},h),{},{index:x,points:[xt(b.cx,b.cy,b.outerRadius,O),j],key:"line"});return S.createElement(ir,{zIndex:Vt.label,key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},S.createElement(dn,null,o&&NI(o,E),TI(l,_,tt(b,c))))});return S.createElement(dn,{className:"recharts-pie-labels"},p)}function CI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l}=n;return typeof l=="object"&&l!=null&&"position"in l?S.createElement(fM,{label:l}):S.createElement(MI,{sectors:t,props:n,showLabels:a})}function DI(e){var{sectors:t,activeShape:n,inactiveShape:a,allOtherPieProps:l,shape:o,id:c}=e,f=de(Dl),d=de(IT),h=de($7),{onMouseEnter:v,onClick:p,onMouseLeave:b}=l,x=Sd(l,mI),O=XB(v,l.dataKey,c),j=FB(b),_=ZB(p,l.dataKey,c);return t==null||t.length===0?null:S.createElement(S.Fragment,null,t.map((E,N)=>{if(E?.startAngle===0&&E?.endAngle===0&&t.length!==1)return null;var T=h==null||h===c,C=String(N)===f&&(d==null||l.dataKey===d)&&T,k=f?a:null,M=n&&C?n:k,L=ft(ft({},E),{},{stroke:E.stroke,tabIndex:-1,[xE]:N,[SE]:c});return S.createElement(dn,Ua({key:"sector-".concat(E?.startAngle,"-").concat(E?.endAngle,"-").concat(E.midAngle,"-").concat(N),tabIndex:-1,className:"recharts-pie-sector"},X0(x,E,N),{onMouseEnter:O(E,N),onMouseLeave:j(E,N),onClick:_(E,N)}),S.createElement(xM,Ua({option:o??M,index:N,shapeType:"sector",isActive:C},L)))}))}function kI(e){var t,{pieSettings:n,displayedData:a,cells:l,offset:o}=e,{cornerRadius:c,startAngle:f,endAngle:d,dataKey:h,nameKey:v,tooltipType:p}=n,b=Math.abs(n.minAngle),x=AI(f,d),O=Math.abs(x),j=a.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,_=a.filter(M=>tt(M,h,0)!==0).length,E=(O>=360?_:_-1)*j,N=O-_*b-E,T=a.reduce((M,L)=>{var W=tt(L,h,0);return M+(me(W)?W:0)},0),C;if(T>0){var k;C=a.map((M,L)=>{var W=tt(M,h,0),re=tt(M,v,L),H=_I(n,o,M),$=(me(W)?W:0)/T,K,ce=ft(ft({},M),l&&l[L]&&l[L].props);L?K=k.endAngle+Wt(x)*j*(W!==0?1:0):K=f;var ue=K+Wt(x)*((W!==0?b:0)+$*N),ve=(K+ue)/2,I=(H.innerRadius+H.outerRadius)/2,ee=[{name:re,value:W,payload:ce,dataKey:h,type:p,graphicalItemId:n.id}],z=xt(H.cx,H.cy,I,ve);return k=ft(ft(ft(ft({},n.presentationProps),{},{percent:$,cornerRadius:typeof c=="string"?parseFloat(c):c,name:re,tooltipPayload:ee,midAngle:ve,middleRadius:I,tooltipPosition:z},ce),H),{},{value:W,dataKey:h,startAngle:K,endAngle:ue,payload:ce,paddingAngle:Wt(x)*j}),k})}return C}function PI(e){var{showLabels:t,sectors:n,children:a}=e,l=S.useMemo(()=>!t||!n?[]:n.map(o=>({value:o.value,payload:o.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:o.cx,cy:o.cy,innerRadius:o.innerRadius,outerRadius:o.outerRadius,startAngle:o.startAngle,endAngle:o.endAngle,clockWise:!1},fill:o.fill})),[n,t]);return S.createElement(sB,{value:t?l:void 0},a)}function zI(e){var{props:t,previousSectorsRef:n,id:a}=e,{sectors:l,isAnimationActive:o,animationBegin:c,animationDuration:f,animationEasing:d,activeShape:h,inactiveShape:v,onAnimationStart:p,onAnimationEnd:b}=t,x=td(t,"recharts-pie-"),O=n.current,[j,_]=S.useState(!1),E=S.useCallback(()=>{typeof b=="function"&&b(),_(!1)},[b]),N=S.useCallback(()=>{typeof p=="function"&&p(),_(!0)},[p]);return S.createElement(PI,{showLabels:!j,sectors:l},S.createElement(ed,{animationId:x,begin:c,duration:f,isActive:o,easing:d,onAnimationStart:N,onAnimationEnd:E,key:x},T=>{var C=[],k=l&&l[0],M=k?.startAngle;return l?.forEach((L,W)=>{var re=O&&O[W],H=W>0?xi(L,"paddingAngle",0):0;if(re){var $=Qt(re.endAngle-re.startAngle,L.endAngle-L.startAngle,T),K=ft(ft({},L),{},{startAngle:M+H,endAngle:M+$+H});C.push(K),M=K.endAngle}else{var{endAngle:ce,startAngle:ue}=L,ve=Qt(0,ce-ue,T),I=ft(ft({},L),{},{startAngle:M+H,endAngle:M+ve+H});C.push(I),M=I.endAngle}}),n.current=C,S.createElement(dn,null,S.createElement(DI,{sectors:C,activeShape:h,inactiveShape:v,allOtherPieProps:t,shape:t.shape,id:a}))}),S.createElement(CI,{showLabels:!j,sectors:l,props:t}),t.children)}var RI={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:Vt.area};function LI(e){var{id:t}=e,n=Sd(e,vI),{hide:a,className:l,rootTabIndex:o}=e,c=S.useMemo(()=>gM(e.children,yd),[e.children]),f=de(v=>AB(v,t,c)),d=S.useRef(null),h=Re("recharts-pie",l);return a||f==null?(d.current=null,S.createElement(dn,{tabIndex:o,className:h})):S.createElement(ir,{zIndex:e.zIndex},S.createElement(wI,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:f,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),S.createElement(dn,{tabIndex:o,className:h},S.createElement(zI,{props:ft(ft({},n),{},{sectors:f}),previousSectorsRef:d,id:t})))}function OM(e){var t=At(e,RI),{id:n}=t,a=Sd(t,pI),l=Gn(a);return S.createElement(wM,{id:n,type:"pie"},o=>S.createElement(S.Fragment,null,S.createElement(dI,{type:"pie",id:o,data:a.data,dataKey:a.dataKey,hide:a.hide,angleAxisId:0,radiusAxisId:0,name:a.name,nameKey:a.nameKey,tooltipType:a.tooltipType,legendType:a.legendType,fill:a.fill,cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,paddingAngle:a.paddingAngle,minAngle:a.minAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,cornerRadius:a.cornerRadius,presentationProps:l,maxRadius:t.maxRadius}),S.createElement(SI,Ua({},a,{id:o})),S.createElement(LI,Ua({},a,{id:o}))))}OM.displayName="Pie";var UI=["points"];function s_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Sp(e){for(var t=1;t{var _,E,N=Sp(Sp(Sp({r:3},c),p),{},{index:j,cx:(_=O.x)!==null&&_!==void 0?_:void 0,cy:(E=O.y)!==null&&E!==void 0?E:void 0,dataKey:o,value:O.value,payload:O.payload,points:t});return S.createElement(KI,{key:"dot-".concat(j),option:n,dotProps:N,className:l})}),x={};return f&&d!=null&&(x.clipPath="url(#clipPath-".concat(v?"":"dots-").concat(d,")")),S.createElement(ir,{zIndex:h},S.createElement(dn,_f({className:a},x),b))}function c_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function f_(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),lH=V([iH,Wr,Jr],(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)}}),jg=()=>de(lH),uH=()=>de(K7);function d_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function wp(e){for(var t=1;t{var{point:t,childIndex:n,mainColor:a,activeDot:l,dataKey:o,clipPath:c}=e;if(l===!1||t.x==null||t.y==null)return null;var f={index:n,dataKey:o,cx:t.x,cy:t.y,r:4,fill:a??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=wp(wp(wp({},f),_l(l)),V0(l)),h;return S.isValidElement(l)?h=S.cloneElement(l,d):typeof l=="function"?h=l(d):h=S.createElement(dM,d),S.createElement(dn,{className:"recharts-active-dot",clipPath:c},h)};function dH(e){var{points:t,mainColor:n,activeDot:a,itemDataKey:l,clipPath:o,zIndex:c=Vt.activeDot}=e,f=de(Dl),d=uH();if(t==null||d==null)return null;var h=t.find(v=>d.includes(v.payload));return _t(h)?null:S.createElement(ir,{zIndex:c},S.createElement(fH,{point:h,childIndex:Number(f),mainColor:n,dataKey:l,activeDot:a,clipPath:o}))}var AM=e=>{var{chartData:t}=e,n=Qe(),a=mn();return S.useEffect(()=>a?()=>{}:(n(SO(t)),()=>{n(SO(void 0))}),[t,n,a]),null},h_={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},EM=hn({name:"brush",initialState:h_,reducers:{setBrushSettings(e,t){return t.payload==null?h_:t.payload}}}),{setBrushSettings:WG}=EM.actions,hH=EM.reducer;function mH(e,t,n){return(t=vH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vH(e){var t=pH(e,"string");return typeof t=="symbol"?t:t+""}function pH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Og{static create(t){return new Og(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:n,position:a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(a)switch(a){case"start":return this.scale(t);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+l}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(t)+o}default:return this.scale(t)}if(n){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+c}return this.scale(t)}}isInRange(t){var n=this.range(),a=n[0],l=n[n.length-1];return a<=l?t>=a&&t<=l:t>=l&&t<=a}}mH(Og,"EPS",1e-4);function yH(e){return(e%180+180)%180}var gH=function(t){var{width:n,height:a}=t,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=yH(l),c=o*Math.PI/180,f=Math.atan(a/n),d=c>f&&c{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=nr(e).dots.findIndex(a=>a===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(a=>a===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(a=>a===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:JG,removeDot:eV,addArea:tV,removeArea:nV,addLine:rV,removeLine:aV}=NM.actions,xH=NM.reducer,SH=S.createContext(void 0),wH=e=>{var{children:t}=e,[n]=S.useState("".concat(uo("recharts"),"-clip")),a=jg();if(a==null)return null;var{x:l,y:o,width:c,height:f}=a;return S.createElement(SH.Provider,{value:n},S.createElement("defs",null,S.createElement("clipPath",{id:n},S.createElement("rect",{x:l,y:o,height:f,width:c}))),t)};function TM(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],a=0;ae*l)return!1;var o=n();return e*(t-e*o/2-a)>=0&&e*(t+e*o/2-l)<=0}function _H(e,t){return TM(e,t+1)}function AH(e,t,n,a,l){for(var o=(a||[]).slice(),{start:c,end:f}=t,d=0,h=1,v=c,p=function(){var O=a?.[d];if(O===void 0)return{v:TM(a,h)};var j=d,_,E=()=>(_===void 0&&(_=n(O,j)),_),N=O.coordinate,T=d===0||wo(e,N,E,v,f);T||(d=0,v=c,h+=1),T&&(v=N+e*(E()/2+l),d+=h)},b;h<=o.length;)if(b=p(),b)return b.v;return[]}function EH(e,t,n,a,l){var o=(a||[]).slice(),c=o.length;if(c===0)return[];for(var{start:f,end:d}=t,h=1;h<=c;h++){for(var v=(c-1)%h,p=f,b=!0,x=function(){var N=a[O],T=O,C,k=()=>(C===void 0&&(C=n(N,T)),C),M=N.coordinate,L=O===v||wo(e,M,k,p,d);if(!L)return b=!1,1;L&&(p=M+e*(k()/2+l))},O=v;O(O===void 0&&(O=n(x,b)),O);if(b===c-1){var _=e*(x.coordinate+e*j()/2-d);o[b]=x=Ft(Ft({},x),{},{tickCoord:_>0?x.coordinate-_*e:x.coordinate})}else o[b]=x=Ft(Ft({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var E=wo(e,x.tickCoord,j,f,d);E&&(d=x.tickCoord-e*(j()/2+l),o[b]=Ft(Ft({},x),{},{isShow:!0}))}},v=c-1;v>=0;v--)h(v);return o}function DH(e,t,n,a,l,o){var c=(a||[]).slice(),f=c.length,{start:d,end:h}=t;if(o){var v=a[f-1],p=n(v,f-1),b=e*(v.coordinate+e*p/2-h);if(c[f-1]=v=Ft(Ft({},v),{},{tickCoord:b>0?v.coordinate-b*e:v.coordinate}),v.tickCoord!=null){var x=wo(e,v.tickCoord,()=>p,d,h);x&&(h=v.tickCoord-e*(p/2+l),c[f-1]=Ft(Ft({},v),{},{isShow:!0}))}}for(var O=o?f-1:f,j=function(N){var T=c[N],C,k=()=>(C===void 0&&(C=n(T,N)),C);if(N===0){var M=e*(T.coordinate-e*k()/2-d);c[N]=T=Ft(Ft({},T),{},{tickCoord:M<0?T.coordinate-M*e:T.coordinate})}else c[N]=T=Ft(Ft({},T),{},{tickCoord:T.coordinate});if(T.tickCoord!=null){var L=wo(e,T.tickCoord,k,d,h);L&&(d=T.tickCoord+e*(k()/2+l),c[N]=Ft(Ft({},T),{},{isShow:!0}))}},_=0;_{var k=typeof h=="function"?h(T.value,C):T.value;return O==="width"?jH(no(k,{fontSize:t,letterSpacing:n}),j,p):no(k,{fontSize:t,letterSpacing:n})[O]},E=l.length>=2?Wt(l[1].coordinate-l[0].coordinate):1,N=OH(o,E,O);return d==="equidistantPreserveStart"?AH(E,N,_,l,c):d==="equidistantPreserveEnd"?EH(E,N,_,l,c):(d==="preserveStart"||d==="preserveStartEnd"?x=DH(E,N,_,l,c,d==="preserveStartEnd"):x=CH(E,N,_,l,c),x.filter(T=>T.isShow))}var kH=e=>{var{ticks:t,label:n,labelGapWithTick:a=5,tickSize:l=0,tickMargin:o=0}=e,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.width>c&&(c=p.width)}});var f=n?n.getBoundingClientRect().width:0,d=l+o,h=c+d+f+(n?a:0);return Math.round(h)}return 0},PH=["axisLine","width","height","className","hide","ticks","axisType"];function zH(e,t){if(e==null)return{};var n,a,l=RH(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{ticks:n=[],tick:a,tickLine:l,stroke:o,tickFormatter:c,unit:f,padding:d,tickTextProps:h,orientation:v,mirror:p,x:b,y:x,width:O,height:j,tickSize:_,tickMargin:E,fontSize:N,letterSpacing:T,getTicksConfig:C,events:k,axisType:M}=e,L=_g(bt(bt({},C),{},{ticks:n}),N,T),W=IH(v,p),re=HH(v,p),H=Gn(C),$=_l(a),K={};typeof l=="object"&&(K=l);var ce=bt(bt({},H),{},{fill:"none"},K),ue=L.map(ee=>bt({entry:ee},BH(ee,b,x,O,j,v,_,p,E))),ve=ue.map(ee=>{var{entry:z,line:G}=ee;return S.createElement(dn,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(z.value,"-").concat(z.coordinate,"-").concat(z.tickCoord)},l&&S.createElement("line",_i({},ce,G,{className:Re("recharts-cartesian-axis-tick-line",xi(l,"className"))})))}),I=ue.map((ee,z)=>{var{entry:G,tick:ne}=ee,P=bt(bt(bt(bt({textAnchor:W,verticalAnchor:re},H),{},{stroke:"none",fill:o},$),ne),{},{index:z,payload:G,visibleTicksCount:L.length,tickFormatter:c,padding:d},h);return S.createElement(dn,_i({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(G.value,"-").concat(G.coordinate,"-").concat(G.tickCoord)},X0(k,G,z)),a&&S.createElement(KH,{option:a,tickProps:P,value:"".concat(typeof c=="function"?c(G.value,z):G.value).concat(f||"")}))});return S.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(M,"-ticks")},I.length>0&&S.createElement(ir,{zIndex:Vt.label},S.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(M,"-tick-labels"),ref:t},I)),ve.length>0&&S.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(M,"-tick-lines")},ve))}),GH=S.forwardRef((e,t)=>{var{axisLine:n,width:a,height:l,className:o,hide:c,ticks:f,axisType:d}=e,h=zH(e,PH),[v,p]=S.useState(""),[b,x]=S.useState(""),O=S.useRef(null);S.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return kH({ticks:O.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=S.useCallback(_=>{if(_){var E=_.getElementsByClassName("recharts-cartesian-axis-tick-value");O.current=E;var N=E[0];if(N){var T=window.getComputedStyle(N),C=T.fontSize,k=T.letterSpacing;(C!==v||k!==b)&&(p(C),x(k))}}},[v,b]);return c||a!=null&&a<=0||l!=null&&l<=0?null:S.createElement(ir,{zIndex:e.zIndex},S.createElement(dn,{className:Re("recharts-cartesian-axis",o)},S.createElement(qH,{x:e.x,y:e.y,width:a,height:l,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Gn(e)}),S.createElement(YH,{ref:j,axisType:d,events:h,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:b,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:f,unit:e.unit,width:e.width,x:e.x,y:e.y}),S.createElement(Bq,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},S.createElement(Qq,{label:e.label,labelRef:e.labelRef}),e.children)))}),Ag=S.forwardRef((e,t)=>{var n=At(e,Kr);return S.createElement(GH,_i({},n,{ref:t}))});Ag.displayName="CartesianAxis";var VH=["x1","y1","x2","y2","key"],XH=["offset"],FH=["xAxisId","yAxisId"],ZH=["xAxisId","yAxisId"];function p_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Zt(e){for(var t=1;t{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:a,y:l,width:o,height:c,ry:f}=e;return S.createElement("rect",{x:a,y:l,ry:f,width:o,height:c,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function MM(e){var{option:t,lineItemProps:n}=e,a;if(S.isValidElement(t))a=S.cloneElement(t,n);else if(typeof t=="function")a=t(n);else{var l,{x1:o,y1:c,x2:f,y2:d,key:h}=n,v=Af(n,VH),p=(l=Gn(v))!==null&&l!==void 0?l:{},{offset:b}=p,x=Af(p,XH);a=S.createElement("line",vi({},x,{x1:o,y1:c,x2:f,y2:d,fill:"none",key:h}))}return a}function nK(e){var{x:t,width:n,horizontal:a=!0,horizontalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=Af(e,FH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(v),index:v});return S.createElement(MM,{key:"line-".concat(v),option:a,lineItemProps:p})});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function rK(e){var{y:t,height:n,vertical:a=!0,verticalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=Af(e,ZH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(v),index:v});return S.createElement(MM,{option:a,lineItemProps:p,key:"line-".concat(v)})});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function aK(e){var{horizontalFill:t,fillOpacity:n,x:a,y:l,width:o,height:c,horizontalPoints:f,horizontal:d=!0}=e;if(!d||!t||!t.length||f==null)return null;var h=f.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var j=b%t.length;return S.createElement("rect",{key:"react-".concat(b),y:p,x:a,height:O,width:o,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function iK(e){var{vertical:t=!0,verticalFill:n,fillOpacity:a,x:l,y:o,width:c,height:f,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var h=d.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var j=b%n.length;return S.createElement("rect",{key:"react-".concat(b),x:p,y:o,width:O,height:f,stroke:"none",fill:n[j],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var lK=(e,t)=>{var{xAxis:n,width:a,height:l,offset:o}=e;return yE(_g(Zt(Zt(Zt({},Kr),n),{},{ticks:gE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.left,o.left+o.width,t)},uK=(e,t)=>{var{yAxis:n,width:a,height:l,offset:o}=e;return yE(_g(Zt(Zt(Zt({},Kr),n),{},{ticks:gE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.top,o.top+o.height,t)},oK={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Vt.grid};function ro(e){var t=iy(),n=ly(),a=EE(),l=Zt(Zt({},At(e,oK)),{},{x:me(e.x)?e.x:a.left,y:me(e.y)?e.y:a.top,width:me(e.width)?e.width:a.width,height:me(e.height)?e.height:a.height}),{xAxisId:o,yAxisId:c,x:f,y:d,width:h,height:v,syncWithTicks:p,horizontalValues:b,verticalValues:x}=l,O=mn(),j=de(re=>sO(re,"xAxis",o,O)),_=de(re=>sO(re,"yAxis",c,O));if(!yr(h)||!yr(v)||!me(f)||!me(d))return null;var E=l.verticalCoordinatesGenerator||lK,N=l.horizontalCoordinatesGenerator||uK,{horizontalPoints:T,verticalPoints:C}=l;if((!T||!T.length)&&typeof N=="function"){var k=b&&b.length,M=N({yAxis:_?Zt(Zt({},_),{},{ticks:k?b:_.ticks}):void 0,width:t??h,height:n??v,offset:a},k?!0:p);Wc(Array.isArray(M),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(T=M)}if((!C||!C.length)&&typeof E=="function"){var L=x&&x.length,W=E({xAxis:j?Zt(Zt({},j),{},{ticks:L?x:j.ticks}):void 0,width:t??h,height:n??v,offset:a},L?!0:p);Wc(Array.isArray(W),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof W,"]")),Array.isArray(W)&&(C=W)}return S.createElement(ir,{zIndex:l.zIndex},S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(tK,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),S.createElement(aK,vi({},l,{horizontalPoints:T})),S.createElement(iK,vi({},l,{verticalPoints:C})),S.createElement(nK,vi({},l,{offset:a,horizontalPoints:T,xAxis:j,yAxis:_})),S.createElement(rK,vi({},l,{offset:a,verticalPoints:C,xAxis:j,yAxis:_}))))}ro.displayName="CartesianGrid";var sK={},CM=hn({name:"errorBars",initialState:sK,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]||(e[n]=[]),e[n].push(a)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:a,next:l}=t.payload;e[n]&&(e[n]=e[n].map(o=>o.dataKey===a.dataKey&&o.direction===a.direction?l:o))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]&&(e[n]=e[n].filter(l=>l.dataKey!==a.dataKey||l.direction!==a.direction))}}}),{addErrorBar:iV,replaceErrorBar:lV,removeErrorBar:uV}=CM.actions,cK=CM.reducer,fK=["children"];function dK(e,t){if(e==null)return{};var n,a,l=hK(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a({x:0,y:0,value:0}),errorBarOffset:0},vK=S.createContext(mK);function pK(e){var{children:t}=e,n=dK(e,fK);return S.createElement(vK.Provider,{value:n},t)}function DM(e,t){var n,a,l=de(h=>ta(h,e)),o=de(h=>na(h,t)),c=(n=l?.allowDataOverflow)!==null&&n!==void 0?n:Dt.allowDataOverflow,f=(a=o?.allowDataOverflow)!==null&&a!==void 0?a:kt.allowDataOverflow,d=c||f;return{needClip:d,needClipX:c,needClipY:f}}function yK(e){var{xAxisId:t,yAxisId:n,clipPathId:a}=e,l=jg(),{needClipX:o,needClipY:c,needClip:f}=DM(t,n);if(!f||!l)return null;var{x:d,y:h,width:v,height:p}=l;return S.createElement("clipPath",{id:"clipPath-".concat(a)},S.createElement("rect",{x:o?d:d-v/2,y:c?h:h-p/2,width:o?v:v*2,height:c?p:p*2}))}var kM=(e,t,n,a)=>wT(e,"xAxis",t,a),PM=(e,t,n,a)=>ST(e,"xAxis",t,a),zM=(e,t,n,a)=>wT(e,"yAxis",n,a),RM=(e,t,n,a)=>ST(e,"yAxis",n,a),gK=V([Ge,kM,zM,PM,RM],(e,t,n,a,l)=>$a(e,"xAxis")?Qc(t,a,!1):Qc(n,l,!1)),bK=(e,t,n,a,l)=>l;function xK(e){return e.type==="line"}var SK=V([tT,bK],(e,t)=>e.filter(xK).find(n=>n.id===t)),wK=V([Ge,kM,zM,PM,RM,SK,gK,Py],(e,t,n,a,l,o,c,f)=>{var{chartData:d,dataStartIndex:h,dataEndIndex:v}=f;if(!(o==null||t==null||n==null||a==null||l==null||a.length===0||l.length===0||c==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:p,data:b}=o,x;if(b!=null&&b.length>0?x=b:x=d?.slice(h,v+1),x!=null)return sY({layout:e,xAxis:t,yAxis:n,xAxisTicks:a,yAxisTicks:l,dataKey:p,bandSize:c,displayedData:x})}});function jK(e){var t=_l(e),n=3,a=2;if(t!=null){var{r:l,strokeWidth:o}=t,c=Number(l),f=Number(o);return(Number.isNaN(c)||c<0)&&(c=n),(Number.isNaN(f)||f<0)&&(f=a),{r:c,strokeWidth:f}}return{r:n,strokeWidth:a}}var jp={exports:{}},Op={};var y_;function OK(){if(y_)return Op;y_=1;var e=kl();function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,a=e.useSyncExternalStore,l=e.useRef,o=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Op.useSyncExternalStoreWithSelector=function(d,h,v,p,b){var x=l(null);if(x.current===null){var O={hasValue:!1,value:null};x.current=O}else O=x.current;x=c(function(){function _(k){if(!E){if(E=!0,N=k,k=p(k),b!==void 0&&O.hasValue){var M=O.value;if(b(M,k))return T=M}return T=k}if(M=T,n(N,k))return M;var L=p(k);return b!==void 0&&b(M,L)?(N=k,M):(N=k,T=L)}var E=!1,N,T,C=v===void 0?null:v;return[function(){return _(h())},C===null?void 0:function(){return _(C())}]},[h,v,p,b]);var j=a(d,x[0],x[1]);return o(function(){O.hasValue=!0,O.value=j},[j]),f(j),j},Op}var g_;function _K(){return g_||(g_=1,jp.exports=OK()),jp.exports}_K();function AK(e){e()}function EK(){let e=null,t=null;return{clear(){e=null,t=null},notify(){AK(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let a=e;for(;a;)n.push(a),a=a.next;return n},subscribe(n){let a=!0;const l=t={callback:n,next:null,prev:t};return l.prev?l.prev.next=l:e=l,function(){!a||e===null||(a=!1,l.next?l.next.prev=l.prev:t=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}var b_={notify(){},get:()=>[]};function NK(e,t){let n,a=b_,l=0,o=!1;function c(j){v();const _=a.subscribe(j);let E=!1;return()=>{E||(E=!0,_(),p())}}function f(){a.notify()}function d(){O.onStateChange&&O.onStateChange()}function h(){return o}function v(){l++,n||(n=e.subscribe(d),a=EK())}function p(){l--,n&&l===0&&(n(),n=void 0,a.clear(),a=b_)}function b(){o||(o=!0,v())}function x(){o&&(o=!1,p())}const O={addNestedSub:c,notifyNestedSubs:f,handleChangeWrapper:d,isSubscribed:h,trySubscribe:b,tryUnsubscribe:x,getListeners:()=>a};return O}var TK=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MK=TK(),CK=()=>typeof navigator<"u"&&navigator.product==="ReactNative",DK=CK(),kK=()=>MK||DK?S.useLayoutEffect:S.useEffect,PK=kK();function x_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function zK(e,t){if(x_(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(let l=0;l{const d=NK(l);return{store:l,subscription:d,getServerState:a?()=>a:void 0}},[l,a]),c=S.useMemo(()=>l.getState(),[l]);PK(()=>{const{subscription:d}=o;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),c!==l.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[o,c]);const f=n||$K;return S.createElement(f.Provider,{value:o},t)}var BK=qK,IK=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function HK(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Eg(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var a of n)if(IK.has(a)){if(e[a]==null&&t[a]==null)continue;if(!zK(e[a],t[a]))return!1}else if(!HK(e[a],t[a]))return!1;return!0}var KK=["id"],YK=["type","layout","connectNulls","needClip","shape"],GK=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:a,legendType:l,hide:o}=e;return[{inactive:o,dataKey:t,type:l,color:a,value:Hf(n,t),payload:e}]},WK=S.memo(e=>{var{dataKey:t,data:n,stroke:a,strokeWidth:l,fill:o,name:c,hide:f,unit:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:n,positions:void 0,settings:{stroke:a,strokeWidth:l,fill:o,dataKey:t,nameKey:void 0,name:Hf(c,t),hide:f,type:h,color:a,unit:d,graphicalItemId:v}};return S.createElement(SM,{tooltipEntrySettings:p})}),LM=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function JK(e,t){for(var n=e.length%2!==0?[...e,0]:e,a=[],l=0;l{var a=n.reduce((p,b)=>p+b);if(!a)return LM(t,e);for(var l=Math.floor(e/a),o=e%a,c=t-e,f=[],d=0,h=0;do){f=[...n.slice(0,d),o-h];break}var v=f.length%2===0?[0,c]:[c];return[...JK(n,l),...f,...v].map(p=>"".concat(p,"px")).join(", ")};function tY(e){var{clipPathId:t,points:n,props:a}=e,{dot:l,dataKey:o,needClip:c}=a,{id:f}=a,d=Ng(a,KK),h=Gn(d);return S.createElement(GI,{points:n,dot:l,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:o,baseProps:h,needClip:c,clipPathId:t})}function nY(e){var{showLabels:t,children:n,points:a}=e,l=S.useMemo(()=>a?.map(o=>{var c,f,d={x:(c=o.x)!==null&&c!==void 0?c:0,y:(f=o.y)!==null&&f!==void 0?f:0,width:0,lowerWidth:0,upperWidth:0,height:0};return dr(dr({},d),{},{value:o.value,payload:o.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[a]);return S.createElement(oB,{value:t?l:void 0},n)}function w_(e){var{clipPathId:t,pathRef:n,points:a,strokeDasharray:l,props:o}=e,{type:c,layout:f,connectNulls:d,needClip:h,shape:v}=o,p=Ng(o,YK),b=dr(dr({},tn(p)),{},{fill:"none",className:"recharts-line-curve",clipPath:h?"url(#clipPath-".concat(t,")"):void 0,points:a,type:c,layout:f,connectNulls:d,strokeDasharray:l??o.strokeDasharray});return S.createElement(S.Fragment,null,a?.length>1&&S.createElement(xM,jo({shapeType:"curve",option:v},b,{pathRef:n})),S.createElement(tY,{points:a,clipPathId:t,props:o}))}function rY(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function aY(e){var{clipPathId:t,props:n,pathRef:a,previousPointsRef:l,longestAnimatedLengthRef:o}=e,{points:c,strokeDasharray:f,isAnimationActive:d,animationBegin:h,animationDuration:v,animationEasing:p,animateNewValues:b,width:x,height:O,onAnimationEnd:j,onAnimationStart:_}=n,E=l.current,N=td(c,"recharts-line-"),T=S.useRef(N),[C,k]=S.useState(!1),M=!C,L=S.useCallback(()=>{typeof j=="function"&&j(),k(!1)},[j]),W=S.useCallback(()=>{typeof _=="function"&&_(),k(!0)},[_]),re=rY(a.current),H=S.useRef(0);T.current!==N&&(H.current=o.current,T.current=N);var $=H.current;return S.createElement(nY,{points:c,showLabels:M},n.children,S.createElement(ed,{animationId:N,begin:h,duration:v,isActive:d,easing:p,onAnimationEnd:L,onAnimationStart:W,key:N},K=>{var ce=Qt($,re+$,K),ue=Math.min(ce,re),ve;if(d)if(f){var I="".concat(f).split(/[,\s]+/gim).map(G=>parseFloat(G));ve=eY(ue,re,I)}else ve=LM(re,ue);else ve=f==null?void 0:String(f);if(K>0&&re>0&&(l.current=c,o.current=Math.max(o.current,ue)),E){var ee=E.length/c.length,z=K===1?c:c.map((G,ne)=>{var P=Math.floor(ne*ee);if(E[P]){var F=E[P];return dr(dr({},G),{},{x:Qt(F.x,G.x,K),y:Qt(F.y,G.y,K)})}return b?dr(dr({},G),{},{x:Qt(x*2,G.x,K),y:Qt(O/2,G.y,K)}):dr(dr({},G),{},{x:G.x,y:G.y})});return l.current=z,S.createElement(w_,{props:n,points:z,clipPathId:t,pathRef:a,strokeDasharray:ve})}return S.createElement(w_,{props:n,points:c,clipPathId:t,pathRef:a,strokeDasharray:ve})}),S.createElement(fM,{label:n.label}))}function iY(e){var{clipPathId:t,props:n}=e,a=S.useRef(null),l=S.useRef(0),o=S.useRef(null);return S.createElement(aY,{props:n,clipPathId:t,previousPointsRef:a,longestAnimatedLengthRef:l,pathRef:o})}var lY=(e,t)=>{var n,a;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(a=e.y)!==null&&a!==void 0?a:void 0,value:e.value,errorVal:tt(e.payload,t)}};class uY extends S.Component{render(){var{hide:t,dot:n,points:a,className:l,xAxisId:o,yAxisId:c,top:f,left:d,width:h,height:v,id:p,needClip:b,zIndex:x}=this.props;if(t)return null;var O=Re("recharts-line",l),j=p,{r:_,strokeWidth:E}=jK(n),N=bM(n),T=_*2+E,C=b?"url(#clipPath-".concat(N?"":"dots-").concat(j,")"):void 0;return S.createElement(ir,{zIndex:x},S.createElement(dn,{className:O},b&&S.createElement("defs",null,S.createElement(yK,{clipPathId:j,xAxisId:o,yAxisId:c}),!N&&S.createElement("clipPath",{id:"clipPath-dots-".concat(j)},S.createElement("rect",{x:d-T/2,y:f-T/2,width:h+T,height:v+T}))),S.createElement(pK,{xAxisId:o,yAxisId:c,data:a,dataPointFormatter:lY,errorBarOffset:0},S.createElement(iY,{props:this.props,clipPathId:j}))),S.createElement(dH,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:C}))}}var UM={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:Vt.line,type:"linear"};function oY(e){var t=At(e,UM),{activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,connectNulls:f,dot:d,hide:h,isAnimationActive:v,label:p,legendType:b,xAxisId:x,yAxisId:O,id:j}=t,_=Ng(t,GK),{needClip:E}=DM(x,O),N=jg(),T=To(),C=mn(),k=de(H=>wK(H,x,O,C,j));if(T!=="horizontal"&&T!=="vertical"||k==null||N==null)return null;var{height:M,width:L,x:W,y:re}=N;return S.createElement(uY,jo({},_,{id:j,connectNulls:f,dot:d,activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,isAnimationActive:v,hide:h,label:p,legendType:b,xAxisId:x,yAxisId:O,points:k,layout:T,height:M,width:L,left:W,top:re,needClip:E}))}function sY(e){var{layout:t,xAxis:n,yAxis:a,xAxisTicks:l,yAxisTicks:o,dataKey:c,bandSize:f,displayedData:d}=e;return d.map((h,v)=>{var p=tt(h,c);if(t==="horizontal"){var b=hj({axis:n,ticks:l,bandSize:f,entry:h,index:v}),x=_t(p)?null:a.scale(p);return{x:b,y:x,value:p,payload:h}}var O=_t(p)?null:n.scale(p),j=hj({axis:a,ticks:o,bandSize:f,entry:h,index:v});return O==null||j==null?null:{x:O,y:j,value:p,payload:h}}).filter(Boolean)}function cY(e){var t=At(e,UM),n=mn();return S.createElement(wM,{id:t.id,type:"line"},a=>S.createElement(S.Fragment,null,S.createElement(QB,{legendPayload:QK(t)}),S.createElement(WK,{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:a}),S.createElement(fI,{type:"line",id:a,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),S.createElement(oY,jo({},t,{id:a}))))}var Sl=S.memo(cY,Eg);Sl.displayName="Line";var fY=["domain","range"],dY=["domain","range"];function j_(e,t){if(e==null)return{};var n,a,l=hY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{n.current===null?t(QI(e)):n.current!==e&&t(WI({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(JI(n.current)),n.current=null)},[t]),null}var gY=e=>{var{xAxisId:t,className:n}=e,a=de(wE),l=mn(),o="xAxis",c=de(E=>xT(E,o,t,l)),f=de(E=>DU(E,t)),d=de(E=>UU(E,t)),h=de(E=>WN(E,t));if(f==null||d==null||h==null)return null;var{dangerouslySetInnerHTML:v,ticks:p,scale:b}=e,x=__(e,mY),{id:O,scale:j}=h,_=__(h,vY);return S.createElement(Ag,j0({},x,_,{x:d.x,y:d.y,width:f.width,height:f.height,className:Re("recharts-".concat(o," ").concat(o),n),viewBox:a,ticks:c,axisType:o}))},bY={allowDataOverflow:Dt.allowDataOverflow,allowDecimals:Dt.allowDecimals,allowDuplicatedCategory:Dt.allowDuplicatedCategory,angle:Dt.angle,axisLine:Kr.axisLine,height:Dt.height,hide:!1,includeHidden:Dt.includeHidden,interval:Dt.interval,minTickGap:Dt.minTickGap,mirror:Dt.mirror,orientation:Dt.orientation,padding:Dt.padding,reversed:Dt.reversed,scale:Dt.scale,tick:Dt.tick,tickCount:Dt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:Dt.type,xAxisId:0},xY=e=>{var t=At(e,bY);return S.createElement(S.Fragment,null,S.createElement(yY,{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}),S.createElement(gY,t))},ao=S.memo(xY,$M);ao.displayName="XAxis";var SY=["dangerouslySetInnerHTML","ticks","scale"],wY=["id","scale"];function O0(){return O0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current===null?t(eH(e)):n.current!==e&&t(tH({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(nH(n.current)),n.current=null)},[t]),null}var _Y=e=>{var{yAxisId:t,className:n,width:a,label:l}=e,o=S.useRef(null),c=S.useRef(null),f=de(wE),d=mn(),h=Qe(),v="yAxis",p=de(M=>BU(M,t)),b=de(M=>qU(M,t)),x=de(M=>xT(M,v,t,d)),O=de(M=>JN(M,t));if(S.useLayoutEffect(()=>{if(!(a!=="auto"||!p||xg(l)||S.isValidElement(l)||O==null)){var M=o.current;if(M){var L=M.getCalculatedWidth();Math.round(p.width)!==Math.round(L)&&h(rH({id:t,width:L}))}}},[x,p,h,l,t,a,O]),p==null||b==null||O==null)return null;var{dangerouslySetInnerHTML:j,ticks:_,scale:E}=e,N=A_(e,SY),{id:T,scale:C}=O,k=A_(O,wY);return S.createElement(Ag,O0({},N,k,{ref:o,labelRef:c,x:b.x,y:b.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:p.width,height:p.height,className:Re("recharts-".concat(v," ").concat(v),n),viewBox:f,ticks:x,axisType:v}))},AY={allowDataOverflow:kt.allowDataOverflow,allowDecimals:kt.allowDecimals,allowDuplicatedCategory:kt.allowDuplicatedCategory,angle:kt.angle,axisLine:Kr.axisLine,hide:!1,includeHidden:kt.includeHidden,interval:kt.interval,minTickGap:kt.minTickGap,mirror:kt.mirror,orientation:kt.orientation,padding:kt.padding,reversed:kt.reversed,scale:kt.scale,tick:kt.tick,tickCount:kt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:kt.type,width:kt.width,yAxisId:0},EY=e=>{var t=At(e,AY);return S.createElement(S.Fragment,null,S.createElement(OY,{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}),S.createElement(_Y,t))},io=S.memo(EY,$M);io.displayName="YAxis";var NY=(e,t)=>t,Tg=V([NY,Ge,FN,Nt,UT,ra,r$,zt],c$),Mg=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,a=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/a)}},qM=Vn("mouseClick"),BM=Eo();BM.startListening({actionCreator:qM,effect:(e,t)=>{var n=e.payload,a=Tg(t.getState(),Mg(n));a?.activeIndex!=null&&t.dispatch(t7({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}});var _0=Vn("mouseMove"),IM=Eo(),Oc=null;IM.startListening({actionCreator:_0,effect:(e,t)=>{var n=e.payload;Oc!==null&&cancelAnimationFrame(Oc);var a=Mg(n);Oc=requestAnimationFrame(()=>{var l=t.getState(),o=cg(l,l.tooltip.settings.shared);if(o==="axis"){var c=Tg(l,a);c?.activeIndex!=null?t.dispatch(MT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate})):t.dispatch(TT())}Oc=null})}});function TY(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?"<>":t}var E_={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},HM=hn({name:"rootProps",initialState:E_,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:E_.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}}}),MY=HM.reducer,{updateOptions:CY}=HM.actions,KM=hn({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:DY}=KM.actions,kY=KM.reducer,YM=Vn("keyDown"),GM=Vn("focus"),Cg=Eo();Cg.startListening({actionCreator:YM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip,o=e.payload;if(!(o!=="ArrowRight"&&o!=="ArrowLeft"&&o!=="Enter")){var c=fg(l,Hl(n),$o(n),Io(n)),f=c==null?-1:Number(c);if(!(!Number.isFinite(f)||f<0)){var d=ra(n);if(o==="Enter"){var h=Sf(n,"axis","hover",String(l.index));t.dispatch(y0({active:!l.active,activeIndex:l.index,activeCoordinate:h}));return}var v=YU(n),p=v==="left-to-right"?1:-1,b=o==="ArrowRight"?1:-1,x=f+b*p;if(!(d==null||x>=d.length||x<0)){var O=Sf(n,"axis","hover",String(x));t.dispatch(y0({active:!0,activeIndex:x.toString(),activeCoordinate:O}))}}}}}});Cg.startListening({actionCreator:GM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip;if(!l.active&&l.index==null){var o="0",c=Sf(n,"axis","hover",String(o));t.dispatch(y0({active:!0,activeIndex:o,activeCoordinate:c}))}}}});var Hn=Vn("externalEvent"),VM=Eo(),_p=new Map;VM.startListening({actionCreator:Hn,effect:(e,t)=>{var{handler:n,reactEvent:a}=e.payload;if(n!=null){a.persist();var l=a.type,o=_p.get(l);o!==void 0&&cancelAnimationFrame(o);var c=requestAnimationFrame(()=>{try{var f=t.getState(),d={activeCoordinate:B7(f),activeDataKey:IT(f),activeIndex:Dl(f),activeLabel:BT(f),activeTooltipIndex:Dl(f),isTooltipActive:I7(f)};n(d,a)}finally{_p.delete(l)}});_p.set(l,c)}}});var PY=V([Bl],e=>e.tooltipItemPayloads),zY=V([PY,Bo,(e,t)=>t,(e,t,n)=>n],(e,t,n,a)=>{var l=e.find(f=>f.settings.graphicalItemId===a);if(l!=null){var{positions:o}=l;if(o!=null){var c=t(o,n);return c}}}),XM=Vn("touchMove"),FM=Eo();FM.startListening({actionCreator:XM,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var a=t.getState(),l=cg(a,a.tooltip.settings.shared);if(l==="axis"){var o=n.touches[0];if(o==null)return;var c=Tg(a,Mg({clientX:o.clientX,clientY:o.clientY,currentTarget:n.currentTarget}));c?.activeIndex!=null&&t.dispatch(MT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate}))}else if(l==="item"){var f,d=n.touches[0];if(document.elementFromPoint==null||d==null)return;var h=document.elementFromPoint(d.clientX,d.clientY);if(!h||!h.getAttribute)return;var v=h.getAttribute(xE),p=(f=h.getAttribute(SE))!==null&&f!==void 0?f:void 0,b=Il(a).find(j=>j.id===p);if(v==null||b==null||p==null)return;var{dataKey:x}=b,O=zY(a,v,p);t.dispatch(NT({activeDataKey:x,activeIndex:v,activeCoordinate:O,activeGraphicalItemId:p}))}}}});var RY=IA({brush:hH,cartesianAxis:aH,chartData:B$,errorBars:cK,graphicalItems:sI,layout:m5,legend:bR,options:R$,polarAxis:bB,polarOptions:kY,referenceElements:xH,rootProps:MY,tooltip:n7,zIndex:O$}),LY=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return $z({reducer:RY,preloadedState:t,middleware:a=>{var l;return a({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((l="es6")!==null&&l!==void 0?l:"")}).concat([BM.middleware,IM.middleware,Cg.middleware,VM.middleware,FM.middleware])},enhancers:a=>{var l=a;return typeof a=="function"&&(l=a()),l.concat(rE({type:"raf"}))},devTools:{serialize:{replacer:TY},name:"recharts-".concat(n)}})};function ZM(e){var{preloadedState:t,children:n,reduxStoreName:a}=e,l=mn(),o=S.useRef(null);if(l)return n;o.current==null&&(o.current=LY(t,a));var c=Q0;return S.createElement(BK,{context:c,store:o.current},n)}function UY(e){var{layout:t,margin:n}=e,a=Qe(),l=mn();return S.useEffect(()=>{l||(a(f5(t)),a(c5(n)))},[a,l,t,n]),null}var QM=S.memo(UY,Eg);function WM(e){var t=Qe();return S.useEffect(()=>{t(CY(e))},[t,e]),null}function N_(e){var{zIndex:t,isPanorama:n}=e,a=S.useRef(null),l=Qe();return S.useLayoutEffect(()=>(a.current&&l(w$({zIndex:t,element:a.current,isPanorama:n})),()=>{l(j$({zIndex:t,isPanorama:n}))}),[l,t,n]),S.createElement("g",{tabIndex:-1,ref:a})}function T_(e){var{children:t,isPanorama:n}=e,a=de(d$);if(!a||a.length===0)return t;var l=a.filter(c=>c<0),o=a.filter(c=>c>0);return S.createElement(S.Fragment,null,l.map(c=>S.createElement(N_,{key:c,zIndex:c,isPanorama:n})),t,o.map(c=>S.createElement(N_,{key:c,zIndex:c,isPanorama:n})))}var $Y=["children"];function qY(e,t){if(e==null)return{};var n,a,l=BY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var n=iy(),a=ly(),l=$E();if(!yr(n)||!yr(a))return null;var{children:o,otherAttributes:c,title:f,desc:d}=e,h,v;return c!=null&&(typeof c.tabIndex=="number"?h=c.tabIndex:h=l?0:void 0,typeof c.role=="string"?v=c.role:v=l?"application":void 0),S.createElement(U0,Ef({},c,{title:f,desc:d,role:v,tabIndex:h,width:n,height:a,style:IY,ref:t}),o)}),KY=e=>{var{children:t}=e,n=de(Vf);if(!n)return null;var{width:a,height:l,y:o,x:c}=n;return S.createElement(U0,{width:a,height:l,x:c,y:o},t)},M_=S.forwardRef((e,t)=>{var{children:n}=e,a=qY(e,$Y),l=mn();return l?S.createElement(KY,null,S.createElement(T_,{isPanorama:!0},n)):S.createElement(HY,Ef({ref:t},a),S.createElement(T_,{isPanorama:!1},n))});function YY(){var e=Qe(),[t,n]=S.useState(null),a=de(T5);return S.useEffect(()=>{if(t!=null){var l=t.getBoundingClientRect(),o=l.width/t.offsetWidth;wt(o)&&o!==a&&e(h5(o))}},[t,e,a]),n}function C_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function GY(e){for(var t=1;t(Z$(),null);function Nf(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var QY=S.forwardRef((e,t)=>{var n,a,l=S.useRef(null),[o,c]=S.useState({containerWidth:Nf((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Nf((a=e.style)===null||a===void 0?void 0:a.height)}),f=S.useCallback((h,v)=>{c(p=>{var b=Math.round(h),x=Math.round(v);return p.containerWidth===b&&p.containerHeight===x?p:{containerWidth:b,containerHeight:x}})},[]),d=S.useCallback(h=>{if(typeof t=="function"&&t(h),h!=null&&typeof ResizeObserver<"u"){var{width:v,height:p}=h.getBoundingClientRect();f(v,p);var b=O=>{var{width:j,height:_}=O[0].contentRect;f(j,_)},x=new ResizeObserver(b);x.observe(h),l.current=x}},[t,f]);return S.useEffect(()=>()=>{var h=l.current;h?.disconnect()},[f]),S.createElement(S.Fragment,null,S.createElement(Ff,{width:o.containerWidth,height:o.containerHeight}),S.createElement("div",Ai({ref:d},e)))}),WY=S.forwardRef((e,t)=>{var{width:n,height:a}=e,[l,o]=S.useState({containerWidth:Nf(n),containerHeight:Nf(a)}),c=S.useCallback((d,h)=>{o(v=>{var p=Math.round(d),b=Math.round(h);return v.containerWidth===p&&v.containerHeight===b?v:{containerWidth:p,containerHeight:b}})},[]),f=S.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:h,height:v}=d.getBoundingClientRect();c(h,v)}},[t,c]);return S.createElement(S.Fragment,null,S.createElement(Ff,{width:l.containerWidth,height:l.containerHeight}),S.createElement("div",Ai({ref:f},e)))}),JY=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return S.createElement(S.Fragment,null,S.createElement(Ff,{width:n,height:a}),S.createElement("div",Ai({ref:t},e)))}),eG=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return Yr(n)||Yr(a)?S.createElement(WY,Ai({},e,{ref:t})):S.createElement(JY,Ai({},e,{ref:t}))});function tG(e){return e===!0?QY:eG}var nG=S.forwardRef((e,t)=>{var{children:n,className:a,height:l,onClick:o,onContextMenu:c,onDoubleClick:f,onMouseDown:d,onMouseEnter:h,onMouseLeave:v,onMouseMove:p,onMouseUp:b,onTouchEnd:x,onTouchMove:O,onTouchStart:j,style:_,width:E,responsive:N,dispatchTouchEvents:T=!0}=e,C=S.useRef(null),k=Qe(),[M,L]=S.useState(null),[W,re]=S.useState(null),H=YY(),$=ay(),K=$?.width>0?$.width:E,ce=$?.height>0?$.height:l,ue=S.useCallback(Q=>{H(Q),typeof t=="function"&&t(Q),L(Q),re(Q),Q!=null&&(C.current=Q)},[H,t,L,re]),ve=S.useCallback(Q=>{k(qM(Q)),k(Hn({handler:o,reactEvent:Q}))},[k,o]),I=S.useCallback(Q=>{k(_0(Q)),k(Hn({handler:h,reactEvent:Q}))},[k,h]),ee=S.useCallback(Q=>{k(TT()),k(Hn({handler:v,reactEvent:Q}))},[k,v]),z=S.useCallback(Q=>{k(_0(Q)),k(Hn({handler:p,reactEvent:Q}))},[k,p]),G=S.useCallback(()=>{k(GM())},[k]),ne=S.useCallback(Q=>{k(YM(Q.key))},[k]),P=S.useCallback(Q=>{k(Hn({handler:c,reactEvent:Q}))},[k,c]),F=S.useCallback(Q=>{k(Hn({handler:f,reactEvent:Q}))},[k,f]),ie=S.useCallback(Q=>{k(Hn({handler:d,reactEvent:Q}))},[k,d]),le=S.useCallback(Q=>{k(Hn({handler:b,reactEvent:Q}))},[k,b]),ye=S.useCallback(Q=>{k(Hn({handler:j,reactEvent:Q}))},[k,j]),be=S.useCallback(Q=>{T&&k(XM(Q)),k(Hn({handler:O,reactEvent:Q}))},[k,T,O]),he=S.useCallback(Q=>{k(Hn({handler:x,reactEvent:Q}))},[k,x]),ut=tG(N);return S.createElement(FT.Provider,{value:M},S.createElement(iA.Provider,{value:W},S.createElement(ut,{width:K??_?.width,height:ce??_?.height,className:Re("recharts-wrapper",a),style:GY({position:"relative",cursor:"default",width:K,height:ce},_),onClick:ve,onContextMenu:P,onDoubleClick:F,onFocus:G,onKeyDown:ne,onMouseDown:ie,onMouseEnter:I,onMouseLeave:ee,onMouseMove:z,onMouseUp:le,onTouchEnd:he,onTouchMove:be,onTouchStart:ye,ref:ue},S.createElement(ZY,null),n)))}),rG=["width","height","responsive","children","className","style","compact","title","desc"];function aG(e,t){if(e==null)return{};var n,a,l=iG(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{width:n,height:a,responsive:l,children:o,className:c,style:f,compact:d,title:h,desc:v}=e,p=aG(e,rG),b=Gn(p);return d?S.createElement(S.Fragment,null,S.createElement(Ff,{width:n,height:a}),S.createElement(M_,{otherAttributes:b,title:h,desc:v},o)):S.createElement(nG,{className:c,style:f,width:n,height:a,responsive:l??!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},S.createElement(M_,{otherAttributes:b,title:h,desc:v,ref:t},S.createElement(wH,null,o)))});function A0(){return A0=Object.assign?Object.assign.bind():function(e){for(var t=1;tS.createElement(oG,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:sG,tooltipPayloadSearcher:ZT,categoricalChartProps:e,ref:t}));function cG(e){var t=Qe();return S.useEffect(()=>{t(DY(e))},[t,e]),null}var fG=["layout"];function E0(){return E0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=At(e,xG);return S.createElement(vG,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:bG,tooltipPayloadSearcher:ZT,categoricalChartProps:n,ref:t})});function wG(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function jG(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function OG({earnings:e,loading:t,error:n}){const[a,l]=S.useState("earnings"),[o,c]=S.useState(null),f=(e?.models??[]).map(p=>({model:p.model,value:a==="earnings"?p.total_usd:p.tokens_in+p.tokens_out,usd:p.total_usd,tokens:p.tokens_in+p.tokens_out,priced:p.priced})).filter(p=>p.value>0).sort((p,b)=>b.value-p.value),d=tA(e?.models),h=f.reduce((p,b)=>p+b.value,0),v=(e?.models??[]).filter(p=>!p.priced).length;return t&&!e?g.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-slate-800/50"}):g.jsxs("div",{className:"min-w-0 overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 px-4 py-3",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Share by model"}),g.jsx("div",{className:"flex gap-1",role:"group","aria-label":"Distribute by",children:["earnings","tokens"].map(p=>g.jsx("button",{type:"button",onClick:()=>l(p),"aria-pressed":a===p,className:`rounded-lg px-3 py-1.5 text-xs font-medium capitalize transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${a===p?"bg-slate-700 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:p},p))})]}),n&&!e?g.jsxs("div",{className:"px-4 py-8",children:[g.jsx("p",{className:"text-sm font-medium text-amber-200",children:"Traffic mix is unavailable"}),g.jsx("p",{className:"mt-1 text-xs text-slate-300",children:n.message})]}):f.length===0?g.jsxs("p",{className:"px-4 py-8 text-sm text-slate-400",children:["No ",a==="earnings"?"priced earnings":"traffic"," recorded since the node started."]}):g.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4 sm:flex-row sm:items-center",children:[g.jsx("div",{className:"h-40 w-40 shrink-0 self-center",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsx(SG,{children:g.jsx(OM,{data:f,dataKey:"value",nameKey:"model",innerRadius:"55%",outerRadius:"100%",paddingAngle:1,stroke:"none",isAnimationActive:!1,onMouseEnter:(p,b)=>c(b),onMouseLeave:()=>c(null),children:f.map((p,b)=>g.jsx(yd,{fill:Pc(d,f[b]?.model??""),opacity:o===null||o===b?1:.35},b))})})})}),g.jsx("ul",{className:"min-w-0 flex-1 space-y-1",children:f.map((p,b)=>{const x=h>0?p.value/h*100:0;return g.jsxs("li",{onMouseEnter:()=>c(b),onMouseLeave:()=>c(null),className:`flex items-start gap-2 rounded px-1 py-0.5 text-xs transition ${o===b?"bg-slate-800":""}`,children:[g.jsx("span",{className:"mt-0.5 block h-2.5 w-2.5 shrink-0 rounded-sm",style:{background:Pc(d,p.model)}}),g.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-slate-300",children:p.model}),g.jsxs("span",{className:"shrink-0 tabular-nums text-slate-300",children:[x.toFixed(1),"%"]}),g.jsx("span",{className:"w-20 shrink-0 text-right tabular-nums text-slate-400",children:a==="earnings"?wG(p.usd):jG(p.tokens)})]},p.model)})})]}),g.jsxs("p",{className:"flex items-start gap-2 border-t border-slate-800 px-4 py-3 text-xs text-slate-300",children:[g.jsx(Tf,{"aria-hidden":"true",size:14,className:"mt-px shrink-0"}),g.jsxs("span",{children:["Share of traffic served since this node last started — its counters reset on restart, so this is the recent mix rather than an all-time split. Probes are excluded.",v>0&&a==="earnings"&&` ${v} model(s) had no rate available and are absent from the earnings split; switch to tokens to see them.`]})]})]})}const P_={green:"text-green-400",red:"text-red-400",yellow:"text-yellow-400",blue:"text-blue-400",gray:"text-gray-400"};function Xu({title:e,value:t,subtitle:n,icon:a,color:l="blue"}){return g.jsxs("div",{className:"min-w-0 rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[g.jsx("span",{className:"truncate text-xs text-slate-300 sm:text-sm",children:e}),a&&g.jsx("span",{"aria-hidden":"true",className:P_[l],children:a})]}),g.jsx("div",{className:`truncate text-lg font-bold sm:text-2xl ${P_[l]}`,title:String(t),children:t}),n&&g.jsx("div",{className:"mt-1 truncate text-[11px] text-slate-400 sm:text-xs",title:n,children:n})]})}function _G(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function AG(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toFixed(0)}function EG({metrics:e,loading:t,error:n,earnings:a,earningsError:l,earningsLoading:o}){if(t)return g.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[...Array(5)].map((x,O)=>g.jsxs("div",{className:"animate-pulse rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsx("div",{className:"h-4 bg-slate-700 rounded w-20 mb-2"}),g.jsx("div",{className:"h-8 bg-slate-700 rounded w-16"})]},O))});const c=!!(e&&e.total_requests>0),f=c&&e?(e.successful_requests/e.total_requests*100).toFixed(1):null,d=!!a?.platform?.unavailable,h=!!l||!a&&!o||d,v=h?null:a?.platform?.uptime_7d_percent,p=v==null?"gray":v>=99?"green":v>=95?"yellow":"red",b=f==null?"gray":parseFloat(f)>=99?"green":parseFloat(f)>=95?"yellow":"red";return g.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[g.jsx(Xu,{title:"7-day uptime",value:v==null?"--":`${v.toFixed(2)}%`,subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"reported by Swan Inference",icon:g.jsx(Z_,{"aria-hidden":"true",size:20}),color:p}),g.jsx(Xu,{title:"Session success",value:f==null?"--":`${f}%`,subtitle:e?c?`${e.failed_requests} failed of ${AG(e.total_requests)}`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(V_,{"aria-hidden":"true",size:20}),color:b}),g.jsx(Xu,{title:"P95 latency",value:e&&c?`${e.p95_latency_ms.toFixed(0)}ms`:"--",subtitle:e?c?`Average ${e.avg_latency_ms.toFixed(0)}ms · no SLA applied`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(T0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Request rate",value:e?`${e.requests_per_minute.toFixed(1)}/min`:"--",subtitle:e?`${e.active_requests} active now`:n?"Metrics API unavailable":"No data",icon:g.jsx(M0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Lifetime earned",value:h||!a?"--":_G(a.platform.total_usd),subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"authoritative platform total",icon:g.jsx(cD,{"aria-hidden":"true",size:20}),color:h?"gray":"green"})]})}function z_({value:e,max:t,color:n,label:a}){const l=t>0?e/t*100:0;return g.jsx("div",{className:"h-2 w-full rounded-full bg-slate-700",role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(Math.min(l,100)),children:g.jsx("div",{className:`h-2 rounded-full ${n}`,style:{width:`${Math.min(l,100)}%`}})})}function NG({gpus:e,loading:t,error:n}){if(t)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("div",{className:"animate-pulse space-y-4",children:g.jsx("div",{className:"h-20 bg-slate-700 rounded"})})]});if(!e||e.length===0)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("p",{className:"text-slate-400",children:n?"API unreachable":"No GPUs detected"})]});const a=Math.max(...e.map(o=>o.temperature_c)),l=e.filter(o=>o.utilization_percent>5).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"GPU capacity"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[l," active · peak ",a,"°C"]})]}),g.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-300",children:[g.jsx(dD,{"aria-hidden":"true",size:16}),g.jsxs("span",{children:[e.length," GPU",e.length>1?"s":""]})]})]}),g.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:e.map(o=>g.jsxs("div",{className:"border border-slate-700 rounded-lg p-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-slate-200",title:o.name,children:o.name}),g.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[g.jsx(BD,{"aria-hidden":"true",size:14,className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300"}),g.jsxs("span",{className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300",children:[o.temperature_c,"°C"]})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Utilization"}),g.jsxs("span",{children:[o.utilization_percent.toFixed(0),"%"]})]}),g.jsx(z_,{value:o.utilization_percent,max:100,color:"bg-blue-500",label:`${o.name} utilization`})]}),o.memory_total_mb>0&&g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Memory"}),g.jsxs("span",{children:[(o.memory_used_mb/1024).toFixed(1)," / ",(o.memory_total_mb/1024).toFixed(1)," GB"]})]}),g.jsx(z_,{value:o.memory_used_mb,max:o.memory_total_mb,color:o.memory_used_mb/o.memory_total_mb>=.98?"bg-red-500":o.memory_used_mb/o.memory_total_mb>=.95?"bg-amber-400":"bg-blue-500",label:`${o.name} memory allocation`})]})]})]},o.index))})]})}const R_={healthy:"bg-emerald-400",degraded:"bg-amber-400",unhealthy:"bg-red-500",unknown:"bg-slate-600"};function TG({samples:e}){if(!e||e.length===0)return null;const t=e.slice(-40),n=t.reduce((l,o)=>(l[o]=(l[o]??0)+1,l),{}),a=Object.entries(n).map(([l,o])=>`${o} ${l}`).join(", ");return g.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[g.jsx("div",{className:"flex gap-px",role:"img","aria-label":`Recent health: ${a}`,children:t.map((l,o)=>g.jsx("span",{title:l,className:`block h-3 w-1 rounded-sm ${R_[l]??R_.unknown}`},o))}),g.jsx("span",{className:"text-[10px] text-slate-400",children:"recent"})]})}const L_=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4});function MG({models:e,healthLog:t,prices:n,loading:a,error:l,onRefresh:o,onModelClick:c,authenticated:f,onUnlock:d,summary:h,compact:v=!1}){const[p,b]=S.useState(null),[x,O]=S.useState(""),[j,_]=S.useState(!1),E=()=>f?!0:(d(),!1),N=async $=>{if(E()){b($.id),O("");try{$.enabled?await Ze.disableModel($.id):await Ze.enableModel($.id),o()}catch(K){O(K instanceof Error?K.message:"Failed to update model")}finally{b(null)}}},T=async $=>{if(E()){b(`health-${$}`),O("");try{await Ze.forceHealthCheck($),o()}catch(K){O(K instanceof Error?K.message:"Failed to run health check")}finally{b(null)}}},C=async()=>{if(E()){b("reload"),O("");try{await Ze.reloadModels(),o()}catch($){O($ instanceof Error?$.message:"Failed to reload models")}finally{b(null)}}};if(a)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"Models"}),g.jsx("div",{className:"animate-pulse space-y-3",children:[...Array(2)].map(($,K)=>g.jsx("div",{className:"h-16 bg-slate-700 rounded"},K))})]});const k=$=>$.health_string==="healthy",M=e.filter($=>!$.enabled||!k($)),L=v&&!j?M:e,W=h?.ready??e.filter($=>$.enabled&&k($)).length,re=h?.unhealthy??e.filter($=>$.enabled&&!k($)).length,H=h?.disabled??e.filter($=>!$.enabled).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Models"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[W," ready",re>0&&` · ${re} unhealthy`,H>0&&` · ${H} disabled`]})]}),g.jsxs("button",{type:"button",onClick:C,disabled:p==="reload",className:"flex min-h-10 items-center gap-1.5 rounded-lg border border-slate-600 bg-slate-800 px-3 text-sm transition-colors hover:bg-slate-700 disabled:opacity-50",children:[f?g.jsx(D0,{"aria-hidden":"true",size:14,className:p==="reload"?"animate-spin":""}):g.jsx(C0,{"aria-hidden":"true",size:14}),"Reload Config"]})]}),x&&g.jsx("p",{role:"alert",className:"mb-3 rounded-lg border border-red-800/60 bg-red-950/30 px-3 py-2 text-sm text-red-300",children:x}),!e||e.length===0?g.jsx("p",{className:"text-slate-400",children:l?"API unreachable":"No models configured"}):v&&!j&&M.length===0?g.jsxs("div",{className:"rounded-lg border border-emerald-900/60 bg-emerald-950/20 px-4 py-5 text-center",children:[g.jsx(wl,{"aria-hidden":"true",size:24,className:"mx-auto text-emerald-300"}),g.jsx("p",{className:"mt-2 text-sm font-medium text-emerald-100",children:"All configured models are ready"}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Healthy models are collapsed to keep operational exceptions visible."})]}):g.jsx("div",{className:"space-y-3",children:L.map($=>{const K=n[$.id];return g.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border border-slate-600 bg-slate-700/50 p-3 transition-colors hover:border-slate-500 sm:items-center",children:[g.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-start gap-3 rounded text-left focus:outline-none focus:ring-2 focus:ring-blue-500 sm:items-center",onClick:()=>c?.($.id),"aria-label":`View details for ${$.id}`,children:[g.jsx("div",{className:"flex-shrink-0",children:$.enabled?k($)?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(Pa,{size:20,className:"text-red-400"}):g.jsx(Tf,{size:20,className:"text-slate-400"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"break-words font-medium text-slate-200",children:$.id}),g.jsxs("div",{className:"mt-0.5 break-all text-xs text-slate-400",children:[$.endpoint," • ",$.category,$.gpu_memory>0&&` • ${($.gpu_memory/1024).toFixed(1)}GB VRAM`]}),g.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[$.state_string," • ",$.health_string]}),g.jsx(TG,{samples:t?.[$.id]??[]}),K&&g.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[g.jsx("span",{className:"font-medium text-emerald-300",children:"Provider payout / 1M"}),g.jsxs("span",{className:"text-blue-200",children:["In ",L_.format(K.provider_input_price)]}),g.jsxs("span",{className:"text-violet-200",children:["Out ",L_.format(K.provider_output_price)]})]})]})]}),g.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1 sm:gap-2",children:[g.jsx("button",{type:"button",onClick:()=>T($.id),disabled:p===`health-${$.id}`||!$.enabled,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-slate-600 rounded transition-colors disabled:opacity-50",title:"Force health check","aria-label":`Run health check for ${$.id}`,children:g.jsx(Pl,{size:16,className:p===`health-${$.id}`?"animate-spin":""})}),g.jsx("button",{type:"button",onClick:()=>N($),disabled:p===$.id,className:`p-2 rounded transition-colors ${$.enabled?"text-green-400 hover:text-green-300 hover:bg-green-900/30":"text-slate-400 hover:text-slate-300 hover:bg-slate-600"} disabled:opacity-50`,title:$.enabled?"Disable model":"Enable model","aria-label":`${$.enabled?"Disable":"Enable"} ${$.id}`,children:g.jsx(_D,{size:16})})]})]},$.id)})}),v&&e.length>0&&g.jsxs("button",{type:"button",onClick:()=>_($=>!$),className:"mt-4 inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-950/40 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-expanded":j,children:[j?g.jsx(Ep,{"aria-hidden":"true",size:16}):g.jsx(kc,{"aria-hidden":"true",size:16}),j?"Hide healthy models":`Show all ${e.length} models`]})]})}function CG({data:e,loading:t,error:n,onOpenSettings:a}){if(t)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("div",{className:"h-28 animate-pulse rounded-lg bg-slate-800"})]});if(!e)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"text-sm text-slate-400",children:n?"API unreachable":"No control data available"})]});const{rate_limiter:l,concurrency_limiter:o,retry_policy:c}=e;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Current admission and retry state"})]}),g.jsx("button",{type:"button",onClick:a,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg text-slate-400 transition hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Open request limit settings",children:g.jsx(LD,{"aria-hidden":"true",size:18})})]}),g.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:[g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(M0,{"aria-hidden":"true",size:14,className:"text-blue-400"}),g.jsx("span",{children:"Rate limit"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[l.current_rate.toFixed(0)," ",g.jsx("span",{className:"text-xs font-normal text-slate-400",children:"req/s"})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[l.total_throttled," throttled · burst ",l.burst_size]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(pD,{"aria-hidden":"true",size:14,className:"text-emerald-400"}),g.jsx("span",{children:"Concurrency"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[o.global_active,g.jsxs("span",{className:"text-slate-400",children:["/",o.global_max]})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:["active slots · ",o.total_rejected," rejected"]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(D0,{"aria-hidden":"true",size:14,className:"text-amber-300"}),g.jsx("span",{children:"Retry recovery"})]}),g.jsx("div",{className:"mt-2 text-lg font-semibold text-white",children:c.total_retries>0?`${(c.retry_success_rate*100).toFixed(0)}%`:"—"}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[c.total_successes," recovered · ",c.total_failures," failed"]})]})]})]})}function DG(e){return e?`Updated ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}`:""}function kG({status:e,loading:t,error:n,lastUpdated:a}){return t?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx("div",{className:"w-3 h-3 bg-slate-600 rounded-full animate-pulse"}),g.jsx("span",{className:"text-sm text-slate-300",children:"Connecting…"})]}):!e&&n?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg border border-amber-800 bg-amber-900/20 px-3 py-2",children:[g.jsx(Np,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm text-amber-200",children:"API unavailable"})]}):e?g.jsxs("div",{title:n?.message,className:`flex min-h-10 items-center gap-2 rounded-lg border px-2.5 py-2 sm:gap-3 sm:px-3 ${n?"border-amber-800 bg-amber-900/20":e.connected?"border-green-800 bg-green-900/20":"border-red-800 bg-red-900/20"}`,children:[g.jsx("div",{className:"flex items-center gap-2",children:n?g.jsxs(g.Fragment,{children:[g.jsx(Np,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm font-medium text-amber-200",children:"Stale"})]}):e.connected?g.jsxs(g.Fragment,{children:[g.jsx(VD,{"aria-hidden":"true",size:16,className:"text-green-400"}),g.jsx("span",{className:"text-sm font-medium text-green-300",children:"Connected"})]}):g.jsxs(g.Fragment,{children:[g.jsx(HS,{"aria-hidden":"true",size:16,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Disconnected"})]})}),!n&&g.jsxs("div",{className:"ml-auto hidden text-xs text-slate-300 md:block",children:[DG(a),e.active_models?.length>0&&` · ${e.active_models.length} model${e.active_models.length>1?"s":""}`]})]}):g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx(HS,{"aria-hidden":"true",size:16,className:"text-slate-300"}),g.jsx("span",{className:"text-sm text-slate-300",children:"No data"})]})}function N0(e,t=!1){if(!e)return"—";const n=new Date(e);return t?n.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"}):n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}function U_(e){return e<1e3?`${e.toFixed(0)} ms`:`${(e/1e3).toFixed(2)} s`}function $_(e){return e>5e3?"text-red-300":e>2e3?"text-amber-300":"text-emerald-300"}const lo={hub:{label:"Hub",title:"Routed to this node by Swan Inference",className:"bg-blue-500/10 text-blue-300 ring-blue-500/30"},health:{label:"Health",title:"This node's own engine probe: a one-token completion checking the backend can serve",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"},selfcheck:{label:"Self-check",title:"This node's periodic audit probe",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"}},q_=[25,50,100];function B_({source:e}){const t=lo[e??"hub"]??lo.hub;return g.jsx("span",{title:t.title,className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset ${t.className}`,children:t.label})}function I_({success:e}){return e?g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-800/70 bg-emerald-950/40 px-2 py-1 text-xs font-medium text-emerald-300",children:[g.jsx(wl,{"aria-hidden":"true",size:13})," Success"]}):g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-red-800/70 bg-red-950/40 px-2 py-1 text-xs font-medium text-red-300",children:[g.jsx(Pa,{"aria-hidden":"true",size:13})," Failed"]})}function H_({request:e}){return g.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Request ID"}),g.jsx("span",{className:"mt-1 block break-all font-mono text-slate-300",children:e.request_id})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Completed"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:N0(e.end_time,!0)})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Total tokens"}),g.jsx("span",{className:"mt-1 block font-mono text-slate-300",children:(e.tokens_in+e.tokens_out).toLocaleString()})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Delivery"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:e.streaming?"Streaming":"Single response"})]}),e.error_reason&&g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("span",{className:"block text-slate-400",children:"Error"}),g.jsx("span",{className:"mt-1 block break-words text-red-300",children:e.error_reason})]})]})}function PG({models:e}){const[t,n]=S.useState(""),[a,l]=S.useState(""),[o,c]=S.useState(q_[0]),[f,d]=S.useState(0),[h,v]=S.useState(null),p=H=>{H(),d(0),v(null)},{data:b,error:x,loading:O,refetch:j}=Da(S.useCallback(()=>Ze.getRequestHistory({limit:o,offset:f*o,model:t||void 0,source:a||void 0}),[o,f,t,a]),f===0?1e4:0),_=b?.requests??[],E=b?.total??0,N=_.reduce((H,$)=>H+$.tokens_in,0),T=_.reduce((H,$)=>H+$.tokens_out,0),C=H=>v($=>$===H?null:H),k=Math.max(1,Math.ceil(E/o)),M=E===0?0:f*o+1,L=f*o+_.length,W=f>0,re=Lp(()=>n(H.target.value)),className:"min-h-10 min-w-0 flex-1 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 sm:min-w-56",children:[g.jsx("option",{value:"",children:"All models"}),e.map(H=>g.jsx("option",{value:H.id,children:H.id},H.id))]}),g.jsx("label",{htmlFor:"transaction-source-filter",className:"sr-only",children:"Filter requests by source"}),g.jsxs("select",{id:"transaction-source-filter",value:a,onChange:H=>p(()=>l(H.target.value)),className:"min-h-10 min-w-0 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:[g.jsx("option",{value:"",children:"All sources"}),Object.entries(lo).map(([H,$])=>g.jsx("option",{value:H,children:$.label},H))]}),g.jsx("button",{type:"button",onClick:j,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh requests",children:g.jsx(Pl,{"aria-hidden":"true",size:16,className:O?"animate-spin":""})})]})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[g.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900 p-3 sm:p-4",children:[g.jsx("p",{className:"text-xs text-slate-400",children:"Matching"}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:E.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:t||a?"requests match the filters":"requests in history"})]}),g.jsxs("div",{className:"rounded-xl border border-blue-900/70 bg-blue-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-blue-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Input tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:N.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]}),g.jsxs("div",{className:"rounded-xl border border-violet-900/70 bg-violet-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-violet-300",children:[g.jsx(Km,{"aria-hidden":"true",size:13})," Output tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:T.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]})]}),g.jsx("div",{className:"overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:O&&_.length===0?g.jsx("div",{className:"animate-pulse space-y-3 p-4",role:"status","aria-label":"Loading transactions",children:[...Array(6)].map((H,$)=>g.jsx("div",{className:"h-14 rounded-lg bg-slate-800"},$))}):x&&_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center",children:[g.jsx(Pa,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-red-400"}),g.jsx("p",{className:"font-medium text-red-200",children:"Requests are unavailable"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:x.message}),g.jsx("button",{type:"button",onClick:j,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]}):_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center text-slate-400",children:[g.jsx(T0,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-slate-600"}),t||a?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests match these filters"}),g.jsxs("p",{className:"mt-1 text-sm",children:["Nothing recorded for ",a?`${lo[a].label.toLowerCase()} traffic`:"this source",t?` on ${t}`:""," yet."]}),g.jsx("button",{type:"button",onClick:()=>p(()=>{n(""),l("")}),className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:"Clear filters"})]}):g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests yet"}),g.jsx("p",{className:"mt-1 text-sm",children:"Requests will appear here after the provider serves inference."})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"hidden overflow-x-auto md:block",children:g.jsxs("table",{className:"w-full min-w-[840px] text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"border-b border-slate-800 bg-slate-950/40 text-xs uppercase tracking-wide text-slate-400",children:[g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Started"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Model"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Source"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Latency"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Input tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Km,{"aria-hidden":"true",size:13})," Output tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Status"}),g.jsx("th",{className:"w-12 px-3 py-3",children:g.jsx("span",{className:"sr-only",children:"Details"})})]})}),g.jsx("tbody",{children:_.map(H=>{const $=h===H.request_id;return g.jsxs(S.Fragment,{children:[g.jsxs("tr",{className:`border-b border-slate-800/80 ${H.success?"hover:bg-slate-800/35":"bg-red-950/10 hover:bg-red-950/20"}`,children:[g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-slate-300",title:new Date(H.start_time).toLocaleString(),children:N0(H.start_time)}),g.jsxs("td",{className:"max-w-xs px-4 py-3",children:[g.jsx("span",{className:"block truncate font-mono text-xs text-slate-200",title:H.model,children:H.model}),H.streaming&&g.jsx("span",{className:"mt-0.5 block text-xs text-blue-300",children:"Streaming"})]}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3",children:g.jsx(B_,{source:H.source})}),g.jsx("td",{className:`whitespace-nowrap px-4 py-3 text-right font-mono text-xs ${$_(H.latency_ms)}`,children:U_(H.latency_ms)}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-blue-200",children:H.tokens_in.toLocaleString()}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-violet-200",children:H.tokens_out.toLocaleString()}),g.jsx("td",{className:"px-4 py-3 text-right",children:g.jsx(I_,{success:H.success})}),g.jsx("td",{className:"px-3 py-3 text-right",children:g.jsx("button",{type:"button",onClick:()=>C(H.request_id),"aria-expanded":$,"aria-controls":`receipt-${H.request_id}`,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":`${$?"Hide":"Show"} details for request ${H.request_id}`,children:$?g.jsx(Ep,{"aria-hidden":"true",size:16}):g.jsx(kc,{"aria-hidden":"true",size:16})})})]}),$&&g.jsx("tr",{id:`receipt-${H.request_id}`,className:"border-b border-slate-800 bg-slate-950/60",children:g.jsx("td",{colSpan:8,className:"px-4 py-4",children:g.jsx(H_,{request:H})})})]},H.request_id)})})]})}),g.jsx("div",{className:"divide-y divide-slate-800 md:hidden",children:_.map(H=>{const $=h===H.request_id;return g.jsxs("article",{className:H.success?"":"bg-red-950/10",children:[g.jsxs("button",{type:"button",onClick:()=>C(H.request_id),"aria-expanded":$,"aria-controls":`mobile-receipt-${H.request_id}`,className:"w-full p-4 text-left focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-sm text-white",children:H.model}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[N0(H.start_time,!0),H.streaming?" · Streaming":""]})]}),g.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-slate-400",children:[g.jsx(B_,{source:H.source}),$?g.jsx(Ep,{"aria-hidden":"true",size:18}):g.jsx(kc,{"aria-hidden":"true",size:18})]})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-[11px] text-slate-400",children:"Latency"}),g.jsx("span",{className:`mt-0.5 block font-mono text-xs ${$_(H.latency_ms)}`,children:U_(H.latency_ms)})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-blue-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:11})," Input"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-blue-100",children:H.tokens_in.toLocaleString()})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-violet-300",children:[g.jsx(Km,{"aria-hidden":"true",size:11})," Output"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-violet-100",children:H.tokens_out.toLocaleString()})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx(I_,{success:H.success})})]}),$&&g.jsx("div",{id:`mobile-receipt-${H.request_id}`,className:"border-t border-slate-800 bg-slate-950/60 p-4",children:g.jsx(H_,{request:H})})]},H.request_id)})})]})}),g.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("p",{className:"text-xs text-slate-400","aria-live":"polite",children:[E===0?"No requests to show.":`Showing ${M.toLocaleString()}–${L.toLocaleString()} of ${E.toLocaleString()}`,t?` for ${t}`:"",a?` from ${lo[a].label.toLowerCase()}`:"",". ",f===0?"Auto-refreshes every 10 seconds.":"Auto-refresh is paused while viewing older pages."]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("label",{htmlFor:"transaction-page-size",className:"text-xs text-slate-400",children:"Per page"}),g.jsx("select",{id:"transaction-page-size",value:o,onChange:H=>p(()=>c(Number(H.target.value))),className:"min-h-9 rounded-lg border border-slate-700 bg-slate-900 px-2 text-xs text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:q_.map(H=>g.jsx("option",{value:H,children:H},H))}),g.jsxs("div",{className:"ml-1 flex items-center gap-1",children:[g.jsx("button",{type:"button",onClick:()=>{d(H=>Math.max(0,H-1)),v(null)},disabled:!W,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Previous page",children:g.jsx(Q4,{"aria-hidden":"true",size:16})}),g.jsxs("span",{className:"px-2 text-xs tabular-nums text-slate-400",children:[f+1," / ",k]}),g.jsx("button",{type:"button",onClick:()=>{d(H=>H+1),v(null)},disabled:!re,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Next page",children:g.jsx(J4,{"aria-hidden":"true",size:16})})]})]})]})]})}const Ap={"1h":{duration:"1h",resolution:"1m",label:"1 Hour"},"6h":{duration:"6h",resolution:"5m",label:"6 Hours"},"24h":{duration:"24h",resolution:"15m",label:"24 Hours"},"7d":{duration:"168h",resolution:"1h",label:"7 Days"}};function zG(){const[e,t]=S.useState("1h"),n=Ap[e],{data:a,error:l,loading:o,refetch:c}=Da(S.useCallback(()=>Ze.getMetricsHistory(n.duration,n.resolution),[n.duration,n.resolution]),6e4),f=a?.data??[],d=N=>{const T=new Date(N);return e==="7d"?T.toLocaleDateString(void 0,{weekday:"short",day:"numeric"}):e==="24h"?T.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):T.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})},h=f.map(N=>({time:d(N.timestamp),requests:N.total_requests,successRate:N.success_rate,avgLatency:N.avg_latency_ms,p99Latency:N.p99_latency_ms,tokensPerSec:N.tokens_per_second})),v=h[h.length-1],p=h.flatMap(N=>[N.avgLatency,N.p99Latency]),b=p.length>0?Math.min(...p):0,x=p.length>0?Math.max(...p):0,O=h.length>0?Math.min(...h.map(N=>N.successRate)):0,j=h.length>0?Math.max(...h.map(N=>N.successRate)):0,_=h.length>0?Math.min(...h.map(N=>N.tokensPerSec)):0,E=h.length>0?Math.max(...h.map(N=>N.tokensPerSec)):0;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(IS,{size:20,className:"text-purple-400"}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Performance trends"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Persisted service signals across one shared time range"})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("div",{className:"flex min-w-0 flex-1 overflow-x-auto rounded-lg bg-slate-800 p-0.5 sm:flex-none",children:Object.keys(Ap).map(N=>g.jsx("button",{onClick:()=>t(N),className:`min-h-10 flex-1 whitespace-nowrap rounded px-2 py-1 text-xs font-medium transition-colors sm:flex-none sm:px-3 ${e===N?"bg-blue-600 text-white":"text-slate-400 hover:text-slate-200"}`,children:Ap[N].label},N))}),g.jsx("button",{type:"button",onClick:c,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",title:"Refresh","aria-label":"Refresh performance trends",children:g.jsx(Pl,{size:16,className:o?"animate-spin":""})})]})]}),l&&g.jsxs("div",{role:"alert",className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-3 py-2 text-sm text-amber-100",children:[g.jsx("span",{children:a?"Showing the last loaded trends; refresh failed.":`Performance trends are unavailable: ${l.message}`}),g.jsx("button",{type:"button",onClick:c,className:"min-h-10 rounded-lg border border-amber-700/70 px-3 text-sm hover:bg-amber-900/30",children:"Try again"})]}),o&&h.length===0?g.jsx("div",{className:"h-64 flex items-center justify-center",children:g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full"})}):h.length<2?g.jsx("div",{className:"h-64 flex items-center justify-center text-slate-400",children:g.jsxs("div",{className:"text-center",children:[g.jsx(IS,{size:32,className:"mx-auto mb-2 opacity-50"}),g.jsx("p",{children:"Not enough historical data yet"}),g.jsx("p",{className:"text-xs mt-1",children:"Data is recorded every minute"})]})}):g.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[g.jsxs("div",{role:"img","aria-label":`Latency ranged from ${b.toFixed(0)} to ${x.toFixed(0)} milliseconds. Latest average ${v?.avgLatency.toFixed(0)} milliseconds and P99 ${v?.p99Latency.toFixed(0)} milliseconds.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Latency (ms)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[(typeof N=="number"?N.toFixed(1):N)+"ms",""]}),g.jsx(UE,{wrapperStyle:{fontSize:"10px"},formatter:N=>g.jsx("span",{className:"text-slate-400",children:N})}),g.jsx(Sl,{type:"monotone",dataKey:"avgLatency",stroke:"#3b82f6",strokeWidth:2,dot:!1,name:"Avg"}),g.jsx(Sl,{type:"monotone",dataKey:"p99Latency",stroke:"#ef4444",strokeWidth:1.5,dot:!1,name:"P99"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Success rate ranged from ${O.toFixed(1)} to ${j.toFixed(1)} percent. Latest ${v?.successRate.toFixed(1)} percent.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Success rate (%)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,domain:[0,100]}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[(typeof N=="number"?N.toFixed(1):N)+"%","Success Rate"]}),g.jsx(Sl,{type:"monotone",dataKey:"successRate",stroke:"#22c55e",strokeWidth:2,dot:!1,name:"Success Rate"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Throughput ranged from ${_.toFixed(1)} to ${E.toFixed(1)} tokens per second. Latest ${v?.tokensPerSec.toFixed(1)} tokens per second.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Throughput (tokens/sec)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[typeof N=="number"?N.toFixed(1):N,"Tokens/sec"]}),g.jsx(Sl,{type:"monotone",dataKey:"tokensPerSec",stroke:"#a855f7",strokeWidth:2,dot:!1,name:"Tokens/sec"})]})})})]})]}),g.jsxs("div",{className:"mt-4 text-center text-xs text-slate-400",children:["Showing ",n.label," of data (",n.resolution," resolution)"]})]})}function RG({modelId:e,onClose:t}){const[n,a]=S.useState(null),[l,o]=S.useState(!0),[c,f]=S.useState(null),d=S.useRef(null),h=S.useRef(null),v=S.useRef(null);S.useEffect(()=>{v.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const N=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const T=C=>{if(C.key==="Escape"){C.preventDefault(),t();return}if(C.key!=="Tab"||!d.current)return;const k=Array.from(d.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),M=k[0],L=k[k.length-1];!M||!L||(C.shiftKey&&document.activeElement===M?(C.preventDefault(),L.focus()):!C.shiftKey&&document.activeElement===L&&(C.preventDefault(),M.focus()))};return window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T),document.body.style.overflow=N,v.current?.focus()}},[t]),S.useEffect(()=>{const N=async()=>{o(!0),f(null);try{const C=await Ze.getModelMetrics(e);a(C)}catch(C){f(C instanceof Error?C.message:"Failed to load model metrics")}finally{o(!1)}};N();const T=setInterval(N,5e3);return()=>clearInterval(T)},[e]);const p=N=>N?new Date(N).toLocaleTimeString():"-",b=N=>N<1e3?`${N.toFixed(0)}ms`:`${(N/1e3).toFixed(2)}s`,x=N=>N<1e3?N.toLocaleString():N<1e6?`${(N/1e3).toFixed(1)}K`:`${(N/1e6).toFixed(1)}M`,O=N=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(N),j=n?.price?((n.metrics?.total_tokens_in??0)*n.price.provider_input_price+(n.metrics?.total_tokens_out??0)*n.price.provider_output_price)/1e6:null,_=n?.health?.health_string==="healthy"||n?.model?.health_string==="healthy",E=(n?.recent_requests??[]).slice().reverse().map(N=>({time:p(N.start_time),latency:N.latency_ms}));return g.jsx("div",{ref:d,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-2 sm:p-4",onClick:t,role:"dialog","aria-modal":"true","aria-labelledby":"model-detail-title","aria-describedby":"model-detail-description",children:g.jsxs("div",{className:"max-h-[94vh] w-full max-w-4xl overflow-y-auto rounded-xl border border-slate-700 bg-slate-900",onClick:N=>N.stopPropagation(),children:[g.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{children:[g.jsx("h2",{id:"model-detail-title",className:"break-words text-xl font-semibold text-slate-100",children:e}),g.jsx("p",{id:"model-detail-description",className:"text-sm text-slate-300",children:"Health, usage, pricing, and recent requests"})]}),g.jsx("button",{ref:h,type:"button",onClick:t,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close model details",children:g.jsx(Q_,{"aria-hidden":"true",size:20})})]}),l&&!n?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full mx-auto"}),g.jsx("p",{className:"mt-4 text-slate-400",children:"Loading model metrics..."})]}):c?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx(Pa,{size:32,className:"mx-auto text-red-400 mb-2"}),g.jsx("p",{className:"text-red-400",children:c})]}):g.jsxs("div",{className:"p-4 space-y-6",children:[g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[_?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(Pa,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Health Status"})]}),g.jsx("p",{className:`text-lg font-semibold ${_?"text-green-400":"text-red-400"}`,children:_?"Healthy":"Unhealthy"}),n?.health?.consecutive_fails?g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n.health.consecutive_fails," consecutive failures"]}):null]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(V_,{size:20,className:"text-blue-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Total Requests"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:n?.metrics?.total_requests?.toLocaleString()??0}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.successful_requests??0," successful, ",n?.metrics?.failed_requests??0," failed"]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(T0,{size:20,className:"text-yellow-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Avg Latency"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:b(n?.metrics?.avg_latency_ms??0)}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.active_requests??0," active requests"]})]})]}),g.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[g.jsxs("div",{className:"rounded-lg bg-slate-700/50 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(ZD,{size:20,className:"text-purple-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Token usage"})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center sm:gap-4",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_in??0)}),g.jsx("p",{className:"text-xs text-blue-200",children:"Input tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_out??0)}),g.jsx("p",{className:"text-xs text-violet-200",children:"Output tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:(n?.metrics?.tokens_per_second??0).toFixed(1)}),g.jsx("p",{className:"text-xs text-slate-400",children:"Tokens/sec"})]})]})]}),g.jsxs("div",{className:"rounded-lg border border-emerald-800/50 bg-emerald-950/20 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(lD,{size:20,className:"text-emerald-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Provider payout / 1M tokens"}),n?.price?.tier&&g.jsx("span",{className:"ml-auto rounded-full border border-slate-600 px-2 py-0.5 text-[10px] uppercase tracking-wide text-slate-400",children:n.price.tier})]}),n?.price?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-blue-100",children:O(n.price.provider_input_price)}),g.jsx("p",{className:"text-xs text-blue-300",children:"Input"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-violet-100",children:O(n.price.provider_output_price)}),g.jsx("p",{className:"text-xs text-violet-300",children:"Output"})]})]}),j!==null&&g.jsxs("p",{className:"mt-3 border-t border-emerald-900/60 pt-2 text-xs text-slate-400",children:["Estimated payout for recorded tokens: ",g.jsx("span",{className:"font-medium text-emerald-300",children:O(j)})]})]}):g.jsx("p",{className:"text-sm text-slate-400",children:"Current catalog price is unavailable."})]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-200",children:"Transactions for this model"}),g.jsx("p",{className:"mb-3 mt-1 text-xs text-slate-400",children:"Latest 20 local requests, with input and output tokens shown separately."}),(n?.recent_requests??[]).length===0?g.jsx("p",{className:"text-slate-400 text-center py-4",children:"No transactions recorded for this model"}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"space-y-2 sm:hidden",children:(n?.recent_requests??[]).map(N=>g.jsxs("div",{className:"rounded-lg border border-slate-600 bg-slate-800/60 p-3",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-xs text-slate-300",title:N.request_id,children:N.request_id}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[p(N.start_time)," · ",b(N.latency_ms)]})]}),N.success?g.jsx(wl,{size:16,className:"shrink-0 text-green-400"}):g.jsx(Pa,{size:16,className:"shrink-0 text-red-400"})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[g.jsxs("div",{className:"rounded bg-blue-950/30 px-2 py-1.5 text-blue-200",children:["Input ",g.jsx("span",{className:"float-right font-mono",children:N.tokens_in.toLocaleString()})]}),g.jsxs("div",{className:"rounded bg-violet-950/30 px-2 py-1.5 text-violet-200",children:["Output ",g.jsx("span",{className:"float-right font-mono",children:N.tokens_out.toLocaleString()})]})]})]},N.request_id))}),g.jsx("div",{className:"hidden overflow-x-auto sm:block",children:g.jsxs("table",{className:"w-full text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"text-slate-400 border-b border-slate-600",children:[g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Transaction"}),g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Time"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Latency"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Input"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Output"}),g.jsx("th",{className:"text-center py-2 px-2 font-medium",children:"Status"})]})}),g.jsx("tbody",{children:(n?.recent_requests??[]).map(N=>g.jsxs("tr",{className:"border-b border-slate-600/50",children:[g.jsx("td",{className:"max-w-36 truncate px-2 py-2 font-mono text-xs text-slate-400",title:N.request_id,children:N.request_id}),g.jsx("td",{className:"py-2 px-2 text-slate-300 text-xs",children:p(N.start_time)}),g.jsx("td",{className:"py-2 px-2 text-right font-mono text-xs",children:g.jsx("span",{className:N.latency_ms>5e3?"text-red-400":N.latency_ms>2e3?"text-yellow-400":"text-green-400",children:b(N.latency_ms)})}),g.jsx("td",{className:"py-2 px-2 text-right text-blue-200 font-mono text-xs",children:N.tokens_in.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-right text-violet-200 font-mono text-xs",children:N.tokens_out.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-center",children:N.success?g.jsx(wl,{size:14,className:"inline text-green-400"}):g.jsx(Pa,{size:14,className:"inline text-red-400"})})]},N.request_id))})]})})]})]}),E.length>1&&g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-3",children:"Recent transaction latency"}),g.jsx("div",{className:"h-40",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:E,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,unit:"ms"}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"}}),g.jsx(Sl,{type:"monotone",dataKey:"latency",stroke:"#3b82f6",strokeWidth:2,dot:{fill:"#3b82f6",strokeWidth:0,r:3},name:"Latency"})]})})})]}),n?.health?.last_error&&g.jsxs("div",{className:"bg-red-900/20 border border-red-800/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(Tf,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Last Error"})]}),g.jsx("p",{className:"text-sm text-red-400 font-mono",children:n.health.last_error})]})]})]})})}function LG({open:e,onClose:t,onAuthenticated:n}){const[a,l]=S.useState(""),[o,c]=S.useState(""),[f,d]=S.useState(!1),h=S.useRef(null),v=S.useRef(null),p=S.useRef(null);if(S.useEffect(()=>{if(!e)return;c(""),p.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const x=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const O=j=>{if(j.key==="Escape"){j.preventDefault(),t();return}if(j.key!=="Tab"||!v.current)return;const _=Array.from(v.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),E=_[0],N=_[_.length-1];!E||!N||(j.shiftKey&&document.activeElement===E?(j.preventDefault(),N.focus()):!j.shiftKey&&document.activeElement===N&&(j.preventDefault(),E.focus()))};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O),document.body.style.overflow=x,p.current?.focus()}},[e,t]),!e)return null;const b=async x=>{if(x.preventDefault(),!!a.trim()){d(!0),c(""),Ze.setAccessToken(a);try{await Ze.getSettings(),l(""),n()}catch(O){Ze.clearAccessToken(),c(O instanceof Error?O.message:"The access token was rejected")}finally{d(!1)}}};return g.jsx("div",{ref:v,className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/80 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-labelledby":"unlock-title","aria-describedby":"unlock-description",onMouseDown:x=>{x.target===x.currentTarget&&t()},children:g.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-slate-700 bg-slate-900 shadow-2xl shadow-black/40",children:[g.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-slate-800 p-5",children:[g.jsxs("div",{className:"flex gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(X_,{"aria-hidden":"true",size:22})}),g.jsxs("div",{children:[g.jsx("h2",{id:"unlock-title",className:"text-lg font-semibold text-white",children:"Unlock operator controls"}),g.jsx("p",{id:"unlock-description",className:"mt-1 text-sm text-slate-300",children:"Monitoring stays read-only until this browser tab is unlocked."})]})]}),g.jsx("button",{type:"button",onClick:t,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close unlock dialog",children:g.jsx(Q_,{"aria-hidden":"true",size:20})})]}),g.jsxs("form",{onSubmit:b,className:"space-y-4 p-5",children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:"control-token",className:"mb-2 block text-sm font-medium text-slate-200",children:"Control token"}),g.jsx("input",{ref:h,id:"control-token",type:"password",autoComplete:"off",value:a,onChange:x=>l(x.target.value),className:"min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 font-mono text-sm text-white outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30",placeholder:"Paste dashboard.token","aria-describedby":"token-help"}),g.jsxs("p",{id:"token-help",className:"mt-2 text-xs leading-5 text-slate-300",children:["On the provider host, read ",g.jsx("code",{className:"rounded bg-slate-800 px-1.5 py-0.5 text-slate-300",children:"$CP_PATH/dashboard.token"}),". The token is kept only for this browser tab."]})]}),o&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/70 bg-red-950/40 px-3 py-2 text-sm text-red-300",children:o}),g.jsxs("div",{className:"flex justify-end gap-3",children:[g.jsx("button",{type:"button",onClick:t,className:"min-h-10 rounded-lg px-4 text-sm text-slate-300 hover:bg-slate-800",children:"Cancel"}),g.jsx("button",{type:"submit",disabled:f||!a.trim(),className:"min-h-10 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",children:f?"Checking…":"Unlock"})]})]})]})})}const UG=[{id:"limits",label:"Limits"},{id:"models",label:"Models"},{id:"alerts",label:"Alerts"},{id:"self-check",label:"Self-check"},{id:"logging",label:"Logging"}],Le="min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 text-sm text-slate-100 outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",Ue="mb-1.5 block text-sm font-medium text-slate-200";function $G({restartRequired:e}){return g.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium ${e?"border-amber-800/70 bg-amber-950/40 text-amber-300":"border-emerald-800/70 bg-emerald-950/40 text-emerald-300"}`,children:e?"Restart required":"Applies now"})}function Fu({id:e,title:t,description:n,icon:a,restartRequired:l,dirty:o,children:c}){return g.jsxs("section",{"aria-labelledby":`${e}-title`,className:"scroll-mt-14 overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 border-b border-slate-800 px-4 py-4 sm:px-5",children:[g.jsxs("div",{className:"flex min-w-0 gap-3",children:[g.jsx("div",{className:"mt-0.5 rounded-lg bg-slate-800 p-2 text-blue-400",children:a}),g.jsxs("div",{children:[g.jsx("h2",{id:`${e}-title`,className:"font-semibold text-white",children:t}),g.jsx("p",{className:"mt-1 max-w-2xl text-sm leading-5 text-slate-400",children:n})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o&&g.jsx("span",{className:"inline-flex items-center rounded-full border border-blue-800/70 bg-blue-950/40 px-2.5 py-1 text-xs font-medium text-blue-200",children:"Unsaved"}),g.jsx($G,{restartRequired:l})]})]}),g.jsx("div",{className:"p-4 sm:p-5",children:c})]})}function Zu({state:e,section:t}){return!e||e.key!==t?null:g.jsx("p",{role:e.type==="error"?"alert":"status",className:`rounded-lg border px-3 py-2 text-sm ${e.type==="error"?"border-red-800/70 bg-red-950/30 text-red-300":"border-emerald-800/70 bg-emerald-950/30 text-emerald-300"}`,children:e.message})}function Qu({checked:e,onChange:t,label:n,description:a}){return g.jsxs("label",{className:"flex min-h-11 cursor-pointer items-start justify-between gap-4 rounded-lg border border-slate-700 bg-slate-950/60 px-3 py-2.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"block text-sm font-medium text-slate-200",children:n}),a&&g.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-slate-400",children:a})]}),g.jsx("input",{type:"checkbox",checked:e,onChange:l=>t(l.target.checked),className:"mt-0.5 h-5 w-5 rounded border-slate-600 bg-slate-900 text-blue-600 focus:ring-2 focus:ring-blue-500"})]})}function Wu({saving:e,label:t="Save settings"}){return g.jsxs("button",{type:"submit",disabled:e,className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-wait disabled:opacity-60",children:[e?g.jsx(Pl,{"aria-hidden":"true",className:"animate-spin",size:16}):g.jsx(CD,{"aria-hidden":"true",size:16}),e?"Saving…":t]})}function qG({authenticated:e,onUnlock:t,onModelsSaved:n,onDirtyChange:a}){const[l,o]=S.useState(null),[c,f]=S.useState(!1),[d,h]=S.useState(""),[v,p]=S.useState(null),[b,x]=S.useState(null),[O,j]=S.useState([]),[_,E]=S.useState(()=>new Set),[N,T]=S.useState(()=>sessionStorage.getItem("computing-provider-restart-pending")==="true"),C=z=>{E(G=>{const ne=new Set(G);return ne.add(z),ne}),x(G=>G?.key===z?null:G)},k=S.useCallback(async()=>{if(e){f(!0),h("");try{const z=await Ze.getSettings();o({...z,models:z.models.map(G=>({...G}))}),j(z.models.map(G=>G.id)),E(new Set)}catch(z){h(z instanceof Error?z.message:"Unable to load settings")}finally{f(!1)}}},[e]);S.useEffect(()=>{e?k():(o(null),E(new Set))},[e,k]),S.useEffect(()=>{const z=_.size>0;a(z);const G=ne=>{z&&(ne.preventDefault(),ne.returnValue="")};return window.addEventListener("beforeunload",G),()=>{window.removeEventListener("beforeunload",G),a(!1)}},[_,a]);const M=async(z,G)=>{p(z),x(null);try{const ne=await G();return x({key:z,type:"success",message:ne.restart_required?"Saved. Restart computing-provider when convenient to apply this section.":"Saved and applied to the running provider."}),E(P=>{const F=new Set(P);return F.delete(z),F}),ne.restart_required&&(sessionStorage.setItem("computing-provider-restart-pending","true"),T(!0)),!0}catch(ne){return x({key:z,type:"error",message:ne instanceof Error?ne.message:"Save failed"}),!1}finally{p(null)}},L=S.useMemo(()=>{if(!l)return 0;const z=new Set(l.models.map(G=>G.id));return O.filter(G=>!z.has(G)).length},[O,l]);if(!e)return g.jsx("div",{className:"mx-auto max-w-2xl py-8 sm:py-16",children:g.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900 p-6 text-center sm:p-10",children:[g.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-blue-500/10 text-blue-400",children:g.jsx(C0,{"aria-hidden":"true",size:24})}),g.jsx("h2",{className:"text-xl font-semibold text-white",children:"Settings are locked"}),g.jsx("p",{className:"mx-auto mt-2 max-w-lg text-sm leading-6 text-slate-400",children:"Unlock this browser tab with the local control token before reading or changing provider configuration. Monitoring remains available without it."}),g.jsxs("button",{type:"button",onClick:t,className:"mt-5 inline-flex min-h-11 items-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white hover:bg-blue-500",children:[g.jsx(X_,{"aria-hidden":"true",size:17})," Unlock settings"]})]})});if(c&&!l)return g.jsxs("div",{className:"flex min-h-64 items-center justify-center text-slate-400",role:"status",children:[g.jsx(Pl,{"aria-hidden":"true",className:"mr-2 animate-spin",size:18})," Loading settings…"]});if(!l)return g.jsxs("div",{className:"rounded-xl border border-red-800/60 bg-red-950/20 p-5",children:[g.jsx("h2",{className:"font-semibold text-red-200",children:"Settings could not be loaded"}),g.jsx("p",{className:"mt-1 text-sm text-red-300",children:d}),g.jsx("button",{type:"button",onClick:k,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]});const W=z=>{C("alerts"),o(G=>G&&{...G,alerts:{...G.alerts,...z}})},re=z=>{C("self-check"),o(G=>G&&{...G,self_check:{...G.self_check,...z}})},H=z=>{C("logging"),o(G=>G&&{...G,log:{...G.log,...z}})},$=z=>{C("limits"),o(G=>G&&{...G,limits:{...G.limits,...z}})},K=z=>W({email:{...l.alerts.email,...z}}),ce=(z,G)=>{C("models"),o(ne=>{if(!ne)return ne;const P=ne.models.map((F,ie)=>ie===z?{...F,...G}:F);return{...ne,models:P}})},ue=async z=>{z.preventDefault();const G=l.alerts.email.to.flatMap(P=>P.split(/[\n,]/)).map(P=>P.trim()).filter(Boolean),ne={...l.alerts,email:{...l.alerts.email,to:G}};await M("alerts",()=>Ze.updateAlerts(ne))&&o(P=>P&&{...P,alerts:{...P.alerts,email:{...P.alerts.email,password:"",clear_password:!1,to:G,password_set:ne.email.clear_password?!1:ne.email.password_set||!!ne.email.password}}})},ve=async z=>{z.preventDefault(),!(L>0&&!window.confirm(`Save and remove ${L} model${L===1?"":"s"} from routing?`))&&await M("models",()=>Ze.updateModels(l.models))&&(n(),await k())},I=()=>{_.size>0&&!window.confirm("Reload settings from disk and discard unsaved changes?")||k()},ee=()=>{sessionStorage.removeItem("computing-provider-restart-pending"),T(!1)};return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Provider settings"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Validated edits to config.toml and models.json. Secrets are write-only."})]}),g.jsxs("button",{type:"button",onClick:I,disabled:c,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 hover:bg-slate-800 disabled:opacity-50",children:[g.jsx(D0,{"aria-hidden":"true",className:c?"animate-spin":"",size:16})," Reload from disk"]})]}),g.jsx("nav",{"aria-label":"Settings sections",className:"sticky top-0 z-20 -mx-1 overflow-x-auto rounded-xl border border-slate-800 bg-slate-950/95 p-1 shadow-lg shadow-slate-950/30 backdrop-blur",children:g.jsx("div",{className:"flex min-w-max gap-1",children:UG.map(z=>g.jsxs("button",{type:"button",onClick:()=>document.getElementById(`${z.id}-title`)?.scrollIntoView({behavior:"smooth",block:"start"}),className:"inline-flex min-h-10 items-center rounded-lg px-3 text-sm text-slate-300 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",children:[z.label,_.has(z.id)&&g.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-blue-400","aria-label":"Unsaved changes"})]},z.id))})}),_.size>0&&g.jsxs("p",{role:"status",className:"rounded-lg border border-blue-800/70 bg-blue-950/30 px-4 py-3 text-sm text-blue-100",children:["Unsaved changes in ",_.size," section",_.size===1?"":"s",". Save each marked section before leaving Settings."]}),N&&g.jsxs("div",{role:"status",className:"flex flex-col gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-4 py-3 text-sm text-amber-100 sm:flex-row sm:items-center sm:justify-between",children:[g.jsx("span",{children:"Saved configuration is waiting for a provider-daemon restart before it takes effect."}),g.jsx("button",{type:"button",onClick:ee,className:"min-h-10 self-start rounded-lg border border-amber-700/70 px-3 text-amber-100 hover:bg-amber-900/30 sm:self-auto",children:"Dismiss"})]}),d&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/60 bg-red-950/20 px-4 py-3 text-sm text-red-300",children:d}),g.jsx(Fu,{id:"limits",title:"Request limits",description:"Protect the provider from more work than it can serve. Both values are persisted and applied immediately.",icon:g.jsx(M0,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("limits"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),M("limits",()=>Ze.updateLimits(l.limits))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"requests-per-second",children:"Requests per second"}),g.jsx("input",{id:"requests-per-second",type:"number",min:"0.1",max:"100000",step:"0.1",required:!0,value:l.limits.requests_per_second,onChange:z=>$({requests_per_second:Number(z.target.value)}),className:Le}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Base global rate; GPU-aware adaptation may lower or raise the live rate."})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"max-concurrent",children:"Maximum concurrent requests"}),g.jsx("input",{id:"max-concurrent",type:"number",min:"1",max:"100000",required:!0,value:l.limits.max_concurrent,onChange:z=>$({max_concurrent:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"limits"}),g.jsx(Wu,{saving:v==="limits"})]})]})}),g.jsx(Fu,{id:"models",title:"Model endpoint map",description:"Add, repoint, or remove local inference endpoints. Saving hot-reloads models.json and updates the advertised model list.",icon:g.jsx(kD,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("models"),children:g.jsxs("form",{onSubmit:ve,className:"space-y-4",children:[l.models.length===0?g.jsx("div",{className:"rounded-lg border border-dashed border-slate-700 px-4 py-8 text-center text-sm text-slate-400",children:"No models configured. Add one to begin serving inference."}):g.jsx("div",{className:"space-y-3",children:l.models.map((z,G)=>g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-950/50 p-4",children:[g.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(180px,0.8fr)_minmax(240px,1.2fr)_auto]",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`model-id-${G}`,children:"Model ID"}),g.jsx("input",{id:`model-id-${G}`,required:!0,readOnly:!z.isNew,value:z.id,onChange:ne=>ce(G,{id:ne.target.value}),className:`${Le} font-mono ${z.isNew?"":"cursor-not-allowed bg-slate-900 text-slate-400"}`})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`model-endpoint-${G}`,children:"Endpoint"}),g.jsx("input",{id:`model-endpoint-${G}`,type:"url",required:!0,value:z.endpoint,onChange:ne=>ce(G,{endpoint:ne.target.value}),placeholder:"http://127.0.0.1:8000",className:`${Le} font-mono`})]}),g.jsxs("button",{type:"button",onClick:()=>{window.confirm(`Remove ${z.id||"this model"} from the configuration? The change takes effect when you save.`)&&(C("models"),o(ne=>ne&&{...ne,models:ne.models.filter((P,F)=>F!==G)}))},className:"mt-auto inline-flex min-h-11 items-center justify-center gap-2 rounded-lg border border-red-900/70 px-3 text-sm text-red-300 hover:bg-red-950/40","aria-label":`Remove ${z.id||"new model"}`,children:[g.jsx(HD,{"aria-hidden":"true",size:16})," ",g.jsx("span",{className:"lg:hidden",children:"Remove"})]})]}),g.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`model-category-${G}`,children:"Category"}),g.jsx("input",{id:`model-category-${G}`,required:!0,value:z.category,onChange:ne=>ce(G,{category:ne.target.value}),placeholder:"text-generation",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`local-model-${G}`,children:"Local model name"}),g.jsx("input",{id:`local-model-${G}`,value:z.local_model??"",onChange:ne=>ce(G,{local_model:ne.target.value}),placeholder:"Optional Ollama name",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`context-length-${G}`,children:"Context length"}),g.jsx("input",{id:`context-length-${G}`,type:"number",min:"0",value:z.context_length??0,onChange:ne=>ce(G,{context_length:Number(ne.target.value)}),className:Le})]})]}),g.jsxs("details",{className:"mt-4 rounded-lg border border-slate-800 bg-slate-950/60",children:[g.jsx("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium text-slate-300",children:"Advanced endpoint details"}),g.jsxs("div",{className:"grid gap-4 border-t border-slate-800 p-3 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`gpu-memory-${G}`,children:"GPU memory (MB)"}),g.jsx("input",{id:`gpu-memory-${G}`,type:"number",min:"0",value:z.gpu_memory,onChange:ne=>ce(G,{gpu_memory:Number(ne.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`container-${G}`,children:"Container"}),g.jsx("input",{id:`container-${G}`,value:z.container??"",onChange:ne=>ce(G,{container:ne.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`format-${G}`,children:"Format"}),g.jsx("input",{id:`format-${G}`,value:z.format??"",onChange:ne=>ce(G,{format:ne.target.value}),placeholder:"awq, gguf…",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`quantization-${G}`,children:"Quantization"}),g.jsx("input",{id:`quantization-${G}`,value:z.quantization??"",onChange:ne=>ce(G,{quantization:ne.target.value}),className:Le})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("label",{className:Ue,htmlFor:`endpoint-key-${G}`,children:"Endpoint API key"}),g.jsx("input",{id:`endpoint-key-${G}`,type:"password",autoComplete:"new-password",value:z.api_key??"",onChange:ne=>ce(G,{api_key:ne.target.value,clear_api_key:!1}),placeholder:z.api_key_set?"Configured •••• — leave blank to keep":"Optional write-only replacement",className:Le}),z.api_key_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!z.clear_api_key,onChange:ne=>ce(G,{clear_api_key:ne.target.checked,api_key:""})})," Clear stored endpoint key"]})]})]})]})]},`${z.id}-${G}`))}),g.jsxs("button",{type:"button",onClick:()=>{C("models"),o(z=>z&&{...z,models:[...z.models,{id:"",endpoint:"",gpu_memory:0,category:"text-generation",api_key_set:!1,context_length:0,isNew:!0}]})},className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-dashed border-slate-600 px-3 text-sm text-slate-200 hover:border-blue-500 hover:text-white",children:[g.jsx(jD,{"aria-hidden":"true",size:16})," Add model"]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"models"}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[L>0&&g.jsxs("span",{className:"text-xs text-amber-300",children:[L," removal pending"]}),g.jsx(Wu,{saving:v==="models",label:"Save and hot-reload"})]})]})]})}),g.jsx(Fu,{id:"alerts",title:"Alert delivery",description:"Configure webhook and SMTP delivery. Stored passwords are never returned to the browser.",icon:g.jsx(Y4,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("alerts"),children:g.jsxs("form",{onSubmit:ue,className:"space-y-5",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"webhook-url",children:"Webhook URL"}),g.jsx("input",{id:"webhook-url",type:"url",value:l.alerts.webhook_url,onChange:z=>W({webhook_url:z.target.value}),placeholder:"https://alerts.example.com/provider",className:Le})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"cooldown",children:"Repeat cooldown (minutes)"}),g.jsx("input",{id:"cooldown",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.cooldown_minutes,onChange:z=>W({cooldown_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"disconnect-delay",children:"Disconnect alert after (minutes)"}),g.jsx("input",{id:"disconnect-delay",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.disconnect_after_min,onChange:z=>W({disconnect_after_min:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"failure-threshold",children:"Failure threshold (%)"}),g.jsx("input",{id:"failure-threshold",type:"number",min:"1",max:"100",step:"1",required:!0,value:Math.round(l.alerts.error_rate_threshold*100),onChange:z=>W({error_rate_threshold:Number(z.target.value)/100}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"minimum-requests",children:"Minimum requests"}),g.jsx("input",{id:"minimum-requests",type:"number",min:"1",required:!0,value:l.alerts.error_rate_min_requests,onChange:z=>W({error_rate_min_requests:Number(z.target.value)}),className:Le})]})]}),g.jsxs("fieldset",{className:"rounded-xl border border-slate-700 p-4",children:[g.jsx("legend",{className:"px-2 text-sm font-semibold text-slate-200",children:"Email (SMTP)"}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[g.jsxs("div",{className:"sm:col-span-2",children:[g.jsx("label",{className:Ue,htmlFor:"smtp-host",children:"SMTP host"}),g.jsx("input",{id:"smtp-host",value:l.alerts.email.host,onChange:z=>K({host:z.target.value}),placeholder:"smtp.example.com",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"smtp-port",children:"Port"}),g.jsx("input",{id:"smtp-port",type:"number",min:"1",max:"65535",value:l.alerts.email.port,onChange:z=>K({port:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"smtp-username",children:"Username"}),g.jsx("input",{id:"smtp-username",value:l.alerts.email.username,onChange:z=>K({username:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"smtp-from",children:"From address"}),g.jsx("input",{id:"smtp-from",type:"email",value:l.alerts.email.from,onChange:z=>K({from:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"smtp-recipients",children:"Recipients"}),g.jsx("textarea",{id:"smtp-recipients",rows:2,value:l.alerts.email.to.join(` + A`,",",",0,0,",",",",","Z"])),L.x,L.y,o,o,+(v<0),M.x,M.y,a,a,+(re>180),+(v>0),T.x,T.y,o,o,+(v<0),P.x,P.y)}else E+=ct(v2||(v2=di(["L",",","Z"])),t,n);return E},V6={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},XE=e=>{var t=At(e,V6),{cx:n,cy:a,innerRadius:l,outerRadius:o,cornerRadius:c,forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v,className:p}=t;if(o0&&Math.abs(h-v)<360?j=G6({cx:n,cy:a,innerRadius:l,outerRadius:o,cornerRadius:Math.min(O,x/2),forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v}):j=VE({cx:n,cy:a,innerRadius:l,outerRadius:o,startAngle:h,endAngle:v}),S.createElement("path",l0({},tn(t),{className:b,d:j}))};function X6(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(AA(t)){if(e==="centric"){var{cx:a,cy:l,innerRadius:o,outerRadius:c,angle:f}=t,d=xt(a,l,o,f),h=xt(a,l,c,f);return[{x:d.x,y:d.y},{x:h.x,y:h.y}]}return GE(t)}}var Wv={},Jv={},ep={},p2;function F6(){return p2||(p2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LA();function n(a){return t.isSymbol(a)?NaN:Number(a)}e.toNumber=n})(ep)),ep}var y2;function Z6(){return y2||(y2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F6();function n(a){return a?(a=t.toNumber(a),a===1/0||a===-1/0?(a<0?-1:1)*Number.MAX_VALUE:a===a?a:0):a===0?a:0}e.toFinite=n})(Jv)),Jv}var g2;function Q6(){return g2||(g2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$A(),n=Z6();function a(l,o,c){c&&typeof c!="number"&&t.isIterateeCall(l,o,c)&&(o=c=void 0),l=n.toFinite(l),o===void 0?(o=l,l=0):o=n.toFinite(o),c=c===void 0?lt?1:e>=t?0:NaN}function e8(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function cy(e){let t,n,a;e.length!==2?(t=Ra,n=(f,d)=>Ra(e(f),d),a=(f,d)=>e(f)-d):(t=e===Ra||e===e8?e:t8,n=e,a=e);function l(f,d,h=0,v=f.length){if(h>>1;n(f[p],d)<0?h=p+1:v=p}while(h>>1;n(f[p],d)<=0?h=p+1:v=p}while(hh&&a(f[p-1],d)>-a(f[p],d)?p-1:p}return{left:l,center:c,right:o}}function t8(){return 0}function ZE(e){return e===null?NaN:+e}function*n8(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const r8=cy(Ra),Co=r8.right;cy(ZE).center;class x2 extends Map{constructor(t,n=l8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[a,l]of t)this.set(a,l)}get(t){return super.get(S2(this,t))}has(t){return super.has(S2(this,t))}set(t,n){return super.set(a8(this,t),n)}delete(t){return super.delete(i8(this,t))}}function S2({_intern:e,_key:t},n){const a=t(n);return e.has(a)?e.get(a):n}function a8({_intern:e,_key:t},n){const a=t(n);return e.has(a)?e.get(a):(e.set(a,n),n)}function i8({_intern:e,_key:t},n){const a=t(n);return e.has(a)&&(n=e.get(a),e.delete(a)),n}function l8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function u8(e=Ra){if(e===Ra)return QE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const a=e(t,n);return a||a===0?a:(e(n,n)===0)-(e(t,t)===0)}}function QE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const o8=Math.sqrt(50),s8=Math.sqrt(10),c8=Math.sqrt(2);function of(e,t,n){const a=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(a)),o=a/Math.pow(10,l),c=o>=o8?10:o>=s8?5:o>=c8?2:1;let f,d,h;return l<0?(h=Math.pow(10,-l)/c,f=Math.round(e*h),d=Math.round(t*h),f/ht&&--d,h=-h):(h=Math.pow(10,l)*c,f=Math.round(e/h),d=Math.round(t/h),f*ht&&--d),d0))return[];if(e===t)return[e];const a=t=l))return[];const f=o-l+1,d=new Array(f);if(a)if(c<0)for(let h=0;h=a)&&(n=a);return n}function j2(e,t){let n;for(const a of e)a!=null&&(n>a||n===void 0&&a>=a)&&(n=a);return n}function WE(e,t,n=0,a=1/0,l){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),a=Math.floor(Math.min(e.length-1,a)),!(n<=t&&t<=a))return e;for(l=l===void 0?QE:u8(l);a>n;){if(a-n>600){const d=a-n+1,h=t-n+1,v=Math.log(d),p=.5*Math.exp(2*v/3),b=.5*Math.sqrt(v*p*(d-p)/d)*(h-d/2<0?-1:1),x=Math.max(n,Math.floor(t-h*p/d+b)),O=Math.min(a,Math.floor(t+(d-h)*p/d+b));WE(e,t,x,O,l)}const o=e[t];let c=n,f=a;for(Hu(e,n,t),l(e[a],o)>0&&Hu(e,n,a);c0;)--f}l(e[n],o)===0?Hu(e,n,f):(++f,Hu(e,f,a)),f<=t&&(n=f+1),t<=f&&(a=f-1)}return e}function Hu(e,t,n){const a=e[t];e[t]=e[n],e[n]=a}function f8(e,t,n){if(e=Float64Array.from(n8(e)),!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return j2(e);if(t>=1)return w2(e);var a,l=(a-1)*t,o=Math.floor(l),c=w2(WE(e,o).subarray(0,o+1)),f=j2(e.subarray(o+1));return c+(f-c)*(l-o)}}function d8(e,t,n=ZE){if(!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return+n(e[0],0,e);if(t>=1)return+n(e[a-1],a-1,e);var a,l=(a-1)*t,o=Math.floor(l),c=+n(e[o],o,e),f=+n(e[o+1],o+1,e);return c+(f-c)*(l-o)}}function h8(e,t,n){e=+e,t=+t,n=(l=arguments.length)<2?(t=e,e=0,1):l<3?1:+n;for(var a=-1,l=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(l);++a>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bc(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=p8.exec(e))?new fn(t[1],t[2],t[3],1):(t=y8.exec(e))?new fn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=g8.exec(e))?bc(t[1],t[2],t[3],t[4]):(t=b8.exec(e))?bc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=x8.exec(e))?M2(t[1],t[2]/100,t[3]/100,1):(t=S8.exec(e))?M2(t[1],t[2]/100,t[3]/100,t[4]):O2.hasOwnProperty(e)?E2(O2[e]):e==="transparent"?new fn(NaN,NaN,NaN,0):null}function E2(e){return new fn(e>>16&255,e>>8&255,e&255,1)}function bc(e,t,n,a){return a<=0&&(e=t=n=NaN),new fn(e,t,n,a)}function O8(e){return e instanceof Do||(e=go(e)),e?(e=e.rgb(),new fn(e.r,e.g,e.b,e.opacity)):new fn}function f0(e,t,n,a){return arguments.length===1?O8(e):new fn(e,t,n,a??1)}function fn(e,t,n,a){this.r=+e,this.g=+t,this.b=+n,this.opacity=+a}hy(fn,f0,eN(Do,{brighter(e){return e=e==null?sf:Math.pow(sf,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?po:Math.pow(po,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fn(yi(this.r),yi(this.g),yi(this.b),cf(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:N2,formatHex:N2,formatHex8:_8,formatRgb:T2,toString:T2}));function N2(){return`#${hi(this.r)}${hi(this.g)}${hi(this.b)}`}function _8(){return`#${hi(this.r)}${hi(this.g)}${hi(this.b)}${hi((isNaN(this.opacity)?1:this.opacity)*255)}`}function T2(){const e=cf(this.opacity);return`${e===1?"rgb(":"rgba("}${yi(this.r)}, ${yi(this.g)}, ${yi(this.b)}${e===1?")":`, ${e})`}`}function cf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function hi(e){return e=yi(e),(e<16?"0":"")+e.toString(16)}function M2(e,t,n,a){return a<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tr(e,t,n,a)}function tN(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof Do||(e=go(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,a=e.b/255,l=Math.min(t,n,a),o=Math.max(t,n,a),c=NaN,f=o-l,d=(o+l)/2;return f?(t===o?c=(n-a)/f+(n0&&d<1?0:c,new tr(c,f,d,e.opacity)}function A8(e,t,n,a){return arguments.length===1?tN(e):new tr(e,t,n,a??1)}function tr(e,t,n,a){this.h=+e,this.s=+t,this.l=+n,this.opacity=+a}hy(tr,A8,eN(Do,{brighter(e){return e=e==null?sf:Math.pow(sf,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?po:Math.pow(po,e),new tr(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,a=n+(n<.5?n:1-n)*t,l=2*n-a;return new fn(np(e>=240?e-240:e+120,l,a),np(e,l,a),np(e<120?e+240:e-120,l,a),this.opacity)},clamp(){return new tr(C2(this.h),xc(this.s),xc(this.l),cf(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=cf(this.opacity);return`${e===1?"hsl(":"hsla("}${C2(this.h)}, ${xc(this.s)*100}%, ${xc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function C2(e){return e=(e||0)%360,e<0?e+360:e}function xc(e){return Math.max(0,Math.min(1,e||0))}function np(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 my=e=>()=>e;function E8(e,t){return function(n){return e+n*t}}function N8(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(a){return Math.pow(e+a*t,n)}}function T8(e){return(e=+e)==1?nN:function(t,n){return n-t?N8(t,n,e):my(isNaN(t)?n:t)}}function nN(e,t){var n=t-e;return n?E8(e,n):my(isNaN(e)?t:e)}const D2=(function e(t){var n=T8(t);function a(l,o){var c=n((l=f0(l)).r,(o=f0(o)).r),f=n(l.g,o.g),d=n(l.b,o.b),h=nN(l.opacity,o.opacity);return function(v){return l.r=c(v),l.g=f(v),l.b=d(v),l.opacity=h(v),l+""}}return a.gamma=e,a})(1);function M8(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,a=t.slice(),l;return function(o){for(l=0;ln&&(o=t.slice(n,o),f[c]?f[c]+=o:f[++c]=o),(a=a[0])===(l=l[0])?f[c]?f[c]+=l:f[++c]=l:(f[++c]=null,d.push({i:c,x:ff(a,l)})),n=rp.lastIndex;return nt&&(n=e,e=t,t=n),function(a){return Math.max(e,Math.min(t,a))}}function B8(e,t,n){var a=e[0],l=e[1],o=t[0],c=t[1];return l2?I8:B8,d=h=null,p}function p(b){return b==null||isNaN(b=+b)?o:(d||(d=f(e.map(a),t,n)))(a(c(b)))}return p.invert=function(b){return c(l((h||(h=f(t,e.map(a),ff)))(b)))},p.domain=function(b){return arguments.length?(e=Array.from(b,df),v()):e.slice()},p.range=function(b){return arguments.length?(t=Array.from(b),v()):t.slice()},p.rangeRound=function(b){return t=Array.from(b),n=vy,v()},p.clamp=function(b){return arguments.length?(c=b?!0:en,v()):c!==en},p.interpolate=function(b){return arguments.length?(n=b,v()):n},p.unknown=function(b){return arguments.length?(o=b,p):o},function(b,x){return a=b,l=x,v()}}function py(){return nd()(en,en)}function H8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function hf(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),a=e.slice(0,n);return[a.length>1?a[0]+a.slice(2):a,+e.slice(n+1)]}function Tl(e){return e=hf(Math.abs(e)),e?e[1]:NaN}function K8(e,t){return function(n,a){for(var l=n.length,o=[],c=0,f=e[0],d=0;l>0&&f>0&&(d+f+1>a&&(f=Math.max(1,a-d)),o.push(n.substring(l-=f,l+f)),!((d+=f+1)>a));)f=e[c=(c+1)%e.length];return o.reverse().join(t)}}function Y8(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var G8=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bo(e){if(!(t=G8.exec(e)))throw new Error("invalid format: "+e);var t;return new yy({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]})}bo.prototype=yy.prototype;function yy(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+""}yy.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 V8(e){e:for(var t=e.length,n=1,a=-1,l;n0&&(a=0);break}return a>0?e.slice(0,a)+e.slice(l+1):e}var mf;function X8(e,t){var n=hf(e,t);if(!n)return mf=void 0,e.toPrecision(t);var a=n[0],l=n[1],o=l-(mf=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,c=a.length;return o===c?a:o>c?a+new Array(o-c+1).join("0"):o>0?a.slice(0,o)+"."+a.slice(o):"0."+new Array(1-o).join("0")+hf(e,Math.max(0,t+o-1))[0]}function P2(e,t){var n=hf(e,t);if(!n)return e+"";var a=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+a:a.length>l+1?a.slice(0,l+1)+"."+a.slice(l+1):a+new Array(l-a.length+2).join("0")}const z2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:H8,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)=>P2(e*100,t),r:P2,s:X8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function R2(e){return e}var L2=Array.prototype.map,$2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function F8(e){var t=e.grouping===void 0||e.thousands===void 0?R2:K8(L2.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",a=e.currency===void 0?"":e.currency[1]+"",l=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?R2:Y8(L2.call(e.numerals,String)),c=e.percent===void 0?"%":e.percent+"",f=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function h(p,b){p=bo(p);var x=p.fill,O=p.align,j=p.sign,_=p.symbol,N=p.zero,E=p.width,T=p.comma,P=p.precision,C=p.trim,M=p.type;M==="n"?(T=!0,M="g"):z2[M]||(P===void 0&&(P=12),C=!0,M="g"),(N||x==="0"&&O==="=")&&(N=!0,x="0",O="=");var L=(b&&b.prefix!==void 0?b.prefix:"")+(_==="$"?n:_==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():""),Z=(_==="$"?a:/[%p]/.test(M)?c:"")+(b&&b.suffix!==void 0?b.suffix:""),re=z2[M],B=/[defgprs%]/.test(M);P=P===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function U(K){var ce=L,ue=Z,ve,H,ee;if(M==="c")ue=re(K)+ue,K="";else{K=+K;var z=K<0||1/K<0;if(K=isNaN(K)?d:re(Math.abs(K),P),C&&(K=V8(K)),z&&+K==0&&j!=="+"&&(z=!1),ce=(z?j==="("?j:f:j==="-"||j==="("?"":j)+ce,ue=(M==="s"&&!isNaN(K)&&mf!==void 0?$2[8+mf/3]:"")+ue+(z&&j==="("?")":""),B){for(ve=-1,H=K.length;++veee||ee>57){ue=(ee===46?l+K.slice(ve+1):K.slice(ve))+ue,K=K.slice(0,ve);break}}}T&&!N&&(K=t(K,1/0));var G=ce.length+K.length+ue.length,ne=G>1)+ce+K+ue+ne.slice(G);break;default:K=ne+ce+K+ue;break}return o(K)}return U.toString=function(){return p+""},U}function v(p,b){var x=Math.max(-8,Math.min(8,Math.floor(Tl(b)/3)))*3,O=Math.pow(10,-x),j=h((p=bo(p),p.type="f",p),{suffix:$2[8+x/3]});return function(_){return j(O*_)}}return{format:h,formatPrefix:v}}var Sc,gy,rN;Z8({thousands:",",grouping:[3],currency:["$",""]});function Z8(e){return Sc=F8(e),gy=Sc.format,rN=Sc.formatPrefix,Sc}function Q8(e){return Math.max(0,-Tl(Math.abs(e)))}function W8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Tl(t)/3)))*3-Tl(Math.abs(e)))}function J8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Tl(t)-Tl(e))+1}function aN(e,t,n,a){var l=s0(e,t,n),o;switch(a=bo(a??",f"),a.type){case"s":{var c=Math.max(Math.abs(e),Math.abs(t));return a.precision==null&&!isNaN(o=W8(l,c))&&(a.precision=o),rN(a,c)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(o=J8(l,Math.max(Math.abs(e),Math.abs(t))))&&(a.precision=o-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(o=Q8(l))&&(a.precision=o-(a.type==="%")*2);break}}return gy(a)}function qa(e){var t=e.domain;return e.ticks=function(n){var a=t();return u0(a[0],a[a.length-1],n??10)},e.tickFormat=function(n,a){var l=t();return aN(l[0],l[l.length-1],n??10,a)},e.nice=function(n){n==null&&(n=10);var a=t(),l=0,o=a.length-1,c=a[l],f=a[o],d,h,v=10;for(f0;){if(h=o0(c,f,n),h===d)return a[l]=c,a[o]=f,t(a);if(h>0)c=Math.floor(c/h)*h,f=Math.ceil(f/h)*h;else if(h<0)c=Math.ceil(c*h)/h,f=Math.floor(f*h)/h;else break;d=h}return e},e}function iN(){var e=py();return e.copy=function(){return ko(e,iN())},Fn.apply(e,arguments),qa(e)}function lN(e){var t;function n(a){return a==null||isNaN(a=+a)?t:a}return n.invert=n,n.domain=n.range=function(a){return arguments.length?(e=Array.from(a,df),n):e.slice()},n.unknown=function(a){return arguments.length?(t=a,n):t},n.copy=function(){return lN(e).unknown(t)},e=arguments.length?Array.from(e,df):[0,1],qa(n)}function uN(e,t){e=e.slice();var n=0,a=e.length-1,l=e[n],o=e[a],c;return oMath.pow(e,t)}function aL(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 B2(e){return(t,n)=>-e(-t,n)}function by(e){const t=e(U2,q2),n=t.domain;let a=10,l,o;function c(){return l=aL(a),o=rL(a),n()[0]<0?(l=B2(l),o=B2(o),e(eL,tL)):e(U2,q2),t}return t.base=function(f){return arguments.length?(a=+f,c()):a},t.domain=function(f){return arguments.length?(n(f),c()):n()},t.ticks=f=>{const d=n();let h=d[0],v=d[d.length-1];const p=v0){for(;b<=x;++b)for(O=1;Ov)break;N.push(j)}}else for(;b<=x;++b)for(O=a-1;O>=1;--O)if(j=b>0?O/o(-b):O*o(b),!(jv)break;N.push(j)}N.length*2<_&&(N=u0(h,v,_))}else N=u0(b,x,Math.min(x-b,_)).map(o);return p?N.reverse():N},t.tickFormat=(f,d)=>{if(f==null&&(f=10),d==null&&(d=a===10?"s":","),typeof d!="function"&&(!(a%1)&&(d=bo(d)).precision==null&&(d.trim=!0),d=gy(d)),f===1/0)return d;const h=Math.max(1,a*f/t.ticks().length);return v=>{let p=v/o(Math.round(l(v)));return p*an(uN(n(),{floor:f=>o(Math.floor(l(f))),ceil:f=>o(Math.ceil(l(f)))})),t}function oN(){const e=by(nd()).domain([1,10]);return e.copy=()=>ko(e,oN()).base(e.base()),Fn.apply(e,arguments),e}function I2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function H2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xy(e){var t=1,n=e(I2(t),H2(t));return n.constant=function(a){return arguments.length?e(I2(t=+a),H2(t)):t},qa(n)}function sN(){var e=xy(nd());return e.copy=function(){return ko(e,sN()).constant(e.constant())},Fn.apply(e,arguments)}function K2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iL(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function lL(e){return e<0?-e*e:e*e}function Sy(e){var t=e(en,en),n=1;function a(){return n===1?e(en,en):n===.5?e(iL,lL):e(K2(n),K2(1/n))}return t.exponent=function(l){return arguments.length?(n=+l,a()):n},qa(t)}function wy(){var e=Sy(nd());return e.copy=function(){return ko(e,wy()).exponent(e.exponent())},Fn.apply(e,arguments),e}function uL(){return wy.apply(null,arguments).exponent(.5)}function Y2(e){return Math.sign(e)*e*e}function oL(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function cN(){var e=py(),t=[0,1],n=!1,a;function l(o){var c=oL(e(o));return isNaN(c)?a:n?Math.round(c):c}return l.invert=function(o){return e.invert(Y2(o))},l.domain=function(o){return arguments.length?(e.domain(o),l):e.domain()},l.range=function(o){return arguments.length?(e.range((t=Array.from(o,df)).map(Y2)),l):t.slice()},l.rangeRound=function(o){return l.range(o).round(!0)},l.round=function(o){return arguments.length?(n=!!o,l):n},l.clamp=function(o){return arguments.length?(e.clamp(o),l):e.clamp()},l.unknown=function(o){return arguments.length?(a=o,l):a},l.copy=function(){return cN(e.domain(),t).round(n).clamp(e.clamp()).unknown(a)},Fn.apply(l,arguments),qa(l)}function fN(){var e=[],t=[],n=[],a;function l(){var c=0,f=Math.max(1,t.length);for(n=new Array(f-1);++c0?n[f-1]:e[0],f=n?[a[n-1],t]:[a[h-1],a[h]]},c.unknown=function(d){return arguments.length&&(o=d),c},c.thresholds=function(){return a.slice()},c.copy=function(){return dN().domain([e,t]).range(l).unknown(o)},Fn.apply(qa(c),arguments)}function hN(){var e=[.5],t=[0,1],n,a=1;function l(o){return o!=null&&o<=o?t[Co(e,o,0,a)]:n}return l.domain=function(o){return arguments.length?(e=Array.from(o),a=Math.min(e.length,t.length-1),l):e.slice()},l.range=function(o){return arguments.length?(t=Array.from(o),a=Math.min(e.length,t.length-1),l):t.slice()},l.invertExtent=function(o){var c=t.indexOf(o);return[e[c-1],e[c]]},l.unknown=function(o){return arguments.length?(n=o,l):n},l.copy=function(){return hN().domain(e).range(t).unknown(n)},Fn.apply(l,arguments)}const ap=new Date,ip=new Date;function Et(e,t,n,a){function l(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return l.floor=o=>(e(o=new Date(+o)),o),l.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),l.round=o=>{const c=l(o),f=l.ceil(o);return o-c(t(o=new Date(+o),c==null?1:Math.floor(c)),o),l.range=(o,c,f)=>{const d=[];if(o=l.ceil(o),f=f==null?1:Math.floor(f),!(o0))return d;let h;do d.push(h=new Date(+o)),t(o,f),e(o);while(hEt(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,f)=>{if(c>=c)if(f<0)for(;++f<=0;)for(;t(c,-1),!o(c););else for(;--f>=0;)for(;t(c,1),!o(c););}),n&&(l.count=(o,c)=>(ap.setTime(+o),ip.setTime(+c),e(ap),e(ip),Math.floor(n(ap,ip))),l.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?l.filter(a?c=>a(c)%o===0:c=>l.count(0,c)%o===0):l)),l}const vf=Et(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);vf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Et(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):vf);vf.range;const Br=1e3,Yn=Br*60,Ir=Yn*60,Vr=Ir*24,jy=Vr*7,G2=Vr*30,lp=Vr*365,mi=Et(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getUTCSeconds());mi.range;const Oy=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Br)},(e,t)=>{e.setTime(+e+t*Yn)},(e,t)=>(t-e)/Yn,e=>e.getMinutes());Oy.range;const _y=Et(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Yn)},(e,t)=>(t-e)/Yn,e=>e.getUTCMinutes());_y.range;const Ay=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Br-e.getMinutes()*Yn)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getHours());Ay.range;const Ey=Et(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getUTCHours());Ey.range;const Po=Et(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Yn)/Vr,e=>e.getDate()-1);Po.range;const rd=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>e.getUTCDate()-1);rd.range;const mN=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>Math.floor(e/Vr));mN.range;function Ei(e){return Et(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())*Yn)/jy)}const ad=Ei(0),pf=Ei(1),sL=Ei(2),cL=Ei(3),Ml=Ei(4),fL=Ei(5),dL=Ei(6);ad.range;pf.range;sL.range;cL.range;Ml.range;fL.range;dL.range;function Ni(e){return Et(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)/jy)}const id=Ni(0),yf=Ni(1),hL=Ni(2),mL=Ni(3),Cl=Ni(4),vL=Ni(5),pL=Ni(6);id.range;yf.range;hL.range;mL.range;Cl.range;vL.range;pL.range;const Ny=Et(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());Ny.range;const Ty=Et(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());Ty.range;const Xr=Et(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());Xr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(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)});Xr.range;const Fr=Et(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());Fr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(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)});Fr.range;function vN(e,t,n,a,l,o){const c=[[mi,1,Br],[mi,5,5*Br],[mi,15,15*Br],[mi,30,30*Br],[o,1,Yn],[o,5,5*Yn],[o,15,15*Yn],[o,30,30*Yn],[l,1,Ir],[l,3,3*Ir],[l,6,6*Ir],[l,12,12*Ir],[a,1,Vr],[a,2,2*Vr],[n,1,jy],[t,1,G2],[t,3,3*G2],[e,1,lp]];function f(h,v,p){const b=v_).right(c,b);if(x===c.length)return e.every(s0(h/lp,v/lp,p));if(x===0)return vf.every(Math.max(s0(h,v,p),1));const[O,j]=c[b/c[x-1][2]53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Ce=op(Ku(ae.y,0,1)),$t=Ce.getUTCDay(),Ce=$t>4||$t===0?yf.ceil(Ce):yf(Ce),Ce=rd.offset(Ce,(ae.V-1)*7),ae.y=Ce.getUTCFullYear(),ae.m=Ce.getUTCMonth(),ae.d=Ce.getUTCDate()+(ae.w+6)%7):(Ce=up(Ku(ae.y,0,1)),$t=Ce.getDay(),Ce=$t>4||$t===0?pf.ceil(Ce):pf(Ce),Ce=Po.offset(Ce,(ae.V-1)*7),ae.y=Ce.getFullYear(),ae.m=Ce.getMonth(),ae.d=Ce.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),$t="Z"in ae?op(Ku(ae.y,0,1)).getUTCDay():up(Ku(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-($t+5)%7:ae.w+ae.U*7-($t+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,op(ae)):up(ae)}}function Z(W,Se,_e,ae){for(var Lt=0,Ce=Se.length,$t=_e.length,Ut,br;Lt=$t)return-1;if(Ut=Se.charCodeAt(Lt++),Ut===37){if(Ut=Se.charAt(Lt++),br=C[Ut in V2?Se.charAt(Lt++):Ut],!br||(ae=br(W,_e,ae))<0)return-1}else if(Ut!=_e.charCodeAt(ae++))return-1}return ae}function re(W,Se,_e){var ae=h.exec(Se.slice(_e));return ae?(W.p=v.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function B(W,Se,_e){var ae=x.exec(Se.slice(_e));return ae?(W.w=O.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function U(W,Se,_e){var ae=p.exec(Se.slice(_e));return ae?(W.w=b.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function K(W,Se,_e){var ae=N.exec(Se.slice(_e));return ae?(W.m=E.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function ce(W,Se,_e){var ae=j.exec(Se.slice(_e));return ae?(W.m=_.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function ue(W,Se,_e){return Z(W,t,Se,_e)}function ve(W,Se,_e){return Z(W,n,Se,_e)}function H(W,Se,_e){return Z(W,a,Se,_e)}function ee(W){return c[W.getDay()]}function z(W){return o[W.getDay()]}function G(W){return d[W.getMonth()]}function ne(W){return f[W.getMonth()]}function k(W){return l[+(W.getHours()>=12)]}function F(W){return 1+~~(W.getMonth()/3)}function ie(W){return c[W.getUTCDay()]}function le(W){return o[W.getUTCDay()]}function ye(W){return d[W.getUTCMonth()]}function be(W){return f[W.getUTCMonth()]}function he(W){return l[+(W.getUTCHours()>=12)]}function ut(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var Se=M(W+="",T);return Se.toString=function(){return W},Se},parse:function(W){var Se=L(W+="",!1);return Se.toString=function(){return W},Se},utcFormat:function(W){var Se=M(W+="",P);return Se.toString=function(){return W},Se},utcParse:function(W){var Se=L(W+="",!0);return Se.toString=function(){return W},Se}}}var V2={"-":"",_:" ",0:"0"},Rt=/^\s*\d+/,wL=/^%/,jL=/[\\^$*+?|[\]().{}]/g;function Pe(e,t,n){var a=e<0?"-":"",l=(a?-e:e)+"",o=l.length;return a+(o[t.toLowerCase(),n]))}function _L(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.w=+a[0],n+a[0].length):-1}function AL(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.u=+a[0],n+a[0].length):-1}function EL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.U=+a[0],n+a[0].length):-1}function NL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.V=+a[0],n+a[0].length):-1}function TL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.W=+a[0],n+a[0].length):-1}function X2(e,t,n){var a=Rt.exec(t.slice(n,n+4));return a?(e.y=+a[0],n+a[0].length):-1}function F2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.y=+a[0]+(+a[0]>68?1900:2e3),n+a[0].length):-1}function ML(e,t,n){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return a?(e.Z=a[1]?0:-(a[2]+(a[3]||"00")),n+a[0].length):-1}function CL(e,t,n){var a=Rt.exec(t.slice(n,n+1));return a?(e.q=a[0]*3-3,n+a[0].length):-1}function DL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.m=a[0]-1,n+a[0].length):-1}function Z2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.d=+a[0],n+a[0].length):-1}function kL(e,t,n){var a=Rt.exec(t.slice(n,n+3));return a?(e.m=0,e.d=+a[0],n+a[0].length):-1}function Q2(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.H=+a[0],n+a[0].length):-1}function PL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.M=+a[0],n+a[0].length):-1}function zL(e,t,n){var a=Rt.exec(t.slice(n,n+2));return a?(e.S=+a[0],n+a[0].length):-1}function RL(e,t,n){var a=Rt.exec(t.slice(n,n+3));return a?(e.L=+a[0],n+a[0].length):-1}function LL(e,t,n){var a=Rt.exec(t.slice(n,n+6));return a?(e.L=Math.floor(a[0]/1e3),n+a[0].length):-1}function $L(e,t,n){var a=wL.exec(t.slice(n,n+1));return a?n+a[0].length:-1}function UL(e,t,n){var a=Rt.exec(t.slice(n));return a?(e.Q=+a[0],n+a[0].length):-1}function qL(e,t,n){var a=Rt.exec(t.slice(n));return a?(e.s=+a[0],n+a[0].length):-1}function W2(e,t){return Pe(e.getDate(),t,2)}function BL(e,t){return Pe(e.getHours(),t,2)}function IL(e,t){return Pe(e.getHours()%12||12,t,2)}function HL(e,t){return Pe(1+Po.count(Xr(e),e),t,3)}function pN(e,t){return Pe(e.getMilliseconds(),t,3)}function KL(e,t){return pN(e,t)+"000"}function YL(e,t){return Pe(e.getMonth()+1,t,2)}function GL(e,t){return Pe(e.getMinutes(),t,2)}function VL(e,t){return Pe(e.getSeconds(),t,2)}function XL(e){var t=e.getDay();return t===0?7:t}function FL(e,t){return Pe(ad.count(Xr(e)-1,e),t,2)}function yN(e){var t=e.getDay();return t>=4||t===0?Ml(e):Ml.ceil(e)}function ZL(e,t){return e=yN(e),Pe(Ml.count(Xr(e),e)+(Xr(e).getDay()===4),t,2)}function QL(e){return e.getDay()}function WL(e,t){return Pe(pf.count(Xr(e)-1,e),t,2)}function JL(e,t){return Pe(e.getFullYear()%100,t,2)}function e9(e,t){return e=yN(e),Pe(e.getFullYear()%100,t,2)}function t9(e,t){return Pe(e.getFullYear()%1e4,t,4)}function n9(e,t){var n=e.getDay();return e=n>=4||n===0?Ml(e):Ml.ceil(e),Pe(e.getFullYear()%1e4,t,4)}function r9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Pe(t/60|0,"0",2)+Pe(t%60,"0",2)}function J2(e,t){return Pe(e.getUTCDate(),t,2)}function a9(e,t){return Pe(e.getUTCHours(),t,2)}function i9(e,t){return Pe(e.getUTCHours()%12||12,t,2)}function l9(e,t){return Pe(1+rd.count(Fr(e),e),t,3)}function gN(e,t){return Pe(e.getUTCMilliseconds(),t,3)}function u9(e,t){return gN(e,t)+"000"}function o9(e,t){return Pe(e.getUTCMonth()+1,t,2)}function s9(e,t){return Pe(e.getUTCMinutes(),t,2)}function c9(e,t){return Pe(e.getUTCSeconds(),t,2)}function f9(e){var t=e.getUTCDay();return t===0?7:t}function d9(e,t){return Pe(id.count(Fr(e)-1,e),t,2)}function bN(e){var t=e.getUTCDay();return t>=4||t===0?Cl(e):Cl.ceil(e)}function h9(e,t){return e=bN(e),Pe(Cl.count(Fr(e),e)+(Fr(e).getUTCDay()===4),t,2)}function m9(e){return e.getUTCDay()}function v9(e,t){return Pe(yf.count(Fr(e)-1,e),t,2)}function p9(e,t){return Pe(e.getUTCFullYear()%100,t,2)}function y9(e,t){return e=bN(e),Pe(e.getUTCFullYear()%100,t,2)}function g9(e,t){return Pe(e.getUTCFullYear()%1e4,t,4)}function b9(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Cl(e):Cl.ceil(e),Pe(e.getUTCFullYear()%1e4,t,4)}function x9(){return"+0000"}function eO(){return"%"}function tO(e){return+e}function nO(e){return Math.floor(+e/1e3)}var ml,xN,SN;S9({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 S9(e){return ml=SL(e),xN=ml.format,ml.parse,SN=ml.utcFormat,ml.utcParse,ml}function w9(e){return new Date(e)}function j9(e){return e instanceof Date?+e:+new Date(+e)}function My(e,t,n,a,l,o,c,f,d,h){var v=py(),p=v.invert,b=v.domain,x=h(".%L"),O=h(":%S"),j=h("%I:%M"),_=h("%I %p"),N=h("%a %d"),E=h("%b %d"),T=h("%B"),P=h("%Y");function C(M){return(d(M)t(l/(e.length-1)))},n.quantiles=function(a){return Array.from({length:a+1},(l,o)=>f8(e,o/a))},n.copy=function(){return _N(t).domain(e)},ea.apply(n,arguments)}function ud(){var e=0,t=.5,n=1,a=1,l,o,c,f,d,h=en,v,p=!1,b;function x(j){return isNaN(j=+j)?b:(j=.5+((j=+v(j))-o)*(a*je.chartData,ky=V([Ia],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Py=(e,t,n,a)=>a?ky(e):Ia(e);function La(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(wt(t)&&wt(n))return!0}return!1}function rO(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function TN(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,a]=e,l,o;if(wt(n))l=n;else if(typeof n=="function")return;if(wt(a))o=a;else if(typeof a=="function")return;var c=[l,o];if(La(c))return c}}function N9(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var a=e(t,n);if(La(a))return rO(a,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[l,o]=e,c,f;if(l==="auto")t!=null&&(c=Math.min(...t));else if(me(l))c=l;else if(typeof l=="function")try{t!=null&&(c=l(t?.[0]))}catch{}else if(typeof l=="string"&&mj.test(l)){var d=mj.exec(l);if(d==null||d[1]==null||t==null)c=void 0;else{var h=+d[1];c=t[0]-h}}else c=t?.[0];if(o==="auto")t!=null&&(f=Math.max(...t));else if(me(o))f=o;else if(typeof o=="function")try{t!=null&&(f=o(t?.[1]))}catch{}else if(typeof o=="string"&&vj.test(o)){var v=vj.exec(o);if(v==null||v[1]==null||t==null)f=void 0;else{var p=+v[1];f=t[1]+p}}else f=t?.[1];var b=[c,f];if(La(b))return t==null?b:rO(b,t,n)}}}var Rl=1e9,T9={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Ry,at=!0,Xn="[DecimalError] ",gi=Xn+"Invalid argument: ",zy=Xn+"Exponent out of range: ",Ll=Math.floor,ci=Math.pow,M9=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,An,Pt=1e7,et=7,MN=9007199254740991,gf=Ll(MN/et),oe={};oe.absoluteValue=oe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};oe.comparedTo=oe.cmp=function(e){var t,n,a,l,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(a=o.d.length,l=e.d.length,t=0,n=ae.d[t]^o.s<0?1:-1;return a===l?0:a>l^o.s<0?1:-1};oe.decimalPlaces=oe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*et;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};oe.dividedBy=oe.div=function(e){return Hr(this,new this.constructor(e))};oe.dividedToIntegerBy=oe.idiv=function(e){var t=this,n=t.constructor;return Xe(Hr(t,new n(e),0,1),n.precision)};oe.equals=oe.eq=function(e){return!this.cmp(e)};oe.exponent=function(){return St(this)};oe.greaterThan=oe.gt=function(e){return this.cmp(e)>0};oe.greaterThanOrEqualTo=oe.gte=function(e){return this.cmp(e)>=0};oe.isInteger=oe.isint=function(){return this.e>this.d.length-2};oe.isNegative=oe.isneg=function(){return this.s<0};oe.isPositive=oe.ispos=function(){return this.s>0};oe.isZero=function(){return this.s===0};oe.lessThan=oe.lt=function(e){return this.cmp(e)<0};oe.lessThanOrEqualTo=oe.lte=function(e){return this.cmp(e)<1};oe.logarithm=oe.log=function(e){var t,n=this,a=n.constructor,l=a.precision,o=l+5;if(e===void 0)e=new a(10);else if(e=new a(e),e.s<1||e.eq(An))throw Error(Xn+"NaN");if(n.s<1)throw Error(Xn+(n.s?"NaN":"-Infinity"));return n.eq(An)?new a(0):(at=!1,t=Hr(xo(n,o),xo(e,o),o),at=!0,Xe(t,l))};oe.minus=oe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kN(t,e):CN(t,(e.s=-e.s,e))};oe.modulo=oe.mod=function(e){var t,n=this,a=n.constructor,l=a.precision;if(e=new a(e),!e.s)throw Error(Xn+"NaN");return n.s?(at=!1,t=Hr(n,e,0,1).times(e),at=!0,n.minus(t)):Xe(new a(n),l)};oe.naturalExponential=oe.exp=function(){return DN(this)};oe.naturalLogarithm=oe.ln=function(){return xo(this)};oe.negated=oe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};oe.plus=oe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?CN(t,e):kN(t,(e.s=-e.s,e))};oe.precision=oe.sd=function(e){var t,n,a,l=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(gi+e);if(t=St(l)+1,a=l.d.length-1,n=a*et+1,a=l.d[a],a){for(;a%10==0;a/=10)n--;for(a=l.d[0];a>=10;a/=10)n++}return e&&t>n?t:n};oe.squareRoot=oe.sqrt=function(){var e,t,n,a,l,o,c,f=this,d=f.constructor;if(f.s<1){if(!f.s)return new d(0);throw Error(Xn+"NaN")}for(e=St(f),at=!1,l=Math.sqrt(+f),l==0||l==1/0?(t=hr(f.d),(t.length+e)%2==0&&(t+="0"),l=Math.sqrt(t),e=Ll((e+1)/2)-(e<0||e%2),l==1/0?t="5e"+e:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),a=new d(t)):a=new d(l.toString()),n=d.precision,l=c=n+3;;)if(o=a,a=o.plus(Hr(f,o,c+2)).times(.5),hr(o.d).slice(0,c)===(t=hr(a.d)).slice(0,c)){if(t=t.slice(c-3,c+1),l==c&&t=="4999"){if(Xe(o,n+1,0),o.times(o).eq(f)){a=o;break}}else if(t!="9999")break;c+=4}return at=!0,Xe(a,n)};oe.times=oe.mul=function(e){var t,n,a,l,o,c,f,d,h,v=this,p=v.constructor,b=v.d,x=(e=new p(e)).d;if(!v.s||!e.s)return new p(0);for(e.s*=v.s,n=v.e+e.e,d=b.length,h=x.length,d=0;){for(t=0,l=d+a;l>a;)f=o[l]+x[a]*b[l-a-1]+t,o[l--]=f%Pt|0,t=f/Pt|0;o[l]=(o[l]+t)%Pt|0}for(;!o[--c];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,at?Xe(e,p.precision):e};oe.toDecimalPlaces=oe.todp=function(e,t){var n=this,a=n.constructor;return n=new a(n),e===void 0?n:(gr(e,0,Rl),t===void 0?t=a.rounding:gr(t,0,8),Xe(n,e+St(n)+1,t))};oe.toExponential=function(e,t){var n,a=this,l=a.constructor;return e===void 0?n=Oi(a,!0):(gr(e,0,Rl),t===void 0?t=l.rounding:gr(t,0,8),a=Xe(new l(a),e+1,t),n=Oi(a,!0,e+1)),n};oe.toFixed=function(e,t){var n,a,l=this,o=l.constructor;return e===void 0?Oi(l):(gr(e,0,Rl),t===void 0?t=o.rounding:gr(t,0,8),a=Xe(new o(l),e+St(l)+1,t),n=Oi(a.abs(),!1,e+St(a)+1),l.isneg()&&!l.isZero()?"-"+n:n)};oe.toInteger=oe.toint=function(){var e=this,t=e.constructor;return Xe(new t(e),St(e)+1,t.rounding)};oe.toNumber=function(){return+this};oe.toPower=oe.pow=function(e){var t,n,a,l,o,c,f=this,d=f.constructor,h=12,v=+(e=new d(e));if(!e.s)return new d(An);if(f=new d(f),!f.s){if(e.s<1)throw Error(Xn+"Infinity");return f}if(f.eq(An))return f;if(a=d.precision,e.eq(An))return Xe(f,a);if(t=e.e,n=e.d.length-1,c=t>=n,o=f.s,c){if((n=v<0?-v:v)<=MN){for(l=new d(An),t=Math.ceil(a/et+4),at=!1;n%2&&(l=l.times(f),iO(l.d,t)),n=Ll(n/2),n!==0;)f=f.times(f),iO(f.d,t);return at=!0,e.s<0?new d(An).div(l):Xe(l,a)}}else if(o<0)throw Error(Xn+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,f.s=1,at=!1,l=e.times(xo(f,a+h)),at=!0,l=DN(l),l.s=o,l};oe.toPrecision=function(e,t){var n,a,l=this,o=l.constructor;return e===void 0?(n=St(l),a=Oi(l,n<=o.toExpNeg||n>=o.toExpPos)):(gr(e,1,Rl),t===void 0?t=o.rounding:gr(t,0,8),l=Xe(new o(l),e,t),n=St(l),a=Oi(l,e<=n||n<=o.toExpNeg,e)),a};oe.toSignificantDigits=oe.tosd=function(e,t){var n=this,a=n.constructor;return e===void 0?(e=a.precision,t=a.rounding):(gr(e,1,Rl),t===void 0?t=a.rounding:gr(t,0,8)),Xe(new a(n),e,t)};oe.toString=oe.valueOf=oe.val=oe.toJSON=oe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=St(e),n=e.constructor;return Oi(e,t<=n.toExpNeg||t>=n.toExpPos)};function CN(e,t){var n,a,l,o,c,f,d,h,v=e.constructor,p=v.precision;if(!e.s||!t.s)return t.s||(t=new v(e)),at?Xe(t,p):t;if(d=e.d,h=t.d,c=e.e,l=t.e,d=d.slice(),o=c-l,o){for(o<0?(a=d,o=-o,f=h.length):(a=h,l=c,f=d.length),c=Math.ceil(p/et),f=c>f?c+1:f+1,o>f&&(o=f,a.length=1),a.reverse();o--;)a.push(0);a.reverse()}for(f=d.length,o=h.length,f-o<0&&(o=f,a=h,h=d,d=a),n=0;o;)n=(d[--o]=d[o]+h[o]+n)/Pt|0,d[o]%=Pt;for(n&&(d.unshift(n),++l),f=d.length;d[--f]==0;)d.pop();return t.d=d,t.e=l,at?Xe(t,p):t}function gr(e,t,n){if(e!==~~e||en)throw Error(gi+e)}function hr(e){var t,n,a,l=e.length-1,o="",c=e[0];if(l>0){for(o+=c,t=1;tc?1:-1;else for(f=d=0;fl[f]?1:-1;break}return d}function n(a,l,o){for(var c=0;o--;)a[o]-=c,c=a[o]1;)a.shift()}return function(a,l,o,c){var f,d,h,v,p,b,x,O,j,_,N,E,T,P,C,M,L,Z,re=a.constructor,B=a.s==l.s?1:-1,U=a.d,K=l.d;if(!a.s)return new re(a);if(!l.s)throw Error(Xn+"Division by zero");for(d=a.e-l.e,L=K.length,C=U.length,x=new re(B),O=x.d=[],h=0;K[h]==(U[h]||0);)++h;if(K[h]>(U[h]||0)&&--d,o==null?E=o=re.precision:c?E=o+(St(a)-St(l))+1:E=o,E<0)return new re(0);if(E=E/et+2|0,h=0,L==1)for(v=0,K=K[0],E++;(h1&&(K=e(K,v),U=e(U,v),L=K.length,C=U.length),P=L,j=U.slice(0,L),_=j.length;_=Pt/2&&++M;do v=0,f=t(K,j,L,_),f<0?(N=j[0],L!=_&&(N=N*Pt+(j[1]||0)),v=N/M|0,v>1?(v>=Pt&&(v=Pt-1),p=e(K,v),b=p.length,_=j.length,f=t(p,j,b,_),f==1&&(v--,n(p,L16)throw Error(zy+St(e));if(!e.s)return new v(An);for(at=!1,f=p,c=new v(.03125);e.abs().gte(.1);)e=e.times(c),h+=5;for(a=Math.log(ci(2,h))/Math.LN10*2+5|0,f+=a,n=l=o=new v(An),v.precision=f;;){if(l=Xe(l.times(e),f),n=n.times(++d),c=o.plus(Hr(l,n,f)),hr(c.d).slice(0,f)===hr(o.d).slice(0,f)){for(;h--;)o=Xe(o.times(o),f);return v.precision=p,t==null?(at=!0,Xe(o,p)):o}o=c}}function St(e){for(var t=e.e*et,n=e.d[0];n>=10;n/=10)t++;return t}function sp(e,t,n){if(t>e.LN10.sd())throw at=!0,n&&(e.precision=n),Error(Xn+"LN10 precision limit exceeded");return Xe(new e(e.LN10),t)}function Ma(e){for(var t="";e--;)t+="0";return t}function xo(e,t){var n,a,l,o,c,f,d,h,v,p=1,b=10,x=e,O=x.d,j=x.constructor,_=j.precision;if(x.s<1)throw Error(Xn+(x.s?"NaN":"-Infinity"));if(x.eq(An))return new j(0);if(t==null?(at=!1,h=_):h=t,x.eq(10))return t==null&&(at=!0),sp(j,h);if(h+=b,j.precision=h,n=hr(O),a=n.charAt(0),o=St(x),Math.abs(o)<15e14){for(;a<7&&a!=1||a==1&&n.charAt(1)>3;)x=x.times(e),n=hr(x.d),a=n.charAt(0),p++;o=St(x),a>1?(x=new j("0."+n),o++):x=new j(a+"."+n.slice(1))}else return d=sp(j,h+2,_).times(o+""),x=xo(new j(a+"."+n.slice(1)),h-b).plus(d),j.precision=_,t==null?(at=!0,Xe(x,_)):x;for(f=c=x=Hr(x.minus(An),x.plus(An),h),v=Xe(x.times(x),h),l=3;;){if(c=Xe(c.times(v),h),d=f.plus(Hr(c,new j(l),h)),hr(d.d).slice(0,h)===hr(f.d).slice(0,h))return f=f.times(2),o!==0&&(f=f.plus(sp(j,h+2,_).times(o+""))),f=Hr(f,new j(p),h),j.precision=_,t==null?(at=!0,Xe(f,_)):f;f=d,l+=2}}function aO(e,t){var n,a,l;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(n<0&&(n=a),n+=+t.slice(a+1),t=t.substring(0,a)):n<0&&(n=t.length),a=0;t.charCodeAt(a)===48;)++a;for(l=t.length;t.charCodeAt(l-1)===48;)--l;if(t=t.slice(a,l),t){if(l-=a,n=n-a-1,e.e=Ll(n/et),e.d=[],a=(n+1)%et,n<0&&(a+=et),agf||e.e<-gf))throw Error(zy+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xe(e,t,n){var a,l,o,c,f,d,h,v,p=e.d;for(c=1,o=p[0];o>=10;o/=10)c++;if(a=t-c,a<0)a+=et,l=t,h=p[v=0];else{if(v=Math.ceil((a+1)/et),o=p.length,v>=o)return e;for(h=o=p[v],c=1;o>=10;o/=10)c++;a%=et,l=a-et+c}if(n!==void 0&&(o=ci(10,c-l-1),f=h/o%10|0,d=t<0||p[v+1]!==void 0||h%o,d=n<4?(f||d)&&(n==0||n==(e.s<0?3:2)):f>5||f==5&&(n==4||d||n==6&&(a>0?l>0?h/ci(10,c-l):0:p[v-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(o=St(e),p.length=1,t=t-o-1,p[0]=ci(10,(et-t%et)%et),e.e=Ll(-t/et)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(a==0?(p.length=v,o=1,v--):(p.length=v+1,o=ci(10,et-a),p[v]=l>0?(h/ci(10,c-l)%ci(10,l)|0)*o:0),d)for(;;)if(v==0){(p[0]+=o)==Pt&&(p[0]=1,++e.e);break}else{if(p[v]+=o,p[v]!=Pt)break;p[v--]=0,o=1}for(a=p.length;p[--a]===0;)p.pop();if(at&&(e.e>gf||e.e<-gf))throw Error(zy+St(e));return e}function kN(e,t){var n,a,l,o,c,f,d,h,v,p,b=e.constructor,x=b.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new b(e),at?Xe(t,x):t;if(d=e.d,p=t.d,a=t.e,h=e.e,d=d.slice(),c=h-a,c){for(v=c<0,v?(n=d,c=-c,f=p.length):(n=p,a=h,f=d.length),l=Math.max(Math.ceil(x/et),f)+2,c>l&&(c=l,n.length=1),n.reverse(),l=c;l--;)n.push(0);n.reverse()}else{for(l=d.length,f=p.length,v=l0;--l)d[f++]=0;for(l=p.length;l>c;){if(d[--l]0?o=o.charAt(0)+"."+o.slice(1)+Ma(a):c>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(l<0?"e":"e+")+l):l<0?(o="0."+Ma(-l-1)+o,n&&(a=n-c)>0&&(o+=Ma(a))):l>=c?(o+=Ma(l+1-c),n&&(a=n-l-1)>0&&(o=o+"."+Ma(a))):((a=l+1)0&&(l+1===c&&(o+="."),o+=Ma(a))),e.s<0?"-"+o:o}function iO(e,t){if(e.length>t)return e.length=t,!0}function PN(e){var t,n,a;function l(o){var c=this;if(!(c instanceof l))return new l(o);if(c.constructor=l,o instanceof l){c.s=o.s,c.e=o.e,c.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(gi+o);if(o>0)c.s=1;else if(o<0)o=-o,c.s=-1;else{c.s=0,c.e=0,c.d=[0];return}if(o===~~o&&o<1e7){c.e=0,c.d=[o];return}return aO(c,o.toString())}else if(typeof o!="string")throw Error(gi+o);if(o.charCodeAt(0)===45?(o=o.slice(1),c.s=-1):c.s=1,M9.test(o))aO(c,o);else throw Error(gi+o)}if(l.prototype=oe,l.ROUND_UP=0,l.ROUND_DOWN=1,l.ROUND_CEIL=2,l.ROUND_FLOOR=3,l.ROUND_HALF_UP=4,l.ROUND_HALF_DOWN=5,l.ROUND_HALF_EVEN=6,l.ROUND_HALF_CEIL=7,l.ROUND_HALF_FLOOR=8,l.clone=PN,l.config=l.set=C9,e===void 0&&(e={}),e)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=l[t+1]&&a<=l[t+2])this[n]=a;else throw Error(gi+n+": "+a);if((a=e[n="LN10"])!==void 0)if(a==Math.LN10)this[n]=new this(a);else throw Error(gi+n+": "+a);return this}var Ry=PN(T9);An=new Ry(1);const Be=Ry;var D9=e=>e,zN={},RN=e=>e===zN,lO=e=>function t(){return arguments.length===0||arguments.length===1&&RN(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},LN=(e,t)=>e===1?t:lO(function(){for(var n=arguments.length,a=new Array(n),l=0;lc!==zN).length;return o>=e?t(...a):LN(e-o,lO(function(){for(var c=arguments.length,f=new Array(c),d=0;dRN(v)?f.shift():v);return t(...h,...f)}))}),k9=e=>LN(e.length,e),m0=(e,t)=>{for(var n=[],a=e;aArray.isArray(t)?t.map(e):Object.keys(t).map(n=>t[n]).map(e)),z9=function(){for(var t=arguments.length,n=new Array(t),a=0;ad(f),o(...arguments))}};function $N(e){var t;return e===0?t=1:t=Math.floor(new Be(e).abs().log(10).toNumber())+1,t}function UN(e,t,n){for(var a=new Be(e),l=0,o=[];a.lt(t)&&l<1e5;)o.push(a.toNumber()),a=a.add(n),l++;return o}var qN=e=>{var[t,n]=e,[a,l]=[t,n];return t>n&&([a,l]=[n,t]),[a,l]},BN=(e,t,n)=>{if(e.lte(0))return new Be(0);var a=$N(e.toNumber()),l=new Be(10).pow(a),o=e.div(l),c=a!==1?.05:.1,f=new Be(Math.ceil(o.div(c).toNumber())).add(n).mul(c),d=f.mul(l);return t?new Be(d.toNumber()):new Be(Math.ceil(d.toNumber()))},R9=(e,t,n)=>{var a=new Be(1),l=new Be(e);if(!l.isint()&&n){var o=Math.abs(e);o<1?(a=new Be(10).pow($N(e)-1),l=new Be(Math.floor(l.div(a).toNumber())).mul(a)):o>1&&(l=new Be(Math.floor(e)))}else e===0?l=new Be(Math.floor((t-1)/2)):n||(l=new Be(Math.floor(e)));var c=Math.floor((t-1)/2),f=z9(P9(d=>l.add(new Be(d-c).mul(a)).toNumber()),m0);return f(0,t)},IN=function(t,n,a,l){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(a-1)))return{step:new Be(0),tickMin:new Be(0),tickMax:new Be(0)};var c=BN(new Be(n).sub(t).div(a-1),l,o),f;t<=0&&n>=0?f=new Be(0):(f=new Be(t).add(n).div(2),f=f.sub(new Be(f).mod(c)));var d=Math.ceil(f.sub(t).div(c).toNumber()),h=Math.ceil(new Be(n).sub(f).div(c).toNumber()),v=d+h+1;return v>a?IN(t,n,a,l,o+1):(v0?h+(a-v):h,d=n>0?d:d+(a-v)),{step:c,tickMin:f.sub(new Be(d).mul(c)),tickMax:f.add(new Be(h).mul(c))})},L9=function(t){var[n,a]=t,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,c=Math.max(l,2),[f,d]=qN([n,a]);if(f===-1/0||d===1/0){var h=d===1/0?[f,...m0(0,l-1).map(()=>1/0)]:[...m0(0,l-1).map(()=>-1/0),d];return n>a?h.reverse():h}if(f===d)return R9(f,l,o);var{step:v,tickMin:p,tickMax:b}=IN(f,d,c,o,0),x=UN(p,b.add(new Be(.1).mul(v)),v);return n>a?x.reverse():x},$9=function(t,n){var[a,l]=t,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[c,f]=qN([a,l]);if(c===-1/0||f===1/0)return[a,l];if(c===f)return[c];var d=Math.max(n,2),h=BN(new Be(f).sub(c).div(d-1),o,0),v=[...UN(new Be(c),new Be(f),h),f];return o===!1&&(v=v.map(p=>Math.round(p))),a>l?v.reverse():v},U9=e=>e.rootProps.barCategoryGap,zo=e=>e.rootProps.stackOffset,HN=e=>e.rootProps.reverseStackOrder,Ly=e=>e.options.chartName,$y=e=>e.rootProps.syncId,KN=e=>e.rootProps.syncMethod,Uy=e=>e.options.eventEmitter,Vt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Ur={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},_n={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},od=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},q9={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Ur.angleAxisId,includeHidden:!1,name:void 0,reversed:Ur.reversed,scale:Ur.scale,tick:Ur.tick,tickCount:void 0,ticks:void 0,type:Ur.type,unit:void 0},B9={allowDataOverflow:_n.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:_n.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_n.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:_n.scale,tick:_n.tick,tickCount:_n.tickCount,ticks:void 0,type:_n.type,unit:void 0},I9={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:Ur.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ur.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:Ur.scale,tick:Ur.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},H9={allowDataOverflow:_n.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:_n.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_n.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:_n.scale,tick:_n.tick,tickCount:_n.tickCount,ticks:void 0,type:"category",unit:void 0},qy=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?I9:q9,By=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?H9:B9,sd=e=>e.polarOptions,Iy=V([Wr,Jr,zt],YE),YN=V([sd,Iy],(e,t)=>{if(e!=null)return Nn(e.innerRadius,t,0)}),GN=V([sd,Iy],(e,t)=>{if(e!=null)return Nn(e.outerRadius,t,t*.8)}),K9=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},VN=V([sd],K9);V([qy,VN],od);var XN=V([Iy,YN,GN],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});V([By,XN],od);var FN=V([Ge,sd,YN,GN,Wr,Jr],(e,t,n,a,l,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||a==null)){var{cx:c,cy:f,startAngle:d,endAngle:h}=t;return{cx:Nn(c,l,l/2),cy:Nn(f,o,o/2),innerRadius:n,outerRadius:a,startAngle:d,endAngle:h,clockWise:!1}}}),it=(e,t)=>t,Ro=(e,t,n)=>n;function ZN(e){return e?.id}function QN(e,t,n){var{chartData:a=[]}=t,{allowDuplicatedCategory:l,dataKey:o}=n,c=new Map;return e.forEach(f=>{var d,h=(d=f.data)!==null&&d!==void 0?d:a;if(!(h==null||h.length===0)){var v=ZN(f);h.forEach((p,b)=>{var x=o==null||l?b:String(tt(p,o,null)),O=tt(p,f.dataKey,0),j;c.has(x)?j=c.get(x):j={},Object.assign(j,{[v]:O}),c.set(x,j)})}}),Array.from(c.values())}function Hy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var cd=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function fd(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Y9(e,t){if(e.length===t.length){for(var n=0;n{var t=Ge(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},$l=e=>e.tooltip.settings.axisId;function uO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function bf(e){for(var t=1;te.cartesianAxis.xAxis[t],ta=(e,t)=>{var n=WN(e,t);return n??Dt},kt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:v0,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,width:No},JN=(e,t)=>e.cartesianAxis.yAxis[t],na=(e,t)=>{var n=JN(e,t);return n??kt},F9={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:""},Ky=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??F9},lt=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"zAxis":return Ky(e,n);case"angleAxis":return qy(e,n);case"radiusAxis":return By(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Z9=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Lo=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"angleAxis":return qy(e,n);case"radiusAxis":return By(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},eT=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Yy(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 tT=e=>e.graphicalItems.cartesianItems,Q9=V([it,Ro],Yy),Gy=(e,t,n)=>e.filter(n).filter(a=>t?.includeHidden===!0?!0:!a.hide),$o=V([tT,lt,Q9],Gy,{memoizeOptions:{resultEqualityCheck:fd}}),nT=V([$o],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Hy)),rT=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),W9=V([$o],rT),Vy=e=>e.map(t=>t.data).filter(Boolean).flat(1),J9=V([$o],Vy,{memoizeOptions:{resultEqualityCheck:fd}}),Xy=(e,t)=>{var{chartData:n=[],dataStartIndex:a,dataEndIndex:l}=t;return e.length>0?e:n.slice(a,l+1)},Fy=V([J9,Py],Xy),Zy=(e,t,n)=>t?.dataKey!=null?e.map(a=>({value:tt(a,t.dataKey)})):n.length>0?n.map(a=>a.dataKey).flatMap(a=>e.map(l=>({value:tt(l,a)}))):e.map(a=>({value:a})),dd=V([Fy,lt,$o],Zy);function aT(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Tc(e){if(pr(e)||e instanceof Date){var t=Number(e);if(wt(t))return t}}function oO(e){if(Array.isArray(e)){var t=[Tc(e[0]),Tc(e[1])];return La(t)?t:void 0}var n=Tc(e);if(n!=null)return[n,n]}function Zr(e){return e.map(Tc).filter(Zk)}function e$(e,t,n){return!n||typeof t!="number"||vr(t)?[]:n.length?Zr(n.flatMap(a=>{var l=tt(e,a.dataKey),o,c;if(Array.isArray(l)?[o,c]=l:o=c=l,!(!wt(o)||!wt(c)))return[t-o,t+c]})):[]}var Tt=e=>{var t=Nt(e),n=$l(e);return Lo(e,t,n)},Uo=V([Tt],e=>e?.dataKey),t$=V([nT,Py,Tt],QN),iT=(e,t,n,a)=>{var l={},o=t.reduce((c,f)=>{if(f.stackId==null)return c;var d=c[f.stackId];return d==null&&(d=[]),d.push(f),c[f.stackId]=d,c},l);return Object.fromEntries(Object.entries(o).map(c=>{var[f,d]=c,h=a?[...d].reverse():d,v=h.map(ZN);return[f,{stackedData:j5(e,v,n),graphicalItems:h}]}))},n$=V([t$,nT,zo,HN],iT),lT=(e,t,n,a)=>{var{dataStartIndex:l,dataEndIndex:o}=t;if(a==null&&n!=="zAxis"){var c=A5(e,l,o);if(!(c!=null&&c[0]===0&&c[1]===0))return c}},r$=V([lt],e=>e.allowDataOverflow),Qy=e=>{var t;if(e==null||!("domain"in e))return v0;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Zr(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:v0},Wy=V([lt],Qy),Jy=V([Wy,r$],TN),a$=V([n$,Ia,it,Jy],lT,{memoizeOptions:{resultEqualityCheck:cd}}),hd=e=>e.errorBars,i$=(e,t,n)=>e.flatMap(a=>t[a.id]).filter(Boolean).filter(a=>aT(n,a)),xf=function(){for(var t=arguments.length,n=new Array(t),a=0;a{var o,c;if(n.length>0&&e.forEach(f=>{n.forEach(d=>{var h,v,p=(h=a[d.id])===null||h===void 0?void 0:h.filter(N=>aT(l,N)),b=tt(f,(v=t.dataKey)!==null&&v!==void 0?v:d.dataKey),x=e$(f,b,p);if(x.length>=2){var O=Math.min(...x),j=Math.max(...x);(o==null||Oc)&&(c=j)}var _=oO(b);_!=null&&(o=o==null?_[0]:Math.min(o,_[0]),c=c==null?_[1]:Math.max(c,_[1]))})}),t?.dataKey!=null&&e.forEach(f=>{var d=oO(tt(f,t.dataKey));d!=null&&(o=o==null?d[0]:Math.min(o,d[0]),c=c==null?d[1]:Math.max(c,d[1]))}),wt(o)&&wt(c))return[o,c]},l$=V([Fy,lt,W9,hd,it],eg,{memoizeOptions:{resultEqualityCheck:cd}});function u$(e){var{value:t}=e;if(pr(t)||t instanceof Date)return t}var o$=(e,t,n)=>{var a=e.map(u$).filter(l=>l!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&jA(a))?FE(0,e.length):t.allowDuplicatedCategory?a:Array.from(new Set(a))},uT=e=>e.referenceElements.dots,Ul=(e,t,n)=>e.filter(a=>a.ifOverflow==="extendDomain").filter(a=>t==="xAxis"?a.xAxisId===n:a.yAxisId===n),s$=V([uT,it,Ro],Ul),oT=e=>e.referenceElements.areas,c$=V([oT,it,Ro],Ul),sT=e=>e.referenceElements.lines,f$=V([sT,it,Ro],Ul),cT=(e,t)=>{if(e!=null){var n=Zr(e.map(a=>t==="xAxis"?a.x:a.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},d$=V(s$,it,cT),fT=(e,t)=>{if(e!=null){var n=Zr(e.flatMap(a=>[t==="xAxis"?a.x1:a.y1,t==="xAxis"?a.x2:a.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},h$=V([c$,it],fT);function m$(e){var t;if(e.x!=null)return Zr([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.x);return n==null||n.length===0?[]:Zr(n)}function v$(e){var t;if(e.y!=null)return Zr([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.y);return n==null||n.length===0?[]:Zr(n)}var dT=(e,t)=>{if(e!=null){var n=e.flatMap(a=>t==="xAxis"?m$(a):v$(a));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},p$=V([f$,it],dT),y$=V(d$,p$,h$,(e,t,n)=>xf(e,n,t)),tg=(e,t,n,a,l,o,c,f)=>{if(n!=null)return n;var d=c==="vertical"&&f==="xAxis"||c==="horizontal"&&f==="yAxis",h=d?xf(a,o,l):xf(o,l);return N9(t,h,e.allowDataOverflow)},g$=V([lt,Wy,Jy,a$,l$,y$,Ge,it],tg,{memoizeOptions:{resultEqualityCheck:cd}}),b$=[0,1],ng=(e,t,n,a,l,o,c)=>{if(!((e==null||n==null||n.length===0)&&c===void 0)){var{dataKey:f,type:d}=e,h=Ua(t,o);if(h&&f==null){var v;return FE(0,(v=n?.length)!==null&&v!==void 0?v:0)}return d==="category"?o$(a,e,h):l==="expand"?b$:c}},rg=V([lt,Ge,Fy,dd,zo,it,g$],ng),hT=(e,t,n,a,l)=>{if(e!=null){var{scale:o,type:c}=e;if(o==="auto")return t==="radial"&&l==="radiusAxis"?"band":t==="radial"&&l==="angleAxis"?"linear":c==="category"&&a&&(a.indexOf("LineChart")>=0||a.indexOf("AreaChart")>=0||a.indexOf("ComposedChart")>=0&&!n)?"point":c==="category"?"band":"linear";if(typeof o=="string"){var f="scale".concat(Oo(o));return f in eo?f:"point"}}},ql=V([lt,Ge,eT,Ly,it],hT);function x$(e){if(e!=null){if(e in eo)return eo[e]();var t="scale".concat(Oo(e));if(t in eo)return eo[t]()}}function ag(e,t,n,a){if(!(n==null||a==null)){if(typeof e.scale=="function")return e.scale.copy().domain(n).range(a);var l=x$(t);if(l!=null){var o=l.domain(n).range(a);return b5(o),o}}}var ig=(e,t,n)=>{var a=Qy(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto")&&La(e))return L9(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&La(e))return $9(e,t.tickCount,t.allowDecimals)}},lg=V([rg,Lo,ql],ig),ug=(e,t,n,a)=>{if(a!=="angleAxis"&&e?.type==="number"&&La(t)&&Array.isArray(n)&&n.length>0){var l=t[0],o=n[0],c=t[1],f=n[n.length-1];return[Math.min(l,o),Math.max(c,f)]}return t},S$=V([lt,rg,lg,it],ug),w$=V(dd,lt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,a=Array.from(Zr(e.map(p=>p.value))).sort((p,b)=>p-b),l=a[0],o=a[a.length-1];if(l==null||o==null)return 1/0;var c=o-l;if(c===0)return 1/0;for(var f=0;fl,(e,t,n,a,l)=>{if(!wt(e))return 0;var o=t==="vertical"?a.height:a.width;if(l==="gap")return e*o/2;if(l==="no-gap"){var c=Nn(n,e*o),f=e*o/2;return f-c-(f-c)/o*c}return 0}),j$=(e,t,n)=>{var a=ta(e,t);return a==null||typeof a.padding!="string"?0:mT(e,"xAxis",t,n,a.padding)},O$=(e,t,n)=>{var a=na(e,t);return a==null||typeof a.padding!="string"?0:mT(e,"yAxis",t,n,a.padding)},_$=V(ta,j$,(e,t)=>{var n,a;if(e==null)return{left:0,right:0};var{padding:l}=e;return typeof l=="string"?{left:t,right:t}:{left:((n=l.left)!==null&&n!==void 0?n:0)+t,right:((a=l.right)!==null&&a!==void 0?a:0)+t}}),A$=V(na,O$,(e,t)=>{var n,a;if(e==null)return{top:0,bottom:0};var{padding:l}=e;return typeof l=="string"?{top:t,bottom:t}:{top:((n=l.top)!==null&&n!==void 0?n:0)+t,bottom:((a=l.bottom)!==null&&a!==void 0?a:0)+t}}),E$=V([zt,_$,Vf,Gf,(e,t,n)=>n],(e,t,n,a,l)=>{var{padding:o}=a;return l?[o.left,n.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),N$=V([zt,Ge,A$,Vf,Gf,(e,t,n)=>n],(e,t,n,a,l,o)=>{var{padding:c}=l;return o?[a.height-c.bottom,c.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),qo=(e,t,n,a)=>{var l;switch(t){case"xAxis":return E$(e,n,a);case"yAxis":return N$(e,n,a);case"zAxis":return(l=Ky(e,n))===null||l===void 0?void 0:l.range;case"angleAxis":return VN(e);case"radiusAxis":return XN(e,n);default:return}},vT=V([lt,qo],od),md=V([lt,ql,S$,vT],ag);V([$o,hd,it],i$);function pT(e,t){return e.idt.id?1:0}var vd=(e,t)=>t,pd=(e,t,n)=>n,T$=V(Kf,vd,pd,(e,t,n)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===n).sort(pT)),M$=V(Yf,vd,pd,(e,t,n)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===n).sort(pT)),yT=(e,t)=>({width:e.width,height:t.height}),C$=(e,t)=>{var n=typeof t.width=="number"?t.width:No;return{width:n,height:e.height}},D$=V(zt,ta,yT),k$=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},P$=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},z$=V(Jr,zt,T$,vd,pd,(e,t,n,a,l)=>{var o={},c;return n.forEach(f=>{var d=yT(t,f);c==null&&(c=k$(t,a,e));var h=a==="top"&&!l||a==="bottom"&&l;o[f.id]=c-Number(h)*d.height,c+=(h?-1:1)*d.height}),o}),R$=V(Wr,zt,M$,vd,pd,(e,t,n,a,l)=>{var o={},c;return n.forEach(f=>{var d=C$(t,f);c==null&&(c=P$(t,a,e));var h=a==="left"&&!l||a==="right"&&l;o[f.id]=c-Number(h)*d.width,c+=(h?-1:1)*d.width}),o}),L$=(e,t)=>{var n=ta(e,t);if(n!=null)return z$(e,n.orientation,n.mirror)},$$=V([zt,ta,L$,(e,t)=>t],(e,t,n,a)=>{if(t!=null){var l=n?.[a];return l==null?{x:e.left,y:0}:{x:e.left,y:l}}}),U$=(e,t)=>{var n=na(e,t);if(n!=null)return R$(e,n.orientation,n.mirror)},q$=V([zt,na,U$,(e,t)=>t],(e,t,n,a)=>{if(t!=null){var l=n?.[a];return l==null?{x:0,y:e.top}:{x:l,y:e.top}}}),B$=V(zt,na,(e,t)=>{var n=typeof t.width=="number"?t.width:No;return{width:n,height:e.height}}),gT=(e,t,n,a)=>{if(n!=null){var{allowDuplicatedCategory:l,type:o,dataKey:c}=n,f=Ua(e,a),d=t.map(h=>h.value);if(c&&f&&o==="category"&&l&&jA(d))return d}},og=V([Ge,dd,lt,it],gT),bT=(e,t,n,a)=>{if(!(n==null||n.dataKey==null)){var{type:l,scale:o}=n,c=Ua(e,a);if(c&&(l==="number"||o!=="auto"))return t.map(f=>f.value)}},sg=V([Ge,dd,Lo,it],bT),sO=V([Ge,Z9,ql,md,og,sg,qo,lg,it],(e,t,n,a,l,o,c,f,d)=>{if(t!=null){var h=Ua(e,d);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:d,categoricalDomain:o,duplicateDomain:l,isCategorical:h,niceTicks:f,range:c,realScaleType:n,scale:a}}}),I$=(e,t,n,a,l,o,c,f,d)=>{if(!(t==null||a==null)){var h=Ua(e,d),{type:v,ticks:p,tickCount:b}=t,x=n==="scaleBand"&&typeof a.bandwidth=="function"?a.bandwidth()/2:2,O=v==="category"&&a.bandwidth?a.bandwidth()/x:0;O=d==="angleAxis"&&o!=null&&o.length>=2?Wt(o[0]-o[1])*2*O:O;var j=p||l;if(j){var _=j.map((N,E)=>{var T=c?c.indexOf(N):N;return{index:E,coordinate:a(T)+O,value:N,offset:O}});return _.filter(N=>wt(N.coordinate))}return h&&f?f.map((N,E)=>({coordinate:a(N)+O,value:N,index:E,offset:O})).filter(N=>wt(N.coordinate)):a.ticks?a.ticks(b).map(N=>({coordinate:a(N)+O,value:N,offset:O})):a.domain().map((N,E)=>({coordinate:a(N)+O,value:c?c[N]:N,index:E,offset:O}))}},xT=V([Ge,Lo,ql,md,lg,qo,og,sg,it],I$),H$=(e,t,n,a,l,o,c)=>{if(!(t==null||n==null||a==null||a[0]===a[1])){var f=Ua(e,c),{tickCount:d}=t,h=0;return h=c==="angleAxis"&&a?.length>=2?Wt(a[0]-a[1])*2*h:h,f&&o?o.map((v,p)=>({coordinate:n(v)+h,value:v,index:p,offset:h})):n.ticks?n.ticks(d).map(v=>({coordinate:n(v)+h,value:v,offset:h})):n.domain().map((v,p)=>({coordinate:n(v)+h,value:l?l[v]:v,index:p,offset:h}))}},ST=V([Ge,Lo,md,qo,og,sg,it],H$),wT=V(lt,md,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})}),K$=V([lt,ql,rg,vT],ag);V((e,t,n)=>Ky(e,n),K$,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})});var Y$=V([Ge,Kf,Yf],(e,t,n)=>{switch(e){case"horizontal":return t.some(a=>a.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(a=>a.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),jT=e=>e.options.defaultTooltipEventType,OT=e=>e.options.validateTooltipEventTypes;function _T(e,t,n){if(e==null)return t;var a=e?"axis":"item";return n==null?t:n.includes(a)?a:t}function cg(e,t){var n=jT(e),a=OT(e);return _T(t,n,a)}function G$(e){return de(t=>cg(t,e))}var AT=(e,t)=>{var n,a=Number(t);if(!(vr(a)||t==null))return a>=0?e==null||(n=e[a])===null||n===void 0?void 0:n.value:void 0},V$=e=>e.tooltip.settings,ka={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},X$={itemInteraction:{click:ka,hover:ka},axisInteraction:{click:ka,hover:ka},keyboardInteraction:ka,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}},ET=hn({name:"tooltip",initialState:X$,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:rt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).tooltipItemPayloads.indexOf(n);l>-1&&(e.tooltipItemPayloads[l]=a)},prepare:rt()},removeTooltipEntrySettings:{reducer(e,t){var n=nr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:rt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,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.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.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.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:F$,replaceTooltipEntrySettings:Z$,removeTooltipEntrySettings:Q$,setTooltipSettingsState:W$,setActiveMouseOverItemIndex:NT,mouseLeaveItem:J$,mouseLeaveChart:TT,setActiveClickItemIndex:eU,setMouseOverAxisIndex:MT,setMouseClickAxisIndex:tU,setSyncInteraction:p0,setKeyboardInteraction:y0}=ET.actions,nU=ET.reducer;function cO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function wc(e){for(var t=1;t{if(t==null)return ka;var l=lU(e,t,n);if(l==null)return ka;if(l.active)return l;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(uU(l)){if(o)return wc(wc({},l),{},{active:!0})}else if(a!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:a,graphicalItemId:void 0};return wc(wc({},ka),{},{coordinate:l.coordinate})};function oU(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 sU(e,t){var n=oU(e),a=t[0],l=t[1];if(n===void 0)return!1;var o=Math.min(a,l),c=Math.max(a,l);return n>=o&&n<=c}function cU(e,t,n){if(n==null||t==null)return!0;var a=tt(e,t);return a==null||!La(n)?!0:sU(a,n)}var fg=(e,t,n,a)=>{var l=e?.index;if(l==null)return null;var o=Number(l);if(!wt(o))return l;var c=0,f=1/0;t.length>0&&(f=t.length-1);var d=Math.max(c,Math.min(o,f)),h=t[d];return h==null||cU(h,n,a)?String(d):null},DT=(e,t,n,a,l,o,c,f)=>{if(!(o==null||f==null)){var d=c[0],h=d==null?void 0:f(d.positions,o);if(h!=null)return h;var v=l?.[Number(o)];if(v)return n==="horizontal"?{x:v.coordinate,y:(a.top+t)/2}:{x:(a.left+e)/2,y:v.coordinate}}},kT=(e,t,n,a)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var l;if(n==="hover"?l=e.itemInteraction.hover.graphicalItemId:l=e.itemInteraction.click.graphicalItemId,l==null&&a!=null){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(c=>{var f;return((f=c.settings)===null||f===void 0?void 0:f.graphicalItemId)===l})},Bo=e=>e.options.tooltipPayloadSearcher,Bl=e=>e.tooltip;function fO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function dO(e){for(var t=1;t{if(!(t==null||o==null)){var{chartData:f,computedData:d,dataStartIndex:h,dataEndIndex:v}=n,p=[];return e.reduce((b,x)=>{var O,{dataDefinedOnItem:j,settings:_}=x,N=mU(j,f),E=Array.isArray(N)?pE(N,h,v):N,T=(O=_?.dataKey)!==null&&O!==void 0?O:a,P=_?.nameKey,C;if(a&&Array.isArray(E)&&!Array.isArray(E[0])&&c==="axis"?C=OA(E,a,l):C=o(E,t,d,P),Array.isArray(C))C.forEach(L=>{var Z=dO(dO({},_),{},{name:L.name,unit:L.unit,color:void 0,fill:void 0});b.push(pj({tooltipEntrySettings:Z,dataKey:L.dataKey,payload:L.payload,value:tt(L.payload,L.dataKey),name:L.name}))});else{var M;b.push(pj({tooltipEntrySettings:_,dataKey:T,payload:C,value:tt(C,T),name:(M=tt(C,P))!==null&&M!==void 0?M:_?.name}))}return b},p)}},dg=V([Tt,Ge,eT,Ly,Nt],hT),vU=V([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),pU=V([Nt,$l],Yy),Il=V([vU,Tt,pU],Gy,{memoizeOptions:{resultEqualityCheck:fd}}),yU=V([Il],e=>e.filter(Hy)),gU=V([Il],Vy,{memoizeOptions:{resultEqualityCheck:fd}}),Hl=V([gU,Ia],Xy),bU=V([yU,Ia,Tt],QN),hg=V([Hl,Tt,Il],Zy),zT=V([Tt],Qy),xU=V([Tt],e=>e.allowDataOverflow),RT=V([zT,xU],TN),SU=V([Il],e=>e.filter(Hy)),wU=V([bU,SU,zo,HN],iT),jU=V([wU,Ia,Nt,RT],lT),OU=V([Il],rT),_U=V([Hl,Tt,OU,hd,Nt],eg,{memoizeOptions:{resultEqualityCheck:cd}}),AU=V([uT,Nt,$l],Ul),EU=V([AU,Nt],cT),NU=V([oT,Nt,$l],Ul),TU=V([NU,Nt],fT),MU=V([sT,Nt,$l],Ul),CU=V([MU,Nt],dT),DU=V([EU,CU,TU],xf),kU=V([Tt,zT,RT,jU,_U,DU,Ge,Nt],tg),Io=V([Tt,Ge,Hl,hg,zo,Nt,kU],ng),PU=V([Io,Tt,dg],ig),zU=V([Tt,Io,PU,Nt],ug),LT=e=>{var t=Nt(e),n=$l(e),a=!1;return qo(e,t,n,a)},$T=V([Tt,LT],od),UT=V([Tt,dg,zU,$T],ag),RU=V([Ge,hg,Tt,Nt],gT),LU=V([Ge,hg,Tt,Nt],bT),$U=(e,t,n,a,l,o,c,f)=>{if(t){var{type:d}=t,h=Ua(e,f);if(a){var v=n==="scaleBand"&&a.bandwidth?a.bandwidth()/2:2,p=d==="category"&&a.bandwidth?a.bandwidth()/v:0;return p=f==="angleAxis"&&l!=null&&l?.length>=2?Wt(l[0]-l[1])*2*p:p,h&&c?c.map((b,x)=>({coordinate:a(b)+p,value:b,index:x,offset:p})):a.domain().map((b,x)=>({coordinate:a(b)+p,value:o?o[b]:b,index:x,offset:p}))}}},ra=V([Ge,Tt,dg,UT,LT,RU,LU,Nt],$U),mg=V([jT,OT,V$],(e,t,n)=>_T(n.shared,e,t)),qT=e=>e.tooltip.settings.trigger,vg=e=>e.tooltip.settings.defaultIndex,Ho=V([Bl,mg,qT,vg],CT),Dl=V([Ho,Hl,Uo,Io],fg),BT=V([ra,Dl],AT),IT=V([Ho],e=>{if(e)return e.dataKey}),UU=V([Ho],e=>{if(e)return e.graphicalItemId}),HT=V([Bl,mg,qT,vg],kT),qU=V([Wr,Jr,Ge,zt,ra,vg,HT,Bo],DT),BU=V([Ho,qU],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),IU=V([Ho],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),HU=V([HT,Dl,Ia,Uo,BT,Bo,mg],PT),KU=V([HU],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function hO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function mO(e){for(var t=1;tde(Tt),FU=()=>{var e=XU(),t=de(ra),n=de(UT);return Qc(!e||!n?void 0:mO(mO({},e),{},{scale:n}),t)};function vO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function vl(e){for(var t=1;t{var l=t.find(o=>o&&o.index===n);if(l){if(e==="horizontal")return{x:l.coordinate,y:a.chartY};if(e==="vertical")return{x:a.chartX,y:l.coordinate}}return{x:0,y:0}},e7=(e,t,n,a)=>{var l=t.find(h=>h&&h.index===n);if(l){if(e==="centric"){var o=l.coordinate,{radius:c}=a;return vl(vl(vl({},a),xt(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var f=l.coordinate,{angle:d}=a;return vl(vl(vl({},a),xt(a.cx,a.cy,f,d)),{},{angle:d,radius:f})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function t7(e,t){var{chartX:n,chartY:a}=e;return n>=t.left&&n<=t.left+t.width&&a>=t.top&&a<=t.top+t.height}var KT=(e,t,n,a,l)=>{var o,c=(o=t?.length)!==null&&o!==void 0?o:0;if(c<=1||e==null)return 0;if(a==="angleAxis"&&l!=null&&Math.abs(Math.abs(l[1]-l[0])-360)<=1e-6)for(var f=0;f0?(d=n[f-1])===null||d===void 0?void 0:d.coordinate:(h=n[c-1])===null||h===void 0?void 0:h.coordinate,O=(v=n[f])===null||v===void 0?void 0:v.coordinate,j=f>=c-1?(p=n[0])===null||p===void 0?void 0:p.coordinate:(b=n[f+1])===null||b===void 0?void 0:b.coordinate,_=void 0;if(!(x==null||O==null||j==null))if(Wt(O-x)!==Wt(j-O)){var N=[];if(Wt(j-O)===Wt(l[1]-l[0])){_=j;var E=O+l[1]-l[0];N[0]=Math.min(E,(E+x)/2),N[1]=Math.max(E,(E+x)/2)}else{_=x;var T=j+l[1]-l[0];N[0]=Math.min(O,(T+O)/2),N[1]=Math.max(O,(T+O)/2)}var P=[Math.min(O,(_+O)/2),Math.max(O,(_+O)/2)];if(e>P[0]&&e<=P[1]||e>=N[0]&&e<=N[1]){var C;return(C=n[f])===null||C===void 0?void 0:C.index}}else{var M=Math.min(x,j),L=Math.max(x,j);if(e>(M+O)/2&&e<=(L+O)/2){var Z;return(Z=n[f])===null||Z===void 0?void 0:Z.index}}}else if(t)for(var re=0;re(B.coordinate+K.coordinate)/2||re>0&&re(B.coordinate+K.coordinate)/2&&e<=(B.coordinate+U.coordinate)/2)return B.index}}return-1},n7=()=>de(Ly),pg=(e,t)=>t,YT=(e,t,n)=>n,yg=(e,t,n,a)=>a,r7=V(ra,e=>kf(e,t=>t.coordinate)),gg=V([Bl,pg,YT,yg],CT),bg=V([gg,Hl,Uo,Io],fg),a7=(e,t,n)=>{if(t!=null){var a=Bl(e);return t==="axis"?n==="hover"?a.axisInteraction.hover.dataKey:a.axisInteraction.click.dataKey:n==="hover"?a.itemInteraction.hover.dataKey:a.itemInteraction.click.dataKey}},GT=V([Bl,pg,YT,yg],kT),Sf=V([Wr,Jr,Ge,zt,ra,yg,GT,Bo],DT),i7=V([gg,Sf],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),VT=V([ra,bg],AT),l7=V([GT,bg,Ia,Uo,VT,Bo,pg],PT),u7=V([gg,bg],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),o7=(e,t,n,a,l,o,c)=>{if(!(!e||!n||!a||!l)&&t7(e,c)){var f=E5(e,t),d=KT(f,o,l,n,a),h=JU(t,l,d,e);return{activeIndex:String(d),activeCoordinate:h}}},s7=(e,t,n,a,l,o,c)=>{if(!(!e||!a||!l||!o||!n)){var f=K6(e,n);if(f){var d=N5(f,t),h=KT(d,c,o,a,l),v=e7(t,o,h,f);return{activeIndex:String(h),activeCoordinate:v}}}},c7=(e,t,n,a,l,o,c,f)=>{if(!(!e||!t||!a||!l||!o))return t==="horizontal"||t==="vertical"?o7(e,t,a,l,o,c,f):s7(e,t,n,a,l,o,c)},f7=V(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var a=e[t];if(a!=null)return n?a.panoramaElement:a.element}}),d7=V(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(a=>parseInt(a,10)).concat(Object.values(Vt)),n=Array.from(new Set(t));return n.sort((a,l)=>a-l)},{memoizeOptions:{resultEqualityCheck:Y9}});function pO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function yO(e){for(var t=1;tyO(yO({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),p7)},g7=new Set(Object.values(Vt));function b7(e){return g7.has(e)}var XT=hn({name:"zIndex",initialState:y7,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:rt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!b7(n)&&delete e.zIndexMap[n])},prepare:rt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:a,isPanorama:l}=t.payload;e.zIndexMap[n]?l?e.zIndexMap[n].panoramaElement=a:e.zIndexMap[n].element=a:e.zIndexMap[n]={consumers:0,element:l?void 0:a,panoramaElement:l?a:void 0}},prepare:rt()},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:rt()}}}),{registerZIndexPortal:x7,unregisterZIndexPortal:S7,registerZIndexPortalElement:w7,unregisterZIndexPortalElement:j7}=XT.actions,O7=XT.reducer;function ir(e){var{zIndex:t,children:n}=e,a=iR(),l=a&&t!==void 0&&t!==0,o=mn(),c=Qe();S.useLayoutEffect(()=>l?(c(x7({zIndex:t})),()=>{c(S7({zIndex:t}))}):_o,[c,t,l]);var f=de(d=>f7(d,t,o));return l?f?U0.createPortal(n,f):null:n}function g0(){return g0=Object.assign?Object.assign.bind():function(e){for(var t=1;tS.useContext(FT),cp={exports:{}},bO;function D7(){return bO||(bO=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function l(d,h,v){this.fn=d,this.context=h,this.once=v||!1}function o(d,h,v,p,b){if(typeof v!="function")throw new TypeError("The listener must be a function");var x=new l(v,p||d,b),O=n?n+h:h;return d._events[O]?d._events[O].fn?d._events[O]=[d._events[O],x]:d._events[O].push(x):(d._events[O]=x,d._eventsCount++),d}function c(d,h){--d._eventsCount===0?d._events=new a:delete d._events[h]}function f(){this._events=new a,this._eventsCount=0}f.prototype.eventNames=function(){var h=[],v,p;if(this._eventsCount===0)return h;for(p in v=this._events)t.call(v,p)&&h.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(v)):h},f.prototype.listeners=function(h){var v=n?n+h:h,p=this._events[v];if(!p)return[];if(p.fn)return[p.fn];for(var b=0,x=p.length,O=new Array(x);b{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),R7=QT.reducer,{createEventEmitter:L7}=QT.actions;function $7(e){return e.tooltip.syncInteraction}var U7={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},WT=hn({name:"chartData",initialState:U7,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:a}=t.payload;n!=null&&(e.dataStartIndex=n),a!=null&&(e.dataEndIndex=a)}}}),{setChartData:SO,setDataStartEndIndexes:q7,setComputedData:KG}=WT.actions,B7=WT.reducer,I7=["x","y"];function wO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function pl(e){for(var t=1;td.rootProps.className);S.useEffect(()=>{if(e==null)return _o;var d=(h,v,p)=>{if(t!==p&&e===h){if(a==="index"){var b;if(c&&v!==null&&v!==void 0&&(b=v.payload)!==null&&b!==void 0&&b.coordinate&&v.payload.sourceViewBox){var x=v.payload.coordinate,{x:O,y:j}=x,_=G7(x,I7),{x:N,y:E,width:T,height:P}=v.payload.sourceViewBox,C=pl(pl({},_),{},{x:c.x+(T?(O-N)/T:0)*c.width,y:c.y+(P?(j-E)/P:0)*c.height});n(pl(pl({},v),{},{payload:pl(pl({},v.payload),{},{coordinate:C})}))}else n(v);return}if(l!=null){var M;if(typeof a=="function"){var L={activeTooltipIndex:v.payload.index==null?void 0:Number(v.payload.index),isTooltipActive:v.payload.active,activeIndex:v.payload.index==null?void 0:Number(v.payload.index),activeLabel:v.payload.label,activeDataKey:v.payload.dataKey,activeCoordinate:v.payload.coordinate},Z=a(l,L);M=l[Z]}else a==="value"&&(M=l.find(H=>String(H.value)===v.payload.label));var{coordinate:re}=v.payload;if(M==null||v.payload.active===!1||re==null||c==null){n(p0({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:B,y:U}=re,K=Math.min(B,c.x+c.width),ce=Math.min(U,c.y+c.height),ue={x:o==="horizontal"?M.coordinate:K,y:o==="horizontal"?ce:M.coordinate},ve=p0({active:v.payload.active,coordinate:ue,dataKey:v.payload.dataKey,index:String(M.index),label:v.payload.label,sourceViewBox:v.payload.sourceViewBox,graphicalItemId:v.payload.graphicalItemId});n(ve)}}};return So.on(b0,d),()=>{So.off(b0,d)}},[f,n,t,e,a,l,o,c])}function F7(){var e=de($y),t=de(Uy),n=Qe();S.useEffect(()=>{if(e==null)return _o;var a=(l,o,c)=>{t!==c&&e===l&&n(q7(o))};return So.on(xO,a),()=>{So.off(xO,a)}},[n,t,e])}function Z7(){var e=Qe();S.useEffect(()=>{e(L7())},[e]),X7(),F7()}function Q7(e,t,n,a,l,o){var c=de(x=>a7(x,e,t)),f=de(Uy),d=de($y),h=de(KN),v=de($7),p=v?.active,b=Xf();S.useEffect(()=>{if(!p&&d!=null&&f!=null){var x=p0({active:o,coordinate:n,dataKey:c,index:l,label:typeof a=="number"?String(a):a,sourceViewBox:b,graphicalItemId:void 0});So.emit(b0,d,x,f)}},[p,n,c,l,a,f,d,h,o,b])}function jO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function OO(e){for(var t=1;t{L(W$({shared:E,trigger:T,axisId:M,active:l,defaultIndex:Z}))},[L,E,T,M,l,Z]);var re=Xf(),B=UE(),U=G$(E),{activeIndex:K,isActive:ce}=(t=de(he=>u7(he,U,T,Z)))!==null&&t!==void 0?t:{},ue=de(he=>l7(he,U,T,Z)),ve=de(he=>VT(he,U,T,Z)),H=de(he=>i7(he,U,T,Z)),ee=ue,z=C7(),G=(n=l??ce)!==null&&n!==void 0?n:!1,[ne,k]=qA([ee,G]),F=U==="axis"?ve:void 0;Q7(U,T,H,F,K,G);var ie=C??z;if(ie==null||re==null||U==null)return null;var le=ee??_O;G||(le=_O),h&&le.length&&(le=zA(le.filter(he=>he.value!=null&&(he.hide!==!0||a.includeHidden)),b,tq));var ye=le.length>0,be=S.createElement(KR,{allowEscapeViewBox:o,animationDuration:c,animationEasing:f,isAnimationActive:v,active:G,coordinate:H,hasPayload:ye,offset:p,position:x,reverseDirection:O,useTranslate3d:j,viewBox:re,wrapperStyle:_,lastBoundingBox:ne,innerRef:k,hasPortalFromProps:!!C},nq(d,OO(OO({},a),{},{payload:le,label:F,active:G,activeIndex:K,coordinate:H,accessibilityLayer:B})));return S.createElement(S.Fragment,null,U0.createPortal(be,ie),G&&S.createElement(M7,{cursor:N,tooltipEventType:U,coordinate:H,payload:le,index:K}))}var yd=e=>null;yd.displayName="Cell";function aq(e,t,n){return(t=iq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iq(e){var t=lq(e,"string");return typeof t=="symbol"?t:t+""}function lq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class uq{constructor(t){aq(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 a=this.cache.keys().next().value;a!=null&&this.cache.delete(a)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function AO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function oq(e){for(var t=1;t{try{var n=document.getElementById(NO);n||(n=document.createElement("span"),n.setAttribute("id",NO),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,hq,t),n.textContent="".concat(e);var a=n.getBoundingClientRect();return{width:a.width,height:a.height}}catch{return{width:0,height:0}}},no=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Jf.isSsr)return{width:0,height:0};if(!JT.enableCache)return TO(t,n);var a=mq(t,n),l=EO.get(a);if(l)return l;var o=TO(t,n);return EO.set(a,o),o},eM;function vq(e,t,n){return(t=pq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pq(e){var t=yq(e,"string");return typeof t=="symbol"?t:t+""}function yq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,CO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,gq=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,bq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,xq={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Sq=["cm","mm","pt","pc","in","Q","px"];function wq(e){return Sq.includes(e)}var xl="NaN";function jq(e,t){return e*xq[t]}class Gt{static parse(t){var n,[,a,l]=(n=bq.exec(t))!==null&&n!==void 0?n:[];return a==null?Gt.NaN:new Gt(parseFloat(a),l??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,vr(t)&&(this.unit=""),n!==""&&!gq.test(n)&&(this.num=NaN,this.unit=""),wq(n)&&(this.num=jq(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Gt(NaN,""):new Gt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return vr(this.num)}}eM=Gt;vq(Gt,"NaN",new eM(NaN,""));function tM(e){if(e==null||e.includes(xl))return xl;for(var t=e;t.includes("*")||t.includes("/");){var n,[,a,l,o]=(n=MO.exec(t))!==null&&n!==void 0?n:[],c=Gt.parse(a??""),f=Gt.parse(o??""),d=l==="*"?c.multiply(f):c.divide(f);if(d.isNaN())return xl;t=t.replace(MO,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,v,p,b]=(h=CO.exec(t))!==null&&h!==void 0?h:[],x=Gt.parse(v??""),O=Gt.parse(b??""),j=p==="+"?x.add(O):x.subtract(O);if(j.isNaN())return xl;t=t.replace(CO,j.toString())}return t}var DO=/\(([^()]*)\)/;function Oq(e){for(var t=e,n;(n=DO.exec(t))!=null;){var[,a]=n;t=t.replace(DO,tM(a))}return t}function _q(e){var t=e.replace(/\s+/g,"");return t=Oq(t),t=tM(t),t}function Aq(e){try{return _q(e)}catch{return xl}}function fp(e){var t=Aq(e.slice(5,-1));return t===xl?"":t}var Eq=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Nq=["dx","dy","angle","className","breakAll"];function x0(){return x0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:a}=e;try{var l=[];_t(t)||(n?l=t.toString().split(""):l=t.toString().split(nM));var o=l.map(f=>({word:f,width:no(f,a).width})),c=n?0:no(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}};function Mq(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var aM=(e,t,n,a)=>e.reduce((l,o)=>{var{word:c,width:f}=o,d=l[l.length-1];if(d&&f!=null&&(t==null||a||d.width+f+ne.reduce((t,n)=>t.width>n.width?t:n),Cq="…",PO=(e,t,n,a,l,o,c,f)=>{var d=e.slice(0,t),h=rM({breakAll:n,style:a,children:d+Cq});if(!h)return[!1,[]];var v=aM(h.wordsWithComputedWidth,o,c,f),p=v.length>l||iM(v).width>Number(o);return[p,v]},Dq=(e,t,n,a,l)=>{var{maxLines:o,children:c,style:f,breakAll:d}=e,h=me(o),v=String(c),p=aM(t,a,n,l);if(!h||l)return p;var b=p.length>o||iM(p).width>Number(a);if(!b)return p;for(var x=0,O=v.length-1,j=0,_;x<=O&&j<=v.length-1;){var N=Math.floor((x+O)/2),E=N-1,[T,P]=PO(v,E,d,f,o,a,n,l),[C]=PO(v,N,d,f,o,a,n,l);if(!T&&!C&&(x=N+1),T&&C&&(O=N-1),!T&&C){_=P;break}j++}return _||p},zO=e=>{var t=_t(e)?[]:e.toString().split(nM);return[{words:t,width:void 0}]},kq=e=>{var{width:t,scaleToFit:n,children:a,style:l,breakAll:o,maxLines:c}=e;if((t||n)&&!Jf.isSsr){var f,d,h=rM({breakAll:o,children:a,style:l});if(h){var{wordsWithComputedWidth:v,spaceWidth:p}=h;f=v,d=p}else return zO(a);return Dq({breakAll:o,children:a,maxLines:c,style:l},f,d,t,!!n)}return zO(a)},lM="#808080",Pq={angle:0,breakAll:!1,capHeight:"0.71em",fill:lM,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},gd=S.forwardRef((e,t)=>{var n=At(e,Pq),{x:a,y:l,lineHeight:o,capHeight:c,fill:f,scaleToFit:d,textAnchor:h,verticalAnchor:v}=n,p=kO(n,Eq),b=S.useMemo(()=>kq({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:d,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,d,p.style,p.width]),{dx:x,dy:O,angle:j,className:_,breakAll:N}=p,E=kO(p,Nq);if(!pr(a)||!pr(l)||b.length===0)return null;var T=Number(a)+(me(x)?x:0),P=Number(l)+(me(O)?O:0);if(!wt(T)||!wt(P))return null;var C;switch(v){case"start":C=fp("calc(".concat(c,")"));break;case"middle":C=fp("calc(".concat((b.length-1)/2," * -").concat(o," + (").concat(c," / 2))"));break;default:C=fp("calc(".concat(b.length-1," * -").concat(o,")"));break}var M=[];if(d){var L=b[0].width,{width:Z}=p;M.push("scale(".concat(me(Z)&&me(L)?Z/L:1,")"))}return j&&M.push("rotate(".concat(j,", ").concat(T,", ").concat(P,")")),M.length&&(E.transform=M.join(" ")),S.createElement("text",x0({},tn(E),{ref:t,x:T,y:P,className:Re("recharts-text",_),textAnchor:h,fill:f.includes("url")?lM:f}),b.map((re,B)=>{var U=re.words.join(N?"":" ");return S.createElement("tspan",{x:T,dy:B===0?C:o,key:"".concat(U,"-").concat(B)},U)}))});gd.displayName="Text";var zq=["labelRef"],Rq=["content"];function RO(e,t){if(e==null)return{};var n,a,l=Lq(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{x:t,y:n,upperWidth:a,lowerWidth:l,width:o,height:c,children:f}=e,d=S.useMemo(()=>({x:t,y:n,upperWidth:a,lowerWidth:l,width:o,height:c}),[t,n,a,l,o,c]);return S.createElement(uM.Provider,{value:d},f)},oM=()=>{var e=S.useContext(uM),t=Xf();return e||AE(t)},Iq=S.createContext(null),Hq=()=>{var e=S.useContext(Iq),t=de(FN);return e||t},Kq=e=>{var{value:t,formatter:n}=e,a=_t(e.children)?t:e.children;return typeof n=="function"?n(a):a},xg=e=>e!=null&&typeof e=="function",Yq=(e,t)=>{var n=Wt(t-e),a=Math.min(Math.abs(t-e),360);return n*a},Gq=(e,t,n,a,l)=>{var{offset:o,className:c}=e,{cx:f,cy:d,innerRadius:h,outerRadius:v,startAngle:p,endAngle:b,clockWise:x}=l,O=(h+v)/2,j=Yq(p,b),_=j>=0?1:-1,N,E;switch(t){case"insideStart":N=p+_*o,E=x;break;case"insideEnd":N=b-_*o,E=!x;break;case"end":N=b+_*o,E=x;break;default:throw new Error("Unsupported position ".concat(t))}E=j<=0?E:!E;var T=xt(f,d,O,N),P=xt(f,d,O,N+(E?1:-1)*359),C="M".concat(T.x,",").concat(T.y,` + A`).concat(O,",").concat(O,",0,1,").concat(E?0:1,`, + `).concat(P.x,",").concat(P.y),M=_t(e.id)?uo("recharts-radial-line-"):e.id;return S.createElement("text",qr({},a,{dominantBaseline:"central",className:Re("recharts-radial-bar-label",c)}),S.createElement("defs",null,S.createElement("path",{id:M,d:C})),S.createElement("textPath",{xlinkHref:"#".concat(M)},n))},Vq=(e,t,n)=>{var{cx:a,cy:l,innerRadius:o,outerRadius:c,startAngle:f,endAngle:d}=e,h=(f+d)/2;if(n==="outside"){var{x:v,y:p}=xt(a,l,c+t,h);return{x:v,y:p,textAnchor:v>=a?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"end"};var b=(o+c)/2,{x,y:O}=xt(a,l,b,h);return{x,y:O,textAnchor:"middle",verticalAnchor:"middle"}},S0=e=>"cx"in e&&me(e.cx),Xq=(e,t)=>{var{parentViewBox:n,offset:a,position:l}=e,o;n!=null&&!S0(n)&&(o=n);var{x:c,y:f,upperWidth:d,lowerWidth:h,height:v}=t,p=c,b=c+(d-h)/2,x=(p+b)/2,O=(d+h)/2,j=p+d/2,_=v>=0?1:-1,N=_*a,E=_>0?"end":"start",T=_>0?"start":"end",P=d>=0?1:-1,C=P*a,M=P>0?"end":"start",L=P>0?"start":"end";if(l==="top"){var Z={x:p+d/2,y:f-N,textAnchor:"middle",verticalAnchor:E};return mt(mt({},Z),o?{height:Math.max(f-o.y,0),width:d}:{})}if(l==="bottom"){var re={x:b+h/2,y:f+v+N,textAnchor:"middle",verticalAnchor:T};return mt(mt({},re),o?{height:Math.max(o.y+o.height-(f+v),0),width:h}:{})}if(l==="left"){var B={x:x-C,y:f+v/2,textAnchor:M,verticalAnchor:"middle"};return mt(mt({},B),o?{width:Math.max(B.x-o.x,0),height:v}:{})}if(l==="right"){var U={x:x+O+C,y:f+v/2,textAnchor:L,verticalAnchor:"middle"};return mt(mt({},U),o?{width:Math.max(o.x+o.width-U.x,0),height:v}:{})}var K=o?{width:O,height:v}:{};return l==="insideLeft"?mt({x:x+C,y:f+v/2,textAnchor:L,verticalAnchor:"middle"},K):l==="insideRight"?mt({x:x+O-C,y:f+v/2,textAnchor:M,verticalAnchor:"middle"},K):l==="insideTop"?mt({x:p+d/2,y:f+N,textAnchor:"middle",verticalAnchor:T},K):l==="insideBottom"?mt({x:b+h/2,y:f+v-N,textAnchor:"middle",verticalAnchor:E},K):l==="insideTopLeft"?mt({x:p+C,y:f+N,textAnchor:L,verticalAnchor:T},K):l==="insideTopRight"?mt({x:p+d-C,y:f+N,textAnchor:M,verticalAnchor:T},K):l==="insideBottomLeft"?mt({x:b+C,y:f+v-N,textAnchor:L,verticalAnchor:E},K):l==="insideBottomRight"?mt({x:b+h-C,y:f+v-N,textAnchor:M,verticalAnchor:E},K):l&&typeof l=="object"&&(me(l.x)||Yr(l.x))&&(me(l.y)||Yr(l.y))?mt({x:c+Nn(l.x,O),y:f+Nn(l.y,v),textAnchor:"end",verticalAnchor:"end"},K):mt({x:j,y:f+v/2,textAnchor:"middle",verticalAnchor:"middle"},K)},Fq={angle:0,offset:5,zIndex:Vt.label,position:"middle",textBreakAll:!1};function Ca(e){var t=At(e,Fq),{viewBox:n,position:a,value:l,children:o,content:c,className:f="",textBreakAll:d,labelRef:h}=t,v=Hq(),p=oM(),b=a==="center"?p:v??p,x,O,j;if(n==null?x=b:S0(n)?x=n:x=AE(n),!x||_t(l)&&_t(o)&&!S.isValidElement(c)&&typeof c!="function")return null;var _=mt(mt({},t),{},{viewBox:x});if(S.isValidElement(c)){var{labelRef:N}=_,E=RO(_,zq);return S.cloneElement(c,E)}if(typeof c=="function"){var{content:T}=_,P=RO(_,Rq);if(O=S.createElement(c,P),S.isValidElement(O))return O}else O=Kq(t);var C=tn(t);if(S0(x)){if(a==="insideStart"||a==="insideEnd"||a==="end")return Gq(t,a,O,C,x);j=Vq(x,t.offset,t.position)}else j=Xq(t,x);return S.createElement(ir,{zIndex:t.zIndex},S.createElement(gd,qr({ref:h,className:Re("recharts-label",f)},C,j,{textAnchor:Mq(C.textAnchor)?C.textAnchor:j.textAnchor,breakAll:d}),O))}Ca.displayName="Label";var Zq=(e,t,n)=>{if(!e)return null;var a={viewBox:t,labelRef:n};return e===!0?S.createElement(Ca,qr({key:"label-implicit"},a)):pr(e)?S.createElement(Ca,qr({key:"label-implicit",value:e},a)):S.isValidElement(e)?e.type===Ca?S.cloneElement(e,mt({key:"label-implicit"},a)):S.createElement(Ca,qr({key:"label-implicit",content:e},a)):xg(e)?S.createElement(Ca,qr({key:"label-implicit",content:e},a)):e&&typeof e=="object"?S.createElement(Ca,qr({},e,{key:"label-implicit"},a)):null};function Qq(e){var{label:t,labelRef:n}=e,a=oM();return Zq(t,a,n)||null}var dp={},hp={},$O;function Wq(){return $O||($O=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(hp)),hp}var mp={},UO;function Jq(){return UO||(UO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(mp)),mp}var qO;function eB(){return qO||(qO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wq(),n=Jq(),a=F0();function l(o){if(a.isArrayLike(o))return t.last(n.toArray(o))}e.last=l})(dp)),dp}var vp,BO;function tB(){return BO||(BO=1,vp=eB().last),vp}var nB=tB();const rB=Qr(nB);var aB=["valueAccessor"],iB=["dataKey","clockWise","id","textBreakAll","zIndex"];function wf(){return wf=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?rB(e.value):e.value,sM=S.createContext(void 0),oB=sM.Provider,cM=S.createContext(void 0),sB=cM.Provider;function cB(){return S.useContext(sM)}function fB(){return S.useContext(cM)}function Cc(e){var{valueAccessor:t=uB}=e,n=IO(e,aB),{dataKey:a,clockWise:l,id:o,textBreakAll:c,zIndex:f}=n,d=IO(n,iB),h=cB(),v=fB(),p=h||v;return!p||!p.length?null:S.createElement(ir,{zIndex:f??Vt.label},S.createElement(dn,{className:"recharts-label-list"},p.map((b,x)=>{var O,j=_t(a)?t(b,x):tt(b&&b.payload,a),_=_t(o)?{}:{id:"".concat(o,"-").concat(x)};return S.createElement(Ca,wf({key:"label-".concat(x)},tn(b),d,_,{fill:(O=n.fill)!==null&&O!==void 0?O:b.fill,parentViewBox:b.parentViewBox,value:j,textBreakAll:c,viewBox:b.viewBox,index:x,zIndex:0}))})))}Cc.displayName="LabelList";function fM(e){var{label:t}=e;return t?t===!0?S.createElement(Cc,{key:"labelList-implicit"}):S.isValidElement(t)||xg(t)?S.createElement(Cc,{key:"labelList-implicit",content:t}):typeof t=="object"?S.createElement(Cc,wf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function w0(){return w0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r:a,className:l}=e,o=Re("recharts-dot",l);return me(t)&&me(n)&&me(a)?S.createElement("circle",w0({},Gn(e),V0(e),{className:o,cx:t,cy:n,r:a})):null},hM=e=>e.graphicalItems.polarItems,dB=V([it,Ro],Yy),bd=V([hM,lt,dB],Gy),hB=V([bd],Vy),xd=V([hB,ky],Xy),mB=V([xd,lt,bd],Zy);V([xd,lt,bd],(e,t,n)=>n.length>0?e.flatMap(a=>n.flatMap(l=>{var o,c=tt(a,(o=t.dataKey)!==null&&o!==void 0?o:l.dataKey);return{value:c,errorDomain:[]}})).filter(Boolean):t?.dataKey!=null?e.map(a=>({value:tt(a,t.dataKey),errorDomain:[]})):e.map(a=>({value:a,errorDomain:[]})));var HO=()=>{},vB=V([xd,lt,bd,hd,it],eg),pB=V([lt,Wy,Jy,HO,vB,HO,Ge,it],tg),mM=V([lt,Ge,xd,mB,zo,it,pB],ng),yB=V([mM,lt,ql],ig);V([lt,mM,yB,it],ug);var gB={radiusAxis:{},angleAxis:{}},vM=hn({name:"polarAxis",initialState:gB,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:YG,removeRadiusAxis:GG,addAngleAxis:VG,removeAngleAxis:XG}=vM.actions,bB=vM.reducer;function KO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function YO(e){for(var t=1;tt,Sg=V([hM,jB],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),OB=[],wg=(e,t,n)=>n?.length===0?OB:n,pM=V([ky,Sg,wg],(e,t,n)=>{var{chartData:a}=e;if(t!=null){var l;if(t?.data!=null&&t.data.length>0?l=t.data:l=a,(!l||!l.length)&&n!=null&&(l=n.map(o=>YO(YO({},t.presentationProps),o.props))),l!=null)return l}}),_B=V([pM,Sg,wg],(e,t,n)=>{if(!(e==null||t==null))return e.map((a,l)=>{var o,c=tt(a,t.nameKey,t.name),f;return n!=null&&(o=n[l])!==null&&o!==void 0&&(o=o.props)!==null&&o!==void 0&&o.fill?f=n[l].props.fill:typeof a=="object"&&a!=null&&"fill"in a?f=a.fill:f=t.fill,{value:Hf(c,t.dataKey),color:f,payload:a,type:t.legendType}})}),AB=V([pM,Sg,wg,zt],(e,t,n,a)=>{if(!(t==null||e==null))return kI({offset:a,pieSettings:t,displayedData:e,cells:n})}),pp={exports:{}},Ye={};var GO;function EB(){if(GO)return Ye;GO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function O(j){if(typeof j=="object"&&j!==null){var _=j.$$typeof;switch(_){case e:switch(j=j.type,j){case n:case l:case a:case d:case h:case b:return j;default:switch(j=j&&j.$$typeof,j){case c:case f:case p:case v:return j;case o:return j;default:return _}}case t:return _}}}return Ye.ContextConsumer=o,Ye.ContextProvider=c,Ye.Element=e,Ye.ForwardRef=f,Ye.Fragment=n,Ye.Lazy=p,Ye.Memo=v,Ye.Portal=t,Ye.Profiler=l,Ye.StrictMode=a,Ye.Suspense=d,Ye.SuspenseList=h,Ye.isContextConsumer=function(j){return O(j)===o},Ye.isContextProvider=function(j){return O(j)===c},Ye.isElement=function(j){return typeof j=="object"&&j!==null&&j.$$typeof===e},Ye.isForwardRef=function(j){return O(j)===f},Ye.isFragment=function(j){return O(j)===n},Ye.isLazy=function(j){return O(j)===p},Ye.isMemo=function(j){return O(j)===v},Ye.isPortal=function(j){return O(j)===t},Ye.isProfiler=function(j){return O(j)===l},Ye.isStrictMode=function(j){return O(j)===a},Ye.isSuspense=function(j){return O(j)===d},Ye.isSuspenseList=function(j){return O(j)===h},Ye.isValidElementType=function(j){return typeof j=="string"||typeof j=="function"||j===n||j===l||j===a||j===d||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===p||j.$$typeof===v||j.$$typeof===c||j.$$typeof===o||j.$$typeof===f||j.$$typeof===x||j.getModuleId!==void 0)},Ye.typeOf=O,Ye}var VO;function NB(){return VO||(VO=1,pp.exports=EB()),pp.exports}var TB=NB(),XO=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",FO=null,yp=null,yM=e=>{if(e===FO&&Array.isArray(yp))return yp;var t=[];return S.Children.forEach(e,n=>{_t(n)||(TB.isFragment(n)?t=t.concat(yM(n.props.children)):t.push(n))}),yp=t,FO=e,t};function gM(e,t){var n=[],a=[];return Array.isArray(t)?a=t.map(l=>XO(l)):a=[XO(t)],yM(e).forEach(l=>{var o=xi(l,"type.displayName")||xi(l,"type.name");o&&a.indexOf(o)!==-1&&n.push(l)}),n}var bM=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,gp={},ZO;function MB(){return ZO||(ZO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const l=n[Symbol.toStringTag];return l==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${l}]`}let a=n;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(n)===a}e.isPlainObject=t})(gp)),gp}var bp,QO;function CB(){return QO||(QO=1,bp=MB().isPlainObject),bp}var DB=CB();const kB=Qr(DB);var WO,JO,e_,t_,n_;function r_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function a_(e){for(var t=1;t{var o=n-a,c;return c=ct(WO||(WO=Vu(["M ",",",""])),e,t),c+=ct(JO||(JO=Vu(["L ",",",""])),e+n,t),c+=ct(e_||(e_=Vu(["L ",",",""])),e+n-o/2,t+l),c+=ct(t_||(t_=Vu(["L ",",",""])),e+n-o/2-a,t+l),c+=ct(n_||(n_=Vu(["L ",","," Z"])),e,t),c},LB={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$B=e=>{var t=At(e,LB),{x:n,y:a,upperWidth:l,lowerWidth:o,height:c,className:f}=t,{animationEasing:d,animationDuration:h,animationBegin:v,isUpdateAnimationActive:p}=t,b=S.useRef(null),[x,O]=S.useState(-1),j=S.useRef(l),_=S.useRef(o),N=S.useRef(c),E=S.useRef(n),T=S.useRef(a),P=td(e,"trapezoid-");if(S.useEffect(()=>{if(b.current&&b.current.getTotalLength)try{var ue=b.current.getTotalLength();ue&&O(ue)}catch{}},[]),n!==+n||a!==+a||l!==+l||o!==+o||c!==+c||l===0&&o===0||c===0)return null;var C=Re("recharts-trapezoid",f);if(!p)return S.createElement("g",null,S.createElement("path",jf({},tn(t),{className:C,d:i_(n,a,l,o,c)})));var M=j.current,L=_.current,Z=N.current,re=E.current,B=T.current,U="0px ".concat(x===-1?1:x,"px"),K="".concat(x,"px 0px"),ce=qE(["strokeDasharray"],h,d);return S.createElement(ed,{animationId:P,key:P,canBegin:x>0,duration:h,easing:d,isActive:p,begin:v},ue=>{var ve=Qt(M,l,ue),H=Qt(L,o,ue),ee=Qt(Z,c,ue),z=Qt(re,n,ue),G=Qt(B,a,ue);b.current&&(j.current=ve,_.current=H,N.current=ee,E.current=z,T.current=G);var ne=ue>0?{transition:ce,strokeDasharray:K}:{strokeDasharray:U};return S.createElement("path",jf({},tn(t),{className:C,d:i_(z,G,ve,H,ee),ref:b,style:a_(a_({},ne),t.style)}))})},UB=["option","shapeType","activeClassName"];function qB(e,t){if(e==null)return{};var n,a,l=BB(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(NT({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}},FB=e=>{var t=Qe();return(n,a)=>l=>{e?.(n,a,l),t(J$())}},ZB=(e,t,n)=>{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(eU({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}};function SM(e){var{tooltipEntrySettings:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(F$(t)):l.current!==t&&n(Z$({prev:l.current,next:t})),l.current=t)},[t,n,a]),S.useLayoutEffect(()=>()=>{l.current&&(n(Q$(l.current)),l.current=null)},[n]),null}function QB(e){var{legendPayload:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(zE(t)):l.current!==t&&n(RE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n(LE(l.current)),l.current=null)},[n]),null}function WB(e){var{legendPayload:t}=e,n=Qe(),a=de(Ge),l=S.useRef(null);return S.useLayoutEffect(()=>{a!=="centric"&&a!=="radial"||(l.current===null?n(zE(t)):l.current!==t&&n(RE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n(LE(l.current)),l.current=null)},[n]),null}var xp,JB=()=>{var[e]=S.useState(()=>uo("uid-"));return e},eI=(xp=T4.useId)!==null&&xp!==void 0?xp:JB;function tI(e,t){var n=eI();return t||(e?"".concat(e,"-").concat(n):n)}var nI=S.createContext(void 0),wM=e=>{var{id:t,type:n,children:a}=e,l=tI("recharts-".concat(n),t);return S.createElement(nI.Provider,{value:l},a(l))},rI={cartesianItems:[],polarItems:[]},jM=hn({name:"graphicalItems",initialState:rI,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:rt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).cartesianItems.indexOf(n);l>-1&&(e.cartesianItems[l]=a)},prepare:rt()},removeCartesianGraphicalItem:{reducer(e,t){var n=nr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:rt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:rt()},removePolarGraphicalItem:{reducer(e,t){var n=nr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:rt()}}}),{addCartesianGraphicalItem:aI,replaceCartesianGraphicalItem:iI,removeCartesianGraphicalItem:lI,addPolarGraphicalItem:uI,removePolarGraphicalItem:oI}=jM.actions,sI=jM.reducer,cI=e=>{var t=Qe(),n=S.useRef(null);return S.useLayoutEffect(()=>{n.current===null?t(aI(e)):n.current!==e&&t(iI({prev:n.current,next:e})),n.current=e},[t,e]),S.useLayoutEffect(()=>()=>{n.current&&(t(lI(n.current)),n.current=null)},[t]),null},fI=S.memo(cI);function dI(e){var t=Qe();return S.useLayoutEffect(()=>(t(uI(e)),()=>{t(oI(e))}),[t,e]),null}var hI=["key"],mI=["onMouseEnter","onClick","onMouseLeave"],vI=["id"],pI=["id"];function o_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function ft(e){for(var t=1;tgM(e.children,yd),[e.children]),n=de(a=>_B(a,e.id,t));return n==null?null:S.createElement(WB,{legendPayload:n})}var wI=S.memo(e=>{var{dataKey:t,nameKey:n,sectors:a,stroke:l,strokeWidth:o,fill:c,name:f,hide:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:a.map(b=>b.tooltipPayload),positions:a.map(b=>b.tooltipPosition),settings:{stroke:l,strokeWidth:o,fill:c,dataKey:t,nameKey:n,name:Hf(f,t),hide:d,type:h,color:c,unit:"",graphicalItemId:v}};return S.createElement(SM,{tooltipEntrySettings:p})}),jI=(e,t)=>e>t?"start":eNn(typeof t=="function"?t(e):t,n,n*.8),_I=(e,t,n)=>{var{top:a,left:l,width:o,height:c}=t,f=YE(o,c),d=l+Nn(e.cx,o,o/2),h=a+Nn(e.cy,c,c/2),v=Nn(e.innerRadius,f,0),p=OI(n,e.outerRadius,f),b=e.maxRadius||Math.sqrt(o*o+c*c)/2;return{cx:d,cy:h,innerRadius:v,outerRadius:p,maxRadius:b}},AI=(e,t)=>{var n=Wt(t-e),a=Math.min(Math.abs(t-e),360);return n*a};function EI(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var NI=(e,t)=>{if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Re("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:a}=t,l=Sd(t,hI);return S.createElement(sy,$a({},l,{type:"linear",className:n}))},TI=(e,t,n)=>{if(S.isValidElement(e))return S.cloneElement(e,t);var a=n;if(typeof e=="function"&&(a=e(t),S.isValidElement(a)))return a;var l=Re("recharts-pie-label-text",EI(e));return S.createElement(gd,$a({},t,{alignmentBaseline:"middle",className:l}),a)};function MI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l,labelLine:o,dataKey:c}=n;if(!a||!l||!t)return null;var f=Gn(n),d=_l(l),h=_l(o),v=typeof l=="object"&&"offsetRadius"in l&&typeof l.offsetRadius=="number"&&l.offsetRadius||20,p=t.map((b,x)=>{var O=(b.startAngle+b.endAngle)/2,j=xt(b.cx,b.cy,b.outerRadius+v,O),_=ft(ft(ft(ft({},f),b),{},{stroke:"none"},d),{},{index:x,textAnchor:jI(j.x,b.cx)},j),N=ft(ft(ft(ft({},f),b),{},{fill:"none",stroke:b.fill},h),{},{index:x,points:[xt(b.cx,b.cy,b.outerRadius,O),j],key:"line"});return S.createElement(ir,{zIndex:Vt.label,key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},S.createElement(dn,null,o&&NI(o,N),TI(l,_,tt(b,c))))});return S.createElement(dn,{className:"recharts-pie-labels"},p)}function CI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l}=n;return typeof l=="object"&&l!=null&&"position"in l?S.createElement(fM,{label:l}):S.createElement(MI,{sectors:t,props:n,showLabels:a})}function DI(e){var{sectors:t,activeShape:n,inactiveShape:a,allOtherPieProps:l,shape:o,id:c}=e,f=de(Dl),d=de(IT),h=de(UU),{onMouseEnter:v,onClick:p,onMouseLeave:b}=l,x=Sd(l,mI),O=XB(v,l.dataKey,c),j=FB(b),_=ZB(p,l.dataKey,c);return t==null||t.length===0?null:S.createElement(S.Fragment,null,t.map((N,E)=>{if(N?.startAngle===0&&N?.endAngle===0&&t.length!==1)return null;var T=h==null||h===c,P=String(E)===f&&(d==null||l.dataKey===d)&&T,C=f?a:null,M=n&&P?n:C,L=ft(ft({},N),{},{stroke:N.stroke,tabIndex:-1,[xE]:E,[SE]:c});return S.createElement(dn,$a({key:"sector-".concat(N?.startAngle,"-").concat(N?.endAngle,"-").concat(N.midAngle,"-").concat(E),tabIndex:-1,className:"recharts-pie-sector"},X0(x,N,E),{onMouseEnter:O(N,E),onMouseLeave:j(N,E),onClick:_(N,E)}),S.createElement(xM,$a({option:o??M,index:E,shapeType:"sector",isActive:P},L)))}))}function kI(e){var t,{pieSettings:n,displayedData:a,cells:l,offset:o}=e,{cornerRadius:c,startAngle:f,endAngle:d,dataKey:h,nameKey:v,tooltipType:p}=n,b=Math.abs(n.minAngle),x=AI(f,d),O=Math.abs(x),j=a.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,_=a.filter(M=>tt(M,h,0)!==0).length,N=(O>=360?_:_-1)*j,E=O-_*b-N,T=a.reduce((M,L)=>{var Z=tt(L,h,0);return M+(me(Z)?Z:0)},0),P;if(T>0){var C;P=a.map((M,L)=>{var Z=tt(M,h,0),re=tt(M,v,L),B=_I(n,o,M),U=(me(Z)?Z:0)/T,K,ce=ft(ft({},M),l&&l[L]&&l[L].props);L?K=C.endAngle+Wt(x)*j*(Z!==0?1:0):K=f;var ue=K+Wt(x)*((Z!==0?b:0)+U*E),ve=(K+ue)/2,H=(B.innerRadius+B.outerRadius)/2,ee=[{name:re,value:Z,payload:ce,dataKey:h,type:p,graphicalItemId:n.id}],z=xt(B.cx,B.cy,H,ve);return C=ft(ft(ft(ft({},n.presentationProps),{},{percent:U,cornerRadius:typeof c=="string"?parseFloat(c):c,name:re,tooltipPayload:ee,midAngle:ve,middleRadius:H,tooltipPosition:z},ce),B),{},{value:Z,dataKey:h,startAngle:K,endAngle:ue,payload:ce,paddingAngle:Wt(x)*j}),C})}return P}function PI(e){var{showLabels:t,sectors:n,children:a}=e,l=S.useMemo(()=>!t||!n?[]:n.map(o=>({value:o.value,payload:o.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:o.cx,cy:o.cy,innerRadius:o.innerRadius,outerRadius:o.outerRadius,startAngle:o.startAngle,endAngle:o.endAngle,clockWise:!1},fill:o.fill})),[n,t]);return S.createElement(sB,{value:t?l:void 0},a)}function zI(e){var{props:t,previousSectorsRef:n,id:a}=e,{sectors:l,isAnimationActive:o,animationBegin:c,animationDuration:f,animationEasing:d,activeShape:h,inactiveShape:v,onAnimationStart:p,onAnimationEnd:b}=t,x=td(t,"recharts-pie-"),O=n.current,[j,_]=S.useState(!1),N=S.useCallback(()=>{typeof b=="function"&&b(),_(!1)},[b]),E=S.useCallback(()=>{typeof p=="function"&&p(),_(!0)},[p]);return S.createElement(PI,{showLabels:!j,sectors:l},S.createElement(ed,{animationId:x,begin:c,duration:f,isActive:o,easing:d,onAnimationStart:E,onAnimationEnd:N,key:x},T=>{var P=[],C=l&&l[0],M=C?.startAngle;return l?.forEach((L,Z)=>{var re=O&&O[Z],B=Z>0?xi(L,"paddingAngle",0):0;if(re){var U=Qt(re.endAngle-re.startAngle,L.endAngle-L.startAngle,T),K=ft(ft({},L),{},{startAngle:M+B,endAngle:M+U+B});P.push(K),M=K.endAngle}else{var{endAngle:ce,startAngle:ue}=L,ve=Qt(0,ce-ue,T),H=ft(ft({},L),{},{startAngle:M+B,endAngle:M+ve+B});P.push(H),M=H.endAngle}}),n.current=P,S.createElement(dn,null,S.createElement(DI,{sectors:P,activeShape:h,inactiveShape:v,allOtherPieProps:t,shape:t.shape,id:a}))}),S.createElement(CI,{showLabels:!j,sectors:l,props:t}),t.children)}var RI={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:Vt.area};function LI(e){var{id:t}=e,n=Sd(e,vI),{hide:a,className:l,rootTabIndex:o}=e,c=S.useMemo(()=>gM(e.children,yd),[e.children]),f=de(v=>AB(v,t,c)),d=S.useRef(null),h=Re("recharts-pie",l);return a||f==null?(d.current=null,S.createElement(dn,{tabIndex:o,className:h})):S.createElement(ir,{zIndex:e.zIndex},S.createElement(wI,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:f,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),S.createElement(dn,{tabIndex:o,className:h},S.createElement(zI,{props:ft(ft({},n),{},{sectors:f}),previousSectorsRef:d,id:t})))}function OM(e){var t=At(e,RI),{id:n}=t,a=Sd(t,pI),l=Gn(a);return S.createElement(wM,{id:n,type:"pie"},o=>S.createElement(S.Fragment,null,S.createElement(dI,{type:"pie",id:o,data:a.data,dataKey:a.dataKey,hide:a.hide,angleAxisId:0,radiusAxisId:0,name:a.name,nameKey:a.nameKey,tooltipType:a.tooltipType,legendType:a.legendType,fill:a.fill,cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,paddingAngle:a.paddingAngle,minAngle:a.minAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,cornerRadius:a.cornerRadius,presentationProps:l,maxRadius:t.maxRadius}),S.createElement(SI,$a({},a,{id:o})),S.createElement(LI,$a({},a,{id:o}))))}OM.displayName="Pie";var $I=["points"];function s_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Sp(e){for(var t=1;t{var _,N,E=Sp(Sp(Sp({r:3},c),p),{},{index:j,cx:(_=O.x)!==null&&_!==void 0?_:void 0,cy:(N=O.y)!==null&&N!==void 0?N:void 0,dataKey:o,value:O.value,payload:O.payload,points:t});return S.createElement(KI,{key:"dot-".concat(j),option:n,dotProps:E,className:l})}),x={};return f&&d!=null&&(x.clipPath="url(#clipPath-".concat(v?"":"dots-").concat(d,")")),S.createElement(ir,{zIndex:h},S.createElement(dn,_f({className:a},x),b))}function c_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function f_(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),lH=V([iH,Wr,Jr],(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)}}),jg=()=>de(lH),uH=()=>de(KU);function d_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function wp(e){for(var t=1;t{var{point:t,childIndex:n,mainColor:a,activeDot:l,dataKey:o,clipPath:c}=e;if(l===!1||t.x==null||t.y==null)return null;var f={index:n,dataKey:o,cx:t.x,cy:t.y,r:4,fill:a??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=wp(wp(wp({},f),_l(l)),V0(l)),h;return S.isValidElement(l)?h=S.cloneElement(l,d):typeof l=="function"?h=l(d):h=S.createElement(dM,d),S.createElement(dn,{className:"recharts-active-dot",clipPath:c},h)};function dH(e){var{points:t,mainColor:n,activeDot:a,itemDataKey:l,clipPath:o,zIndex:c=Vt.activeDot}=e,f=de(Dl),d=uH();if(t==null||d==null)return null;var h=t.find(v=>d.includes(v.payload));return _t(h)?null:S.createElement(ir,{zIndex:c},S.createElement(fH,{point:h,childIndex:Number(f),mainColor:n,dataKey:l,activeDot:a,clipPath:o}))}var AM=e=>{var{chartData:t}=e,n=Qe(),a=mn();return S.useEffect(()=>a?()=>{}:(n(SO(t)),()=>{n(SO(void 0))}),[t,n,a]),null},h_={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},EM=hn({name:"brush",initialState:h_,reducers:{setBrushSettings(e,t){return t.payload==null?h_:t.payload}}}),{setBrushSettings:WG}=EM.actions,hH=EM.reducer;function mH(e,t,n){return(t=vH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vH(e){var t=pH(e,"string");return typeof t=="symbol"?t:t+""}function pH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Og{static create(t){return new Og(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:n,position:a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(a)switch(a){case"start":return this.scale(t);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+l}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(t)+o}default:return this.scale(t)}if(n){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+c}return this.scale(t)}}isInRange(t){var n=this.range(),a=n[0],l=n[n.length-1];return a<=l?t>=a&&t<=l:t>=l&&t<=a}}mH(Og,"EPS",1e-4);function yH(e){return(e%180+180)%180}var gH=function(t){var{width:n,height:a}=t,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=yH(l),c=o*Math.PI/180,f=Math.atan(a/n),d=c>f&&c{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=nr(e).dots.findIndex(a=>a===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(a=>a===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(a=>a===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:JG,removeDot:eV,addArea:tV,removeArea:nV,addLine:rV,removeLine:aV}=NM.actions,xH=NM.reducer,SH=S.createContext(void 0),wH=e=>{var{children:t}=e,[n]=S.useState("".concat(uo("recharts"),"-clip")),a=jg();if(a==null)return null;var{x:l,y:o,width:c,height:f}=a;return S.createElement(SH.Provider,{value:n},S.createElement("defs",null,S.createElement("clipPath",{id:n},S.createElement("rect",{x:l,y:o,height:f,width:c}))),t)};function TM(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],a=0;ae*l)return!1;var o=n();return e*(t-e*o/2-a)>=0&&e*(t+e*o/2-l)<=0}function _H(e,t){return TM(e,t+1)}function AH(e,t,n,a,l){for(var o=(a||[]).slice(),{start:c,end:f}=t,d=0,h=1,v=c,p=function(){var O=a?.[d];if(O===void 0)return{v:TM(a,h)};var j=d,_,N=()=>(_===void 0&&(_=n(O,j)),_),E=O.coordinate,T=d===0||wo(e,E,N,v,f);T||(d=0,v=c,h+=1),T&&(v=E+e*(N()/2+l),d+=h)},b;h<=o.length;)if(b=p(),b)return b.v;return[]}function EH(e,t,n,a,l){var o=(a||[]).slice(),c=o.length;if(c===0)return[];for(var{start:f,end:d}=t,h=1;h<=c;h++){for(var v=(c-1)%h,p=f,b=!0,x=function(){var E=a[O],T=O,P,C=()=>(P===void 0&&(P=n(E,T)),P),M=E.coordinate,L=O===v||wo(e,M,C,p,d);if(!L)return b=!1,1;L&&(p=M+e*(C()/2+l))},O=v;O(O===void 0&&(O=n(x,b)),O);if(b===c-1){var _=e*(x.coordinate+e*j()/2-d);o[b]=x=Ft(Ft({},x),{},{tickCoord:_>0?x.coordinate-_*e:x.coordinate})}else o[b]=x=Ft(Ft({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var N=wo(e,x.tickCoord,j,f,d);N&&(d=x.tickCoord-e*(j()/2+l),o[b]=Ft(Ft({},x),{},{isShow:!0}))}},v=c-1;v>=0;v--)h(v);return o}function DH(e,t,n,a,l,o){var c=(a||[]).slice(),f=c.length,{start:d,end:h}=t;if(o){var v=a[f-1],p=n(v,f-1),b=e*(v.coordinate+e*p/2-h);if(c[f-1]=v=Ft(Ft({},v),{},{tickCoord:b>0?v.coordinate-b*e:v.coordinate}),v.tickCoord!=null){var x=wo(e,v.tickCoord,()=>p,d,h);x&&(h=v.tickCoord-e*(p/2+l),c[f-1]=Ft(Ft({},v),{},{isShow:!0}))}}for(var O=o?f-1:f,j=function(E){var T=c[E],P,C=()=>(P===void 0&&(P=n(T,E)),P);if(E===0){var M=e*(T.coordinate-e*C()/2-d);c[E]=T=Ft(Ft({},T),{},{tickCoord:M<0?T.coordinate-M*e:T.coordinate})}else c[E]=T=Ft(Ft({},T),{},{tickCoord:T.coordinate});if(T.tickCoord!=null){var L=wo(e,T.tickCoord,C,d,h);L&&(d=T.tickCoord+e*(C()/2+l),c[E]=Ft(Ft({},T),{},{isShow:!0}))}},_=0;_{var C=typeof h=="function"?h(T.value,P):T.value;return O==="width"?jH(no(C,{fontSize:t,letterSpacing:n}),j,p):no(C,{fontSize:t,letterSpacing:n})[O]},N=l.length>=2?Wt(l[1].coordinate-l[0].coordinate):1,E=OH(o,N,O);return d==="equidistantPreserveStart"?AH(N,E,_,l,c):d==="equidistantPreserveEnd"?EH(N,E,_,l,c):(d==="preserveStart"||d==="preserveStartEnd"?x=DH(N,E,_,l,c,d==="preserveStartEnd"):x=CH(N,E,_,l,c),x.filter(T=>T.isShow))}var kH=e=>{var{ticks:t,label:n,labelGapWithTick:a=5,tickSize:l=0,tickMargin:o=0}=e,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.width>c&&(c=p.width)}});var f=n?n.getBoundingClientRect().width:0,d=l+o,h=c+d+f+(n?a:0);return Math.round(h)}return 0},PH=["axisLine","width","height","className","hide","ticks","axisType"];function zH(e,t){if(e==null)return{};var n,a,l=RH(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{ticks:n=[],tick:a,tickLine:l,stroke:o,tickFormatter:c,unit:f,padding:d,tickTextProps:h,orientation:v,mirror:p,x:b,y:x,width:O,height:j,tickSize:_,tickMargin:N,fontSize:E,letterSpacing:T,getTicksConfig:P,events:C,axisType:M}=e,L=_g(bt(bt({},P),{},{ticks:n}),E,T),Z=IH(v,p),re=HH(v,p),B=Gn(P),U=_l(a),K={};typeof l=="object"&&(K=l);var ce=bt(bt({},B),{},{fill:"none"},K),ue=L.map(ee=>bt({entry:ee},BH(ee,b,x,O,j,v,_,p,N))),ve=ue.map(ee=>{var{entry:z,line:G}=ee;return S.createElement(dn,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(z.value,"-").concat(z.coordinate,"-").concat(z.tickCoord)},l&&S.createElement("line",_i({},ce,G,{className:Re("recharts-cartesian-axis-tick-line",xi(l,"className"))})))}),H=ue.map((ee,z)=>{var{entry:G,tick:ne}=ee,k=bt(bt(bt(bt({textAnchor:Z,verticalAnchor:re},B),{},{stroke:"none",fill:o},U),ne),{},{index:z,payload:G,visibleTicksCount:L.length,tickFormatter:c,padding:d},h);return S.createElement(dn,_i({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(G.value,"-").concat(G.coordinate,"-").concat(G.tickCoord)},X0(C,G,z)),a&&S.createElement(KH,{option:a,tickProps:k,value:"".concat(typeof c=="function"?c(G.value,z):G.value).concat(f||"")}))});return S.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(M,"-ticks")},H.length>0&&S.createElement(ir,{zIndex:Vt.label},S.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(M,"-tick-labels"),ref:t},H)),ve.length>0&&S.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(M,"-tick-lines")},ve))}),GH=S.forwardRef((e,t)=>{var{axisLine:n,width:a,height:l,className:o,hide:c,ticks:f,axisType:d}=e,h=zH(e,PH),[v,p]=S.useState(""),[b,x]=S.useState(""),O=S.useRef(null);S.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return kH({ticks:O.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=S.useCallback(_=>{if(_){var N=_.getElementsByClassName("recharts-cartesian-axis-tick-value");O.current=N;var E=N[0];if(E){var T=window.getComputedStyle(E),P=T.fontSize,C=T.letterSpacing;(P!==v||C!==b)&&(p(P),x(C))}}},[v,b]);return c||a!=null&&a<=0||l!=null&&l<=0?null:S.createElement(ir,{zIndex:e.zIndex},S.createElement(dn,{className:Re("recharts-cartesian-axis",o)},S.createElement(qH,{x:e.x,y:e.y,width:a,height:l,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Gn(e)}),S.createElement(YH,{ref:j,axisType:d,events:h,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:b,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:f,unit:e.unit,width:e.width,x:e.x,y:e.y}),S.createElement(Bq,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},S.createElement(Qq,{label:e.label,labelRef:e.labelRef}),e.children)))}),Ag=S.forwardRef((e,t)=>{var n=At(e,Kr);return S.createElement(GH,_i({},n,{ref:t}))});Ag.displayName="CartesianAxis";var VH=["x1","y1","x2","y2","key"],XH=["offset"],FH=["xAxisId","yAxisId"],ZH=["xAxisId","yAxisId"];function p_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Zt(e){for(var t=1;t{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:a,y:l,width:o,height:c,ry:f}=e;return S.createElement("rect",{x:a,y:l,ry:f,width:o,height:c,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function MM(e){var{option:t,lineItemProps:n}=e,a;if(S.isValidElement(t))a=S.cloneElement(t,n);else if(typeof t=="function")a=t(n);else{var l,{x1:o,y1:c,x2:f,y2:d,key:h}=n,v=Af(n,VH),p=(l=Gn(v))!==null&&l!==void 0?l:{},{offset:b}=p,x=Af(p,XH);a=S.createElement("line",vi({},x,{x1:o,y1:c,x2:f,y2:d,fill:"none",key:h}))}return a}function nK(e){var{x:t,width:n,horizontal:a=!0,horizontalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=Af(e,FH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(v),index:v});return S.createElement(MM,{key:"line-".concat(v),option:a,lineItemProps:p})});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function rK(e){var{y:t,height:n,vertical:a=!0,verticalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=Af(e,ZH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(v),index:v});return S.createElement(MM,{option:a,lineItemProps:p,key:"line-".concat(v)})});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function aK(e){var{horizontalFill:t,fillOpacity:n,x:a,y:l,width:o,height:c,horizontalPoints:f,horizontal:d=!0}=e;if(!d||!t||!t.length||f==null)return null;var h=f.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var j=b%t.length;return S.createElement("rect",{key:"react-".concat(b),y:p,x:a,height:O,width:o,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function iK(e){var{vertical:t=!0,verticalFill:n,fillOpacity:a,x:l,y:o,width:c,height:f,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var h=d.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var j=b%n.length;return S.createElement("rect",{key:"react-".concat(b),x:p,y:o,width:O,height:f,stroke:"none",fill:n[j],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var lK=(e,t)=>{var{xAxis:n,width:a,height:l,offset:o}=e;return yE(_g(Zt(Zt(Zt({},Kr),n),{},{ticks:gE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.left,o.left+o.width,t)},uK=(e,t)=>{var{yAxis:n,width:a,height:l,offset:o}=e;return yE(_g(Zt(Zt(Zt({},Kr),n),{},{ticks:gE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.top,o.top+o.height,t)},oK={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Vt.grid};function ro(e){var t=iy(),n=ly(),a=EE(),l=Zt(Zt({},At(e,oK)),{},{x:me(e.x)?e.x:a.left,y:me(e.y)?e.y:a.top,width:me(e.width)?e.width:a.width,height:me(e.height)?e.height:a.height}),{xAxisId:o,yAxisId:c,x:f,y:d,width:h,height:v,syncWithTicks:p,horizontalValues:b,verticalValues:x}=l,O=mn(),j=de(re=>sO(re,"xAxis",o,O)),_=de(re=>sO(re,"yAxis",c,O));if(!yr(h)||!yr(v)||!me(f)||!me(d))return null;var N=l.verticalCoordinatesGenerator||lK,E=l.horizontalCoordinatesGenerator||uK,{horizontalPoints:T,verticalPoints:P}=l;if((!T||!T.length)&&typeof E=="function"){var C=b&&b.length,M=E({yAxis:_?Zt(Zt({},_),{},{ticks:C?b:_.ticks}):void 0,width:t??h,height:n??v,offset:a},C?!0:p);Wc(Array.isArray(M),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(T=M)}if((!P||!P.length)&&typeof N=="function"){var L=x&&x.length,Z=N({xAxis:j?Zt(Zt({},j),{},{ticks:L?x:j.ticks}):void 0,width:t??h,height:n??v,offset:a},L?!0:p);Wc(Array.isArray(Z),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof Z,"]")),Array.isArray(Z)&&(P=Z)}return S.createElement(ir,{zIndex:l.zIndex},S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(tK,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),S.createElement(aK,vi({},l,{horizontalPoints:T})),S.createElement(iK,vi({},l,{verticalPoints:P})),S.createElement(nK,vi({},l,{offset:a,horizontalPoints:T,xAxis:j,yAxis:_})),S.createElement(rK,vi({},l,{offset:a,verticalPoints:P,xAxis:j,yAxis:_}))))}ro.displayName="CartesianGrid";var sK={},CM=hn({name:"errorBars",initialState:sK,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]||(e[n]=[]),e[n].push(a)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:a,next:l}=t.payload;e[n]&&(e[n]=e[n].map(o=>o.dataKey===a.dataKey&&o.direction===a.direction?l:o))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]&&(e[n]=e[n].filter(l=>l.dataKey!==a.dataKey||l.direction!==a.direction))}}}),{addErrorBar:iV,replaceErrorBar:lV,removeErrorBar:uV}=CM.actions,cK=CM.reducer,fK=["children"];function dK(e,t){if(e==null)return{};var n,a,l=hK(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a({x:0,y:0,value:0}),errorBarOffset:0},vK=S.createContext(mK);function pK(e){var{children:t}=e,n=dK(e,fK);return S.createElement(vK.Provider,{value:n},t)}function DM(e,t){var n,a,l=de(h=>ta(h,e)),o=de(h=>na(h,t)),c=(n=l?.allowDataOverflow)!==null&&n!==void 0?n:Dt.allowDataOverflow,f=(a=o?.allowDataOverflow)!==null&&a!==void 0?a:kt.allowDataOverflow,d=c||f;return{needClip:d,needClipX:c,needClipY:f}}function yK(e){var{xAxisId:t,yAxisId:n,clipPathId:a}=e,l=jg(),{needClipX:o,needClipY:c,needClip:f}=DM(t,n);if(!f||!l)return null;var{x:d,y:h,width:v,height:p}=l;return S.createElement("clipPath",{id:"clipPath-".concat(a)},S.createElement("rect",{x:o?d:d-v/2,y:c?h:h-p/2,width:o?v:v*2,height:c?p:p*2}))}var kM=(e,t,n,a)=>wT(e,"xAxis",t,a),PM=(e,t,n,a)=>ST(e,"xAxis",t,a),zM=(e,t,n,a)=>wT(e,"yAxis",n,a),RM=(e,t,n,a)=>ST(e,"yAxis",n,a),gK=V([Ge,kM,zM,PM,RM],(e,t,n,a,l)=>Ua(e,"xAxis")?Qc(t,a,!1):Qc(n,l,!1)),bK=(e,t,n,a,l)=>l;function xK(e){return e.type==="line"}var SK=V([tT,bK],(e,t)=>e.filter(xK).find(n=>n.id===t)),wK=V([Ge,kM,zM,PM,RM,SK,gK,Py],(e,t,n,a,l,o,c,f)=>{var{chartData:d,dataStartIndex:h,dataEndIndex:v}=f;if(!(o==null||t==null||n==null||a==null||l==null||a.length===0||l.length===0||c==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:p,data:b}=o,x;if(b!=null&&b.length>0?x=b:x=d?.slice(h,v+1),x!=null)return sY({layout:e,xAxis:t,yAxis:n,xAxisTicks:a,yAxisTicks:l,dataKey:p,bandSize:c,displayedData:x})}});function jK(e){var t=_l(e),n=3,a=2;if(t!=null){var{r:l,strokeWidth:o}=t,c=Number(l),f=Number(o);return(Number.isNaN(c)||c<0)&&(c=n),(Number.isNaN(f)||f<0)&&(f=a),{r:c,strokeWidth:f}}return{r:n,strokeWidth:a}}var jp={exports:{}},Op={};var y_;function OK(){if(y_)return Op;y_=1;var e=kl();function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,a=e.useSyncExternalStore,l=e.useRef,o=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Op.useSyncExternalStoreWithSelector=function(d,h,v,p,b){var x=l(null);if(x.current===null){var O={hasValue:!1,value:null};x.current=O}else O=x.current;x=c(function(){function _(C){if(!N){if(N=!0,E=C,C=p(C),b!==void 0&&O.hasValue){var M=O.value;if(b(M,C))return T=M}return T=C}if(M=T,n(E,C))return M;var L=p(C);return b!==void 0&&b(M,L)?(E=C,M):(E=C,T=L)}var N=!1,E,T,P=v===void 0?null:v;return[function(){return _(h())},P===null?void 0:function(){return _(P())}]},[h,v,p,b]);var j=a(d,x[0],x[1]);return o(function(){O.hasValue=!0,O.value=j},[j]),f(j),j},Op}var g_;function _K(){return g_||(g_=1,jp.exports=OK()),jp.exports}_K();function AK(e){e()}function EK(){let e=null,t=null;return{clear(){e=null,t=null},notify(){AK(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let a=e;for(;a;)n.push(a),a=a.next;return n},subscribe(n){let a=!0;const l=t={callback:n,next:null,prev:t};return l.prev?l.prev.next=l:e=l,function(){!a||e===null||(a=!1,l.next?l.next.prev=l.prev:t=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}var b_={notify(){},get:()=>[]};function NK(e,t){let n,a=b_,l=0,o=!1;function c(j){v();const _=a.subscribe(j);let N=!1;return()=>{N||(N=!0,_(),p())}}function f(){a.notify()}function d(){O.onStateChange&&O.onStateChange()}function h(){return o}function v(){l++,n||(n=e.subscribe(d),a=EK())}function p(){l--,n&&l===0&&(n(),n=void 0,a.clear(),a=b_)}function b(){o||(o=!0,v())}function x(){o&&(o=!1,p())}const O={addNestedSub:c,notifyNestedSubs:f,handleChangeWrapper:d,isSubscribed:h,trySubscribe:b,tryUnsubscribe:x,getListeners:()=>a};return O}var TK=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MK=TK(),CK=()=>typeof navigator<"u"&&navigator.product==="ReactNative",DK=CK(),kK=()=>MK||DK?S.useLayoutEffect:S.useEffect,PK=kK();function x_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function zK(e,t){if(x_(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(let l=0;l{const d=NK(l);return{store:l,subscription:d,getServerState:a?()=>a:void 0}},[l,a]),c=S.useMemo(()=>l.getState(),[l]);PK(()=>{const{subscription:d}=o;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),c!==l.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[o,c]);const f=n||UK;return S.createElement(f.Provider,{value:o},t)}var BK=qK,IK=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function HK(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Eg(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var a of n)if(IK.has(a)){if(e[a]==null&&t[a]==null)continue;if(!zK(e[a],t[a]))return!1}else if(!HK(e[a],t[a]))return!1;return!0}var KK=["id"],YK=["type","layout","connectNulls","needClip","shape"],GK=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:a,legendType:l,hide:o}=e;return[{inactive:o,dataKey:t,type:l,color:a,value:Hf(n,t),payload:e}]},WK=S.memo(e=>{var{dataKey:t,data:n,stroke:a,strokeWidth:l,fill:o,name:c,hide:f,unit:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:n,positions:void 0,settings:{stroke:a,strokeWidth:l,fill:o,dataKey:t,nameKey:void 0,name:Hf(c,t),hide:f,type:h,color:a,unit:d,graphicalItemId:v}};return S.createElement(SM,{tooltipEntrySettings:p})}),LM=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function JK(e,t){for(var n=e.length%2!==0?[...e,0]:e,a=[],l=0;l{var a=n.reduce((p,b)=>p+b);if(!a)return LM(t,e);for(var l=Math.floor(e/a),o=e%a,c=t-e,f=[],d=0,h=0;do){f=[...n.slice(0,d),o-h];break}var v=f.length%2===0?[0,c]:[c];return[...JK(n,l),...f,...v].map(p=>"".concat(p,"px")).join(", ")};function tY(e){var{clipPathId:t,points:n,props:a}=e,{dot:l,dataKey:o,needClip:c}=a,{id:f}=a,d=Ng(a,KK),h=Gn(d);return S.createElement(GI,{points:n,dot:l,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:o,baseProps:h,needClip:c,clipPathId:t})}function nY(e){var{showLabels:t,children:n,points:a}=e,l=S.useMemo(()=>a?.map(o=>{var c,f,d={x:(c=o.x)!==null&&c!==void 0?c:0,y:(f=o.y)!==null&&f!==void 0?f:0,width:0,lowerWidth:0,upperWidth:0,height:0};return dr(dr({},d),{},{value:o.value,payload:o.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[a]);return S.createElement(oB,{value:t?l:void 0},n)}function w_(e){var{clipPathId:t,pathRef:n,points:a,strokeDasharray:l,props:o}=e,{type:c,layout:f,connectNulls:d,needClip:h,shape:v}=o,p=Ng(o,YK),b=dr(dr({},tn(p)),{},{fill:"none",className:"recharts-line-curve",clipPath:h?"url(#clipPath-".concat(t,")"):void 0,points:a,type:c,layout:f,connectNulls:d,strokeDasharray:l??o.strokeDasharray});return S.createElement(S.Fragment,null,a?.length>1&&S.createElement(xM,jo({shapeType:"curve",option:v},b,{pathRef:n})),S.createElement(tY,{points:a,clipPathId:t,props:o}))}function rY(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function aY(e){var{clipPathId:t,props:n,pathRef:a,previousPointsRef:l,longestAnimatedLengthRef:o}=e,{points:c,strokeDasharray:f,isAnimationActive:d,animationBegin:h,animationDuration:v,animationEasing:p,animateNewValues:b,width:x,height:O,onAnimationEnd:j,onAnimationStart:_}=n,N=l.current,E=td(c,"recharts-line-"),T=S.useRef(E),[P,C]=S.useState(!1),M=!P,L=S.useCallback(()=>{typeof j=="function"&&j(),C(!1)},[j]),Z=S.useCallback(()=>{typeof _=="function"&&_(),C(!0)},[_]),re=rY(a.current),B=S.useRef(0);T.current!==E&&(B.current=o.current,T.current=E);var U=B.current;return S.createElement(nY,{points:c,showLabels:M},n.children,S.createElement(ed,{animationId:E,begin:h,duration:v,isActive:d,easing:p,onAnimationEnd:L,onAnimationStart:Z,key:E},K=>{var ce=Qt(U,re+U,K),ue=Math.min(ce,re),ve;if(d)if(f){var H="".concat(f).split(/[,\s]+/gim).map(G=>parseFloat(G));ve=eY(ue,re,H)}else ve=LM(re,ue);else ve=f==null?void 0:String(f);if(K>0&&re>0&&(l.current=c,o.current=Math.max(o.current,ue)),N){var ee=N.length/c.length,z=K===1?c:c.map((G,ne)=>{var k=Math.floor(ne*ee);if(N[k]){var F=N[k];return dr(dr({},G),{},{x:Qt(F.x,G.x,K),y:Qt(F.y,G.y,K)})}return b?dr(dr({},G),{},{x:Qt(x*2,G.x,K),y:Qt(O/2,G.y,K)}):dr(dr({},G),{},{x:G.x,y:G.y})});return l.current=z,S.createElement(w_,{props:n,points:z,clipPathId:t,pathRef:a,strokeDasharray:ve})}return S.createElement(w_,{props:n,points:c,clipPathId:t,pathRef:a,strokeDasharray:ve})}),S.createElement(fM,{label:n.label}))}function iY(e){var{clipPathId:t,props:n}=e,a=S.useRef(null),l=S.useRef(0),o=S.useRef(null);return S.createElement(aY,{props:n,clipPathId:t,previousPointsRef:a,longestAnimatedLengthRef:l,pathRef:o})}var lY=(e,t)=>{var n,a;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(a=e.y)!==null&&a!==void 0?a:void 0,value:e.value,errorVal:tt(e.payload,t)}};class uY extends S.Component{render(){var{hide:t,dot:n,points:a,className:l,xAxisId:o,yAxisId:c,top:f,left:d,width:h,height:v,id:p,needClip:b,zIndex:x}=this.props;if(t)return null;var O=Re("recharts-line",l),j=p,{r:_,strokeWidth:N}=jK(n),E=bM(n),T=_*2+N,P=b?"url(#clipPath-".concat(E?"":"dots-").concat(j,")"):void 0;return S.createElement(ir,{zIndex:x},S.createElement(dn,{className:O},b&&S.createElement("defs",null,S.createElement(yK,{clipPathId:j,xAxisId:o,yAxisId:c}),!E&&S.createElement("clipPath",{id:"clipPath-dots-".concat(j)},S.createElement("rect",{x:d-T/2,y:f-T/2,width:h+T,height:v+T}))),S.createElement(pK,{xAxisId:o,yAxisId:c,data:a,dataPointFormatter:lY,errorBarOffset:0},S.createElement(iY,{props:this.props,clipPathId:j}))),S.createElement(dH,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:P}))}}var $M={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:Vt.line,type:"linear"};function oY(e){var t=At(e,$M),{activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,connectNulls:f,dot:d,hide:h,isAnimationActive:v,label:p,legendType:b,xAxisId:x,yAxisId:O,id:j}=t,_=Ng(t,GK),{needClip:N}=DM(x,O),E=jg(),T=To(),P=mn(),C=de(B=>wK(B,x,O,P,j));if(T!=="horizontal"&&T!=="vertical"||C==null||E==null)return null;var{height:M,width:L,x:Z,y:re}=E;return S.createElement(uY,jo({},_,{id:j,connectNulls:f,dot:d,activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,isAnimationActive:v,hide:h,label:p,legendType:b,xAxisId:x,yAxisId:O,points:C,layout:T,height:M,width:L,left:Z,top:re,needClip:N}))}function sY(e){var{layout:t,xAxis:n,yAxis:a,xAxisTicks:l,yAxisTicks:o,dataKey:c,bandSize:f,displayedData:d}=e;return d.map((h,v)=>{var p=tt(h,c);if(t==="horizontal"){var b=hj({axis:n,ticks:l,bandSize:f,entry:h,index:v}),x=_t(p)?null:a.scale(p);return{x:b,y:x,value:p,payload:h}}var O=_t(p)?null:n.scale(p),j=hj({axis:a,ticks:o,bandSize:f,entry:h,index:v});return O==null||j==null?null:{x:O,y:j,value:p,payload:h}}).filter(Boolean)}function cY(e){var t=At(e,$M),n=mn();return S.createElement(wM,{id:t.id,type:"line"},a=>S.createElement(S.Fragment,null,S.createElement(QB,{legendPayload:QK(t)}),S.createElement(WK,{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:a}),S.createElement(fI,{type:"line",id:a,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),S.createElement(oY,jo({},t,{id:a}))))}var Sl=S.memo(cY,Eg);Sl.displayName="Line";var fY=["domain","range"],dY=["domain","range"];function j_(e,t){if(e==null)return{};var n,a,l=hY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{n.current===null?t(QI(e)):n.current!==e&&t(WI({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(JI(n.current)),n.current=null)},[t]),null}var gY=e=>{var{xAxisId:t,className:n}=e,a=de(wE),l=mn(),o="xAxis",c=de(N=>xT(N,o,t,l)),f=de(N=>D$(N,t)),d=de(N=>$$(N,t)),h=de(N=>WN(N,t));if(f==null||d==null||h==null)return null;var{dangerouslySetInnerHTML:v,ticks:p,scale:b}=e,x=__(e,mY),{id:O,scale:j}=h,_=__(h,vY);return S.createElement(Ag,j0({},x,_,{x:d.x,y:d.y,width:f.width,height:f.height,className:Re("recharts-".concat(o," ").concat(o),n),viewBox:a,ticks:c,axisType:o}))},bY={allowDataOverflow:Dt.allowDataOverflow,allowDecimals:Dt.allowDecimals,allowDuplicatedCategory:Dt.allowDuplicatedCategory,angle:Dt.angle,axisLine:Kr.axisLine,height:Dt.height,hide:!1,includeHidden:Dt.includeHidden,interval:Dt.interval,minTickGap:Dt.minTickGap,mirror:Dt.mirror,orientation:Dt.orientation,padding:Dt.padding,reversed:Dt.reversed,scale:Dt.scale,tick:Dt.tick,tickCount:Dt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:Dt.type,xAxisId:0},xY=e=>{var t=At(e,bY);return S.createElement(S.Fragment,null,S.createElement(yY,{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}),S.createElement(gY,t))},ao=S.memo(xY,UM);ao.displayName="XAxis";var SY=["dangerouslySetInnerHTML","ticks","scale"],wY=["id","scale"];function O0(){return O0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current===null?t(eH(e)):n.current!==e&&t(tH({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(nH(n.current)),n.current=null)},[t]),null}var _Y=e=>{var{yAxisId:t,className:n,width:a,label:l}=e,o=S.useRef(null),c=S.useRef(null),f=de(wE),d=mn(),h=Qe(),v="yAxis",p=de(M=>B$(M,t)),b=de(M=>q$(M,t)),x=de(M=>xT(M,v,t,d)),O=de(M=>JN(M,t));if(S.useLayoutEffect(()=>{if(!(a!=="auto"||!p||xg(l)||S.isValidElement(l)||O==null)){var M=o.current;if(M){var L=M.getCalculatedWidth();Math.round(p.width)!==Math.round(L)&&h(rH({id:t,width:L}))}}},[x,p,h,l,t,a,O]),p==null||b==null||O==null)return null;var{dangerouslySetInnerHTML:j,ticks:_,scale:N}=e,E=A_(e,SY),{id:T,scale:P}=O,C=A_(O,wY);return S.createElement(Ag,O0({},E,C,{ref:o,labelRef:c,x:b.x,y:b.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:p.width,height:p.height,className:Re("recharts-".concat(v," ").concat(v),n),viewBox:f,ticks:x,axisType:v}))},AY={allowDataOverflow:kt.allowDataOverflow,allowDecimals:kt.allowDecimals,allowDuplicatedCategory:kt.allowDuplicatedCategory,angle:kt.angle,axisLine:Kr.axisLine,hide:!1,includeHidden:kt.includeHidden,interval:kt.interval,minTickGap:kt.minTickGap,mirror:kt.mirror,orientation:kt.orientation,padding:kt.padding,reversed:kt.reversed,scale:kt.scale,tick:kt.tick,tickCount:kt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:kt.type,width:kt.width,yAxisId:0},EY=e=>{var t=At(e,AY);return S.createElement(S.Fragment,null,S.createElement(OY,{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}),S.createElement(_Y,t))},io=S.memo(EY,UM);io.displayName="YAxis";var NY=(e,t)=>t,Tg=V([NY,Ge,FN,Nt,$T,ra,r7,zt],c7),Mg=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,a=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/a)}},qM=Vn("mouseClick"),BM=Eo();BM.startListening({actionCreator:qM,effect:(e,t)=>{var n=e.payload,a=Tg(t.getState(),Mg(n));a?.activeIndex!=null&&t.dispatch(tU({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}});var _0=Vn("mouseMove"),IM=Eo(),Oc=null;IM.startListening({actionCreator:_0,effect:(e,t)=>{var n=e.payload;Oc!==null&&cancelAnimationFrame(Oc);var a=Mg(n);Oc=requestAnimationFrame(()=>{var l=t.getState(),o=cg(l,l.tooltip.settings.shared);if(o==="axis"){var c=Tg(l,a);c?.activeIndex!=null?t.dispatch(MT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate})):t.dispatch(TT())}Oc=null})}});function TY(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?"<>":t}var E_={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},HM=hn({name:"rootProps",initialState:E_,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:E_.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}}}),MY=HM.reducer,{updateOptions:CY}=HM.actions,KM=hn({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:DY}=KM.actions,kY=KM.reducer,YM=Vn("keyDown"),GM=Vn("focus"),Cg=Eo();Cg.startListening({actionCreator:YM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip,o=e.payload;if(!(o!=="ArrowRight"&&o!=="ArrowLeft"&&o!=="Enter")){var c=fg(l,Hl(n),Uo(n),Io(n)),f=c==null?-1:Number(c);if(!(!Number.isFinite(f)||f<0)){var d=ra(n);if(o==="Enter"){var h=Sf(n,"axis","hover",String(l.index));t.dispatch(y0({active:!l.active,activeIndex:l.index,activeCoordinate:h}));return}var v=Y$(n),p=v==="left-to-right"?1:-1,b=o==="ArrowRight"?1:-1,x=f+b*p;if(!(d==null||x>=d.length||x<0)){var O=Sf(n,"axis","hover",String(x));t.dispatch(y0({active:!0,activeIndex:x.toString(),activeCoordinate:O}))}}}}}});Cg.startListening({actionCreator:GM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip;if(!l.active&&l.index==null){var o="0",c=Sf(n,"axis","hover",String(o));t.dispatch(y0({active:!0,activeIndex:o,activeCoordinate:c}))}}}});var Hn=Vn("externalEvent"),VM=Eo(),_p=new Map;VM.startListening({actionCreator:Hn,effect:(e,t)=>{var{handler:n,reactEvent:a}=e.payload;if(n!=null){a.persist();var l=a.type,o=_p.get(l);o!==void 0&&cancelAnimationFrame(o);var c=requestAnimationFrame(()=>{try{var f=t.getState(),d={activeCoordinate:BU(f),activeDataKey:IT(f),activeIndex:Dl(f),activeLabel:BT(f),activeTooltipIndex:Dl(f),isTooltipActive:IU(f)};n(d,a)}finally{_p.delete(l)}});_p.set(l,c)}}});var PY=V([Bl],e=>e.tooltipItemPayloads),zY=V([PY,Bo,(e,t)=>t,(e,t,n)=>n],(e,t,n,a)=>{var l=e.find(f=>f.settings.graphicalItemId===a);if(l!=null){var{positions:o}=l;if(o!=null){var c=t(o,n);return c}}}),XM=Vn("touchMove"),FM=Eo();FM.startListening({actionCreator:XM,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var a=t.getState(),l=cg(a,a.tooltip.settings.shared);if(l==="axis"){var o=n.touches[0];if(o==null)return;var c=Tg(a,Mg({clientX:o.clientX,clientY:o.clientY,currentTarget:n.currentTarget}));c?.activeIndex!=null&&t.dispatch(MT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate}))}else if(l==="item"){var f,d=n.touches[0];if(document.elementFromPoint==null||d==null)return;var h=document.elementFromPoint(d.clientX,d.clientY);if(!h||!h.getAttribute)return;var v=h.getAttribute(xE),p=(f=h.getAttribute(SE))!==null&&f!==void 0?f:void 0,b=Il(a).find(j=>j.id===p);if(v==null||b==null||p==null)return;var{dataKey:x}=b,O=zY(a,v,p);t.dispatch(NT({activeDataKey:x,activeIndex:v,activeCoordinate:O,activeGraphicalItemId:p}))}}}});var RY=IA({brush:hH,cartesianAxis:aH,chartData:B7,errorBars:cK,graphicalItems:sI,layout:m5,legend:bR,options:R7,polarAxis:bB,polarOptions:kY,referenceElements:xH,rootProps:MY,tooltip:nU,zIndex:O7}),LY=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Uz({reducer:RY,preloadedState:t,middleware:a=>{var l;return a({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((l="es6")!==null&&l!==void 0?l:"")}).concat([BM.middleware,IM.middleware,Cg.middleware,VM.middleware,FM.middleware])},enhancers:a=>{var l=a;return typeof a=="function"&&(l=a()),l.concat(rE({type:"raf"}))},devTools:{serialize:{replacer:TY},name:"recharts-".concat(n)}})};function ZM(e){var{preloadedState:t,children:n,reduxStoreName:a}=e,l=mn(),o=S.useRef(null);if(l)return n;o.current==null&&(o.current=LY(t,a));var c=Q0;return S.createElement(BK,{context:c,store:o.current},n)}function $Y(e){var{layout:t,margin:n}=e,a=Qe(),l=mn();return S.useEffect(()=>{l||(a(f5(t)),a(c5(n)))},[a,l,t,n]),null}var QM=S.memo($Y,Eg);function WM(e){var t=Qe();return S.useEffect(()=>{t(CY(e))},[t,e]),null}function N_(e){var{zIndex:t,isPanorama:n}=e,a=S.useRef(null),l=Qe();return S.useLayoutEffect(()=>(a.current&&l(w7({zIndex:t,element:a.current,isPanorama:n})),()=>{l(j7({zIndex:t,isPanorama:n}))}),[l,t,n]),S.createElement("g",{tabIndex:-1,ref:a})}function T_(e){var{children:t,isPanorama:n}=e,a=de(d7);if(!a||a.length===0)return t;var l=a.filter(c=>c<0),o=a.filter(c=>c>0);return S.createElement(S.Fragment,null,l.map(c=>S.createElement(N_,{key:c,zIndex:c,isPanorama:n})),t,o.map(c=>S.createElement(N_,{key:c,zIndex:c,isPanorama:n})))}var UY=["children"];function qY(e,t){if(e==null)return{};var n,a,l=BY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var n=iy(),a=ly(),l=UE();if(!yr(n)||!yr(a))return null;var{children:o,otherAttributes:c,title:f,desc:d}=e,h,v;return c!=null&&(typeof c.tabIndex=="number"?h=c.tabIndex:h=l?0:void 0,typeof c.role=="string"?v=c.role:v=l?"application":void 0),S.createElement($0,Ef({},c,{title:f,desc:d,role:v,tabIndex:h,width:n,height:a,style:IY,ref:t}),o)}),KY=e=>{var{children:t}=e,n=de(Vf);if(!n)return null;var{width:a,height:l,y:o,x:c}=n;return S.createElement($0,{width:a,height:l,x:c,y:o},t)},M_=S.forwardRef((e,t)=>{var{children:n}=e,a=qY(e,UY),l=mn();return l?S.createElement(KY,null,S.createElement(T_,{isPanorama:!0},n)):S.createElement(HY,Ef({ref:t},a),S.createElement(T_,{isPanorama:!1},n))});function YY(){var e=Qe(),[t,n]=S.useState(null),a=de(T5);return S.useEffect(()=>{if(t!=null){var l=t.getBoundingClientRect(),o=l.width/t.offsetWidth;wt(o)&&o!==a&&e(h5(o))}},[t,e,a]),n}function C_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function GY(e){for(var t=1;t(Z7(),null);function Nf(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var QY=S.forwardRef((e,t)=>{var n,a,l=S.useRef(null),[o,c]=S.useState({containerWidth:Nf((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Nf((a=e.style)===null||a===void 0?void 0:a.height)}),f=S.useCallback((h,v)=>{c(p=>{var b=Math.round(h),x=Math.round(v);return p.containerWidth===b&&p.containerHeight===x?p:{containerWidth:b,containerHeight:x}})},[]),d=S.useCallback(h=>{if(typeof t=="function"&&t(h),h!=null&&typeof ResizeObserver<"u"){var{width:v,height:p}=h.getBoundingClientRect();f(v,p);var b=O=>{var{width:j,height:_}=O[0].contentRect;f(j,_)},x=new ResizeObserver(b);x.observe(h),l.current=x}},[t,f]);return S.useEffect(()=>()=>{var h=l.current;h?.disconnect()},[f]),S.createElement(S.Fragment,null,S.createElement(Ff,{width:o.containerWidth,height:o.containerHeight}),S.createElement("div",Ai({ref:d},e)))}),WY=S.forwardRef((e,t)=>{var{width:n,height:a}=e,[l,o]=S.useState({containerWidth:Nf(n),containerHeight:Nf(a)}),c=S.useCallback((d,h)=>{o(v=>{var p=Math.round(d),b=Math.round(h);return v.containerWidth===p&&v.containerHeight===b?v:{containerWidth:p,containerHeight:b}})},[]),f=S.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:h,height:v}=d.getBoundingClientRect();c(h,v)}},[t,c]);return S.createElement(S.Fragment,null,S.createElement(Ff,{width:l.containerWidth,height:l.containerHeight}),S.createElement("div",Ai({ref:f},e)))}),JY=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return S.createElement(S.Fragment,null,S.createElement(Ff,{width:n,height:a}),S.createElement("div",Ai({ref:t},e)))}),eG=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return Yr(n)||Yr(a)?S.createElement(WY,Ai({},e,{ref:t})):S.createElement(JY,Ai({},e,{ref:t}))});function tG(e){return e===!0?QY:eG}var nG=S.forwardRef((e,t)=>{var{children:n,className:a,height:l,onClick:o,onContextMenu:c,onDoubleClick:f,onMouseDown:d,onMouseEnter:h,onMouseLeave:v,onMouseMove:p,onMouseUp:b,onTouchEnd:x,onTouchMove:O,onTouchStart:j,style:_,width:N,responsive:E,dispatchTouchEvents:T=!0}=e,P=S.useRef(null),C=Qe(),[M,L]=S.useState(null),[Z,re]=S.useState(null),B=YY(),U=ay(),K=U?.width>0?U.width:N,ce=U?.height>0?U.height:l,ue=S.useCallback(W=>{B(W),typeof t=="function"&&t(W),L(W),re(W),W!=null&&(P.current=W)},[B,t,L,re]),ve=S.useCallback(W=>{C(qM(W)),C(Hn({handler:o,reactEvent:W}))},[C,o]),H=S.useCallback(W=>{C(_0(W)),C(Hn({handler:h,reactEvent:W}))},[C,h]),ee=S.useCallback(W=>{C(TT()),C(Hn({handler:v,reactEvent:W}))},[C,v]),z=S.useCallback(W=>{C(_0(W)),C(Hn({handler:p,reactEvent:W}))},[C,p]),G=S.useCallback(()=>{C(GM())},[C]),ne=S.useCallback(W=>{C(YM(W.key))},[C]),k=S.useCallback(W=>{C(Hn({handler:c,reactEvent:W}))},[C,c]),F=S.useCallback(W=>{C(Hn({handler:f,reactEvent:W}))},[C,f]),ie=S.useCallback(W=>{C(Hn({handler:d,reactEvent:W}))},[C,d]),le=S.useCallback(W=>{C(Hn({handler:b,reactEvent:W}))},[C,b]),ye=S.useCallback(W=>{C(Hn({handler:j,reactEvent:W}))},[C,j]),be=S.useCallback(W=>{T&&C(XM(W)),C(Hn({handler:O,reactEvent:W}))},[C,T,O]),he=S.useCallback(W=>{C(Hn({handler:x,reactEvent:W}))},[C,x]),ut=tG(E);return S.createElement(FT.Provider,{value:M},S.createElement(iA.Provider,{value:Z},S.createElement(ut,{width:K??_?.width,height:ce??_?.height,className:Re("recharts-wrapper",a),style:GY({position:"relative",cursor:"default",width:K,height:ce},_),onClick:ve,onContextMenu:k,onDoubleClick:F,onFocus:G,onKeyDown:ne,onMouseDown:ie,onMouseEnter:H,onMouseLeave:ee,onMouseMove:z,onMouseUp:le,onTouchEnd:he,onTouchMove:be,onTouchStart:ye,ref:ue},S.createElement(ZY,null),n)))}),rG=["width","height","responsive","children","className","style","compact","title","desc"];function aG(e,t){if(e==null)return{};var n,a,l=iG(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{width:n,height:a,responsive:l,children:o,className:c,style:f,compact:d,title:h,desc:v}=e,p=aG(e,rG),b=Gn(p);return d?S.createElement(S.Fragment,null,S.createElement(Ff,{width:n,height:a}),S.createElement(M_,{otherAttributes:b,title:h,desc:v},o)):S.createElement(nG,{className:c,style:f,width:n,height:a,responsive:l??!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},S.createElement(M_,{otherAttributes:b,title:h,desc:v,ref:t},S.createElement(wH,null,o)))});function A0(){return A0=Object.assign?Object.assign.bind():function(e){for(var t=1;tS.createElement(oG,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:sG,tooltipPayloadSearcher:ZT,categoricalChartProps:e,ref:t}));function cG(e){var t=Qe();return S.useEffect(()=>{t(DY(e))},[t,e]),null}var fG=["layout"];function E0(){return E0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=At(e,xG);return S.createElement(vG,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:bG,tooltipPayloadSearcher:ZT,categoricalChartProps:n,ref:t})});function wG(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function jG(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function OG({earnings:e,loading:t,error:n}){const[a,l]=S.useState("earnings"),[o,c]=S.useState(null),f=(e?.models??[]).map(p=>({model:p.model,value:a==="earnings"?p.total_usd:p.tokens_in+p.tokens_out,usd:p.total_usd,tokens:p.tokens_in+p.tokens_out,priced:p.priced})).filter(p=>p.value>0).sort((p,b)=>b.value-p.value),d=tA(e?.models),h=f.reduce((p,b)=>p+b.value,0),v=(e?.models??[]).filter(p=>!p.priced).length;return t&&!e?g.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-slate-800/50"}):g.jsxs("div",{className:"min-w-0 overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 px-4 py-3",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Share by model"}),g.jsx("div",{className:"flex gap-1",role:"group","aria-label":"Distribute by",children:["earnings","tokens"].map(p=>g.jsx("button",{type:"button",onClick:()=>l(p),"aria-pressed":a===p,className:`rounded-lg px-3 py-1.5 text-xs font-medium capitalize transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${a===p?"bg-slate-700 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:p},p))})]}),n&&!e?g.jsxs("div",{className:"px-4 py-8",children:[g.jsx("p",{className:"text-sm font-medium text-amber-200",children:"Traffic mix is unavailable"}),g.jsx("p",{className:"mt-1 text-xs text-slate-300",children:n.message})]}):f.length===0?g.jsxs("p",{className:"px-4 py-8 text-sm text-slate-400",children:["No ",a==="earnings"?"priced earnings":"traffic"," recorded since the node started."]}):g.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4 sm:flex-row sm:items-center",children:[g.jsx("div",{className:"h-40 w-40 shrink-0 self-center",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsx(SG,{children:g.jsx(OM,{data:f,dataKey:"value",nameKey:"model",innerRadius:"55%",outerRadius:"100%",paddingAngle:1,stroke:"none",isAnimationActive:!1,onMouseEnter:(p,b)=>c(b),onMouseLeave:()=>c(null),children:f.map((p,b)=>g.jsx(yd,{fill:Pc(d,f[b]?.model??""),opacity:o===null||o===b?1:.35},b))})})})}),g.jsx("ul",{className:"min-w-0 flex-1 space-y-1",children:f.map((p,b)=>{const x=h>0?p.value/h*100:0;return g.jsxs("li",{onMouseEnter:()=>c(b),onMouseLeave:()=>c(null),className:`flex items-start gap-2 rounded px-1 py-0.5 text-xs transition ${o===b?"bg-slate-800":""}`,children:[g.jsx("span",{className:"mt-0.5 block h-2.5 w-2.5 shrink-0 rounded-sm",style:{background:Pc(d,p.model)}}),g.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-slate-300",children:p.model}),g.jsxs("span",{className:"shrink-0 tabular-nums text-slate-300",children:[x.toFixed(1),"%"]}),g.jsx("span",{className:"w-20 shrink-0 text-right tabular-nums text-slate-400",children:a==="earnings"?wG(p.usd):jG(p.tokens)})]},p.model)})})]}),g.jsxs("p",{className:"flex items-start gap-2 border-t border-slate-800 px-4 py-3 text-xs text-slate-300",children:[g.jsx(Tf,{"aria-hidden":"true",size:14,className:"mt-px shrink-0"}),g.jsxs("span",{children:["Share of traffic served since this node last started — its counters reset on restart, so this is the recent mix rather than an all-time split. Probes are excluded.",v>0&&a==="earnings"&&` ${v} model(s) had no rate available and are absent from the earnings split; switch to tokens to see them.`]})]})]})}const P_={green:"text-green-400",red:"text-red-400",yellow:"text-yellow-400",blue:"text-blue-400",gray:"text-gray-400"};function Xu({title:e,value:t,subtitle:n,icon:a,color:l="blue"}){return g.jsxs("div",{className:"min-w-0 rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[g.jsx("span",{className:"truncate text-xs text-slate-300 sm:text-sm",children:e}),a&&g.jsx("span",{"aria-hidden":"true",className:P_[l],children:a})]}),g.jsx("div",{className:`truncate text-lg font-bold sm:text-2xl ${P_[l]}`,title:String(t),children:t}),n&&g.jsx("div",{className:"mt-1 truncate text-[11px] text-slate-400 sm:text-xs",title:n,children:n})]})}function _G(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function AG(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toFixed(0)}function EG({metrics:e,loading:t,error:n,earnings:a,earningsError:l,earningsLoading:o}){if(t)return g.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[...Array(5)].map((x,O)=>g.jsxs("div",{className:"animate-pulse rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsx("div",{className:"h-4 bg-slate-700 rounded w-20 mb-2"}),g.jsx("div",{className:"h-8 bg-slate-700 rounded w-16"})]},O))});const c=!!(e&&e.total_requests>0),f=c&&e?(e.successful_requests/e.total_requests*100).toFixed(1):null,d=!!a?.platform?.unavailable,h=!!l||!a&&!o||d,v=h?null:a?.platform?.uptime_7d_percent,p=v==null?"gray":v>=99?"green":v>=95?"yellow":"red",b=f==null?"gray":parseFloat(f)>=99?"green":parseFloat(f)>=95?"yellow":"red";return g.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[g.jsx(Xu,{title:"7-day uptime",value:v==null?"--":`${v.toFixed(2)}%`,subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"reported by Swan Inference",icon:g.jsx(Z_,{"aria-hidden":"true",size:20}),color:p}),g.jsx(Xu,{title:"Session success",value:f==null?"--":`${f}%`,subtitle:e?c?`${e.failed_requests} failed of ${AG(e.total_requests)}`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(V_,{"aria-hidden":"true",size:20}),color:b}),g.jsx(Xu,{title:"P95 latency",value:e&&c?`${e.p95_latency_ms.toFixed(0)}ms`:"--",subtitle:e?c?`Average ${e.avg_latency_ms.toFixed(0)}ms · no SLA applied`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(T0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Request rate",value:e?`${e.requests_per_minute.toFixed(1)}/min`:"--",subtitle:e?`${e.active_requests} active now`:n?"Metrics API unavailable":"No data",icon:g.jsx(M0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Lifetime earned",value:h||!a?"--":_G(a.platform.total_usd),subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"authoritative platform total",icon:g.jsx(cD,{"aria-hidden":"true",size:20}),color:h?"gray":"green"})]})}function z_({value:e,max:t,color:n,label:a}){const l=t>0?e/t*100:0;return g.jsx("div",{className:"h-2 w-full rounded-full bg-slate-700",role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(Math.min(l,100)),children:g.jsx("div",{className:`h-2 rounded-full ${n}`,style:{width:`${Math.min(l,100)}%`}})})}function NG({gpus:e,loading:t,error:n}){if(t)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("div",{className:"animate-pulse space-y-4",children:g.jsx("div",{className:"h-20 bg-slate-700 rounded"})})]});if(!e||e.length===0)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("p",{className:"text-slate-400",children:n?"API unreachable":"No GPUs detected"})]});const a=Math.max(...e.map(o=>o.temperature_c)),l=e.filter(o=>o.utilization_percent>5).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"GPU capacity"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[l," active · peak ",a,"°C"]})]}),g.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-300",children:[g.jsx(dD,{"aria-hidden":"true",size:16}),g.jsxs("span",{children:[e.length," GPU",e.length>1?"s":""]})]})]}),g.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:e.map(o=>g.jsxs("div",{className:"border border-slate-700 rounded-lg p-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-slate-200",title:o.name,children:o.name}),g.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[g.jsx(BD,{"aria-hidden":"true",size:14,className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300"}),g.jsxs("span",{className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300",children:[o.temperature_c,"°C"]})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Utilization"}),g.jsxs("span",{children:[o.utilization_percent.toFixed(0),"%"]})]}),g.jsx(z_,{value:o.utilization_percent,max:100,color:"bg-blue-500",label:`${o.name} utilization`})]}),o.memory_total_mb>0&&g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Memory"}),g.jsxs("span",{children:[(o.memory_used_mb/1024).toFixed(1)," / ",(o.memory_total_mb/1024).toFixed(1)," GB"]})]}),g.jsx(z_,{value:o.memory_used_mb,max:o.memory_total_mb,color:o.memory_used_mb/o.memory_total_mb>=.98?"bg-red-500":o.memory_used_mb/o.memory_total_mb>=.95?"bg-amber-400":"bg-blue-500",label:`${o.name} memory allocation`})]})]})]},o.index))})]})}const R_={healthy:"bg-emerald-400",degraded:"bg-amber-400",unhealthy:"bg-red-500",unknown:"bg-slate-600"};function TG({samples:e}){if(!e||e.length===0)return null;const t=e.slice(-40),n=t.reduce((l,o)=>(l[o]=(l[o]??0)+1,l),{}),a=Object.entries(n).map(([l,o])=>`${o} ${l}`).join(", ");return g.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[g.jsx("div",{className:"flex gap-px",role:"img","aria-label":`Recent health: ${a}`,children:t.map((l,o)=>g.jsx("span",{title:l,className:`block h-3 w-1 rounded-sm ${R_[l]??R_.unknown}`},o))}),g.jsx("span",{className:"text-[10px] text-slate-400",children:"recent"})]})}const L_=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4});function MG({models:e,healthLog:t,prices:n,loading:a,error:l,onRefresh:o,onModelClick:c,authenticated:f,onUnlock:d,summary:h,compact:v=!1}){const[p,b]=S.useState(null),[x,O]=S.useState(""),[j,_]=S.useState(!1),N=()=>f?!0:(d(),!1),E=async U=>{if(N()){b(U.id),O("");try{U.enabled?await Ze.disableModel(U.id):await Ze.enableModel(U.id),o()}catch(K){O(K instanceof Error?K.message:"Failed to update model")}finally{b(null)}}},T=async U=>{if(N()){b(`health-${U}`),O("");try{await Ze.forceHealthCheck(U),o()}catch(K){O(K instanceof Error?K.message:"Failed to run health check")}finally{b(null)}}},P=async()=>{if(N()){b("reload"),O("");try{await Ze.reloadModels(),o()}catch(U){O(U instanceof Error?U.message:"Failed to reload models")}finally{b(null)}}};if(a)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"Models"}),g.jsx("div",{className:"animate-pulse space-y-3",children:[...Array(2)].map((U,K)=>g.jsx("div",{className:"h-16 bg-slate-700 rounded"},K))})]});const C=U=>U.health_string==="healthy",M=e.filter(U=>!U.enabled||!C(U)),L=v&&!j?M:e,Z=h?.ready??e.filter(U=>U.enabled&&C(U)).length,re=h?.unhealthy??e.filter(U=>U.enabled&&!C(U)).length,B=h?.disabled??e.filter(U=>!U.enabled).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Models"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[Z," ready",re>0&&` · ${re} unhealthy`,B>0&&` · ${B} disabled`]})]}),g.jsxs("button",{type:"button",onClick:P,disabled:p==="reload",className:"flex min-h-10 items-center gap-1.5 rounded-lg border border-slate-600 bg-slate-800 px-3 text-sm transition-colors hover:bg-slate-700 disabled:opacity-50",children:[f?g.jsx(D0,{"aria-hidden":"true",size:14,className:p==="reload"?"animate-spin":""}):g.jsx(C0,{"aria-hidden":"true",size:14}),"Reload Config"]})]}),x&&g.jsx("p",{role:"alert",className:"mb-3 rounded-lg border border-red-800/60 bg-red-950/30 px-3 py-2 text-sm text-red-300",children:x}),!e||e.length===0?g.jsx("p",{className:"text-slate-400",children:l?"API unreachable":"No models configured"}):v&&!j&&M.length===0?g.jsxs("div",{className:"rounded-lg border border-emerald-900/60 bg-emerald-950/20 px-4 py-5 text-center",children:[g.jsx(wl,{"aria-hidden":"true",size:24,className:"mx-auto text-emerald-300"}),g.jsx("p",{className:"mt-2 text-sm font-medium text-emerald-100",children:"All configured models are ready"}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Healthy models are collapsed to keep operational exceptions visible."})]}):g.jsx("div",{className:"space-y-3",children:L.map(U=>{const K=n[U.id];return g.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border border-slate-600 bg-slate-700/50 p-3 transition-colors hover:border-slate-500 sm:items-center",children:[g.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-start gap-3 rounded text-left focus:outline-none focus:ring-2 focus:ring-blue-500 sm:items-center",onClick:()=>c?.(U.id),"aria-label":`View details for ${U.id}`,children:[g.jsx("div",{className:"flex-shrink-0",children:U.enabled?C(U)?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(Pa,{size:20,className:"text-red-400"}):g.jsx(Tf,{size:20,className:"text-slate-400"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"break-words font-medium text-slate-200",children:U.id}),g.jsxs("div",{className:"mt-0.5 break-all text-xs text-slate-400",children:[U.endpoint," • ",U.category,U.gpu_memory>0&&` • ${(U.gpu_memory/1024).toFixed(1)}GB VRAM`]}),g.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[U.state_string," • ",U.health_string]}),g.jsx(TG,{samples:t?.[U.id]??[]}),K&&g.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[g.jsx("span",{className:"font-medium text-emerald-300",children:"Provider payout / 1M"}),g.jsxs("span",{className:"text-blue-200",children:["In ",L_.format(K.provider_input_price)]}),g.jsxs("span",{className:"text-violet-200",children:["Out ",L_.format(K.provider_output_price)]})]})]})]}),g.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1 sm:gap-2",children:[g.jsx("button",{type:"button",onClick:()=>T(U.id),disabled:p===`health-${U.id}`||!U.enabled,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-slate-600 rounded transition-colors disabled:opacity-50",title:"Force health check","aria-label":`Run health check for ${U.id}`,children:g.jsx(Pl,{size:16,className:p===`health-${U.id}`?"animate-spin":""})}),g.jsx("button",{type:"button",onClick:()=>E(U),disabled:p===U.id,className:`p-2 rounded transition-colors ${U.enabled?"text-green-400 hover:text-green-300 hover:bg-green-900/30":"text-slate-400 hover:text-slate-300 hover:bg-slate-600"} disabled:opacity-50`,title:U.enabled?"Disable model":"Enable model","aria-label":`${U.enabled?"Disable":"Enable"} ${U.id}`,children:g.jsx(_D,{size:16})})]})]},U.id)})}),v&&e.length>0&&g.jsxs("button",{type:"button",onClick:()=>_(U=>!U),className:"mt-4 inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-950/40 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-expanded":j,children:[j?g.jsx(Ep,{"aria-hidden":"true",size:16}):g.jsx(kc,{"aria-hidden":"true",size:16}),j?"Hide healthy models":`Show all ${e.length} models`]})]})}function CG({data:e,loading:t,error:n,onOpenSettings:a}){if(t)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("div",{className:"h-28 animate-pulse rounded-lg bg-slate-800"})]});if(!e)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"text-sm text-slate-400",children:n?"API unreachable":"No control data available"})]});const{rate_limiter:l,concurrency_limiter:o,retry_policy:c}=e;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Current admission and retry state"})]}),g.jsx("button",{type:"button",onClick:a,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg text-slate-400 transition hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Open request limit settings",children:g.jsx(LD,{"aria-hidden":"true",size:18})})]}),g.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:[g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(M0,{"aria-hidden":"true",size:14,className:"text-blue-400"}),g.jsx("span",{children:"Rate limit"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[l.current_rate.toFixed(0)," ",g.jsx("span",{className:"text-xs font-normal text-slate-400",children:"req/s"})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[l.total_throttled," throttled · burst ",l.burst_size]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(pD,{"aria-hidden":"true",size:14,className:"text-emerald-400"}),g.jsx("span",{children:"Concurrency"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[o.global_active,g.jsxs("span",{className:"text-slate-400",children:["/",o.global_max]})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:["active slots · ",o.total_rejected," rejected"]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(D0,{"aria-hidden":"true",size:14,className:"text-amber-300"}),g.jsx("span",{children:"Retry recovery"})]}),g.jsx("div",{className:"mt-2 text-lg font-semibold text-white",children:c.total_retries>0?`${(c.retry_success_rate*100).toFixed(0)}%`:"—"}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[c.total_successes," recovered · ",c.total_failures," failed"]})]})]})]})}function DG(e){return e?`Updated ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}`:""}function kG({status:e,loading:t,error:n,lastUpdated:a}){return t?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx("div",{className:"w-3 h-3 bg-slate-600 rounded-full animate-pulse"}),g.jsx("span",{className:"text-sm text-slate-300",children:"Connecting…"})]}):!e&&n?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg border border-amber-800 bg-amber-900/20 px-3 py-2",children:[g.jsx(Np,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm text-amber-200",children:"API unavailable"})]}):e?g.jsxs("div",{title:n?.message,className:`flex min-h-10 items-center gap-2 rounded-lg border px-2.5 py-2 sm:gap-3 sm:px-3 ${n?"border-amber-800 bg-amber-900/20":e.connected?"border-green-800 bg-green-900/20":"border-red-800 bg-red-900/20"}`,children:[g.jsx("div",{className:"flex items-center gap-2",children:n?g.jsxs(g.Fragment,{children:[g.jsx(Np,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm font-medium text-amber-200",children:"Stale"})]}):e.connected?g.jsxs(g.Fragment,{children:[g.jsx(VD,{"aria-hidden":"true",size:16,className:"text-green-400"}),g.jsx("span",{className:"text-sm font-medium text-green-300",children:"Connected"})]}):g.jsxs(g.Fragment,{children:[g.jsx(HS,{"aria-hidden":"true",size:16,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Disconnected"})]})}),!n&&g.jsxs("div",{className:"ml-auto hidden text-xs text-slate-300 md:block",children:[DG(a),e.active_models?.length>0&&` · ${e.active_models.length} model${e.active_models.length>1?"s":""}`]})]}):g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx(HS,{"aria-hidden":"true",size:16,className:"text-slate-300"}),g.jsx("span",{className:"text-sm text-slate-300",children:"No data"})]})}function N0(e,t=!1){if(!e)return"—";const n=new Date(e);return t?n.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"}):n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}function $_(e){return e<1e3?`${e.toFixed(0)} ms`:`${(e/1e3).toFixed(2)} s`}function U_(e){return e>5e3?"text-red-300":e>2e3?"text-amber-300":"text-emerald-300"}const lo={hub:{label:"Hub",title:"Routed to this node by Swan Inference",className:"bg-blue-500/10 text-blue-300 ring-blue-500/30"},health:{label:"Health",title:"This node's own engine probe: a one-token completion checking the backend can serve",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"},selfcheck:{label:"Self-check",title:"This node's periodic audit probe",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"}},q_=[25,50,100];function B_({source:e}){const t=lo[e??"hub"]??lo.hub;return g.jsx("span",{title:t.title,className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset ${t.className}`,children:t.label})}function I_({success:e}){return e?g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-800/70 bg-emerald-950/40 px-2 py-1 text-xs font-medium text-emerald-300",children:[g.jsx(wl,{"aria-hidden":"true",size:13})," Success"]}):g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-red-800/70 bg-red-950/40 px-2 py-1 text-xs font-medium text-red-300",children:[g.jsx(Pa,{"aria-hidden":"true",size:13})," Failed"]})}function H_({request:e}){return g.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Request ID"}),g.jsx("span",{className:"mt-1 block break-all font-mono text-slate-300",children:e.request_id})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Completed"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:N0(e.end_time,!0)})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Total tokens"}),g.jsx("span",{className:"mt-1 block font-mono text-slate-300",children:(e.tokens_in+e.tokens_out).toLocaleString()})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Delivery"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:e.streaming?"Streaming":"Single response"})]}),e.error_reason&&g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("span",{className:"block text-slate-400",children:"Error"}),g.jsx("span",{className:"mt-1 block break-words text-red-300",children:e.error_reason})]})]})}function PG({models:e}){const[t,n]=S.useState(""),[a,l]=S.useState(""),[o,c]=S.useState(q_[0]),[f,d]=S.useState(0),[h,v]=S.useState(null),p=B=>{B(),d(0),v(null)},{data:b,error:x,loading:O,refetch:j}=Da(S.useCallback(()=>Ze.getRequestHistory({limit:o,offset:f*o,model:t||void 0,source:a||void 0}),[o,f,t,a]),f===0?1e4:0),_=b?.requests??[],N=b?.total??0,E=_.reduce((B,U)=>B+U.tokens_in,0),T=_.reduce((B,U)=>B+U.tokens_out,0),P=B=>v(U=>U===B?null:B),C=Math.max(1,Math.ceil(N/o)),M=N===0?0:f*o+1,L=f*o+_.length,Z=f>0,re=Lp(()=>n(B.target.value)),className:"min-h-10 min-w-0 flex-1 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 sm:min-w-56",children:[g.jsx("option",{value:"",children:"All models"}),e.map(B=>g.jsx("option",{value:B.id,children:B.id},B.id))]}),g.jsx("label",{htmlFor:"transaction-source-filter",className:"sr-only",children:"Filter requests by source"}),g.jsxs("select",{id:"transaction-source-filter",value:a,onChange:B=>p(()=>l(B.target.value)),className:"min-h-10 min-w-0 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:[g.jsx("option",{value:"",children:"All sources"}),Object.entries(lo).map(([B,U])=>g.jsx("option",{value:B,children:U.label},B))]}),g.jsx("button",{type:"button",onClick:j,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh requests",children:g.jsx(Pl,{"aria-hidden":"true",size:16,className:O?"animate-spin":""})})]})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[g.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900 p-3 sm:p-4",children:[g.jsx("p",{className:"text-xs text-slate-400",children:"Matching"}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:N.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:t||a?"requests match the filters":"requests in history"})]}),g.jsxs("div",{className:"rounded-xl border border-blue-900/70 bg-blue-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-blue-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Input tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:E.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]}),g.jsxs("div",{className:"rounded-xl border border-violet-900/70 bg-violet-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-violet-300",children:[g.jsx(Km,{"aria-hidden":"true",size:13})," Output tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:T.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]})]}),g.jsx("div",{className:"overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:O&&_.length===0?g.jsx("div",{className:"animate-pulse space-y-3 p-4",role:"status","aria-label":"Loading transactions",children:[...Array(6)].map((B,U)=>g.jsx("div",{className:"h-14 rounded-lg bg-slate-800"},U))}):x&&_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center",children:[g.jsx(Pa,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-red-400"}),g.jsx("p",{className:"font-medium text-red-200",children:"Requests are unavailable"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:x.message}),g.jsx("button",{type:"button",onClick:j,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]}):_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center text-slate-400",children:[g.jsx(T0,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-slate-600"}),t||a?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests match these filters"}),g.jsxs("p",{className:"mt-1 text-sm",children:["Nothing recorded for ",a?`${lo[a].label.toLowerCase()} traffic`:"this source",t?` on ${t}`:""," yet."]}),g.jsx("button",{type:"button",onClick:()=>p(()=>{n(""),l("")}),className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:"Clear filters"})]}):g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests yet"}),g.jsx("p",{className:"mt-1 text-sm",children:"Requests will appear here after the provider serves inference."})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"hidden overflow-x-auto md:block",children:g.jsxs("table",{className:"w-full min-w-[840px] text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"border-b border-slate-800 bg-slate-950/40 text-xs uppercase tracking-wide text-slate-400",children:[g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Started"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Model"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Source"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Latency"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Input tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Km,{"aria-hidden":"true",size:13})," Output tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Status"}),g.jsx("th",{className:"w-12 px-3 py-3",children:g.jsx("span",{className:"sr-only",children:"Details"})})]})}),g.jsx("tbody",{children:_.map(B=>{const U=h===B.request_id;return g.jsxs(S.Fragment,{children:[g.jsxs("tr",{className:`border-b border-slate-800/80 ${B.success?"hover:bg-slate-800/35":"bg-red-950/10 hover:bg-red-950/20"}`,children:[g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-slate-300",title:new Date(B.start_time).toLocaleString(),children:N0(B.start_time)}),g.jsxs("td",{className:"max-w-xs px-4 py-3",children:[g.jsx("span",{className:"block truncate font-mono text-xs text-slate-200",title:B.model,children:B.model}),B.streaming&&g.jsx("span",{className:"mt-0.5 block text-xs text-blue-300",children:"Streaming"})]}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3",children:g.jsx(B_,{source:B.source})}),g.jsx("td",{className:`whitespace-nowrap px-4 py-3 text-right font-mono text-xs ${U_(B.latency_ms)}`,children:$_(B.latency_ms)}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-blue-200",children:B.tokens_in.toLocaleString()}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-violet-200",children:B.tokens_out.toLocaleString()}),g.jsx("td",{className:"px-4 py-3 text-right",children:g.jsx(I_,{success:B.success})}),g.jsx("td",{className:"px-3 py-3 text-right",children:g.jsx("button",{type:"button",onClick:()=>P(B.request_id),"aria-expanded":U,"aria-controls":`receipt-${B.request_id}`,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":`${U?"Hide":"Show"} details for request ${B.request_id}`,children:U?g.jsx(Ep,{"aria-hidden":"true",size:16}):g.jsx(kc,{"aria-hidden":"true",size:16})})})]}),U&&g.jsx("tr",{id:`receipt-${B.request_id}`,className:"border-b border-slate-800 bg-slate-950/60",children:g.jsx("td",{colSpan:8,className:"px-4 py-4",children:g.jsx(H_,{request:B})})})]},B.request_id)})})]})}),g.jsx("div",{className:"divide-y divide-slate-800 md:hidden",children:_.map(B=>{const U=h===B.request_id;return g.jsxs("article",{className:B.success?"":"bg-red-950/10",children:[g.jsxs("button",{type:"button",onClick:()=>P(B.request_id),"aria-expanded":U,"aria-controls":`mobile-receipt-${B.request_id}`,className:"w-full p-4 text-left focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-sm text-white",children:B.model}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[N0(B.start_time,!0),B.streaming?" · Streaming":""]})]}),g.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-slate-400",children:[g.jsx(B_,{source:B.source}),U?g.jsx(Ep,{"aria-hidden":"true",size:18}):g.jsx(kc,{"aria-hidden":"true",size:18})]})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-[11px] text-slate-400",children:"Latency"}),g.jsx("span",{className:`mt-0.5 block font-mono text-xs ${U_(B.latency_ms)}`,children:$_(B.latency_ms)})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-blue-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:11})," Input"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-blue-100",children:B.tokens_in.toLocaleString()})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-violet-300",children:[g.jsx(Km,{"aria-hidden":"true",size:11})," Output"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-violet-100",children:B.tokens_out.toLocaleString()})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx(I_,{success:B.success})})]}),U&&g.jsx("div",{id:`mobile-receipt-${B.request_id}`,className:"border-t border-slate-800 bg-slate-950/60 p-4",children:g.jsx(H_,{request:B})})]},B.request_id)})})]})}),g.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("p",{className:"text-xs text-slate-400","aria-live":"polite",children:[N===0?"No requests to show.":`Showing ${M.toLocaleString()}–${L.toLocaleString()} of ${N.toLocaleString()}`,t?` for ${t}`:"",a?` from ${lo[a].label.toLowerCase()}`:"",". ",f===0?"Auto-refreshes every 10 seconds.":"Auto-refresh is paused while viewing older pages."]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("label",{htmlFor:"transaction-page-size",className:"text-xs text-slate-400",children:"Per page"}),g.jsx("select",{id:"transaction-page-size",value:o,onChange:B=>p(()=>c(Number(B.target.value))),className:"min-h-9 rounded-lg border border-slate-700 bg-slate-900 px-2 text-xs text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:q_.map(B=>g.jsx("option",{value:B,children:B},B))}),g.jsxs("div",{className:"ml-1 flex items-center gap-1",children:[g.jsx("button",{type:"button",onClick:()=>{d(B=>Math.max(0,B-1)),v(null)},disabled:!Z,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Previous page",children:g.jsx(Q4,{"aria-hidden":"true",size:16})}),g.jsxs("span",{className:"px-2 text-xs tabular-nums text-slate-400",children:[f+1," / ",C]}),g.jsx("button",{type:"button",onClick:()=>{d(B=>B+1),v(null)},disabled:!re,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Next page",children:g.jsx(J4,{"aria-hidden":"true",size:16})})]})]})]})]})}const Ap={"1h":{duration:"1h",resolution:"1m",label:"1 Hour"},"6h":{duration:"6h",resolution:"5m",label:"6 Hours"},"24h":{duration:"24h",resolution:"15m",label:"24 Hours"},"7d":{duration:"168h",resolution:"1h",label:"7 Days"}};function zG(){const[e,t]=S.useState("1h"),n=Ap[e],{data:a,error:l,loading:o,refetch:c}=Da(S.useCallback(()=>Ze.getMetricsHistory(n.duration,n.resolution),[n.duration,n.resolution]),6e4),f=a?.data??[],d=E=>{const T=new Date(E);return e==="7d"?T.toLocaleDateString(void 0,{weekday:"short",day:"numeric"}):e==="24h"?T.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):T.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})},h=f.map(E=>({time:d(E.timestamp),requests:E.total_requests,successRate:E.success_rate,avgLatency:E.avg_latency_ms,p99Latency:E.p99_latency_ms,tokensPerSec:E.tokens_per_second})),v=h[h.length-1],p=h.flatMap(E=>[E.avgLatency,E.p99Latency]),b=p.length>0?Math.min(...p):0,x=p.length>0?Math.max(...p):0,O=h.length>0?Math.min(...h.map(E=>E.successRate)):0,j=h.length>0?Math.max(...h.map(E=>E.successRate)):0,_=h.length>0?Math.min(...h.map(E=>E.tokensPerSec)):0,N=h.length>0?Math.max(...h.map(E=>E.tokensPerSec)):0;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(IS,{size:20,className:"text-purple-400"}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Performance trends"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Persisted service signals across one shared time range"})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("div",{className:"flex min-w-0 flex-1 overflow-x-auto rounded-lg bg-slate-800 p-0.5 sm:flex-none",children:Object.keys(Ap).map(E=>g.jsx("button",{onClick:()=>t(E),className:`min-h-10 flex-1 whitespace-nowrap rounded px-2 py-1 text-xs font-medium transition-colors sm:flex-none sm:px-3 ${e===E?"bg-blue-600 text-white":"text-slate-400 hover:text-slate-200"}`,children:Ap[E].label},E))}),g.jsx("button",{type:"button",onClick:c,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",title:"Refresh","aria-label":"Refresh performance trends",children:g.jsx(Pl,{size:16,className:o?"animate-spin":""})})]})]}),l&&g.jsxs("div",{role:"alert",className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-3 py-2 text-sm text-amber-100",children:[g.jsx("span",{children:a?"Showing the last loaded trends; refresh failed.":`Performance trends are unavailable: ${l.message}`}),g.jsx("button",{type:"button",onClick:c,className:"min-h-10 rounded-lg border border-amber-700/70 px-3 text-sm hover:bg-amber-900/30",children:"Try again"})]}),o&&h.length===0?g.jsx("div",{className:"h-64 flex items-center justify-center",children:g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full"})}):h.length<2?g.jsx("div",{className:"h-64 flex items-center justify-center text-slate-400",children:g.jsxs("div",{className:"text-center",children:[g.jsx(IS,{size:32,className:"mx-auto mb-2 opacity-50"}),g.jsx("p",{children:"Not enough historical data yet"}),g.jsx("p",{className:"text-xs mt-1",children:"Data is recorded every minute"})]})}):g.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[g.jsxs("div",{role:"img","aria-label":`Latency ranged from ${b.toFixed(0)} to ${x.toFixed(0)} milliseconds. Latest average ${v?.avgLatency.toFixed(0)} milliseconds and P99 ${v?.p99Latency.toFixed(0)} milliseconds.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Latency (ms)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:E=>[(typeof E=="number"?E.toFixed(1):E)+"ms",""]}),g.jsx($E,{wrapperStyle:{fontSize:"10px"},formatter:E=>g.jsx("span",{className:"text-slate-400",children:E})}),g.jsx(Sl,{type:"monotone",dataKey:"avgLatency",stroke:"#3b82f6",strokeWidth:2,dot:!1,name:"Avg"}),g.jsx(Sl,{type:"monotone",dataKey:"p99Latency",stroke:"#ef4444",strokeWidth:1.5,dot:!1,name:"P99"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Success rate ranged from ${O.toFixed(1)} to ${j.toFixed(1)} percent. Latest ${v?.successRate.toFixed(1)} percent.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Success rate (%)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,domain:[0,100]}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:E=>[(typeof E=="number"?E.toFixed(1):E)+"%","Success Rate"]}),g.jsx(Sl,{type:"monotone",dataKey:"successRate",stroke:"#22c55e",strokeWidth:2,dot:!1,name:"Success Rate"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Throughput ranged from ${_.toFixed(1)} to ${N.toFixed(1)} tokens per second. Latest ${v?.tokensPerSec.toFixed(1)} tokens per second.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Throughput (tokens/sec)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:E=>[typeof E=="number"?E.toFixed(1):E,"Tokens/sec"]}),g.jsx(Sl,{type:"monotone",dataKey:"tokensPerSec",stroke:"#a855f7",strokeWidth:2,dot:!1,name:"Tokens/sec"})]})})})]})]}),g.jsxs("div",{className:"mt-4 text-center text-xs text-slate-400",children:["Showing ",n.label," of data (",n.resolution," resolution)"]})]})}function RG({modelId:e,onClose:t}){const[n,a]=S.useState(null),[l,o]=S.useState(!0),[c,f]=S.useState(null),d=S.useRef(null),h=S.useRef(null),v=S.useRef(null);S.useEffect(()=>{v.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const E=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const T=P=>{if(P.key==="Escape"){P.preventDefault(),t();return}if(P.key!=="Tab"||!d.current)return;const C=Array.from(d.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),M=C[0],L=C[C.length-1];!M||!L||(P.shiftKey&&document.activeElement===M?(P.preventDefault(),L.focus()):!P.shiftKey&&document.activeElement===L&&(P.preventDefault(),M.focus()))};return window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T),document.body.style.overflow=E,v.current?.focus()}},[t]),S.useEffect(()=>{const E=async()=>{o(!0),f(null);try{const P=await Ze.getModelMetrics(e);a(P)}catch(P){f(P instanceof Error?P.message:"Failed to load model metrics")}finally{o(!1)}};E();const T=setInterval(E,5e3);return()=>clearInterval(T)},[e]);const p=E=>E?new Date(E).toLocaleTimeString():"-",b=E=>E<1e3?`${E.toFixed(0)}ms`:`${(E/1e3).toFixed(2)}s`,x=E=>E<1e3?E.toLocaleString():E<1e6?`${(E/1e3).toFixed(1)}K`:`${(E/1e6).toFixed(1)}M`,O=E=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(E),j=n?.price?((n.metrics?.total_tokens_in??0)*n.price.provider_input_price+(n.metrics?.total_tokens_out??0)*n.price.provider_output_price)/1e6:null,_=n?.health?.health_string==="healthy"||n?.model?.health_string==="healthy",N=(n?.recent_requests??[]).slice().reverse().map(E=>({time:p(E.start_time),latency:E.latency_ms}));return g.jsx("div",{ref:d,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-2 sm:p-4",onClick:t,role:"dialog","aria-modal":"true","aria-labelledby":"model-detail-title","aria-describedby":"model-detail-description",children:g.jsxs("div",{className:"max-h-[94vh] w-full max-w-4xl overflow-y-auto rounded-xl border border-slate-700 bg-slate-900",onClick:E=>E.stopPropagation(),children:[g.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{children:[g.jsx("h2",{id:"model-detail-title",className:"break-words text-xl font-semibold text-slate-100",children:e}),g.jsx("p",{id:"model-detail-description",className:"text-sm text-slate-300",children:"Health, usage, pricing, and recent requests"})]}),g.jsx("button",{ref:h,type:"button",onClick:t,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close model details",children:g.jsx(Q_,{"aria-hidden":"true",size:20})})]}),l&&!n?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full mx-auto"}),g.jsx("p",{className:"mt-4 text-slate-400",children:"Loading model metrics..."})]}):c?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx(Pa,{size:32,className:"mx-auto text-red-400 mb-2"}),g.jsx("p",{className:"text-red-400",children:c})]}):g.jsxs("div",{className:"p-4 space-y-6",children:[g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[_?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(Pa,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Health Status"})]}),g.jsx("p",{className:`text-lg font-semibold ${_?"text-green-400":"text-red-400"}`,children:_?"Healthy":"Unhealthy"}),n?.health?.consecutive_fails?g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n.health.consecutive_fails," consecutive failures"]}):null]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(V_,{size:20,className:"text-blue-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Total Requests"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:n?.metrics?.total_requests?.toLocaleString()??0}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.successful_requests??0," successful, ",n?.metrics?.failed_requests??0," failed"]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(T0,{size:20,className:"text-yellow-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Avg Latency"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:b(n?.metrics?.avg_latency_ms??0)}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.active_requests??0," active requests"]})]})]}),g.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[g.jsxs("div",{className:"rounded-lg bg-slate-700/50 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(ZD,{size:20,className:"text-purple-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Token usage"})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center sm:gap-4",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_in??0)}),g.jsx("p",{className:"text-xs text-blue-200",children:"Input tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_out??0)}),g.jsx("p",{className:"text-xs text-violet-200",children:"Output tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:(n?.metrics?.tokens_per_second??0).toFixed(1)}),g.jsx("p",{className:"text-xs text-slate-400",children:"Tokens/sec"})]})]})]}),g.jsxs("div",{className:"rounded-lg border border-emerald-800/50 bg-emerald-950/20 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(lD,{size:20,className:"text-emerald-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Provider payout / 1M tokens"}),n?.price?.tier&&g.jsx("span",{className:"ml-auto rounded-full border border-slate-600 px-2 py-0.5 text-[10px] uppercase tracking-wide text-slate-400",children:n.price.tier})]}),n?.price?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-blue-100",children:O(n.price.provider_input_price)}),g.jsx("p",{className:"text-xs text-blue-300",children:"Input"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-violet-100",children:O(n.price.provider_output_price)}),g.jsx("p",{className:"text-xs text-violet-300",children:"Output"})]})]}),j!==null&&g.jsxs("p",{className:"mt-3 border-t border-emerald-900/60 pt-2 text-xs text-slate-400",children:["Estimated payout for recorded tokens: ",g.jsx("span",{className:"font-medium text-emerald-300",children:O(j)})]})]}):g.jsx("p",{className:"text-sm text-slate-400",children:"Current catalog price is unavailable."})]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-200",children:"Transactions for this model"}),g.jsx("p",{className:"mb-3 mt-1 text-xs text-slate-400",children:"Latest 20 local requests, with input and output tokens shown separately."}),(n?.recent_requests??[]).length===0?g.jsx("p",{className:"text-slate-400 text-center py-4",children:"No transactions recorded for this model"}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"space-y-2 sm:hidden",children:(n?.recent_requests??[]).map(E=>g.jsxs("div",{className:"rounded-lg border border-slate-600 bg-slate-800/60 p-3",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-xs text-slate-300",title:E.request_id,children:E.request_id}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[p(E.start_time)," · ",b(E.latency_ms)]})]}),E.success?g.jsx(wl,{size:16,className:"shrink-0 text-green-400"}):g.jsx(Pa,{size:16,className:"shrink-0 text-red-400"})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[g.jsxs("div",{className:"rounded bg-blue-950/30 px-2 py-1.5 text-blue-200",children:["Input ",g.jsx("span",{className:"float-right font-mono",children:E.tokens_in.toLocaleString()})]}),g.jsxs("div",{className:"rounded bg-violet-950/30 px-2 py-1.5 text-violet-200",children:["Output ",g.jsx("span",{className:"float-right font-mono",children:E.tokens_out.toLocaleString()})]})]})]},E.request_id))}),g.jsx("div",{className:"hidden overflow-x-auto sm:block",children:g.jsxs("table",{className:"w-full text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"text-slate-400 border-b border-slate-600",children:[g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Transaction"}),g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Time"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Latency"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Input"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Output"}),g.jsx("th",{className:"text-center py-2 px-2 font-medium",children:"Status"})]})}),g.jsx("tbody",{children:(n?.recent_requests??[]).map(E=>g.jsxs("tr",{className:"border-b border-slate-600/50",children:[g.jsx("td",{className:"max-w-36 truncate px-2 py-2 font-mono text-xs text-slate-400",title:E.request_id,children:E.request_id}),g.jsx("td",{className:"py-2 px-2 text-slate-300 text-xs",children:p(E.start_time)}),g.jsx("td",{className:"py-2 px-2 text-right font-mono text-xs",children:g.jsx("span",{className:E.latency_ms>5e3?"text-red-400":E.latency_ms>2e3?"text-yellow-400":"text-green-400",children:b(E.latency_ms)})}),g.jsx("td",{className:"py-2 px-2 text-right text-blue-200 font-mono text-xs",children:E.tokens_in.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-right text-violet-200 font-mono text-xs",children:E.tokens_out.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-center",children:E.success?g.jsx(wl,{size:14,className:"inline text-green-400"}):g.jsx(Pa,{size:14,className:"inline text-red-400"})})]},E.request_id))})]})})]})]}),N.length>1&&g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-3",children:"Recent transaction latency"}),g.jsx("div",{className:"h-40",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Dc,{data:N,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,unit:"ms"}),g.jsx(Mc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"}}),g.jsx(Sl,{type:"monotone",dataKey:"latency",stroke:"#3b82f6",strokeWidth:2,dot:{fill:"#3b82f6",strokeWidth:0,r:3},name:"Latency"})]})})})]}),n?.health?.last_error&&g.jsxs("div",{className:"bg-red-900/20 border border-red-800/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(Tf,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Last Error"})]}),g.jsx("p",{className:"text-sm text-red-400 font-mono",children:n.health.last_error})]})]})]})})}function LG({open:e,onClose:t,onAuthenticated:n}){const[a,l]=S.useState(""),[o,c]=S.useState(""),[f,d]=S.useState(!1),h=S.useRef(null),v=S.useRef(null),p=S.useRef(null);if(S.useEffect(()=>{if(!e)return;c(""),p.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const x=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const O=j=>{if(j.key==="Escape"){j.preventDefault(),t();return}if(j.key!=="Tab"||!v.current)return;const _=Array.from(v.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),N=_[0],E=_[_.length-1];!N||!E||(j.shiftKey&&document.activeElement===N?(j.preventDefault(),E.focus()):!j.shiftKey&&document.activeElement===E&&(j.preventDefault(),N.focus()))};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O),document.body.style.overflow=x,p.current?.focus()}},[e,t]),!e)return null;const b=async x=>{if(x.preventDefault(),!!a.trim()){d(!0),c(""),Ze.setAccessToken(a);try{await Ze.getSettings(),l(""),n()}catch(O){Ze.clearAccessToken(),c(O instanceof Error?O.message:"The access token was rejected")}finally{d(!1)}}};return g.jsx("div",{ref:v,className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/80 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-labelledby":"unlock-title","aria-describedby":"unlock-description",onMouseDown:x=>{x.target===x.currentTarget&&t()},children:g.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-slate-700 bg-slate-900 shadow-2xl shadow-black/40",children:[g.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-slate-800 p-5",children:[g.jsxs("div",{className:"flex gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(X_,{"aria-hidden":"true",size:22})}),g.jsxs("div",{children:[g.jsx("h2",{id:"unlock-title",className:"text-lg font-semibold text-white",children:"Unlock operator controls"}),g.jsx("p",{id:"unlock-description",className:"mt-1 text-sm text-slate-300",children:"Monitoring stays read-only until this browser tab is unlocked."})]})]}),g.jsx("button",{type:"button",onClick:t,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close unlock dialog",children:g.jsx(Q_,{"aria-hidden":"true",size:20})})]}),g.jsxs("form",{onSubmit:b,className:"space-y-4 p-5",children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:"control-token",className:"mb-2 block text-sm font-medium text-slate-200",children:"Control token"}),g.jsx("input",{ref:h,id:"control-token",type:"password",autoComplete:"off",value:a,onChange:x=>l(x.target.value),className:"min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 font-mono text-sm text-white outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30",placeholder:"Paste dashboard.token","aria-describedby":"token-help"}),g.jsxs("p",{id:"token-help",className:"mt-2 text-xs leading-5 text-slate-300",children:["On the provider host, read ",g.jsx("code",{className:"rounded bg-slate-800 px-1.5 py-0.5 text-slate-300",children:"$CP_PATH/dashboard.token"}),". The token is kept only for this browser tab."]})]}),o&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/70 bg-red-950/40 px-3 py-2 text-sm text-red-300",children:o}),g.jsxs("div",{className:"flex justify-end gap-3",children:[g.jsx("button",{type:"button",onClick:t,className:"min-h-10 rounded-lg px-4 text-sm text-slate-300 hover:bg-slate-800",children:"Cancel"}),g.jsx("button",{type:"submit",disabled:f||!a.trim(),className:"min-h-10 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",children:f?"Checking…":"Unlock"})]})]})]})})}const $G=[{id:"limits",label:"Limits"},{id:"models",label:"Models"},{id:"alerts",label:"Alerts"},{id:"self-check",label:"Self-check"},{id:"logging",label:"Logging"}],Le="min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 text-sm text-slate-100 outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",$e="mb-1.5 block text-sm font-medium text-slate-200";function UG({restartRequired:e}){return g.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium ${e?"border-amber-800/70 bg-amber-950/40 text-amber-300":"border-emerald-800/70 bg-emerald-950/40 text-emerald-300"}`,children:e?"Restart required":"Applies now"})}function Fu({id:e,title:t,description:n,icon:a,restartRequired:l,dirty:o,children:c}){return g.jsxs("section",{"aria-labelledby":`${e}-title`,className:"scroll-mt-14 overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 border-b border-slate-800 px-4 py-4 sm:px-5",children:[g.jsxs("div",{className:"flex min-w-0 gap-3",children:[g.jsx("div",{className:"mt-0.5 rounded-lg bg-slate-800 p-2 text-blue-400",children:a}),g.jsxs("div",{children:[g.jsx("h2",{id:`${e}-title`,className:"font-semibold text-white",children:t}),g.jsx("p",{className:"mt-1 max-w-2xl text-sm leading-5 text-slate-400",children:n})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o&&g.jsx("span",{className:"inline-flex items-center rounded-full border border-blue-800/70 bg-blue-950/40 px-2.5 py-1 text-xs font-medium text-blue-200",children:"Unsaved"}),g.jsx(UG,{restartRequired:l})]})]}),g.jsx("div",{className:"p-4 sm:p-5",children:c})]})}function Zu({state:e,section:t}){return!e||e.key!==t?null:g.jsx("p",{role:e.type==="error"?"alert":"status",className:`rounded-lg border px-3 py-2 text-sm ${e.type==="error"?"border-red-800/70 bg-red-950/30 text-red-300":"border-emerald-800/70 bg-emerald-950/30 text-emerald-300"}`,children:e.message})}function Qu({checked:e,onChange:t,label:n,description:a}){return g.jsxs("label",{className:"flex min-h-11 cursor-pointer items-start justify-between gap-4 rounded-lg border border-slate-700 bg-slate-950/60 px-3 py-2.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"block text-sm font-medium text-slate-200",children:n}),a&&g.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-slate-400",children:a})]}),g.jsx("input",{type:"checkbox",checked:e,onChange:l=>t(l.target.checked),className:"mt-0.5 h-5 w-5 rounded border-slate-600 bg-slate-900 text-blue-600 focus:ring-2 focus:ring-blue-500"})]})}function Wu({saving:e,label:t="Save settings"}){return g.jsxs("button",{type:"submit",disabled:e,className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-wait disabled:opacity-60",children:[e?g.jsx(Pl,{"aria-hidden":"true",className:"animate-spin",size:16}):g.jsx(CD,{"aria-hidden":"true",size:16}),e?"Saving…":t]})}function qG({authenticated:e,onUnlock:t,onModelsSaved:n,onDirtyChange:a}){const[l,o]=S.useState(null),[c,f]=S.useState(!1),[d,h]=S.useState(""),[v,p]=S.useState(null),[b,x]=S.useState(null),[O,j]=S.useState([]),[_,N]=S.useState(()=>new Set),[E,T]=S.useState(()=>sessionStorage.getItem("computing-provider-restart-pending")==="true"),P=z=>{N(G=>{const ne=new Set(G);return ne.add(z),ne}),x(G=>G?.key===z?null:G)},C=S.useCallback(async()=>{if(e){f(!0),h("");try{const z=await Ze.getSettings();o({...z,models:z.models.map(G=>({...G}))}),j(z.models.map(G=>G.id)),N(new Set)}catch(z){h(z instanceof Error?z.message:"Unable to load settings")}finally{f(!1)}}},[e]);S.useEffect(()=>{e?C():(o(null),N(new Set))},[e,C]),S.useEffect(()=>{const z=_.size>0;a(z);const G=ne=>{z&&(ne.preventDefault(),ne.returnValue="")};return window.addEventListener("beforeunload",G),()=>{window.removeEventListener("beforeunload",G),a(!1)}},[_,a]);const M=async(z,G)=>{p(z),x(null);try{const ne=await G();return x({key:z,type:"success",message:ne.restart_required?"Saved. Restart computing-provider when convenient to apply this section.":"Saved and applied to the running provider."}),N(k=>{const F=new Set(k);return F.delete(z),F}),ne.restart_required&&(sessionStorage.setItem("computing-provider-restart-pending","true"),T(!0)),!0}catch(ne){return x({key:z,type:"error",message:ne instanceof Error?ne.message:"Save failed"}),!1}finally{p(null)}},L=S.useMemo(()=>{if(!l)return 0;const z=new Set(l.models.map(G=>G.id));return O.filter(G=>!z.has(G)).length},[O,l]);if(!e)return g.jsx("div",{className:"mx-auto max-w-2xl py-8 sm:py-16",children:g.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900 p-6 text-center sm:p-10",children:[g.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-blue-500/10 text-blue-400",children:g.jsx(C0,{"aria-hidden":"true",size:24})}),g.jsx("h2",{className:"text-xl font-semibold text-white",children:"Settings are locked"}),g.jsx("p",{className:"mx-auto mt-2 max-w-lg text-sm leading-6 text-slate-400",children:"Unlock this browser tab with the local control token before reading or changing provider configuration. Monitoring remains available without it."}),g.jsxs("button",{type:"button",onClick:t,className:"mt-5 inline-flex min-h-11 items-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white hover:bg-blue-500",children:[g.jsx(X_,{"aria-hidden":"true",size:17})," Unlock settings"]})]})});if(c&&!l)return g.jsxs("div",{className:"flex min-h-64 items-center justify-center text-slate-400",role:"status",children:[g.jsx(Pl,{"aria-hidden":"true",className:"mr-2 animate-spin",size:18})," Loading settings…"]});if(!l)return g.jsxs("div",{className:"rounded-xl border border-red-800/60 bg-red-950/20 p-5",children:[g.jsx("h2",{className:"font-semibold text-red-200",children:"Settings could not be loaded"}),g.jsx("p",{className:"mt-1 text-sm text-red-300",children:d}),g.jsx("button",{type:"button",onClick:C,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]});const Z=z=>{P("alerts"),o(G=>G&&{...G,alerts:{...G.alerts,...z}})},re=z=>{P("self-check"),o(G=>G&&{...G,self_check:{...G.self_check,...z}})},B=z=>{P("logging"),o(G=>G&&{...G,log:{...G.log,...z}})},U=z=>{P("limits"),o(G=>G&&{...G,limits:{...G.limits,...z}})},K=z=>Z({email:{...l.alerts.email,...z}}),ce=(z,G)=>{P("models"),o(ne=>{if(!ne)return ne;const k=ne.models.map((F,ie)=>ie===z?{...F,...G}:F);return{...ne,models:k}})},ue=async z=>{z.preventDefault();const G=l.alerts.email.to.flatMap(k=>k.split(/[\n,]/)).map(k=>k.trim()).filter(Boolean),ne={...l.alerts,email:{...l.alerts.email,to:G}};await M("alerts",()=>Ze.updateAlerts(ne))&&o(k=>k&&{...k,alerts:{...k.alerts,email:{...k.alerts.email,password:"",clear_password:!1,to:G,password_set:ne.email.clear_password?!1:ne.email.password_set||!!ne.email.password}}})},ve=async z=>{z.preventDefault(),!(L>0&&!window.confirm(`Save and remove ${L} model${L===1?"":"s"} from routing?`))&&await M("models",()=>Ze.updateModels(l.models))&&(n(),await C())},H=()=>{_.size>0&&!window.confirm("Reload settings from disk and discard unsaved changes?")||C()},ee=()=>{sessionStorage.removeItem("computing-provider-restart-pending"),T(!1)};return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Provider settings"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Validated edits to config.toml and models.json. Secrets are write-only."})]}),g.jsxs("button",{type:"button",onClick:H,disabled:c,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 hover:bg-slate-800 disabled:opacity-50",children:[g.jsx(D0,{"aria-hidden":"true",className:c?"animate-spin":"",size:16})," Reload from disk"]})]}),g.jsx("nav",{"aria-label":"Settings sections",className:"sticky top-0 z-20 -mx-1 overflow-x-auto rounded-xl border border-slate-800 bg-slate-950/95 p-1 shadow-lg shadow-slate-950/30 backdrop-blur",children:g.jsx("div",{className:"flex min-w-max gap-1",children:$G.map(z=>g.jsxs("button",{type:"button",onClick:()=>document.getElementById(`${z.id}-title`)?.scrollIntoView({behavior:"smooth",block:"start"}),className:"inline-flex min-h-10 items-center rounded-lg px-3 text-sm text-slate-300 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",children:[z.label,_.has(z.id)&&g.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-blue-400","aria-label":"Unsaved changes"})]},z.id))})}),_.size>0&&g.jsxs("p",{role:"status",className:"rounded-lg border border-blue-800/70 bg-blue-950/30 px-4 py-3 text-sm text-blue-100",children:["Unsaved changes in ",_.size," section",_.size===1?"":"s",". Save each marked section before leaving Settings."]}),E&&g.jsxs("div",{role:"status",className:"flex flex-col gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-4 py-3 text-sm text-amber-100 sm:flex-row sm:items-center sm:justify-between",children:[g.jsx("span",{children:"Saved configuration is waiting for a provider-daemon restart before it takes effect."}),g.jsx("button",{type:"button",onClick:ee,className:"min-h-10 self-start rounded-lg border border-amber-700/70 px-3 text-amber-100 hover:bg-amber-900/30 sm:self-auto",children:"Dismiss"})]}),d&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/60 bg-red-950/20 px-4 py-3 text-sm text-red-300",children:d}),g.jsx(Fu,{id:"limits",title:"Request limits",description:"Protect the provider from more work than it can serve. Both values are persisted and applied immediately.",icon:g.jsx(M0,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("limits"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),M("limits",()=>Ze.updateLimits(l.limits))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"requests-per-second",children:"Requests per second"}),g.jsx("input",{id:"requests-per-second",type:"number",min:"0.1",max:"100000",step:"0.1",required:!0,value:l.limits.requests_per_second,onChange:z=>U({requests_per_second:Number(z.target.value)}),className:Le}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Base global rate; GPU-aware adaptation may lower or raise the live rate."})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"max-concurrent",children:"Maximum concurrent requests"}),g.jsx("input",{id:"max-concurrent",type:"number",min:"1",max:"100000",required:!0,value:l.limits.max_concurrent,onChange:z=>U({max_concurrent:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"limits"}),g.jsx(Wu,{saving:v==="limits"})]})]})}),g.jsx(Fu,{id:"models",title:"Model endpoint map",description:"Add, repoint, or remove local inference endpoints. Saving hot-reloads models.json and updates the advertised model list.",icon:g.jsx(kD,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("models"),children:g.jsxs("form",{onSubmit:ve,className:"space-y-4",children:[l.models.length===0?g.jsx("div",{className:"rounded-lg border border-dashed border-slate-700 px-4 py-8 text-center text-sm text-slate-400",children:"No models configured. Add one to begin serving inference."}):g.jsx("div",{className:"space-y-3",children:l.models.map((z,G)=>g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-950/50 p-4",children:[g.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(180px,0.8fr)_minmax(240px,1.2fr)_auto]",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`model-id-${G}`,children:"Model ID"}),g.jsx("input",{id:`model-id-${G}`,required:!0,readOnly:!z.isNew,value:z.id,onChange:ne=>ce(G,{id:ne.target.value}),className:`${Le} font-mono ${z.isNew?"":"cursor-not-allowed bg-slate-900 text-slate-400"}`})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`model-endpoint-${G}`,children:"Endpoint"}),g.jsx("input",{id:`model-endpoint-${G}`,type:"url",required:!0,value:z.endpoint,onChange:ne=>ce(G,{endpoint:ne.target.value}),placeholder:"http://127.0.0.1:8000",className:`${Le} font-mono`})]}),g.jsxs("button",{type:"button",onClick:()=>{window.confirm(`Remove ${z.id||"this model"} from the configuration? The change takes effect when you save.`)&&(P("models"),o(ne=>ne&&{...ne,models:ne.models.filter((k,F)=>F!==G)}))},className:"mt-auto inline-flex min-h-11 items-center justify-center gap-2 rounded-lg border border-red-900/70 px-3 text-sm text-red-300 hover:bg-red-950/40","aria-label":`Remove ${z.id||"new model"}`,children:[g.jsx(HD,{"aria-hidden":"true",size:16})," ",g.jsx("span",{className:"lg:hidden",children:"Remove"})]})]}),g.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`model-category-${G}`,children:"Category"}),g.jsx("input",{id:`model-category-${G}`,required:!0,value:z.category,onChange:ne=>ce(G,{category:ne.target.value}),placeholder:"text-generation",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`local-model-${G}`,children:"Local model name"}),g.jsx("input",{id:`local-model-${G}`,value:z.local_model??"",onChange:ne=>ce(G,{local_model:ne.target.value}),placeholder:"Optional Ollama name",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`context-length-${G}`,children:"Context length"}),g.jsx("input",{id:`context-length-${G}`,type:"number",min:"0",value:z.context_length??0,onChange:ne=>ce(G,{context_length:Number(ne.target.value)}),className:Le})]})]}),g.jsxs("details",{className:"mt-4 rounded-lg border border-slate-800 bg-slate-950/60",children:[g.jsx("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium text-slate-300",children:"Advanced endpoint details"}),g.jsxs("div",{className:"grid gap-4 border-t border-slate-800 p-3 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`gpu-memory-${G}`,children:"GPU memory (MB)"}),g.jsx("input",{id:`gpu-memory-${G}`,type:"number",min:"0",value:z.gpu_memory,onChange:ne=>ce(G,{gpu_memory:Number(ne.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`container-${G}`,children:"Container"}),g.jsx("input",{id:`container-${G}`,value:z.container??"",onChange:ne=>ce(G,{container:ne.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`format-${G}`,children:"Format"}),g.jsx("input",{id:`format-${G}`,value:z.format??"",onChange:ne=>ce(G,{format:ne.target.value}),placeholder:"awq, gguf…",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:`quantization-${G}`,children:"Quantization"}),g.jsx("input",{id:`quantization-${G}`,value:z.quantization??"",onChange:ne=>ce(G,{quantization:ne.target.value}),className:Le})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("label",{className:$e,htmlFor:`endpoint-key-${G}`,children:"Endpoint API key"}),g.jsx("input",{id:`endpoint-key-${G}`,type:"password",autoComplete:"new-password",value:z.api_key??"",onChange:ne=>ce(G,{api_key:ne.target.value,clear_api_key:!1}),placeholder:z.api_key_set?"Configured •••• — leave blank to keep":"Optional write-only replacement",className:Le}),z.api_key_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!z.clear_api_key,onChange:ne=>ce(G,{clear_api_key:ne.target.checked,api_key:""})})," Clear stored endpoint key"]})]})]})]})]},`${z.id}-${G}`))}),g.jsxs("button",{type:"button",onClick:()=>{P("models"),o(z=>z&&{...z,models:[...z.models,{id:"",endpoint:"",gpu_memory:0,category:"text-generation",api_key_set:!1,context_length:0,isNew:!0}]})},className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-dashed border-slate-600 px-3 text-sm text-slate-200 hover:border-blue-500 hover:text-white",children:[g.jsx(jD,{"aria-hidden":"true",size:16})," Add model"]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"models"}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[L>0&&g.jsxs("span",{className:"text-xs text-amber-300",children:[L," removal pending"]}),g.jsx(Wu,{saving:v==="models",label:"Save and hot-reload"})]})]})]})}),g.jsx(Fu,{id:"alerts",title:"Alert delivery",description:"Configure webhook and SMTP delivery. Stored passwords are never returned to the browser.",icon:g.jsx(Y4,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("alerts"),children:g.jsxs("form",{onSubmit:ue,className:"space-y-5",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"webhook-url",children:"Webhook URL"}),g.jsx("input",{id:"webhook-url",type:"url",value:l.alerts.webhook_url,onChange:z=>Z({webhook_url:z.target.value}),placeholder:"https://alerts.example.com/provider",className:Le})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"cooldown",children:"Repeat cooldown (minutes)"}),g.jsx("input",{id:"cooldown",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.cooldown_minutes,onChange:z=>Z({cooldown_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"disconnect-delay",children:"Disconnect alert after (minutes)"}),g.jsx("input",{id:"disconnect-delay",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.disconnect_after_min,onChange:z=>Z({disconnect_after_min:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"failure-threshold",children:"Failure threshold (%)"}),g.jsx("input",{id:"failure-threshold",type:"number",min:"1",max:"100",step:"1",required:!0,value:Math.round(l.alerts.error_rate_threshold*100),onChange:z=>Z({error_rate_threshold:Number(z.target.value)/100}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"minimum-requests",children:"Minimum requests"}),g.jsx("input",{id:"minimum-requests",type:"number",min:"1",required:!0,value:l.alerts.error_rate_min_requests,onChange:z=>Z({error_rate_min_requests:Number(z.target.value)}),className:Le})]})]}),g.jsxs("fieldset",{className:"rounded-xl border border-slate-700 p-4",children:[g.jsx("legend",{className:"px-2 text-sm font-semibold text-slate-200",children:"Email (SMTP)"}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[g.jsxs("div",{className:"sm:col-span-2",children:[g.jsx("label",{className:$e,htmlFor:"smtp-host",children:"SMTP host"}),g.jsx("input",{id:"smtp-host",value:l.alerts.email.host,onChange:z=>K({host:z.target.value}),placeholder:"smtp.example.com",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-port",children:"Port"}),g.jsx("input",{id:"smtp-port",type:"number",min:"1",max:"65535",value:l.alerts.email.port,onChange:z=>K({port:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-username",children:"Username"}),g.jsx("input",{id:"smtp-username",value:l.alerts.email.username,onChange:z=>K({username:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-from",children:"From address"}),g.jsx("input",{id:"smtp-from",type:"email",value:l.alerts.email.from,onChange:z=>K({from:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"smtp-recipients",children:"Recipients"}),g.jsx("textarea",{id:"smtp-recipients",rows:2,value:l.alerts.email.to.join(` `),onChange:z=>K({to:z.target.value.split(` -`)}),placeholder:"One address per line",className:`${Le} py-2`})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:Ue,htmlFor:"smtp-password",children:"SMTP password"}),g.jsx("input",{id:"smtp-password",type:"password",autoComplete:"new-password",value:l.alerts.email.password??"",onChange:z=>K({password:z.target.value,clear_password:!1}),placeholder:l.alerts.email.password_set?"Configured •••• — leave blank to keep":"Write-only password",className:Le}),l.alerts.email.password_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!l.alerts.email.clear_password,onChange:z=>K({clear_password:z.target.checked,password:""})})," Clear password stored in config.toml"]})]})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"alerts"}),g.jsx(Wu,{saving:v==="alerts"})]})]})}),g.jsx(Fu,{id:"self-check",title:"Self-check behavior",description:"Control periodic inference audits and automatic routing recovery.",icon:g.jsx(Z_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("self-check"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),M("self-check",()=>Ze.updateSelfCheck(l.self_check))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.self_check.enable,onChange:z=>re({enable:z}),label:"Periodic self-check",description:"Audit configured models on a schedule."}),g.jsx(Qu,{checked:l.self_check.auto_disable,onChange:z=>re({auto_disable:z}),label:"Auto-disable failing models",description:"Remove repeatedly failing backends from routing."}),g.jsx(Qu,{checked:l.self_check.auto_recover,onChange:z=>re({auto_recover:z}),label:"Auto-recover healthy models",description:"Return recovered backends to routing."})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"self-check-interval",children:"Interval (minutes)"}),g.jsx("input",{id:"self-check-interval",type:"number",min:"1",max:"10080",required:!0,value:l.self_check.interval_minutes,onChange:z=>re({interval_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"failures-before-disable",children:"Failures before disable"}),g.jsx("input",{id:"failures-before-disable",type:"number",min:"1",max:"100",required:!0,value:l.self_check.failures_before_disable,onChange:z=>re({failures_before_disable:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"self-check"}),g.jsx(Wu,{saving:v==="self-check"})]})]})}),g.jsx(Fu,{id:"logging",title:"Logging and retention",description:"Choose log verbosity, destination, rotation, and retention.",icon:g.jsx(F_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("logging"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),M("logging",()=>Ze.updateLogging(l.log))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:Ue,htmlFor:"log-dir",children:"Log directory"}),g.jsx("input",{id:"log-dir",required:!0,value:l.log.dir,onChange:z=>H({dir:z.target.value}),className:`${Le} font-mono`})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-level",children:"Level"}),g.jsx("select",{id:"log-level",value:l.log.level,onChange:z=>H({level:z.target.value}),className:Le,children:["trace","debug","info","warn","error"].map(z=>g.jsx("option",{value:z,children:z},z))})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-max-size",children:"Rotate at (MB)"}),g.jsx("input",{id:"log-max-size",type:"number",min:"1",max:"102400",required:!0,value:l.log.max_size_mb,onChange:z=>H({max_size_mb:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-backups",children:"Backups to keep"}),g.jsx("input",{id:"log-backups",type:"number",min:"1",max:"1000",required:!0,value:l.log.max_backups,onChange:z=>H({max_backups:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-age",children:"Retention days (-1 = forever)"}),g.jsx("input",{id:"log-age",type:"number",min:"-1",max:"36500",required:!0,value:l.log.max_age_days,onChange:z=>H({max_age_days:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.log.compress,onChange:z=>H({compress:z}),label:"Compress rotated logs"}),g.jsx(Qu,{checked:l.log.stdout,onChange:z=>H({stdout:z}),label:"Also write to stdout"})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"logging"}),g.jsx(Wu,{saving:v==="logging"})]})]})}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-slate-800 bg-slate-900/60 px-4 py-3 text-xs text-slate-400",children:[g.jsx(X4,{"aria-hidden":"true",size:15,className:"text-emerald-400"})," All saves are validated server-side and use atomic file replacement."]})]})}function BG({status:e,metrics:t,models:n,dataIssues:a,loading:l}){if(l&&!e&&!t&&!n)return g.jsxs("div",{role:"status",className:"mb-4 flex items-center gap-3 rounded-xl border border-slate-800 bg-slate-900 px-4 py-3",children:[g.jsx("span",{"aria-hidden":"true",className:"h-5 w-5 animate-pulse rounded-full bg-slate-700"}),g.jsxs("div",{children:[g.jsx("p",{className:"font-medium text-slate-200",children:"Checking operational status…"}),g.jsx("p",{className:"mt-0.5 text-sm text-slate-400",children:"Loading connection, model, and capacity signals."})]})]});const o=[];let c="healthy";const f=a.filter(b=>b.error).map(b=>b.label);f.length>0&&(c="warning",o.push(`Stale or unavailable: ${f.join(", ")}`)),e&&!e.connected&&(c="critical",o.push("Disconnected from Swan Inference")),n?.summary.unhealthy&&(c="critical",o.push(`${n.summary.unhealthy} unhealthy model${n.summary.unhealthy===1?"":"s"}`)),n&&n.summary.total===0&&(c="critical",o.push("No models configured"));const d=t?.gpu_metrics.filter(b=>b.temperature_c>=85).length??0;if(d>0&&(c==="healthy"&&(c="warning"),o.push(`${d} GPU${d===1?"":"s"} at or above 85°C`)),t&&t.total_requests>=10){const b=t.failed_requests/t.total_requests;b>=.05&&(c==="healthy"&&(c="warning"),o.push(`${(b*100).toFixed(1)}% session failure rate`))}const h={healthy:{Icon:aD,title:"All operational signals look healthy",copy:n?`${n.summary.ready} of ${n.summary.total} models ready`:"Waiting for model status",className:"border-emerald-800/70 bg-emerald-950/30",iconClass:"text-emerald-300",titleClass:"text-emerald-100"},warning:{Icon:Np,title:"Provider status needs a closer look",copy:o.join(" · "),className:"border-amber-800/70 bg-amber-950/30",iconClass:"text-amber-300",titleClass:"text-amber-100"},critical:{Icon:Pa,title:"Provider needs attention",copy:o.join(" · "),className:"border-red-800/70 bg-red-950/30",iconClass:"text-red-300",titleClass:"text-red-100"}}[c],v=h.Icon,p=`${h.title}. ${h.copy}`;return g.jsxs("div",{role:c==="critical"?"alert":"status",title:p,className:`flex min-w-0 max-w-full items-center gap-2 rounded-lg border px-3 py-1.5 ${h.className}`,children:[g.jsx(v,{"aria-hidden":"true",size:16,className:`shrink-0 ${h.iconClass}`}),g.jsxs("p",{className:`min-w-0 truncate text-sm font-medium ${h.titleClass}`,children:[h.title,h.copy&&g.jsx("span",{className:"ml-2 font-normal text-slate-300",children:h.copy})]}),c!=="healthy"&&g.jsxs("button",{type:"button",onClick:()=>document.getElementById("operations-heading")?.scrollIntoView({behavior:"smooth"}),className:"ml-1 inline-flex shrink-0 items-center gap-1 rounded-md border border-current/30 px-2 py-1 text-xs font-medium text-slate-200 hover:bg-white/5 focus:outline-none focus:ring-2 focus:ring-blue-400",children:["Review ",g.jsx(kc,{"aria-hidden":"true",size:13})]})]})}const yl=5e3,t3=[{id:"overview",label:"Overview",icon:gD},{id:"transactions",label:"Requests",icon:ED},{id:"settings",label:"Settings",icon:F_}];function K_(){const e=window.location.hash.replace("#","");return t3.some(t=>t.id===e)?e:"overview"}function IG(){const[e,t]=S.useState(null),[n,a]=S.useState(K_),[l,o]=S.useState(!1),[c,f]=S.useState(!1),[d,h]=S.useState(!1),{data:v,error:p,loading:b,refreshing:x,refetch:O}=Da(S.useCallback(()=>Ze.getMetrics(),[]),yl),{data:j,error:_,loading:E,refreshing:N,lastUpdated:T,refetch:C}=Da(S.useCallback(()=>Ze.getStatus(),[]),yl),{data:k,error:M,loading:L,refreshing:W,refetch:re}=Da(S.useCallback(()=>Ze.getEarnings(),[]),yl),{data:H,error:$,loading:K,refreshing:ce,refetch:ue}=Da(S.useCallback(()=>Ze.getModels(),[]),yl),{data:ve,error:I,loading:ee,refreshing:z,refetch:G}=Da(S.useCallback(()=>Ze.getRequestManagement(),[]),yl);S.useEffect(()=>{Ze.hasAccessToken()&&Ze.getSettings().then(()=>o(!0)).catch(()=>{Ze.clearAccessToken(),o(!1)})},[]),S.useEffect(()=>{const he=()=>{a(K_()),window.scrollTo({top:0})};return window.addEventListener("hashchange",he),()=>window.removeEventListener("hashchange",he)},[]);const ne=()=>{O(),C(),ue(),G(),re()},P=()=>{Ze.clearAccessToken(),o(!1)},F=S.useCallback(()=>f(!1),[]),ie=S.useCallback(()=>t(null),[]),le=S.useCallback(()=>{o(!0),f(!1)},[]),ye=he=>{n==="settings"&&he!=="settings"&&d&&!window.confirm("Leave settings and discard unsaved changes?")||(a(he),window.history.replaceState(null,"",`#${he}`),window.scrollTo({top:0}),he==="settings"&&!l&&f(!0))},be=x||N||W||ce||z;return g.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100",children:[g.jsxs("header",{className:"border-b border-slate-800 bg-slate-900/95",children:[g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-stretch gap-3 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(zD,{"aria-hidden":"true",size:24})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight text-white sm:text-xl",children:"Provider Console"}),g.jsxs("p",{className:"text-xs text-slate-400",children:["Inference operations",j?.version&&g.jsxs(g.Fragment,{children:[" · ",g.jsxs("span",{title:j.build??void 0,className:"font-mono text-slate-400",children:["v",j.version]})]})]})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2 sm:justify-end sm:gap-3",children:[g.jsx(kG,{status:j,loading:E,error:_,lastUpdated:T}),g.jsxs("button",{type:"button",onClick:ne,disabled:be,className:"inline-flex min-h-10 min-w-10 items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-800 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh dashboard data",children:[g.jsx(Pl,{"aria-hidden":"true",size:16,className:be?"animate-spin":""}),g.jsx("span",{className:"hidden sm:inline",children:be?"Refreshing…":"Refresh"})]}),l?g.jsxs("button",{type:"button",onClick:P,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 px-3 text-sm text-slate-300 transition hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[g.jsx(SD,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Lock"})]}):g.jsxs("button",{type:"button",onClick:()=>f(!0),className:"inline-flex min-h-10 items-center gap-2 rounded-lg bg-blue-600 px-3 text-sm font-medium text-white transition hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-400",children:[g.jsx(C0,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Unlock controls"}),g.jsx("span",{className:"sm:hidden",children:"Unlock"})]})]})]}),g.jsx("nav",{"aria-label":"Dashboard sections",className:"mx-auto max-w-7xl px-4 sm:px-6",children:g.jsx("div",{className:"flex gap-1 overflow-hidden",children:t3.map(he=>{const ut=he.icon,Q=n===he.id;return g.jsxs("button",{type:"button",onClick:()=>ye(he.id),"aria-current":Q?"page":void 0,className:`inline-flex min-h-11 min-w-0 flex-1 items-center justify-center gap-1.5 whitespace-nowrap border-b-2 px-2 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:flex-none sm:gap-2 sm:px-5 sm:text-sm ${Q?"border-blue-500 text-white":"border-transparent text-slate-400 hover:border-slate-700 hover:text-slate-200"}`,children:[g.jsx(ut,{"aria-hidden":"true",size:16}),he.label]},he.id)})})})]}),g.jsxs("main",{className:"mx-auto max-w-7xl px-4 py-5 sm:px-6 sm:py-6",children:[n==="overview"&&g.jsxs("div",{className:"space-y-6",children:[g.jsxs("section",{"aria-labelledby":"provider-health-heading",children:[g.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("h2",{id:"provider-health-heading",className:"text-xl font-semibold text-white",children:"Provider overview"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Current service health, traffic, and earnings."})]}),g.jsx(BG,{status:j,metrics:v,models:H,loading:E||b||K,dataIssues:[{label:"connection",error:_},{label:"metrics",error:p},{label:"models",error:$},{label:"request controls",error:I},{label:"earnings",error:M}]})]}),g.jsx(EG,{metrics:v,loading:b,error:p,earnings:k,earningsError:M,earningsLoading:L})]}),g.jsxs("section",{"aria-labelledby":"operations-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"operations-heading",className:"text-xl font-semibold text-white",children:"Operations"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Model readiness and local resource pressure."})]}),g.jsxs("div",{className:"grid items-start gap-6 lg:grid-cols-2",children:[g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsx(MG,{models:H?.models??[],healthLog:H?.health_log,prices:H?.prices??{},summary:H?.summary,loading:K,error:$,onRefresh:ue,onModelClick:t,authenticated:l,onUnlock:()=>f(!0)}),g.jsx(CG,{data:ve,loading:ee,error:I,onOpenSettings:()=>ye("settings")})]}),g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsxs("section",{"aria-labelledby":"earnings-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"earnings-heading",className:"text-xl font-semibold text-white",children:"Earnings and traffic mix"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Estimated local history and the models contributing to it."})]}),g.jsxs("div",{className:"min-w-0 space-y-4",children:[g.jsx(JD,{models:k?.models}),g.jsx(OG,{earnings:k,loading:L&&!k,error:M})]})]}),g.jsx(NG,{gpus:v?.gpu_metrics??[],loading:b,error:p})]})]})]}),g.jsxs("section",{"aria-labelledby":"performance-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"performance-heading",className:"text-xl font-semibold text-white",children:"Performance"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Persistent trends that remain available after navigation or restart."})]}),g.jsx(zG,{})]})]}),n==="transactions"&&g.jsx(PG,{models:H?.models??[]}),n==="settings"&&g.jsx(qG,{authenticated:l,onUnlock:()=>f(!0),onModelsSaved:ue,onDirtyChange:h})]}),g.jsx("footer",{className:"mt-8 border-t border-slate-800 bg-slate-900 px-4 py-4 sm:px-6",children:g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-2 text-xs text-slate-400",children:[g.jsx("span",{children:"Swan Chain Computing Provider"}),g.jsxs("span",{children:["Core monitoring refreshes every ",yl/1e3,"s"]})]})}),e&&g.jsx(RG,{modelId:e,onClose:ie}),g.jsx(LG,{open:c,onClose:F,onAuthenticated:le})]})}z4.createRoot(document.getElementById("root")).render(g.jsx(S.StrictMode,{children:g.jsx(IG,{})})); +`)}),placeholder:"One address per line",className:`${Le} py-2`})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:$e,htmlFor:"smtp-password",children:"SMTP password"}),g.jsx("input",{id:"smtp-password",type:"password",autoComplete:"new-password",value:l.alerts.email.password??"",onChange:z=>K({password:z.target.value,clear_password:!1}),placeholder:l.alerts.email.password_set?"Configured •••• — leave blank to keep":"Write-only password",className:Le}),l.alerts.email.password_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!l.alerts.email.clear_password,onChange:z=>K({clear_password:z.target.checked,password:""})})," Clear password stored in config.toml"]})]})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"alerts"}),g.jsx(Wu,{saving:v==="alerts"})]})]})}),g.jsx(Fu,{id:"self-check",title:"Self-check behavior",description:"Control periodic inference audits and automatic routing recovery.",icon:g.jsx(Z_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("self-check"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),M("self-check",()=>Ze.updateSelfCheck(l.self_check))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.self_check.enable,onChange:z=>re({enable:z}),label:"Periodic self-check",description:"Audit configured models on a schedule."}),g.jsx(Qu,{checked:l.self_check.auto_disable,onChange:z=>re({auto_disable:z}),label:"Auto-disable failing models",description:"Remove repeatedly failing backends from routing."}),g.jsx(Qu,{checked:l.self_check.auto_recover,onChange:z=>re({auto_recover:z}),label:"Auto-recover healthy models",description:"Return recovered backends to routing."})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"self-check-interval",children:"Interval (minutes)"}),g.jsx("input",{id:"self-check-interval",type:"number",min:"1",max:"10080",required:!0,value:l.self_check.interval_minutes,onChange:z=>re({interval_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"failures-before-disable",children:"Failures before disable"}),g.jsx("input",{id:"failures-before-disable",type:"number",min:"1",max:"100",required:!0,value:l.self_check.failures_before_disable,onChange:z=>re({failures_before_disable:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"self-check"}),g.jsx(Wu,{saving:v==="self-check"})]})]})}),g.jsx(Fu,{id:"logging",title:"Logging and retention",description:"Choose log verbosity, destination, rotation, and retention.",icon:g.jsx(F_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("logging"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),M("logging",()=>Ze.updateLogging(l.log))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:$e,htmlFor:"log-dir",children:"Log directory"}),g.jsx("input",{id:"log-dir",required:!0,value:l.log.dir,onChange:z=>B({dir:z.target.value}),className:`${Le} font-mono`})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-level",children:"Level"}),g.jsx("select",{id:"log-level",value:l.log.level,onChange:z=>B({level:z.target.value}),className:Le,children:["trace","debug","info","warn","error"].map(z=>g.jsx("option",{value:z,children:z},z))})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-max-size",children:"Rotate at (MB)"}),g.jsx("input",{id:"log-max-size",type:"number",min:"1",max:"102400",required:!0,value:l.log.max_size_mb,onChange:z=>B({max_size_mb:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-backups",children:"Backups to keep"}),g.jsx("input",{id:"log-backups",type:"number",min:"1",max:"1000",required:!0,value:l.log.max_backups,onChange:z=>B({max_backups:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:$e,htmlFor:"log-age",children:"Retention days (-1 = forever)"}),g.jsx("input",{id:"log-age",type:"number",min:"-1",max:"36500",required:!0,value:l.log.max_age_days,onChange:z=>B({max_age_days:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.log.compress,onChange:z=>B({compress:z}),label:"Compress rotated logs"}),g.jsx(Qu,{checked:l.log.stdout,onChange:z=>B({stdout:z}),label:"Also write to stdout"})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"logging"}),g.jsx(Wu,{saving:v==="logging"})]})]})}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-slate-800 bg-slate-900/60 px-4 py-3 text-xs text-slate-400",children:[g.jsx(X4,{"aria-hidden":"true",size:15,className:"text-emerald-400"})," All saves are validated server-side and use atomic file replacement."]})]})}function BG({status:e,metrics:t,models:n,dataIssues:a,loading:l}){if(l&&!e&&!t&&!n)return g.jsxs("div",{role:"status",className:"mb-4 flex items-center gap-3 rounded-xl border border-slate-800 bg-slate-900 px-4 py-3",children:[g.jsx("span",{"aria-hidden":"true",className:"h-5 w-5 animate-pulse rounded-full bg-slate-700"}),g.jsxs("div",{children:[g.jsx("p",{className:"font-medium text-slate-200",children:"Checking operational status…"}),g.jsx("p",{className:"mt-0.5 text-sm text-slate-400",children:"Loading connection, model, and capacity signals."})]})]});const o=[];let c="healthy";const f=a.filter(b=>b.error).map(b=>b.label);f.length>0&&(c="warning",o.push(`Stale or unavailable: ${f.join(", ")}`)),e&&!e.connected&&(c="critical",o.push("Disconnected from Swan Inference")),n?.summary.unhealthy&&(c="critical",o.push(`${n.summary.unhealthy} unhealthy model${n.summary.unhealthy===1?"":"s"}`)),n&&n.summary.total===0&&(c="critical",o.push("No models configured"));const d=t?.gpu_metrics.filter(b=>b.temperature_c>=85).length??0;if(d>0&&(c==="healthy"&&(c="warning"),o.push(`${d} GPU${d===1?"":"s"} at or above 85°C`)),t&&t.total_requests>=10){const b=t.failed_requests/t.total_requests;b>=.05&&(c==="healthy"&&(c="warning"),o.push(`${(b*100).toFixed(1)}% session failure rate`))}const h={healthy:{Icon:aD,title:"All operational signals look healthy",copy:n?`${n.summary.ready} of ${n.summary.total} models ready`:"Waiting for model status",className:"border-emerald-800/70 bg-emerald-950/30",iconClass:"text-emerald-300",titleClass:"text-emerald-100"},warning:{Icon:Np,title:"Provider status needs a closer look",copy:o.join(" · "),className:"border-amber-800/70 bg-amber-950/30",iconClass:"text-amber-300",titleClass:"text-amber-100"},critical:{Icon:Pa,title:"Provider needs attention",copy:o.join(" · "),className:"border-red-800/70 bg-red-950/30",iconClass:"text-red-300",titleClass:"text-red-100"}}[c],v=h.Icon,p=`${h.title}. ${h.copy}`;return g.jsxs("div",{role:c==="critical"?"alert":"status",title:p,className:`flex min-w-0 max-w-full items-center gap-2 rounded-lg border px-3 py-1.5 ${h.className}`,children:[g.jsx(v,{"aria-hidden":"true",size:16,className:`shrink-0 ${h.iconClass}`}),g.jsxs("p",{className:`min-w-0 truncate text-sm font-medium ${h.titleClass}`,children:[h.title,h.copy&&g.jsx("span",{className:"ml-2 font-normal text-slate-300",children:h.copy})]}),c!=="healthy"&&g.jsxs("button",{type:"button",onClick:()=>document.getElementById("operations-heading")?.scrollIntoView({behavior:"smooth"}),className:"ml-1 inline-flex shrink-0 items-center gap-1 rounded-md border border-current/30 px-2 py-1 text-xs font-medium text-slate-200 hover:bg-white/5 focus:outline-none focus:ring-2 focus:ring-blue-400",children:["Review ",g.jsx(kc,{"aria-hidden":"true",size:13})]})]})}const yl=5e3,t3=[{id:"overview",label:"Overview",icon:gD},{id:"transactions",label:"Requests",icon:ED},{id:"settings",label:"Settings",icon:F_}];function K_(){const e=window.location.hash.replace("#","");return t3.some(t=>t.id===e)?e:"overview"}function IG(){const[e,t]=S.useState(null),[n,a]=S.useState(K_),[l,o]=S.useState(!1),[c,f]=S.useState(!1),[d,h]=S.useState(!1),{data:v,error:p,loading:b,refreshing:x,refetch:O}=Da(S.useCallback(()=>Ze.getMetrics(),[]),yl),{data:j,error:_,loading:N,refreshing:E,lastUpdated:T,refetch:P}=Da(S.useCallback(()=>Ze.getStatus(),[]),yl),{data:C,error:M,loading:L,refreshing:Z,refetch:re}=Da(S.useCallback(()=>Ze.getEarnings(),[]),yl),{data:B,error:U,loading:K,refreshing:ce,refetch:ue}=Da(S.useCallback(()=>Ze.getModels(),[]),yl),{data:ve,error:H,loading:ee,refreshing:z,refetch:G}=Da(S.useCallback(()=>Ze.getRequestManagement(),[]),yl);S.useEffect(()=>{Ze.hasAccessToken()&&Ze.getSettings().then(()=>o(!0)).catch(()=>{Ze.clearAccessToken(),o(!1)})},[]),S.useEffect(()=>{const he=()=>{a(K_()),window.scrollTo({top:0})};return window.addEventListener("hashchange",he),()=>window.removeEventListener("hashchange",he)},[]);const ne=()=>{O(),P(),ue(),G(),re()},k=()=>{Ze.clearAccessToken(),o(!1)},F=S.useCallback(()=>f(!1),[]),ie=S.useCallback(()=>t(null),[]),le=S.useCallback(()=>{o(!0),f(!1)},[]),ye=he=>{n==="settings"&&he!=="settings"&&d&&!window.confirm("Leave settings and discard unsaved changes?")||(a(he),window.history.replaceState(null,"",`#${he}`),window.scrollTo({top:0}),he==="settings"&&!l&&f(!0))},be=x||E||Z||ce||z;return g.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100",children:[g.jsxs("header",{className:"border-b border-slate-800 bg-slate-900/95",children:[g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-stretch gap-3 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(zD,{"aria-hidden":"true",size:24})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight text-white sm:text-xl",children:"Provider Console"}),g.jsxs("p",{className:"text-xs text-slate-400",children:["Inference operations",j?.version&&g.jsxs(g.Fragment,{children:[" · ",g.jsxs("span",{title:j.build??void 0,className:"font-mono text-slate-400",children:["v",j.version]})]})]})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2 sm:justify-end sm:gap-3",children:[g.jsx(kG,{status:j,loading:N,error:_,lastUpdated:T}),g.jsxs("button",{type:"button",onClick:ne,disabled:be,className:"inline-flex min-h-10 min-w-10 items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-800 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh dashboard data",children:[g.jsx(Pl,{"aria-hidden":"true",size:16,className:be?"animate-spin":""}),g.jsx("span",{className:"hidden sm:inline",children:be?"Refreshing…":"Refresh"})]}),l?g.jsxs("button",{type:"button",onClick:k,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 px-3 text-sm text-slate-300 transition hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[g.jsx(SD,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Lock"})]}):g.jsxs("button",{type:"button",onClick:()=>f(!0),className:"inline-flex min-h-10 items-center gap-2 rounded-lg bg-blue-600 px-3 text-sm font-medium text-white transition hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-400",children:[g.jsx(C0,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Unlock controls"}),g.jsx("span",{className:"sm:hidden",children:"Unlock"})]})]})]}),g.jsx("nav",{"aria-label":"Dashboard sections",className:"mx-auto max-w-7xl px-4 sm:px-6",children:g.jsx("div",{className:"flex gap-1 overflow-hidden",children:t3.map(he=>{const ut=he.icon,W=n===he.id;return g.jsxs("button",{type:"button",onClick:()=>ye(he.id),"aria-current":W?"page":void 0,className:`inline-flex min-h-11 min-w-0 flex-1 items-center justify-center gap-1.5 whitespace-nowrap border-b-2 px-2 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:flex-none sm:gap-2 sm:px-5 sm:text-sm ${W?"border-blue-500 text-white":"border-transparent text-slate-400 hover:border-slate-700 hover:text-slate-200"}`,children:[g.jsx(ut,{"aria-hidden":"true",size:16}),he.label]},he.id)})})})]}),g.jsxs("main",{className:"mx-auto max-w-7xl px-4 py-5 sm:px-6 sm:py-6",children:[n==="overview"&&g.jsxs("div",{className:"space-y-6",children:[g.jsxs("section",{"aria-labelledby":"provider-health-heading",children:[g.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("h2",{id:"provider-health-heading",className:"text-xl font-semibold text-white",children:"Provider overview"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Current service health, traffic, and earnings."})]}),g.jsx(BG,{status:j,metrics:v,models:B,loading:N||b||K,dataIssues:[{label:"connection",error:_},{label:"metrics",error:p},{label:"models",error:U},{label:"request controls",error:H},{label:"earnings",error:M}]})]}),g.jsx(EG,{metrics:v,loading:b,error:p,earnings:C,earningsError:M,earningsLoading:L})]}),g.jsxs("section",{"aria-labelledby":"operations-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"operations-heading",className:"text-xl font-semibold text-white",children:"Operations"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Model readiness and local resource pressure."})]}),g.jsxs("div",{className:"grid items-start gap-6 lg:grid-cols-2",children:[g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsx(MG,{models:B?.models??[],healthLog:B?.health_log,prices:B?.prices??{},summary:B?.summary,loading:K,error:U,onRefresh:ue,onModelClick:t,authenticated:l,onUnlock:()=>f(!0)}),g.jsx(CG,{data:ve,loading:ee,error:H,onOpenSettings:()=>ye("settings")})]}),g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsxs("section",{"aria-labelledby":"earnings-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"earnings-heading",className:"text-xl font-semibold text-white",children:"Earnings and traffic mix"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Estimated local history and the models contributing to it."})]}),g.jsxs("div",{className:"min-w-0 space-y-4",children:[g.jsx(JD,{models:C?.models}),g.jsx(OG,{earnings:C,loading:L&&!C,error:M})]})]}),g.jsx(NG,{gpus:v?.gpu_metrics??[],loading:b,error:p})]})]})]}),g.jsxs("section",{"aria-labelledby":"performance-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"performance-heading",className:"text-xl font-semibold text-white",children:"Performance"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Persistent trends that remain available after navigation or restart."})]}),g.jsx(zG,{})]})]}),n==="transactions"&&g.jsx(PG,{models:B?.models??[]}),n==="settings"&&g.jsx(qG,{authenticated:l,onUnlock:()=>f(!0),onModelsSaved:ue,onDirtyChange:h})]}),g.jsx("footer",{className:"mt-8 border-t border-slate-800 bg-slate-900 px-4 py-4 sm:px-6",children:g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-2 text-xs text-slate-400",children:[g.jsx("span",{children:"Swan Chain Computing Provider"}),g.jsxs("span",{children:["Core monitoring refreshes every ",yl/1e3,"s"]})]})}),e&&g.jsx(RG,{modelId:e,onClose:ie}),g.jsx(LG,{open:c,onClose:F,onAuthenticated:le})]})}z4.createRoot(document.getElementById("root")).render(g.jsx(S.StrictMode,{children:g.jsx(IG,{})})); diff --git a/internal/dashboard/ui/dist/index.html b/internal/dashboard/ui/dist/index.html index aad61edd..619feef7 100644 --- a/internal/dashboard/ui/dist/index.html +++ b/internal/dashboard/ui/dist/index.html @@ -6,7 +6,7 @@ Swan Provider Console - + diff --git a/internal/dashboard/ui/src/components/EarningsChart.tsx b/internal/dashboard/ui/src/components/EarningsChart.tsx index 426bc395..671a7418 100644 --- a/internal/dashboard/ui/src/components/EarningsChart.tsx +++ b/internal/dashboard/ui/src/components/EarningsChart.tsx @@ -138,6 +138,11 @@ export function EarningsChart({ models }: EarningsChartProps) { const colours = useMemo(() => buildModelColours(models), [models]); const points = useMemo(() => data?.points ?? [], [data?.points]); const bucketSeconds = data?.bucket_seconds; + // How much of this window came from the platform's ledger. The provenance + // has to be stated: a bar priced locally and a bar read off the ledger are + // different claims, and only the second reconciles with what is paid. + const authoritativePoints = data?.authoritative_points ?? 0; + const allAuthoritative = points.length > 0 && authoritativePoints === points.length; const peak = points.reduce((m, p) => Math.max(m, p.usd), 0); const activeIndex = hovered ?? (points.length > 0 ? points.length - 1 : null); const active = activeIndex !== null ? points[activeIndex] : null; @@ -334,10 +339,15 @@ export function EarningsChart({ models }: EarningsChartProps) {

diff --git a/internal/dashboard/ui/src/types/index.ts b/internal/dashboard/ui/src/types/index.ts index 3063697c..24eaa68e 100644 --- a/internal/dashboard/ui/src/types/index.ts +++ b/internal/dashboard/ui/src/types/index.ts @@ -251,6 +251,11 @@ export interface EarningsPoint { models?: Record; /** The part of `usd` that could not be assigned to any model. */ unattributed?: number; + /** + * True when this bucket's total came from differencing the platform's own + * lifetime figure, rather than from local token counts at published rates. + */ + authoritative?: boolean; } export interface EarningsSeries { @@ -264,6 +269,8 @@ export interface EarningsSeries { covers?: string; /** Seconds each point spans, so labels match what was aggregated. */ bucket_seconds?: number; + /** How many points came from the platform's ledger rather than local pricing. */ + authoritative_points?: number; } export interface RequestLog {